Redirection - Version 3.3.1

Version Description

  • 24th June 2018 =
  • Add a minimum PHP check for people < 5.4
Download this release

Release Info

Developer johnny5
Plugin Icon 128x128 Redirection
Version 3.3.1
Comparing to
See all releases

Code changes from version 3.3 to 3.3.1

models/match-deprecated.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ abstract class Red_Match {
4
+ public function __construct( $values = '' ) {
5
+ if ( $values ) {
6
+ $this->load( $values );
7
+ }
8
+ }
9
+
10
+ abstract public function save( array $details, $no_target_url = false );
11
+ abstract public function name();
12
+ abstract public function get_target( $url, $matched_url, $regex );
13
+ abstract public function get_data();
14
+ abstract public function load( $values );
15
+
16
+ public function sanitize_url( $url ) {
17
+ // No new lines
18
+ $url = preg_replace( "/[\r\n\t].*?$/s", '', $url );
19
+
20
+ // Clean control codes
21
+ $url = preg_replace( '/[^\PC\s]/u', '', $url );
22
+
23
+ return $url;
24
+ }
25
+
26
+ protected function get_target_regex_url( $matched_url, $target, $url ) {
27
+ return preg_replace( '@' . str_replace( '@', '\\@', $matched_url ) . '@', $target, $url );
28
+ }
29
+
30
+ static function create( $name, $data = '' ) {
31
+ $avail = self::available();
32
+ if ( isset( $avail[ strtolower( $name ) ] ) ) {
33
+ $classname = $name . '_match';
34
+
35
+ if ( ! class_exists( strtolower( $classname ) ) ) {
36
+ include( dirname( __FILE__ ) . '/../matches/' . $avail[ strtolower( $name ) ] );
37
+ }
38
+
39
+ return new $classname( $data );
40
+ }
41
+
42
+ return false;
43
+ }
44
+
45
+ static function all() {
46
+ $data = array();
47
+
48
+ $avail = self::available();
49
+ foreach ( $avail as $name => $file ) {
50
+ $obj = self::create( $name );
51
+ $data[ $name ] = $obj->name();
52
+ }
53
+
54
+ return $data;
55
+ }
56
+
57
+ static function available() {
58
+ return array(
59
+ 'url' => 'url.php',
60
+ 'referrer' => 'referrer.php',
61
+ 'agent' => 'user-agent.php',
62
+ 'login' => 'login.php',
63
+ 'header' => 'http-header.php',
64
+ 'custom' => 'custom-filter.php',
65
+ 'cookie' => 'cookie.php',
66
+ 'role' => 'user-role.php',
67
+ );
68
+ }
69
+ }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://redirection.me/donation/
4
  Tags: redirect, htaccess, 301, 404, seo, permalink, apache, nginx, post, admin
5
  Requires at least: 4.5
6
  Tested up to: 4.9.6
7
- Stable tag: 3.3
8
  Requires PHP: 5.4
9
  License: GPLv3
10
 
@@ -136,6 +136,9 @@ The plugin works in a similar manner to how WordPress handles permalinks and sho
136
 
137
  == Changelog ==
138
 
 
 
 
139
  = 3.3 - 24th June 2018 =
140
  * Add user role/capability match
141
  * Add fix for IP blocking plugins
4
  Tags: redirect, htaccess, 301, 404, seo, permalink, apache, nginx, post, admin
5
  Requires at least: 4.5
6
  Tested up to: 4.9.6
7
+ Stable tag: 3.3.1
8
  Requires PHP: 5.4
9
  License: GPLv3
10
 
136
 
137
  == Changelog ==
138
 
139
+ = 3.3.1 - 24th June 2018 =
140
+ * Add a minimum PHP check for people < 5.4
141
+
142
  = 3.3 - 24th June 2018 =
143
  * Add user role/capability match
144
  * Add fix for IP blocking plugins
redirection-admin.php CHANGED
@@ -360,6 +360,17 @@ class Redirection_Admin {
360
  return true;
361
  }
362
 
 
 
 
 
 
 
 
 
 
 
 
363
  private function check_tables_exist() {
364
  include_once dirname( REDIRECTION_FILE ) . '/models/database.php';
365
 
@@ -390,6 +401,10 @@ class Redirection_Admin {
390
 
391
  Redirection_Admin::update();
392
 
 
 
 
 
393
  if ( $this->check_minimum_wp() === false ) {
394
  return;
395
  }
360
  return true;
361
  }
362
 
363
+ private function check_minimum_php() {
364
+ if ( version_compare( PHP_VERSION, '5.4' ) < 0 ) {
365
+ ?>
366
+ <div class="error">
367
+ <h1><?php _e( 'Unable to load Redirection', 'redirection' ); ?></h1>
368
+ <p style="text-align: left"><?php printf( __( 'Redirection requires PHP v%1s, you are using v%2s - please update your PHP', 'redirection' ), '5.4', PHP_VERSION ); ?></p>
369
+ </div>
370
+ <?php
371
+ }
372
+ }
373
+
374
  private function check_tables_exist() {
375
  include_once dirname( REDIRECTION_FILE ) . '/models/database.php';
376
 
401
 
402
  Redirection_Admin::update();
403
 
404
+ if ( $this->check_minimum_php() === false ) {
405
+ return;
406
+ }
407
+
408
  if ( $this->check_minimum_wp() === false ) {
409
  return;
410
  }
redirection-version.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
 
3
- define( 'REDIRECTION_VERSION', '3.3' );
4
- define( 'REDIRECTION_BUILD', '5e2fd33ef11a377ea0813370ddb5fd1d' );
5
  define( 'REDIRECTION_MIN_WP', '4.5' );
1
  <?php
2
 
3
+ define( 'REDIRECTION_VERSION', '3.3.1' );
4
+ define( 'REDIRECTION_BUILD', 'c2b766d11e00020c4a8cb5e565c6b2e7' );
5
  define( 'REDIRECTION_MIN_WP', '4.5' );
redirection.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Redirection v3.3 */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=56)}([function(e,t,n){"use strict";e.exports=n(54)},function(e,t,n){var r=n(45),o=new r;e.exports={numberFormat:o.numberFormat.bind(o),translate:o.translate.bind(o),configure:o.configure.bind(o),setLocale:o.setLocale.bind(o),getLocale:o.getLocale.bind(o),getLocaleSlug:o.getLocaleSlug.bind(o),addTranslations:o.addTranslations.bind(o),reRenderTranslations:o.reRenderTranslations.bind(o),registerComponentUpdateHook:o.registerComponentUpdateHook.bind(o),registerTranslateHook:o.registerTranslateHook.bind(o),state:o.state,stateObserver:o.stateObserver,on:o.stateObserver.on.bind(o.stateObserver),off:o.stateObserver.removeListener.bind(o.stateObserver),emit:o.stateObserver.emit.bind(o.stateObserver),$this:o,I18N:r}},function(e,t,n){e.exports=n(36)()},function(e,t,n){var r;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
@@ -14,7 +14,7 @@
14
  object-assign
15
  (c) Sindre Sorhus
16
  @license MIT
17
- */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,l=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var u in n=Object(arguments[s]))o.call(n,u)&&(l[u]=n[u]);if(r){i=r(n);for(var c=0;c<i.length;c++)a.call(n,i[c])&&(l[i[c]]=n[i[c]])}}return l}},function(e,t){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=13)}([function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var n=e.exports={version:"2.5.0"};"number"==typeof __e&&(__e=n)},function(e,t,n){e.exports=!n(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(32)("wks"),o=n(9),a=n(0).Symbol,i="function"==typeof a;(e.exports=function(e){return r[e]||(r[e]=i&&a[e]||(i?a:o)("Symbol."+e))}).store=r},function(e,t,n){var r=n(0),o=n(2),a=n(8),i=n(22),l=n(10),s=function(e,t,n){var u,c,p,f,d=e&s.F,h=e&s.G,m=e&s.S,g=e&s.P,b=e&s.B,y=h?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,v=h?o:o[t]||(o[t]={}),E=v.prototype||(v.prototype={});for(u in h&&(n=t),n)p=((c=!d&&y&&void 0!==y[u])?y:n)[u],f=b&&c?l(p,r):g&&"function"==typeof p?l(Function.call,p):p,y&&i(y,u,p,e&s.U),v[u]!=p&&a(v,u,f),g&&E[u]!=p&&(E[u]=p)};r.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t,n){var r=n(16),o=n(21);e.exports=n(3)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(24);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(28),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return n.some(function(e){var t=e.trim();return"."===t.charAt(0)?r.toLowerCase().endsWith(t.toLowerCase()):/\/\*$/.test(t)?a===t.replace(/\/.*$/,""):o===t})}return!0},n(14),n(34)},function(e,t,n){n(15),e.exports=n(2).Array.some},function(e,t,n){"use strict";var r=n(7),o=n(25)(3);r(r.P+r.F*!n(33)([].some,!0),"Array",{some:function(e){return o(this,e,arguments[1])}})},function(e,t,n){var r=n(17),o=n(18),a=n(20),i=Object.defineProperty;t.f=n(3)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),o)try{return i(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(1);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(3)&&!n(4)(function(){return 7!=Object.defineProperty(n(19)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(1),o=n(0).document,a=r(o)&&r(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},function(e,t,n){var r=n(1);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(0),o=n(8),a=n(23),i=n(9)("src"),l=Function.toString,s=(""+l).split("toString");n(2).inspectSource=function(e){return l.call(e)},(e.exports=function(e,t,n,l){var u="function"==typeof n;u&&(a(n,"name")||o(n,"name",t)),e[t]!==n&&(u&&(a(n,i)||o(n,i,e[t]?""+e[t]:s.join(String(t)))),e===r?e[t]=n:l?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[i]||l.call(this)})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(10),o=n(26),a=n(27),i=n(12),l=n(29);e.exports=function(e,t){var n=1==e,s=2==e,u=3==e,c=4==e,p=6==e,f=5==e||p,d=t||l;return function(t,l,h){for(var m,g,b=a(t),y=o(b),v=r(l,h,3),E=i(y.length),w=0,_=n?d(t,E):s?d(t,0):void 0;E>w;w++)if((f||w in y)&&(g=v(m=y[w],w,b),e))if(n)_[w]=g;else if(g)switch(e){case 3:return!0;case 5:return m;case 6:return w;case 2:_.push(m)}else if(c)return!1;return p?-1:u||c?c:_}}},function(e,t,n){var r=n(5);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(11);e.exports=function(e){return Object(r(e))}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(30);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(1),o=n(31),a=n(6)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[a])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){var r=n(5);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(0),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){n(35),e.exports=n(2).String.endsWith},function(e,t,n){"use strict";var r=n(7),o=n(12),a=n(36),i="".endsWith;r(r.P+r.F*n(38)("endsWith"),"String",{endsWith:function(e){var t=a(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(t.length),l=void 0===n?r:Math.min(o(n),r),s=String(e);return i?i.call(t,s,l):t.slice(l-s.length,l)===s}})},function(e,t,n){var r=n(37),o=n(11);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(e))}},function(e,t,n){var r=n(1),o=n(5),a=n(6)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(6)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}}])},function(e,t,n){"use strict";var r=n(4).compose;t.__esModule=!0,t.composeWithDevTools=function(){if(0!==arguments.length)return"object"==typeof arguments[0]?r:r.apply(null,arguments)},t.devToolsEnhancer=function(){return function(e){return e}}},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(this,n(10))},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a=Object.defineProperty,i=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,s=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,c=u&&u(Object);e.exports=function e(t,n,p){if("string"!=typeof n){if(c){var f=u(n);f&&f!==c&&e(t,f,p)}var d=i(n);l&&(d=d.concat(l(n)));for(var h=0;h<d.length;++h){var m=d[h];if(!(r[m]||o[m]||p&&p[m])){var g=s(n,m);try{a(t,m,g)}catch(e){}}}return t}return t}},function(e,t,n){"use strict";e.exports=n(46)},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(53)},function(e,t){function n(e){var t,r=function(){};function o(e,t,n){e&&e.then?e.then(function(e){o(e,t,n)}).catch(function(e){o(e,n,n)}):t(e)}function a(e){t=function(t,n){try{e(t,n)}catch(e){n(e)}},r(),r=void 0}function i(e){a(function(t,n){n(e)})}function l(e){a(function(t){t(e)})}function s(e,n){var o=r;r=function(){o(),t(e,n)}}function u(e){!t&&o(e,l,i)}function c(e){!t&&o(e,i,i)}var p={then:function(e){var r=t||s;return n(function(t,n){r(function(n){t(e(n))},n)})},catch:function(e){var r=t||s;return n(function(t,n){r(t,function(t){n(e(t))})})},resolve:u,reject:c};try{e&&e(u,c)}catch(e){c(e)}return p}n.resolve=function(e){return n(function(t){t(e)})},n.reject=function(e){return n(function(t,n){n(e)})},n.race=function(e){return e=e||[],n(function(t,n){var r=e.length;if(!r)return t();for(var o=0;o<r;++o){var a=e[o];a&&a.then&&a.then(t).catch(n)}})},n.all=function(e){return e=e||[],n(function(t,n){var r=e.length,o=r;if(!r)return t();function a(){--o<=0&&t(e)}function i(t,r){t&&t.then?t.then(function(t){e[r]=t,a()}).catch(n):a()}for(var l=0;l<r;++l)i(e[l],l)})},void 0!==e&&e.exports&&(e.exports=n)},function(e,t,n){"use strict";n.r(t);var r=n(22),o=n.n(r);n(55);!window.Promise&&(window.Promise=o.a),Array.from||(Array.from=function(e){return[].slice.call(e)}),"function"!=typeof Object.assign&&(Object.assign=function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(void 0!==r&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],o=0;o<n;){var a=t[o];if(e.call(r,a,o,t))return a;o++}}});var a=n(0),i=n.n(a),l=n(21),s=n.n(l),u=n(20),c=n(1),p=n.n(c),f=n(2),d=n.n(f),h=d.a.shape({trySubscribe:d.a.func.isRequired,tryUnsubscribe:d.a.func.isRequired,notifyNestedSubs:d.a.func.isRequired,isSubscribed:d.a.func.isRequired}),m=d.a.shape({subscribe:d.a.func.isRequired,dispatch:d.a.func.isRequired,getState:d.a.func.isRequired});var g=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"store",n=arguments[1]||t+"Subscription",r=function(e){function r(n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o));return a[t]=n.store,a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,e),r.prototype.getChildContext=function(){var e;return(e={})[t]=this[t],e[n]=null,e},r.prototype.render=function(){return a.Children.only(this.props.children)},r}(a.Component);return r.propTypes={store:m.isRequired,children:d.a.element.isRequired},r.childContextTypes=((e={})[t]=m.isRequired,e[n]=h,e),r}(),b=n(19),y=n.n(b),v=n(9),E=n.n(v);var w=null,_={notify:function(){}};var O=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.store=t,this.parentSub=n,this.onStateChange=r,this.unsubscribe=null,this.listeners=_}return e.prototype.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},e.prototype.notifyNestedSubs=function(){this.listeners.notify()},e.prototype.isSubscribed=function(){return Boolean(this.unsubscribe)},e.prototype.trySubscribe=function(){var e,t;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=(e=[],t=[],{clear:function(){t=w,e=w},notify:function(){for(var n=e=t,r=0;r<n.length;r++)n[r]()},get:function(){return t},subscribe:function(n){var r=!0;return t===e&&(t=e.slice()),t.push(n),function(){r&&e!==w&&(r=!1,t===e&&(t=e.slice()),t.splice(t.indexOf(n),1))}}}))},e.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=_)},e}(),x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var k=0,S={};function C(){}function j(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.getDisplayName,i=void 0===o?function(e){return"ConnectAdvanced("+e+")"}:o,l=r.methodName,s=void 0===l?"connectAdvanced":l,u=r.renderCountProp,c=void 0===u?void 0:u,p=r.shouldHandleStateChanges,f=void 0===p||p,d=r.storeKey,g=void 0===d?"store":d,b=r.withRef,v=void 0!==b&&b,w=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(r,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),_=g+"Subscription",j=k++,P=((t={})[g]=m,t[_]=h,t),T=((n={})[_]=h,n);return function(t){E()("function"==typeof t,"You must pass a component to the function returned by "+s+". Instead received "+JSON.stringify(t));var n=t.displayName||t.name||"Component",r=i(n),o=x({},w,{getDisplayName:i,methodName:s,renderCountProp:c,shouldHandleStateChanges:f,storeKey:g,withRef:v,displayName:r,wrappedComponentName:n,WrappedComponent:t}),l=function(n){function i(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,n.call(this,e,t));return o.version=j,o.state={},o.renderCount=0,o.store=e[g]||t[g],o.propsMode=Boolean(e[g]),o.setWrappedInstance=o.setWrappedInstance.bind(o),E()(o.store,'Could not find "'+g+'" in either the context or props of "'+r+'". Either wrap the root component in a <Provider>, or explicitly pass "'+g+'" as a prop to "'+r+'".'),o.initSelector(),o.initSubscription(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,n),i.prototype.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[_]=t||this.context[_],e},i.prototype.componentDidMount=function(){f&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},i.prototype.componentWillReceiveProps=function(e){this.selector.run(e)},i.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},i.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=C,this.store=null,this.selector.run=C,this.selector.shouldComponentUpdate=!1},i.prototype.getWrappedInstance=function(){return E()(v,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+s+"() call."),this.wrappedInstance},i.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},i.prototype.initSelector=function(){var t=e(this.store.dispatch,o);this.selector=function(e,t){var n={run:function(r){try{var o=e(t.getState(),r);(o!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=o,n.error=null)}catch(e){n.shouldComponentUpdate=!0,n.error=e}}};return n}(t,this.store),this.selector.run(this.props)},i.prototype.initSubscription=function(){if(f){var e=(this.propsMode?this.props:this.context)[_];this.subscription=new O(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},i.prototype.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(S)):this.notifyNestedSubs()},i.prototype.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},i.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},i.prototype.addExtraProps=function(e){if(!(v||c||this.propsMode&&this.subscription))return e;var t=x({},e);return v&&(t.ref=this.setWrappedInstance),c&&(t[c]=this.renderCount++),this.propsMode&&this.subscription&&(t[_]=this.subscription),t},i.prototype.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(a.createElement)(t,this.addExtraProps(e.props))},i}(a.Component);return l.WrappedComponent=t,l.displayName=r,l.childContextTypes=T,l.contextTypes=P,l.propTypes=P,y()(l,t)}}var P=Object.prototype.hasOwnProperty;function T(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function N(e,t){if(T(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!P.call(t,n[o])||!T(e[n[o]],t[n[o]]))return!1;return!0}var R=n(4),D=n(17),A="object"==typeof self&&self&&self.Object===Object&&self,I=(D.a||A||Function("return this")()).Symbol,L=Object.prototype;L.hasOwnProperty,L.toString,I&&I.toStringTag;Object.prototype.toString;I&&I.toStringTag;Object.getPrototypeOf,Object;var U=Function.prototype,F=Object.prototype,M=U.toString;F.hasOwnProperty,M.call(Object);function B(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function z(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function G(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=z(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=z(o),o=r(t,n)),o},r}}var W=[function(e){return"function"==typeof e?G(e):void 0},function(e){return e?void 0:B(function(e){return{dispatch:e}})},function(e){return e&&"object"==typeof e?B(function(t){return Object(R.bindActionCreators)(e,t)}):void 0}];var H=[function(e){return"function"==typeof e?G(e):void 0},function(e){return e?void 0:B(function(){return{}})}],V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function q(e,t,n){return V({},n,e,t)}var $=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r=n.pure,o=n.areMergedPropsEqual,a=!1,i=void 0;return function(t,n,l){var s=e(t,n,l);return a?r&&o(s,i)||(i=s):(a=!0,i=s),i}}}(e):void 0},function(e){return e?void 0:function(){return q}}];function K(e,t,n,r){return function(o,a){return n(e(o,a),t(r,a),a)}}function Q(e,t,n,r,o){var a=o.areStatesEqual,i=o.areOwnPropsEqual,l=o.areStatePropsEqual,s=!1,u=void 0,c=void 0,p=void 0,f=void 0,d=void 0;function h(o,s){var h,m,g=!i(s,c),b=!a(o,u);return u=o,c=s,g&&b?(p=e(u,c),t.dependsOnOwnProps&&(f=t(r,c)),d=n(p,f,c)):g?(e.dependsOnOwnProps&&(p=e(u,c)),t.dependsOnOwnProps&&(f=t(r,c)),d=n(p,f,c)):b?(h=e(u,c),m=!l(h,p),p=h,m&&(d=n(p,f,c)),d):d}return function(o,a){return s?h(o,a):(p=e(u=o,c=a),f=t(r,c),d=n(p,f,c),s=!0,d)}}function Y(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,a=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),i=n(e,a),l=r(e,a),s=o(e,a);return(a.pure?Q:K)(i,l,s,e,a)}var J=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function X(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function Z(e,t){return e===t}var ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.connectHOC,n=void 0===t?j:t,r=e.mapStateToPropsFactories,o=void 0===r?H:r,a=e.mapDispatchToPropsFactories,i=void 0===a?W:a,l=e.mergePropsFactories,s=void 0===l?$:l,u=e.selectorFactory,c=void 0===u?Y:u;return function(e,t,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=a.pure,u=void 0===l||l,p=a.areStatesEqual,f=void 0===p?Z:p,d=a.areOwnPropsEqual,h=void 0===d?N:d,m=a.areStatePropsEqual,g=void 0===m?N:m,b=a.areMergedPropsEqual,y=void 0===b?N:b,v=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=X(e,o,"mapStateToProps"),w=X(t,i,"mapDispatchToProps"),_=X(r,s,"mergeProps");return n(c,J({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:w,initMergeProps:_,pure:u,areStatesEqual:f,areOwnPropsEqual:h,areStatePropsEqual:g,areMergedPropsEqual:y},v))}}(),te=n(16);function ne(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var re=ne();re.withExtraArgument=ne;var oe=re,ae="SETTING_LOAD_START",ie="SETTING_LOAD_SUCCESS",le="SETTING_LOAD_FAILED",se="SETTING_LOAD_STATUS",ue="SETTING_SAVING",ce="SETTING_SAVED",pe="SETTING_SAVE_FAILED",fe="STATUS_IN_PROGRESS",de="STATUS_FAILED",he="STATUS_COMPLETE",me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var ge="LOG_LOADING",be="LOG_LOADED",ye="LOG_FAILED",ve="LOG_SET_SELECTED",Ee="LOG_SET_ALL_SELECTED",we="LOG_ITEM_SAVING",_e="LOG_ITEM_SAVED",Oe="LOG_ITEM_FAILED",xe="log",ke=n(5),Se=n.n(ke),Ce=["groups","404s","log","io","options","support"];function je(e,t){history.pushState({},null,function(e,t,n){var r=Pe(n);for(var o in e)e[o]&&t[o]!==e[o]?r[o.toLowerCase()]=e[o]:t[o]===e[o]&&delete r[o.toLowerCase()];r.filterby&&!r.filter&&delete r.filterby;return"?"+ke.stringify(r)}(e,t))}function Pe(e){return ke.parse(e?e.slice(1):document.location.search.slice(1))}function Te(e){var t=Pe(e);return-1!==Ce.indexOf(t.sub)?t.sub:"redirect"}var Ne=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Re=["orderby","direction","page","per_page","filter","filterBy"],De=function(e,t){for(var n=[],r=0;r<e.length;r++)-1===t.indexOf(e[r])&&n.push(e[r]);return n},Ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=Pe(),a={orderby:n,direction:"desc",page:0,per_page:parseInt(Redirectioni10n.per_page,10),selected:[],filterBy:"",filter:""},i=void 0===o.sub?"":o.sub;return-1===r.indexOf(i)?a:Ne({},a,{orderby:o.orderby&&-1!==e.indexOf(o.orderby)?o.orderby:a.orderby,direction:o.direction&&"asc"===o.direction?"asc":a.direction,page:o.offset&&parseInt(o.offset,10)>0?parseInt(o.offset,10):a.page,per_page:Redirectioni10n.per_page?parseInt(Redirectioni10n.per_page,10):a.per_page,filterBy:o.filterby&&-1!==t.indexOf(o.filterby)?o.filterby:a.filterBy,filter:o.filter?o.filter:a.filter})},Ie=function(e,t){for(var n=Object.assign({},e),r=0;r<Re.length;r++)void 0!==t[Re[r]]&&(n[Re[r]]=t[Re[r]]);return n},Le=function(e,t){return"desc"===e.direction&&delete e.direction,e.orderby===t&&delete e.orderby,0===e.page&&delete e.page,e.per_page===parseInt(Redirectioni10n.per_page,10)&&delete e.per_page,""===e.filterBy&&""===e.filter&&(delete e.filterBy,delete e.filter),25!==parseInt(Redirectioni10n.per_page,10)&&(e.per_page=parseInt(Redirectioni10n.per_page,10)),delete e.selected,e},Ue=function(e){return Object.assign({},e,{selected:[]})},Fe=function(e,t){return Ne({},e,{selected:De(e.selected,t).concat(De(t,e.selected))})},Me=function(e,t,n){return Ne({},e,{selected:n?t.map(function(e){return e.id}):[]})},Be=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ze=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Redirectioni10n.WP_API_root+"redirection/v1/"+e+"/";if(n._wpnonce=Redirectioni10n.WP_API_nonce,n&&Object.keys(n).length>0&&(t=n,n=Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){return e[n]=t[n],e},{}),Object.keys(n).length>0)){var o=r+(-1===Redirectioni10n.WP_API_root.indexOf("?")?"?":"&")+Se.a.stringify(n);return-1!==Redirectioni10n.WP_API_root.indexOf("page=redirection.php")?o.replace(/page=(\d+)/,"ppage=$1"):o}return r},Ge=function(e){return{url:e,headers:function(e){return-1!==e.indexOf("rest_route")||-1!==e.indexOf("/wp-json/")?new Headers({"Content-Type":"application/json; charset=utf-8"}):new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"})}(e),credentials:"same-origin"}},We=function(e,t){return Be({},Ge(ze(e,t)),{method:"post"})},He=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Be({},Ge(ze(e,t)),{method:"get"})},Ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Be({},Ge(ze(e,n)),{method:"post",params:t});return Object.keys(t).length>0&&(r.body=JSON.stringify(t)),r},qe={get:function(){return He("setting")},update:function(e){return Ve("setting",e)}},$e={list:function(e){return He("redirect",e)},update:function(e,t){return Ve("redirect/"+e,t)},create:function(e){return Ve("redirect",e)}},Ke={list:function(e){return He("group",e)},update:function(e,t){return Ve("group/"+e,t)},create:function(e){return Ve("group",e)}},Qe={list:function(e){return He("log",e)},deleteAll:function(e){return We("log",e)}},Ye={list:function(e){return He("404",e)},deleteAll:function(e){return We("404",e)}},Je={get:function(){return He("import")},upload:function(e,t){return function(e,t){var n=Be({},Ge(ze(e)),{method:"post"});return n.headers.delete("Content-Type"),n.body=new FormData,n.body.append("file",t),n}("import/file/"+e,t)},pluginList:function(){return He("import/plugin")},pluginImport:function(e){return Ve("import/plugin/"+e)}},Xe={file:function(e,t){return He("export/"+e+"/"+t)}},Ze={status:function(){return He("plugin")},fix:function(){return Ve("plugin")},delete:function(){return We("plugin/delete")}},et={redirect:function(e,t,n){return Ve("bulk/redirect/"+e,t,n)},group:function(e,t,n){return Ve("bulk/group/"+e,t,n)},log:function(e,t,n){return Ve("bulk/log/"+e,t,n)},error:function(e,t,n){return Ve("bulk/404/"+e,t,n)}},tt=function(e){return"https://api.redirect.li/v1/"+e+(-1===e.indexOf("?")?"?":"&")+"ref=redirection"},nt={getGeo:function(e){return{url:tt("ip/"+e+"?locale="+Redirectioni10n.localeSlug.substr(0,2)),method:"get"}}},rt={get:function(e){return{url:tt("useragent/"+encodeURIComponent(e)),method:"get"}}},ot=function(e){return e.action=function(e){return e.url.replace(Redirectioni10n.WP_API_root,"").replace(/[\?&]_wpnonce=[a-f0-9]*/,"")+" "+e.method.toUpperCase()}(e),fetch(e.url,e).then(function(t){if(!t||!t.status)throw{message:"No data or status object returned in request",code:0};return t.status&&void 0!==t.statusText&&(e.status=t.status,e.statusText=t.statusText),t.headers.get("x-wp-nonce")&&(Redirectioni10n.WP_API_nonce=t.headers.get("x-wp-nonce")),t.text()}).then(function(t){e.raw=t;try{var n=JSON.parse(t.replace(/\ufeff/,""));if(e.status&&200!==e.status)throw{message:function(e){return 0===e?"Admin AJAX returned 0":e.message?e.message:"Unknown error "+e}(n),code:function(e){return e.error_code?e.error_code:e.data&&e.data.error_code?e.data.error_code:0===e?"admin-ajax":e.code?e.code:"unknown"}(n),request:e,data:n.data?n.data:null};if(0===n)throw{message:"Failed to get data",code:"json-zero"};return n}catch(t){throw t.request=e,t}})},at=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function it(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var lt=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return function(a,i){var l=i()[r.store],s=l.table,u=l.total,p={items:n?[n]:s.selected,bulk:t};if("delete"===t&&s.page>0&&s.per_page*s.page==u-1&&(s.page-=1),"delete"!==t||confirm(Object(c.translate)("Are you sure you want to delete this item?","Are you sure you want to delete these items?",{count:p.items.length}))){var f=Ie(s,p),d=at({items:p.items.join(",")},o);return ot(e(t,d,Le(s,r.order))).then(function(e){a(at({type:r.saved},e,{saving:p.items}))}).catch(function(e){a({type:r.failed,error:e,saving:p.items})}),a({type:r.saving,table:f,saving:p.items})}}},st=function(e,t,n,r,o){return ot(e).then(function(e){o({type:r.saved,item:e.item,items:e.items,total:e.total,saving:[n.id]})}).catch(function(e){o({type:r.failed,error:e,item:n,saving:[n.id]})}),o({type:r.saving,table:t,item:n,saving:[n.id]})},ut=function(e,t,n){return function(r,o){var a=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(o()[n.store],[]);return a.page=0,a.orderby="id",a.direction="desc",st(e(t),a,t,n,r)}},ct=function(e,t,n,r){return function(o,a){var i=a()[r.store].table;return st(e(t,n),i,n,r,o)}},pt=function(e,t){for(var n in e)if(e[n]!==t[n])return!1;return!0},ft=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(e){return e},i=o.table,l=void 0===i?{}:i,s=o.rows,u=a(Ie(l,r)),c=Le(at({},l,r),n.order);if(!(pt(u,l)&&s.length>0&&pt(r,{})))return ot(e(c)).then(function(e){t(at({type:n.saved},e))}).catch(function(e){t({type:n.failed,error:e})}),t(at({table:u,type:n.saving},function(e,t){var n={};for(var r in t)void 0===e[r]&&(n[r]=t[r]);return n}(u,r)))},dt=function(e,t,n,r,o){var a=o.table,i=Le(at({},a,r),n.order);ot(e(i)).then(function(e){t(at({type:n.saved},e))}).catch(function(e){t({type:n.failed,error:e})})},ht=function(e,t,n){for(var r=e.slice(0),o=0;o<e.length;o++)parseInt(e[o].id,10)===t.id&&(r[o]=n(e[o]));return r},mt=function(e,t){return t.item?ht(e.rows,t.item,function(e){return at({},e,t.item,{original:e})}):e.rows},gt=function(e,t){return t.item?ht(e.rows,t.item,function(e){return e.original}):e.rows},bt=function(e,t){return t.item?mt(e,t):t.items?t.items:e.rows},yt=function(e,t){return t.table?at({},e.table,t.table):e.table},vt=function(e,t){return void 0!==t.total?t.total:e.total},Et=function(e,t){return[].concat(it(e.saving),it(t.saving))},wt=function(e,t){return e.saving.filter(function(e){return-1===t.saving.indexOf(e)})},_t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var Ot="ERROR_LOADING",xt="ERROR_LOADED",kt="ERROR_FAILED",St="ERROR_SET_SELECTED",Ct="ERROR_SET_ALL_SELECTED",jt="ERROR_ITEM_SAVING",Pt="ERROR_ITEM_SAVED",Tt="ERROR_ITEM_FAILED",Nt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var Rt="IO_EXPORTED",Dt="IO_EXPORTING",At="IO_IMPORTING",It="IO_IMPORTED",Lt="IO_FAILED",Ut="IO_CLEAR",Ft="IO_ADD_FILE",Mt="IO_IMPORTERS",Bt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var zt="GROUP_LOADING",Gt="GROUP_LOADED",Wt="GROUP_FAILED",Ht="GROUP_SET_SELECTED",Vt="GROUP_SET_ALL_SELECTED",qt="GROUP_ITEM_SAVING",$t="GROUP_ITEM_FAILED",Kt="GROUP_ITEM_SAVED",Qt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var Yt="REDIRECT_LOADING",Jt="REDIRECT_LOADED",Xt="REDIRECT_FAILED",Zt="REDIRECT_SET_SELECTED",en="REDIRECT_SET_ALL_SELECTED",tn="REDIRECT_ITEM_SAVING",nn="REDIRECT_ITEM_FAILED",rn="REDIRECT_ITEM_SAVED",on="REDIRECT_ADD_TOP",an=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var ln="MESSAGE_CLEAR_ERRORS",sn="MESSAGE_CLEAR_NOTICES",un=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cn=function(e,t){return e.slice(0).concat([t])},pn=function(e,t){return e.slice(0).concat([t])},fn=function(e){return Math.max(0,e.inProgress-1)},dn={REDIRECT_ITEM_SAVED:Object(c.translate)("Redirection saved"),LOG_ITEM_SAVED:Object(c.translate)("Log deleted"),SETTING_SAVED:Object(c.translate)("Settings saved"),GROUP_ITEM_SAVED:Object(c.translate)("Group saved"),ERROR_ITEM_SAVED:Object(c.translate)("404 deleted")};var hn="INFO_LOADING",mn="INFO_LOADED_GEO",gn="INFO_LOADED_AGENT",bn="INFO_FAILED",yn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function vn(e,t,n){return yn({},e,(r={},o=t[n],a=t,o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a,r));var r,o,a}var En=Object(R.combineReducers)({settings:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case ae:return me({},e,{loadStatus:fe});case ie:return me({},e,{loadStatus:he,values:t.values,groups:t.groups,postTypes:t.postTypes,installed:t.installed,canDelete:t.canDelete});case le:return me({},e,{loadStatus:de,error:t.error});case ue:return me({},e,{saveStatus:fe});case ce:return me({},e,{saveStatus:he,values:t.values,groups:t.groups,installed:t.installed});case pe:return me({},e,{saveStatus:de,error:t.error});case se:return me({},e,{pluginStatus:t.pluginStatus})}return e},log:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case Ee:return _t({},e,{table:Me(e.table,e.rows,t.onoff)});case ve:return _t({},e,{table:Fe(e.table,t.items)});case we:return _t({},e,{table:Ue(yt(e,t)),saving:Et(e,t),rows:mt(e,t)});case _e:return _t({},e,{rows:bt(e,t),total:vt(e,t),saving:wt(e,t)});case ge:return _t({},e,{table:yt(e,t),status:fe,saving:[],logType:t.logType,requestCount:e.requestCount+1});case ye:return _t({},e,{status:de,saving:[]});case be:return _t({},e,{rows:bt(e,t),status:he,total:vt(e,t),table:Ue(e.table)});case Oe:return _t({},e,{saving:wt(e,t),rows:gt(e,t)})}return e},error:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case Ct:return Nt({},e,{table:Me(e.table,e.rows,t.onoff)});case St:return Nt({},e,{table:Fe(e.table,t.items)});case jt:return Nt({},e,{table:Ue(yt(e,t)),saving:Et(e,t),rows:mt(e,t)});case Pt:return Nt({},e,{rows:bt(e,t),total:vt(e,t),saving:wt(e,t)});case Ot:return Nt({},e,{table:yt(e,t),status:fe,saving:[],logType:t.logType,requestCount:e.requestCount+1});case kt:return Nt({},e,{status:de,saving:[]});case xt:return Nt({},e,{rows:bt(e,t),status:he,total:vt(e,t),table:Ue(e.table)});case Tt:return Nt({},e,{saving:wt(e,t),rows:gt(e,t)})}return e},io:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case Dt:return Bt({},e,{exportStatus:fe});case Rt:return Bt({},e,{exportStatus:he,exportData:t.data});case Ft:return Bt({},e,{file:t.file});case Ut:return Bt({},e,{file:!1,lastImport:!1,exportData:!1});case Lt:return Bt({},e,{importingStatus:de,exportStatus:de,lastImport:!1,file:!1,exportData:!1});case At:return Bt({},e,{importingStatus:fe,lastImport:!1,file:!!t.file&&t.file});case It:return Bt({},e,{lastImport:t.total,importingStatus:he,file:!1});case Mt:return Bt({},e,{importers:t.importers})}return e},group:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case zt:return Qt({},e,{table:yt(e,t),status:fe,saving:[]});case Gt:return Qt({},e,{rows:bt(e,t),status:he,total:vt(e,t),table:Ue(e.table)});case qt:return Qt({},e,{table:Ue(yt(e,t)),saving:Et(e,t),rows:mt(e,t)});case Kt:return Qt({},e,{rows:bt(e,t),total:vt(e,t),saving:wt(e,t)});case Vt:return Qt({},e,{table:Me(e.table,e.rows,t.onoff)});case Ht:return Qt({},e,{table:Fe(e.table,t.items)});case Wt:return Qt({},e,{status:de,saving:[]});case $t:return Qt({},e,{saving:wt(e,t),rows:gt(e,t)})}return e},redirect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case on:return an({},e,{addTop:t.onoff});case Yt:return an({},e,{table:yt(e,t),status:fe,saving:[]});case Jt:return an({},e,{rows:bt(e,t),status:he,total:vt(e,t),table:Ue(e.table)});case tn:return an({},e,{table:Ue(yt(e,t)),saving:Et(e,t),rows:mt(e,t)});case rn:return an({},e,{rows:bt(e,t),total:vt(e,t),saving:wt(e,t)});case en:return an({},e,{table:Me(e.table,e.rows,t.onoff)});case Zt:return an({},e,{table:Fe(e.table,t.items)});case Xt:return an({},e,{status:de,saving:[]});case nn:return an({},e,{saving:wt(e,t),rows:gt(e,t)})}return e},message:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case Lt:case Wt:case nn:case $t:case ye:case Oe:case le:case pe:case Tt:case kt:case Xt:var n=cn(e.errors,t.error);return console.error(t.error.message),un({},e,{errors:n,inProgress:fn(e)});case we:case tn:case ue:case jt:case qt:return un({},e,{inProgress:e.inProgress+1});case _e:case rn:case ce:case Kt:case Pt:return un({},e,{notices:pn(e.notices,dn[t.type]),inProgress:fn(e)});case sn:return un({},e,{notices:[]});case ln:return un({},e,{errors:[]})}return e},info:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case hn:return yn({},e,{status:fe});case mn:return yn({},e,{status:he,maps:vn(e.maps,t.map,"ip")});case gn:return yn({},e,{status:he,agents:vn(e.agents,t.agent,"agent")});case bn:return yn({},e,{status:de,error:t.error})}return e}}),wn=Object(te.composeWithDevTools)({name:"Redirection"}),_n=[oe,function(){return function(e){return function(t){switch(t.type){case tn:case qt:case Yt:case zt:case ge:case Ot:!function(e,t){var n=Te(),r={redirect:[[Yt,tn],"id"],groups:[[zt,qt],"name"],log:[[ge],"date"],"404s":[[Ot],"date"]};r[n]&&e===r[n][0].find(function(t){return t===e})&&je({orderby:t.orderby,direction:t.direction,offset:t.page,per_page:t.per_page,filter:t.filter,filterBy:t.filterBy},{orderby:r[n][1],direction:"desc",offset:0,filter:"",filterBy:"",per_page:parseInt(Redirectioni10n.per_page,10)})}(t.type,t.table?t.table:t)}return e(t)}}}];function On(){var e=Redirectioni10n&&Redirectioni10n.preload&&Redirectioni10n.preload.pluginStatus?Redirectioni10n.preload.pluginStatus:[];return{loadStatus:fe,saveStatus:!1,error:!1,installed:"",settings:{},postTypes:[],pluginStatus:e,canDelete:!1}}function xn(){return{settings:On(),log:{rows:[],saving:[],logType:xe,total:0,status:fe,table:Ae(["ip","url"],["ip"],"date",["log"]),requestCount:0},error:{rows:[],saving:[],logType:xe,total:0,status:fe,table:Ae(["ip","url"],["ip"],"date",["404s"]),requestCount:0},io:{status:fe,file:!1,lastImport:!1,exportData:!1,importingStatus:!1,exportStatus:!1,importers:[]},group:{rows:[],saving:[],total:0,status:fe,table:Ae(["name"],["name","module"],"name",["groups"])},redirect:{rows:[],saving:[],total:0,addTop:!1,status:fe,table:Ae(["url","position","last_count","id","last_access"],["group"],"id",[""])},message:{errors:[],notices:[],inProgress:0,saving:[]},info:{status:fe,maps:{},agents:{},error:""}}}n(31);var kn=function(){return function(e,t){return t().settings.loadStatus===he?null:(ot(qe.get()).then(function(t){e({type:ie,values:t.settings,groups:t.groups,postTypes:t.post_types,installed:t.installed,canDelete:t.canDelete})}).catch(function(t){e({type:le,error:t})}),e({type:ae}))}},Sn=function(e){return function(t){return ot(qe.update(e)).then(function(e){t({type:ce,values:e.settings,groups:e.groups,installed:e.installed})}).catch(function(e){t({type:pe,error:e})}),t({type:ue})}},Cn=function(){return function(e){return ot(Ze.delete()).then(function(e){document.location.href=e.location}).catch(function(t){e({type:pe,error:t})}),e({type:ue})}},jn=function(){return function(e){return ot(Ze.status()).then(function(t){e({type:se,pluginStatus:t})}).catch(function(t){e({type:le,error:t})}),e({type:ae})}},Pn=function(){return function(e){return ot(Ze.fix()).then(function(t){e({type:se,pluginStatus:t})}).catch(function(t){e({type:le,error:t})}),e({type:ae})}},Tn=function(e){var t=e.title,n=e.url,r=void 0!==n&&n;return i.a.createElement("tr",null,i.a.createElement("th",null,!r&&t,r&&i.a.createElement("a",{href:r,target:"_blank"},t)),i.a.createElement("td",null,e.children))},Nn=function(e){return i.a.createElement("table",{className:"form-table"},i.a.createElement("tbody",null,e.children))},Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dn=function e(t){var n=t.value,r=t.text;return"object"===(void 0===n?"undefined":Rn(n))?i.a.createElement("optgroup",{label:r},n.map(function(t,n){return i.a.createElement(e,{text:t.text,value:t.value,key:n})})):i.a.createElement("option",{value:n},r)},An=function(e){var t=e.items,n=e.value,r=e.name,o=e.onChange,a=e.isEnabled,l=void 0===a||a;return i.a.createElement("select",{name:r,value:n,onChange:o,disabled:!l},t.map(function(e,t){return i.a.createElement(Dn,{value:e.value,text:e.text,key:t})}))},In=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ln=[{value:-1,text:Object(c.translate)("No logs")},{value:1,text:Object(c.translate)("A day")},{value:7,text:Object(c.translate)("A week")},{value:30,text:Object(c.translate)("A month")},{value:60,text:Object(c.translate)("Two months")},{value:0,text:Object(c.translate)("Forever")}],Un=[{value:-1,text:Object(c.translate)("Never cache")},{value:1,text:Object(c.translate)("An hour")},{value:24,text:Object(c.translate)("A day")},{value:168,text:Object(c.translate)("A week")},{value:0,text:Object(c.translate)("Forever")}],Fn=[{value:0,text:Object(c.translate)("No IP logging")},{value:1,text:Object(c.translate)("Full IP logging")},{value:2,text:Object(c.translate)("Anonymize IP (mask last part)")}],Mn=[{value:0,text:Object(c.translate)("Default /wp-json/")},{value:1,text:Object(c.translate)("Raw /index.php?rest_route=/")},{value:2,text:Object(c.translate)("Proxy over Admin AJAX")},{value:3,text:Object(c.translate)("Relative /wp-json/")},{value:4,text:Object(c.translate)("Form request")}],Bn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.onChange=function(e){var t=e.target,r="checkbox"===t.type?t.checked:t.value;n.setState(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t.name,r))},n.onSubmit=function(e){e.preventDefault(),n.props.onSaveSettings(n.state)},n.onMonitor=function(e){var t=e.target.name.replace("monitor_type_",""),r=n.state,o=r.monitor_post,a=r.associated_redirect,i=n.state.monitor_types.filter(function(e){return e!==t});e.target.checked&&i.push(t),n.setState({monitor_types:i,monitor_post:i.length>0?o:0,associated_redirect:i.length>0?a:""})};var r=e.values.modules;return n.state=e.values,n.state.location=r[2]?r[2].location:"",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),In(t,[{key:"UNSAFE_componentWillUpdate",value:function(e){e.values.token!==this.props.values.token&&this.setState({token:e.values.token}),e.values.auto_target!==this.props.values.auto_target&&this.setState({auto_target:e.values.auto_target})}},{key:"renderMonitor",value:function(e){return i.a.createElement(Tn,{title:Object(c.translate)("URL Monitor Changes")+":",url:this.supportLink("options","monitor")},i.a.createElement(An,{items:e,name:"monitor_post",value:parseInt(this.state.monitor_post,10),onChange:this.onChange})," ",Object(c.translate)("Save changes to this group"),i.a.createElement("p",null,i.a.createElement("input",{type:"text",className:"regular-text",name:"associated_redirect",onChange:this.onChange,placeholder:Object(c.translate)('For example "/amp"'),value:this.state.associated_redirect})," ",Object(c.translate)("Create associated redirect (added to end of URL)")))}},{key:"renderPostTypes",value:function(){var e=this,t=this.props.postTypes,n=this.state.monitor_types,r=[],o=function(o){var a=t[o],l=!!n.find(function(e){return e===o});r.push(i.a.createElement("p",{key:o},i.a.createElement("label",null,i.a.createElement("input",{type:"checkbox",name:"monitor_type_"+o,onChange:e.onMonitor,checked:l}),Object(c.translate)("Monitor changes to %(type)s",{args:{type:a.toLowerCase()}}))))};for(var a in t)o(a);return r}},{key:"supportLink",value:function(e,t){return"https://redirection.me/support/"+e+"/?utm_source=redirection&utm_medium=plugin&utm_campaign=support"+(t?"&utm_term="+t+"#"+t:"")}},{key:"render",value:function(){var e=this.props,t=e.groups,n=e.saveStatus,r=e.installed,o=this.state.monitor_types.length>0;return i.a.createElement("form",{onSubmit:this.onSubmit},i.a.createElement(Nn,null,i.a.createElement(Tn,{title:""},i.a.createElement("label",null,i.a.createElement("input",{type:"checkbox",checked:this.state.support,name:"support",onChange:this.onChange}),i.a.createElement("span",{className:"sub"},Object(c.translate)("I'm a nice person and I have helped support the author of this plugin")))),i.a.createElement(Tn,{title:Object(c.translate)("Redirect Logs")+":",url:this.supportLink("logs")},i.a.createElement(An,{items:Ln,name:"expire_redirect",value:parseInt(this.state.expire_redirect,10),onChange:this.onChange})," ",Object(c.translate)("(time to keep logs for)")),i.a.createElement(Tn,{title:Object(c.translate)("404 Logs")+":",url:this.supportLink("tracking-404-errors")},i.a.createElement(An,{items:Ln,name:"expire_404",value:parseInt(this.state.expire_404,10),onChange:this.onChange})," ",Object(c.translate)("(time to keep logs for)")),i.a.createElement(Tn,{title:Object(c.translate)("IP Logging")+":",url:this.supportLink("options","iplogging")},i.a.createElement(An,{items:Fn,name:"ip_logging",value:parseInt(this.state.ip_logging,10),onChange:this.onChange})," ",Object(c.translate)("(select IP logging level)")," - ",i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:this.supportLink("privacy-gdpr")},Object(c.translate)("GDPR / Privacy information"))),i.a.createElement(Tn,{title:Object(c.translate)("URL Monitor")+":",url:this.supportLink("options","monitor")},this.renderPostTypes()),o&&this.renderMonitor(t),i.a.createElement(Tn,{title:Object(c.translate)("RSS Token")+":",url:this.supportLink("options","rsstoken")},i.a.createElement("input",{className:"regular-text",type:"text",value:this.state.token,name:"token",onChange:this.onChange}),i.a.createElement("br",null),i.a.createElement("span",{className:"sub"},Object(c.translate)("A unique token allowing feed readers access to Redirection log RSS (leave blank to auto-generate)"))),i.a.createElement(Tn,{title:Object(c.translate)("Auto-generate URL")+":",url:this.supportLink("options","autogenerate")},i.a.createElement("input",{className:"regular-text",type:"text",value:this.state.auto_target,name:"auto_target",onChange:this.onChange}),i.a.createElement("br",null),i.a.createElement("span",{className:"sub"},Object(c.translate)("Used to auto-generate a URL if no URL is given. Use the special tags {{code}}$dec${{/code}} or {{code}}$hex${{/code}} to insert a unique ID instead",{components:{code:i.a.createElement("code",null)}}))),i.a.createElement(Tn,{title:Object(c.translate)("Apache Module"),url:this.supportLink("options","apache")},i.a.createElement("label",null,i.a.createElement("p",null,i.a.createElement("input",{type:"text",className:"regular-text",name:"location",value:this.state.location,onChange:this.onChange,placeholder:r})),i.a.createElement("p",{className:"sub"},Object(c.translate)("Enter the full path and filename if you want Redirection to automatically update your {{code}}.htaccess{{/code}}.",{components:{code:i.a.createElement("code",null)}})))),i.a.createElement(Tn,{title:Object(c.translate)("Force HTTPS"),url:this.supportLink("options","force-https")},i.a.createElement("label",null,i.a.createElement("p",null,i.a.createElement("input",{type:"checkbox",name:"https",onChange:this.onChange,checked:this.state.https}),Object(c.translate)("Force a redirect from HTTP to HTTPS. Please ensure your HTTPS is working before enabling"),"  ",Object(c.translate)("(beta)")))),i.a.createElement(Tn,{title:Object(c.translate)("Redirect Cache"),url:this.supportLink("options","cache")},i.a.createElement(An,{items:Un,name:"redirect_cache",value:parseInt(this.state.redirect_cache,10),onChange:this.onChange}),"  ",i.a.createElement("span",{className:"sub"},Object(c.translate)('How long to cache redirected 301 URLs (via "Expires" HTTP header)'))),i.a.createElement(Tn,{title:Object(c.translate)("REST API"),url:this.supportLink("options","restapi")},i.a.createElement(An,{items:Mn,name:"rest_api",value:parseInt(this.state.rest_api,10),onChange:this.onChange}),"  ",i.a.createElement("span",{className:"sub"},Object(c.translate)("How Redirection uses the REST API - don't change unless necessary")))),i.a.createElement("input",{className:"button-primary",type:"submit",name:"update",value:Object(c.translate)("Update"),disabled:n===fe}))}}]),t}();var zn=ee(function(e){var t=e.settings;return{groups:t.groups,values:t.values,saveStatus:t.saveStatus,installed:t.installed,postTypes:t.postTypes}},function(e){return{onSaveSettings:function(t){e(Sn(t))}}})(Bn),Gn=n(3),Wn=n.n(Gn),Hn=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Vn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.nodeRef=function(e){n.ref=e},n.handleClick=n.onBackground.bind(n),n.ref=null,n.height=0,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Hn(t,[{key:"componentDidMount",value:function(){this.height=0,this.resize(),document.body.classList.add("redirection-modal")}},{key:"componentWillUnmount",value:function(){document.body.classList.remove("redirection-modal")}},{key:"componentWillReceiveProps",value:function(){this.resize()}},{key:"componentDidUpdate",value:function(){this.resize()}},{key:"resize",value:function(){for(var e=0,t=0;t<this.ref.children.length;t++)e+=this.ref.children[t].clientHeight;this.ref.style.height=e+"px"}},{key:"onBackground",value:function(e){"modal"===e.target.className&&this.props.onClose()}},{key:"render",value:function(){var e=this.props.onClose,t=Wn()({"modal-wrapper":!0,"modal-wrapper-padding":this.props.padding}),n={};return this.height&&(n.height=this.height+"px"),i.a.createElement("div",{className:t,onClick:this.handleClick},i.a.createElement("div",{className:"modal-backdrop"}),i.a.createElement("div",{className:"modal"},i.a.createElement("div",{className:"modal-content",ref:this.nodeRef,style:n},i.a.createElement("div",{className:"modal-close"},i.a.createElement("button",{onClick:e},"✖")),i.a.cloneElement(this.props.children,{parent:this}))))}}]),t}();Vn.defaultProps={padding:!0};var qn=Vn,$n=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Kn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isModal:!1},n.onSubmit=n.handleSubmit.bind(n),n.onClose=n.closeModal.bind(n),n.onDelete=n.handleDelete.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),$n(t,[{key:"handleSubmit",value:function(e){this.setState({isModal:!0}),e.preventDefault()}},{key:"closeModal",value:function(){this.setState({isModal:!1})}},{key:"handleDelete",value:function(){this.props.onDelete(),this.closeModal()}},{key:"showModal",value:function(){return i.a.createElement(qn,{onClose:this.onClose},i.a.createElement("div",null,i.a.createElement("h1",null,Object(c.translate)("Delete the plugin - are you sure?")),i.a.createElement("p",null,Object(c.translate)("Deleting the plugin will remove all your redirections, logs, and settings. Do this if you want to remove the plugin for good, or if you want to reset the plugin.")),i.a.createElement("p",null,Object(c.translate)("Once deleted your redirections will stop working. If they appear to continue working then please clear your browser cache.")),i.a.createElement("p",null,i.a.createElement("button",{className:"button-primary button-delete",onClick:this.onDelete},Object(c.translate)("Yes! Delete the plugin"))," ",i.a.createElement("button",{className:"button-secondary",onClick:this.onClose},Object(c.translate)("No! Don't delete the plugin")))))}},{key:"render",value:function(){return i.a.createElement("div",{className:"wrap"},i.a.createElement("form",{action:"",method:"post",onSubmit:this.onSubmit},i.a.createElement("h2",null,Object(c.translate)("Delete Redirection")),i.a.createElement("p",null,"Selecting this option will delete all redirections, all logs, and any options associated with the Redirection plugin. Make sure this is what you want to do."),i.a.createElement("input",{className:"button-primary button-delete",type:"submit",name:"delete",value:Object(c.translate)("Delete")})),this.state.isModal&&this.showModal())}}]),t}(),Qn=function(){return i.a.createElement("div",{className:"placeholder-container"},i.a.createElement("div",{className:"placeholder-loading"}))},Yn=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Jn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onDonate=n.handleDonation.bind(n),n.onChange=n.handleChange.bind(n),n.onBlur=n.handleBlur.bind(n),n.onInput=n.handleInput.bind(n),n.state={support:e.support,amount:20},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Yn(t,[{key:"handleBlur",value:function(){this.setState({amount:Math.max(16,this.state.amount)})}},{key:"handleDonation",value:function(){this.setState({support:!1})}},{key:"getReturnUrl",value:function(){return document.location.href+"#thanks"}},{key:"handleChange",value:function(e){this.state.amount!==e.value&&this.setState({amount:parseInt(e.value,10)})}},{key:"handleInput",value:function(e){var t=e.target.value?parseInt(e.target.value,10):16;this.setState({amount:t})}},{key:"getAmountoji",value:function(e){for(var t=[[100,"😍"],[80,"😎"],[60,"😊"],[40,"😃"],[20,"😀"],[10,"🙂"]],n=0;n<t.length;n++)if(e>=t[n][0])return t[n][1];return t[t.length-1][1]}},{key:"renderSupported",value:function(){return i.a.createElement("div",null,Object(c.translate)("You've supported this plugin - thank you!"),"  ",i.a.createElement("a",{href:"#",onClick:this.onDonate},Object(c.translate)("I'd like to support some more.")))}},{key:"renderUnsupported",value:function(){for(var e,t,n,r=(n="",(t=16)in(e={})?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e),o=20;o<=100;o+=20)r[o]="";return i.a.createElement("div",null,i.a.createElement("label",null,i.a.createElement("p",null,Object(c.translate)("Redirection is free to use - life is wonderful and lovely! It has required a great deal of time and effort to develop and you can help support this development by {{strong}}making a small donation{{/strong}}.",{components:{strong:i.a.createElement("strong",null)}})," ",Object(c.translate)("You get useful software and I get to carry on making it better."))),i.a.createElement("input",{type:"hidden",name:"cmd",value:"_xclick"}),i.a.createElement("input",{type:"hidden",name:"business",value:"admin@urbangiraffe.com"}),i.a.createElement("input",{type:"hidden",name:"item_name",value:"Redirection"}),i.a.createElement("input",{type:"hidden",name:"buyer_credit_promo_code",value:""}),i.a.createElement("input",{type:"hidden",name:"buyer_credit_product_category",value:""}),i.a.createElement("input",{type:"hidden",name:"buyer_credit_shipping_method",value:""}),i.a.createElement("input",{type:"hidden",name:"buyer_credit_user_address_change",value:""}),i.a.createElement("input",{type:"hidden",name:"no_shipping",value:"1"}),i.a.createElement("input",{type:"hidden",name:"return",value:this.getReturnUrl()}),i.a.createElement("input",{type:"hidden",name:"no_note",value:"1"}),i.a.createElement("input",{type:"hidden",name:"currency_code",value:"USD"}),i.a.createElement("input",{type:"hidden",name:"tax",value:"0"}),i.a.createElement("input",{type:"hidden",name:"lc",value:"US"}),i.a.createElement("input",{type:"hidden",name:"bn",value:"PP-DonationsBF"}),i.a.createElement("div",{className:"donation-amount"},"$",i.a.createElement("input",{type:"number",name:"amount",min:16,value:this.state.amount,onChange:this.onInput,onBlur:this.onBlur}),i.a.createElement("span",null,this.getAmountoji(this.state.amount)),i.a.createElement("input",{type:"submit",className:"button-primary",value:Object(c.translate)("Support 💰")})))}},{key:"render",value:function(){var e=this.state.support;return i.a.createElement("form",{action:"https://www.paypal.com/cgi-bin/webscr",method:"post",className:"donation"},i.a.createElement(Nn,null,i.a.createElement(Tn,{title:Object(c.translate)("Plugin Support")+":"},e?this.renderSupported():this.renderUnsupported())))}}]),t}(),Xn=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Zn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return e.onLoadSettings(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Xn(t,[{key:"render",value:function(){var e=this.props,t=e.loadStatus,n=e.values,r=e.canDelete,o=void 0!==r&&r;return t!==fe&&n?i.a.createElement("div",null,t===he&&i.a.createElement(Jn,{support:n.support}),t===he&&i.a.createElement(zn,null),i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("hr",null),o&&i.a.createElement(Kn,{onDelete:this.props.onDeletePlugin})):i.a.createElement(Qn,null)}}]),t}();var er=ee(function(e){var t=e.settings;return{loadStatus:t.loadStatus,values:t.values,canDelete:t.canDelete}},function(e){return{onLoadSettings:function(){e(kn())},onDeletePlugin:function(){e(Cn())}}})(Zn);var tr=ee(null,function(e){return{onSubscribe:function(){e(Sn({newsletter:!0}))}}})(function(e){return e.newsletter?i.a.createElement("div",{className:"newsletter"},i.a.createElement("h3",null,Object(c.translate)("Newsletter")),i.a.createElement("p",null,Object(c.translate)("Thanks for subscribing! {{a}}Click here{{/a}} if you need to return to your subscription.",{components:{a:i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://tinyletter.com/redirection"})}}))):i.a.createElement("div",{className:"newsletter"},i.a.createElement("h3",null,Object(c.translate)("Newsletter")),i.a.createElement("p",null,Object(c.translate)("Want to keep up to date with changes to Redirection?")),i.a.createElement("p",null,Object(c.translate)("Sign up for the tiny Redirection newsletter - a low volume newsletter about new features and changes to the plugin. Ideal if want to test beta changes before release.")),i.a.createElement("form",{action:"https://tinyletter.com/redirection",method:"post",onSubmit:e.onSubscribe},i.a.createElement("p",null,i.a.createElement("label",null,Object(c.translate)("Your email address:")," ",i.a.createElement("input",{type:"email",name:"email",id:"tlemail"})," ",i.a.createElement("input",{type:"submit",value:"Subscribe",className:"button-secondary"})),i.a.createElement("input",{type:"hidden",value:"1",name:"embed"})," ",i.a.createElement("span",null,i.a.createElement("a",{href:"https://tinyletter.com/redirection",target:"_blank",rel:"noreferrer noopener"},"Powered by TinyLetter")))))}),nr=function(){return i.a.createElement("div",null,i.a.createElement("h2",null,Object(c.translate)("Need help?")),i.a.createElement("p",null,Object(c.translate)("Full documentation for Redirection can be found at {{site}}https://redirection.me{{/site}}. If you have a problem please check the {{faq}}FAQ{{/faq}} first.",{components:{site:i.a.createElement("a",{href:"https://redirection.me",target:"_blank",rel:"noopener noreferrer"}),faq:i.a.createElement("a",{href:"https://redirection.me/support/faq/",target:"_blank",rel:"noopener noreferrer"})}})),i.a.createElement("p",null,i.a.createElement("strong",null,Object(c.translate)("If you want to report a bug please read the {{report}}Reporting Bugs{{/report}} guide.",{components:{report:i.a.createElement("a",{href:"https://redirection.me/support/reporting-bugs/",target:"_blank",rel:"noopener noreferrer"})}}))),i.a.createElement("div",{className:"inline-notice inline-general"},i.a.createElement("p",{className:"github"},i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/johngodley/redirection/issues"},i.a.createElement("img",{src:Redirectioni10n.pluginBaseUrl+"/images/GitHub-Mark-64px.png",width:"32",height:"32"})),i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/johngodley/redirection/issues"},"https://github.com/johngodley/redirection/"))),i.a.createElement("p",null,Object(c.translate)("Please note that any support is provide on as-time-is-available basis and is not guaranteed. I do not provide paid support.")),i.a.createElement("p",null,Object(c.translate)("If you want to submit information that you don't want in a public repository then send it directly via {{email}}email{{/email}} - include as much information as you can!",{components:{email:i.a.createElement("a",{href:"mailto:john@redirection.me?subject=Redirection%20Issue&body="+encodeURIComponent("Redirection: "+Redirectioni10n.versions)})}})))},rr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var or=function(){return i.a.createElement("div",null,i.a.createElement("form",{action:Redirectioni10n.pluginRoot+"&sub=support",method:"POST"},i.a.createElement("input",{type:"hidden",name:"_wpnonce",value:Redirectioni10n.WP_API_nonce}),i.a.createElement("input",{type:"hidden",name:"action",value:"fixit"}),i.a.createElement("p",null,Object(c.translate)("If the magic button doesn't work then you should read the error and see if you can fix it manually, otherwise follow the 'Need help' section below.")),i.a.createElement("p",null,i.a.createElement("input",{type:"submit",className:"button-primary",value:Object(c.translate)("⚡️ Magic fix ⚡️")}))))},ar=function(e){var t=e.item;return i.a.createElement("tr",null,i.a.createElement("th",null,t.name),i.a.createElement("td",null,i.a.createElement("span",{className:"plugin-status-"+t.status},t.status.charAt(0).toUpperCase()+t.status.slice(1))," ",t.message))},ir=function(e){var t=e.status,n=t.filter(function(e){return"good"!==e.status});return i.a.createElement("div",null,i.a.createElement("table",{className:"plugin-status"},i.a.createElement("tbody",null,t.map(function(e,t){return i.a.createElement(ar,{item:e,key:t})}))),n.length>0&&i.a.createElement(or,null))},lr=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.props.onLoadStatus(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),rr(t,[{key:"render",value:function(){var e=this.props.pluginStatus;return i.a.createElement("div",null,i.a.createElement("h2",null,Object(c.translate)("Plugin Status")),e.length>0&&i.a.createElement(ir,{status:e}),0===e.length&&i.a.createElement("div",{className:"placeholder-inline"},i.a.createElement("div",{className:"placeholder-loading"})))}}]),t}();var sr=ee(function(e){return{pluginStatus:e.settings.pluginStatus}},function(e){return{onLoadStatus:function(){e(jn())},onFix:function(){e(Pn())}}})(lr),ur=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var cr=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return e.onLoadSettings(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),ur(t,[{key:"render",value:function(){var e=(this.props.values?this.props.values:{}).newsletter,t=void 0!==e&&e;return i.a.createElement("div",null,i.a.createElement(sr,null),i.a.createElement(nr,null),i.a.createElement(tr,{newsletter:t}))}}]),t}();var pr=ee(function(e){return{values:e.settings.values}},function(e){return{onLoadSettings:function(){e(kn())}}})(cr);var fr=function(e){var t,n,r,o=e.name,a=e.text,l=e.table,s=e.primary,u=l.direction,c=l.orderby,p=Wn()((r=!0,(n="column-"+o)in(t={"manage-column":!0,sortable:!0,asc:c===o&&"asc"===u,desc:c===o&&"desc"===u||c!==o,"column-primary":s})?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t));return i.a.createElement("th",{scope:"col",className:p,onClick:function(t){t.preventDefault(),e.onSetOrderBy(o,c===o&&"desc"===u?"asc":"desc")}},i.a.createElement("a",{href:"#"},i.a.createElement("span",null,a),i.a.createElement("span",{className:"sorting-indicator"})))};var dr=function(e){var t,n,r,o=e.name,a=e.text,l=e.primary,s=Wn()((r=!0,(n="column-"+o)in(t={"manage-column":!0,"column-primary":l})?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t));return i.a.createElement("th",{scope:"col",className:s},i.a.createElement("span",null,a))},hr=function(e){var t=e.onSetAllSelected,n=e.isDisabled,r=e.isSelected;return i.a.createElement("td",{className:"manage-column column-cb check-column",onClick:t},i.a.createElement("label",{className:"screen-reader-text"},Object(c.translate)("Select All")),i.a.createElement("input",{type:"checkbox",disabled:n,checked:r}))},mr=function(e){var t=e.isDisabled,n=e.onSetAllSelected,r=e.onSetOrderBy,o=e.isSelected,a=e.headers,l=e.table,s=function(e){n(e.target.checked)};return i.a.createElement("tr",null,a.map(function(e){var n=e.primary,a=void 0!==n&&n,u=e.check,c=void 0!==u&&u,p=e.sortable,f=void 0===p||p;return!0===c?i.a.createElement(hr,{onSetAllSelected:s,isDisabled:t,isSelected:o,key:e.name}):!1===f?i.a.createElement(dr,{name:e.name,text:e.title,key:e.name,primary:a}):i.a.createElement(fr,{table:l,name:e.name,text:e.title,key:e.name,onSetOrderBy:r,primary:a})}))},gr=function(e){var t=e.rows,n=e.status,r=e.selected,o=e.row;return i.a.createElement("tbody",null,t.map(function(e,t){return o(e,t,function(e,t,n){return{isLoading:e===fe,isSelected:function(e,t){return-1!==e.indexOf(t)}(t,n.id)}}(n,r,e))}))},br=function(e){var t=e.columns;return i.a.createElement("tr",{className:"is-placeholder"},t.map(function(e,t){return i.a.createElement("td",{key:t},i.a.createElement("div",{className:"placeholder-loading"}))}))},yr=function(e){var t=e.headers,n=e.rows;return i.a.createElement("tbody",null,i.a.createElement(br,{columns:t}),n.slice(0,-1).map(function(e,n){return i.a.createElement(br,{columns:t,key:n})}))},vr=function(e){var t=e.headers;return i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("td",null),i.a.createElement("td",{colSpan:t.length-1},Object(c.translate)("No results"))))},Er=function(e){var t=e.headers;return i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("td",{colSpan:t.length},i.a.createElement("p",null,Object(c.translate)("Sorry, something went wrong loading the data - please try again")))))},wr=function(e){var t=e.headers,n=e.row,r=e.rows,o=e.total,a=e.table,l=e.status,s=e.onSetAllSelected,u=e.onSetOrderBy,c=function(e,t){return e!==he||0===t.length}(l,r),p=function(e,t){return e.length===t.length&&0!==t.length}(a.selected,r),f=null;return l===fe&&0===r.length?f=i.a.createElement(yr,{headers:t,rows:r}):0===r.length&&l===he?f=i.a.createElement(vr,{headers:t}):l===de?f=i.a.createElement(Er,{headers:t}):r.length>0&&(f=i.a.createElement(gr,{rows:r,status:l,selected:a.selected,row:n})),i.a.createElement("table",{className:"wp-list-table widefat fixed striped items"},i.a.createElement("thead",null,i.a.createElement(mr,{table:a,isDisabled:c,isSelected:p,headers:t,rows:r,total:o,onSetOrderBy:u,onSetAllSelected:s})),f,i.a.createElement("tfoot",null,i.a.createElement(mr,{table:a,isDisabled:c,isSelected:p,headers:t,rows:r,total:o,onSetOrderBy:u,onSetAllSelected:s})))},_r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Or(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xr(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function kr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Sr=function(e){var t=e.title,n=e.button,r=e.className,o=e.enabled,a=e.onClick;return o?i.a.createElement("a",{className:r,href:"#",onClick:a},i.a.createElement("span",{className:"screen-reader-text"},t),i.a.createElement("span",{"aria-hidden":"true"},n)):i.a.createElement("span",{className:"tablenav-pages-navspan","aria-hidden":"true"},n)},Cr=function(e){function t(e){Or(this,t);var n=xr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=n.handleChange.bind(n),n.onSetPage=n.handleSetPage.bind(n),n.setClickers(e),n.state={currentPage:e.page},n}return kr(t,i.a.Component),_r(t,[{key:"componentWillUpdate",value:function(e){this.setClickers(e),e.page!==this.props.page&&this.setState({currentPage:e.page})}},{key:"setClickers",value:function(e){this.onFirst=this.handleClick.bind(this,0),this.onLast=this.handleClick.bind(this,this.getTotalPages(e)-1),this.onNext=this.handleClick.bind(this,e.page+1),this.onPrev=this.handleClick.bind(this,e.page-1)}},{key:"handleClick",value:function(e,t){t.preventDefault(),this.setState({currentPage:e}),this.props.onChangePage(e)}},{key:"handleChange",value:function(e){var t=parseInt(e.target.value,10);t!==this.state.currentPage&&this.setState({currentPage:t-1})}},{key:"handleSetPage",value:function(){this.props.onChangePage(this.state.currentPage)}},{key:"getTotalPages",value:function(e){var t=e.total,n=e.per_page;return Math.ceil(t/n)}},{key:"render",value:function(){var e=this.props.page,t=this.getTotalPages(this.props);return i.a.createElement("span",{className:"pagination-links"},i.a.createElement(Sr,{title:Object(c.translate)("First page"),button:"«",className:"first-page",enabled:e>0,onClick:this.onFirst})," ",i.a.createElement(Sr,{title:Object(c.translate)("Prev page"),button:"‹",className:"prev-page",enabled:e>0,onClick:this.onPrev}),i.a.createElement("span",{className:"paging-input"},i.a.createElement("label",{htmlFor:"current-page-selector",className:"screen-reader-text"},Object(c.translate)("Current Page"))," ",i.a.createElement("input",{className:"current-page",type:"number",min:"1",max:t,name:"paged",value:this.state.currentPage+1,size:"2","aria-describedby":"table-paging",onBlur:this.onSetPage,onChange:this.onChange}),i.a.createElement("span",{className:"tablenav-paging-text"},Object(c.translate)("of %(page)s",{components:{total:i.a.createElement("span",{className:"total-pages"})},args:{page:Object(c.numberFormat)(t)}})))," ",i.a.createElement(Sr,{title:Object(c.translate)("Next page"),button:"›",className:"next-page",enabled:e<t-1,onClick:this.onNext})," ",i.a.createElement(Sr,{title:Object(c.translate)("Last page"),button:"»",className:"last-page",enabled:e<t-1,onClick:this.onLast}))}}]),t}(),jr=function(e){function t(){return Or(this,t),xr(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return kr(t,i.a.Component),_r(t,[{key:"render",value:function(){var e=this.props,t=e.total,n=e.per_page,r=e.page,o=e.onChangePage,a=e.inProgress,l=t<=n,s=Wn()({"tablenav-pages":!0,"one-page":l});return i.a.createElement("div",{className:s},i.a.createElement("span",{className:"displaying-num"},Object(c.translate)("%s item","%s items",{count:t,args:Object(c.numberFormat)(t)})),!l&&i.a.createElement(Cr,{onChangePage:o,total:t,per_page:n,page:r,inProgress:a}))}}]),t}(),Pr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Tr=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleClick=n.onClick.bind(n),n.handleChange=n.onChange.bind(n),n.state={action:-1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Pr(t,[{key:"onChange",value:function(e){this.setState({action:e.target.value})}},{key:"onClick",value:function(e){e.preventDefault(),-1!==parseInt(this.state.action,10)&&(this.props.onAction(this.state.action),this.setState({action:-1}))}},{key:"getBulk",value:function(e){var t=this.props.selected;return i.a.createElement("div",{className:"alignleft actions bulkactions"},i.a.createElement("label",{htmlFor:"bulk-action-selector-top",className:"screen-reader-text"},Object(c.translate)("Select bulk action")),i.a.createElement("select",{name:"action",id:"bulk-action-selector-top",value:this.state.action,disabled:0===t.length,onChange:this.handleChange},i.a.createElement("option",{value:"-1"},Object(c.translate)("Bulk Actions")),e.map(function(e){return i.a.createElement("option",{key:e.id,value:e.id},e.name)})),i.a.createElement("input",{type:"submit",id:"doaction",className:"button action",value:Object(c.translate)("Apply"),disabled:0===t.length||-1===parseInt(this.state.action,10),onClick:this.handleClick}))}},{key:"render",value:function(){var e=this.props,t=e.total,n=e.table,r=e.bulk,o=e.status;return i.a.createElement("div",{className:"tablenav top"},r&&this.getBulk(r),this.props.children?this.props.children:null,t>0&&i.a.createElement(jr,{per_page:n.per_page,page:n.page,total:t,onChangePage:this.props.onChangePage,inProgress:o===fe}))}}]),t}(),Nr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Rr=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={search:n.getDefaultSearch(e.table,e.ignoreFilter)},n.handleChange=n.onChange.bind(n),n.handleSubmit=n.onSubmit.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Nr(t,[{key:"getDefaultSearch",value:function(e,t){return t&&t.find(function(t){return t===e.filterBy})?"":e.filter}},{key:"componentWillReceiveProps",value:function(e){e.table.filterBy===this.props.table.filterBy&&e.table.filter===this.props.table.filter||this.setState({search:this.getDefaultSearch(e.table,e.ignoreFilter)})}},{key:"onChange",value:function(e){this.setState({search:e.target.value})}},{key:"onSubmit",value:function(e){e.preventDefault(),this.props.onSearch(this.state.search,this.props.table.filterBy)}},{key:"render",value:function(){var e=this.props.status===fe||""===this.state.search&&""===this.props.table.filter,t="ip"===this.props.table.filterBy?Object(c.translate)("Search by IP"):Object(c.translate)("Search");return i.a.createElement("form",{onSubmit:this.handleSubmit},i.a.createElement("p",{className:"search-box"},i.a.createElement("input",{type:"search",name:"s",value:this.state.search,onChange:this.handleChange}),i.a.createElement("input",{type:"submit",className:"button",value:t,disabled:e})))}}]),t}(),Dr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ar=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isModal:!1},n.onShow=n.showDelete.bind(n),n.onClose=n.closeModal.bind(n),n.onDelete=n.handleDelete.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Dr(t,[{key:"showDelete",value:function(e){this.setState({isModal:!0}),e.preventDefault()}},{key:"closeModal",value:function(){this.setState({isModal:!1})}},{key:"handleDelete",value:function(){var e=this.props.table;this.setState({isModal:!1}),this.props.onDelete(this.getFilterBy(e.filterBy,e.filter),e.filter)}},{key:"getFilterBy",value:function(e,t){return t?e||"url":""}},{key:"getTitle",value:function(e,t){return"ip"===e?Object(c.translate)("Delete all from IP %s",{args:t}):t?Object(c.translate)('Delete all matching "%s"',{args:t.substring(0,15)}):Object(c.translate)("Delete All")}},{key:"render",value:function(){var e=this.props.table,t=this.getTitle(e.filterBy,e.filter);return i.a.createElement("div",{className:"table-button-item"},i.a.createElement("input",{className:"button",type:"submit",name:"",value:t,onClick:this.onShow}),this.state.isModal&&i.a.createElement(qn,{onClose:this.onClose},i.a.createElement("div",null,i.a.createElement("h1",null,Object(c.translate)("Delete the logs - are you sure?")),i.a.createElement("p",null,Object(c.translate)("Once deleted your current logs will no longer be available. You can set a delete schedule from the Redirection options if you want to do this automatically.")),i.a.createElement("p",null,i.a.createElement("button",{className:"button-primary",onClick:this.onDelete},Object(c.translate)("Yes! Delete the logs"))," ",i.a.createElement("button",{className:"button-secondary",onClick:this.onClose},Object(c.translate)("No! Don't delete the logs"))))))}}]),t}(),Ir=function(e){var t=e.logType;return i.a.createElement("form",{method:"post",action:Redirectioni10n.pluginRoot+"&sub="+t},i.a.createElement("input",{type:"hidden",name:"_wpnonce",value:Redirectioni10n.WP_API_nonce}),i.a.createElement("input",{type:"hidden",name:"export-csv",value:""}),i.a.createElement("input",{className:"button",type:"submit",name:"",value:Object(c.translate)("Export")}))},Lr=n(8),Ur=function(e){var t=e.children,n=e.disabled,r=void 0!==n&&n;return i.a.createElement("div",{className:"row-actions"},r?i.a.createElement("span",null," "):t)},Fr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr={saving:we,saved:_e,failed:Oe,order:"date",store:"log"},Br={saving:ge,saved:be,failed:ye,order:"date",store:"log"},zr=function(e,t){return function(n,r){return ft(Qe.deleteAll,n,Br,{page:0,filter:t,filterBy:e},r().log,function(e){return Fr({},e,{filter:"",filterBy:""})})}},Gr=function(e,t,n){return lt(et.log,e,t,Mr,n)},Wr=function(e){return function(t,n){return ft(Qe.list,t,Br,e,n().log)}},Hr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{filter:"",filterBy:"",page:0,orderby:""};return Wr(e)},Vr=function(e,t){return Wr({orderby:e,direction:t})},qr=function(e){return Wr({page:e})},$r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Wr({filter:e,filterBy:""===e?"":t,page:0,orderby:""})},Kr=function(e,t){return Wr({filterBy:e,filter:t,orderby:"",page:0})},Qr=function(e){return{type:ve,items:e.map(parseInt)}},Yr=function(e){return{type:Ee,onoff:e}},Jr=function(e){var t=e.size,n=void 0===t?"":t,r="spinner-container"+(n?" spinner-"+n:"");return i.a.createElement("div",{className:r},i.a.createElement("span",{className:"css-spinner"}))},Xr=function(e){return function(t,n){if(!n().info.maps[e])return ot(nt.getGeo(e)).then(function(e){t({type:mn,map:e})}).catch(function(e){t({type:bn,error:e})}),t({type:hn})}},Zr=function(e){return function(t,n){if(!n().info.agents[e])return ot(rt.get(e)).then(function(e){t({type:gn,agent:e})}).catch(function(e){t({type:bn,error:e})}),t({type:hn})}},eo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var to=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.props.onGet(e.ip),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),eo(t,[{key:"renderError",value:function(){var e=this.props.error;return i.a.createElement("div",{className:"modal-error"},i.a.createElement("h2",null,Object(c.translate)("Geo IP Error")),i.a.createElement("p",null,Object(c.translate)("Something went wrong obtaining this information")),i.a.createElement("p",null,i.a.createElement("code",null,e.message)))}},{key:"showPrivate",value:function(e){var t=e.ip,n=e.ipType;return i.a.createElement("div",{className:"geo-simple"},i.a.createElement("h2",null,Object(c.translate)("Geo IP"),": ",t," - IPv",n),i.a.createElement("p",null,Object(c.translate)("This is an IP from a private network. This means it is located inside a home or business network and no more information can be displayed.")))}},{key:"showUnknown",value:function(e){var t=e.ip,n=e.ipType;return i.a.createElement("div",{className:"geo-simple"},i.a.createElement("h2",null,Object(c.translate)("Geo IP"),": ",t," - IPv",n),i.a.createElement("p",null,Object(c.translate)("No details are known for this address.")))}},{key:"showMap",value:function(e){var t=e.countryName,n=e.regionName,r=e.city,o=e.postCode,a=e.timeZone,l=e.accuracyRadius,s=e.latitude,u=e.longitude,p=e.ip,f=e.ipType,d="https://www.google.com/maps/embed/v1/place?key=AIzaSyDPHZn9iAyI6l-2Qv5-1IPXsLUENVtQc3A&q="+encodeURIComponent(s+","+u),h=[n,t,o].filter(function(e){return e});return i.a.createElement("div",{className:"geo-full"},i.a.createElement("table",null,i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("th",{colSpan:"2"},i.a.createElement("h2",null,Object(c.translate)("Geo IP"),": ",i.a.createElement("a",{href:"https://redirect.li/map/?ip="+encodeURIComponent(p),target:"_blank",rel:"noopener noreferrer"},p)," - IPv",f))),i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("City")),i.a.createElement("td",null,r)),i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Area")),i.a.createElement("td",null,h.join(", "))),i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Timezone")),i.a.createElement("td",null,a)),i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Geo Location")),i.a.createElement("td",null,s+","+u+" (~"+l+"m)")))),i.a.createElement("iframe",{frameBorder:"0",src:d,allowFullScreen:!0}))}},{key:"renderDetails",value:function(){var e=this.props,t=e.maps,n=e.ip,r=!!t[n]&&t[n];if(r){var o=r.code;return"private"===o?this.showPrivate(r):"geoip"===o?this.showMap(r):this.showUnknown(r)}return null}},{key:"renderLink",value:function(){return i.a.createElement("div",{className:"external"},Object(c.translate)("Powered by {{link}}redirect.li{{/link}}",{components:{link:i.a.createElement("a",{href:"https://redirect.li",target:"_blank",rel:"noopener noreferrer"})}}))}},{key:"componentDidUpdate",value:function(){this.props.parent.resize()}},{key:"render",value:function(){var e=this.props.status,t=e===he&&this.props.maps[this.props.ip]&&"geoip"!==this.props.maps[this.props.ip].code,n=Wn()({"geo-map":!0,"modal-loading":e===fe,"geo-map-small":e===de||t});return i.a.createElement("div",{className:n},e===fe&&i.a.createElement(Jr,null),e===de&&this.renderError(),e===he&&this.renderDetails(),e===he&&this.renderLink())}}]),t}();var no=ee(function(e){var t=e.info;return{status:t.status,error:t.error,maps:t.maps}},function(e){return{onGet:function(t){e(Xr(t))}}})(to),ro=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var oo=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.props.onGet(e.agent),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),ro(t,[{key:"renderError",value:function(){var e=this.props.error;return i.a.createElement("div",{className:"modal-error"},i.a.createElement("h2",null,Object(c.translate)("Useragent Error")),i.a.createElement("p",null,Object(c.translate)("Something went wrong obtaining this information")),i.a.createElement("p",null,i.a.createElement("code",null,e.message)))}},{key:"renderUnknown",value:function(){var e=this.props.agent;return i.a.createElement("div",{className:"agent-unknown"},i.a.createElement("h2",null,Object(c.translate)("Unknown Useragent")),i.a.createElement("br",null),i.a.createElement("p",null,e))}},{key:"getDetail",value:function(e){return!!(e&&e.name&&e.version)&&e.name+" "+e.version}},{key:"getDevice",value:function(e){var t=[];return e.vendor&&t.push(e.vendor),e.name&&t.push(e.name),t.join(" ")}},{key:"getType",value:function(e,t){var n=e.slice(0,1).toUpperCase()+e.slice(1);return t?i.a.createElement("a",{href:t,target:"_blank"},n):n}},{key:"renderDetails",value:function(){var e=this.props,t=e.agents,n=e.agent,r=!!t[n]&&t[n];if(!r)return this.renderUnknown();var o=this.getType(r.device.type,r.url),a=this.getDevice(r.device),l=this.getDetail(r.os),s=this.getDetail(r.browser),u=this.getDetail(r.engine),p=[];return a&&p.push([Object(c.translate)("Device"),a]),l&&p.push([Object(c.translate)("Operating System"),l]),s&&p.push([Object(c.translate)("Browser"),s]),u&&p.push([Object(c.translate)("Engine"),u]),i.a.createElement("div",null,i.a.createElement("h2",null,Object(c.translate)("Useragent"),": ",o),i.a.createElement("table",null,i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Agent")),i.a.createElement("td",{className:"useragent-agent"},n)),p.map(function(e,t){return i.a.createElement("tr",{key:t},i.a.createElement("th",null,e[0]),i.a.createElement("td",null,e[1]))}))),i.a.createElement("div",{className:"external"},Object(c.translate)("Powered by {{link}}redirect.li{{/link}}",{components:{link:i.a.createElement("a",{href:"https://redirect.li",target:"_blank",rel:"noopener noreferrer"})}})))}},{key:"componentDidUpdate",value:function(){this.props.parent.resize()}},{key:"render",value:function(){var e=this.props.status,t=Wn()({useragent:!0,"modal-loading":e===fe});return i.a.createElement("div",{className:t},e===fe&&i.a.createElement(Jr,null),e===de&&this.renderError(),e===he&&this.renderDetails())}}]),t}();var ao=ee(function(e){var t=e.info;return{status:t.status,error:t.error,agents:t.agents}},function(e){return{onGet:function(t){e(Zr(t))}}})(oo),io=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var lo=function(e){var t=e.url;if(t){var n=Lr.parse(t).hostname;return i.a.createElement("a",{href:t,rel:"noreferrer noopener",target:"_blank"},n)}return null},so=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onShow=function(e){e.preventDefault(),n.props.onShowIP(n.props.item.ip)},n.onSelected=function(){n.props.onSetSelected([n.props.item.id])},n.onDelete=function(e){e.preventDefault(),n.props.onDelete(n.props.item.id)},n.renderIp=function(e){return e?i.a.createElement("a",{href:"https://redirect.li/map/?ip="+encodeURIComponent(e),onClick:n.showMap},e):"-"},n.showMap=function(e){e.preventDefault(),n.setState({showMap:!0})},n.showAgent=function(e){e.preventDefault(),n.setState({showAgent:!0})},n.closeMap=function(){n.setState({showMap:!1})},n.closeAgent=function(){n.setState({showAgent:!1})},n.state={showMap:!1,showAgent:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),io(t,[{key:"renderMap",value:function(){return i.a.createElement(qn,{onClose:this.closeMap,padding:!1},i.a.createElement(no,{ip:this.props.item.ip}))}},{key:"renderAgent",value:function(){return i.a.createElement(qn,{onClose:this.closeAgent,width:"800"},i.a.createElement(ao,{agent:this.props.item.agent}))}},{key:"render",value:function(){var e=this.props.item,t=e.created,n=e.created_time,r=e.ip,o=e.referrer,a=e.url,l=e.agent,s=e.sent_to,u=e.id,p=this.props,f=p.selected,d=p.status,h=d===fe,m="STATUS_SAVING"===d,g=h||m,b=[i.a.createElement("a",{href:"#",onClick:this.onDelete,key:"0"},Object(c.translate)("Delete"))];return r&&b.unshift(i.a.createElement("a",{href:"https://redirect.li/map/?ip="+encodeURIComponent(r),onClick:this.showMap,key:"2"},Object(c.translate)("Geo Info"))),l&&b.unshift(i.a.createElement("a",{href:"https://redirect.li/agent/?ip="+encodeURIComponent(l),onClick:this.showAgent,key:"3"},Object(c.translate)("Agent Info"))),i.a.createElement("tr",{className:g?"disabled":""},i.a.createElement("th",{scope:"row",className:"check-column"},!m&&i.a.createElement("input",{type:"checkbox",name:"item[]",value:u,disabled:h,checked:f,onClick:this.onSelected}),m&&i.a.createElement(Jr,{size:"small"})),i.a.createElement("td",{className:"column-date"},t,i.a.createElement("br",null),n),i.a.createElement("td",{className:"column-primary column-url"},i.a.createElement("a",{href:a,rel:"noreferrer noopener",target:"_blank"},a.substring(0,100)),i.a.createElement("br",null),s?s.substring(0,100):"",i.a.createElement(Ur,{disabled:m},b.reduce(function(e,t){return[e," | ",t]})),this.state.showMap&&this.renderMap(),this.state.showAgent&&this.renderAgent()),i.a.createElement("td",{className:"column-referrer"},i.a.createElement(lo,{url:o}),o&&i.a.createElement("br",null),l),i.a.createElement("td",{className:"column-ip"},this.renderIp(r),i.a.createElement(Ur,null,r&&i.a.createElement("a",{href:"#",onClick:this.onShow},Object(c.translate)("Filter by IP")))))}}]),t}();var uo=ee(null,function(e){return{onShowIP:function(t){e(Kr("ip",t))},onSetSelected:function(t){e(Qr(t))},onDelete:function(t){e(Gr("delete",t))}}})(so),co=function(e){var t=e.enabled,n=void 0===t||t,r=e.children;return n?i.a.createElement("div",{className:"table-buttons"},r):null},po=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var fo=[{name:"cb",check:!0},{name:"date",title:Object(c.translate)("Date")},{name:"url",title:Object(c.translate)("Source URL"),primary:!0},{name:"referrer",title:Object(c.translate)("Referrer / User Agent"),sortable:!1},{name:"ip",title:Object(c.translate)("IP"),sortable:!1}],ho=[{id:"delete",name:Object(c.translate)("Delete")}],mo=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return e.onLoad(e.log.table),n.handleRender=n.renderRow.bind(n),n.handleRSS=n.onRSS.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),po(t,[{key:"componentWillReceiveProps",value:function(e){e.clicked!==this.props.clicked&&e.onLoad()}},{key:"onRSS",value:function(){document.location=Redirectioni10n.pluginRoot+"&sub=rss&module=1&token="+Redirectioni10n.token}},{key:"renderRow",value:function(e,t,n){var r=this.props.log.saving,o=n.isLoading?fe:he,a=-1!==r.indexOf(e.id)?"STATUS_SAVING":o;return i.a.createElement(uo,{item:e,key:t,selected:n.isSelected,status:a})}},{key:"render",value:function(){var e=this.props.log,t=e.status,n=e.total,r=e.table,o=e.rows;return i.a.createElement("div",null,i.a.createElement(Rr,{status:t,table:r,onSearch:this.props.onSearch}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,status:t,onChangePage:this.props.onChangePage,onAction:this.props.onTableAction,bulk:ho}),i.a.createElement(wr,{headers:fo,rows:o,total:n,row:this.handleRender,table:r,status:t,onSetAllSelected:this.props.onSetAllSelected,onSetOrderBy:this.props.onSetOrderBy}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,status:t,onChangePage:this.props.onChangePage,onAction:this.props.onTableAction},i.a.createElement(co,{enabled:o.length>0},i.a.createElement(Ir,{logType:xe}),i.a.createElement("button",{className:"button-secondary",onClick:this.handleRSS},"RSS"),i.a.createElement(Ar,{onDelete:this.props.onDeleteAll,table:r}))))}}]),t}();var go=ee(function(e){return{log:e.log}},function(e){return{onLoad:function(t){e(Hr(t))},onDeleteAll:function(t,n){e(zr(t,n))},onSearch:function(t,n){e($r(t,n))},onChangePage:function(t){e(qr(t))},onTableAction:function(t){e(Gr(t))},onSetAllSelected:function(t){e(Yr(t))},onSetOrderBy:function(t,n){e(Vr(t,n))}}})(mo),bo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yo={saving:jt,saved:Pt,failed:Tt,order:"date",store:"error"},vo={saving:Ot,saved:xt,failed:kt,order:"date",store:"error"},Eo=function(e,t){return function(n,r){return dt(Ye.deleteAll,n,vo,{page:0,filter:t,filterBy:e},r().error)}},wo=function(e,t){return function(n,r){return ft(Ye.deleteAll,n,vo,{page:0,filter:t,filterBy:e},r().error,function(e){return bo({},e,{filter:"",filterBy:""})})}},_o=function(e,t,n){return lt(et.error,e,t,yo,n)},Oo=function(e){return function(t,n){return ft(Ye.list,t,vo,e,n().error)}},xo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{filter:"",filterBy:"",page:0,orderby:""};return Oo(e)},ko=function(e,t){return Oo({orderby:e,direction:t})},So=function(e){return Oo({page:e})},Co=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Oo({filter:e,filterBy:""===e?"":t,page:0,orderby:""})},jo=function(e,t){return Oo({filterBy:e,filter:t,orderby:"",page:0})},Po=function(e){return{type:St,items:e.map(parseInt)}},To=function(e){return{type:Ct,onoff:e}},No=function(e){var t=e.url;if(t){var n=Lr.parse(t).hostname;return i.a.createElement("a",{href:t,rel:"noreferrer noopener",target:"_blank"},n)}return null},Ro=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Do=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onDropdown=function(e){""!==e.target.value&&n.props.onCustomAgent({mobile:"iPad|iPod|iPhone|Android|BlackBerry|SymbianOS|SCH-Md+|Opera Mini|Windows CE|Nokia|SonyEricsson|webOS|PalmOS",feed:"Bloglines|feed|rss",lib:"cURL|Java|libwww-perl|PHP|urllib"}[e.target.value]),n.setState({dropdown:""})},n.handleChangeAgent=n.onChangeAgent.bind(n),n.handleChangeRegex=n.onChangeRegex.bind(n),n.state={dropdown:0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Ro(t,[{key:"onChangeAgent",value:function(e){this.props.onChange("agent","agent",e.target.value)}},{key:"onChangeRegex",value:function(e){this.props.onChange("agent","regex",e.target.checked)}},{key:"render",value:function(){return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("User Agent")),i.a.createElement("td",{className:"useragent-match"},i.a.createElement("input",{type:"text",name:"agent",value:this.props.agent,onChange:this.handleChangeAgent,className:"medium",placeholder:Object(c.translate)("Match against this browser user agent")}),i.a.createElement("select",{name:"agent_dropdown",onChange:this.onDropdown,value:this.state.dropdown,className:"medium"},i.a.createElement("option",{value:""},Object(c.translate)("Custom")),i.a.createElement("option",{value:"mobile"},Object(c.translate)("Mobile")),i.a.createElement("option",{value:"feed"},Object(c.translate)("Feed Readers")," "),i.a.createElement("option",{value:"lib"},Object(c.translate)("Libraries"))),i.a.createElement("label",{className:"edit-redirection-regex"},Object(c.translate)("Regex")," ",i.a.createElement("sup",null,i.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",i.a.createElement("input",{type:"checkbox",name:"regex",checked:this.props.regex,onChange:this.handleChangeRegex}))))}}]),t}(),Ao=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Io=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleChangeReferrer=n.onChangeReferrer.bind(n),n.handleChangeRegex=n.onChangeRegex.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Ao(t,[{key:"onChangeReferrer",value:function(e){this.props.onChange("referrer","referrer",e.target.value)}},{key:"onChangeRegex",value:function(e){this.props.onChange("referrer","regex",e.target.checked)}},{key:"render",value:function(){return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Referrer")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"referrer",value:this.props.referrer,onChange:this.handleChangeReferrer,placeholder:Object(c.translate)("Match against this browser referrer text")}),i.a.createElement("label",{className:"edit-redirection-regex"},Object(c.translate)("Regex")," ",i.a.createElement("sup",null,i.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",i.a.createElement("input",{type:"checkbox",name:"regex",checked:this.props.regex,onChange:this.handleChangeRegex}))))}}]),t}(),Lo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Uo=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){n.props.onChange("header",e.target.name,e.target.value)},n.onChangeRegex=function(e){n.props.onChange("header","regex",e.target.checked)},n.onDropdown=function(e){""!==e.target.value&&n.props.onChange("header","name",{accept:"Accept-Language"}[e.target.value]),n.setState({dropdown:""})},n.state={dropdown:0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Lo(t,[{key:"render",value:function(){var e=this.props,t=e.name,n=e.value,r=e.regex;return i.a.createElement(i.a.Fragment,null,i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("HTTP Header")),i.a.createElement("td",{className:"custom-header-match"},i.a.createElement("input",{type:"text",name:"name",value:t,onChange:this.onChange,className:"medium",placeholder:Object(c.translate)("Header name")}),i.a.createElement("input",{type:"text",name:"value",value:n,onChange:this.onChange,className:"medium",placeholder:Object(c.translate)("Header value")}),i.a.createElement("select",{name:"agent_dropdown",onChange:this.onDropdown,value:this.state.dropdown,className:"medium"},i.a.createElement("option",{value:""},Object(c.translate)("Custom")),i.a.createElement("option",{value:"accept"},Object(c.translate)("Accept Language"))),i.a.createElement("label",{className:"edit-redirection-regex"},Object(c.translate)("Regex")," ",i.a.createElement("sup",null,i.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",i.a.createElement("input",{type:"checkbox",name:"regex",checked:r,onChange:this.onChangeRegex})))),i.a.createElement("tr",null,i.a.createElement("th",null),i.a.createElement("td",null,Object(c.translate)("Note it is your responsability to pass HTTP headers to PHP. Please contact your hosting provider for support about this."))))}}]),t}(),Fo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Mo(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var Bo=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=Mo(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onChange=function(e){r.props.onChange("custom","filter",e.target.value)},Mo(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Fo(t,[{key:"render",value:function(){return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Filter Name")),i.a.createElement("td",{className:"customfilter-match"},i.a.createElement("input",{type:"text",name:"filter",value:this.props.filter,onChange:this.onChange,className:"medium",placeholder:Object(c.translate)("WordPress filter name")})))}}]),t}(),zo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Go=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){n.props.onChange("cookie",e.target.name,e.target.value)},n.onChangeRegex=function(e){n.props.onChange("cookie","regex",e.target.checked)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),zo(t,[{key:"render",value:function(){var e=this.props,t=e.name,n=e.value,r=e.regex;return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Cookie")),i.a.createElement("td",{className:"custom-header-match"},i.a.createElement("input",{type:"text",name:"name",value:t,onChange:this.onChange,className:"medium",placeholder:Object(c.translate)("Cookie name")}),i.a.createElement("input",{type:"text",name:"value",value:n,onChange:this.onChange,className:"medium",placeholder:Object(c.translate)("Cookie value")}),i.a.createElement("label",{className:"edit-redirection-regex"},Object(c.translate)("Regex")," ",i.a.createElement("sup",null,i.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",i.a.createElement("input",{type:"checkbox",name:"regex",checked:r,onChange:this.onChangeRegex}))))}}]),t}(),Wo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Ho(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var Vo=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=Ho(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onChange=function(e){""!==e.target.value&&r.props.onChange("role","role",e.target.value)},Ho(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Wo(t,[{key:"render",value:function(){return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Role")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",value:this.props.role,placeholder:Object(c.translate)("Enter role or capability value"),onChange:this.onChange})))}}]),t}(),qo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function $o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var Ko=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=$o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onChange=function(e){""!==e.target.value&&r.props.onChange("server","server",e.target.value)},$o(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),qo(t,[{key:"render",value:function(){return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Server")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",value:this.props.server,placeholder:Object(c.translate)("Enter server URL to match against"),onChange:this.onChange})))}}]),t}(),Qo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Yo(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var Jo=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=Yo(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onChange=function(e){r.props.onChange("login",e.target.name,e.target.value)},Yo(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Qo(t,[{key:"render",value:function(){return i.a.createElement(i.a.Fragment,null,i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Logged In")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"logged_in",value:this.props.logged_in,onChange:this.onChange,placeholder:Object(c.translate)("Target URL when matched")}))),i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Logged Out")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"logged_out",value:this.props.logged_out,onChange:this.onChange,placeholder:Object(c.translate)("Target URL when not matched")}))))}}]),t}(),Xo=function(e){return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Target URL")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"url",value:e.target.url,onChange:function(t){e.onChange("target","url",t.target.value)},placeholder:Object(c.translate)("The target URL you want to redirect to if matched")})))},Zo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function ea(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var ta=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=ea(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onChange=function(e){r.props.onChange(r.props.target,e.target.name,e.target.value)},ea(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Zo(t,[{key:"render",value:function(){return i.a.createElement(i.a.Fragment,null,i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Matched Target")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"url_from",value:this.props.url_from,onChange:this.onChange,placeholder:Object(c.translate)("Target URL when matched")}))),i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Unmatched Target")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"url_notfrom",value:this.props.url_notfrom,onChange:this.onChange,placeholder:Object(c.translate)("Target URL when not matched")}))))}}]),t}(),na=function(e){for(var t={},n=0;n<e.length;n++){var r=e[n];t[r.moduleName]||(t[r.moduleName]=[]),t[r.moduleName].push({value:r.id,text:r.name})}return Object.keys(t).map(function(e){return{text:e,value:t[e]}})},ra={store:"redirect",saving:tn,saved:rn,failed:nn,order:"name"},oa={store:"redirect",saving:Yt,saved:Jt,failed:Xt,order:"name"},aa=function(e){return ut($e.create,e,ra)},ia=function(e,t){return ct($e.update,e,t,ra)},la=function(e,t){return lt(et.redirect,e,t,ra)},sa=function(e){return function(t,n){return ft($e.list,t,oa,e,n().redirect)}},ua=function(e,t){return sa({orderby:e,direction:t})},ca=function(e){return sa({page:e})},pa=function(e){return sa({filter:e,filterBy:"",page:0,orderby:""})},fa=function(e,t){return sa({filterBy:e,filter:t,orderby:"",page:0})},da=function(e){return{type:Zt,items:e.map(parseInt)}},ha=function(e){return{type:en,onoff:e}},ma=function(e){return{type:on,onoff:e}},ga=function(e){return"url"===e||"pass"===e},ba=function(e,t){return{id:0,url:e,regex:!1,match_type:"url",action_type:"url",action_data:{url:""},group_id:t,title:"",action_code:301}},ya=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},va=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Ea(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wa=[{value:"url",name:Object(c.translate)("URL only")},{value:"login",name:Object(c.translate)("URL and login status")},{value:"role",name:Object(c.translate)("URL and role/capability filter")},{value:"referrer",name:Object(c.translate)("URL and referrer")},{value:"agent",name:Object(c.translate)("URL and user agent")},{value:"cookie",name:Object(c.translate)("URL and cookie")},{value:"server",name:Object(c.translate)("URL and server")},{value:"header",name:Object(c.translate)("URL and HTTP header")},{value:"custom",name:Object(c.translate)("URL and custom filter")}],_a=[{value:"url",name:Object(c.translate)("Redirect to URL")},{value:"random",name:Object(c.translate)("Redirect to random post")},{value:"pass",name:Object(c.translate)("Pass-through")},{value:"error",name:Object(c.translate)("Error (404)")},{value:"nothing",name:Object(c.translate)("Do nothing")}],Oa=[{value:301,name:Object(c.translate)("301 - Moved Permanently")},{value:302,name:Object(c.translate)("302 - Found")},{value:307,name:Object(c.translate)("307 - Temporary Redirect")},{value:308,name:Object(c.translate)("308 - Permanent Redirect")}],xa=[{value:401,name:Object(c.translate)("401 - Unauthorized")},{value:404,name:Object(c.translate)("404 - Not Found")},{value:410,name:Object(c.translate)("410 - Gone")}],ka=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));Sa.call(n);var r=e.item,o=r.url,a=r.regex,i=r.match_type,l=r.action_type,s=r.action_data,u=r.group_id,c=void 0===u?0:u,p=r.title,f=r.action_code,d=r.position,h=void 0===d?0:d,m=s||{},g=m.logged_in,b=void 0===g?"":g,y=m.logged_out,v=void 0===y?"":y;return n.state={url:o,title:p,regex:a,match_type:i,action_type:l,action_code:f,action_data:s,group_id:n.getValidGroup(c),position:h,login:{logged_in:b,logged_out:v},target:s||{},agent:n.getAgentState(s),referrer:n.getReferrerState(s),cookie:n.getHeaderState(s),header:n.getHeaderState(s),custom:n.getCustomState(s),role:n.getRoleState(s),server:n.getServerState(s)},n.state.advanced=!n.canShowAdvanced(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),va(t,[{key:"getValidGroup",value:function(e){var t=this.props.group.rows,n=this.props.table;if(t.find(function(t){return t.id===e}))return e;if(t.length>0){if("group"===n.filterBy&&parseInt(n.filter,10)>0)return parseInt(n.filter,10);var r=t.find(function(e){return e.default});return r?r.id:t[0].id}return 0}},{key:"reset",value:function(){this.setState(ya({url:"",regex:!1,match_type:"url",action_type:"url",action_data:"",title:"",action_code:301,position:0},this.resetActionData()))}},{key:"resetActionData",value:function(){return{login:{logged_in:"",logged_out:""},target:{url:""},agent:{url_from:"",agent:"",regex:!1,url_notfrom:""},referrer:{referrer:"",regex:!1,url_from:"",url_notfrom:""},cookie:{name:"",value:"",regex:!1,url_from:"",url_notfrom:""},header:{name:"",value:"",regex:!1,url_from:"",url_notfrom:""},custom:{filter:"",url_from:"",url_notfrom:""},role:{role:"",url_from:"",url_notfrom:""},server:{server:"",url_from:"",url_notfrom:""}}}},{key:"canShowAdvanced",value:function(){var e=this.state,t=e.match_type,n=e.action_type;return"url"===t&&"url"===n}},{key:"getAgentState",value:function(e){var t=e||{},n=t.agent,r=void 0===n?"":n,o=t.regex,a=void 0!==o&&o,i=t.url_from,l=void 0===i?"":i,s=t.url_notfrom;return{agent:r,regex:a,url_from:l,url_notfrom:void 0===s?"":s}}},{key:"getReferrerState",value:function(e){var t=e||{},n=t.referrer,r=void 0===n?"":n,o=t.regex,a=void 0!==o&&o,i=t.url_from,l=void 0===i?"":i,s=t.url_notfrom;return{referrer:r,regex:a,url_from:l,url_notfrom:void 0===s?"":s}}},{key:"getRoleState",value:function(e){var t=e||{},n=t.role,r=void 0===n?"":n,o=t.url_from,a=void 0===o?"":o,i=t.url_notfrom;return{role:r,url_from:a,url_notfrom:void 0===i?"":i}}},{key:"getServerState",value:function(e){var t=e||{},n=t.server,r=void 0===n?"":n,o=t.url_from,a=void 0===o?"":o,i=t.url_notfrom;return{server:r,url_from:a,url_notfrom:void 0===i?"":i}}},{key:"getHeaderState",value:function(e){var t=e||{},n=t.name,r=void 0===n?"":n,o=t.value,a=void 0===o?"":o,i=t.regex,l=void 0!==i&&i,s=t.url_from,u=void 0===s?"":s,c=t.url_notfrom;return{name:r,value:a,regex:l,url_from:u,url_notfrom:void 0===c?"":c}}},{key:"getCustomState",value:function(e){var t=e||{},n=t.filter,r=void 0===n?"":n,o=t.url_from,a=void 0===o?"":o,i=t.url_notfrom;return{filter:r,url_from:a,url_notfrom:void 0===i?"":i}}},{key:"getCode",value:function(){return"error"===this.state.action_type?i.a.createElement("select",{name:"action_code",value:this.state.action_code,onChange:this.onChange},xa.map(function(e){return i.a.createElement("option",{key:e.value,value:e.value},e.name)})):"url"===this.state.action_type||"random"===this.state.action_type?i.a.createElement("select",{name:"action_code",value:this.state.action_code,onChange:this.onChange},Oa.map(function(e){return i.a.createElement("option",{key:e.value,value:e.value},e.name)})):null}},{key:"getMatchExtra",value:function(){switch(this.state.match_type){case"agent":return i.a.createElement(Do,{agent:this.state.agent.agent,regex:this.state.agent.regex,onChange:this.onSetData,onCustomAgent:this.onCustomAgent});case"referrer":return i.a.createElement(Io,{referrer:this.state.referrer.referrer,regex:this.state.referrer.regex,onChange:this.onSetData});case"cookie":return i.a.createElement(Go,{name:this.state.cookie.name,value:this.state.cookie.value,regex:this.state.cookie.regex,onChange:this.onSetData});case"header":return i.a.createElement(Uo,{name:this.state.header.name,value:this.state.header.value,regex:this.state.header.regex,onChange:this.onSetData});case"custom":return i.a.createElement(Bo,{filter:this.state.custom.filter,onChange:this.onSetData});case"role":return i.a.createElement(Vo,{role:this.state.role.role,onChange:this.onSetData});case"server":return i.a.createElement(Ko,{server:this.state.server.server,onChange:this.onSetData})}return null}},{key:"getTarget",value:function(){var e=this.state,t=e.match_type,n=e.action_type,r=e.agent,o=e.referrer,a=e.login,l=e.cookie,s=e.target,u=e.header,c=e.custom,p=e.role,f=e.server;if(!ga(n))return null;switch(t){case"agent":return i.a.createElement(ta,{url_from:r.url_from,url_notfrom:r.url_notfrom,target:"agent",onChange:this.onSetData});case"referrer":return i.a.createElement(ta,{url_from:o.url_from,url_notfrom:o.url_notfrom,target:"referrer",onChange:this.onSetData});case"login":return i.a.createElement(Jo,{logged_in:a.logged_in,logged_out:a.logged_out,onChange:this.onSetData});case"url":return i.a.createElement(Xo,{target:s,onChange:this.onSetData});case"cookie":return i.a.createElement(ta,{url_from:l.url_from,url_notfrom:l.url_notfrom,target:"cookie",onChange:this.onSetData});case"header":return i.a.createElement(ta,{url_from:u.url_from,url_notfrom:u.url_notfrom,target:"header",onChange:this.onSetData});case"custom":return i.a.createElement(ta,{url_from:c.url_from,url_notfrom:c.url_notfrom,target:"custom",onChange:this.onSetData});case"role":return i.a.createElement(ta,{url_from:p.url_from,url_notfrom:p.url_notfrom,target:"role",onChange:this.onSetData});case"server":return i.a.createElement(ta,{url_from:f.url_from,url_notfrom:f.url_notfrom,target:"server",onChange:this.onSetData})}return null}},{key:"getTitle",value:function(){var e=this.state.title;return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Title")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"title",value:e,onChange:this.onChange,placeholder:Object(c.translate)("Optional description - describe the purpose of this redirect")})))}},{key:"getMatch",value:function(){var e=this.state.match_type;return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Match")),i.a.createElement("td",null,i.a.createElement("select",{name:"match_type",value:e,onChange:this.onChange},wa.map(function(e){return i.a.createElement("option",{value:e.value,key:e.value},e.name)}))))}},{key:"getTargetCode",value:function(){var e=this.state,t=e.action_type,n=e.match_type,r=this.getCode();return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("When matched")),i.a.createElement("td",null,i.a.createElement("select",{name:"action_type",value:t,onChange:this.onChange},_a.filter(function(e){return!("login"===n&&!ga(e.value))}).map(function(e){return i.a.createElement("option",{value:e.value,key:e.value},e.name)})),r&&i.a.createElement(i.a.Fragment,null,i.a.createElement("strong",{className:"small-flex"},Object(c.translate)("with HTTP code"))," ",i.a.createElement("span",null,r))))}},{key:"getGroup",value:function(){var e=this.props.group.rows,t=this.state.group_id,n=parseInt(this.state.position,10),r=this.state.advanced;return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Group")),i.a.createElement("td",null,i.a.createElement(An,{name:"group",value:t,items:na(e),onChange:this.onGroup}),r&&i.a.createElement("span",{className:"edit-redirection-position"},i.a.createElement("strong",null,Object(c.translate)("Position")),i.a.createElement("input",{type:"number",value:n,name:"position",min:"0",size:"3",onChange:this.onChange}))))}},{key:"canSave",value:function(){var e=this.state,t=e.url,n=e.match_type,r=e.target,o=e.action_type,a=e.referrer,i=e.login,l=e.agent,s=e.header,u=e.cookie,c=e.role,p=e.server;if(""===Redirectioni10n.autoGenerate&&""===t)return!1;if(ga(o)){if("url"===n&&""===r)return!1;if("referrer"===n&&""===a.url_from&&""===a.url_notfrom)return!1;if("login"===n&&""===i.logged_in&&""===i.logged_out)return!1;if("agent"===n&&""===l.url_from&&""===l.url_notfrom)return!1;if("cookie"===n&&""===u.url_from&&""===u.url_notfrom)return!1;if("header"===n&&""===s.url_from&&""===s.url_notfrom)return!1;if("role"===n&&""===c.url_from&&""===c.url_notfrom)return!1;if("server"===n&&""===p.url_from&&""===p.url_notfrom)return!1}return!0}},{key:"render",value:function(){var e=this.state,t=e.url,n=e.regex,r=e.advanced,o=this.props,a=o.saveButton,l=void 0===a?Object(c.translate)("Save"):a,s=o.onCancel,u=o.autoFocus,p=void 0!==u&&u,f=o.addTop,d=o.onClose;return i.a.createElement("form",{onSubmit:this.onSave},i.a.createElement("table",{className:"edit edit-redirection"},i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Source URL")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"url",value:t,onChange:this.onChange,autoFocus:p,placeholder:Object(c.translate)("The relative URL you want to redirect from")}),i.a.createElement("label",{className:"edit-redirection-regex"},Object(c.translate)("Regex")," ",i.a.createElement("sup",null,i.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",i.a.createElement("input",{type:"checkbox",name:"regex",checked:n,onChange:this.onChange})))),r&&this.getTitle(),r&&this.getMatch(),r&&this.getMatchExtra(),r&&this.getTargetCode(),this.getTarget(),this.getGroup(),this.props.children&&this.props.children,i.a.createElement("tr",null,i.a.createElement("th",null),i.a.createElement("td",null,i.a.createElement("div",{className:"table-actions"},i.a.createElement("input",{className:"button-primary",type:"submit",name:"save",value:l,disabled:!this.canSave()}),"  ",s&&i.a.createElement("input",{className:"button-secondary",type:"submit",name:"cancel",value:Object(c.translate)("Cancel"),onClick:s}),f&&!s&&i.a.createElement("input",{className:"button-secondary",type:"submit",name:"cancel",value:Object(c.translate)("Close"),onClick:d})," ",this.canShowAdvanced()&&!1!==this.props.advanced&&i.a.createElement("a",{href:"#",onClick:this.onAdvanced,className:"advanced",title:Object(c.translate)("Show advanced options")},"⚙")))))))}}]),t}(),Sa=function(){var e=this;this.onSetData=function(t,n,r){void 0!==r?e.setState(Ea({},t,ya({},e.state[t],Ea({},n,r)))):e.setState(Ea({},t,n))},this.onCustomAgent=function(t){var n=e.state.agent;n.agent=t,n.regex=!0,e.setState({agent:n})},this.onSave=function(t){t.preventDefault();var n=e.state,r=n.url,o=n.title,a=n.regex,i=n.match_type,l=n.action_type,s=n.group_id,u=n.action_code,c=n.position,p=e.props.group.rows,f={id:parseInt(e.props.item.id,10),url:r,title:o,regex:a,match_type:i,action_type:l,position:c,group_id:s>0?s:p[0].id,action_code:e.getCode()?parseInt(u,10):0,action_data:function(e){var t=e.agent,n=e.referrer,r=e.login,o=e.match_type,a=e.target,i=e.action_type,l=e.header,s=e.cookie,u=e.custom,c=e.role,p=e.server;return"cookie"===o?{name:s.name,value:s.value,regex:s.regex,url_from:ga(i)?s.url_from:"",url_notfrom:ga(i)?s.url_notfrom:""}:"header"===o?{name:l.name,value:l.value,regex:l.regex,url_from:ga(i)?l.url_from:"",url_notfrom:ga(i)?l.url_notfrom:""}:"custom"===o?{filter:u.filter,url_from:ga(i)?u.url_from:"",url_notfrom:ga(i)?u.url_notfrom:""}:"agent"===o?{agent:t.agent,regex:t.regex,url_from:ga(i)?t.url_from:"",url_notfrom:ga(i)?t.url_notfrom:""}:"referrer"===o?{referrer:n.referrer,regex:n.regex,url_from:ga(i)?n.url_from:"",url_notfrom:ga(i)?n.url_notfrom:""}:"role"===o?{role:c.role,url_from:ga(i)?c.url_from:"",url_notfrom:ga(i)?c.url_notfrom:""}:"server"===o?{server:p.server,url_from:ga(i)?p.url_from:"",url_notfrom:ga(i)?p.url_notfrom:""}:"login"===o&&ga(i)?{logged_in:r.logged_in,logged_out:r.logged_out}:"url"===o&&ga(i)?{url:a.url}:""}(e.state)};f.id?e.props.onSave(f.id,f):e.props.onCreate(f),e.props.onCancel?e.props.onCancel(t):e.reset(),e.props.childSave&&e.props.childSave()},this.onAdvanced=function(t){t.preventDefault(),e.setState({advanced:!e.state.advanced})},this.onGroup=function(t){e.setState({group_id:parseInt(t.target.value,10)})},this.onChange=function(t){var n=t.target,r="checkbox"===n.type?n.checked:n.value;if(e.setState(Ea({},n.name,r)),"action_type"===n.name&&"url"===n.value&&e.setState({action_code:301}),"action_type"===n.name&&"error"===n.value&&e.setState({action_code:404}),"match_type"===n.name){var o=ya({},e.resetActionData());"login"===n.value?e.setState(ya({},o,{action_type:"url"})):e.setState(o)}}};var Ca=ee(function(e){var t=e.group,n=e.redirect;return{group:t,addTop:n.addTop,table:n.table}},function(e){return{onSave:function(t,n){e(ia(t,n))},onCreate:function(t){e(aa(t))},onClose:function(t){t.preventDefault(),e(ma(!1))}}})(ka),ja=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Pa=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.showMap=function(e){e.preventDefault(),n.setState({showMap:!0})},n.showAgent=function(e){e.preventDefault(),n.setState({showAgent:!0})},n.closeMap=function(){n.setState({showMap:!1})},n.closeAgent=function(){n.setState({showAgent:!1})},n.handleSelected=n.onSelect.bind(n),n.handleDelete=n.onDelete.bind(n),n.handleAdd=n.onAdd.bind(n),n.handleShow=n.onShow.bind(n),n.handleClose=n.onClose.bind(n),n.handleSave=n.onSave.bind(n),n.handleDeleteLog=n.onDeleteLog.bind(n),n.state={editing:!1,delete_log:!1,showMap:!1,showAgent:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),ja(t,[{key:"onSelect",value:function(){this.props.onSetSelected([this.props.item.id])}},{key:"onDelete",value:function(e){e.preventDefault(),this.props.onDelete(this.props.item.id)}},{key:"onShow",value:function(e){e.preventDefault(),this.props.onShowIP(this.props.item.ip)}},{key:"onAdd",value:function(e){e.preventDefault(),this.setState({editing:!0})}},{key:"onClose",value:function(){this.setState({editing:!1})}},{key:"onDeleteLog",value:function(e){this.setState({delete_log:e.target.checked})}},{key:"onSave",value:function(){this.state.delete_log&&this.props.onDeleteFilter(this.props.item.url)}},{key:"renderEdit",value:function(){return i.a.createElement(qn,{onClose:this.handleClose,width:"700"},i.a.createElement("div",{className:"add-new"},i.a.createElement(Ca,{item:ba(this.props.item.url,0),saveButton:Object(c.translate)("Add Redirect"),advanced:!1,onCancel:this.handleClose,childSave:this.handleSave,autoFocus:!0},i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Delete 404s")),i.a.createElement("td",null,i.a.createElement("label",null,i.a.createElement("input",{type:"checkbox",name:"delete_log",checked:this.state.delete_log,onChange:this.handleDeleteLog}),Object(c.translate)("Delete all logs for this 404")))))))}},{key:"renderMap",value:function(){return i.a.createElement(qn,{onClose:this.closeMap,padding:!1},i.a.createElement(no,{ip:this.props.item.ip}))}},{key:"renderAgent",value:function(){return i.a.createElement(qn,{onClose:this.closeAgent,width:"800"},i.a.createElement(ao,{agent:this.props.item.agent}))}},{key:"renderIp",value:function(e){return e?i.a.createElement("a",{href:"https://redirect.li/map/?ip="+encodeURIComponent(e),onClick:this.showMap},e):"-"}},{key:"render",value:function(){var e=this.props.item,t=e.created,n=e.created_time,r=e.ip,o=e.referrer,a=e.url,l=e.agent,s=e.id,u=this.props,p=u.selected,f=u.status,d=f===fe,h="STATUS_SAVING"===f,m=d||h,g=[i.a.createElement("a",{href:"#",onClick:this.handleDelete,key:"0"},Object(c.translate)("Delete")),i.a.createElement("a",{href:"#",onClick:this.handleAdd,key:"1"},Object(c.translate)("Add Redirect"))];return r&&g.unshift(i.a.createElement("a",{href:"https://redirect.li/map/?ip="+encodeURIComponent(r),onClick:this.showMap,key:"2"},Object(c.translate)("Geo Info"))),l&&g.unshift(i.a.createElement("a",{href:"https://redirect.li/agent/?agent="+encodeURIComponent(l),onClick:this.showAgent,key:"3"},Object(c.translate)("Agent Info"))),i.a.createElement("tr",{className:m?"disabled":""},i.a.createElement("th",{scope:"row",className:"check-column"},!h&&i.a.createElement("input",{type:"checkbox",name:"item[]",value:s,disabled:d,checked:p,onClick:this.handleSelected}),h&&i.a.createElement(Jr,{size:"small"})),i.a.createElement("td",{className:"column-date"},t,i.a.createElement("br",null),n),i.a.createElement("td",{className:"column-url column-primary"},i.a.createElement("a",{href:a,rel:"noreferrer noopener",target:"_blank"},a.substring(0,100)),i.a.createElement(Ur,{disabled:h},g.reduce(function(e,t){return[e," | ",t]})),this.state.editing&&this.renderEdit(),this.state.showMap&&this.renderMap(),this.state.showAgent&&this.renderAgent()),i.a.createElement("td",{className:"column-referrer"},i.a.createElement(No,{url:o}),o&&i.a.createElement("br",null),i.a.createElement("span",null,l)),i.a.createElement("td",{className:"column-ip"},this.renderIp(r),i.a.createElement(Ur,null,r&&i.a.createElement("a",{href:"#",onClick:this.handleShow},Object(c.translate)("Filter by IP")))))}}]),t}();var Ta=ee(function(e){return{infoStatus:e.info.status}},function(e){return{onShowIP:function(t){e(jo("ip",t))},onSetSelected:function(t){e(Po(t))},onDelete:function(t){e(_o("delete",t))},onDeleteFilter:function(t){e(Eo("url-exact",t))}}})(Pa),Na={store:"group",saving:qt,saved:Kt,failed:$t,order:"name"},Ra={store:"group",saving:zt,saved:Gt,failed:Wt,order:"name"},Da=function(e){return ut(Ke.create,e,Na)},Aa=function(e,t){return ct(Ke.update,e,t,Na)},Ia=function(e,t){return lt(et.group,e,t,Na)},La=function(e){return function(t,n){return ft(Ke.list,t,Ra,e,n().group)}},Ua=function(e,t){return La({orderby:e,direction:t})},Fa=function(e){return La({page:e})},Ma=function(e){return La({filter:e,filterBy:"",page:0,orderby:""})},Ba=function(e,t){return La({filterBy:e,filter:t,orderby:"",page:0})},za=function(e){return{type:Ht,items:e.map(parseInt)}},Ga=function(e){return{type:Vt,onoff:e}},Wa=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ha=[{name:"cb",check:!0},{name:"date",title:Object(c.translate)("Date")},{name:"url",title:Object(c.translate)("Source URL"),primary:!0},{name:"referrer",title:Object(c.translate)("Referrer / User Agent"),sortable:!1},{name:"ip",title:Object(c.translate)("IP"),sortable:!1}],Va=[{id:"delete",name:Object(c.translate)("Delete")}],qa=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return e.onLoad(e.error.table),n.props.onLoadGroups(),n.handleRender=n.renderRow.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Wa(t,[{key:"componentWillReceiveProps",value:function(e){e.clicked!==this.props.clicked&&e.onLoad()}},{key:"renderRow",value:function(e,t,n){var r=this.props.error.saving,o=n.isLoading?fe:he,a=-1!==r.indexOf(e.id)?"STATUS_SAVING":o;return i.a.createElement(Ta,{item:e,key:t,selected:n.isSelected,status:a})}},{key:"render",value:function(){var e=this.props.error,t=e.status,n=e.total,r=e.table,o=e.rows;return i.a.createElement("div",null,i.a.createElement(Rr,{status:t,table:r,onSearch:this.props.onSearch}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,status:t,onChangePage:this.props.onChangePage,onAction:this.props.onTableAction,bulk:Va}),i.a.createElement(wr,{headers:Ha,rows:o,total:n,row:this.handleRender,table:r,status:t,onSetAllSelected:this.props.onSetAllSelected,onSetOrderBy:this.props.onSetOrderBy}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,status:t,onChangePage:this.props.onChangePage,onAction:this.props.onTableAction},i.a.createElement(co,{enabled:o.length>0},i.a.createElement(Ir,{logType:"404"}),i.a.createElement(Ar,{onDelete:this.props.onDeleteAll,table:r}))))}}]),t}();var $a=ee(function(e){return{error:e.error}},function(e){return{onLoad:function(t){e(xo(t))},onLoadGroups:function(){e(La())},onDeleteAll:function(t,n){e(wo(t,n))},onSearch:function(t,n){e(Co(t,n))},onChangePage:function(t){e(So(t))},onTableAction:function(t){e(_o(t,null))},onSetAllSelected:function(t){e(To(t))},onSetOrderBy:function(t,n){e(ko(t,n))}}})(qa),Ka=n(15),Qa=n.n(Ka),Ya="undefined"==typeof document||!document||!document.createElement||"multiple"in document.createElement("input");function Ja(e){var t=[];if(e.dataTransfer){var n=e.dataTransfer;n.files&&n.files.length?t=n.files:n.items&&n.items.length&&(t=n.items)}else e.target&&e.target.files&&(t=e.target.files);return Array.prototype.slice.call(t)}function Xa(e,t){return"application/x-moz-file"===e.type||Qa()(e,t)}function Za(e){e.preventDefault()}var ei={borderStyle:"solid",borderColor:"#c66",backgroundColor:"#eee"},ti={opacity:.5},ni={borderStyle:"solid",borderColor:"#6c6",backgroundColor:"#eee"},ri={width:200,height:200,borderWidth:2,borderColor:"#666",borderStyle:"dashed",borderRadius:5},oi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ai=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function ii(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var li=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.renderChildren=function(e,t,n,o){return"function"==typeof e?e(oi({},r.state,{isDragActive:t,isDragAccept:n,isDragReject:o})):e},r.composeHandlers=r.composeHandlers.bind(r),r.onClick=r.onClick.bind(r),r.onDocumentDrop=r.onDocumentDrop.bind(r),r.onDragEnter=r.onDragEnter.bind(r),r.onDragLeave=r.onDragLeave.bind(r),r.onDragOver=r.onDragOver.bind(r),r.onDragStart=r.onDragStart.bind(r),r.onDrop=r.onDrop.bind(r),r.onFileDialogCancel=r.onFileDialogCancel.bind(r),r.onInputElementClick=r.onInputElementClick.bind(r),r.setRef=r.setRef.bind(r),r.setRefs=r.setRefs.bind(r),r.isFileDialogActive=!1,r.state={draggedFiles:[],acceptedFiles:[],rejectedFiles:[]},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),ai(t,[{key:"componentDidMount",value:function(){var e=this.props.preventDropOnDocument;this.dragTargets=[],e&&(document.addEventListener("dragover",Za,!1),document.addEventListener("drop",this.onDocumentDrop,!1)),this.fileInputEl.addEventListener("click",this.onInputElementClick,!1),window.addEventListener("focus",this.onFileDialogCancel,!1)}},{key:"componentWillUnmount",value:function(){this.props.preventDropOnDocument&&(document.removeEventListener("dragover",Za),document.removeEventListener("drop",this.onDocumentDrop)),null!=this.fileInputEl&&this.fileInputEl.removeEventListener("click",this.onInputElementClick,!1),window.removeEventListener("focus",this.onFileDialogCancel,!1)}},{key:"composeHandlers",value:function(e){return this.props.disabled?null:e}},{key:"onDocumentDrop",value:function(e){this.node&&this.node.contains(e.target)||(e.preventDefault(),this.dragTargets=[])}},{key:"onDragStart",value:function(e){this.props.onDragStart&&this.props.onDragStart.call(this,e)}},{key:"onDragEnter",value:function(e){e.preventDefault(),-1===this.dragTargets.indexOf(e.target)&&this.dragTargets.push(e.target),this.setState({isDragActive:!0,draggedFiles:Ja(e)}),this.props.onDragEnter&&this.props.onDragEnter.call(this,e)}},{key:"onDragOver",value:function(e){e.preventDefault(),e.stopPropagation();try{e.dataTransfer.dropEffect=this.isFileDialogActive?"none":"copy"}catch(e){}return this.props.onDragOver&&this.props.onDragOver.call(this,e),!1}},{key:"onDragLeave",value:function(e){var t=this;e.preventDefault(),this.dragTargets=this.dragTargets.filter(function(n){return n!==e.target&&t.node.contains(n)}),this.dragTargets.length>0||(this.setState({isDragActive:!1,draggedFiles:[]}),this.props.onDragLeave&&this.props.onDragLeave.call(this,e))}},{key:"onDrop",value:function(e){var t=this,n=this.props,r=n.onDrop,o=n.onDropAccepted,a=n.onDropRejected,i=n.multiple,l=n.disablePreview,s=n.accept,u=Ja(e),c=[],p=[];e.preventDefault(),this.dragTargets=[],this.isFileDialogActive=!1,u.forEach(function(e){if(!l)try{e.preview=window.URL.createObjectURL(e)}catch(e){0}Xa(e,s)&&function(e,t,n){return e.size<=t&&e.size>=n}(e,t.props.maxSize,t.props.minSize)?c.push(e):p.push(e)}),i||p.push.apply(p,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(c.splice(1))),r&&r.call(this,c,p,e),p.length>0&&a&&a.call(this,p,e),c.length>0&&o&&o.call(this,c,e),this.draggedFiles=null,this.setState({isDragActive:!1,draggedFiles:[],acceptedFiles:c,rejectedFiles:p})}},{key:"onClick",value:function(e){var t=this.props,n=t.onClick;t.disableClick||(e.stopPropagation(),n&&n.call(this,e),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return function(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}(e)||function(e){return-1!==e.indexOf("Edge/")}(e)}()?this.open():setTimeout(this.open.bind(this),0))}},{key:"onInputElementClick",value:function(e){e.stopPropagation(),this.props.inputProps&&this.props.inputProps.onClick&&this.props.inputProps.onClick()}},{key:"onFileDialogCancel",value:function(){var e=this,t=this.props.onFileDialogCancel;this.isFileDialogActive&&setTimeout(function(){null!=e.fileInputEl&&(e.fileInputEl.files.length||(e.isFileDialogActive=!1));"function"==typeof t&&t()},300)}},{key:"setRef",value:function(e){this.node=e}},{key:"setRefs",value:function(e){this.fileInputEl=e}},{key:"open",value:function(){this.isFileDialogActive=!0,this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"render",value:function(){var e=this.props,t=e.accept,n=e.acceptClassName,r=e.activeClassName,o=e.children,a=e.disabled,l=e.disabledClassName,s=e.inputProps,u=e.multiple,c=e.name,p=e.rejectClassName,f=ii(e,["accept","acceptClassName","activeClassName","children","disabled","disabledClassName","inputProps","multiple","name","rejectClassName"]),d=f.acceptStyle,h=f.activeStyle,m=f.className,g=void 0===m?"":m,b=f.disabledStyle,y=f.rejectStyle,v=f.style,E=ii(f,["acceptStyle","activeStyle","className","disabledStyle","rejectStyle","style"]),w=this.state,_=w.isDragActive,O=w.draggedFiles,x=O.length,k=u||x<=1,S=x>0&&function(e,t){return e.every(function(e){return Xa(e,t)})}(O,this.props.accept),C=x>0&&(!S||!k),j=!(g||v||h||d||y||b);_&&r&&(g+=" "+r),S&&n&&(g+=" "+n),C&&p&&(g+=" "+p),a&&l&&(g+=" "+l),j&&(h=ni,d=(v=ri).active,y=ei,b=ti);var P=oi({},v);h&&_&&(P=oi({},v,h)),d&&S&&(P=oi({},P,d)),y&&C&&(P=oi({},P,y)),b&&a&&(P=oi({},v,b));var T={accept:t,disabled:a,type:"file",style:{display:"none"},multiple:Ya&&u,ref:this.setRefs,onChange:this.onDrop,autoComplete:"off"};c&&c.length&&(T.name=c);E.acceptedFiles,E.preventDropOnDocument,E.disablePreview,E.disableClick,E.onDropAccepted,E.onDropRejected,E.onFileDialogCancel,E.maxSize,E.minSize;var N=ii(E,["acceptedFiles","preventDropOnDocument","disablePreview","disableClick","onDropAccepted","onDropRejected","onFileDialogCancel","maxSize","minSize"]);return i.a.createElement("div",oi({className:g,style:P},N,{onClick:this.composeHandlers(this.onClick),onDragStart:this.composeHandlers(this.onDragStart),onDragEnter:this.composeHandlers(this.onDragEnter),onDragOver:this.composeHandlers(this.onDragOver),onDragLeave:this.composeHandlers(this.onDragLeave),onDrop:this.composeHandlers(this.onDrop),ref:this.setRef,"aria-disabled":a}),this.renderChildren(o,_,S,C),i.a.createElement("input",oi({},s,T)))}}]),t}(),si=li;li.propTypes={accept:d.a.oneOfType([d.a.string,d.a.arrayOf(d.a.string)]),children:d.a.oneOfType([d.a.node,d.a.func]),disableClick:d.a.bool,disabled:d.a.bool,disablePreview:d.a.bool,preventDropOnDocument:d.a.bool,inputProps:d.a.object,multiple:d.a.bool,name:d.a.string,maxSize:d.a.number,minSize:d.a.number,className:d.a.string,activeClassName:d.a.string,acceptClassName:d.a.string,rejectClassName:d.a.string,disabledClassName:d.a.string,style:d.a.object,activeStyle:d.a.object,acceptStyle:d.a.object,rejectStyle:d.a.object,disabledStyle:d.a.object,onClick:d.a.func,onDrop:d.a.func,onDropAccepted:d.a.func,onDropRejected:d.a.func,onDragStart:d.a.func,onDragEnter:d.a.func,onDragOver:d.a.func,onDragLeave:d.a.func,onFileDialogCancel:d.a.func},li.defaultProps={preventDropOnDocument:!0,disabled:!1,disablePreview:!1,disableClick:!1,multiple:!0,maxSize:1/0,minSize:0};var ui=function(e,t){return function(n){return ot(Xe.file(e,t)).then(function(e){n({type:Rt,data:e.data})}).catch(function(e){n({type:Lt,error:e})}),n({type:Dt})}},ci=function(e){return document.location.href=e,{type:"NOTHING"}},pi=function(e,t){return function(n){return ot(Je.upload(t,e)).then(function(e){n({type:It,total:e.imported})}).catch(function(e){n({type:Lt,error:e})}),n({type:At,file:e})}},fi=function(){return{type:Ut}},di=function(e){return{type:Ft,file:e}},hi=function(){return function(e){ot(Je.pluginList()).then(function(t){e({type:Mt,importers:t.importers})}).catch(function(t){e({type:Lt,error:t})})}},mi=function(e){return function(t){return ot(Je.pluginImport(e)).then(function(e){t({type:It,total:e.imported})}).catch(function(e){t({type:Lt,error:e})}),t({type:At})}},gi=function(e){var t=e.plugin,n=e.doImport,r=t.name,o=t.total;return i.a.createElement("div",{className:"plugin-importer"},i.a.createElement("p",null,i.a.createElement("strong",null,r)," (",Object(c.translate)("total = ")+o," )"),i.a.createElement("button",{onClick:function(){n(t)},className:"button-secondary"},Object(c.translate)("Import from %s",{args:r})))},bi=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var yi=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.doImport=function(e){confirm(Object(c.translate)("Are you sure you want to import from %s?",{args:e.name}))&&n.props.pluginImport(e.id)},n.props.onLoadGroups(),n.props.onLoadImport(),n.setDropzone=n.onSetZone.bind(n),n.handleDrop=n.onDrop.bind(n),n.handleOpen=n.onOpen.bind(n),n.handleInput=n.onInput.bind(n),n.handleCancel=n.onCancel.bind(n),n.handleImport=n.onImport.bind(n),n.handleEnter=n.onEnter.bind(n),n.handleLeave=n.onLeave.bind(n),n.handleView=n.onView.bind(n),n.handleDownload=n.onDownload.bind(n),n.state={group:0,hover:!1,module:"all",format:"json"},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),bi(t,[{key:"onView",value:function(){this.props.onExport(this.state.module,this.state.format)}},{key:"onDownload",value:function(){var e,t;this.props.onDownloadFile((e=this.state.module,t=this.state.format,Redirectioni10n.pluginRoot+"&sub=io&export="+e+"&exporter="+t))}},{key:"onEnter",value:function(){this.props.io.importingStatus!==fe&&this.setState({hover:!0})}},{key:"onLeave",value:function(){this.setState({hover:!1})}},{key:"onImport",value:function(){this.props.onImport(this.props.io.file,this.state.group)}},{key:"onCancel",value:function(){this.setState({hover:!1}),this.props.onClearFile()}},{key:"onInput",value:function(e){var t,n,r,o=e.target;this.setState((t={},n=o.name,r=o.value,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t)),"module"===o.name&&"everything"===o.value&&this.setState({format:"json"})}},{key:"onSetZone",value:function(e){this.dropzone=e}},{key:"onDrop",value:function(e){var t=this.props.io.importingStatus;e.length>0&&t!==fe&&this.props.onAddFile(e[0]),this.setState({hover:!1,group:this.props.group.rows[0].id})}},{key:"onOpen",value:function(){this.dropzone.open()}},{key:"renderGroupSelect",value:function(){var e=this.props.group.rows;return i.a.createElement("div",{className:"groups"},Object(c.translate)("Import to group")," ",i.a.createElement(An,{items:na(e),name:"group",value:this.state.group,onChange:this.handleInput}))}},{key:"renderInitialDrop",value:function(){return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("Import a CSV, .htaccess, or JSON file.")),i.a.createElement("p",null,Object(c.translate)("Click 'Add File' or drag and drop here.")),i.a.createElement("button",{type:"button",className:"button-secondary",onClick:this.handleOpen},Object(c.translate)("Add File")))}},{key:"renderDropBeforeUpload",value:function(){var e=this.props.io.file,t="application/json"===e.type;return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("File selected")),i.a.createElement("p",null,i.a.createElement("code",null,e.name)),!t&&this.renderGroupSelect(),i.a.createElement("button",{className:"button-primary",onClick:this.handleImport},Object(c.translate)("Upload")),"  ",i.a.createElement("button",{className:"button-secondary",onClick:this.handleCancel},Object(c.translate)("Cancel")))}},{key:"renderUploading",value:function(){var e=this.props.io.file;return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("Importing")),i.a.createElement("p",null,i.a.createElement("code",null,e.name)),i.a.createElement("div",{className:"is-placeholder"},i.a.createElement("div",{className:"placeholder-loading"})))}},{key:"renderUploaded",value:function(){var e=this.props.io.lastImport;return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("Finished importing")),i.a.createElement("p",null,Object(c.translate)("Total redirects imported:")," ",e),0===e&&i.a.createElement("p",null,Object(c.translate)("Double-check the file is the correct format!")),i.a.createElement("button",{className:"button-secondary",onClick:this.handleCancel},Object(c.translate)("OK")))}},{key:"renderDropzoneContent",value:function(){var e=this.props.io,t=e.importingStatus,n=e.lastImport,r=e.file;return t===fe?this.renderUploading():t===he&&!1!==n&&!1===r?this.renderUploaded():!1===r?this.renderInitialDrop():this.renderDropBeforeUpload()}},{key:"renderExport",value:function(e){return i.a.createElement("div",null,i.a.createElement("textarea",{className:"module-export",rows:"14",readOnly:!0,value:e}),i.a.createElement("input",{className:"button-secondary",type:"submit",value:Object(c.translate)("Close"),onClick:this.handleCancel}))}},{key:"renderExporting",value:function(){return i.a.createElement("div",{className:"loader-wrapper loader-textarea"},i.a.createElement("div",{className:"placeholder-loading"}))}},{key:"renderImporters",value:function(e){var t=this;return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("Plugin Importers")),i.a.createElement("p",null,Object(c.translate)("The following redirect plugins were detected on your site and can be imported from.")),e.map(function(e,n){return i.a.createElement(gi,{plugin:e,key:n,doImport:t.doImport})}))}},{key:"render",value:function(){var e=this.state.hover,t=this.props.io,n=t.importingStatus,r=t.file,o=t.exportData,a=t.exportStatus,l=t.importers,s=Wn()({dropzone:!0,"dropzone-dropped":!1!==r,"dropzone-importing":n===fe,"dropzone-hover":e});return i.a.createElement("div",{className:"import"},i.a.createElement("h2",null,Object(c.translate)("Import")),i.a.createElement(si,{ref:this.setDropzone,onDrop:this.handleDrop,onDragLeave:this.handleLeave,onDragEnter:this.handleEnter,className:s,disableClick:!0,disablePreview:!0,multiple:!1},this.renderDropzoneContent()),i.a.createElement("p",null,Object(c.translate)("All imports will be appended to the current database.")),i.a.createElement("div",{className:"inline-notice notice-warning"},i.a.createElement("p",null,Object(c.translate)("{{strong}}CSV file format{{/strong}}: {{code}}source URL, target URL{{/code}} - and can be optionally followed with {{code}}regex, http code{{/code}} ({{code}}regex{{/code}} - 0 for no, 1 for yes).",{components:{code:i.a.createElement("code",null),strong:i.a.createElement("strong",null)}}))),i.a.createElement("h2",null,Object(c.translate)("Export")),i.a.createElement("p",null,Object(c.translate)("Export to CSV, Apache .htaccess, Nginx, or Redirection JSON (which contains all redirects and groups).")),i.a.createElement("select",{name:"module",onChange:this.handleInput,value:this.state.module},i.a.createElement("option",{value:"0"},Object(c.translate)("Everything")),i.a.createElement("option",{value:"1"},Object(c.translate)("WordPress redirects")),i.a.createElement("option",{value:"2"},Object(c.translate)("Apache redirects")),i.a.createElement("option",{value:"3"},Object(c.translate)("Nginx redirects"))),i.a.createElement("select",{name:"format",onChange:this.handleInput,value:this.state.format},i.a.createElement("option",{value:"csv"},Object(c.translate)("CSV")),i.a.createElement("option",{value:"apache"},Object(c.translate)("Apache .htaccess")),i.a.createElement("option",{value:"nginx"},Object(c.translate)("Nginx rewrite rules")),i.a.createElement("option",{value:"json"},Object(c.translate)("Redirection JSON")))," ",i.a.createElement("button",{className:"button-primary",onClick:this.handleView},Object(c.translate)("View"))," ",i.a.createElement("button",{className:"button-secondary",onClick:this.handleDownload},Object(c.translate)("Download")),a===fe&&this.renderExporting(),o&&a!==fe&&this.renderExport(o),i.a.createElement("p",null,Object(c.translate)("Log files can be exported from the log pages.")),l.length>0&&this.renderImporters(l))}}]),t}();var vi=ee(function(e){return{group:e.group,io:e.io}},function(e){return{onLoadGroups:function(){e(La())},onImport:function(t,n){e(pi(t,n))},onAddFile:function(t){e(di(t))},onClearFile:function(){e(fi())},onExport:function(t,n){e(ui(t,n))},onDownloadFile:function(t){e(ci(t))},onLoadImport:function(){e(hi())},pluginImport:function(t){e(mi(t))}}})(yi),Ei=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var wi=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={selected:e.selected},n.handleChange=n.onChange.bind(n),n.handleSubmit=n.onSubmit.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Ei(t,[{key:"componentWillUpdate",value:function(e){e.selected!==this.state.selected&&this.setState({selected:e.selected})}},{key:"onChange",value:function(e){this.setState({selected:e.target.value})}},{key:"onSubmit",value:function(){this.props.onFilter(this.state.selected)}},{key:"render",value:function(){var e=this.props,t=e.options,n=e.isEnabled;return i.a.createElement("div",{className:"alignleft actions"},i.a.createElement(An,{items:t,value:this.state.selected,name:"filter",onChange:this.handleChange,isEnabled:this.props.isEnabled}),i.a.createElement("button",{className:"button",onClick:this.handleSubmit,disabled:!n},Object(c.translate)("Filter")))}}]),t}(),_i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Oi=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={editing:!1,name:e.item.name,moduleId:e.item.module_id},n.handleSelected=n.onSelected.bind(n),n.handleEdit=n.onEdit.bind(n),n.handleSave=n.onSave.bind(n),n.handleDelete=n.onDelete.bind(n),n.handleDisable=n.onDisable.bind(n),n.handleEnable=n.onEnable.bind(n),n.handleChange=n.onChange.bind(n),n.handleSelect=n.onSelect.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),_i(t,[{key:"componentWillUpdate",value:function(e){this.props.item.name!==e.item.name&&this.setState({name:e.item.name,moduleId:e.item.module_id})}},{key:"onEdit",value:function(e){e.preventDefault(),this.setState({editing:!this.state.editing})}},{key:"onDelete",value:function(e){e.preventDefault(),this.props.onTableAction("delete",this.props.item.id)}},{key:"onDisable",value:function(e){e.preventDefault(),this.props.onTableAction("disable",this.props.item.id)}},{key:"onEnable",value:function(e){e.preventDefault(),this.props.onTableAction("enable",this.props.item.id)}},{key:"onSelected",value:function(){this.props.onSetSelected([this.props.item.id])}},{key:"onChange",value:function(e){var t=e.target;this.setState({name:t.value})}},{key:"onSave",value:function(e){this.onEdit(e),this.props.onSaveGroup(this.props.item.id,{name:this.state.name,moduleId:this.state.moduleId})}},{key:"onSelect",value:function(e){var t=e.target;this.setState({moduleId:parseInt(t.value,10)})}},{key:"renderLoader",value:function(){return i.a.createElement("div",{className:"loader-wrapper"},i.a.createElement("div",{className:"placeholder-loading loading-small",style:{top:"0px"}}))}},{key:"renderActions",value:function(e){var t=this.props.item,n=t.id,r=t.enabled;return i.a.createElement(Ur,{disabled:e},i.a.createElement("a",{href:"#",onClick:this.handleEdit},Object(c.translate)("Edit"))," | ",i.a.createElement("a",{href:"#",onClick:this.handleDelete},Object(c.translate)("Delete"))," | ",i.a.createElement("a",{href:Redirectioni10n.pluginRoot+"&filterby=group&filter="+n},Object(c.translate)("View Redirects"))," | ",r&&i.a.createElement("a",{href:"#",onClick:this.handleDisable},Object(c.translate)("Disable")),!r&&i.a.createElement("a",{href:"#",onClick:this.handleEnable},Object(c.translate)("Enable")))}},{key:"renderEdit",value:function(){return i.a.createElement("form",{onSubmit:this.handleSave},i.a.createElement("table",{className:"edit-groups"},i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("th",{width:"70"},Object(c.translate)("Name")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"name",value:this.state.name,onChange:this.handleChange}))),i.a.createElement("tr",null,i.a.createElement("th",{width:"70"},Object(c.translate)("Module")),i.a.createElement("td",null,i.a.createElement(An,{name:"module_id",value:this.state.moduleId,onChange:this.handleSelect,items:[{value:1,text:"WordPress"},{value:2,text:"Apache"},{value:3,text:"Nginx"}]}))),i.a.createElement("tr",null,i.a.createElement("th",{width:"70"}),i.a.createElement("td",null,i.a.createElement("div",{className:"table-actions"},i.a.createElement("input",{className:"button-primary",type:"submit",name:"save",value:Object(c.translate)("Save")}),"  ",i.a.createElement("input",{className:"button-secondary",type:"submit",name:"cancel",value:Object(c.translate)("Cancel"),onClick:this.handleEdit})))))))}},{key:"getName",value:function(e,t){return t?e:i.a.createElement("strike",null,e)}},{key:"render",value:function(){var e,t,n=this.props.item,r=n.name,o=n.redirects,a=n.id,l=n.module_id,s=n.enabled,u=this.props,c=u.selected,p=u.status,f=p===fe,d="STATUS_SAVING"===p,h=!s||f||d;return i.a.createElement("tr",{className:h?"disabled":""},i.a.createElement("th",{scope:"row",className:"check-column"},!d&&i.a.createElement("input",{type:"checkbox",name:"item[]",value:a,disabled:f,checked:c,onClick:this.handleSelected}),d&&i.a.createElement(Jr,{size:"small"})),i.a.createElement("td",{className:"column-primary column-name"},!this.state.editing&&this.getName(r,s),this.state.editing?this.renderEdit():this.renderActions(d)),i.a.createElement("td",{className:"column-redirects"},o),i.a.createElement("td",{className:"column-module"},(e=l,(t=[{value:1,text:"WordPress"},{value:2,text:"Apache"},{value:3,text:"Nginx"}].find(function(t){return t.value===parseInt(e,10)}))?t.text:"")))}}]),t}();var xi=ee(null,function(e){return{onSetSelected:function(t){e(za(t))},onSaveGroup:function(t,n){e(Aa(t,n))},onTableAction:function(t,n){e(Ia(t,n))}}})(Oi),ki=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Si=[{name:"cb",check:!0},{name:"name",title:Object(c.translate)("Name"),primary:!0},{name:"redirects",title:Object(c.translate)("Redirects"),sortable:!1},{name:"module",title:Object(c.translate)("Module"),sortable:!1}],Ci=[{id:"delete",name:Object(c.translate)("Delete")},{id:"enable",name:Object(c.translate)("Enable")},{id:"disable",name:Object(c.translate)("Disable")}],ji=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.props.onLoadGroups(),n.state={name:"",moduleId:1},n.handleName=n.onChange.bind(n),n.handleModule=n.onModule.bind(n),n.handleSubmit=n.onSubmit.bind(n),n.handleRender=n.renderRow.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),ki(t,[{key:"componentWillReceiveProps",value:function(e){e.clicked!==this.props.clicked&&e.onLoadGroups()}},{key:"renderRow",value:function(e,t,n){var r=this.props.group.saving,o=n.isLoading?fe:he,a=-1!==r.indexOf(e.id)?"STATUS_SAVING":o;return i.a.createElement(xi,{item:e,key:t,selected:n.isSelected,status:a})}},{key:"onChange",value:function(e){this.setState({name:e.target.value})}},{key:"onModule",value:function(e){this.setState({moduleId:e.target.value})}},{key:"onSubmit",value:function(e){e.preventDefault(),this.props.onCreate({id:0,name:this.state.name,moduleId:this.state.moduleId}),this.setState({name:""})}},{key:"getModules",value:function(){return[{value:"",text:Object(c.translate)("All modules")}].concat([{value:1,text:"WordPress"},{value:2,text:"Apache"},{value:3,text:"Nginx"}])}},{key:"render",value:function(){var e=this.props.group,t=e.status,n=e.total,r=e.table,o=e.rows,a=-1!==e.saving.indexOf(0);return i.a.createElement("div",null,i.a.createElement(Rr,{status:t,table:r,onSearch:this.props.onSearch,ignoreFilter:["module"]}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,onChangePage:this.props.onChangePage,onAction:this.props.onAction,status:t,bulk:Ci},i.a.createElement(wi,{selected:r.filter,options:this.getModules(),onFilter:this.props.onFilter,isEnabled:!0})),i.a.createElement(wr,{headers:Si,rows:o,total:n,row:this.handleRender,table:r,status:t,onSetAllSelected:this.props.onSetAllSelected,onSetOrderBy:this.props.onSetOrderBy}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,onChangePage:this.props.onChangePage,onAction:this.props.onAction,status:t}),i.a.createElement("h2",null,Object(c.translate)("Add Group")),i.a.createElement("p",null,Object(c.translate)("Use groups to organise your redirects. Groups are assigned to a module, which affects how the redirects in that group work. If you are unsure then stick to the WordPress module.")),i.a.createElement("form",{onSubmit:this.handleSubmit},i.a.createElement("table",{className:"form-table"},i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("th",{style:{width:"50px"}},Object(c.translate)("Name")),i.a.createElement("td",null,i.a.createElement("input",{size:"30",className:"regular-text",type:"text",name:"name",value:this.state.name,onChange:this.handleName,disabled:a}),i.a.createElement(An,{name:"id",value:this.state.moduleId,onChange:this.handleModule,items:[{value:1,text:"WordPress"},{value:2,text:"Apache"},{value:3,text:"Nginx"}],disabled:a})," ",i.a.createElement("input",{className:"button-primary",type:"submit",name:"add",value:"Add",disabled:a||""===this.state.name})))))))}}]),t}();var Pi=ee(function(e){return{group:e.group}},function(e){return{onLoadGroups:function(){e(La({page:0,filter:"",filterBy:"",orderby:""}))},onSearch:function(t){e(Ma(t))},onChangePage:function(t){e(Fa(t))},onAction:function(t){e(Ia(t))},onSetAllSelected:function(t){e(Ga(t))},onSetOrderBy:function(t,n){e(Ua(t,n))},onFilter:function(t){e(Ba("module",t))},onCreate:function(t){e(Da(t))}}})(ji),Ti=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ni=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onEdit=function(e){e.preventDefault(),n.setState({editing:!0})},n.onCancel=function(e){e.preventDefault(),n.setState({editing:!1})},n.onDelete=function(e){e.preventDefault(),n.props.onTableAction("delete",n.props.item.id)},n.onDisable=function(e){e.preventDefault(),n.props.onTableAction("disable",n.props.item.id)},n.onEnable=function(e){e.preventDefault(),n.props.onTableAction("enable",n.props.item.id)},n.onSelected=function(){n.props.onSetSelected([n.props.item.id])},n.state={editing:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Ti(t,[{key:"componentWillUpdate",value:function(e){e.item.id!==this.props.item.id&&this.state.editing&&this.setState({editing:!1})}},{key:"getMenu",value:function(){var e=this.props.item.enabled,t=[];return e&&t.push([Object(c.translate)("Edit"),this.onEdit]),t.push([Object(c.translate)("Delete"),this.onDelete]),e?t.push([Object(c.translate)("Disable"),this.onDisable]):t.push([Object(c.translate)("Enable"),this.onEnable]),t.map(function(e,t){return i.a.createElement("a",{key:t,href:"#",onClick:e[1]},e[0])}).reduce(function(e,t){return[e," | ",t]})}},{key:"getCode",value:function(){var e=this.props.item,t=e.action_code,n=e.action_type;return"pass"===n?Object(c.translate)("pass"):"nothing"===n?"-":t}},{key:"getTarget",value:function(){var e=this.props.item,t=e.match_type,n=e.action_data;return"url"===t?n.url:null}},{key:"getUrl",value:function(e){return this.props.item.enabled?e:i.a.createElement("strike",null,e)}},{key:"getName",value:function(e,t){var n=this.props.item.regex;return t||(n?this.getUrl(e):i.a.createElement("a",{href:e,target:"_blank",rel:"noopener noreferrer"},this.getUrl(e)))}},{key:"renderSource",value:function(e,t,n){var r=this.getName(e,t);return i.a.createElement("td",{className:"column-primary column-url has-row-actions"},r,i.a.createElement("br",null),i.a.createElement("span",{className:"target"},this.getTarget()),i.a.createElement(Ur,{disabled:n},this.getMenu()))}},{key:"renderEditColumns",value:function(){return i.a.createElement("td",{className:"column-primary column-url",colSpan:"4"},i.a.createElement(Ca,{item:this.props.item,onCancel:this.onCancel}))}},{key:"renderViewColumns",value:function(e){var t=this.props.item,n=t.url,r=t.hits,o=t.last_access,a=t.title,l=t.position;return i.a.createElement(i.a.Fragment,null,this.renderSource(n,a,e),i.a.createElement("td",{className:"column-position"},Object(c.numberFormat)(l)),i.a.createElement("td",{className:"column-last_count"},Object(c.numberFormat)(r)),i.a.createElement("td",{className:"column_last_access"},o))}},{key:"render",value:function(){var e=this.props.item,t=e.id,n=e.enabled,r=this.props,o=r.selected,a=r.status,l=a===fe,s="STATUS_SAVING"===a,u=!n||l||s,c=Wn()({disabled:u});return i.a.createElement("tr",{className:c},i.a.createElement("th",{scope:"row",className:"check-column"},!s&&i.a.createElement("input",{type:"checkbox",name:"item[]",value:t,disabled:l,checked:o,onClick:this.onSelected}),s&&i.a.createElement(Jr,{size:"small"})),i.a.createElement("td",{className:"column-code"},this.getCode()),this.state.editing?this.renderEditColumns():this.renderViewColumns(s))}}]),t}();var Ri=ee(null,function(e){return{onSetSelected:function(t){e(da(t))},onTableAction:function(t,n){e(la(t,n))}}})(Ni),Di=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ai=[{name:"cb",check:!0},{name:"code",title:Object(c.translate)("Type"),sortable:!1},{name:"url",title:Object(c.translate)("URL"),primary:!0},{name:"position",title:Object(c.translate)("Pos")},{name:"last_count",title:Object(c.translate)("Hits")},{name:"last_access",title:Object(c.translate)("Last Access")}],Ii=[{id:"delete",name:Object(c.translate)("Delete")},{id:"enable",name:Object(c.translate)("Enable")},{id:"disable",name:Object(c.translate)("Disable")},{id:"reset",name:Object(c.translate)("Reset hits")}],Li=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleRender=n.renderRow.bind(n),n.props.onLoadRedirects(),n.props.onLoadGroups(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Di(t,[{key:"componentWillReceiveProps",value:function(e){e.clicked!==this.props.clicked&&e.onLoadRedirects({page:0,filter:"",filterBy:"",orderby:""})}},{key:"renderRow",value:function(e,t,n){var r=this.props.redirect.saving,o=n.isLoading?fe:he,a=-1!==r.indexOf(e.id)?"STATUS_SAVING":o;return i.a.createElement(Ri,{item:e,key:t,selected:n.isSelected,status:a})}},{key:"getGroups",value:function(e){return[{value:0,text:Object(c.translate)("All groups")}].concat(na(e))}},{key:"renderNew",value:function(){var e=this.props.redirect.addTop,t=Wn()({"add-new":!0,edit:!0,addTop:e});return i.a.createElement("div",null,!e&&i.a.createElement("h2",null,Object(c.translate)("Add new redirection")),i.a.createElement("div",{className:t},i.a.createElement(Ca,{item:ba("",0),saveButton:Object(c.translate)("Add Redirect"),autoFocus:e})))}},{key:"canFilter",value:function(e,t){return e.status===he&&t!==fe}},{key:"render",value:function(){var e=this.props.redirect,t=e.status,n=e.total,r=e.table,o=e.rows,a=e.addTop,l=this.props.group,s=t===he&&l.status===he;return i.a.createElement("div",{className:"redirects"},a&&this.renderNew(),i.a.createElement(Rr,{status:t,table:r,onSearch:this.props.onSearch,ignoreFilter:["group"]}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,onChangePage:this.props.onChangePage,onAction:this.props.onAction,bulk:Ii,status:t},i.a.createElement(wi,{selected:r.filter?r.filter:"0",options:this.getGroups(l.rows),isEnabled:this.canFilter(l,t),onFilter:this.props.onFilter})),i.a.createElement(wr,{headers:Ai,rows:o,total:n,row:this.handleRender,table:r,status:t,onSetAllSelected:this.props.onSetAllSelected,onSetOrderBy:this.props.onSetOrderBy}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,onChangePage:this.props.onChangePage,onAction:this.props.onAction,status:t}),s&&!a&&this.renderNew())}}]),t}();var Ui=ee(function(e){return{redirect:e.redirect,group:e.group}},function(e){return{onLoadGroups:function(){e(La())},onLoadRedirects:function(t){e(sa(t))},onSearch:function(t){e(pa(t))},onChangePage:function(t){e(ca(t))},onAction:function(t){e(la(t))},onSetAllSelected:function(t){e(ha(t))},onSetOrderBy:function(t,n){e(ua(t,n))},onFilter:function(t){e(fa("group",t))}}})(Li),Fi=function(){return{type:ln}},Mi=function(){return{type:sn}},Bi=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var zi=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){n.setState({rest_api:e.target.value})},n.onClick=n.dismiss.bind(n),n.state={rest_api:Redirectioni10n.api_setting},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Bi(t,[{key:"componentDidUpdate",value:function(e){0===e.errors.length&&this.props.errors.length>0&&window.scrollTo(0,0)}},{key:"dismiss",value:function(){this.props.onClear()}},{key:"getDebug",value:function(e){for(var t=[Redirectioni10n.versions],n=0;n<e.length;n++){var r=e[n].request,o=void 0!==r&&r;t.push(""),t.push("Error: "+this.getErrorDetails(e[n])),o&&o.status&&o.statusText&&(t.push("Action: "+o.action),o.params&&t.push("Params: "+JSON.stringify(o.params)),t.push("Code: "+o.status+" "+o.statusText)),o&&t.push("Raw: "+(o.raw?o.raw:"-no data-"))}return t}},{key:"getErrorDetailsTitle",value:function(e){return 0===e.code?e.message:e.data&&e.data.wpdb?i.a.createElement("span",null,e.message+" ("+e.code+")",": ",i.a.createElement("code",null,e.data.wpdb)):e.code?e.message+" ("+e.code+")":e.message}},{key:"getErrorDetails",value:function(e){return 0===e.code?e.message:e.data&&e.data.wpdb?e.message+" ("+e.code+"): "+e.data.wpdb:e.code?e.message+" ("+e.code+")":e.message}},{key:"getErrorMessage",value:function(e){var t=this;console.log(e);var n=e.map(function(e){return e.action&&"reload"===e.action?-1===document.location.search.indexOf("retry=")?void(document.location.href+="&retry=1"):Object(c.translate)("The data on this page has expired, please reload."):0===e.code?Object(c.translate)("WordPress did not return a response. This could mean an error occurred or that the request was blocked. Please check your server error_log."):"rest_cookie_invalid_nonce"===e.code?Object(c.translate)("Please logout and login again."):e.request&&403===e.request.status?Object(c.translate)("Your server returned a 403 Forbidden error which may indicate the request was blocked. Are you using a firewall or a security plugin like mod_security?"):e.request&&413===e.request.status?Object(c.translate)("Your server has rejected the request for being too big. You will need to change it to continue."):"disabled"===e.code||"rest_disabled"===e.code?Object(c.translate)("Your WordPress REST API has been disabled. You will need to enable it for Redirection to continue working"):-1!==e.message.indexOf("Unexpected token")?Object(c.translate)("WordPress returned an unexpected message. This could be caused by your REST API not working, or by another plugin or theme."):e.message?t.getErrorDetailsTitle(e):Object(c.translate)("I was trying to do a thing and it went wrong. It may be a temporary issue and if you try again it might work - great!")});return i.a.createElement("p",null,Object.keys([{}].concat(n).reduce(function(e,t){return e[t]=e})))}},{key:"getHeight",value:function(e){for(var t=0,n=0;n<e.length;n++){t+=e[n].split("\n").length}return Math.max(t,20)}},{key:"renderError",value:function(e){var t=this.getDebug(e),n=Wn()({notice:!0,"notice-error":!0}),r="mailto:john@redirection.me?subject=Redirection%20Error&body="+encodeURIComponent(t.join("\n")),o="https://github.com/johngodley/redirection/issues/new?title=Redirection%20Error&body="+encodeURIComponent("```\n"+t.join("\n")+"\n```\n\n");return i.a.createElement("div",{className:n},i.a.createElement("div",{className:"closer",onClick:this.onClick},"✖"),i.a.createElement("h2",null,Object(c.translate)("Something went wrong 🙁")),i.a.createElement("strong",null,this.getErrorMessage(e)),i.a.createElement("ol",null,i.a.createElement("li",null,Object(c.translate)("If you are unable to get anything working then Redirection may have difficulty communicating with your server. You can try manually changing this setting:"),i.a.createElement("form",{action:Redirectioni10n.pluginRoot+"&sub=support",method:"POST"},"REST API: ",i.a.createElement(An,{items:Mn,name:"rest_api",value:this.state.rest_api,onChange:this.onChange}),i.a.createElement("input",{type:"submit",className:"button-secondary",value:Object(c.translate)("Save")}),i.a.createElement("input",{type:"hidden",name:"_wpnonce",value:Redirectioni10n.WP_API_nonce}),i.a.createElement("input",{type:"hidden",name:"action",value:"rest_api"}))),i.a.createElement("li",null,Object(c.translate)('Take a look at the {{link}}plugin status{{/link}}. It may be able to identify and "magic fix" the problem.',{components:{link:i.a.createElement("a",{href:"?page=redirection.php&sub=support"})}})),i.a.createElement("li",null,Object(c.translate)("{{link}}Redirection is unable to talk to your REST API{{/link}}. If you have disabled it then you will need to enable it.",{components:{link:i.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://redirection.me/support/problems/rest-api/?utm_source=redirection&utm_medium=plugin&utm_campaign=support"})}})),i.a.createElement("li",null,Object(c.translate)("{{link}}Security software may be blocking Redirection{{/link}}. You will need to configure this to allow REST API requests.",{components:{link:i.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://redirection.me/support/problems/security-software/?utm_source=redirection&utm_medium=plugin&utm_campaign=support"})}})),i.a.createElement("li",null,Object(c.translate)("{{link}}Caching software{{/link}}, in particular Cloudflare, can cache the wrong thing. Try clearing all your caches.",{components:{link:i.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://redirection.me/support/problems/cloudflare/?utm_source=redirection&utm_medium=plugin&utm_campaign=support"})}})),i.a.createElement("li",null,Object(c.translate)("{{link}}Please temporarily disable other plugins!{{/link}} This fixes so many problems.",{components:{link:i.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://redirection.me/support/problems/plugins/?utm_source=redirection&utm_medium=plugin&utm_campaign=support"})}}))),i.a.createElement("h3",null,Object(c.translate)("None of the suggestions helped")),i.a.createElement("p",null,Object(c.translate)("If this is a new problem then please either {{strong}}create a new issue{{/strong}} or send it in an {{strong}}email{{/strong}}. Include a description of what you were trying to do and the important details listed below. Please include a screenshot.",{components:{strong:i.a.createElement("strong",null)}})),i.a.createElement("p",null,i.a.createElement("a",{href:o,className:"button-primary"},Object(c.translate)("Create Issue"))," ",i.a.createElement("a",{href:r,className:"button-secondary"},Object(c.translate)("Email"))),i.a.createElement("h3",null,Object(c.translate)("Important details")),i.a.createElement("p",null,Object(c.translate)("Include these details in your report {{strong}}along with a description of what you were doing{{/strong}}.",{components:{strong:i.a.createElement("strong",null)}})),i.a.createElement("p",null,i.a.createElement("textarea",{readOnly:!0,rows:this.getHeight(t),cols:"120",value:t.join("\n"),spellCheck:!1})))}},{key:"render",value:function(){var e=this.props.errors;return 0===e.length?null:this.renderError(e)}}]),t}();var Gi=ee(function(e){return{errors:e.message.errors}},function(e){return{onClear:function(){e(Fi())}}})(zi),Wi=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Hi=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleClick=n.onClick.bind(n),n.handleShrink=n.onShrink.bind(n),n.state={shrunk:!1,width:"auto"},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Wi(t,[{key:"onClick",value:function(){this.state.shrunk?this.setState({shrunk:!1}):this.props.onClear()}},{key:"componentWillUpdate",value:function(e){this.props.notices!==e.notices&&(this.stopTimer(),this.setState({shrunk:!1}),this.startTimer())}},{key:"componentWillUnmount",value:function(){this.stopTimer()}},{key:"stopTimer",value:function(){clearTimeout(this.timer)}},{key:"startTimer",value:function(){this.timer=setTimeout(this.handleShrink,5e3)}},{key:"onShrink",value:function(){this.setState({shrunk:!0})}},{key:"getNotice",value:function(e){return e.length>1?e[e.length-1]+" ("+e.length+")":e[0]}},{key:"renderNotice",value:function(e){var t="notice notice-info redirection-notice"+(this.state.shrunk?" notice-shrunk":"");return i.a.createElement("div",{className:t,onClick:this.handleClick},i.a.createElement("div",{className:"closer"},"✔"),i.a.createElement("p",null,this.state.shrunk?i.a.createElement("span",{title:Object(c.translate)("View notice")},"🔔"):this.getNotice(e)))}},{key:"render",value:function(){var e=this.props.notices;return 0===e.length?null:this.renderNotice(e)}}]),t}();var Vi=ee(function(e){return{notices:e.message.notices}},function(e){return{onClear:function(){e(Mi())}}})(Hi),qi=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var $i=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),qi(t,[{key:"getMessage",value:function(e){return e>1?Object(c.translate)("Saving...")+" ("+e+")":Object(c.translate)("Saving...")}},{key:"renderProgress",value:function(e){return i.a.createElement("div",{className:"notice notice-progress redirection-notice"},i.a.createElement(Jr,null),i.a.createElement("p",null,this.getMessage(e)))}},{key:"render",value:function(){var e=this.props.inProgress;return 0===e?null:this.renderProgress(e)}}]),t}();var Ki=ee(function(e){return{inProgress:e.message.inProgress}},null)($i),Qi=function(e){var t=e.item,n=e.isCurrent,r=e.onClick,o=Redirectioni10n.pluginRoot+(""===t.value?"":"&sub="+t.value);return i.a.createElement("li",null,i.a.createElement("a",{className:n?"current":"",href:o,onClick:function(e){e.preventDefault(),r(t.value,o)}},t.name))},Yi=[{name:Object(c.translate)("Redirects"),value:""},{name:Object(c.translate)("Groups"),value:"groups"},{name:Object(c.translate)("Log"),value:"log"},{name:Object(c.translate)("404s"),value:"404s"},{name:Object(c.translate)("Import/Export"),value:"io"},{name:Object(c.translate)("Options"),value:"options"},{name:Object(c.translate)("Support"),value:"support"}],Ji=function(e){var t=e.onChangePage,n=Te();return i.a.createElement("div",{className:"subsubsub-container"},i.a.createElement("ul",{className:"subsubsub"},Yi.map(function(e,r){return i.a.createElement(Qi,{key:r,item:e,isCurrent:n===e.value||"redirect"===n&&""===e.value,onClick:t})}).reduce(function(e,t){return[e," | ",t]})))},Xi=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Zi={redirect:Object(c.translate)("Redirections"),groups:Object(c.translate)("Groups"),io:Object(c.translate)("Import/Export"),log:Object(c.translate)("Logs"),"404s":Object(c.translate)("404 errors"),options:Object(c.translate)("Options"),support:Object(c.translate)("Support")},el=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onAdd=function(e){e.preventDefault(),n.props.onAdd()},n.state={page:Te(),clicked:0,stack:!1,error:"3.3"!==Redirectioni10n.version,info:!1},n.handlePageChange=n.onChangePage.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Xi(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:!0,stack:e,info:t})}},{key:"onChangePage",value:function(e,t){var n=this.props.errors;""===e&&(e="redirect"),"support"===e&&n.length>0?document.location.href=t:(history.pushState({},null,t),this.setState({page:e,clicked:this.state.clicked+1}),this.props.onClear())}},{key:"getContent",value:function(e){var t=this.state.clicked;switch(e){case"support":return i.a.createElement(pr,null);case"404s":return i.a.createElement($a,{clicked:t});case"log":return i.a.createElement(go,{clicked:t});case"io":return i.a.createElement(vi,null);case"groups":return i.a.createElement(Pi,{clicked:t});case"options":return i.a.createElement(er,null)}return i.a.createElement(Ui,{clicked:t})}},{key:"renderError",value:function(){var e=[Redirectioni10n.versions,"Buster: 3.3 === "+Redirectioni10n.version,"",this.state.stack];return this.state.info&&this.state.info.componentStack&&e.push(this.state.info.componentStack),"3.3"!==Redirectioni10n.version?i.a.createElement("div",{className:"notice notice-error"},i.a.createElement("h2",null,Object(c.translate)("Cached Redirection detected")),i.a.createElement("p",null,Object(c.translate)("Please clear your browser cache and reload this page.")),i.a.createElement("p",null,Object(c.translate)("If you are using a caching system such as Cloudflare then please read this: "),i.a.createElement("a",{href:"https://redirection.me/support/problems/cloudflare/?utm_source=redirection&utm_medium=plugin&utm_campaign=support",target:"_blank",rel:"noreferrer noopener"},Object(c.translate)("clearing your cache."))),i.a.createElement("p",null,i.a.createElement("textarea",{readOnly:!0,rows:e.length+3,cols:"120",value:e.join("\n"),spellCheck:!1}))):i.a.createElement("div",{className:"notice notice-error"},i.a.createElement("h2",null,Object(c.translate)("Something went wrong 🙁")),i.a.createElement("p",null,Object(c.translate)("Redirection is not working. Try clearing your browser cache and reloading this page."),"  ",Object(c.translate)("If you are using a page caching plugin or service (CloudFlare, OVH, etc) then you can also try clearing that cache.")),i.a.createElement("p",null,Object(c.translate)("If that doesn't help, open your browser's error console and create a {{link}}new issue{{/link}} with the details.",{components:{link:i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/johngodley/redirection/issues"})}})),i.a.createElement("p",null,Object(c.translate)("Please mention {{code}}%s{{/code}}, and explain what you were doing at the time",{components:{code:i.a.createElement("code",null)},args:this.state.page})),i.a.createElement("p",null,i.a.createElement("textarea",{readOnly:!0,rows:e.length+8,cols:"120",value:e.join("\n"),spellCheck:!1})))}},{key:"render",value:function(){var e=Zi[this.state.page];return this.state.error?this.renderError():i.a.createElement("div",{className:"wrap redirection"},i.a.createElement("h1",{className:"wp-heading-inline"},e),"redirect"===this.state.page&&i.a.createElement("a",{href:"#",onClick:this.onAdd,className:"page-title-action"},Object(c.translate)("Add New")),i.a.createElement(Ji,{onChangePage:this.handlePageChange}),i.a.createElement(Gi,null),this.getContent(this.state.page),i.a.createElement(Ki,null),i.a.createElement(Vi,null))}}]),t}();var tl,nl=ee(function(e){return{errors:e.message.errors}},function(e){return{onClear:function(){e(Fi())},onAdd:function(){e(ma(!0))}}})(el),rl=function(){return i.a.createElement(g,{store:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(R.createStore)(En,e,wn(R.applyMiddleware.apply(void 0,_n)))}(xn())},i.a.createElement(nl,null))};document.querySelector("#react-ui")&&(tl="react-ui",p.a.setLocale({"":{localeSlug:Redirectioni10n.localeSlug}}),p.a.addTranslations(Redirectioni10n.locale),function(e,t){s.a.render(i.a.createElement(u.AppContainer,null,i.a.createElement(e,null)),document.getElementById(t))}(rl,tl)),window.redirection=Redirectioni10n.version},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){(function(e,r){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(a){"object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType;var i="object"==typeof r&&r;i.global!==i&&i.window!==i&&i.self;var l,s=2147483647,u=36,c=1,p=26,f=38,d=700,h=72,m=128,g="-",b=/^xn--/,y=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=u-c,_=Math.floor,O=String.fromCharCode;function x(e){throw new RangeError(E[e])}function k(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function S(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+k((e=e.replace(v,".")).split("."),t).join(".")}function C(e){for(var t,n,r=[],o=0,a=e.length;o<a;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<a?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function j(e){return k(e,function(e){var t="";return e>65535&&(t+=O((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=O(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function T(e,t,n){var r=0;for(e=n?_(e/d):e>>1,e+=_(e/t);e>w*p>>1;r+=u)e=_(e/w);return _(r+(w+1)*e/(e+f))}function N(e){var t,n,r,o,a,i,l,f,d,b,y,v=[],E=e.length,w=0,O=m,k=h;for((n=e.lastIndexOf(g))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&x("not-basic"),v.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<E;){for(a=w,i=1,l=u;o>=E&&x("invalid-input"),((f=(y=e.charCodeAt(o++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:u)>=u||f>_((s-w)/i))&&x("overflow"),w+=f*i,!(f<(d=l<=k?c:l>=k+p?p:l-k));l+=u)i>_(s/(b=u-d))&&x("overflow"),i*=b;k=T(w-a,t=v.length+1,0==a),_(w/t)>s-O&&x("overflow"),O+=_(w/t),w%=t,v.splice(w++,0,O)}return j(v)}function R(e){var t,n,r,o,a,i,l,f,d,b,y,v,E,w,k,S=[];for(v=(e=C(e)).length,t=m,n=0,a=h,i=0;i<v;++i)(y=e[i])<128&&S.push(O(y));for(r=o=S.length,o&&S.push(g);r<v;){for(l=s,i=0;i<v;++i)(y=e[i])>=t&&y<l&&(l=y);for(l-t>_((s-n)/(E=r+1))&&x("overflow"),n+=(l-t)*E,t=l,i=0;i<v;++i)if((y=e[i])<t&&++n>s&&x("overflow"),y==t){for(f=n,d=u;!(f<(b=d<=a?c:d>=a+p?p:d-a));d+=u)k=f-b,w=u-b,S.push(O(P(b+k%w,0))),f=_(k/w);S.push(O(P(f,0))),a=T(n,E,r==o),n=0,++r}++n,++t}return S.join("")}l={version:"1.4.1",ucs2:{decode:C,encode:j},decode:N,encode:R,toASCII:function(e){return S(e,function(e){return y.test(e)?"xn--"+R(e):e})},toUnicode:function(e){return S(e,function(e){return b.test(e)?N(e.slice(4).toLowerCase()):e})}},void 0===(o=function(){return l}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(25)(e),n(10))},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var o,a=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?e:(o=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:r+a.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},function(e,t,n){var r,o,a={},i=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),l=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var n=function(e){return document.querySelector(e)}.call(this,e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),s=null,u=0,c=[],p=n(27);function f(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=a[r.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](r.parts[i]);for(;i<r.parts.length;i++)o.parts.push(y(r.parts[i],t))}else{var l=[];for(i=0;i<r.parts.length;i++)l.push(y(r.parts[i],t));a[r.id]={id:r.id,refs:1,parts:l}}}}function d(e,t){for(var n=[],r={},o=0;o<e.length;o++){var a=e[o],i=t.base?a[0]+t.base:a[0],l={css:a[1],media:a[2],sourceMap:a[3]};r[i]?r[i].parts.push(l):n.push(r[i]={id:i,parts:[l]})}return n}function h(e,t){var n=l(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),c.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=l(e.insertInto+" "+e.insertAt.before);n.insertBefore(t,o)}}function m(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=c.indexOf(e);t>=0&&c.splice(t,1)}function g(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),b(t,e.attrs),h(e,t),t}function b(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function y(e,t){var n,r,o,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var i=u++;n=s||(s=g(t)),r=w.bind(null,n,i,!1),o=w.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",b(t,e.attrs),h(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||a)&&(r=p(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([r],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(i),l&&URL.revokeObjectURL(l)}.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),r=function(e,t){var n=t.css,r=t.media;r&&e.setAttribute("media",r);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=i()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return f(n,t),function(e){for(var r=[],o=0;o<n.length;o++){var i=n[o];(l=a[i.id]).refs--,r.push(l)}e&&f(d(e,t),t);for(o=0;o<r.length;o++){var l;if(0===(l=r[o]).refs){for(var s=0;s<l.parts.length;s++)l.parts[s]();delete a[l.id]}}}};var v,E=(v=[],function(e,t){return v[e]=t,v.filter(Boolean).join("\n")});function w(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=E(t,o);else{var a=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(i=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),a=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(a).concat([o]).join("\n")}var i;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var a=this[o][0];"number"==typeof a&&(r[a]=!0)}for(o=0;o<e.length;o++){var i=e[o];"number"==typeof i[0]&&r[i[0]]||(n&&!i[2]?i[2]=n:n&&(i[2]="("+i[2]+") and ("+n+")"),t.push(i))}},t}},function(e,t,n){(e.exports=n(29)(!1)).push([e.i,'.spinner-container{display:inline-block;position:relative}.css-spinner{position:absolute;left:10px;top:-25px;display:block;width:40px;height:40px;background-color:#333;border-radius:100%;-webkit-animation:sk-scaleout 1s infinite ease-in-out;animation:sk-scaleout 1s infinite ease-in-out}@-webkit-keyframes sk-scaleout{0%{-webkit-transform:scale(0)}to{-webkit-transform:scale(1);opacity:0}}@keyframes sk-scaleout{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.spinner-small .css-spinner{width:20px;height:20px;top:-15px;left:5px}body.redirection-modal{overflow:hidden}.modal-wrapper{width:100%}.modal-backdrop{background-color:#999;opacity:.6;z-index:1000}.modal,.modal-backdrop{width:100%;height:100%;position:fixed;top:0;left:0}.modal{z-index:10000;text-align:center}.modal .modal-close button{position:absolute;top:0;right:0;padding-top:5px;padding-right:5px;border:none;background-color:#fff;cursor:pointer;z-index:10001}.modal .modal-content,.modal .modal-table{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;margin:auto;border-radius:5px;background:#fff;opacity:1;box-shadow:3px 3px 3px rgba(0,0,0,.2)}.modal .modal-content{width:60%;height:100px;margin-right:15%;max-width:90%;max-height:90%}.modal .modal-content h1{margin:0!important;color:#333!important}.modal-wrapper.modal-wrapper-padless .modal-content{padding:20px}.modal-wrapper-padding .modal-content{padding:10px}.geo-map{padding-bottom:10px;width:100%;position:relative}.geo-map .geo-full{height:600px}.geo-map.geo-map-small{height:100px;padding-top:20px}.geo-map iframe{top:0;background-color:#ddd;height:450px;max-height:90%}.geo-map iframe,.geo-map table{position:absolute;left:0;width:100%}.geo-map table{background-color:#fff;padding:10px;padding-bottom:30px;bottom:0;height:130px}.geo-map table td,.geo-map table th{padding:0}.geo-map table th{font-weight:700}.geo-map table td{text-align:left}.geo-map h2{line-height:1;margin:0;padding-bottom:10px}.geo-map .external{position:absolute;right:15px;bottom:10px}.useragent{box-sizing:border-box;padding-bottom:30px}.useragent th{width:120px;vertical-align:top;line-height:1}.useragent td{line-height:1.2}.useragent h2{padding-left:10px}.useragent h2,.useragent td{text-align:left}.useragent h2{margin-bottom:0;padding-bottom:5px}.useragent .useragent-agent{font-size:12px}.useragent .external{position:absolute;right:15px;bottom:15px}.useragent .agent-unknown,.useragent .agent-unknown h2{text-align:center;padding:5px}.useragent table{padding-bottom:15px}.modal-error h2{text-align:center}.modal-loading{display:flex;height:100px}.modal-loading>*{justify-content:center;align-self:center;margin-left:calc(50% - 30px);margin-top:40px}@media screen and (max-width:782px){.modal .modal-content{width:80%;margin-right:10%}.modal .geo-map iframe{height:255px}.modal .geo-map .geo-full{height:400px!important}}.redirection .wp-list-table tbody>th:not(.check-column){vertical-align:top;padding:5px}.redirection .wp-list-table .column-last_count{width:80px;text-align:left}.redirection .wp-list-table .column-date{width:150px}.redirection .wp-list-table .column-last_access{width:150px;text-align:left}.redirection .wp-list-table .column-ip,.redirection .wp-list-table .column-module,.redirection .wp-list-table .column-total{width:110px}.redirection .wp-list-table .column-redirects{width:100px;text-align:left}.redirection .wp-list-table .column-position{width:80px;text-align:left}.redirection .wp-list-table .column-code{width:50px;text-align:left}.redirection .wp-list-table strike{opacity:.7}.redirection .form-table th a{color:#444}table.edit-redirection{width:100%;padding-right:15px}table.edit-redirection th{width:130px;font-weight:700;text-align:left}table.edit-redirection tbody tr td{display:flex;padding:0}table.edit-redirection tbody tr td>*{flex:1 1 auto;justify-content:flex-start;margin-right:5px}table.edit-redirection tbody tr td .edit-redirection-regex,table.edit-redirection tbody tr td>select{flex:0 0 auto}table.edit-redirection tbody tr td .edit-redirection-position input{width:60px}table.edit-redirection tbody tr td .small-flex{flex-grow:0;padding-top:5px}.edit-groups{width:100%}.edit-groups th{line-height:1.2;vertical-align:top;padding:2px;padding-top:5px!important;padding-left:0;font-size:13px;font-weight:700}.edit-groups td{padding:2px}.edit-groups input[type=text]{width:100%}.table-buttons{float:left;padding-top:2px}.table-buttons>button,.table-buttons>div.table-button-item,.table-buttons>form{margin-right:5px!important;display:inline}.table-buttons .modal-wrapper{display:inline}@media screen and (max-width:782px){input[type=checkbox]{height:20px;width:20px}.wp-list-table td.column-primary{padding-left:10px;padding-right:10px}.redirection .wp-list-table input,.redirection .wp-list-table select,.redirection .wp-list-table td,.redirection .wp-list-table th{font-size:1em!important}.redirection .wp-list-table td.column-code,.redirection .wp-list-table td.column-date,.redirection .wp-list-table td.column-referrer,.redirection .wp-list-table td.column-url .target,.redirection .wp-list-table th.column-code,.redirection .wp-list-table th.column-date{display:none!important}table.edit-redirection{padding-right:0}table.edit-redirection th{display:block;font-weight:700;padding-left:0!important}table.edit-redirection tbody tr td{flex-wrap:wrap}table.edit-redirection tbody tr td>*{flex:1 0 auto;width:100%}table.edit-redirection input[type=number],table.edit-redirection input[type=text],table.edit-redirection select{width:100%}table.edit-groups input[type=number],table.edit-groups select,table.edit-redirection input[type=number],table.edit-redirection select{height:30px!important}}.plugin-status th{text-align:left}.plugin-status span,.plugin-status td,.plugin-status th{padding:5px;vertical-align:top}.plugin-status .plugin-status-good{background-color:#46b450;color:#fff}.plugin-status .plugin-status-problem{background-color:orange;color:#fff}.plugin-status .plugin-status-error{background-color:#ff3860;color:#fff}.github{margin-top:8px}.github a{text-decoration:none}.github img{padding-right:10px;margin-bottom:-10px}.donation .donation-amount{float:left;margin-top:10px}.donation .donation-amount span{font-size:28px;margin-top:4px;vertical-align:bottom}.donation .donation-amount img{width:24px!important;margin-bottom:-5px!important}.donation .donation-amount:after{content:"";display:block;clear:both}.donation input[type=number]{width:60px;margin-left:10px}.donation td,.donation th{padding-bottom:0;margin-bottom:0}.donation input[type=submit]{margin-left:10px}.dropzone{border:3px dashed #bbb;text-align:center;padding:10px;padding-bottom:15px;margin-bottom:10px;border-radius:4px}.dropzone,.dropzone h3{color:#666}.dropzone p{font-size:14px}.dropzone .groups{margin-top:15px;margin-bottom:15px}.dropzone .is-placeholder{width:50%;height:90px;position:relative;margin:0 auto}.dropzone-hover{border-color:#86bfd4}.dropzone-importing{border-color:transparent}.redirection-notice{position:fixed;bottom:25px;right:0;font-weight:700;box-shadow:3px 3px 3px rgba(0,0,0,.2);border-top:1px solid #eee;cursor:pointer;transition:width 1s ease-in-out}.redirection-notice p{padding-right:20px}.redirection-notice .closer{position:absolute;right:5px;top:10px;font-size:16px;opacity:.8}.redirection-notice.notice-shrunk{width:20px}.redirection-notice.notice-shrunk p{font-size:16px}.redirection-notice.notice-shrunk .closer{display:none}.notice-progress{border-left:5px solid green;padding:10px;cursor:auto;bottom:80px}.notice-progress p{margin-left:50px;animation:loading-fade 1.2s ease-in-out infinite}.notice-progress .spinner-container{position:absolute;left:0;top:33px}@keyframes loading-fade{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.placeholder-container{width:100%;height:100px;position:relative}.placeholder-loading{content:"";position:absolute;top:16px;right:8px;bottom:16px;left:8px;padding-left:8px;padding-top:8px;background-color:#c8d7e1;animation:loading-fade 1.6s ease-in-out infinite}.placeholder-inline{width:100%;height:50px;position:relative}.placeholder-inline .placeholder-loading{top:0;right:0;left:0;bottom:0}.loading-small{width:25px;height:25px}input.current-page{width:60px}.loader-wrapper{position:relative}.loader-textarea{height:100px}.wp-list-table .is-placeholder td{position:relative;height:50px}.wp-list-table .item-loading{opacity:.3}.subsubsub-container:after,.subsubsub-container:before{content:"";display:table}.subsubsub-container:after{clear:both}.wp-core-ui .button-delete{color:#fff}.wp-core-ui .button-delete,.wp-core-ui .button-delete:hover{box-shadow:none;text-shadow:none;background-color:#ff3860;border-color:transparent}.inline-notice{background:#fff;border-left:4px solid #fff;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 15px 2px;padding:1px 12px;margin:5px 0 15px;border-left-color:#ffb900}.inline-notice.inline-general{border-left-color:#46b450}.addTop{margin-top:20px}@media screen and (max-width:782px){.newsletter form input[type=email]{display:block;width:100%;margin:5px 0}.import select{width:100%;margin:5px 0}.plugin-importer button{width:100%}p.search-box input[name=s]{margin-top:20px}}.notice-error{margin-top:3em}.notice-error .closer{float:right;padding-top:5px;font-size:18px;cursor:pointer;color:#333}.notice-error textarea{font-family:courier;font-size:12px;background-color:#eee;width:100%}.notice-error span code{background-color:transparent}.module-export{border:1px solid #ddd;padding:5px;font-family:courier;margin-top:15px;width:100%;background-color:#fff!important}.redirects a.advanced{text-decoration:none}',""])},function(e,t,n){var r=n(30);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(28)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,l){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?a(i(e),function(i){var l=encodeURIComponent(r(i))+n;return o(e[i])?a(e[i],function(e){return l+encodeURIComponent(r(e))}).join(t):l+encodeURIComponent(r(e[i]))}).join(t):l?encodeURIComponent(r(l))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var i=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,a){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var l=/\+/g;e=e.split(t);var s=1e3;a&&"number"==typeof a.maxKeys&&(s=a.maxKeys);var u=e.length;s>0&&u>s&&(u=s);for(var c=0;c<u;++c){var p,f,d,h,m=e[c].replace(l,"%20"),g=m.indexOf(n);g>=0?(p=m.substr(0,g),f=m.substr(g+1)):(p=m,f=""),d=decodeURIComponent(p),h=decodeURIComponent(f),r(i,d)?o(i[d])?i[d].push(h):i[d]=[i[d],h]:i[d]=h}return i};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=n(6),o=n(7),a=n(35);e.exports=function(){function e(e,t,n,r,i,l){l!==a&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t){e.exports=
18
  /**
19
  * Exposes number format capability through i18n mixin
20
  *
1
+ /*! Redirection v3.3.1 */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=56)}([function(e,t,n){"use strict";e.exports=n(54)},function(e,t,n){var r=n(45),o=new r;e.exports={numberFormat:o.numberFormat.bind(o),translate:o.translate.bind(o),configure:o.configure.bind(o),setLocale:o.setLocale.bind(o),getLocale:o.getLocale.bind(o),getLocaleSlug:o.getLocaleSlug.bind(o),addTranslations:o.addTranslations.bind(o),reRenderTranslations:o.reRenderTranslations.bind(o),registerComponentUpdateHook:o.registerComponentUpdateHook.bind(o),registerTranslateHook:o.registerTranslateHook.bind(o),state:o.state,stateObserver:o.stateObserver,on:o.stateObserver.on.bind(o.stateObserver),off:o.stateObserver.removeListener.bind(o.stateObserver),emit:o.stateObserver.emit.bind(o.stateObserver),$this:o,I18N:r}},function(e,t,n){e.exports=n(36)()},function(e,t,n){var r;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
14
  object-assign
15
  (c) Sindre Sorhus
16
  @license MIT
17
+ */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,l=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var u in n=Object(arguments[s]))o.call(n,u)&&(l[u]=n[u]);if(r){i=r(n);for(var c=0;c<i.length;c++)a.call(n,i[c])&&(l[i[c]]=n[i[c]])}}return l}},function(e,t){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=13)}([function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var n=e.exports={version:"2.5.0"};"number"==typeof __e&&(__e=n)},function(e,t,n){e.exports=!n(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(32)("wks"),o=n(9),a=n(0).Symbol,i="function"==typeof a;(e.exports=function(e){return r[e]||(r[e]=i&&a[e]||(i?a:o)("Symbol."+e))}).store=r},function(e,t,n){var r=n(0),o=n(2),a=n(8),i=n(22),l=n(10),s=function(e,t,n){var u,c,p,f,d=e&s.F,h=e&s.G,m=e&s.S,g=e&s.P,b=e&s.B,y=h?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,v=h?o:o[t]||(o[t]={}),E=v.prototype||(v.prototype={});for(u in h&&(n=t),n)p=((c=!d&&y&&void 0!==y[u])?y:n)[u],f=b&&c?l(p,r):g&&"function"==typeof p?l(Function.call,p):p,y&&i(y,u,p,e&s.U),v[u]!=p&&a(v,u,f),g&&E[u]!=p&&(E[u]=p)};r.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t,n){var r=n(16),o=n(21);e.exports=n(3)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(24);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(28),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return n.some(function(e){var t=e.trim();return"."===t.charAt(0)?r.toLowerCase().endsWith(t.toLowerCase()):/\/\*$/.test(t)?a===t.replace(/\/.*$/,""):o===t})}return!0},n(14),n(34)},function(e,t,n){n(15),e.exports=n(2).Array.some},function(e,t,n){"use strict";var r=n(7),o=n(25)(3);r(r.P+r.F*!n(33)([].some,!0),"Array",{some:function(e){return o(this,e,arguments[1])}})},function(e,t,n){var r=n(17),o=n(18),a=n(20),i=Object.defineProperty;t.f=n(3)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),o)try{return i(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(1);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(3)&&!n(4)(function(){return 7!=Object.defineProperty(n(19)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(1),o=n(0).document,a=r(o)&&r(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},function(e,t,n){var r=n(1);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(0),o=n(8),a=n(23),i=n(9)("src"),l=Function.toString,s=(""+l).split("toString");n(2).inspectSource=function(e){return l.call(e)},(e.exports=function(e,t,n,l){var u="function"==typeof n;u&&(a(n,"name")||o(n,"name",t)),e[t]!==n&&(u&&(a(n,i)||o(n,i,e[t]?""+e[t]:s.join(String(t)))),e===r?e[t]=n:l?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[i]||l.call(this)})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(10),o=n(26),a=n(27),i=n(12),l=n(29);e.exports=function(e,t){var n=1==e,s=2==e,u=3==e,c=4==e,p=6==e,f=5==e||p,d=t||l;return function(t,l,h){for(var m,g,b=a(t),y=o(b),v=r(l,h,3),E=i(y.length),w=0,_=n?d(t,E):s?d(t,0):void 0;E>w;w++)if((f||w in y)&&(g=v(m=y[w],w,b),e))if(n)_[w]=g;else if(g)switch(e){case 3:return!0;case 5:return m;case 6:return w;case 2:_.push(m)}else if(c)return!1;return p?-1:u||c?c:_}}},function(e,t,n){var r=n(5);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(11);e.exports=function(e){return Object(r(e))}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(30);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(1),o=n(31),a=n(6)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[a])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){var r=n(5);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(0),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){n(35),e.exports=n(2).String.endsWith},function(e,t,n){"use strict";var r=n(7),o=n(12),a=n(36),i="".endsWith;r(r.P+r.F*n(38)("endsWith"),"String",{endsWith:function(e){var t=a(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(t.length),l=void 0===n?r:Math.min(o(n),r),s=String(e);return i?i.call(t,s,l):t.slice(l-s.length,l)===s}})},function(e,t,n){var r=n(37),o=n(11);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(e))}},function(e,t,n){var r=n(1),o=n(5),a=n(6)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(6)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}}])},function(e,t,n){"use strict";var r=n(4).compose;t.__esModule=!0,t.composeWithDevTools=function(){if(0!==arguments.length)return"object"==typeof arguments[0]?r:r.apply(null,arguments)},t.devToolsEnhancer=function(){return function(e){return e}}},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(this,n(10))},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a=Object.defineProperty,i=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,s=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,c=u&&u(Object);e.exports=function e(t,n,p){if("string"!=typeof n){if(c){var f=u(n);f&&f!==c&&e(t,f,p)}var d=i(n);l&&(d=d.concat(l(n)));for(var h=0;h<d.length;++h){var m=d[h];if(!(r[m]||o[m]||p&&p[m])){var g=s(n,m);try{a(t,m,g)}catch(e){}}}return t}return t}},function(e,t,n){"use strict";e.exports=n(46)},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(53)},function(e,t){function n(e){var t,r=function(){};function o(e,t,n){e&&e.then?e.then(function(e){o(e,t,n)}).catch(function(e){o(e,n,n)}):t(e)}function a(e){t=function(t,n){try{e(t,n)}catch(e){n(e)}},r(),r=void 0}function i(e){a(function(t,n){n(e)})}function l(e){a(function(t){t(e)})}function s(e,n){var o=r;r=function(){o(),t(e,n)}}function u(e){!t&&o(e,l,i)}function c(e){!t&&o(e,i,i)}var p={then:function(e){var r=t||s;return n(function(t,n){r(function(n){t(e(n))},n)})},catch:function(e){var r=t||s;return n(function(t,n){r(t,function(t){n(e(t))})})},resolve:u,reject:c};try{e&&e(u,c)}catch(e){c(e)}return p}n.resolve=function(e){return n(function(t){t(e)})},n.reject=function(e){return n(function(t,n){n(e)})},n.race=function(e){return e=e||[],n(function(t,n){var r=e.length;if(!r)return t();for(var o=0;o<r;++o){var a=e[o];a&&a.then&&a.then(t).catch(n)}})},n.all=function(e){return e=e||[],n(function(t,n){var r=e.length,o=r;if(!r)return t();function a(){--o<=0&&t(e)}function i(t,r){t&&t.then?t.then(function(t){e[r]=t,a()}).catch(n):a()}for(var l=0;l<r;++l)i(e[l],l)})},void 0!==e&&e.exports&&(e.exports=n)},function(e,t,n){"use strict";n.r(t);var r=n(22),o=n.n(r);n(55);!window.Promise&&(window.Promise=o.a),Array.from||(Array.from=function(e){return[].slice.call(e)}),"function"!=typeof Object.assign&&(Object.assign=function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(void 0!==r&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],o=0;o<n;){var a=t[o];if(e.call(r,a,o,t))return a;o++}}});var a=n(0),i=n.n(a),l=n(21),s=n.n(l),u=n(20),c=n(1),p=n.n(c),f=n(2),d=n.n(f),h=d.a.shape({trySubscribe:d.a.func.isRequired,tryUnsubscribe:d.a.func.isRequired,notifyNestedSubs:d.a.func.isRequired,isSubscribed:d.a.func.isRequired}),m=d.a.shape({subscribe:d.a.func.isRequired,dispatch:d.a.func.isRequired,getState:d.a.func.isRequired});var g=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"store",n=arguments[1]||t+"Subscription",r=function(e){function r(n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o));return a[t]=n.store,a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,e),r.prototype.getChildContext=function(){var e;return(e={})[t]=this[t],e[n]=null,e},r.prototype.render=function(){return a.Children.only(this.props.children)},r}(a.Component);return r.propTypes={store:m.isRequired,children:d.a.element.isRequired},r.childContextTypes=((e={})[t]=m.isRequired,e[n]=h,e),r}(),b=n(19),y=n.n(b),v=n(9),E=n.n(v);var w=null,_={notify:function(){}};var O=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.store=t,this.parentSub=n,this.onStateChange=r,this.unsubscribe=null,this.listeners=_}return e.prototype.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},e.prototype.notifyNestedSubs=function(){this.listeners.notify()},e.prototype.isSubscribed=function(){return Boolean(this.unsubscribe)},e.prototype.trySubscribe=function(){var e,t;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=(e=[],t=[],{clear:function(){t=w,e=w},notify:function(){for(var n=e=t,r=0;r<n.length;r++)n[r]()},get:function(){return t},subscribe:function(n){var r=!0;return t===e&&(t=e.slice()),t.push(n),function(){r&&e!==w&&(r=!1,t===e&&(t=e.slice()),t.splice(t.indexOf(n),1))}}}))},e.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=_)},e}(),x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var k=0,S={};function C(){}function j(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.getDisplayName,i=void 0===o?function(e){return"ConnectAdvanced("+e+")"}:o,l=r.methodName,s=void 0===l?"connectAdvanced":l,u=r.renderCountProp,c=void 0===u?void 0:u,p=r.shouldHandleStateChanges,f=void 0===p||p,d=r.storeKey,g=void 0===d?"store":d,b=r.withRef,v=void 0!==b&&b,w=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(r,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),_=g+"Subscription",j=k++,P=((t={})[g]=m,t[_]=h,t),T=((n={})[_]=h,n);return function(t){E()("function"==typeof t,"You must pass a component to the function returned by "+s+". Instead received "+JSON.stringify(t));var n=t.displayName||t.name||"Component",r=i(n),o=x({},w,{getDisplayName:i,methodName:s,renderCountProp:c,shouldHandleStateChanges:f,storeKey:g,withRef:v,displayName:r,wrappedComponentName:n,WrappedComponent:t}),l=function(n){function i(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,n.call(this,e,t));return o.version=j,o.state={},o.renderCount=0,o.store=e[g]||t[g],o.propsMode=Boolean(e[g]),o.setWrappedInstance=o.setWrappedInstance.bind(o),E()(o.store,'Could not find "'+g+'" in either the context or props of "'+r+'". Either wrap the root component in a <Provider>, or explicitly pass "'+g+'" as a prop to "'+r+'".'),o.initSelector(),o.initSubscription(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,n),i.prototype.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[_]=t||this.context[_],e},i.prototype.componentDidMount=function(){f&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},i.prototype.componentWillReceiveProps=function(e){this.selector.run(e)},i.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},i.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=C,this.store=null,this.selector.run=C,this.selector.shouldComponentUpdate=!1},i.prototype.getWrappedInstance=function(){return E()(v,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+s+"() call."),this.wrappedInstance},i.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},i.prototype.initSelector=function(){var t=e(this.store.dispatch,o);this.selector=function(e,t){var n={run:function(r){try{var o=e(t.getState(),r);(o!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=o,n.error=null)}catch(e){n.shouldComponentUpdate=!0,n.error=e}}};return n}(t,this.store),this.selector.run(this.props)},i.prototype.initSubscription=function(){if(f){var e=(this.propsMode?this.props:this.context)[_];this.subscription=new O(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},i.prototype.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(S)):this.notifyNestedSubs()},i.prototype.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},i.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},i.prototype.addExtraProps=function(e){if(!(v||c||this.propsMode&&this.subscription))return e;var t=x({},e);return v&&(t.ref=this.setWrappedInstance),c&&(t[c]=this.renderCount++),this.propsMode&&this.subscription&&(t[_]=this.subscription),t},i.prototype.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(a.createElement)(t,this.addExtraProps(e.props))},i}(a.Component);return l.WrappedComponent=t,l.displayName=r,l.childContextTypes=T,l.contextTypes=P,l.propTypes=P,y()(l,t)}}var P=Object.prototype.hasOwnProperty;function T(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function N(e,t){if(T(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!P.call(t,n[o])||!T(e[n[o]],t[n[o]]))return!1;return!0}var R=n(4),D=n(17),A="object"==typeof self&&self&&self.Object===Object&&self,I=(D.a||A||Function("return this")()).Symbol,L=Object.prototype;L.hasOwnProperty,L.toString,I&&I.toStringTag;Object.prototype.toString;I&&I.toStringTag;Object.getPrototypeOf,Object;var U=Function.prototype,F=Object.prototype,M=U.toString;F.hasOwnProperty,M.call(Object);function B(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function z(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function G(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=z(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=z(o),o=r(t,n)),o},r}}var W=[function(e){return"function"==typeof e?G(e):void 0},function(e){return e?void 0:B(function(e){return{dispatch:e}})},function(e){return e&&"object"==typeof e?B(function(t){return Object(R.bindActionCreators)(e,t)}):void 0}];var H=[function(e){return"function"==typeof e?G(e):void 0},function(e){return e?void 0:B(function(){return{}})}],V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function q(e,t,n){return V({},n,e,t)}var $=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r=n.pure,o=n.areMergedPropsEqual,a=!1,i=void 0;return function(t,n,l){var s=e(t,n,l);return a?r&&o(s,i)||(i=s):(a=!0,i=s),i}}}(e):void 0},function(e){return e?void 0:function(){return q}}];function K(e,t,n,r){return function(o,a){return n(e(o,a),t(r,a),a)}}function Q(e,t,n,r,o){var a=o.areStatesEqual,i=o.areOwnPropsEqual,l=o.areStatePropsEqual,s=!1,u=void 0,c=void 0,p=void 0,f=void 0,d=void 0;function h(o,s){var h,m,g=!i(s,c),b=!a(o,u);return u=o,c=s,g&&b?(p=e(u,c),t.dependsOnOwnProps&&(f=t(r,c)),d=n(p,f,c)):g?(e.dependsOnOwnProps&&(p=e(u,c)),t.dependsOnOwnProps&&(f=t(r,c)),d=n(p,f,c)):b?(h=e(u,c),m=!l(h,p),p=h,m&&(d=n(p,f,c)),d):d}return function(o,a){return s?h(o,a):(p=e(u=o,c=a),f=t(r,c),d=n(p,f,c),s=!0,d)}}function Y(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,a=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),i=n(e,a),l=r(e,a),s=o(e,a);return(a.pure?Q:K)(i,l,s,e,a)}var J=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function X(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function Z(e,t){return e===t}var ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.connectHOC,n=void 0===t?j:t,r=e.mapStateToPropsFactories,o=void 0===r?H:r,a=e.mapDispatchToPropsFactories,i=void 0===a?W:a,l=e.mergePropsFactories,s=void 0===l?$:l,u=e.selectorFactory,c=void 0===u?Y:u;return function(e,t,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=a.pure,u=void 0===l||l,p=a.areStatesEqual,f=void 0===p?Z:p,d=a.areOwnPropsEqual,h=void 0===d?N:d,m=a.areStatePropsEqual,g=void 0===m?N:m,b=a.areMergedPropsEqual,y=void 0===b?N:b,v=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=X(e,o,"mapStateToProps"),w=X(t,i,"mapDispatchToProps"),_=X(r,s,"mergeProps");return n(c,J({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:w,initMergeProps:_,pure:u,areStatesEqual:f,areOwnPropsEqual:h,areStatePropsEqual:g,areMergedPropsEqual:y},v))}}(),te=n(16);function ne(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var re=ne();re.withExtraArgument=ne;var oe=re,ae="SETTING_LOAD_START",ie="SETTING_LOAD_SUCCESS",le="SETTING_LOAD_FAILED",se="SETTING_LOAD_STATUS",ue="SETTING_SAVING",ce="SETTING_SAVED",pe="SETTING_SAVE_FAILED",fe="STATUS_IN_PROGRESS",de="STATUS_FAILED",he="STATUS_COMPLETE",me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var ge="LOG_LOADING",be="LOG_LOADED",ye="LOG_FAILED",ve="LOG_SET_SELECTED",Ee="LOG_SET_ALL_SELECTED",we="LOG_ITEM_SAVING",_e="LOG_ITEM_SAVED",Oe="LOG_ITEM_FAILED",xe="log",ke=n(5),Se=n.n(ke),Ce=["groups","404s","log","io","options","support"];function je(e,t){history.pushState({},null,function(e,t,n){var r=Pe(n);for(var o in e)e[o]&&t[o]!==e[o]?r[o.toLowerCase()]=e[o]:t[o]===e[o]&&delete r[o.toLowerCase()];r.filterby&&!r.filter&&delete r.filterby;return"?"+ke.stringify(r)}(e,t))}function Pe(e){return ke.parse(e?e.slice(1):document.location.search.slice(1))}function Te(e){var t=Pe(e);return-1!==Ce.indexOf(t.sub)?t.sub:"redirect"}var Ne=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Re=["orderby","direction","page","per_page","filter","filterBy"],De=function(e,t){for(var n=[],r=0;r<e.length;r++)-1===t.indexOf(e[r])&&n.push(e[r]);return n},Ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=Pe(),a={orderby:n,direction:"desc",page:0,per_page:parseInt(Redirectioni10n.per_page,10),selected:[],filterBy:"",filter:""},i=void 0===o.sub?"":o.sub;return-1===r.indexOf(i)?a:Ne({},a,{orderby:o.orderby&&-1!==e.indexOf(o.orderby)?o.orderby:a.orderby,direction:o.direction&&"asc"===o.direction?"asc":a.direction,page:o.offset&&parseInt(o.offset,10)>0?parseInt(o.offset,10):a.page,per_page:Redirectioni10n.per_page?parseInt(Redirectioni10n.per_page,10):a.per_page,filterBy:o.filterby&&-1!==t.indexOf(o.filterby)?o.filterby:a.filterBy,filter:o.filter?o.filter:a.filter})},Ie=function(e,t){for(var n=Object.assign({},e),r=0;r<Re.length;r++)void 0!==t[Re[r]]&&(n[Re[r]]=t[Re[r]]);return n},Le=function(e,t){return"desc"===e.direction&&delete e.direction,e.orderby===t&&delete e.orderby,0===e.page&&delete e.page,e.per_page===parseInt(Redirectioni10n.per_page,10)&&delete e.per_page,""===e.filterBy&&""===e.filter&&(delete e.filterBy,delete e.filter),25!==parseInt(Redirectioni10n.per_page,10)&&(e.per_page=parseInt(Redirectioni10n.per_page,10)),delete e.selected,e},Ue=function(e){return Object.assign({},e,{selected:[]})},Fe=function(e,t){return Ne({},e,{selected:De(e.selected,t).concat(De(t,e.selected))})},Me=function(e,t,n){return Ne({},e,{selected:n?t.map(function(e){return e.id}):[]})},Be=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ze=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Redirectioni10n.WP_API_root+"redirection/v1/"+e+"/";if(n._wpnonce=Redirectioni10n.WP_API_nonce,n&&Object.keys(n).length>0&&(t=n,n=Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){return e[n]=t[n],e},{}),Object.keys(n).length>0)){var o=r+(-1===Redirectioni10n.WP_API_root.indexOf("?")?"?":"&")+Se.a.stringify(n);return-1!==Redirectioni10n.WP_API_root.indexOf("page=redirection.php")?o.replace(/page=(\d+)/,"ppage=$1"):o}return r},Ge=function(e){return{url:e,headers:function(e){return-1!==e.indexOf("rest_route")||-1!==e.indexOf("/wp-json/")?new Headers({"Content-Type":"application/json; charset=utf-8"}):new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"})}(e),credentials:"same-origin"}},We=function(e,t){return Be({},Ge(ze(e,t)),{method:"post"})},He=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Be({},Ge(ze(e,t)),{method:"get"})},Ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Be({},Ge(ze(e,n)),{method:"post",params:t});return Object.keys(t).length>0&&(r.body=JSON.stringify(t)),r},qe={get:function(){return He("setting")},update:function(e){return Ve("setting",e)}},$e={list:function(e){return He("redirect",e)},update:function(e,t){return Ve("redirect/"+e,t)},create:function(e){return Ve("redirect",e)}},Ke={list:function(e){return He("group",e)},update:function(e,t){return Ve("group/"+e,t)},create:function(e){return Ve("group",e)}},Qe={list:function(e){return He("log",e)},deleteAll:function(e){return We("log",e)}},Ye={list:function(e){return He("404",e)},deleteAll:function(e){return We("404",e)}},Je={get:function(){return He("import")},upload:function(e,t){return function(e,t){var n=Be({},Ge(ze(e)),{method:"post"});return n.headers.delete("Content-Type"),n.body=new FormData,n.body.append("file",t),n}("import/file/"+e,t)},pluginList:function(){return He("import/plugin")},pluginImport:function(e){return Ve("import/plugin/"+e)}},Xe={file:function(e,t){return He("export/"+e+"/"+t)}},Ze={status:function(){return He("plugin")},fix:function(){return Ve("plugin")},delete:function(){return We("plugin/delete")}},et={redirect:function(e,t,n){return Ve("bulk/redirect/"+e,t,n)},group:function(e,t,n){return Ve("bulk/group/"+e,t,n)},log:function(e,t,n){return Ve("bulk/log/"+e,t,n)},error:function(e,t,n){return Ve("bulk/404/"+e,t,n)}},tt=function(e){return"https://api.redirect.li/v1/"+e+(-1===e.indexOf("?")?"?":"&")+"ref=redirection"},nt={getGeo:function(e){return{url:tt("ip/"+e+"?locale="+Redirectioni10n.localeSlug.substr(0,2)),method:"get"}}},rt={get:function(e){return{url:tt("useragent/"+encodeURIComponent(e)),method:"get"}}},ot=function(e){return e.action=function(e){return e.url.replace(Redirectioni10n.WP_API_root,"").replace(/[\?&]_wpnonce=[a-f0-9]*/,"")+" "+e.method.toUpperCase()}(e),fetch(e.url,e).then(function(t){if(!t||!t.status)throw{message:"No data or status object returned in request",code:0};return t.status&&void 0!==t.statusText&&(e.status=t.status,e.statusText=t.statusText),t.headers.get("x-wp-nonce")&&(Redirectioni10n.WP_API_nonce=t.headers.get("x-wp-nonce")),t.text()}).then(function(t){e.raw=t;try{var n=JSON.parse(t.replace(/\ufeff/,""));if(e.status&&200!==e.status)throw{message:function(e){return 0===e?"Admin AJAX returned 0":e.message?e.message:"Unknown error "+e}(n),code:function(e){return e.error_code?e.error_code:e.data&&e.data.error_code?e.data.error_code:0===e?"admin-ajax":e.code?e.code:"unknown"}(n),request:e,data:n.data?n.data:null};if(0===n)throw{message:"Failed to get data",code:"json-zero"};return n}catch(t){throw t.request=e,t}})},at=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function it(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var lt=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return function(a,i){var l=i()[r.store],s=l.table,u=l.total,p={items:n?[n]:s.selected,bulk:t};if("delete"===t&&s.page>0&&s.per_page*s.page==u-1&&(s.page-=1),"delete"!==t||confirm(Object(c.translate)("Are you sure you want to delete this item?","Are you sure you want to delete these items?",{count:p.items.length}))){var f=Ie(s,p),d=at({items:p.items.join(",")},o);return ot(e(t,d,Le(s,r.order))).then(function(e){a(at({type:r.saved},e,{saving:p.items}))}).catch(function(e){a({type:r.failed,error:e,saving:p.items})}),a({type:r.saving,table:f,saving:p.items})}}},st=function(e,t,n,r,o){return ot(e).then(function(e){o({type:r.saved,item:e.item,items:e.items,total:e.total,saving:[n.id]})}).catch(function(e){o({type:r.failed,error:e,item:n,saving:[n.id]})}),o({type:r.saving,table:t,item:n,saving:[n.id]})},ut=function(e,t,n){return function(r,o){var a=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(o()[n.store],[]);return a.page=0,a.orderby="id",a.direction="desc",st(e(t),a,t,n,r)}},ct=function(e,t,n,r){return function(o,a){var i=a()[r.store].table;return st(e(t,n),i,n,r,o)}},pt=function(e,t){for(var n in e)if(e[n]!==t[n])return!1;return!0},ft=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(e){return e},i=o.table,l=void 0===i?{}:i,s=o.rows,u=a(Ie(l,r)),c=Le(at({},l,r),n.order);if(!(pt(u,l)&&s.length>0&&pt(r,{})))return ot(e(c)).then(function(e){t(at({type:n.saved},e))}).catch(function(e){t({type:n.failed,error:e})}),t(at({table:u,type:n.saving},function(e,t){var n={};for(var r in t)void 0===e[r]&&(n[r]=t[r]);return n}(u,r)))},dt=function(e,t,n,r,o){var a=o.table,i=Le(at({},a,r),n.order);ot(e(i)).then(function(e){t(at({type:n.saved},e))}).catch(function(e){t({type:n.failed,error:e})})},ht=function(e,t,n){for(var r=e.slice(0),o=0;o<e.length;o++)parseInt(e[o].id,10)===t.id&&(r[o]=n(e[o]));return r},mt=function(e,t){return t.item?ht(e.rows,t.item,function(e){return at({},e,t.item,{original:e})}):e.rows},gt=function(e,t){return t.item?ht(e.rows,t.item,function(e){return e.original}):e.rows},bt=function(e,t){return t.item?mt(e,t):t.items?t.items:e.rows},yt=function(e,t){return t.table?at({},e.table,t.table):e.table},vt=function(e,t){return void 0!==t.total?t.total:e.total},Et=function(e,t){return[].concat(it(e.saving),it(t.saving))},wt=function(e,t){return e.saving.filter(function(e){return-1===t.saving.indexOf(e)})},_t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var Ot="ERROR_LOADING",xt="ERROR_LOADED",kt="ERROR_FAILED",St="ERROR_SET_SELECTED",Ct="ERROR_SET_ALL_SELECTED",jt="ERROR_ITEM_SAVING",Pt="ERROR_ITEM_SAVED",Tt="ERROR_ITEM_FAILED",Nt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var Rt="IO_EXPORTED",Dt="IO_EXPORTING",At="IO_IMPORTING",It="IO_IMPORTED",Lt="IO_FAILED",Ut="IO_CLEAR",Ft="IO_ADD_FILE",Mt="IO_IMPORTERS",Bt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var zt="GROUP_LOADING",Gt="GROUP_LOADED",Wt="GROUP_FAILED",Ht="GROUP_SET_SELECTED",Vt="GROUP_SET_ALL_SELECTED",qt="GROUP_ITEM_SAVING",$t="GROUP_ITEM_FAILED",Kt="GROUP_ITEM_SAVED",Qt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var Yt="REDIRECT_LOADING",Jt="REDIRECT_LOADED",Xt="REDIRECT_FAILED",Zt="REDIRECT_SET_SELECTED",en="REDIRECT_SET_ALL_SELECTED",tn="REDIRECT_ITEM_SAVING",nn="REDIRECT_ITEM_FAILED",rn="REDIRECT_ITEM_SAVED",on="REDIRECT_ADD_TOP",an=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var ln="MESSAGE_CLEAR_ERRORS",sn="MESSAGE_CLEAR_NOTICES",un=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cn=function(e,t){return e.slice(0).concat([t])},pn=function(e,t){return e.slice(0).concat([t])},fn=function(e){return Math.max(0,e.inProgress-1)},dn={REDIRECT_ITEM_SAVED:Object(c.translate)("Redirection saved"),LOG_ITEM_SAVED:Object(c.translate)("Log deleted"),SETTING_SAVED:Object(c.translate)("Settings saved"),GROUP_ITEM_SAVED:Object(c.translate)("Group saved"),ERROR_ITEM_SAVED:Object(c.translate)("404 deleted")};var hn="INFO_LOADING",mn="INFO_LOADED_GEO",gn="INFO_LOADED_AGENT",bn="INFO_FAILED",yn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function vn(e,t,n){return yn({},e,(r={},o=t[n],a=t,o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a,r));var r,o,a}var En=Object(R.combineReducers)({settings:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case ae:return me({},e,{loadStatus:fe});case ie:return me({},e,{loadStatus:he,values:t.values,groups:t.groups,postTypes:t.postTypes,installed:t.installed,canDelete:t.canDelete});case le:return me({},e,{loadStatus:de,error:t.error});case ue:return me({},e,{saveStatus:fe});case ce:return me({},e,{saveStatus:he,values:t.values,groups:t.groups,installed:t.installed});case pe:return me({},e,{saveStatus:de,error:t.error});case se:return me({},e,{pluginStatus:t.pluginStatus})}return e},log:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case Ee:return _t({},e,{table:Me(e.table,e.rows,t.onoff)});case ve:return _t({},e,{table:Fe(e.table,t.items)});case we:return _t({},e,{table:Ue(yt(e,t)),saving:Et(e,t),rows:mt(e,t)});case _e:return _t({},e,{rows:bt(e,t),total:vt(e,t),saving:wt(e,t)});case ge:return _t({},e,{table:yt(e,t),status:fe,saving:[],logType:t.logType,requestCount:e.requestCount+1});case ye:return _t({},e,{status:de,saving:[]});case be:return _t({},e,{rows:bt(e,t),status:he,total:vt(e,t),table:Ue(e.table)});case Oe:return _t({},e,{saving:wt(e,t),rows:gt(e,t)})}return e},error:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case Ct:return Nt({},e,{table:Me(e.table,e.rows,t.onoff)});case St:return Nt({},e,{table:Fe(e.table,t.items)});case jt:return Nt({},e,{table:Ue(yt(e,t)),saving:Et(e,t),rows:mt(e,t)});case Pt:return Nt({},e,{rows:bt(e,t),total:vt(e,t),saving:wt(e,t)});case Ot:return Nt({},e,{table:yt(e,t),status:fe,saving:[],logType:t.logType,requestCount:e.requestCount+1});case kt:return Nt({},e,{status:de,saving:[]});case xt:return Nt({},e,{rows:bt(e,t),status:he,total:vt(e,t),table:Ue(e.table)});case Tt:return Nt({},e,{saving:wt(e,t),rows:gt(e,t)})}return e},io:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case Dt:return Bt({},e,{exportStatus:fe});case Rt:return Bt({},e,{exportStatus:he,exportData:t.data});case Ft:return Bt({},e,{file:t.file});case Ut:return Bt({},e,{file:!1,lastImport:!1,exportData:!1});case Lt:return Bt({},e,{importingStatus:de,exportStatus:de,lastImport:!1,file:!1,exportData:!1});case At:return Bt({},e,{importingStatus:fe,lastImport:!1,file:!!t.file&&t.file});case It:return Bt({},e,{lastImport:t.total,importingStatus:he,file:!1});case Mt:return Bt({},e,{importers:t.importers})}return e},group:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case zt:return Qt({},e,{table:yt(e,t),status:fe,saving:[]});case Gt:return Qt({},e,{rows:bt(e,t),status:he,total:vt(e,t),table:Ue(e.table)});case qt:return Qt({},e,{table:Ue(yt(e,t)),saving:Et(e,t),rows:mt(e,t)});case Kt:return Qt({},e,{rows:bt(e,t),total:vt(e,t),saving:wt(e,t)});case Vt:return Qt({},e,{table:Me(e.table,e.rows,t.onoff)});case Ht:return Qt({},e,{table:Fe(e.table,t.items)});case Wt:return Qt({},e,{status:de,saving:[]});case $t:return Qt({},e,{saving:wt(e,t),rows:gt(e,t)})}return e},redirect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case on:return an({},e,{addTop:t.onoff});case Yt:return an({},e,{table:yt(e,t),status:fe,saving:[]});case Jt:return an({},e,{rows:bt(e,t),status:he,total:vt(e,t),table:Ue(e.table)});case tn:return an({},e,{table:Ue(yt(e,t)),saving:Et(e,t),rows:mt(e,t)});case rn:return an({},e,{rows:bt(e,t),total:vt(e,t),saving:wt(e,t)});case en:return an({},e,{table:Me(e.table,e.rows,t.onoff)});case Zt:return an({},e,{table:Fe(e.table,t.items)});case Xt:return an({},e,{status:de,saving:[]});case nn:return an({},e,{saving:wt(e,t),rows:gt(e,t)})}return e},message:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case Lt:case Wt:case nn:case $t:case ye:case Oe:case le:case pe:case Tt:case kt:case Xt:var n=cn(e.errors,t.error);return console.error(t.error.message),un({},e,{errors:n,inProgress:fn(e)});case we:case tn:case ue:case jt:case qt:return un({},e,{inProgress:e.inProgress+1});case _e:case rn:case ce:case Kt:case Pt:return un({},e,{notices:pn(e.notices,dn[t.type]),inProgress:fn(e)});case sn:return un({},e,{notices:[]});case ln:return un({},e,{errors:[]})}return e},info:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case hn:return yn({},e,{status:fe});case mn:return yn({},e,{status:he,maps:vn(e.maps,t.map,"ip")});case gn:return yn({},e,{status:he,agents:vn(e.agents,t.agent,"agent")});case bn:return yn({},e,{status:de,error:t.error})}return e}}),wn=Object(te.composeWithDevTools)({name:"Redirection"}),_n=[oe,function(){return function(e){return function(t){switch(t.type){case tn:case qt:case Yt:case zt:case ge:case Ot:!function(e,t){var n=Te(),r={redirect:[[Yt,tn],"id"],groups:[[zt,qt],"name"],log:[[ge],"date"],"404s":[[Ot],"date"]};r[n]&&e===r[n][0].find(function(t){return t===e})&&je({orderby:t.orderby,direction:t.direction,offset:t.page,per_page:t.per_page,filter:t.filter,filterBy:t.filterBy},{orderby:r[n][1],direction:"desc",offset:0,filter:"",filterBy:"",per_page:parseInt(Redirectioni10n.per_page,10)})}(t.type,t.table?t.table:t)}return e(t)}}}];function On(){var e=Redirectioni10n&&Redirectioni10n.preload&&Redirectioni10n.preload.pluginStatus?Redirectioni10n.preload.pluginStatus:[];return{loadStatus:fe,saveStatus:!1,error:!1,installed:"",settings:{},postTypes:[],pluginStatus:e,canDelete:!1}}function xn(){return{settings:On(),log:{rows:[],saving:[],logType:xe,total:0,status:fe,table:Ae(["ip","url"],["ip"],"date",["log"]),requestCount:0},error:{rows:[],saving:[],logType:xe,total:0,status:fe,table:Ae(["ip","url"],["ip"],"date",["404s"]),requestCount:0},io:{status:fe,file:!1,lastImport:!1,exportData:!1,importingStatus:!1,exportStatus:!1,importers:[]},group:{rows:[],saving:[],total:0,status:fe,table:Ae(["name"],["name","module"],"name",["groups"])},redirect:{rows:[],saving:[],total:0,addTop:!1,status:fe,table:Ae(["url","position","last_count","id","last_access"],["group"],"id",[""])},message:{errors:[],notices:[],inProgress:0,saving:[]},info:{status:fe,maps:{},agents:{},error:""}}}n(31);var kn=function(){return function(e,t){return t().settings.loadStatus===he?null:(ot(qe.get()).then(function(t){e({type:ie,values:t.settings,groups:t.groups,postTypes:t.post_types,installed:t.installed,canDelete:t.canDelete})}).catch(function(t){e({type:le,error:t})}),e({type:ae}))}},Sn=function(e){return function(t){return ot(qe.update(e)).then(function(e){t({type:ce,values:e.settings,groups:e.groups,installed:e.installed})}).catch(function(e){t({type:pe,error:e})}),t({type:ue})}},Cn=function(){return function(e){return ot(Ze.delete()).then(function(e){document.location.href=e.location}).catch(function(t){e({type:pe,error:t})}),e({type:ue})}},jn=function(){return function(e){return ot(Ze.status()).then(function(t){e({type:se,pluginStatus:t})}).catch(function(t){e({type:le,error:t})}),e({type:ae})}},Pn=function(){return function(e){return ot(Ze.fix()).then(function(t){e({type:se,pluginStatus:t})}).catch(function(t){e({type:le,error:t})}),e({type:ae})}},Tn=function(e){var t=e.title,n=e.url,r=void 0!==n&&n;return i.a.createElement("tr",null,i.a.createElement("th",null,!r&&t,r&&i.a.createElement("a",{href:r,target:"_blank"},t)),i.a.createElement("td",null,e.children))},Nn=function(e){return i.a.createElement("table",{className:"form-table"},i.a.createElement("tbody",null,e.children))},Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dn=function e(t){var n=t.value,r=t.text;return"object"===(void 0===n?"undefined":Rn(n))?i.a.createElement("optgroup",{label:r},n.map(function(t,n){return i.a.createElement(e,{text:t.text,value:t.value,key:n})})):i.a.createElement("option",{value:n},r)},An=function(e){var t=e.items,n=e.value,r=e.name,o=e.onChange,a=e.isEnabled,l=void 0===a||a;return i.a.createElement("select",{name:r,value:n,onChange:o,disabled:!l},t.map(function(e,t){return i.a.createElement(Dn,{value:e.value,text:e.text,key:t})}))},In=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ln=[{value:-1,text:Object(c.translate)("No logs")},{value:1,text:Object(c.translate)("A day")},{value:7,text:Object(c.translate)("A week")},{value:30,text:Object(c.translate)("A month")},{value:60,text:Object(c.translate)("Two months")},{value:0,text:Object(c.translate)("Forever")}],Un=[{value:-1,text:Object(c.translate)("Never cache")},{value:1,text:Object(c.translate)("An hour")},{value:24,text:Object(c.translate)("A day")},{value:168,text:Object(c.translate)("A week")},{value:0,text:Object(c.translate)("Forever")}],Fn=[{value:0,text:Object(c.translate)("No IP logging")},{value:1,text:Object(c.translate)("Full IP logging")},{value:2,text:Object(c.translate)("Anonymize IP (mask last part)")}],Mn=[{value:0,text:Object(c.translate)("Default /wp-json/")},{value:1,text:Object(c.translate)("Raw /index.php?rest_route=/")},{value:2,text:Object(c.translate)("Proxy over Admin AJAX")},{value:3,text:Object(c.translate)("Relative /wp-json/")},{value:4,text:Object(c.translate)("Form request")}],Bn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.onChange=function(e){var t=e.target,r="checkbox"===t.type?t.checked:t.value;n.setState(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t.name,r))},n.onSubmit=function(e){e.preventDefault(),n.props.onSaveSettings(n.state)},n.onMonitor=function(e){var t=e.target.name.replace("monitor_type_",""),r=n.state,o=r.monitor_post,a=r.associated_redirect,i=n.state.monitor_types.filter(function(e){return e!==t});e.target.checked&&i.push(t),n.setState({monitor_types:i,monitor_post:i.length>0?o:0,associated_redirect:i.length>0?a:""})};var r=e.values.modules;return n.state=e.values,n.state.location=r[2]?r[2].location:"",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),In(t,[{key:"UNSAFE_componentWillUpdate",value:function(e){e.values.token!==this.props.values.token&&this.setState({token:e.values.token}),e.values.auto_target!==this.props.values.auto_target&&this.setState({auto_target:e.values.auto_target})}},{key:"renderMonitor",value:function(e){return i.a.createElement(Tn,{title:Object(c.translate)("URL Monitor Changes")+":",url:this.supportLink("options","monitor")},i.a.createElement(An,{items:e,name:"monitor_post",value:parseInt(this.state.monitor_post,10),onChange:this.onChange})," ",Object(c.translate)("Save changes to this group"),i.a.createElement("p",null,i.a.createElement("input",{type:"text",className:"regular-text",name:"associated_redirect",onChange:this.onChange,placeholder:Object(c.translate)('For example "/amp"'),value:this.state.associated_redirect})," ",Object(c.translate)("Create associated redirect (added to end of URL)")))}},{key:"renderPostTypes",value:function(){var e=this,t=this.props.postTypes,n=this.state.monitor_types,r=[],o=function(o){var a=t[o],l=!!n.find(function(e){return e===o});r.push(i.a.createElement("p",{key:o},i.a.createElement("label",null,i.a.createElement("input",{type:"checkbox",name:"monitor_type_"+o,onChange:e.onMonitor,checked:l}),Object(c.translate)("Monitor changes to %(type)s",{args:{type:a.toLowerCase()}}))))};for(var a in t)o(a);return r}},{key:"supportLink",value:function(e,t){return"https://redirection.me/support/"+e+"/?utm_source=redirection&utm_medium=plugin&utm_campaign=support"+(t?"&utm_term="+t+"#"+t:"")}},{key:"render",value:function(){var e=this.props,t=e.groups,n=e.saveStatus,r=e.installed,o=this.state.monitor_types.length>0;return i.a.createElement("form",{onSubmit:this.onSubmit},i.a.createElement(Nn,null,i.a.createElement(Tn,{title:""},i.a.createElement("label",null,i.a.createElement("input",{type:"checkbox",checked:this.state.support,name:"support",onChange:this.onChange}),i.a.createElement("span",{className:"sub"},Object(c.translate)("I'm a nice person and I have helped support the author of this plugin")))),i.a.createElement(Tn,{title:Object(c.translate)("Redirect Logs")+":",url:this.supportLink("logs")},i.a.createElement(An,{items:Ln,name:"expire_redirect",value:parseInt(this.state.expire_redirect,10),onChange:this.onChange})," ",Object(c.translate)("(time to keep logs for)")),i.a.createElement(Tn,{title:Object(c.translate)("404 Logs")+":",url:this.supportLink("tracking-404-errors")},i.a.createElement(An,{items:Ln,name:"expire_404",value:parseInt(this.state.expire_404,10),onChange:this.onChange})," ",Object(c.translate)("(time to keep logs for)")),i.a.createElement(Tn,{title:Object(c.translate)("IP Logging")+":",url:this.supportLink("options","iplogging")},i.a.createElement(An,{items:Fn,name:"ip_logging",value:parseInt(this.state.ip_logging,10),onChange:this.onChange})," ",Object(c.translate)("(select IP logging level)")," - ",i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:this.supportLink("privacy-gdpr")},Object(c.translate)("GDPR / Privacy information"))),i.a.createElement(Tn,{title:Object(c.translate)("URL Monitor")+":",url:this.supportLink("options","monitor")},this.renderPostTypes()),o&&this.renderMonitor(t),i.a.createElement(Tn,{title:Object(c.translate)("RSS Token")+":",url:this.supportLink("options","rsstoken")},i.a.createElement("input",{className:"regular-text",type:"text",value:this.state.token,name:"token",onChange:this.onChange}),i.a.createElement("br",null),i.a.createElement("span",{className:"sub"},Object(c.translate)("A unique token allowing feed readers access to Redirection log RSS (leave blank to auto-generate)"))),i.a.createElement(Tn,{title:Object(c.translate)("Auto-generate URL")+":",url:this.supportLink("options","autogenerate")},i.a.createElement("input",{className:"regular-text",type:"text",value:this.state.auto_target,name:"auto_target",onChange:this.onChange}),i.a.createElement("br",null),i.a.createElement("span",{className:"sub"},Object(c.translate)("Used to auto-generate a URL if no URL is given. Use the special tags {{code}}$dec${{/code}} or {{code}}$hex${{/code}} to insert a unique ID instead",{components:{code:i.a.createElement("code",null)}}))),i.a.createElement(Tn,{title:Object(c.translate)("Apache Module"),url:this.supportLink("options","apache")},i.a.createElement("label",null,i.a.createElement("p",null,i.a.createElement("input",{type:"text",className:"regular-text",name:"location",value:this.state.location,onChange:this.onChange,placeholder:r})),i.a.createElement("p",{className:"sub"},Object(c.translate)("Enter the full path and filename if you want Redirection to automatically update your {{code}}.htaccess{{/code}}.",{components:{code:i.a.createElement("code",null)}})))),i.a.createElement(Tn,{title:Object(c.translate)("Force HTTPS"),url:this.supportLink("options","force-https")},i.a.createElement("label",null,i.a.createElement("p",null,i.a.createElement("input",{type:"checkbox",name:"https",onChange:this.onChange,checked:this.state.https}),Object(c.translate)("Force a redirect from HTTP to HTTPS. Please ensure your HTTPS is working before enabling"),"  ",Object(c.translate)("(beta)")))),i.a.createElement(Tn,{title:Object(c.translate)("Redirect Cache"),url:this.supportLink("options","cache")},i.a.createElement(An,{items:Un,name:"redirect_cache",value:parseInt(this.state.redirect_cache,10),onChange:this.onChange}),"  ",i.a.createElement("span",{className:"sub"},Object(c.translate)('How long to cache redirected 301 URLs (via "Expires" HTTP header)'))),i.a.createElement(Tn,{title:Object(c.translate)("REST API"),url:this.supportLink("options","restapi")},i.a.createElement(An,{items:Mn,name:"rest_api",value:parseInt(this.state.rest_api,10),onChange:this.onChange}),"  ",i.a.createElement("span",{className:"sub"},Object(c.translate)("How Redirection uses the REST API - don't change unless necessary")))),i.a.createElement("input",{className:"button-primary",type:"submit",name:"update",value:Object(c.translate)("Update"),disabled:n===fe}))}}]),t}();var zn=ee(function(e){var t=e.settings;return{groups:t.groups,values:t.values,saveStatus:t.saveStatus,installed:t.installed,postTypes:t.postTypes}},function(e){return{onSaveSettings:function(t){e(Sn(t))}}})(Bn),Gn=n(3),Wn=n.n(Gn),Hn=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Vn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.nodeRef=function(e){n.ref=e},n.handleClick=n.onBackground.bind(n),n.ref=null,n.height=0,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Hn(t,[{key:"componentDidMount",value:function(){this.height=0,this.resize(),document.body.classList.add("redirection-modal")}},{key:"componentWillUnmount",value:function(){document.body.classList.remove("redirection-modal")}},{key:"componentWillReceiveProps",value:function(){this.resize()}},{key:"componentDidUpdate",value:function(){this.resize()}},{key:"resize",value:function(){for(var e=0,t=0;t<this.ref.children.length;t++)e+=this.ref.children[t].clientHeight;this.ref.style.height=e+"px"}},{key:"onBackground",value:function(e){"modal"===e.target.className&&this.props.onClose()}},{key:"render",value:function(){var e=this.props.onClose,t=Wn()({"modal-wrapper":!0,"modal-wrapper-padding":this.props.padding}),n={};return this.height&&(n.height=this.height+"px"),i.a.createElement("div",{className:t,onClick:this.handleClick},i.a.createElement("div",{className:"modal-backdrop"}),i.a.createElement("div",{className:"modal"},i.a.createElement("div",{className:"modal-content",ref:this.nodeRef,style:n},i.a.createElement("div",{className:"modal-close"},i.a.createElement("button",{onClick:e},"✖")),i.a.cloneElement(this.props.children,{parent:this}))))}}]),t}();Vn.defaultProps={padding:!0};var qn=Vn,$n=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Kn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isModal:!1},n.onSubmit=n.handleSubmit.bind(n),n.onClose=n.closeModal.bind(n),n.onDelete=n.handleDelete.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),$n(t,[{key:"handleSubmit",value:function(e){this.setState({isModal:!0}),e.preventDefault()}},{key:"closeModal",value:function(){this.setState({isModal:!1})}},{key:"handleDelete",value:function(){this.props.onDelete(),this.closeModal()}},{key:"showModal",value:function(){return i.a.createElement(qn,{onClose:this.onClose},i.a.createElement("div",null,i.a.createElement("h1",null,Object(c.translate)("Delete the plugin - are you sure?")),i.a.createElement("p",null,Object(c.translate)("Deleting the plugin will remove all your redirections, logs, and settings. Do this if you want to remove the plugin for good, or if you want to reset the plugin.")),i.a.createElement("p",null,Object(c.translate)("Once deleted your redirections will stop working. If they appear to continue working then please clear your browser cache.")),i.a.createElement("p",null,i.a.createElement("button",{className:"button-primary button-delete",onClick:this.onDelete},Object(c.translate)("Yes! Delete the plugin"))," ",i.a.createElement("button",{className:"button-secondary",onClick:this.onClose},Object(c.translate)("No! Don't delete the plugin")))))}},{key:"render",value:function(){return i.a.createElement("div",{className:"wrap"},i.a.createElement("form",{action:"",method:"post",onSubmit:this.onSubmit},i.a.createElement("h2",null,Object(c.translate)("Delete Redirection")),i.a.createElement("p",null,"Selecting this option will delete all redirections, all logs, and any options associated with the Redirection plugin. Make sure this is what you want to do."),i.a.createElement("input",{className:"button-primary button-delete",type:"submit",name:"delete",value:Object(c.translate)("Delete")})),this.state.isModal&&this.showModal())}}]),t}(),Qn=function(){return i.a.createElement("div",{className:"placeholder-container"},i.a.createElement("div",{className:"placeholder-loading"}))},Yn=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Jn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onDonate=n.handleDonation.bind(n),n.onChange=n.handleChange.bind(n),n.onBlur=n.handleBlur.bind(n),n.onInput=n.handleInput.bind(n),n.state={support:e.support,amount:20},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Yn(t,[{key:"handleBlur",value:function(){this.setState({amount:Math.max(16,this.state.amount)})}},{key:"handleDonation",value:function(){this.setState({support:!1})}},{key:"getReturnUrl",value:function(){return document.location.href+"#thanks"}},{key:"handleChange",value:function(e){this.state.amount!==e.value&&this.setState({amount:parseInt(e.value,10)})}},{key:"handleInput",value:function(e){var t=e.target.value?parseInt(e.target.value,10):16;this.setState({amount:t})}},{key:"getAmountoji",value:function(e){for(var t=[[100,"😍"],[80,"😎"],[60,"😊"],[40,"😃"],[20,"😀"],[10,"🙂"]],n=0;n<t.length;n++)if(e>=t[n][0])return t[n][1];return t[t.length-1][1]}},{key:"renderSupported",value:function(){return i.a.createElement("div",null,Object(c.translate)("You've supported this plugin - thank you!"),"  ",i.a.createElement("a",{href:"#",onClick:this.onDonate},Object(c.translate)("I'd like to support some more.")))}},{key:"renderUnsupported",value:function(){for(var e,t,n,r=(n="",(t=16)in(e={})?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e),o=20;o<=100;o+=20)r[o]="";return i.a.createElement("div",null,i.a.createElement("label",null,i.a.createElement("p",null,Object(c.translate)("Redirection is free to use - life is wonderful and lovely! It has required a great deal of time and effort to develop and you can help support this development by {{strong}}making a small donation{{/strong}}.",{components:{strong:i.a.createElement("strong",null)}})," ",Object(c.translate)("You get useful software and I get to carry on making it better."))),i.a.createElement("input",{type:"hidden",name:"cmd",value:"_xclick"}),i.a.createElement("input",{type:"hidden",name:"business",value:"admin@urbangiraffe.com"}),i.a.createElement("input",{type:"hidden",name:"item_name",value:"Redirection"}),i.a.createElement("input",{type:"hidden",name:"buyer_credit_promo_code",value:""}),i.a.createElement("input",{type:"hidden",name:"buyer_credit_product_category",value:""}),i.a.createElement("input",{type:"hidden",name:"buyer_credit_shipping_method",value:""}),i.a.createElement("input",{type:"hidden",name:"buyer_credit_user_address_change",value:""}),i.a.createElement("input",{type:"hidden",name:"no_shipping",value:"1"}),i.a.createElement("input",{type:"hidden",name:"return",value:this.getReturnUrl()}),i.a.createElement("input",{type:"hidden",name:"no_note",value:"1"}),i.a.createElement("input",{type:"hidden",name:"currency_code",value:"USD"}),i.a.createElement("input",{type:"hidden",name:"tax",value:"0"}),i.a.createElement("input",{type:"hidden",name:"lc",value:"US"}),i.a.createElement("input",{type:"hidden",name:"bn",value:"PP-DonationsBF"}),i.a.createElement("div",{className:"donation-amount"},"$",i.a.createElement("input",{type:"number",name:"amount",min:16,value:this.state.amount,onChange:this.onInput,onBlur:this.onBlur}),i.a.createElement("span",null,this.getAmountoji(this.state.amount)),i.a.createElement("input",{type:"submit",className:"button-primary",value:Object(c.translate)("Support 💰")})))}},{key:"render",value:function(){var e=this.state.support;return i.a.createElement("form",{action:"https://www.paypal.com/cgi-bin/webscr",method:"post",className:"donation"},i.a.createElement(Nn,null,i.a.createElement(Tn,{title:Object(c.translate)("Plugin Support")+":"},e?this.renderSupported():this.renderUnsupported())))}}]),t}(),Xn=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Zn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return e.onLoadSettings(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Xn(t,[{key:"render",value:function(){var e=this.props,t=e.loadStatus,n=e.values,r=e.canDelete,o=void 0!==r&&r;return t!==fe&&n?i.a.createElement("div",null,t===he&&i.a.createElement(Jn,{support:n.support}),t===he&&i.a.createElement(zn,null),i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("hr",null),o&&i.a.createElement(Kn,{onDelete:this.props.onDeletePlugin})):i.a.createElement(Qn,null)}}]),t}();var er=ee(function(e){var t=e.settings;return{loadStatus:t.loadStatus,values:t.values,canDelete:t.canDelete}},function(e){return{onLoadSettings:function(){e(kn())},onDeletePlugin:function(){e(Cn())}}})(Zn);var tr=ee(null,function(e){return{onSubscribe:function(){e(Sn({newsletter:!0}))}}})(function(e){return e.newsletter?i.a.createElement("div",{className:"newsletter"},i.a.createElement("h3",null,Object(c.translate)("Newsletter")),i.a.createElement("p",null,Object(c.translate)("Thanks for subscribing! {{a}}Click here{{/a}} if you need to return to your subscription.",{components:{a:i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://tinyletter.com/redirection"})}}))):i.a.createElement("div",{className:"newsletter"},i.a.createElement("h3",null,Object(c.translate)("Newsletter")),i.a.createElement("p",null,Object(c.translate)("Want to keep up to date with changes to Redirection?")),i.a.createElement("p",null,Object(c.translate)("Sign up for the tiny Redirection newsletter - a low volume newsletter about new features and changes to the plugin. Ideal if want to test beta changes before release.")),i.a.createElement("form",{action:"https://tinyletter.com/redirection",method:"post",onSubmit:e.onSubscribe},i.a.createElement("p",null,i.a.createElement("label",null,Object(c.translate)("Your email address:")," ",i.a.createElement("input",{type:"email",name:"email",id:"tlemail"})," ",i.a.createElement("input",{type:"submit",value:"Subscribe",className:"button-secondary"})),i.a.createElement("input",{type:"hidden",value:"1",name:"embed"})," ",i.a.createElement("span",null,i.a.createElement("a",{href:"https://tinyletter.com/redirection",target:"_blank",rel:"noreferrer noopener"},"Powered by TinyLetter")))))}),nr=function(){return i.a.createElement("div",null,i.a.createElement("h2",null,Object(c.translate)("Need help?")),i.a.createElement("p",null,Object(c.translate)("Full documentation for Redirection can be found at {{site}}https://redirection.me{{/site}}. If you have a problem please check the {{faq}}FAQ{{/faq}} first.",{components:{site:i.a.createElement("a",{href:"https://redirection.me",target:"_blank",rel:"noopener noreferrer"}),faq:i.a.createElement("a",{href:"https://redirection.me/support/faq/",target:"_blank",rel:"noopener noreferrer"})}})),i.a.createElement("p",null,i.a.createElement("strong",null,Object(c.translate)("If you want to report a bug please read the {{report}}Reporting Bugs{{/report}} guide.",{components:{report:i.a.createElement("a",{href:"https://redirection.me/support/reporting-bugs/",target:"_blank",rel:"noopener noreferrer"})}}))),i.a.createElement("div",{className:"inline-notice inline-general"},i.a.createElement("p",{className:"github"},i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/johngodley/redirection/issues"},i.a.createElement("img",{src:Redirectioni10n.pluginBaseUrl+"/images/GitHub-Mark-64px.png",width:"32",height:"32"})),i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/johngodley/redirection/issues"},"https://github.com/johngodley/redirection/"))),i.a.createElement("p",null,Object(c.translate)("Please note that any support is provide on as-time-is-available basis and is not guaranteed. I do not provide paid support.")),i.a.createElement("p",null,Object(c.translate)("If you want to submit information that you don't want in a public repository then send it directly via {{email}}email{{/email}} - include as much information as you can!",{components:{email:i.a.createElement("a",{href:"mailto:john@redirection.me?subject=Redirection%20Issue&body="+encodeURIComponent("Redirection: "+Redirectioni10n.versions)})}})))},rr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var or=function(){return i.a.createElement("div",null,i.a.createElement("form",{action:Redirectioni10n.pluginRoot+"&sub=support",method:"POST"},i.a.createElement("input",{type:"hidden",name:"_wpnonce",value:Redirectioni10n.WP_API_nonce}),i.a.createElement("input",{type:"hidden",name:"action",value:"fixit"}),i.a.createElement("p",null,Object(c.translate)("If the magic button doesn't work then you should read the error and see if you can fix it manually, otherwise follow the 'Need help' section below.")),i.a.createElement("p",null,i.a.createElement("input",{type:"submit",className:"button-primary",value:Object(c.translate)("⚡️ Magic fix ⚡️")}))))},ar=function(e){var t=e.item;return i.a.createElement("tr",null,i.a.createElement("th",null,t.name),i.a.createElement("td",null,i.a.createElement("span",{className:"plugin-status-"+t.status},t.status.charAt(0).toUpperCase()+t.status.slice(1))," ",t.message))},ir=function(e){var t=e.status,n=t.filter(function(e){return"good"!==e.status});return i.a.createElement("div",null,i.a.createElement("table",{className:"plugin-status"},i.a.createElement("tbody",null,t.map(function(e,t){return i.a.createElement(ar,{item:e,key:t})}))),n.length>0&&i.a.createElement(or,null))},lr=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.props.onLoadStatus(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),rr(t,[{key:"render",value:function(){var e=this.props.pluginStatus;return i.a.createElement("div",null,i.a.createElement("h2",null,Object(c.translate)("Plugin Status")),e.length>0&&i.a.createElement(ir,{status:e}),0===e.length&&i.a.createElement("div",{className:"placeholder-inline"},i.a.createElement("div",{className:"placeholder-loading"})))}}]),t}();var sr=ee(function(e){return{pluginStatus:e.settings.pluginStatus}},function(e){return{onLoadStatus:function(){e(jn())},onFix:function(){e(Pn())}}})(lr),ur=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var cr=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return e.onLoadSettings(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),ur(t,[{key:"render",value:function(){var e=(this.props.values?this.props.values:{}).newsletter,t=void 0!==e&&e;return i.a.createElement("div",null,i.a.createElement(sr,null),i.a.createElement(nr,null),i.a.createElement(tr,{newsletter:t}))}}]),t}();var pr=ee(function(e){return{values:e.settings.values}},function(e){return{onLoadSettings:function(){e(kn())}}})(cr);var fr=function(e){var t,n,r,o=e.name,a=e.text,l=e.table,s=e.primary,u=l.direction,c=l.orderby,p=Wn()((r=!0,(n="column-"+o)in(t={"manage-column":!0,sortable:!0,asc:c===o&&"asc"===u,desc:c===o&&"desc"===u||c!==o,"column-primary":s})?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t));return i.a.createElement("th",{scope:"col",className:p,onClick:function(t){t.preventDefault(),e.onSetOrderBy(o,c===o&&"desc"===u?"asc":"desc")}},i.a.createElement("a",{href:"#"},i.a.createElement("span",null,a),i.a.createElement("span",{className:"sorting-indicator"})))};var dr=function(e){var t,n,r,o=e.name,a=e.text,l=e.primary,s=Wn()((r=!0,(n="column-"+o)in(t={"manage-column":!0,"column-primary":l})?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t));return i.a.createElement("th",{scope:"col",className:s},i.a.createElement("span",null,a))},hr=function(e){var t=e.onSetAllSelected,n=e.isDisabled,r=e.isSelected;return i.a.createElement("td",{className:"manage-column column-cb check-column",onClick:t},i.a.createElement("label",{className:"screen-reader-text"},Object(c.translate)("Select All")),i.a.createElement("input",{type:"checkbox",disabled:n,checked:r}))},mr=function(e){var t=e.isDisabled,n=e.onSetAllSelected,r=e.onSetOrderBy,o=e.isSelected,a=e.headers,l=e.table,s=function(e){n(e.target.checked)};return i.a.createElement("tr",null,a.map(function(e){var n=e.primary,a=void 0!==n&&n,u=e.check,c=void 0!==u&&u,p=e.sortable,f=void 0===p||p;return!0===c?i.a.createElement(hr,{onSetAllSelected:s,isDisabled:t,isSelected:o,key:e.name}):!1===f?i.a.createElement(dr,{name:e.name,text:e.title,key:e.name,primary:a}):i.a.createElement(fr,{table:l,name:e.name,text:e.title,key:e.name,onSetOrderBy:r,primary:a})}))},gr=function(e){var t=e.rows,n=e.status,r=e.selected,o=e.row;return i.a.createElement("tbody",null,t.map(function(e,t){return o(e,t,function(e,t,n){return{isLoading:e===fe,isSelected:function(e,t){return-1!==e.indexOf(t)}(t,n.id)}}(n,r,e))}))},br=function(e){var t=e.columns;return i.a.createElement("tr",{className:"is-placeholder"},t.map(function(e,t){return i.a.createElement("td",{key:t},i.a.createElement("div",{className:"placeholder-loading"}))}))},yr=function(e){var t=e.headers,n=e.rows;return i.a.createElement("tbody",null,i.a.createElement(br,{columns:t}),n.slice(0,-1).map(function(e,n){return i.a.createElement(br,{columns:t,key:n})}))},vr=function(e){var t=e.headers;return i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("td",null),i.a.createElement("td",{colSpan:t.length-1},Object(c.translate)("No results"))))},Er=function(e){var t=e.headers;return i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("td",{colSpan:t.length},i.a.createElement("p",null,Object(c.translate)("Sorry, something went wrong loading the data - please try again")))))},wr=function(e){var t=e.headers,n=e.row,r=e.rows,o=e.total,a=e.table,l=e.status,s=e.onSetAllSelected,u=e.onSetOrderBy,c=function(e,t){return e!==he||0===t.length}(l,r),p=function(e,t){return e.length===t.length&&0!==t.length}(a.selected,r),f=null;return l===fe&&0===r.length?f=i.a.createElement(yr,{headers:t,rows:r}):0===r.length&&l===he?f=i.a.createElement(vr,{headers:t}):l===de?f=i.a.createElement(Er,{headers:t}):r.length>0&&(f=i.a.createElement(gr,{rows:r,status:l,selected:a.selected,row:n})),i.a.createElement("table",{className:"wp-list-table widefat fixed striped items"},i.a.createElement("thead",null,i.a.createElement(mr,{table:a,isDisabled:c,isSelected:p,headers:t,rows:r,total:o,onSetOrderBy:u,onSetAllSelected:s})),f,i.a.createElement("tfoot",null,i.a.createElement(mr,{table:a,isDisabled:c,isSelected:p,headers:t,rows:r,total:o,onSetOrderBy:u,onSetAllSelected:s})))},_r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Or(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xr(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function kr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Sr=function(e){var t=e.title,n=e.button,r=e.className,o=e.enabled,a=e.onClick;return o?i.a.createElement("a",{className:r,href:"#",onClick:a},i.a.createElement("span",{className:"screen-reader-text"},t),i.a.createElement("span",{"aria-hidden":"true"},n)):i.a.createElement("span",{className:"tablenav-pages-navspan","aria-hidden":"true"},n)},Cr=function(e){function t(e){Or(this,t);var n=xr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=n.handleChange.bind(n),n.onSetPage=n.handleSetPage.bind(n),n.setClickers(e),n.state={currentPage:e.page},n}return kr(t,i.a.Component),_r(t,[{key:"componentWillUpdate",value:function(e){this.setClickers(e),e.page!==this.props.page&&this.setState({currentPage:e.page})}},{key:"setClickers",value:function(e){this.onFirst=this.handleClick.bind(this,0),this.onLast=this.handleClick.bind(this,this.getTotalPages(e)-1),this.onNext=this.handleClick.bind(this,e.page+1),this.onPrev=this.handleClick.bind(this,e.page-1)}},{key:"handleClick",value:function(e,t){t.preventDefault(),this.setState({currentPage:e}),this.props.onChangePage(e)}},{key:"handleChange",value:function(e){var t=parseInt(e.target.value,10);t!==this.state.currentPage&&this.setState({currentPage:t-1})}},{key:"handleSetPage",value:function(){this.props.onChangePage(this.state.currentPage)}},{key:"getTotalPages",value:function(e){var t=e.total,n=e.per_page;return Math.ceil(t/n)}},{key:"render",value:function(){var e=this.props.page,t=this.getTotalPages(this.props);return i.a.createElement("span",{className:"pagination-links"},i.a.createElement(Sr,{title:Object(c.translate)("First page"),button:"«",className:"first-page",enabled:e>0,onClick:this.onFirst})," ",i.a.createElement(Sr,{title:Object(c.translate)("Prev page"),button:"‹",className:"prev-page",enabled:e>0,onClick:this.onPrev}),i.a.createElement("span",{className:"paging-input"},i.a.createElement("label",{htmlFor:"current-page-selector",className:"screen-reader-text"},Object(c.translate)("Current Page"))," ",i.a.createElement("input",{className:"current-page",type:"number",min:"1",max:t,name:"paged",value:this.state.currentPage+1,size:"2","aria-describedby":"table-paging",onBlur:this.onSetPage,onChange:this.onChange}),i.a.createElement("span",{className:"tablenav-paging-text"},Object(c.translate)("of %(page)s",{components:{total:i.a.createElement("span",{className:"total-pages"})},args:{page:Object(c.numberFormat)(t)}})))," ",i.a.createElement(Sr,{title:Object(c.translate)("Next page"),button:"›",className:"next-page",enabled:e<t-1,onClick:this.onNext})," ",i.a.createElement(Sr,{title:Object(c.translate)("Last page"),button:"»",className:"last-page",enabled:e<t-1,onClick:this.onLast}))}}]),t}(),jr=function(e){function t(){return Or(this,t),xr(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return kr(t,i.a.Component),_r(t,[{key:"render",value:function(){var e=this.props,t=e.total,n=e.per_page,r=e.page,o=e.onChangePage,a=e.inProgress,l=t<=n,s=Wn()({"tablenav-pages":!0,"one-page":l});return i.a.createElement("div",{className:s},i.a.createElement("span",{className:"displaying-num"},Object(c.translate)("%s item","%s items",{count:t,args:Object(c.numberFormat)(t)})),!l&&i.a.createElement(Cr,{onChangePage:o,total:t,per_page:n,page:r,inProgress:a}))}}]),t}(),Pr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Tr=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleClick=n.onClick.bind(n),n.handleChange=n.onChange.bind(n),n.state={action:-1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Pr(t,[{key:"onChange",value:function(e){this.setState({action:e.target.value})}},{key:"onClick",value:function(e){e.preventDefault(),-1!==parseInt(this.state.action,10)&&(this.props.onAction(this.state.action),this.setState({action:-1}))}},{key:"getBulk",value:function(e){var t=this.props.selected;return i.a.createElement("div",{className:"alignleft actions bulkactions"},i.a.createElement("label",{htmlFor:"bulk-action-selector-top",className:"screen-reader-text"},Object(c.translate)("Select bulk action")),i.a.createElement("select",{name:"action",id:"bulk-action-selector-top",value:this.state.action,disabled:0===t.length,onChange:this.handleChange},i.a.createElement("option",{value:"-1"},Object(c.translate)("Bulk Actions")),e.map(function(e){return i.a.createElement("option",{key:e.id,value:e.id},e.name)})),i.a.createElement("input",{type:"submit",id:"doaction",className:"button action",value:Object(c.translate)("Apply"),disabled:0===t.length||-1===parseInt(this.state.action,10),onClick:this.handleClick}))}},{key:"render",value:function(){var e=this.props,t=e.total,n=e.table,r=e.bulk,o=e.status;return i.a.createElement("div",{className:"tablenav top"},r&&this.getBulk(r),this.props.children?this.props.children:null,t>0&&i.a.createElement(jr,{per_page:n.per_page,page:n.page,total:t,onChangePage:this.props.onChangePage,inProgress:o===fe}))}}]),t}(),Nr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Rr=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={search:n.getDefaultSearch(e.table,e.ignoreFilter)},n.handleChange=n.onChange.bind(n),n.handleSubmit=n.onSubmit.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Nr(t,[{key:"getDefaultSearch",value:function(e,t){return t&&t.find(function(t){return t===e.filterBy})?"":e.filter}},{key:"componentWillReceiveProps",value:function(e){e.table.filterBy===this.props.table.filterBy&&e.table.filter===this.props.table.filter||this.setState({search:this.getDefaultSearch(e.table,e.ignoreFilter)})}},{key:"onChange",value:function(e){this.setState({search:e.target.value})}},{key:"onSubmit",value:function(e){e.preventDefault(),this.props.onSearch(this.state.search,this.props.table.filterBy)}},{key:"render",value:function(){var e=this.props.status===fe||""===this.state.search&&""===this.props.table.filter,t="ip"===this.props.table.filterBy?Object(c.translate)("Search by IP"):Object(c.translate)("Search");return i.a.createElement("form",{onSubmit:this.handleSubmit},i.a.createElement("p",{className:"search-box"},i.a.createElement("input",{type:"search",name:"s",value:this.state.search,onChange:this.handleChange}),i.a.createElement("input",{type:"submit",className:"button",value:t,disabled:e})))}}]),t}(),Dr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ar=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isModal:!1},n.onShow=n.showDelete.bind(n),n.onClose=n.closeModal.bind(n),n.onDelete=n.handleDelete.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Dr(t,[{key:"showDelete",value:function(e){this.setState({isModal:!0}),e.preventDefault()}},{key:"closeModal",value:function(){this.setState({isModal:!1})}},{key:"handleDelete",value:function(){var e=this.props.table;this.setState({isModal:!1}),this.props.onDelete(this.getFilterBy(e.filterBy,e.filter),e.filter)}},{key:"getFilterBy",value:function(e,t){return t?e||"url":""}},{key:"getTitle",value:function(e,t){return"ip"===e?Object(c.translate)("Delete all from IP %s",{args:t}):t?Object(c.translate)('Delete all matching "%s"',{args:t.substring(0,15)}):Object(c.translate)("Delete All")}},{key:"render",value:function(){var e=this.props.table,t=this.getTitle(e.filterBy,e.filter);return i.a.createElement("div",{className:"table-button-item"},i.a.createElement("input",{className:"button",type:"submit",name:"",value:t,onClick:this.onShow}),this.state.isModal&&i.a.createElement(qn,{onClose:this.onClose},i.a.createElement("div",null,i.a.createElement("h1",null,Object(c.translate)("Delete the logs - are you sure?")),i.a.createElement("p",null,Object(c.translate)("Once deleted your current logs will no longer be available. You can set a delete schedule from the Redirection options if you want to do this automatically.")),i.a.createElement("p",null,i.a.createElement("button",{className:"button-primary",onClick:this.onDelete},Object(c.translate)("Yes! Delete the logs"))," ",i.a.createElement("button",{className:"button-secondary",onClick:this.onClose},Object(c.translate)("No! Don't delete the logs"))))))}}]),t}(),Ir=function(e){var t=e.logType;return i.a.createElement("form",{method:"post",action:Redirectioni10n.pluginRoot+"&sub="+t},i.a.createElement("input",{type:"hidden",name:"_wpnonce",value:Redirectioni10n.WP_API_nonce}),i.a.createElement("input",{type:"hidden",name:"export-csv",value:""}),i.a.createElement("input",{className:"button",type:"submit",name:"",value:Object(c.translate)("Export")}))},Lr=n(8),Ur=function(e){var t=e.children,n=e.disabled,r=void 0!==n&&n;return i.a.createElement("div",{className:"row-actions"},r?i.a.createElement("span",null," "):t)},Fr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr={saving:we,saved:_e,failed:Oe,order:"date",store:"log"},Br={saving:ge,saved:be,failed:ye,order:"date",store:"log"},zr=function(e,t){return function(n,r){return ft(Qe.deleteAll,n,Br,{page:0,filter:t,filterBy:e},r().log,function(e){return Fr({},e,{filter:"",filterBy:""})})}},Gr=function(e,t,n){return lt(et.log,e,t,Mr,n)},Wr=function(e){return function(t,n){return ft(Qe.list,t,Br,e,n().log)}},Hr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{filter:"",filterBy:"",page:0,orderby:""};return Wr(e)},Vr=function(e,t){return Wr({orderby:e,direction:t})},qr=function(e){return Wr({page:e})},$r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Wr({filter:e,filterBy:""===e?"":t,page:0,orderby:""})},Kr=function(e,t){return Wr({filterBy:e,filter:t,orderby:"",page:0})},Qr=function(e){return{type:ve,items:e.map(parseInt)}},Yr=function(e){return{type:Ee,onoff:e}},Jr=function(e){var t=e.size,n=void 0===t?"":t,r="spinner-container"+(n?" spinner-"+n:"");return i.a.createElement("div",{className:r},i.a.createElement("span",{className:"css-spinner"}))},Xr=function(e){return function(t,n){if(!n().info.maps[e])return ot(nt.getGeo(e)).then(function(e){t({type:mn,map:e})}).catch(function(e){t({type:bn,error:e})}),t({type:hn})}},Zr=function(e){return function(t,n){if(!n().info.agents[e])return ot(rt.get(e)).then(function(e){t({type:gn,agent:e})}).catch(function(e){t({type:bn,error:e})}),t({type:hn})}},eo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var to=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.props.onGet(e.ip),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),eo(t,[{key:"renderError",value:function(){var e=this.props.error;return i.a.createElement("div",{className:"modal-error"},i.a.createElement("h2",null,Object(c.translate)("Geo IP Error")),i.a.createElement("p",null,Object(c.translate)("Something went wrong obtaining this information")),i.a.createElement("p",null,i.a.createElement("code",null,e.message)))}},{key:"showPrivate",value:function(e){var t=e.ip,n=e.ipType;return i.a.createElement("div",{className:"geo-simple"},i.a.createElement("h2",null,Object(c.translate)("Geo IP"),": ",t," - IPv",n),i.a.createElement("p",null,Object(c.translate)("This is an IP from a private network. This means it is located inside a home or business network and no more information can be displayed.")))}},{key:"showUnknown",value:function(e){var t=e.ip,n=e.ipType;return i.a.createElement("div",{className:"geo-simple"},i.a.createElement("h2",null,Object(c.translate)("Geo IP"),": ",t," - IPv",n),i.a.createElement("p",null,Object(c.translate)("No details are known for this address.")))}},{key:"showMap",value:function(e){var t=e.countryName,n=e.regionName,r=e.city,o=e.postCode,a=e.timeZone,l=e.accuracyRadius,s=e.latitude,u=e.longitude,p=e.ip,f=e.ipType,d="https://www.google.com/maps/embed/v1/place?key=AIzaSyDPHZn9iAyI6l-2Qv5-1IPXsLUENVtQc3A&q="+encodeURIComponent(s+","+u),h=[n,t,o].filter(function(e){return e});return i.a.createElement("div",{className:"geo-full"},i.a.createElement("table",null,i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("th",{colSpan:"2"},i.a.createElement("h2",null,Object(c.translate)("Geo IP"),": ",i.a.createElement("a",{href:"https://redirect.li/map/?ip="+encodeURIComponent(p),target:"_blank",rel:"noopener noreferrer"},p)," - IPv",f))),i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("City")),i.a.createElement("td",null,r)),i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Area")),i.a.createElement("td",null,h.join(", "))),i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Timezone")),i.a.createElement("td",null,a)),i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Geo Location")),i.a.createElement("td",null,s+","+u+" (~"+l+"m)")))),i.a.createElement("iframe",{frameBorder:"0",src:d,allowFullScreen:!0}))}},{key:"renderDetails",value:function(){var e=this.props,t=e.maps,n=e.ip,r=!!t[n]&&t[n];if(r){var o=r.code;return"private"===o?this.showPrivate(r):"geoip"===o?this.showMap(r):this.showUnknown(r)}return null}},{key:"renderLink",value:function(){return i.a.createElement("div",{className:"external"},Object(c.translate)("Powered by {{link}}redirect.li{{/link}}",{components:{link:i.a.createElement("a",{href:"https://redirect.li",target:"_blank",rel:"noopener noreferrer"})}}))}},{key:"componentDidUpdate",value:function(){this.props.parent.resize()}},{key:"render",value:function(){var e=this.props.status,t=e===he&&this.props.maps[this.props.ip]&&"geoip"!==this.props.maps[this.props.ip].code,n=Wn()({"geo-map":!0,"modal-loading":e===fe,"geo-map-small":e===de||t});return i.a.createElement("div",{className:n},e===fe&&i.a.createElement(Jr,null),e===de&&this.renderError(),e===he&&this.renderDetails(),e===he&&this.renderLink())}}]),t}();var no=ee(function(e){var t=e.info;return{status:t.status,error:t.error,maps:t.maps}},function(e){return{onGet:function(t){e(Xr(t))}}})(to),ro=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var oo=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.props.onGet(e.agent),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),ro(t,[{key:"renderError",value:function(){var e=this.props.error;return i.a.createElement("div",{className:"modal-error"},i.a.createElement("h2",null,Object(c.translate)("Useragent Error")),i.a.createElement("p",null,Object(c.translate)("Something went wrong obtaining this information")),i.a.createElement("p",null,i.a.createElement("code",null,e.message)))}},{key:"renderUnknown",value:function(){var e=this.props.agent;return i.a.createElement("div",{className:"agent-unknown"},i.a.createElement("h2",null,Object(c.translate)("Unknown Useragent")),i.a.createElement("br",null),i.a.createElement("p",null,e))}},{key:"getDetail",value:function(e){return!!(e&&e.name&&e.version)&&e.name+" "+e.version}},{key:"getDevice",value:function(e){var t=[];return e.vendor&&t.push(e.vendor),e.name&&t.push(e.name),t.join(" ")}},{key:"getType",value:function(e,t){var n=e.slice(0,1).toUpperCase()+e.slice(1);return t?i.a.createElement("a",{href:t,target:"_blank"},n):n}},{key:"renderDetails",value:function(){var e=this.props,t=e.agents,n=e.agent,r=!!t[n]&&t[n];if(!r)return this.renderUnknown();var o=this.getType(r.device.type,r.url),a=this.getDevice(r.device),l=this.getDetail(r.os),s=this.getDetail(r.browser),u=this.getDetail(r.engine),p=[];return a&&p.push([Object(c.translate)("Device"),a]),l&&p.push([Object(c.translate)("Operating System"),l]),s&&p.push([Object(c.translate)("Browser"),s]),u&&p.push([Object(c.translate)("Engine"),u]),i.a.createElement("div",null,i.a.createElement("h2",null,Object(c.translate)("Useragent"),": ",o),i.a.createElement("table",null,i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Agent")),i.a.createElement("td",{className:"useragent-agent"},n)),p.map(function(e,t){return i.a.createElement("tr",{key:t},i.a.createElement("th",null,e[0]),i.a.createElement("td",null,e[1]))}))),i.a.createElement("div",{className:"external"},Object(c.translate)("Powered by {{link}}redirect.li{{/link}}",{components:{link:i.a.createElement("a",{href:"https://redirect.li",target:"_blank",rel:"noopener noreferrer"})}})))}},{key:"componentDidUpdate",value:function(){this.props.parent.resize()}},{key:"render",value:function(){var e=this.props.status,t=Wn()({useragent:!0,"modal-loading":e===fe});return i.a.createElement("div",{className:t},e===fe&&i.a.createElement(Jr,null),e===de&&this.renderError(),e===he&&this.renderDetails())}}]),t}();var ao=ee(function(e){var t=e.info;return{status:t.status,error:t.error,agents:t.agents}},function(e){return{onGet:function(t){e(Zr(t))}}})(oo),io=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var lo=function(e){var t=e.url;if(t){var n=Lr.parse(t).hostname;return i.a.createElement("a",{href:t,rel:"noreferrer noopener",target:"_blank"},n)}return null},so=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onShow=function(e){e.preventDefault(),n.props.onShowIP(n.props.item.ip)},n.onSelected=function(){n.props.onSetSelected([n.props.item.id])},n.onDelete=function(e){e.preventDefault(),n.props.onDelete(n.props.item.id)},n.renderIp=function(e){return e?i.a.createElement("a",{href:"https://redirect.li/map/?ip="+encodeURIComponent(e),onClick:n.showMap},e):"-"},n.showMap=function(e){e.preventDefault(),n.setState({showMap:!0})},n.showAgent=function(e){e.preventDefault(),n.setState({showAgent:!0})},n.closeMap=function(){n.setState({showMap:!1})},n.closeAgent=function(){n.setState({showAgent:!1})},n.state={showMap:!1,showAgent:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),io(t,[{key:"renderMap",value:function(){return i.a.createElement(qn,{onClose:this.closeMap,padding:!1},i.a.createElement(no,{ip:this.props.item.ip}))}},{key:"renderAgent",value:function(){return i.a.createElement(qn,{onClose:this.closeAgent,width:"800"},i.a.createElement(ao,{agent:this.props.item.agent}))}},{key:"render",value:function(){var e=this.props.item,t=e.created,n=e.created_time,r=e.ip,o=e.referrer,a=e.url,l=e.agent,s=e.sent_to,u=e.id,p=this.props,f=p.selected,d=p.status,h=d===fe,m="STATUS_SAVING"===d,g=h||m,b=[i.a.createElement("a",{href:"#",onClick:this.onDelete,key:"0"},Object(c.translate)("Delete"))];return r&&b.unshift(i.a.createElement("a",{href:"https://redirect.li/map/?ip="+encodeURIComponent(r),onClick:this.showMap,key:"2"},Object(c.translate)("Geo Info"))),l&&b.unshift(i.a.createElement("a",{href:"https://redirect.li/agent/?ip="+encodeURIComponent(l),onClick:this.showAgent,key:"3"},Object(c.translate)("Agent Info"))),i.a.createElement("tr",{className:g?"disabled":""},i.a.createElement("th",{scope:"row",className:"check-column"},!m&&i.a.createElement("input",{type:"checkbox",name:"item[]",value:u,disabled:h,checked:f,onClick:this.onSelected}),m&&i.a.createElement(Jr,{size:"small"})),i.a.createElement("td",{className:"column-date"},t,i.a.createElement("br",null),n),i.a.createElement("td",{className:"column-primary column-url"},i.a.createElement("a",{href:a,rel:"noreferrer noopener",target:"_blank"},a.substring(0,100)),i.a.createElement("br",null),s?s.substring(0,100):"",i.a.createElement(Ur,{disabled:m},b.reduce(function(e,t){return[e," | ",t]})),this.state.showMap&&this.renderMap(),this.state.showAgent&&this.renderAgent()),i.a.createElement("td",{className:"column-referrer"},i.a.createElement(lo,{url:o}),o&&i.a.createElement("br",null),l),i.a.createElement("td",{className:"column-ip"},this.renderIp(r),i.a.createElement(Ur,null,r&&i.a.createElement("a",{href:"#",onClick:this.onShow},Object(c.translate)("Filter by IP")))))}}]),t}();var uo=ee(null,function(e){return{onShowIP:function(t){e(Kr("ip",t))},onSetSelected:function(t){e(Qr(t))},onDelete:function(t){e(Gr("delete",t))}}})(so),co=function(e){var t=e.enabled,n=void 0===t||t,r=e.children;return n?i.a.createElement("div",{className:"table-buttons"},r):null},po=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var fo=[{name:"cb",check:!0},{name:"date",title:Object(c.translate)("Date")},{name:"url",title:Object(c.translate)("Source URL"),primary:!0},{name:"referrer",title:Object(c.translate)("Referrer / User Agent"),sortable:!1},{name:"ip",title:Object(c.translate)("IP"),sortable:!1}],ho=[{id:"delete",name:Object(c.translate)("Delete")}],mo=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return e.onLoad(e.log.table),n.handleRender=n.renderRow.bind(n),n.handleRSS=n.onRSS.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),po(t,[{key:"componentWillReceiveProps",value:function(e){e.clicked!==this.props.clicked&&e.onLoad()}},{key:"onRSS",value:function(){document.location=Redirectioni10n.pluginRoot+"&sub=rss&module=1&token="+Redirectioni10n.token}},{key:"renderRow",value:function(e,t,n){var r=this.props.log.saving,o=n.isLoading?fe:he,a=-1!==r.indexOf(e.id)?"STATUS_SAVING":o;return i.a.createElement(uo,{item:e,key:t,selected:n.isSelected,status:a})}},{key:"render",value:function(){var e=this.props.log,t=e.status,n=e.total,r=e.table,o=e.rows;return i.a.createElement("div",null,i.a.createElement(Rr,{status:t,table:r,onSearch:this.props.onSearch}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,status:t,onChangePage:this.props.onChangePage,onAction:this.props.onTableAction,bulk:ho}),i.a.createElement(wr,{headers:fo,rows:o,total:n,row:this.handleRender,table:r,status:t,onSetAllSelected:this.props.onSetAllSelected,onSetOrderBy:this.props.onSetOrderBy}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,status:t,onChangePage:this.props.onChangePage,onAction:this.props.onTableAction},i.a.createElement(co,{enabled:o.length>0},i.a.createElement(Ir,{logType:xe}),i.a.createElement("button",{className:"button-secondary",onClick:this.handleRSS},"RSS"),i.a.createElement(Ar,{onDelete:this.props.onDeleteAll,table:r}))))}}]),t}();var go=ee(function(e){return{log:e.log}},function(e){return{onLoad:function(t){e(Hr(t))},onDeleteAll:function(t,n){e(zr(t,n))},onSearch:function(t,n){e($r(t,n))},onChangePage:function(t){e(qr(t))},onTableAction:function(t){e(Gr(t))},onSetAllSelected:function(t){e(Yr(t))},onSetOrderBy:function(t,n){e(Vr(t,n))}}})(mo),bo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yo={saving:jt,saved:Pt,failed:Tt,order:"date",store:"error"},vo={saving:Ot,saved:xt,failed:kt,order:"date",store:"error"},Eo=function(e,t){return function(n,r){return dt(Ye.deleteAll,n,vo,{page:0,filter:t,filterBy:e},r().error)}},wo=function(e,t){return function(n,r){return ft(Ye.deleteAll,n,vo,{page:0,filter:t,filterBy:e},r().error,function(e){return bo({},e,{filter:"",filterBy:""})})}},_o=function(e,t,n){return lt(et.error,e,t,yo,n)},Oo=function(e){return function(t,n){return ft(Ye.list,t,vo,e,n().error)}},xo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{filter:"",filterBy:"",page:0,orderby:""};return Oo(e)},ko=function(e,t){return Oo({orderby:e,direction:t})},So=function(e){return Oo({page:e})},Co=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Oo({filter:e,filterBy:""===e?"":t,page:0,orderby:""})},jo=function(e,t){return Oo({filterBy:e,filter:t,orderby:"",page:0})},Po=function(e){return{type:St,items:e.map(parseInt)}},To=function(e){return{type:Ct,onoff:e}},No=function(e){var t=e.url;if(t){var n=Lr.parse(t).hostname;return i.a.createElement("a",{href:t,rel:"noreferrer noopener",target:"_blank"},n)}return null},Ro=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Do=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onDropdown=function(e){""!==e.target.value&&n.props.onCustomAgent({mobile:"iPad|iPod|iPhone|Android|BlackBerry|SymbianOS|SCH-Md+|Opera Mini|Windows CE|Nokia|SonyEricsson|webOS|PalmOS",feed:"Bloglines|feed|rss",lib:"cURL|Java|libwww-perl|PHP|urllib"}[e.target.value]),n.setState({dropdown:""})},n.handleChangeAgent=n.onChangeAgent.bind(n),n.handleChangeRegex=n.onChangeRegex.bind(n),n.state={dropdown:0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Ro(t,[{key:"onChangeAgent",value:function(e){this.props.onChange("agent","agent",e.target.value)}},{key:"onChangeRegex",value:function(e){this.props.onChange("agent","regex",e.target.checked)}},{key:"render",value:function(){return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("User Agent")),i.a.createElement("td",{className:"useragent-match"},i.a.createElement("input",{type:"text",name:"agent",value:this.props.agent,onChange:this.handleChangeAgent,className:"medium",placeholder:Object(c.translate)("Match against this browser user agent")}),i.a.createElement("select",{name:"agent_dropdown",onChange:this.onDropdown,value:this.state.dropdown,className:"medium"},i.a.createElement("option",{value:""},Object(c.translate)("Custom")),i.a.createElement("option",{value:"mobile"},Object(c.translate)("Mobile")),i.a.createElement("option",{value:"feed"},Object(c.translate)("Feed Readers")," "),i.a.createElement("option",{value:"lib"},Object(c.translate)("Libraries"))),i.a.createElement("label",{className:"edit-redirection-regex"},Object(c.translate)("Regex")," ",i.a.createElement("sup",null,i.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",i.a.createElement("input",{type:"checkbox",name:"regex",checked:this.props.regex,onChange:this.handleChangeRegex}))))}}]),t}(),Ao=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Io=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleChangeReferrer=n.onChangeReferrer.bind(n),n.handleChangeRegex=n.onChangeRegex.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Ao(t,[{key:"onChangeReferrer",value:function(e){this.props.onChange("referrer","referrer",e.target.value)}},{key:"onChangeRegex",value:function(e){this.props.onChange("referrer","regex",e.target.checked)}},{key:"render",value:function(){return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Referrer")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"referrer",value:this.props.referrer,onChange:this.handleChangeReferrer,placeholder:Object(c.translate)("Match against this browser referrer text")}),i.a.createElement("label",{className:"edit-redirection-regex"},Object(c.translate)("Regex")," ",i.a.createElement("sup",null,i.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",i.a.createElement("input",{type:"checkbox",name:"regex",checked:this.props.regex,onChange:this.handleChangeRegex}))))}}]),t}(),Lo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Uo=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){n.props.onChange("header",e.target.name,e.target.value)},n.onChangeRegex=function(e){n.props.onChange("header","regex",e.target.checked)},n.onDropdown=function(e){""!==e.target.value&&n.props.onChange("header","name",{accept:"Accept-Language"}[e.target.value]),n.setState({dropdown:""})},n.state={dropdown:0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Lo(t,[{key:"render",value:function(){var e=this.props,t=e.name,n=e.value,r=e.regex;return i.a.createElement(i.a.Fragment,null,i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("HTTP Header")),i.a.createElement("td",{className:"custom-header-match"},i.a.createElement("input",{type:"text",name:"name",value:t,onChange:this.onChange,className:"medium",placeholder:Object(c.translate)("Header name")}),i.a.createElement("input",{type:"text",name:"value",value:n,onChange:this.onChange,className:"medium",placeholder:Object(c.translate)("Header value")}),i.a.createElement("select",{name:"agent_dropdown",onChange:this.onDropdown,value:this.state.dropdown,className:"medium"},i.a.createElement("option",{value:""},Object(c.translate)("Custom")),i.a.createElement("option",{value:"accept"},Object(c.translate)("Accept Language"))),i.a.createElement("label",{className:"edit-redirection-regex"},Object(c.translate)("Regex")," ",i.a.createElement("sup",null,i.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",i.a.createElement("input",{type:"checkbox",name:"regex",checked:r,onChange:this.onChangeRegex})))),i.a.createElement("tr",null,i.a.createElement("th",null),i.a.createElement("td",null,Object(c.translate)("Note it is your responsability to pass HTTP headers to PHP. Please contact your hosting provider for support about this."))))}}]),t}(),Fo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Mo(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var Bo=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=Mo(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onChange=function(e){r.props.onChange("custom","filter",e.target.value)},Mo(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Fo(t,[{key:"render",value:function(){return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Filter Name")),i.a.createElement("td",{className:"customfilter-match"},i.a.createElement("input",{type:"text",name:"filter",value:this.props.filter,onChange:this.onChange,className:"medium",placeholder:Object(c.translate)("WordPress filter name")})))}}]),t}(),zo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Go=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){n.props.onChange("cookie",e.target.name,e.target.value)},n.onChangeRegex=function(e){n.props.onChange("cookie","regex",e.target.checked)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),zo(t,[{key:"render",value:function(){var e=this.props,t=e.name,n=e.value,r=e.regex;return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Cookie")),i.a.createElement("td",{className:"custom-header-match"},i.a.createElement("input",{type:"text",name:"name",value:t,onChange:this.onChange,className:"medium",placeholder:Object(c.translate)("Cookie name")}),i.a.createElement("input",{type:"text",name:"value",value:n,onChange:this.onChange,className:"medium",placeholder:Object(c.translate)("Cookie value")}),i.a.createElement("label",{className:"edit-redirection-regex"},Object(c.translate)("Regex")," ",i.a.createElement("sup",null,i.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",i.a.createElement("input",{type:"checkbox",name:"regex",checked:r,onChange:this.onChangeRegex}))))}}]),t}(),Wo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Ho(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var Vo=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=Ho(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onChange=function(e){""!==e.target.value&&r.props.onChange("role","role",e.target.value)},Ho(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Wo(t,[{key:"render",value:function(){return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Role")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",value:this.props.role,placeholder:Object(c.translate)("Enter role or capability value"),onChange:this.onChange})))}}]),t}(),qo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function $o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var Ko=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=$o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onChange=function(e){""!==e.target.value&&r.props.onChange("server","server",e.target.value)},$o(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),qo(t,[{key:"render",value:function(){return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Server")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",value:this.props.server,placeholder:Object(c.translate)("Enter server URL to match against"),onChange:this.onChange})))}}]),t}(),Qo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Yo(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var Jo=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=Yo(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onChange=function(e){r.props.onChange("login",e.target.name,e.target.value)},Yo(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Qo(t,[{key:"render",value:function(){return i.a.createElement(i.a.Fragment,null,i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Logged In")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"logged_in",value:this.props.logged_in,onChange:this.onChange,placeholder:Object(c.translate)("Target URL when matched")}))),i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Logged Out")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"logged_out",value:this.props.logged_out,onChange:this.onChange,placeholder:Object(c.translate)("Target URL when not matched")}))))}}]),t}(),Xo=function(e){return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Target URL")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"url",value:e.target.url,onChange:function(t){e.onChange("target","url",t.target.value)},placeholder:Object(c.translate)("The target URL you want to redirect to if matched")})))},Zo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function ea(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var ta=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=ea(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onChange=function(e){r.props.onChange(r.props.target,e.target.name,e.target.value)},ea(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Zo(t,[{key:"render",value:function(){return i.a.createElement(i.a.Fragment,null,i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Matched Target")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"url_from",value:this.props.url_from,onChange:this.onChange,placeholder:Object(c.translate)("Target URL when matched")}))),i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Unmatched Target")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"url_notfrom",value:this.props.url_notfrom,onChange:this.onChange,placeholder:Object(c.translate)("Target URL when not matched")}))))}}]),t}(),na=function(e){for(var t={},n=0;n<e.length;n++){var r=e[n];t[r.moduleName]||(t[r.moduleName]=[]),t[r.moduleName].push({value:r.id,text:r.name})}return Object.keys(t).map(function(e){return{text:e,value:t[e]}})},ra={store:"redirect",saving:tn,saved:rn,failed:nn,order:"name"},oa={store:"redirect",saving:Yt,saved:Jt,failed:Xt,order:"name"},aa=function(e){return ut($e.create,e,ra)},ia=function(e,t){return ct($e.update,e,t,ra)},la=function(e,t){return lt(et.redirect,e,t,ra)},sa=function(e){return function(t,n){return ft($e.list,t,oa,e,n().redirect)}},ua=function(e,t){return sa({orderby:e,direction:t})},ca=function(e){return sa({page:e})},pa=function(e){return sa({filter:e,filterBy:"",page:0,orderby:""})},fa=function(e,t){return sa({filterBy:e,filter:t,orderby:"",page:0})},da=function(e){return{type:Zt,items:e.map(parseInt)}},ha=function(e){return{type:en,onoff:e}},ma=function(e){return{type:on,onoff:e}},ga=function(e){return"url"===e||"pass"===e},ba=function(e,t){return{id:0,url:e,regex:!1,match_type:"url",action_type:"url",action_data:{url:""},group_id:t,title:"",action_code:301}},ya=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},va=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Ea(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wa=[{value:"url",name:Object(c.translate)("URL only")},{value:"login",name:Object(c.translate)("URL and login status")},{value:"role",name:Object(c.translate)("URL and role/capability filter")},{value:"referrer",name:Object(c.translate)("URL and referrer")},{value:"agent",name:Object(c.translate)("URL and user agent")},{value:"cookie",name:Object(c.translate)("URL and cookie")},{value:"server",name:Object(c.translate)("URL and server")},{value:"header",name:Object(c.translate)("URL and HTTP header")},{value:"custom",name:Object(c.translate)("URL and custom filter")}],_a=[{value:"url",name:Object(c.translate)("Redirect to URL")},{value:"random",name:Object(c.translate)("Redirect to random post")},{value:"pass",name:Object(c.translate)("Pass-through")},{value:"error",name:Object(c.translate)("Error (404)")},{value:"nothing",name:Object(c.translate)("Do nothing")}],Oa=[{value:301,name:Object(c.translate)("301 - Moved Permanently")},{value:302,name:Object(c.translate)("302 - Found")},{value:307,name:Object(c.translate)("307 - Temporary Redirect")},{value:308,name:Object(c.translate)("308 - Permanent Redirect")}],xa=[{value:401,name:Object(c.translate)("401 - Unauthorized")},{value:404,name:Object(c.translate)("404 - Not Found")},{value:410,name:Object(c.translate)("410 - Gone")}],ka=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));Sa.call(n);var r=e.item,o=r.url,a=r.regex,i=r.match_type,l=r.action_type,s=r.action_data,u=r.group_id,c=void 0===u?0:u,p=r.title,f=r.action_code,d=r.position,h=void 0===d?0:d,m=s||{},g=m.logged_in,b=void 0===g?"":g,y=m.logged_out,v=void 0===y?"":y;return n.state={url:o,title:p,regex:a,match_type:i,action_type:l,action_code:f,action_data:s,group_id:n.getValidGroup(c),position:h,login:{logged_in:b,logged_out:v},target:s||{},agent:n.getAgentState(s),referrer:n.getReferrerState(s),cookie:n.getHeaderState(s),header:n.getHeaderState(s),custom:n.getCustomState(s),role:n.getRoleState(s),server:n.getServerState(s)},n.state.advanced=!n.canShowAdvanced(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),va(t,[{key:"getValidGroup",value:function(e){var t=this.props.group.rows,n=this.props.table;if(t.find(function(t){return t.id===e}))return e;if(t.length>0){if("group"===n.filterBy&&parseInt(n.filter,10)>0)return parseInt(n.filter,10);var r=t.find(function(e){return e.default});return r?r.id:t[0].id}return 0}},{key:"reset",value:function(){this.setState(ya({url:"",regex:!1,match_type:"url",action_type:"url",action_data:"",title:"",action_code:301,position:0},this.resetActionData()))}},{key:"resetActionData",value:function(){return{login:{logged_in:"",logged_out:""},target:{url:""},agent:{url_from:"",agent:"",regex:!1,url_notfrom:""},referrer:{referrer:"",regex:!1,url_from:"",url_notfrom:""},cookie:{name:"",value:"",regex:!1,url_from:"",url_notfrom:""},header:{name:"",value:"",regex:!1,url_from:"",url_notfrom:""},custom:{filter:"",url_from:"",url_notfrom:""},role:{role:"",url_from:"",url_notfrom:""},server:{server:"",url_from:"",url_notfrom:""}}}},{key:"canShowAdvanced",value:function(){var e=this.state,t=e.match_type,n=e.action_type;return"url"===t&&"url"===n}},{key:"getAgentState",value:function(e){var t=e||{},n=t.agent,r=void 0===n?"":n,o=t.regex,a=void 0!==o&&o,i=t.url_from,l=void 0===i?"":i,s=t.url_notfrom;return{agent:r,regex:a,url_from:l,url_notfrom:void 0===s?"":s}}},{key:"getReferrerState",value:function(e){var t=e||{},n=t.referrer,r=void 0===n?"":n,o=t.regex,a=void 0!==o&&o,i=t.url_from,l=void 0===i?"":i,s=t.url_notfrom;return{referrer:r,regex:a,url_from:l,url_notfrom:void 0===s?"":s}}},{key:"getRoleState",value:function(e){var t=e||{},n=t.role,r=void 0===n?"":n,o=t.url_from,a=void 0===o?"":o,i=t.url_notfrom;return{role:r,url_from:a,url_notfrom:void 0===i?"":i}}},{key:"getServerState",value:function(e){var t=e||{},n=t.server,r=void 0===n?"":n,o=t.url_from,a=void 0===o?"":o,i=t.url_notfrom;return{server:r,url_from:a,url_notfrom:void 0===i?"":i}}},{key:"getHeaderState",value:function(e){var t=e||{},n=t.name,r=void 0===n?"":n,o=t.value,a=void 0===o?"":o,i=t.regex,l=void 0!==i&&i,s=t.url_from,u=void 0===s?"":s,c=t.url_notfrom;return{name:r,value:a,regex:l,url_from:u,url_notfrom:void 0===c?"":c}}},{key:"getCustomState",value:function(e){var t=e||{},n=t.filter,r=void 0===n?"":n,o=t.url_from,a=void 0===o?"":o,i=t.url_notfrom;return{filter:r,url_from:a,url_notfrom:void 0===i?"":i}}},{key:"getCode",value:function(){return"error"===this.state.action_type?i.a.createElement("select",{name:"action_code",value:this.state.action_code,onChange:this.onChange},xa.map(function(e){return i.a.createElement("option",{key:e.value,value:e.value},e.name)})):"url"===this.state.action_type||"random"===this.state.action_type?i.a.createElement("select",{name:"action_code",value:this.state.action_code,onChange:this.onChange},Oa.map(function(e){return i.a.createElement("option",{key:e.value,value:e.value},e.name)})):null}},{key:"getMatchExtra",value:function(){switch(this.state.match_type){case"agent":return i.a.createElement(Do,{agent:this.state.agent.agent,regex:this.state.agent.regex,onChange:this.onSetData,onCustomAgent:this.onCustomAgent});case"referrer":return i.a.createElement(Io,{referrer:this.state.referrer.referrer,regex:this.state.referrer.regex,onChange:this.onSetData});case"cookie":return i.a.createElement(Go,{name:this.state.cookie.name,value:this.state.cookie.value,regex:this.state.cookie.regex,onChange:this.onSetData});case"header":return i.a.createElement(Uo,{name:this.state.header.name,value:this.state.header.value,regex:this.state.header.regex,onChange:this.onSetData});case"custom":return i.a.createElement(Bo,{filter:this.state.custom.filter,onChange:this.onSetData});case"role":return i.a.createElement(Vo,{role:this.state.role.role,onChange:this.onSetData});case"server":return i.a.createElement(Ko,{server:this.state.server.server,onChange:this.onSetData})}return null}},{key:"getTarget",value:function(){var e=this.state,t=e.match_type,n=e.action_type,r=e.agent,o=e.referrer,a=e.login,l=e.cookie,s=e.target,u=e.header,c=e.custom,p=e.role,f=e.server;if(!ga(n))return null;switch(t){case"agent":return i.a.createElement(ta,{url_from:r.url_from,url_notfrom:r.url_notfrom,target:"agent",onChange:this.onSetData});case"referrer":return i.a.createElement(ta,{url_from:o.url_from,url_notfrom:o.url_notfrom,target:"referrer",onChange:this.onSetData});case"login":return i.a.createElement(Jo,{logged_in:a.logged_in,logged_out:a.logged_out,onChange:this.onSetData});case"url":return i.a.createElement(Xo,{target:s,onChange:this.onSetData});case"cookie":return i.a.createElement(ta,{url_from:l.url_from,url_notfrom:l.url_notfrom,target:"cookie",onChange:this.onSetData});case"header":return i.a.createElement(ta,{url_from:u.url_from,url_notfrom:u.url_notfrom,target:"header",onChange:this.onSetData});case"custom":return i.a.createElement(ta,{url_from:c.url_from,url_notfrom:c.url_notfrom,target:"custom",onChange:this.onSetData});case"role":return i.a.createElement(ta,{url_from:p.url_from,url_notfrom:p.url_notfrom,target:"role",onChange:this.onSetData});case"server":return i.a.createElement(ta,{url_from:f.url_from,url_notfrom:f.url_notfrom,target:"server",onChange:this.onSetData})}return null}},{key:"getTitle",value:function(){var e=this.state.title;return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Title")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"title",value:e,onChange:this.onChange,placeholder:Object(c.translate)("Optional description - describe the purpose of this redirect")})))}},{key:"getMatch",value:function(){var e=this.state.match_type;return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Match")),i.a.createElement("td",null,i.a.createElement("select",{name:"match_type",value:e,onChange:this.onChange},wa.map(function(e){return i.a.createElement("option",{value:e.value,key:e.value},e.name)}))))}},{key:"getTargetCode",value:function(){var e=this.state,t=e.action_type,n=e.match_type,r=this.getCode();return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("When matched")),i.a.createElement("td",null,i.a.createElement("select",{name:"action_type",value:t,onChange:this.onChange},_a.filter(function(e){return!("login"===n&&!ga(e.value))}).map(function(e){return i.a.createElement("option",{value:e.value,key:e.value},e.name)})),r&&i.a.createElement(i.a.Fragment,null,i.a.createElement("strong",{className:"small-flex"},Object(c.translate)("with HTTP code"))," ",i.a.createElement("span",null,r))))}},{key:"getGroup",value:function(){var e=this.props.group.rows,t=this.state.group_id,n=parseInt(this.state.position,10),r=this.state.advanced;return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Group")),i.a.createElement("td",null,i.a.createElement(An,{name:"group",value:t,items:na(e),onChange:this.onGroup}),r&&i.a.createElement("span",{className:"edit-redirection-position"},i.a.createElement("strong",null,Object(c.translate)("Position")),i.a.createElement("input",{type:"number",value:n,name:"position",min:"0",size:"3",onChange:this.onChange}))))}},{key:"canSave",value:function(){var e=this.state,t=e.url,n=e.match_type,r=e.target,o=e.action_type,a=e.referrer,i=e.login,l=e.agent,s=e.header,u=e.cookie,c=e.role,p=e.server;if(""===Redirectioni10n.autoGenerate&&""===t)return!1;if(ga(o)){if("url"===n&&""===r)return!1;if("referrer"===n&&""===a.url_from&&""===a.url_notfrom)return!1;if("login"===n&&""===i.logged_in&&""===i.logged_out)return!1;if("agent"===n&&""===l.url_from&&""===l.url_notfrom)return!1;if("cookie"===n&&""===u.url_from&&""===u.url_notfrom)return!1;if("header"===n&&""===s.url_from&&""===s.url_notfrom)return!1;if("role"===n&&""===c.url_from&&""===c.url_notfrom)return!1;if("server"===n&&""===p.url_from&&""===p.url_notfrom)return!1}return!0}},{key:"render",value:function(){var e=this.state,t=e.url,n=e.regex,r=e.advanced,o=this.props,a=o.saveButton,l=void 0===a?Object(c.translate)("Save"):a,s=o.onCancel,u=o.autoFocus,p=void 0!==u&&u,f=o.addTop,d=o.onClose;return i.a.createElement("form",{onSubmit:this.onSave},i.a.createElement("table",{className:"edit edit-redirection"},i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Source URL")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"url",value:t,onChange:this.onChange,autoFocus:p,placeholder:Object(c.translate)("The relative URL you want to redirect from")}),i.a.createElement("label",{className:"edit-redirection-regex"},Object(c.translate)("Regex")," ",i.a.createElement("sup",null,i.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",i.a.createElement("input",{type:"checkbox",name:"regex",checked:n,onChange:this.onChange})))),r&&this.getTitle(),r&&this.getMatch(),r&&this.getMatchExtra(),r&&this.getTargetCode(),this.getTarget(),this.getGroup(),this.props.children&&this.props.children,i.a.createElement("tr",null,i.a.createElement("th",null),i.a.createElement("td",null,i.a.createElement("div",{className:"table-actions"},i.a.createElement("input",{className:"button-primary",type:"submit",name:"save",value:l,disabled:!this.canSave()}),"  ",s&&i.a.createElement("input",{className:"button-secondary",type:"submit",name:"cancel",value:Object(c.translate)("Cancel"),onClick:s}),f&&!s&&i.a.createElement("input",{className:"button-secondary",type:"submit",name:"cancel",value:Object(c.translate)("Close"),onClick:d})," ",this.canShowAdvanced()&&!1!==this.props.advanced&&i.a.createElement("a",{href:"#",onClick:this.onAdvanced,className:"advanced",title:Object(c.translate)("Show advanced options")},"⚙")))))))}}]),t}(),Sa=function(){var e=this;this.onSetData=function(t,n,r){void 0!==r?e.setState(Ea({},t,ya({},e.state[t],Ea({},n,r)))):e.setState(Ea({},t,n))},this.onCustomAgent=function(t){var n=e.state.agent;n.agent=t,n.regex=!0,e.setState({agent:n})},this.onSave=function(t){t.preventDefault();var n=e.state,r=n.url,o=n.title,a=n.regex,i=n.match_type,l=n.action_type,s=n.group_id,u=n.action_code,c=n.position,p=e.props.group.rows,f={id:parseInt(e.props.item.id,10),url:r,title:o,regex:a,match_type:i,action_type:l,position:c,group_id:s>0?s:p[0].id,action_code:e.getCode()?parseInt(u,10):0,action_data:function(e){var t=e.agent,n=e.referrer,r=e.login,o=e.match_type,a=e.target,i=e.action_type,l=e.header,s=e.cookie,u=e.custom,c=e.role,p=e.server;return"cookie"===o?{name:s.name,value:s.value,regex:s.regex,url_from:ga(i)?s.url_from:"",url_notfrom:ga(i)?s.url_notfrom:""}:"header"===o?{name:l.name,value:l.value,regex:l.regex,url_from:ga(i)?l.url_from:"",url_notfrom:ga(i)?l.url_notfrom:""}:"custom"===o?{filter:u.filter,url_from:ga(i)?u.url_from:"",url_notfrom:ga(i)?u.url_notfrom:""}:"agent"===o?{agent:t.agent,regex:t.regex,url_from:ga(i)?t.url_from:"",url_notfrom:ga(i)?t.url_notfrom:""}:"referrer"===o?{referrer:n.referrer,regex:n.regex,url_from:ga(i)?n.url_from:"",url_notfrom:ga(i)?n.url_notfrom:""}:"role"===o?{role:c.role,url_from:ga(i)?c.url_from:"",url_notfrom:ga(i)?c.url_notfrom:""}:"server"===o?{server:p.server,url_from:ga(i)?p.url_from:"",url_notfrom:ga(i)?p.url_notfrom:""}:"login"===o&&ga(i)?{logged_in:r.logged_in,logged_out:r.logged_out}:"url"===o&&ga(i)?{url:a.url}:""}(e.state)};f.id?e.props.onSave(f.id,f):e.props.onCreate(f),e.props.onCancel?e.props.onCancel(t):e.reset(),e.props.childSave&&e.props.childSave()},this.onAdvanced=function(t){t.preventDefault(),e.setState({advanced:!e.state.advanced})},this.onGroup=function(t){e.setState({group_id:parseInt(t.target.value,10)})},this.onChange=function(t){var n=t.target,r="checkbox"===n.type?n.checked:n.value;if(e.setState(Ea({},n.name,r)),"action_type"===n.name&&"url"===n.value&&e.setState({action_code:301}),"action_type"===n.name&&"error"===n.value&&e.setState({action_code:404}),"match_type"===n.name){var o=ya({},e.resetActionData());"login"===n.value?e.setState(ya({},o,{action_type:"url"})):e.setState(o)}}};var Ca=ee(function(e){var t=e.group,n=e.redirect;return{group:t,addTop:n.addTop,table:n.table}},function(e){return{onSave:function(t,n){e(ia(t,n))},onCreate:function(t){e(aa(t))},onClose:function(t){t.preventDefault(),e(ma(!1))}}})(ka),ja=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Pa=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.showMap=function(e){e.preventDefault(),n.setState({showMap:!0})},n.showAgent=function(e){e.preventDefault(),n.setState({showAgent:!0})},n.closeMap=function(){n.setState({showMap:!1})},n.closeAgent=function(){n.setState({showAgent:!1})},n.handleSelected=n.onSelect.bind(n),n.handleDelete=n.onDelete.bind(n),n.handleAdd=n.onAdd.bind(n),n.handleShow=n.onShow.bind(n),n.handleClose=n.onClose.bind(n),n.handleSave=n.onSave.bind(n),n.handleDeleteLog=n.onDeleteLog.bind(n),n.state={editing:!1,delete_log:!1,showMap:!1,showAgent:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),ja(t,[{key:"onSelect",value:function(){this.props.onSetSelected([this.props.item.id])}},{key:"onDelete",value:function(e){e.preventDefault(),this.props.onDelete(this.props.item.id)}},{key:"onShow",value:function(e){e.preventDefault(),this.props.onShowIP(this.props.item.ip)}},{key:"onAdd",value:function(e){e.preventDefault(),this.setState({editing:!0})}},{key:"onClose",value:function(){this.setState({editing:!1})}},{key:"onDeleteLog",value:function(e){this.setState({delete_log:e.target.checked})}},{key:"onSave",value:function(){this.state.delete_log&&this.props.onDeleteFilter(this.props.item.url)}},{key:"renderEdit",value:function(){return i.a.createElement(qn,{onClose:this.handleClose,width:"700"},i.a.createElement("div",{className:"add-new"},i.a.createElement(Ca,{item:ba(this.props.item.url,0),saveButton:Object(c.translate)("Add Redirect"),advanced:!1,onCancel:this.handleClose,childSave:this.handleSave,autoFocus:!0},i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Delete 404s")),i.a.createElement("td",null,i.a.createElement("label",null,i.a.createElement("input",{type:"checkbox",name:"delete_log",checked:this.state.delete_log,onChange:this.handleDeleteLog}),Object(c.translate)("Delete all logs for this 404")))))))}},{key:"renderMap",value:function(){return i.a.createElement(qn,{onClose:this.closeMap,padding:!1},i.a.createElement(no,{ip:this.props.item.ip}))}},{key:"renderAgent",value:function(){return i.a.createElement(qn,{onClose:this.closeAgent,width:"800"},i.a.createElement(ao,{agent:this.props.item.agent}))}},{key:"renderIp",value:function(e){return e?i.a.createElement("a",{href:"https://redirect.li/map/?ip="+encodeURIComponent(e),onClick:this.showMap},e):"-"}},{key:"render",value:function(){var e=this.props.item,t=e.created,n=e.created_time,r=e.ip,o=e.referrer,a=e.url,l=e.agent,s=e.id,u=this.props,p=u.selected,f=u.status,d=f===fe,h="STATUS_SAVING"===f,m=d||h,g=[i.a.createElement("a",{href:"#",onClick:this.handleDelete,key:"0"},Object(c.translate)("Delete")),i.a.createElement("a",{href:"#",onClick:this.handleAdd,key:"1"},Object(c.translate)("Add Redirect"))];return r&&g.unshift(i.a.createElement("a",{href:"https://redirect.li/map/?ip="+encodeURIComponent(r),onClick:this.showMap,key:"2"},Object(c.translate)("Geo Info"))),l&&g.unshift(i.a.createElement("a",{href:"https://redirect.li/agent/?agent="+encodeURIComponent(l),onClick:this.showAgent,key:"3"},Object(c.translate)("Agent Info"))),i.a.createElement("tr",{className:m?"disabled":""},i.a.createElement("th",{scope:"row",className:"check-column"},!h&&i.a.createElement("input",{type:"checkbox",name:"item[]",value:s,disabled:d,checked:p,onClick:this.handleSelected}),h&&i.a.createElement(Jr,{size:"small"})),i.a.createElement("td",{className:"column-date"},t,i.a.createElement("br",null),n),i.a.createElement("td",{className:"column-url column-primary"},i.a.createElement("a",{href:a,rel:"noreferrer noopener",target:"_blank"},a.substring(0,100)),i.a.createElement(Ur,{disabled:h},g.reduce(function(e,t){return[e," | ",t]})),this.state.editing&&this.renderEdit(),this.state.showMap&&this.renderMap(),this.state.showAgent&&this.renderAgent()),i.a.createElement("td",{className:"column-referrer"},i.a.createElement(No,{url:o}),o&&i.a.createElement("br",null),i.a.createElement("span",null,l)),i.a.createElement("td",{className:"column-ip"},this.renderIp(r),i.a.createElement(Ur,null,r&&i.a.createElement("a",{href:"#",onClick:this.handleShow},Object(c.translate)("Filter by IP")))))}}]),t}();var Ta=ee(function(e){return{infoStatus:e.info.status}},function(e){return{onShowIP:function(t){e(jo("ip",t))},onSetSelected:function(t){e(Po(t))},onDelete:function(t){e(_o("delete",t))},onDeleteFilter:function(t){e(Eo("url-exact",t))}}})(Pa),Na={store:"group",saving:qt,saved:Kt,failed:$t,order:"name"},Ra={store:"group",saving:zt,saved:Gt,failed:Wt,order:"name"},Da=function(e){return ut(Ke.create,e,Na)},Aa=function(e,t){return ct(Ke.update,e,t,Na)},Ia=function(e,t){return lt(et.group,e,t,Na)},La=function(e){return function(t,n){return ft(Ke.list,t,Ra,e,n().group)}},Ua=function(e,t){return La({orderby:e,direction:t})},Fa=function(e){return La({page:e})},Ma=function(e){return La({filter:e,filterBy:"",page:0,orderby:""})},Ba=function(e,t){return La({filterBy:e,filter:t,orderby:"",page:0})},za=function(e){return{type:Ht,items:e.map(parseInt)}},Ga=function(e){return{type:Vt,onoff:e}},Wa=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ha=[{name:"cb",check:!0},{name:"date",title:Object(c.translate)("Date")},{name:"url",title:Object(c.translate)("Source URL"),primary:!0},{name:"referrer",title:Object(c.translate)("Referrer / User Agent"),sortable:!1},{name:"ip",title:Object(c.translate)("IP"),sortable:!1}],Va=[{id:"delete",name:Object(c.translate)("Delete")}],qa=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return e.onLoad(e.error.table),n.props.onLoadGroups(),n.handleRender=n.renderRow.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Wa(t,[{key:"componentWillReceiveProps",value:function(e){e.clicked!==this.props.clicked&&e.onLoad()}},{key:"renderRow",value:function(e,t,n){var r=this.props.error.saving,o=n.isLoading?fe:he,a=-1!==r.indexOf(e.id)?"STATUS_SAVING":o;return i.a.createElement(Ta,{item:e,key:t,selected:n.isSelected,status:a})}},{key:"render",value:function(){var e=this.props.error,t=e.status,n=e.total,r=e.table,o=e.rows;return i.a.createElement("div",null,i.a.createElement(Rr,{status:t,table:r,onSearch:this.props.onSearch}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,status:t,onChangePage:this.props.onChangePage,onAction:this.props.onTableAction,bulk:Va}),i.a.createElement(wr,{headers:Ha,rows:o,total:n,row:this.handleRender,table:r,status:t,onSetAllSelected:this.props.onSetAllSelected,onSetOrderBy:this.props.onSetOrderBy}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,status:t,onChangePage:this.props.onChangePage,onAction:this.props.onTableAction},i.a.createElement(co,{enabled:o.length>0},i.a.createElement(Ir,{logType:"404"}),i.a.createElement(Ar,{onDelete:this.props.onDeleteAll,table:r}))))}}]),t}();var $a=ee(function(e){return{error:e.error}},function(e){return{onLoad:function(t){e(xo(t))},onLoadGroups:function(){e(La())},onDeleteAll:function(t,n){e(wo(t,n))},onSearch:function(t,n){e(Co(t,n))},onChangePage:function(t){e(So(t))},onTableAction:function(t){e(_o(t,null))},onSetAllSelected:function(t){e(To(t))},onSetOrderBy:function(t,n){e(ko(t,n))}}})(qa),Ka=n(15),Qa=n.n(Ka),Ya="undefined"==typeof document||!document||!document.createElement||"multiple"in document.createElement("input");function Ja(e){var t=[];if(e.dataTransfer){var n=e.dataTransfer;n.files&&n.files.length?t=n.files:n.items&&n.items.length&&(t=n.items)}else e.target&&e.target.files&&(t=e.target.files);return Array.prototype.slice.call(t)}function Xa(e,t){return"application/x-moz-file"===e.type||Qa()(e,t)}function Za(e){e.preventDefault()}var ei={borderStyle:"solid",borderColor:"#c66",backgroundColor:"#eee"},ti={opacity:.5},ni={borderStyle:"solid",borderColor:"#6c6",backgroundColor:"#eee"},ri={width:200,height:200,borderWidth:2,borderColor:"#666",borderStyle:"dashed",borderRadius:5},oi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ai=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function ii(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var li=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.renderChildren=function(e,t,n,o){return"function"==typeof e?e(oi({},r.state,{isDragActive:t,isDragAccept:n,isDragReject:o})):e},r.composeHandlers=r.composeHandlers.bind(r),r.onClick=r.onClick.bind(r),r.onDocumentDrop=r.onDocumentDrop.bind(r),r.onDragEnter=r.onDragEnter.bind(r),r.onDragLeave=r.onDragLeave.bind(r),r.onDragOver=r.onDragOver.bind(r),r.onDragStart=r.onDragStart.bind(r),r.onDrop=r.onDrop.bind(r),r.onFileDialogCancel=r.onFileDialogCancel.bind(r),r.onInputElementClick=r.onInputElementClick.bind(r),r.setRef=r.setRef.bind(r),r.setRefs=r.setRefs.bind(r),r.isFileDialogActive=!1,r.state={draggedFiles:[],acceptedFiles:[],rejectedFiles:[]},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),ai(t,[{key:"componentDidMount",value:function(){var e=this.props.preventDropOnDocument;this.dragTargets=[],e&&(document.addEventListener("dragover",Za,!1),document.addEventListener("drop",this.onDocumentDrop,!1)),this.fileInputEl.addEventListener("click",this.onInputElementClick,!1),window.addEventListener("focus",this.onFileDialogCancel,!1)}},{key:"componentWillUnmount",value:function(){this.props.preventDropOnDocument&&(document.removeEventListener("dragover",Za),document.removeEventListener("drop",this.onDocumentDrop)),null!=this.fileInputEl&&this.fileInputEl.removeEventListener("click",this.onInputElementClick,!1),window.removeEventListener("focus",this.onFileDialogCancel,!1)}},{key:"composeHandlers",value:function(e){return this.props.disabled?null:e}},{key:"onDocumentDrop",value:function(e){this.node&&this.node.contains(e.target)||(e.preventDefault(),this.dragTargets=[])}},{key:"onDragStart",value:function(e){this.props.onDragStart&&this.props.onDragStart.call(this,e)}},{key:"onDragEnter",value:function(e){e.preventDefault(),-1===this.dragTargets.indexOf(e.target)&&this.dragTargets.push(e.target),this.setState({isDragActive:!0,draggedFiles:Ja(e)}),this.props.onDragEnter&&this.props.onDragEnter.call(this,e)}},{key:"onDragOver",value:function(e){e.preventDefault(),e.stopPropagation();try{e.dataTransfer.dropEffect=this.isFileDialogActive?"none":"copy"}catch(e){}return this.props.onDragOver&&this.props.onDragOver.call(this,e),!1}},{key:"onDragLeave",value:function(e){var t=this;e.preventDefault(),this.dragTargets=this.dragTargets.filter(function(n){return n!==e.target&&t.node.contains(n)}),this.dragTargets.length>0||(this.setState({isDragActive:!1,draggedFiles:[]}),this.props.onDragLeave&&this.props.onDragLeave.call(this,e))}},{key:"onDrop",value:function(e){var t=this,n=this.props,r=n.onDrop,o=n.onDropAccepted,a=n.onDropRejected,i=n.multiple,l=n.disablePreview,s=n.accept,u=Ja(e),c=[],p=[];e.preventDefault(),this.dragTargets=[],this.isFileDialogActive=!1,u.forEach(function(e){if(!l)try{e.preview=window.URL.createObjectURL(e)}catch(e){0}Xa(e,s)&&function(e,t,n){return e.size<=t&&e.size>=n}(e,t.props.maxSize,t.props.minSize)?c.push(e):p.push(e)}),i||p.push.apply(p,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(c.splice(1))),r&&r.call(this,c,p,e),p.length>0&&a&&a.call(this,p,e),c.length>0&&o&&o.call(this,c,e),this.draggedFiles=null,this.setState({isDragActive:!1,draggedFiles:[],acceptedFiles:c,rejectedFiles:p})}},{key:"onClick",value:function(e){var t=this.props,n=t.onClick;t.disableClick||(e.stopPropagation(),n&&n.call(this,e),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return function(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}(e)||function(e){return-1!==e.indexOf("Edge/")}(e)}()?this.open():setTimeout(this.open.bind(this),0))}},{key:"onInputElementClick",value:function(e){e.stopPropagation(),this.props.inputProps&&this.props.inputProps.onClick&&this.props.inputProps.onClick()}},{key:"onFileDialogCancel",value:function(){var e=this,t=this.props.onFileDialogCancel;this.isFileDialogActive&&setTimeout(function(){null!=e.fileInputEl&&(e.fileInputEl.files.length||(e.isFileDialogActive=!1));"function"==typeof t&&t()},300)}},{key:"setRef",value:function(e){this.node=e}},{key:"setRefs",value:function(e){this.fileInputEl=e}},{key:"open",value:function(){this.isFileDialogActive=!0,this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"render",value:function(){var e=this.props,t=e.accept,n=e.acceptClassName,r=e.activeClassName,o=e.children,a=e.disabled,l=e.disabledClassName,s=e.inputProps,u=e.multiple,c=e.name,p=e.rejectClassName,f=ii(e,["accept","acceptClassName","activeClassName","children","disabled","disabledClassName","inputProps","multiple","name","rejectClassName"]),d=f.acceptStyle,h=f.activeStyle,m=f.className,g=void 0===m?"":m,b=f.disabledStyle,y=f.rejectStyle,v=f.style,E=ii(f,["acceptStyle","activeStyle","className","disabledStyle","rejectStyle","style"]),w=this.state,_=w.isDragActive,O=w.draggedFiles,x=O.length,k=u||x<=1,S=x>0&&function(e,t){return e.every(function(e){return Xa(e,t)})}(O,this.props.accept),C=x>0&&(!S||!k),j=!(g||v||h||d||y||b);_&&r&&(g+=" "+r),S&&n&&(g+=" "+n),C&&p&&(g+=" "+p),a&&l&&(g+=" "+l),j&&(h=ni,d=(v=ri).active,y=ei,b=ti);var P=oi({},v);h&&_&&(P=oi({},v,h)),d&&S&&(P=oi({},P,d)),y&&C&&(P=oi({},P,y)),b&&a&&(P=oi({},v,b));var T={accept:t,disabled:a,type:"file",style:{display:"none"},multiple:Ya&&u,ref:this.setRefs,onChange:this.onDrop,autoComplete:"off"};c&&c.length&&(T.name=c);E.acceptedFiles,E.preventDropOnDocument,E.disablePreview,E.disableClick,E.onDropAccepted,E.onDropRejected,E.onFileDialogCancel,E.maxSize,E.minSize;var N=ii(E,["acceptedFiles","preventDropOnDocument","disablePreview","disableClick","onDropAccepted","onDropRejected","onFileDialogCancel","maxSize","minSize"]);return i.a.createElement("div",oi({className:g,style:P},N,{onClick:this.composeHandlers(this.onClick),onDragStart:this.composeHandlers(this.onDragStart),onDragEnter:this.composeHandlers(this.onDragEnter),onDragOver:this.composeHandlers(this.onDragOver),onDragLeave:this.composeHandlers(this.onDragLeave),onDrop:this.composeHandlers(this.onDrop),ref:this.setRef,"aria-disabled":a}),this.renderChildren(o,_,S,C),i.a.createElement("input",oi({},s,T)))}}]),t}(),si=li;li.propTypes={accept:d.a.oneOfType([d.a.string,d.a.arrayOf(d.a.string)]),children:d.a.oneOfType([d.a.node,d.a.func]),disableClick:d.a.bool,disabled:d.a.bool,disablePreview:d.a.bool,preventDropOnDocument:d.a.bool,inputProps:d.a.object,multiple:d.a.bool,name:d.a.string,maxSize:d.a.number,minSize:d.a.number,className:d.a.string,activeClassName:d.a.string,acceptClassName:d.a.string,rejectClassName:d.a.string,disabledClassName:d.a.string,style:d.a.object,activeStyle:d.a.object,acceptStyle:d.a.object,rejectStyle:d.a.object,disabledStyle:d.a.object,onClick:d.a.func,onDrop:d.a.func,onDropAccepted:d.a.func,onDropRejected:d.a.func,onDragStart:d.a.func,onDragEnter:d.a.func,onDragOver:d.a.func,onDragLeave:d.a.func,onFileDialogCancel:d.a.func},li.defaultProps={preventDropOnDocument:!0,disabled:!1,disablePreview:!1,disableClick:!1,multiple:!0,maxSize:1/0,minSize:0};var ui=function(e,t){return function(n){return ot(Xe.file(e,t)).then(function(e){n({type:Rt,data:e.data})}).catch(function(e){n({type:Lt,error:e})}),n({type:Dt})}},ci=function(e){return document.location.href=e,{type:"NOTHING"}},pi=function(e,t){return function(n){return ot(Je.upload(t,e)).then(function(e){n({type:It,total:e.imported})}).catch(function(e){n({type:Lt,error:e})}),n({type:At,file:e})}},fi=function(){return{type:Ut}},di=function(e){return{type:Ft,file:e}},hi=function(){return function(e){ot(Je.pluginList()).then(function(t){e({type:Mt,importers:t.importers})}).catch(function(t){e({type:Lt,error:t})})}},mi=function(e){return function(t){return ot(Je.pluginImport(e)).then(function(e){t({type:It,total:e.imported})}).catch(function(e){t({type:Lt,error:e})}),t({type:At})}},gi=function(e){var t=e.plugin,n=e.doImport,r=t.name,o=t.total;return i.a.createElement("div",{className:"plugin-importer"},i.a.createElement("p",null,i.a.createElement("strong",null,r)," (",Object(c.translate)("total = ")+o," )"),i.a.createElement("button",{onClick:function(){n(t)},className:"button-secondary"},Object(c.translate)("Import from %s",{args:r})))},bi=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var yi=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.doImport=function(e){confirm(Object(c.translate)("Are you sure you want to import from %s?",{args:e.name}))&&n.props.pluginImport(e.id)},n.props.onLoadGroups(),n.props.onLoadImport(),n.setDropzone=n.onSetZone.bind(n),n.handleDrop=n.onDrop.bind(n),n.handleOpen=n.onOpen.bind(n),n.handleInput=n.onInput.bind(n),n.handleCancel=n.onCancel.bind(n),n.handleImport=n.onImport.bind(n),n.handleEnter=n.onEnter.bind(n),n.handleLeave=n.onLeave.bind(n),n.handleView=n.onView.bind(n),n.handleDownload=n.onDownload.bind(n),n.state={group:0,hover:!1,module:"all",format:"json"},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),bi(t,[{key:"onView",value:function(){this.props.onExport(this.state.module,this.state.format)}},{key:"onDownload",value:function(){var e,t;this.props.onDownloadFile((e=this.state.module,t=this.state.format,Redirectioni10n.pluginRoot+"&sub=io&export="+e+"&exporter="+t))}},{key:"onEnter",value:function(){this.props.io.importingStatus!==fe&&this.setState({hover:!0})}},{key:"onLeave",value:function(){this.setState({hover:!1})}},{key:"onImport",value:function(){this.props.onImport(this.props.io.file,this.state.group)}},{key:"onCancel",value:function(){this.setState({hover:!1}),this.props.onClearFile()}},{key:"onInput",value:function(e){var t,n,r,o=e.target;this.setState((t={},n=o.name,r=o.value,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t)),"module"===o.name&&"everything"===o.value&&this.setState({format:"json"})}},{key:"onSetZone",value:function(e){this.dropzone=e}},{key:"onDrop",value:function(e){var t=this.props.io.importingStatus;e.length>0&&t!==fe&&this.props.onAddFile(e[0]),this.setState({hover:!1,group:this.props.group.rows[0].id})}},{key:"onOpen",value:function(){this.dropzone.open()}},{key:"renderGroupSelect",value:function(){var e=this.props.group.rows;return i.a.createElement("div",{className:"groups"},Object(c.translate)("Import to group")," ",i.a.createElement(An,{items:na(e),name:"group",value:this.state.group,onChange:this.handleInput}))}},{key:"renderInitialDrop",value:function(){return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("Import a CSV, .htaccess, or JSON file.")),i.a.createElement("p",null,Object(c.translate)("Click 'Add File' or drag and drop here.")),i.a.createElement("button",{type:"button",className:"button-secondary",onClick:this.handleOpen},Object(c.translate)("Add File")))}},{key:"renderDropBeforeUpload",value:function(){var e=this.props.io.file,t="application/json"===e.type;return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("File selected")),i.a.createElement("p",null,i.a.createElement("code",null,e.name)),!t&&this.renderGroupSelect(),i.a.createElement("button",{className:"button-primary",onClick:this.handleImport},Object(c.translate)("Upload")),"  ",i.a.createElement("button",{className:"button-secondary",onClick:this.handleCancel},Object(c.translate)("Cancel")))}},{key:"renderUploading",value:function(){var e=this.props.io.file;return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("Importing")),i.a.createElement("p",null,i.a.createElement("code",null,e.name)),i.a.createElement("div",{className:"is-placeholder"},i.a.createElement("div",{className:"placeholder-loading"})))}},{key:"renderUploaded",value:function(){var e=this.props.io.lastImport;return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("Finished importing")),i.a.createElement("p",null,Object(c.translate)("Total redirects imported:")," ",e),0===e&&i.a.createElement("p",null,Object(c.translate)("Double-check the file is the correct format!")),i.a.createElement("button",{className:"button-secondary",onClick:this.handleCancel},Object(c.translate)("OK")))}},{key:"renderDropzoneContent",value:function(){var e=this.props.io,t=e.importingStatus,n=e.lastImport,r=e.file;return t===fe?this.renderUploading():t===he&&!1!==n&&!1===r?this.renderUploaded():!1===r?this.renderInitialDrop():this.renderDropBeforeUpload()}},{key:"renderExport",value:function(e){return i.a.createElement("div",null,i.a.createElement("textarea",{className:"module-export",rows:"14",readOnly:!0,value:e}),i.a.createElement("input",{className:"button-secondary",type:"submit",value:Object(c.translate)("Close"),onClick:this.handleCancel}))}},{key:"renderExporting",value:function(){return i.a.createElement("div",{className:"loader-wrapper loader-textarea"},i.a.createElement("div",{className:"placeholder-loading"}))}},{key:"renderImporters",value:function(e){var t=this;return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("Plugin Importers")),i.a.createElement("p",null,Object(c.translate)("The following redirect plugins were detected on your site and can be imported from.")),e.map(function(e,n){return i.a.createElement(gi,{plugin:e,key:n,doImport:t.doImport})}))}},{key:"render",value:function(){var e=this.state.hover,t=this.props.io,n=t.importingStatus,r=t.file,o=t.exportData,a=t.exportStatus,l=t.importers,s=Wn()({dropzone:!0,"dropzone-dropped":!1!==r,"dropzone-importing":n===fe,"dropzone-hover":e});return i.a.createElement("div",{className:"import"},i.a.createElement("h2",null,Object(c.translate)("Import")),i.a.createElement(si,{ref:this.setDropzone,onDrop:this.handleDrop,onDragLeave:this.handleLeave,onDragEnter:this.handleEnter,className:s,disableClick:!0,disablePreview:!0,multiple:!1},this.renderDropzoneContent()),i.a.createElement("p",null,Object(c.translate)("All imports will be appended to the current database.")),i.a.createElement("div",{className:"inline-notice notice-warning"},i.a.createElement("p",null,Object(c.translate)("{{strong}}CSV file format{{/strong}}: {{code}}source URL, target URL{{/code}} - and can be optionally followed with {{code}}regex, http code{{/code}} ({{code}}regex{{/code}} - 0 for no, 1 for yes).",{components:{code:i.a.createElement("code",null),strong:i.a.createElement("strong",null)}}))),i.a.createElement("h2",null,Object(c.translate)("Export")),i.a.createElement("p",null,Object(c.translate)("Export to CSV, Apache .htaccess, Nginx, or Redirection JSON (which contains all redirects and groups).")),i.a.createElement("select",{name:"module",onChange:this.handleInput,value:this.state.module},i.a.createElement("option",{value:"0"},Object(c.translate)("Everything")),i.a.createElement("option",{value:"1"},Object(c.translate)("WordPress redirects")),i.a.createElement("option",{value:"2"},Object(c.translate)("Apache redirects")),i.a.createElement("option",{value:"3"},Object(c.translate)("Nginx redirects"))),i.a.createElement("select",{name:"format",onChange:this.handleInput,value:this.state.format},i.a.createElement("option",{value:"csv"},Object(c.translate)("CSV")),i.a.createElement("option",{value:"apache"},Object(c.translate)("Apache .htaccess")),i.a.createElement("option",{value:"nginx"},Object(c.translate)("Nginx rewrite rules")),i.a.createElement("option",{value:"json"},Object(c.translate)("Redirection JSON")))," ",i.a.createElement("button",{className:"button-primary",onClick:this.handleView},Object(c.translate)("View"))," ",i.a.createElement("button",{className:"button-secondary",onClick:this.handleDownload},Object(c.translate)("Download")),a===fe&&this.renderExporting(),o&&a!==fe&&this.renderExport(o),i.a.createElement("p",null,Object(c.translate)("Log files can be exported from the log pages.")),l.length>0&&this.renderImporters(l))}}]),t}();var vi=ee(function(e){return{group:e.group,io:e.io}},function(e){return{onLoadGroups:function(){e(La())},onImport:function(t,n){e(pi(t,n))},onAddFile:function(t){e(di(t))},onClearFile:function(){e(fi())},onExport:function(t,n){e(ui(t,n))},onDownloadFile:function(t){e(ci(t))},onLoadImport:function(){e(hi())},pluginImport:function(t){e(mi(t))}}})(yi),Ei=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var wi=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={selected:e.selected},n.handleChange=n.onChange.bind(n),n.handleSubmit=n.onSubmit.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Ei(t,[{key:"componentWillUpdate",value:function(e){e.selected!==this.state.selected&&this.setState({selected:e.selected})}},{key:"onChange",value:function(e){this.setState({selected:e.target.value})}},{key:"onSubmit",value:function(){this.props.onFilter(this.state.selected)}},{key:"render",value:function(){var e=this.props,t=e.options,n=e.isEnabled;return i.a.createElement("div",{className:"alignleft actions"},i.a.createElement(An,{items:t,value:this.state.selected,name:"filter",onChange:this.handleChange,isEnabled:this.props.isEnabled}),i.a.createElement("button",{className:"button",onClick:this.handleSubmit,disabled:!n},Object(c.translate)("Filter")))}}]),t}(),_i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Oi=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={editing:!1,name:e.item.name,moduleId:e.item.module_id},n.handleSelected=n.onSelected.bind(n),n.handleEdit=n.onEdit.bind(n),n.handleSave=n.onSave.bind(n),n.handleDelete=n.onDelete.bind(n),n.handleDisable=n.onDisable.bind(n),n.handleEnable=n.onEnable.bind(n),n.handleChange=n.onChange.bind(n),n.handleSelect=n.onSelect.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),_i(t,[{key:"componentWillUpdate",value:function(e){this.props.item.name!==e.item.name&&this.setState({name:e.item.name,moduleId:e.item.module_id})}},{key:"onEdit",value:function(e){e.preventDefault(),this.setState({editing:!this.state.editing})}},{key:"onDelete",value:function(e){e.preventDefault(),this.props.onTableAction("delete",this.props.item.id)}},{key:"onDisable",value:function(e){e.preventDefault(),this.props.onTableAction("disable",this.props.item.id)}},{key:"onEnable",value:function(e){e.preventDefault(),this.props.onTableAction("enable",this.props.item.id)}},{key:"onSelected",value:function(){this.props.onSetSelected([this.props.item.id])}},{key:"onChange",value:function(e){var t=e.target;this.setState({name:t.value})}},{key:"onSave",value:function(e){this.onEdit(e),this.props.onSaveGroup(this.props.item.id,{name:this.state.name,moduleId:this.state.moduleId})}},{key:"onSelect",value:function(e){var t=e.target;this.setState({moduleId:parseInt(t.value,10)})}},{key:"renderLoader",value:function(){return i.a.createElement("div",{className:"loader-wrapper"},i.a.createElement("div",{className:"placeholder-loading loading-small",style:{top:"0px"}}))}},{key:"renderActions",value:function(e){var t=this.props.item,n=t.id,r=t.enabled;return i.a.createElement(Ur,{disabled:e},i.a.createElement("a",{href:"#",onClick:this.handleEdit},Object(c.translate)("Edit"))," | ",i.a.createElement("a",{href:"#",onClick:this.handleDelete},Object(c.translate)("Delete"))," | ",i.a.createElement("a",{href:Redirectioni10n.pluginRoot+"&filterby=group&filter="+n},Object(c.translate)("View Redirects"))," | ",r&&i.a.createElement("a",{href:"#",onClick:this.handleDisable},Object(c.translate)("Disable")),!r&&i.a.createElement("a",{href:"#",onClick:this.handleEnable},Object(c.translate)("Enable")))}},{key:"renderEdit",value:function(){return i.a.createElement("form",{onSubmit:this.handleSave},i.a.createElement("table",{className:"edit-groups"},i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("th",{width:"70"},Object(c.translate)("Name")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"name",value:this.state.name,onChange:this.handleChange}))),i.a.createElement("tr",null,i.a.createElement("th",{width:"70"},Object(c.translate)("Module")),i.a.createElement("td",null,i.a.createElement(An,{name:"module_id",value:this.state.moduleId,onChange:this.handleSelect,items:[{value:1,text:"WordPress"},{value:2,text:"Apache"},{value:3,text:"Nginx"}]}))),i.a.createElement("tr",null,i.a.createElement("th",{width:"70"}),i.a.createElement("td",null,i.a.createElement("div",{className:"table-actions"},i.a.createElement("input",{className:"button-primary",type:"submit",name:"save",value:Object(c.translate)("Save")}),"  ",i.a.createElement("input",{className:"button-secondary",type:"submit",name:"cancel",value:Object(c.translate)("Cancel"),onClick:this.handleEdit})))))))}},{key:"getName",value:function(e,t){return t?e:i.a.createElement("strike",null,e)}},{key:"render",value:function(){var e,t,n=this.props.item,r=n.name,o=n.redirects,a=n.id,l=n.module_id,s=n.enabled,u=this.props,c=u.selected,p=u.status,f=p===fe,d="STATUS_SAVING"===p,h=!s||f||d;return i.a.createElement("tr",{className:h?"disabled":""},i.a.createElement("th",{scope:"row",className:"check-column"},!d&&i.a.createElement("input",{type:"checkbox",name:"item[]",value:a,disabled:f,checked:c,onClick:this.handleSelected}),d&&i.a.createElement(Jr,{size:"small"})),i.a.createElement("td",{className:"column-primary column-name"},!this.state.editing&&this.getName(r,s),this.state.editing?this.renderEdit():this.renderActions(d)),i.a.createElement("td",{className:"column-redirects"},o),i.a.createElement("td",{className:"column-module"},(e=l,(t=[{value:1,text:"WordPress"},{value:2,text:"Apache"},{value:3,text:"Nginx"}].find(function(t){return t.value===parseInt(e,10)}))?t.text:"")))}}]),t}();var xi=ee(null,function(e){return{onSetSelected:function(t){e(za(t))},onSaveGroup:function(t,n){e(Aa(t,n))},onTableAction:function(t,n){e(Ia(t,n))}}})(Oi),ki=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Si=[{name:"cb",check:!0},{name:"name",title:Object(c.translate)("Name"),primary:!0},{name:"redirects",title:Object(c.translate)("Redirects"),sortable:!1},{name:"module",title:Object(c.translate)("Module"),sortable:!1}],Ci=[{id:"delete",name:Object(c.translate)("Delete")},{id:"enable",name:Object(c.translate)("Enable")},{id:"disable",name:Object(c.translate)("Disable")}],ji=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.props.onLoadGroups(),n.state={name:"",moduleId:1},n.handleName=n.onChange.bind(n),n.handleModule=n.onModule.bind(n),n.handleSubmit=n.onSubmit.bind(n),n.handleRender=n.renderRow.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),ki(t,[{key:"componentWillReceiveProps",value:function(e){e.clicked!==this.props.clicked&&e.onLoadGroups()}},{key:"renderRow",value:function(e,t,n){var r=this.props.group.saving,o=n.isLoading?fe:he,a=-1!==r.indexOf(e.id)?"STATUS_SAVING":o;return i.a.createElement(xi,{item:e,key:t,selected:n.isSelected,status:a})}},{key:"onChange",value:function(e){this.setState({name:e.target.value})}},{key:"onModule",value:function(e){this.setState({moduleId:e.target.value})}},{key:"onSubmit",value:function(e){e.preventDefault(),this.props.onCreate({id:0,name:this.state.name,moduleId:this.state.moduleId}),this.setState({name:""})}},{key:"getModules",value:function(){return[{value:"",text:Object(c.translate)("All modules")}].concat([{value:1,text:"WordPress"},{value:2,text:"Apache"},{value:3,text:"Nginx"}])}},{key:"render",value:function(){var e=this.props.group,t=e.status,n=e.total,r=e.table,o=e.rows,a=-1!==e.saving.indexOf(0);return i.a.createElement("div",null,i.a.createElement(Rr,{status:t,table:r,onSearch:this.props.onSearch,ignoreFilter:["module"]}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,onChangePage:this.props.onChangePage,onAction:this.props.onAction,status:t,bulk:Ci},i.a.createElement(wi,{selected:r.filter,options:this.getModules(),onFilter:this.props.onFilter,isEnabled:!0})),i.a.createElement(wr,{headers:Si,rows:o,total:n,row:this.handleRender,table:r,status:t,onSetAllSelected:this.props.onSetAllSelected,onSetOrderBy:this.props.onSetOrderBy}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,onChangePage:this.props.onChangePage,onAction:this.props.onAction,status:t}),i.a.createElement("h2",null,Object(c.translate)("Add Group")),i.a.createElement("p",null,Object(c.translate)("Use groups to organise your redirects. Groups are assigned to a module, which affects how the redirects in that group work. If you are unsure then stick to the WordPress module.")),i.a.createElement("form",{onSubmit:this.handleSubmit},i.a.createElement("table",{className:"form-table"},i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("th",{style:{width:"50px"}},Object(c.translate)("Name")),i.a.createElement("td",null,i.a.createElement("input",{size:"30",className:"regular-text",type:"text",name:"name",value:this.state.name,onChange:this.handleName,disabled:a}),i.a.createElement(An,{name:"id",value:this.state.moduleId,onChange:this.handleModule,items:[{value:1,text:"WordPress"},{value:2,text:"Apache"},{value:3,text:"Nginx"}],disabled:a})," ",i.a.createElement("input",{className:"button-primary",type:"submit",name:"add",value:"Add",disabled:a||""===this.state.name})))))))}}]),t}();var Pi=ee(function(e){return{group:e.group}},function(e){return{onLoadGroups:function(){e(La({page:0,filter:"",filterBy:"",orderby:""}))},onSearch:function(t){e(Ma(t))},onChangePage:function(t){e(Fa(t))},onAction:function(t){e(Ia(t))},onSetAllSelected:function(t){e(Ga(t))},onSetOrderBy:function(t,n){e(Ua(t,n))},onFilter:function(t){e(Ba("module",t))},onCreate:function(t){e(Da(t))}}})(ji),Ti=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ni=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onEdit=function(e){e.preventDefault(),n.setState({editing:!0})},n.onCancel=function(e){e.preventDefault(),n.setState({editing:!1})},n.onDelete=function(e){e.preventDefault(),n.props.onTableAction("delete",n.props.item.id)},n.onDisable=function(e){e.preventDefault(),n.props.onTableAction("disable",n.props.item.id)},n.onEnable=function(e){e.preventDefault(),n.props.onTableAction("enable",n.props.item.id)},n.onSelected=function(){n.props.onSetSelected([n.props.item.id])},n.state={editing:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Ti(t,[{key:"componentWillUpdate",value:function(e){e.item.id!==this.props.item.id&&this.state.editing&&this.setState({editing:!1})}},{key:"getMenu",value:function(){var e=this.props.item.enabled,t=[];return e&&t.push([Object(c.translate)("Edit"),this.onEdit]),t.push([Object(c.translate)("Delete"),this.onDelete]),e?t.push([Object(c.translate)("Disable"),this.onDisable]):t.push([Object(c.translate)("Enable"),this.onEnable]),t.map(function(e,t){return i.a.createElement("a",{key:t,href:"#",onClick:e[1]},e[0])}).reduce(function(e,t){return[e," | ",t]})}},{key:"getCode",value:function(){var e=this.props.item,t=e.action_code,n=e.action_type;return"pass"===n?Object(c.translate)("pass"):"nothing"===n?"-":t}},{key:"getTarget",value:function(){var e=this.props.item,t=e.match_type,n=e.action_data;return"url"===t?n.url:null}},{key:"getUrl",value:function(e){return this.props.item.enabled?e:i.a.createElement("strike",null,e)}},{key:"getName",value:function(e,t){var n=this.props.item.regex;return t||(n?this.getUrl(e):i.a.createElement("a",{href:e,target:"_blank",rel:"noopener noreferrer"},this.getUrl(e)))}},{key:"renderSource",value:function(e,t,n){var r=this.getName(e,t);return i.a.createElement("td",{className:"column-primary column-url has-row-actions"},r,i.a.createElement("br",null),i.a.createElement("span",{className:"target"},this.getTarget()),i.a.createElement(Ur,{disabled:n},this.getMenu()))}},{key:"renderEditColumns",value:function(){return i.a.createElement("td",{className:"column-primary column-url",colSpan:"4"},i.a.createElement(Ca,{item:this.props.item,onCancel:this.onCancel}))}},{key:"renderViewColumns",value:function(e){var t=this.props.item,n=t.url,r=t.hits,o=t.last_access,a=t.title,l=t.position;return i.a.createElement(i.a.Fragment,null,this.renderSource(n,a,e),i.a.createElement("td",{className:"column-position"},Object(c.numberFormat)(l)),i.a.createElement("td",{className:"column-last_count"},Object(c.numberFormat)(r)),i.a.createElement("td",{className:"column_last_access"},o))}},{key:"render",value:function(){var e=this.props.item,t=e.id,n=e.enabled,r=this.props,o=r.selected,a=r.status,l=a===fe,s="STATUS_SAVING"===a,u=!n||l||s,c=Wn()({disabled:u});return i.a.createElement("tr",{className:c},i.a.createElement("th",{scope:"row",className:"check-column"},!s&&i.a.createElement("input",{type:"checkbox",name:"item[]",value:t,disabled:l,checked:o,onClick:this.onSelected}),s&&i.a.createElement(Jr,{size:"small"})),i.a.createElement("td",{className:"column-code"},this.getCode()),this.state.editing?this.renderEditColumns():this.renderViewColumns(s))}}]),t}();var Ri=ee(null,function(e){return{onSetSelected:function(t){e(da(t))},onTableAction:function(t,n){e(la(t,n))}}})(Ni),Di=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ai=[{name:"cb",check:!0},{name:"code",title:Object(c.translate)("Type"),sortable:!1},{name:"url",title:Object(c.translate)("URL"),primary:!0},{name:"position",title:Object(c.translate)("Pos")},{name:"last_count",title:Object(c.translate)("Hits")},{name:"last_access",title:Object(c.translate)("Last Access")}],Ii=[{id:"delete",name:Object(c.translate)("Delete")},{id:"enable",name:Object(c.translate)("Enable")},{id:"disable",name:Object(c.translate)("Disable")},{id:"reset",name:Object(c.translate)("Reset hits")}],Li=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleRender=n.renderRow.bind(n),n.props.onLoadRedirects(),n.props.onLoadGroups(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Di(t,[{key:"componentWillReceiveProps",value:function(e){e.clicked!==this.props.clicked&&e.onLoadRedirects({page:0,filter:"",filterBy:"",orderby:""})}},{key:"renderRow",value:function(e,t,n){var r=this.props.redirect.saving,o=n.isLoading?fe:he,a=-1!==r.indexOf(e.id)?"STATUS_SAVING":o;return i.a.createElement(Ri,{item:e,key:t,selected:n.isSelected,status:a})}},{key:"getGroups",value:function(e){return[{value:0,text:Object(c.translate)("All groups")}].concat(na(e))}},{key:"renderNew",value:function(){var e=this.props.redirect.addTop,t=Wn()({"add-new":!0,edit:!0,addTop:e});return i.a.createElement("div",null,!e&&i.a.createElement("h2",null,Object(c.translate)("Add new redirection")),i.a.createElement("div",{className:t},i.a.createElement(Ca,{item:ba("",0),saveButton:Object(c.translate)("Add Redirect"),autoFocus:e})))}},{key:"canFilter",value:function(e,t){return e.status===he&&t!==fe}},{key:"render",value:function(){var e=this.props.redirect,t=e.status,n=e.total,r=e.table,o=e.rows,a=e.addTop,l=this.props.group,s=t===he&&l.status===he;return i.a.createElement("div",{className:"redirects"},a&&this.renderNew(),i.a.createElement(Rr,{status:t,table:r,onSearch:this.props.onSearch,ignoreFilter:["group"]}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,onChangePage:this.props.onChangePage,onAction:this.props.onAction,bulk:Ii,status:t},i.a.createElement(wi,{selected:r.filter?r.filter:"0",options:this.getGroups(l.rows),isEnabled:this.canFilter(l,t),onFilter:this.props.onFilter})),i.a.createElement(wr,{headers:Ai,rows:o,total:n,row:this.handleRender,table:r,status:t,onSetAllSelected:this.props.onSetAllSelected,onSetOrderBy:this.props.onSetOrderBy}),i.a.createElement(Tr,{total:n,selected:r.selected,table:r,onChangePage:this.props.onChangePage,onAction:this.props.onAction,status:t}),s&&!a&&this.renderNew())}}]),t}();var Ui=ee(function(e){return{redirect:e.redirect,group:e.group}},function(e){return{onLoadGroups:function(){e(La())},onLoadRedirects:function(t){e(sa(t))},onSearch:function(t){e(pa(t))},onChangePage:function(t){e(ca(t))},onAction:function(t){e(la(t))},onSetAllSelected:function(t){e(ha(t))},onSetOrderBy:function(t,n){e(ua(t,n))},onFilter:function(t){e(fa("group",t))}}})(Li),Fi=function(){return{type:ln}},Mi=function(){return{type:sn}},Bi=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var zi=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){n.setState({rest_api:e.target.value})},n.onClick=n.dismiss.bind(n),n.state={rest_api:Redirectioni10n.api_setting},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Bi(t,[{key:"componentDidUpdate",value:function(e){0===e.errors.length&&this.props.errors.length>0&&window.scrollTo(0,0)}},{key:"dismiss",value:function(){this.props.onClear()}},{key:"getDebug",value:function(e){for(var t=[Redirectioni10n.versions],n=0;n<e.length;n++){var r=e[n].request,o=void 0!==r&&r;t.push(""),t.push("Error: "+this.getErrorDetails(e[n])),o&&o.status&&o.statusText&&(t.push("Action: "+o.action),o.params&&t.push("Params: "+JSON.stringify(o.params)),t.push("Code: "+o.status+" "+o.statusText)),o&&t.push("Raw: "+(o.raw?o.raw:"-no data-"))}return t}},{key:"getErrorDetailsTitle",value:function(e){return 0===e.code?e.message:e.data&&e.data.wpdb?i.a.createElement("span",null,e.message+" ("+e.code+")",": ",i.a.createElement("code",null,e.data.wpdb)):e.code?e.message+" ("+e.code+")":e.message}},{key:"getErrorDetails",value:function(e){return 0===e.code?e.message:e.data&&e.data.wpdb?e.message+" ("+e.code+"): "+e.data.wpdb:e.code?e.message+" ("+e.code+")":e.message}},{key:"getErrorMessage",value:function(e){var t=this;console.log(e);var n=e.map(function(e){return e.action&&"reload"===e.action?-1===document.location.search.indexOf("retry=")?void(document.location.href+="&retry=1"):Object(c.translate)("The data on this page has expired, please reload."):0===e.code?Object(c.translate)("WordPress did not return a response. This could mean an error occurred or that the request was blocked. Please check your server error_log."):"rest_cookie_invalid_nonce"===e.code?Object(c.translate)("Please logout and login again."):e.request&&403===e.request.status?Object(c.translate)("Your server returned a 403 Forbidden error which may indicate the request was blocked. Are you using a firewall or a security plugin like mod_security?"):e.request&&413===e.request.status?Object(c.translate)("Your server has rejected the request for being too big. You will need to change it to continue."):"disabled"===e.code||"rest_disabled"===e.code?Object(c.translate)("Your WordPress REST API has been disabled. You will need to enable it for Redirection to continue working"):-1!==e.message.indexOf("Unexpected token")?Object(c.translate)("WordPress returned an unexpected message. This could be caused by your REST API not working, or by another plugin or theme."):e.message?t.getErrorDetailsTitle(e):Object(c.translate)("I was trying to do a thing and it went wrong. It may be a temporary issue and if you try again it might work - great!")});return i.a.createElement("p",null,Object.keys([{}].concat(n).reduce(function(e,t){return e[t]=e})))}},{key:"getHeight",value:function(e){for(var t=0,n=0;n<e.length;n++){t+=e[n].split("\n").length}return Math.max(t,20)}},{key:"renderError",value:function(e){var t=this.getDebug(e),n=Wn()({notice:!0,"notice-error":!0}),r="mailto:john@redirection.me?subject=Redirection%20Error&body="+encodeURIComponent(t.join("\n")),o="https://github.com/johngodley/redirection/issues/new?title=Redirection%20Error&body="+encodeURIComponent("```\n"+t.join("\n")+"\n```\n\n");return i.a.createElement("div",{className:n},i.a.createElement("div",{className:"closer",onClick:this.onClick},"✖"),i.a.createElement("h2",null,Object(c.translate)("Something went wrong 🙁")),i.a.createElement("strong",null,this.getErrorMessage(e)),i.a.createElement("ol",null,i.a.createElement("li",null,Object(c.translate)("If you are unable to get anything working then Redirection may have difficulty communicating with your server. You can try manually changing this setting:"),i.a.createElement("form",{action:Redirectioni10n.pluginRoot+"&sub=support",method:"POST"},"REST API: ",i.a.createElement(An,{items:Mn,name:"rest_api",value:this.state.rest_api,onChange:this.onChange}),i.a.createElement("input",{type:"submit",className:"button-secondary",value:Object(c.translate)("Save")}),i.a.createElement("input",{type:"hidden",name:"_wpnonce",value:Redirectioni10n.WP_API_nonce}),i.a.createElement("input",{type:"hidden",name:"action",value:"rest_api"}))),i.a.createElement("li",null,Object(c.translate)('Take a look at the {{link}}plugin status{{/link}}. It may be able to identify and "magic fix" the problem.',{components:{link:i.a.createElement("a",{href:"?page=redirection.php&sub=support"})}})),i.a.createElement("li",null,Object(c.translate)("{{link}}Redirection is unable to talk to your REST API{{/link}}. If you have disabled it then you will need to enable it.",{components:{link:i.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://redirection.me/support/problems/rest-api/?utm_source=redirection&utm_medium=plugin&utm_campaign=support"})}})),i.a.createElement("li",null,Object(c.translate)("{{link}}Security software may be blocking Redirection{{/link}}. You will need to configure this to allow REST API requests.",{components:{link:i.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://redirection.me/support/problems/security-software/?utm_source=redirection&utm_medium=plugin&utm_campaign=support"})}})),i.a.createElement("li",null,Object(c.translate)("{{link}}Caching software{{/link}}, in particular Cloudflare, can cache the wrong thing. Try clearing all your caches.",{components:{link:i.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://redirection.me/support/problems/cloudflare/?utm_source=redirection&utm_medium=plugin&utm_campaign=support"})}})),i.a.createElement("li",null,Object(c.translate)("{{link}}Please temporarily disable other plugins!{{/link}} This fixes so many problems.",{components:{link:i.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://redirection.me/support/problems/plugins/?utm_source=redirection&utm_medium=plugin&utm_campaign=support"})}}))),i.a.createElement("h3",null,Object(c.translate)("None of the suggestions helped")),i.a.createElement("p",null,Object(c.translate)("If this is a new problem then please either {{strong}}create a new issue{{/strong}} or send it in an {{strong}}email{{/strong}}. Include a description of what you were trying to do and the important details listed below. Please include a screenshot.",{components:{strong:i.a.createElement("strong",null)}})),i.a.createElement("p",null,i.a.createElement("a",{href:o,className:"button-primary"},Object(c.translate)("Create Issue"))," ",i.a.createElement("a",{href:r,className:"button-secondary"},Object(c.translate)("Email"))),i.a.createElement("h3",null,Object(c.translate)("Important details")),i.a.createElement("p",null,Object(c.translate)("Include these details in your report {{strong}}along with a description of what you were doing{{/strong}}.",{components:{strong:i.a.createElement("strong",null)}})),i.a.createElement("p",null,i.a.createElement("textarea",{readOnly:!0,rows:this.getHeight(t),cols:"120",value:t.join("\n"),spellCheck:!1})))}},{key:"render",value:function(){var e=this.props.errors;return 0===e.length?null:this.renderError(e)}}]),t}();var Gi=ee(function(e){return{errors:e.message.errors}},function(e){return{onClear:function(){e(Fi())}}})(zi),Wi=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Hi=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleClick=n.onClick.bind(n),n.handleShrink=n.onShrink.bind(n),n.state={shrunk:!1,width:"auto"},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Wi(t,[{key:"onClick",value:function(){this.state.shrunk?this.setState({shrunk:!1}):this.props.onClear()}},{key:"componentWillUpdate",value:function(e){this.props.notices!==e.notices&&(this.stopTimer(),this.setState({shrunk:!1}),this.startTimer())}},{key:"componentWillUnmount",value:function(){this.stopTimer()}},{key:"stopTimer",value:function(){clearTimeout(this.timer)}},{key:"startTimer",value:function(){this.timer=setTimeout(this.handleShrink,5e3)}},{key:"onShrink",value:function(){this.setState({shrunk:!0})}},{key:"getNotice",value:function(e){return e.length>1?e[e.length-1]+" ("+e.length+")":e[0]}},{key:"renderNotice",value:function(e){var t="notice notice-info redirection-notice"+(this.state.shrunk?" notice-shrunk":"");return i.a.createElement("div",{className:t,onClick:this.handleClick},i.a.createElement("div",{className:"closer"},"✔"),i.a.createElement("p",null,this.state.shrunk?i.a.createElement("span",{title:Object(c.translate)("View notice")},"🔔"):this.getNotice(e)))}},{key:"render",value:function(){var e=this.props.notices;return 0===e.length?null:this.renderNotice(e)}}]),t}();var Vi=ee(function(e){return{notices:e.message.notices}},function(e){return{onClear:function(){e(Mi())}}})(Hi),qi=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var $i=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),qi(t,[{key:"getMessage",value:function(e){return e>1?Object(c.translate)("Saving...")+" ("+e+")":Object(c.translate)("Saving...")}},{key:"renderProgress",value:function(e){return i.a.createElement("div",{className:"notice notice-progress redirection-notice"},i.a.createElement(Jr,null),i.a.createElement("p",null,this.getMessage(e)))}},{key:"render",value:function(){var e=this.props.inProgress;return 0===e?null:this.renderProgress(e)}}]),t}();var Ki=ee(function(e){return{inProgress:e.message.inProgress}},null)($i),Qi=function(e){var t=e.item,n=e.isCurrent,r=e.onClick,o=Redirectioni10n.pluginRoot+(""===t.value?"":"&sub="+t.value);return i.a.createElement("li",null,i.a.createElement("a",{className:n?"current":"",href:o,onClick:function(e){e.preventDefault(),r(t.value,o)}},t.name))},Yi=[{name:Object(c.translate)("Redirects"),value:""},{name:Object(c.translate)("Groups"),value:"groups"},{name:Object(c.translate)("Log"),value:"log"},{name:Object(c.translate)("404s"),value:"404s"},{name:Object(c.translate)("Import/Export"),value:"io"},{name:Object(c.translate)("Options"),value:"options"},{name:Object(c.translate)("Support"),value:"support"}],Ji=function(e){var t=e.onChangePage,n=Te();return i.a.createElement("div",{className:"subsubsub-container"},i.a.createElement("ul",{className:"subsubsub"},Yi.map(function(e,r){return i.a.createElement(Qi,{key:r,item:e,isCurrent:n===e.value||"redirect"===n&&""===e.value,onClick:t})}).reduce(function(e,t){return[e," | ",t]})))},Xi=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Zi={redirect:Object(c.translate)("Redirections"),groups:Object(c.translate)("Groups"),io:Object(c.translate)("Import/Export"),log:Object(c.translate)("Logs"),"404s":Object(c.translate)("404 errors"),options:Object(c.translate)("Options"),support:Object(c.translate)("Support")},el=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onAdd=function(e){e.preventDefault(),n.props.onAdd()},n.state={page:Te(),clicked:0,stack:!1,error:"3.3.1"!==Redirectioni10n.version,info:!1},n.handlePageChange=n.onChangePage.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),Xi(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:!0,stack:e,info:t})}},{key:"onChangePage",value:function(e,t){var n=this.props.errors;""===e&&(e="redirect"),"support"===e&&n.length>0?document.location.href=t:(history.pushState({},null,t),this.setState({page:e,clicked:this.state.clicked+1}),this.props.onClear())}},{key:"getContent",value:function(e){var t=this.state.clicked;switch(e){case"support":return i.a.createElement(pr,null);case"404s":return i.a.createElement($a,{clicked:t});case"log":return i.a.createElement(go,{clicked:t});case"io":return i.a.createElement(vi,null);case"groups":return i.a.createElement(Pi,{clicked:t});case"options":return i.a.createElement(er,null)}return i.a.createElement(Ui,{clicked:t})}},{key:"renderError",value:function(){var e=[Redirectioni10n.versions,"Buster: 3.3.1 === "+Redirectioni10n.version,"",this.state.stack];return this.state.info&&this.state.info.componentStack&&e.push(this.state.info.componentStack),"3.3.1"!==Redirectioni10n.version?i.a.createElement("div",{className:"notice notice-error"},i.a.createElement("h2",null,Object(c.translate)("Cached Redirection detected")),i.a.createElement("p",null,Object(c.translate)("Please clear your browser cache and reload this page.")),i.a.createElement("p",null,Object(c.translate)("If you are using a caching system such as Cloudflare then please read this: "),i.a.createElement("a",{href:"https://redirection.me/support/problems/cloudflare/?utm_source=redirection&utm_medium=plugin&utm_campaign=support",target:"_blank",rel:"noreferrer noopener"},Object(c.translate)("clearing your cache."))),i.a.createElement("p",null,i.a.createElement("textarea",{readOnly:!0,rows:e.length+3,cols:"120",value:e.join("\n"),spellCheck:!1}))):i.a.createElement("div",{className:"notice notice-error"},i.a.createElement("h2",null,Object(c.translate)("Something went wrong 🙁")),i.a.createElement("p",null,Object(c.translate)("Redirection is not working. Try clearing your browser cache and reloading this page."),"  ",Object(c.translate)("If you are using a page caching plugin or service (CloudFlare, OVH, etc) then you can also try clearing that cache.")),i.a.createElement("p",null,Object(c.translate)("If that doesn't help, open your browser's error console and create a {{link}}new issue{{/link}} with the details.",{components:{link:i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/johngodley/redirection/issues"})}})),i.a.createElement("p",null,Object(c.translate)("Please mention {{code}}%s{{/code}}, and explain what you were doing at the time",{components:{code:i.a.createElement("code",null)},args:this.state.page})),i.a.createElement("p",null,i.a.createElement("textarea",{readOnly:!0,rows:e.length+8,cols:"120",value:e.join("\n"),spellCheck:!1})))}},{key:"render",value:function(){var e=Zi[this.state.page];return this.state.error?this.renderError():i.a.createElement("div",{className:"wrap redirection"},i.a.createElement("h1",{className:"wp-heading-inline"},e),"redirect"===this.state.page&&i.a.createElement("a",{href:"#",onClick:this.onAdd,className:"page-title-action"},Object(c.translate)("Add New")),i.a.createElement(Ji,{onChangePage:this.handlePageChange}),i.a.createElement(Gi,null),this.getContent(this.state.page),i.a.createElement(Ki,null),i.a.createElement(Vi,null))}}]),t}();var tl,nl=ee(function(e){return{errors:e.message.errors}},function(e){return{onClear:function(){e(Fi())},onAdd:function(){e(ma(!0))}}})(el),rl=function(){return i.a.createElement(g,{store:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(R.createStore)(En,e,wn(R.applyMiddleware.apply(void 0,_n)))}(xn())},i.a.createElement(nl,null))};document.querySelector("#react-ui")&&(tl="react-ui",p.a.setLocale({"":{localeSlug:Redirectioni10n.localeSlug}}),p.a.addTranslations(Redirectioni10n.locale),function(e,t){s.a.render(i.a.createElement(u.AppContainer,null,i.a.createElement(e,null)),document.getElementById(t))}(rl,tl)),window.redirection=Redirectioni10n.version},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){(function(e,r){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(a){"object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType;var i="object"==typeof r&&r;i.global!==i&&i.window!==i&&i.self;var l,s=2147483647,u=36,c=1,p=26,f=38,d=700,h=72,m=128,g="-",b=/^xn--/,y=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=u-c,_=Math.floor,O=String.fromCharCode;function x(e){throw new RangeError(E[e])}function k(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function S(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+k((e=e.replace(v,".")).split("."),t).join(".")}function C(e){for(var t,n,r=[],o=0,a=e.length;o<a;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<a?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function j(e){return k(e,function(e){var t="";return e>65535&&(t+=O((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=O(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function T(e,t,n){var r=0;for(e=n?_(e/d):e>>1,e+=_(e/t);e>w*p>>1;r+=u)e=_(e/w);return _(r+(w+1)*e/(e+f))}function N(e){var t,n,r,o,a,i,l,f,d,b,y,v=[],E=e.length,w=0,O=m,k=h;for((n=e.lastIndexOf(g))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&x("not-basic"),v.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<E;){for(a=w,i=1,l=u;o>=E&&x("invalid-input"),((f=(y=e.charCodeAt(o++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:u)>=u||f>_((s-w)/i))&&x("overflow"),w+=f*i,!(f<(d=l<=k?c:l>=k+p?p:l-k));l+=u)i>_(s/(b=u-d))&&x("overflow"),i*=b;k=T(w-a,t=v.length+1,0==a),_(w/t)>s-O&&x("overflow"),O+=_(w/t),w%=t,v.splice(w++,0,O)}return j(v)}function R(e){var t,n,r,o,a,i,l,f,d,b,y,v,E,w,k,S=[];for(v=(e=C(e)).length,t=m,n=0,a=h,i=0;i<v;++i)(y=e[i])<128&&S.push(O(y));for(r=o=S.length,o&&S.push(g);r<v;){for(l=s,i=0;i<v;++i)(y=e[i])>=t&&y<l&&(l=y);for(l-t>_((s-n)/(E=r+1))&&x("overflow"),n+=(l-t)*E,t=l,i=0;i<v;++i)if((y=e[i])<t&&++n>s&&x("overflow"),y==t){for(f=n,d=u;!(f<(b=d<=a?c:d>=a+p?p:d-a));d+=u)k=f-b,w=u-b,S.push(O(P(b+k%w,0))),f=_(k/w);S.push(O(P(f,0))),a=T(n,E,r==o),n=0,++r}++n,++t}return S.join("")}l={version:"1.4.1",ucs2:{decode:C,encode:j},decode:N,encode:R,toASCII:function(e){return S(e,function(e){return y.test(e)?"xn--"+R(e):e})},toUnicode:function(e){return S(e,function(e){return b.test(e)?N(e.slice(4).toLowerCase()):e})}},void 0===(o=function(){return l}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(25)(e),n(10))},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var o,a=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?e:(o=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:r+a.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},function(e,t,n){var r,o,a={},i=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),l=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var n=function(e){return document.querySelector(e)}.call(this,e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),s=null,u=0,c=[],p=n(27);function f(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=a[r.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](r.parts[i]);for(;i<r.parts.length;i++)o.parts.push(y(r.parts[i],t))}else{var l=[];for(i=0;i<r.parts.length;i++)l.push(y(r.parts[i],t));a[r.id]={id:r.id,refs:1,parts:l}}}}function d(e,t){for(var n=[],r={},o=0;o<e.length;o++){var a=e[o],i=t.base?a[0]+t.base:a[0],l={css:a[1],media:a[2],sourceMap:a[3]};r[i]?r[i].parts.push(l):n.push(r[i]={id:i,parts:[l]})}return n}function h(e,t){var n=l(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),c.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=l(e.insertInto+" "+e.insertAt.before);n.insertBefore(t,o)}}function m(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=c.indexOf(e);t>=0&&c.splice(t,1)}function g(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),b(t,e.attrs),h(e,t),t}function b(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function y(e,t){var n,r,o,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var i=u++;n=s||(s=g(t)),r=w.bind(null,n,i,!1),o=w.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",b(t,e.attrs),h(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||a)&&(r=p(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([r],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(i),l&&URL.revokeObjectURL(l)}.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),r=function(e,t){var n=t.css,r=t.media;r&&e.setAttribute("media",r);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=i()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return f(n,t),function(e){for(var r=[],o=0;o<n.length;o++){var i=n[o];(l=a[i.id]).refs--,r.push(l)}e&&f(d(e,t),t);for(o=0;o<r.length;o++){var l;if(0===(l=r[o]).refs){for(var s=0;s<l.parts.length;s++)l.parts[s]();delete a[l.id]}}}};var v,E=(v=[],function(e,t){return v[e]=t,v.filter(Boolean).join("\n")});function w(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=E(t,o);else{var a=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(i=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),a=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(a).concat([o]).join("\n")}var i;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var a=this[o][0];"number"==typeof a&&(r[a]=!0)}for(o=0;o<e.length;o++){var i=e[o];"number"==typeof i[0]&&r[i[0]]||(n&&!i[2]?i[2]=n:n&&(i[2]="("+i[2]+") and ("+n+")"),t.push(i))}},t}},function(e,t,n){(e.exports=n(29)(!1)).push([e.i,'.spinner-container{display:inline-block;position:relative}.css-spinner{position:absolute;left:10px;top:-25px;display:block;width:40px;height:40px;background-color:#333;border-radius:100%;-webkit-animation:sk-scaleout 1s infinite ease-in-out;animation:sk-scaleout 1s infinite ease-in-out}@-webkit-keyframes sk-scaleout{0%{-webkit-transform:scale(0)}to{-webkit-transform:scale(1);opacity:0}}@keyframes sk-scaleout{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.spinner-small .css-spinner{width:20px;height:20px;top:-15px;left:5px}body.redirection-modal{overflow:hidden}.modal-wrapper{width:100%}.modal-backdrop{background-color:#999;opacity:.6;z-index:1000}.modal,.modal-backdrop{width:100%;height:100%;position:fixed;top:0;left:0}.modal{z-index:10000;text-align:center}.modal .modal-close button{position:absolute;top:0;right:0;padding-top:5px;padding-right:5px;border:none;background-color:#fff;cursor:pointer;z-index:10001}.modal .modal-content,.modal .modal-table{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10000;margin:auto;border-radius:5px;background:#fff;opacity:1;box-shadow:3px 3px 3px rgba(0,0,0,.2)}.modal .modal-content{width:60%;height:100px;margin-right:15%;max-width:90%;max-height:90%}.modal .modal-content h1{margin:0!important;color:#333!important}.modal-wrapper.modal-wrapper-padless .modal-content{padding:20px}.modal-wrapper-padding .modal-content{padding:10px}.geo-map{padding-bottom:10px;width:100%;position:relative}.geo-map .geo-full{height:600px}.geo-map.geo-map-small{height:100px;padding-top:20px}.geo-map iframe{top:0;background-color:#ddd;height:450px;max-height:90%}.geo-map iframe,.geo-map table{position:absolute;left:0;width:100%}.geo-map table{background-color:#fff;padding:10px;padding-bottom:30px;bottom:0;height:130px}.geo-map table td,.geo-map table th{padding:0}.geo-map table th{font-weight:700}.geo-map table td{text-align:left}.geo-map h2{line-height:1;margin:0;padding-bottom:10px}.geo-map .external{position:absolute;right:15px;bottom:10px}.useragent{box-sizing:border-box;padding-bottom:30px}.useragent th{width:120px;vertical-align:top;line-height:1}.useragent td{line-height:1.2}.useragent h2{padding-left:10px}.useragent h2,.useragent td{text-align:left}.useragent h2{margin-bottom:0;padding-bottom:5px}.useragent .useragent-agent{font-size:12px}.useragent .external{position:absolute;right:15px;bottom:15px}.useragent .agent-unknown,.useragent .agent-unknown h2{text-align:center;padding:5px}.useragent table{padding-bottom:15px}.modal-error h2{text-align:center}.modal-loading{display:flex;height:100px}.modal-loading>*{justify-content:center;align-self:center;margin-left:calc(50% - 30px);margin-top:40px}@media screen and (max-width:782px){.modal .modal-content{width:80%;margin-right:10%}.modal .geo-map iframe{height:255px}.modal .geo-map .geo-full{height:400px!important}}.redirection .wp-list-table tbody>th:not(.check-column){vertical-align:top;padding:5px}.redirection .wp-list-table .column-last_count{width:80px;text-align:left}.redirection .wp-list-table .column-date{width:150px}.redirection .wp-list-table .column-last_access{width:150px;text-align:left}.redirection .wp-list-table .column-ip,.redirection .wp-list-table .column-module,.redirection .wp-list-table .column-total{width:110px}.redirection .wp-list-table .column-redirects{width:100px;text-align:left}.redirection .wp-list-table .column-position{width:80px;text-align:left}.redirection .wp-list-table .column-code{width:50px;text-align:left}.redirection .wp-list-table strike{opacity:.7}.redirection .form-table th a{color:#444}table.edit-redirection{width:100%;padding-right:15px}table.edit-redirection th{width:130px;font-weight:700;text-align:left}table.edit-redirection tbody tr td{display:flex;padding:0}table.edit-redirection tbody tr td>*{flex:1 1 auto;justify-content:flex-start;margin-right:5px}table.edit-redirection tbody tr td .edit-redirection-regex,table.edit-redirection tbody tr td>select{flex:0 0 auto}table.edit-redirection tbody tr td .edit-redirection-position input{width:60px}table.edit-redirection tbody tr td .small-flex{flex-grow:0;padding-top:5px}.edit-groups{width:100%}.edit-groups th{line-height:1.2;vertical-align:top;padding:2px;padding-top:5px!important;padding-left:0;font-size:13px;font-weight:700}.edit-groups td{padding:2px}.edit-groups input[type=text]{width:100%}.table-buttons{float:left;padding-top:2px}.table-buttons>button,.table-buttons>div.table-button-item,.table-buttons>form{margin-right:5px!important;display:inline}.table-buttons .modal-wrapper{display:inline}@media screen and (max-width:782px){input[type=checkbox]{height:20px;width:20px}.wp-list-table td.column-primary{padding-left:10px;padding-right:10px}.redirection .wp-list-table input,.redirection .wp-list-table select,.redirection .wp-list-table td,.redirection .wp-list-table th{font-size:1em!important}.redirection .wp-list-table td.column-code,.redirection .wp-list-table td.column-date,.redirection .wp-list-table td.column-referrer,.redirection .wp-list-table td.column-url .target,.redirection .wp-list-table th.column-code,.redirection .wp-list-table th.column-date{display:none!important}table.edit-redirection{padding-right:0}table.edit-redirection th{display:block;font-weight:700;padding-left:0!important}table.edit-redirection tbody tr td{flex-wrap:wrap}table.edit-redirection tbody tr td>*{flex:1 0 auto;width:100%}table.edit-redirection input[type=number],table.edit-redirection input[type=text],table.edit-redirection select{width:100%}table.edit-groups input[type=number],table.edit-groups select,table.edit-redirection input[type=number],table.edit-redirection select{height:30px!important}}.plugin-status th{text-align:left}.plugin-status span,.plugin-status td,.plugin-status th{padding:5px;vertical-align:top}.plugin-status .plugin-status-good{background-color:#46b450;color:#fff}.plugin-status .plugin-status-problem{background-color:orange;color:#fff}.plugin-status .plugin-status-error{background-color:#ff3860;color:#fff}.github{margin-top:8px}.github a{text-decoration:none}.github img{padding-right:10px;margin-bottom:-10px}.donation .donation-amount{float:left;margin-top:10px}.donation .donation-amount span{font-size:28px;margin-top:4px;vertical-align:bottom}.donation .donation-amount img{width:24px!important;margin-bottom:-5px!important}.donation .donation-amount:after{content:"";display:block;clear:both}.donation input[type=number]{width:60px;margin-left:10px}.donation td,.donation th{padding-bottom:0;margin-bottom:0}.donation input[type=submit]{margin-left:10px}.dropzone{border:3px dashed #bbb;text-align:center;padding:10px;padding-bottom:15px;margin-bottom:10px;border-radius:4px}.dropzone,.dropzone h3{color:#666}.dropzone p{font-size:14px}.dropzone .groups{margin-top:15px;margin-bottom:15px}.dropzone .is-placeholder{width:50%;height:90px;position:relative;margin:0 auto}.dropzone-hover{border-color:#86bfd4}.dropzone-importing{border-color:transparent}.redirection-notice{position:fixed;bottom:25px;right:0;font-weight:700;box-shadow:3px 3px 3px rgba(0,0,0,.2);border-top:1px solid #eee;cursor:pointer;transition:width 1s ease-in-out}.redirection-notice p{padding-right:20px}.redirection-notice .closer{position:absolute;right:5px;top:10px;font-size:16px;opacity:.8}.redirection-notice.notice-shrunk{width:20px}.redirection-notice.notice-shrunk p{font-size:16px}.redirection-notice.notice-shrunk .closer{display:none}.notice-progress{border-left:5px solid green;padding:10px;cursor:auto;bottom:80px}.notice-progress p{margin-left:50px;animation:loading-fade 1.2s ease-in-out infinite}.notice-progress .spinner-container{position:absolute;left:0;top:33px}@keyframes loading-fade{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.placeholder-container{width:100%;height:100px;position:relative}.placeholder-loading{content:"";position:absolute;top:16px;right:8px;bottom:16px;left:8px;padding-left:8px;padding-top:8px;background-color:#c8d7e1;animation:loading-fade 1.6s ease-in-out infinite}.placeholder-inline{width:100%;height:50px;position:relative}.placeholder-inline .placeholder-loading{top:0;right:0;left:0;bottom:0}.loading-small{width:25px;height:25px}input.current-page{width:60px}.loader-wrapper{position:relative}.loader-textarea{height:100px}.wp-list-table .is-placeholder td{position:relative;height:50px}.wp-list-table .item-loading{opacity:.3}.subsubsub-container:after,.subsubsub-container:before{content:"";display:table}.subsubsub-container:after{clear:both}.wp-core-ui .button-delete{color:#fff}.wp-core-ui .button-delete,.wp-core-ui .button-delete:hover{box-shadow:none;text-shadow:none;background-color:#ff3860;border-color:transparent}.inline-notice{background:#fff;border-left:4px solid #fff;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 15px 2px;padding:1px 12px;margin:5px 0 15px;border-left-color:#ffb900}.inline-notice.inline-general{border-left-color:#46b450}.addTop{margin-top:20px}@media screen and (max-width:782px){.newsletter form input[type=email]{display:block;width:100%;margin:5px 0}.import select{width:100%;margin:5px 0}.plugin-importer button{width:100%}p.search-box input[name=s]{margin-top:20px}}.notice-error{margin-top:3em}.notice-error .closer{float:right;padding-top:5px;font-size:18px;cursor:pointer;color:#333}.notice-error textarea{font-family:courier;font-size:12px;background-color:#eee;width:100%}.notice-error span code{background-color:transparent}.module-export{border:1px solid #ddd;padding:5px;font-family:courier;margin-top:15px;width:100%;background-color:#fff!important}.redirects a.advanced{text-decoration:none}',""])},function(e,t,n){var r=n(30);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(28)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,l){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?a(i(e),function(i){var l=encodeURIComponent(r(i))+n;return o(e[i])?a(e[i],function(e){return l+encodeURIComponent(r(e))}).join(t):l+encodeURIComponent(r(e[i]))}).join(t):l?encodeURIComponent(r(l))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var i=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,a){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var l=/\+/g;e=e.split(t);var s=1e3;a&&"number"==typeof a.maxKeys&&(s=a.maxKeys);var u=e.length;s>0&&u>s&&(u=s);for(var c=0;c<u;++c){var p,f,d,h,m=e[c].replace(l,"%20"),g=m.indexOf(n);g>=0?(p=m.substr(0,g),f=m.substr(g+1)):(p=m,f=""),d=decodeURIComponent(p),h=decodeURIComponent(f),r(i,d)?o(i[d])?i[d].push(h):i[d]=[i[d],h]:i[d]=h}return i};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=n(6),o=n(7),a=n(35);e.exports=function(){function e(e,t,n,r,i,l){l!==a&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t){e.exports=
18
  /**
19
  * Exposes number format capability through i18n mixin
20
  *
redirection.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Redirection
4
  Plugin URI: https://redirection.me/
5
  Description: Manage all your 301 redirects and monitor 404 errors
6
- Version: 3.3
7
  Author: John Godley
8
  Author URI: https://johngodley.com
9
  Text Domain: redirection
@@ -35,7 +35,13 @@ include dirname( __FILE__ ) . '/models/redirect.php';
35
  include dirname( __FILE__ ) . '/models/module.php';
36
  include dirname( __FILE__ ) . '/models/log.php';
37
  include dirname( __FILE__ ) . '/models/flusher.php';
38
- include dirname( __FILE__ ) . '/models/match.php';
 
 
 
 
 
 
39
  include dirname( __FILE__ ) . '/models/action.php';
40
  include dirname( __FILE__ ) . '/models/request.php';
41
 
3
  Plugin Name: Redirection
4
  Plugin URI: https://redirection.me/
5
  Description: Manage all your 301 redirects and monitor 404 errors
6
+ Version: 3.3.1
7
  Author: John Godley
8
  Author URI: https://johngodley.com
9
  Text Domain: redirection
35
  include dirname( __FILE__ ) . '/models/module.php';
36
  include dirname( __FILE__ ) . '/models/log.php';
37
  include dirname( __FILE__ ) . '/models/flusher.php';
38
+
39
+ if ( version_compare( phpversion(), '5.4' ) < 0 ) {
40
+ include dirname( __FILE__ ) . '/models/match-deprecated.php';
41
+ } else {
42
+ include dirname( __FILE__ ) . '/models/match.php';
43
+ }
44
+
45
  include dirname( __FILE__ ) . '/models/action.php';
46
  include dirname( __FILE__ ) . '/models/request.php';
47