From aaac00c8bd73c49091fddeb0d56db09add1539e5 Mon Sep 17 00:00:00 2001 From: John Godley Date: Sat, 10 Nov 2018 14:18:17 +0000 Subject: [PATCH] Release 3.6.2 --- gulpfile.js | 4 ++-- models/fixer.php | 4 ++-- package.json | 2 +- readme.txt | 6 ++++-- redirection-version.php | 4 ++-- redirection.js | 4 ++-- redirection.php | 2 +- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index c09e1315..0e0de020 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -174,13 +174,13 @@ const copyPlugin = ( target, cb ) => gulp.src( SVN_SOURCE_FILES ) } } ); -gulp.task( 'svn', () => copyPlugin( config.svn_target ) ); +gulp.task( 'svn', () => copyPlugin( config.svn_target, () => console.log( 'SVN exported to ' + config.svn_target ) ) ); gulp.task( 'export', () => { const zipTarget = path.resolve( config.export_target, '..' ); const zipName = 'redirection-' + pkg.version + '.zip'; - console.log( 'Exporting: ' + zipName ); + console.log( 'Exporting: ' + zipName + ' to ' + config.export_target ); return copyPlugin( config.export_target, () => { return gulp.src( config.export_target + '/**', { base: path.join( config.export_target, '..' ) } ) diff --git a/models/fixer.php b/models/fixer.php index ab72223f..6344549e 100644 --- a/models/fixer.php +++ b/models/fixer.php @@ -52,8 +52,8 @@ private function get_http_settings() { $message = __( 'Site and home are consistent', 'redirection' ); if ( $site !== $home ) { - $message = __( 'Site and home URL are inconsistent - please correct from your General settings', 'redirection' ); - $message .= ' - ' . get_site_url() . ' !== ' . get_home_url(); + /* translators: 1: Site URL, 2: Home URL */ + $message = sprintf( __( 'Site and home URL are inconsistent. Please correct from your Settings > General page: %1$1s is not %2$2s', 'redirection' ), get_site_url(), get_home_url() ); } return array( diff --git a/package.json b/package.json index 1295266d..6e6e0d6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "redirection", - "version": "3.6.1", + "version": "3.6.2", "description": "Redirection is a WordPress plugin to manage 301 redirections and keep track of 404 errors without requiring knowledge of Apache .htaccess files.", "main": "redirection.php", "sideEffects": true, diff --git a/readme.txt b/readme.txt index 8cca14d3..e2bc9082 100644 --- a/readme.txt +++ b/readme.txt @@ -139,8 +139,10 @@ The plugin works in a similar manner to how WordPress handles permalinks and sho == Changelog == -= 3.6.2 - 7th November 2018 = -* Add another PHP < 5.4 fix += 3.6.2 - 10th November 2018 = +* Add another PHP < 5.4 compat fix +* Fix 'delete all from 404 log' when ungrouped deleting all 404s +* Fix IDs shown in bulk add redirect = 3.6.1 - 3rd November 2018 = * Add another PHP < 5.4 fix. Sigh diff --git a/redirection-version.php b/redirection-version.php index 7ace7d62..49fbf830 100644 --- a/redirection-version.php +++ b/redirection-version.php @@ -1,5 +1,5 @@ 0&&c>u&&(c=u);for(var s=0;s=0?(p=m.substr(0,y),f=m.substr(y+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,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*{justify-content:center;align-self:center;margin-left:calc(50% - 30px);margin-top:40px}@media screen and (max-width: 782px){.redirection-modal_main .redirection-modal_content{width:80%;margin-right:10%}}\n",""])},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=n(49);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,'@-webkit-keyframes loading-fade{0%{opacity:0.5}50%{opacity:1}100%{opacity:0.5}}@keyframes loading-fade{0%{opacity:0.5}50%{opacity:1}100%{opacity:0.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;-webkit-animation:loading-fade 1.6s ease-in-out infinite;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:0.3}\n',""])},function(e,t,n){var r=n(51);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".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:0px;margin-bottom:0px}.donation input[type=submit]{margin-left:10px}\n",""])},function(e,t,n){var r=n(53);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!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 1.0s infinite ease-in-out;animation:sk-scaleout 1.0s infinite ease-in-out}@-webkit-keyframes sk-scaleout{0%{-webkit-transform:scale(0)}100%{-webkit-transform:scale(1);opacity:0}}@keyframes sk-scaleout{0%{-webkit-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.spinner-small .css-spinner{width:20px;height:20px;top:-15px;left:5px}\n",""])},function(e,t,n){var r=n(55);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".http-tester input[type=text]{width:80%}.http-tester table{width:95%}.http-tester table th,.http-tester table td{vertical-align:top;padding:5px 5px;overflow:hidden}.http-tester table td{max-width:500px}.http-tester table th{text-align:right;padding-right:10px;width:150px}.http-tester table p{padding-top:0;margin-top:0}.http-tester table code{background-color:transparent;font-size:12px;padding:0}.http-tester ul{list-style-type:disc;margin-left:20px}.http-tester ul li span{margin:-20px}.http-tester ul ul{list-style-type:disc;margin-left:20px}\n",""])},function(e,t,n){var r=n(57);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".plugin-status th{text-align:left;padding:5px;vertical-align:top}.plugin-status td,.plugin-status span{vertical-align:top;padding:5px}.plugin-status .plugin-status-good{background-color:#4ab866;color:white}.plugin-status .plugin-status-problem{background-color:orange;color:white}.plugin-status .plugin-status-error{background-color:#ff3860;color:white}.github{margin-top:8px}.github a{text-decoration:none}.github img{padding-right:10px;margin-bottom:-10px}\n",""])},function(e,t,n){var r=n(59);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,'.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-module,.redirection .wp-list-table .column-total,.redirection .wp-list-table .column-ip{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 .check-column-red{vertical-align:middle;padding:4px 0 0 3px !important;width:2.2em;margin:0px}.redirection .wp-list-table strike{opacity:0.7}.redirection .form-table th a{color:#444}table.edit-redirection{width:100%;padding-right:15px}table.edit-redirection th{width:130px;font-weight:bold;text-align:left}table.edit-redirection th.top{vertical-align:top}table.edit-redirection tbody tr td{display:flex;padding:0px}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}table.edit-redirection tbody td.edit-left>*{flex:none}table.edit-redirection textarea{width:100%;height:100px}.edit-groups{width:100%}.edit-groups th{line-height:1.2;vertical-align:top;padding:2px;padding-top:5px !important;padding-left:0px;font-size:13px;font-weight:bold}.edit-groups td{padding:2px}.edit-groups input[type=text]{width:100%}.table-buttons{float:left;padding-top:2px}.table-buttons>button,.table-buttons>form,.table-buttons>div.table-button-item{margin-right:5px !important;display:inline}.table-buttons .redirection-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 td,.redirection .wp-list-table input,.redirection .wp-list-table select,.redirection .wp-list-table th{font-size:1em !important}.redirection .wp-list-table td.column-code,.redirection .wp-list-table th.column-code,.redirection .wp-list-table td.column-url .target,.redirection .wp-list-table td.column-date,.redirection .wp-list-table th.column-date,.redirection .wp-list-table td.column-referrer{display:none !important}table.edit-redirection{padding-right:0}table.edit-redirection th{display:block;font-weight:bold;padding-left:0px !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="text"],table.edit-redirection select,table.edit-redirection input[type="number"]{width:100%}table.edit-redirection select,table.edit-redirection input[type="number"]{height:30px !important}table.edit-groups select,table.edit-groups input[type="number"]{height:30px !important}}\n',""])},function(e,t,n){(function(e,r){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(a){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof r&&r;i.global!==i&&i.window!==i&&i.self;var l,u=2147483647,c=36,s=1,p=26,f=38,d=700,h=72,m=128,y="-",b=/^xn--/,g=/[^\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=c-s,O=Math.floor,_=String.fromCharCode;function S(e){throw new RangeError(E[e])}function x(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function k(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+x((e=e.replace(v,".")).split("."),t).join(".")}function j(e){for(var t,n,r=[],o=0,a=e.length;o=55296&&t<=56319&&o65535&&(t+=_((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=_(e)}).join("")}function P(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function T(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function D(e,t,n){var r=0;for(e=n?O(e/d):e>>1,e+=O(e/t);e>w*p>>1;r+=c)e=O(e/w);return O(r+(w+1)*e/(e+f))}function N(e){var t,n,r,o,a,i,l,f,d,b,g=[],v=e.length,E=0,w=m,_=h;for((n=e.lastIndexOf(y))<0&&(n=0),r=0;r=128&&S("not-basic"),g.push(e.charCodeAt(r));for(o=n>0?n+1:0;o=v&&S("invalid-input"),((f=P(e.charCodeAt(o++)))>=c||f>O((u-E)/i))&&S("overflow"),E+=f*i,!(f<(d=l<=_?s:l>=_+p?p:l-_));l+=c)i>O(u/(b=c-d))&&S("overflow"),i*=b;_=D(E-a,t=g.length+1,0==a),O(E/t)>u-w&&S("overflow"),w+=O(E/t),E%=t,g.splice(E++,0,w)}return C(g)}function R(e){var t,n,r,o,a,i,l,f,d,b,g,v,E,w,x,k=[];for(v=(e=j(e)).length,t=m,n=0,a=h,i=0;i=t&&gO((u-n)/(E=r+1))&&S("overflow"),n+=(l-t)*E,t=l,i=0;iu&&S("overflow"),g==t){for(f=n,d=c;!(f<(b=d<=a?s:d>=a+p?p:d-a));d+=c)x=f-b,w=c-b,k.push(_(T(b+x%w,0))),f=O(x/w);k.push(_(T(f,0))),a=D(n,E,r==o),n=0,++r}++n,++t}return k.join("")}l={version:"1.4.1",ucs2:{decode:j,encode:C},decode:N,encode:R,toASCII:function(e){return k(e,function(e){return g.test(e)?"xn--"+R(e):e})},toUnicode:function(e){return k(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(61)(e),n(16))},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){"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,n){var r=n(64);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".redirection-poweredby{position:absolute;right:15px;bottom:10px}\n",""])},function(e,t,n){var r=n(66);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".redirection-geomap{padding-bottom:10px;width:100%;position:relative}.redirection-geomap .redirection-geomap_full{height:600px}.redirection-geomap iframe{position:absolute;top:0;left:0;width:100%;background-color:#f3f6f8;height:450px;max-height:90%}.redirection-geomap table{background-color:#fff;padding:10px;padding-bottom:30px;position:absolute;bottom:0;left:0;height:130px;width:100%}.redirection-geomap table th,.redirection-geomap table td{padding:0}.redirection-geomap table th{font-weight:bold;text-align:left;width:150px}.redirection-geomap table td{text-align:left}.redirection-geomap h2{line-height:1;margin:0;padding-bottom:10px}@media screen and (max-width: 782px){.redirection-modal_main .redirection-geomap iframe{height:255px}.redirection-modal_main .redirection-geomap .redirection-geomap_full{height:400px !important}}.redirection-geomap_small{height:100px;padding-top:20px}\n",""])},function(e,t,n){var r=n(68);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".redirection-useragent{box-sizing:border-box;padding-bottom:30px}.redirection-useragent th{width:120px;vertical-align:top;line-height:1;text-align:left;padding-left:10px}.redirection-useragent td{line-height:1.2}.redirection-useragent td,.redirection-useragent h2{text-align:left}.redirection-useragent h2{margin-bottom:0;padding-left:12px;padding-bottom:5px}.redirection-useragent .redirection-useragent_agent{font-size:12px}.redirection-useragent .redirection-useragent_unknown,.redirection-useragent .redirection-useragent_unknown h2{text-align:center;padding:5px}.redirection-useragent table{padding-bottom:15px;padding-top:10px}\n",""])},function(e,t,n){var r=n(70);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".dropzone{border:3px dashed #bbb;text-align:center;padding:10px;padding-bottom:15px;margin-bottom:10px;border-radius:4px;color:#666}.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,.dropzone-hover{border-color:#86bfd4}.dropzone-importing{border-color:transparent}\n",""])},function(e,t,n){var r=n(72);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".redirection-httpcheck_results{display:flex;padding-bottom:40px}.redirection-httpcheck_results .redirection-httpcheck_info{text-align:left}.redirection-httpcheck table{width:100%}.redirection-httpcheck .redirection-httpcheck_status{width:80px}.redirection-httpcheck .redirection-httpcheck_status .dashicons{font-size:70px;width:70px;height:70px}.redirection-httpcheck .redirection-httpcheck_status .dashicons-yes{color:#4ab866}.redirection-httpcheck .redirection-httpcheck_status .dashicons-no{color:#ff3860}.redirection-httpcheck h2{margin-bottom:0;padding-bottom:5px;text-align:left;padding-left:10px}\n",""])},function(e,t,n){var r=n(74);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".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,Monaco,monospace;font-size:12px;background-color:#eee;width:100%}.notice-error span code{background-color:transparent}\n",""])},function(e,t,n){var r=n(76);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".redirection-notice{position:fixed;bottom:25px;right:0;font-weight:bold;box-shadow:3px 3px 3px rgba(0,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:0.8}.redirection-notice.notice-shrunk{width:20px}.redirection-notice.notice-shrunk p{font-size:16px}.redirection-notice.notice-shrunk .closer{display:none}\n",""])},function(e,t,n){var r=n(78);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".notice-progress{border-left:5px solid green;padding:10px;cursor:auto;bottom:80px}.notice-progress p{margin-left:50px;-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite}.notice-progress .spinner-container{position:absolute;left:0;top:33px}\n",""])},function(e,t,n){var r=n(80);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,'.subsubsub-container::before,.subsubsub-container::after{content:"";display:table}.subsubsub-container::after{clear:both}\n',""])},function(e,t,n){var r=n(82);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,'.wp-core-ui .button-delete{box-shadow:none;text-shadow:none;background-color:#ff3860;border-color:transparent;color:#fff}.wp-core-ui .button-delete:hover{background-color:#ff3860;border-color:transparent;box-shadow:none;text-shadow:none}.inline-notice{background:#fff;border-left:4px solid #fff;box-shadow:0 1px 1px 0 rgba(0,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 0px}.import select{width:100%;margin:5px 0px}.plugin-importer button{width:100%}p.search-box input[name="s"]{margin-top:20px}}.module-export{border:1px solid #ddd;padding:5px;font-family:courier,Monaco,monospace;margin-top:15px;width:100%;background-color:white !important}.redirects a.advanced{text-decoration:none}\n',""])},function(e,t,n){"use strict";n.r(t);var r=n(17),o=n.n(r),a={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(a.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return a.iterable&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function h(e){var t=new FileReader,n=d(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a.arrayBuffer&&a.blob&&function(e){return e&&DataView.prototype.isPrototypeOf(e)}(e)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=d(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function v(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function E(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},y.call(g.prototype),y.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];E.redirect=function(e,t){if(-1===w.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})};var O=self.DOMException;try{new O}catch(e){(O=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),O.prototype.constructor=O}function _(e,t){return new Promise(function(n,r){var o=new g(e,t);if(o.signal&&o.signal.aborted)return r(new O("Aborted","AbortError"));var i=new XMLHttpRequest;function l(){i.abort()}i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:function(e){var t=new p;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;n(new E(t,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.onabort=function(){r(new O("Aborted","AbortError"))},i.open(o.method,o.url,!0),"include"===o.credentials?i.withCredentials=!0:"omit"===o.credentials&&(i.withCredentials=!1),"responseType"in i&&a.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),o.signal&&(o.signal.addEventListener("abort",l),i.onreadystatechange=function(){4===i.readyState&&o.signal.removeEventListener("abort",l)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})}_.polyfill=!0,self.fetch||(self.fetch=_,self.Headers=p,self.Request=g,self.Response=E),!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>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],o=0;o=0||(o[n]=e[n]);return o}var B=n(19),z=n.n(B),G=n(10),W=n.n(G),$=n(11),H=null,q={notify:function(){}};var V=function(){function e(e,t,n){this.store=e,this.parentSub=t,this.onStateChange=n,this.unsubscribe=null,this.listeners=q}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=function(){var e=[],t=[];return{clear:function(){t=H,e=H},notify:function(){for(var n=e=t,r=0;r, or explicitly pass "'+h+'" as a prop to "'+r+'".'),o.initSelector(),o.initSubscription(),o}D(a,n);var i=a.prototype;return i.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[g]=t||this.context[g],e},i.componentDidMount=function(){f&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},i.componentWillReceiveProps=function(e){this.selector.run(e)},i.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},i.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=Q,this.store=null,this.selector.run=Q,this.selector.shouldComponentUpdate=!1},i.getWrappedInstance=function(){return W()(y,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+u+"() call."),this.wrappedInstance},i.setWrappedInstance=function(e){this.wrappedInstance=e},i.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.initSubscription=function(){if(f){var e=(this.propsMode?this.props:this.context)[g];this.subscription=new V(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},i.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(Y)):this.notifyNestedSubs()},i.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},i.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},i.addExtraProps=function(e){if(!(y||s||this.propsMode&&this.subscription))return e;var t=F({},e);return y&&(t.ref=this.setWrappedInstance),s&&(t[s]=this.renderCount++),this.propsMode&&this.subscription&&(t[g]=this.subscription),t},i.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(S.createElement)(t,this.addExtraProps(e.props))},a}(S.Component);return a.WrappedComponent=t,a.displayName=r,a.childContextTypes=w,a.contextTypes=E,a.propTypes=E,z()(a,t)}}var J=Object.prototype.hasOwnProperty;function Z(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function ee(e,t){if(Z(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=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 de(e,t){return e===t}var he=function(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?X:n,o=t.mapStateToPropsFactories,a=void 0===o?ie:o,i=t.mapDispatchToPropsFactories,l=void 0===i?ae:i,u=t.mergePropsFactories,c=void 0===u?ue:u,s=t.selectorFactory,p=void 0===s?pe:s;return function(e,t,n,o){void 0===o&&(o={});var i=o,u=i.pure,s=void 0===u||u,f=i.areStatesEqual,d=void 0===f?de:f,h=i.areOwnPropsEqual,m=void 0===h?ee:h,y=i.areStatePropsEqual,b=void 0===y?ee:y,g=i.areMergedPropsEqual,v=void 0===g?ee:g,E=M(i,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),w=fe(e,a,"mapStateToProps"),O=fe(t,l,"mapDispatchToProps"),_=fe(n,c,"mergeProps");return r(p,F({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:w,initMapDispatchToProps:O,initMergeProps:_,pure:s,areStatesEqual:d,areOwnPropsEqual:m,areStatePropsEqual:b,areMergedPropsEqual:v},E))}}(),me=n(21);function ye(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 be=ye();be.withExtraArgument=ye;var ge=be,ve="SETTING_LOAD_START",Ee="SETTING_LOAD_SUCCESS",we="SETTING_LOAD_FAILED",Oe="SETTING_LOAD_STATUS",_e="SETTING_SAVING",Se="SETTING_SAVED",xe="SETTING_SAVE_FAILED",ke="STATUS_IN_PROGRESS",je="STATUS_FAILED",Ce="STATUS_COMPLETE",Pe="STATUS_SAVING";function Te(e){for(var t=1;t0&&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=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=$e(),i={orderby:r,direction:"desc",page:0,per_page:parseInt(Redirectioni10n.per_page,10),selected:[],filterBy:"",filter:"",groupBy:""},l=void 0===a.sub?"":a.sub;return-1===o.indexOf(l)?i:qe({},i,{orderby:a.orderby&&-1!==e.indexOf(a.orderby)?a.orderby:i.orderby,direction:a.direction&&"asc"===a.direction?"asc":i.direction,page:a.offset&&parseInt(a.offset,10)>0?parseInt(a.offset,10):i.page,per_page:Redirectioni10n.per_page?parseInt(Redirectioni10n.per_page,10):i.per_page,filterBy:a.filterby&&-1!==t.indexOf(a.filterby)?a.filterby:i.filterBy,filter:a.filter?a.filter:i.filter,groupBy:a.groupby&&-1!==n.indexOf(a.groupby)?a.groupby:i.groupBy})},Xe=function(e,t){for(var n=Object.assign({},e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=Redirectioni10n.WP_API_root+"redirection/v1/"+e+"/";if(t._wpnonce=Redirectioni10n.WP_API_nonce,t&&Object.keys(t).length>0&&(t=function(e){return Object.keys(e).filter(function(t){return e[t]}).reduce(function(t,n){return t[n]=e[n],t},{})}(t),Object.keys(t).length>0)){var r=n+(-1===Redirectioni10n.WP_API_root.indexOf("?")?"?":"&")+ze.a.stringify(t);return-1!==Redirectioni10n.WP_API_root.indexOf("page=redirection.php")?r.replace(/page=(\d+)/,"ppage=$1"):r}return n},it=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"}},lt=function(e,t){var n=rt({},t),r={};return t.items&&(r.items=t.items,delete n.items),rt({},it(at(e,n)),{method:"post",body:r.items?JSON.stringify(r):null})},ut=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rt({},it(at(e,t)),{method:"get"})},ct=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=rt({},it(at(e,n)),{method:"post",params:t});return Object.keys(t).length>0&&(r.body=JSON.stringify(t)),r},st={get:function(){return ut("setting")},update:function(e){return ct("setting",e)}},pt={list:function(e){return ut("redirect",e)},update:function(e,t){return ct("redirect/"+e,t)},create:function(e){return ct("redirect",e)}},ft={list:function(e){return ut("group",e)},update:function(e,t){return ct("group/"+e,t)},create:function(e){return ct("group",e)}},dt={list:function(e){return ut("log",e)},deleteAll:function(e){return lt("log",e)}},ht={list:function(e){return ut("404",e)},deleteAll:function(e){return lt("404",e)}},mt={get:function(){return ut("import")},upload:function(e,t){return function(e,t){var n=rt({},it(at(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 ut("import/plugin")},pluginImport:function(e){return ct("import/plugin/"+e)}},yt={file:function(e,t){return ut("export/"+e+"/"+t)}},bt={status:function(){return ut("plugin")},fix:function(){return ct("plugin")},delete:function(){return lt("plugin/delete")}},gt={redirect:function(e,t,n){return ct("bulk/redirect/"+e,t,n)},group:function(e,t,n){return ct("bulk/group/"+e,t,n)},log:function(e,t,n){return ct("bulk/log/"+e,t,n)},error:function(e,t,n){return ct("bulk/404/"+e,t,n)}},vt=function(e){return"https://api.redirect.li/v1/"+e+(-1===e.indexOf("?")?"?":"&")+"ref=redirection"},Et={getGeo:function(e){return{url:vt("ip/"+e+"?locale="+Redirectioni10n.localeSlug.substr(0,2)),method:"get"}}},wt={get:function(e){return{url:vt("useragent/"+encodeURIComponent(e)),method:"get"}}},Ot={get:function(e){return{url:vt("http?url="+encodeURIComponent(e)),method:"get"}}},_t=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}})};function St(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t4&&void 0!==arguments[4]?arguments[4]:{};return function(a,i){var l=i()[r.store],u=l.table,c=l.total,s={items:n?[n]:u.selected,bulk:t};if("delete"===t&&u.page>0&&u.per_page*u.page==c-1&&(u.page-=1),"delete"!==t||confirm(Object(P.translate)("Are you sure you want to delete this item?","Are you sure you want to delete these items?",{count:s.items.length}))){var p=Xe(u,s),f=kt({},{items:s.items.join(",")},o);return _t(e(t,f,Je(u,r.order))).then(function(e){a(kt({type:r.saved},e,{saving:s.items}))}).catch(function(e){a({type:r.failed,error:e,saving:s.items})}),a({type:r.saving,table:p,saving:s.items})}}},Pt=function(e,t,n,r,o){return _t(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]})},Tt=function(e,t,n){return function(r,o){var a=xt({},o()[n.store]);return a.page=0,a.orderby="id",a.direction="desc",Pt(e(t),a,t,n,r)}},Dt=function(e,t,n,r){return function(o,a){var i=a()[r.store].table;return Pt(e(t,n),i,n,r,o)}},Nt=function(e,t){for(var n in e)if(e[n]!==t[n])return!1;return!0},Rt=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,u=o.rows,c=a(Xe(l,r)),s=Je(kt({},l,r),n.order);if(!(Nt(c,l)&&u.length>0&&Nt(r,{})))return _t(e(s)).then(function(e){t(kt({type:n.saved},e))}).catch(function(e){t({type:n.failed,error:e})}),t(kt({table:c,type:n.saving},function(e,t){var n={};for(var r in t)void 0===e[r]&&(n[r]=t[r]);return n}(c,r)))},At=function(e,t,n,r,o){var a=o.table,i=Je(kt({},a,r),n.order);_t(e(i)).then(function(e){t(kt({type:n.saved},e))}).catch(function(e){t({type:n.failed,error:e})})},It=function(e,t,n){for(var r=e.slice(0),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ve:return Te({},e,{loadStatus:ke});case Ee:return Te({},e,{loadStatus:Ce,values:t.values,groups:t.groups,postTypes:t.postTypes,installed:t.installed,canDelete:t.canDelete});case we:return Te({},e,{loadStatus:je,error:t.error});case _e:return Te({},e,{saveStatus:ke});case Se:return Te({},e,{saveStatus:Ce,values:t.values,groups:t.groups,installed:t.installed});case xe:return Te({},e,{saveStatus:je,error:t.error});case Oe:return Te({},e,{pluginStatus:t.pluginStatus})}return e},log:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Le:return Wt({},e,{table:tt(e.table,e.rows,t.onoff)});case Ie:return Wt({},e,{table:et(e.table,t.items)});case Ue:return Wt({},e,{table:Ze(Mt(e,t)),saving:zt(e,t),rows:Lt(e,t)});case Fe:return Wt({},e,{rows:Ft(e,t),total:Bt(e,t),saving:Gt(e,t)});case Ne:return Wt({},e,{table:Mt(e,t),status:ke,saving:[],logType:t.logType,requestCount:e.requestCount+1});case Ae:return Wt({},e,{status:je,saving:[]});case Re:return Wt({},e,{rows:Ft(e,t),status:Ce,total:Bt(e,t),table:Ze(e.table)});case Me:return Wt({},e,{saving:Gt(e,t),rows:Ut(e,t)})}return e},error:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Yt:return Zt({},e,{table:tt(e.table,e.rows,t.onoff)});case Kt:return Zt({},e,{table:et(e.table,t.items)});case Qt:return Zt({},e,{table:Ze(Mt(e,t)),saving:zt(e,t),rows:Lt(e,t)});case Xt:return Zt({},e,{rows:Ft(e,t),total:Bt(e,t),saving:Gt(e,t)});case Ht:return Zt({},e,{table:Mt(e,t),status:ke,saving:[],requestCount:e.requestCount+1});case Vt:return Zt({},e,{status:je,saving:[]});case qt:return Zt({},e,{rows:Ft(e,t),status:Ce,total:Bt(e,t),table:Ze(e.table)});case Jt:return Zt({},e,{saving:Gt(e,t),rows:Ut(e,t)})}return e},io:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case nn:return sn({},e,{exportStatus:ke});case tn:return sn({},e,{exportStatus:Ce,exportData:t.data});case un:return sn({},e,{file:t.file});case ln:return sn({},e,{file:!1,lastImport:!1,exportData:!1});case an:return sn({},e,{importingStatus:je,exportStatus:je,lastImport:!1,file:!1,exportData:!1});case rn:return sn({},e,{importingStatus:ke,lastImport:!1,file:!!t.file&&t.file});case on:return sn({},e,{lastImport:t.total,importingStatus:Ce,file:!1});case cn:return sn({},e,{importers:t.importers})}return e},group:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case fn:return En({},e,{table:Mt(e,t),status:ke,saving:[]});case dn:return En({},e,{rows:Ft(e,t),status:Ce,total:Bt(e,t),table:Ze(e.table)});case bn:return En({},e,{table:Ze(Mt(e,t)),saving:zt(e,t),rows:Lt(e,t)});case vn:return En({},e,{rows:Ft(e,t),total:Bt(e,t),saving:Gt(e,t)});case yn:return En({},e,{table:tt(e.table,e.rows,t.onoff)});case mn:return En({},e,{table:et(e.table,t.items)});case hn:return En({},e,{status:je,saving:[]});case gn:return En({},e,{saving:Gt(e,t),rows:Ut(e,t)})}return e},redirect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Tn:return Dn({},e,{addTop:t.onoff});case On:return Dn({},e,{table:Mt(e,t),status:ke,saving:[]});case _n:return Dn({},e,{rows:Ft(e,t),status:Ce,total:Bt(e,t),table:Ze(e.table)});case jn:return Dn({},e,{table:Ze(Mt(e,t)),saving:zt(e,t),rows:Lt(e,t)});case Pn:return Dn({},e,{rows:Ft(e,t),total:Bt(e,t),saving:Gt(e,t)});case kn:return Dn({},e,{table:tt(e.table,e.rows,t.onoff)});case xn:return Dn({},e,{table:et(e.table,t.items)});case Sn:return Dn({},e,{status:je,saving:[]});case Cn:return Dn({},e,{saving:Gt(e,t),rows:Ut(e,t)})}return e},message:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case an:case hn:case Cn:case gn:case Ae:case Me:case we:case xe:case Jt:case Vt:case Sn:var n=Un(e.errors,t.error);return console.error(t.error.message),In({},e,{errors:n,inProgress:Mn(e)});case Ue:case jn:case _e:case Qt:case bn:return In({},e,{inProgress:e.inProgress+1});case Fe:case Pn:case Se:case vn:case Xt:return In({},e,{notices:Fn(e.notices,Bn[t.type]),inProgress:Mn(e)});case An:return In({},e,{notices:[]});case Rn:return In({},e,{errors:[]})}return e},info:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case zn:return Vn({},e,{status:ke,http:!1});case Gn:return Vn({},e,{status:Ce,maps:Yn(e.maps,t.map,"ip")});case Wn:return Vn({},e,{status:Ce,agents:Yn(e.agents,t.agent,"agent")});case $n:return Vn({},e,{status:je,error:t.error});case Hn:return Vn({},e,{status:Ce,http:t.http});case qn:return Vn({},e,{http:!1})}return e}}),Xn=Object(me.composeWithDevTools)({name:"Redirection"}),Jn=[ge,function(){return function(e){return function(t){switch(t.type){case jn:case bn:case On:case fn:case Ne:case Ht:!function(e,t){var n=He(),r={redirect:[[On,jn],"id"],groups:[[fn,bn],"name"],log:[[Ne],"date"],"404s":[[Ht],"date"]};if(r[n]&&e===r[n][0].find(function(t){return t===e})){var o=t.orderby,a=t.direction,i=t.page,l=t.per_page,u=t.filter,c=t.filterBy,s=t.groupBy,p={orderby:o,direction:a,offset:i,per_page:l,filter:u,filterBy:c,groupBy:s},f={orderby:r[n][1],direction:"desc",offset:0,filter:"",filterBy:"",per_page:parseInt(Redirectioni10n.per_page,10),groupBy:""};s&&(f.orderby="total"),We(p,f)}}(t.type,t.table?t.table:t)}return e(t)}}}];function Zn(){var e=Redirectioni10n&&Redirectioni10n.preload&&Redirectioni10n.preload.pluginStatus?Redirectioni10n.preload.pluginStatus:[];return{loadStatus:ke,saveStatus:!1,error:!1,installed:"",settings:{},postTypes:[],pluginStatus:e,canDelete:!1}}function er(){return{rows:[],saving:[],total:0,status:ke,table:Qe(["ip","url"],["ip"],[],"date",["log"]),requestCount:0}}function tr(){var e=$e(),t="date";return"404s"===e.sub&&e.groupby&&(t="total"),{rows:[],saving:[],total:0,status:ke,table:Qe(["ip","url","total"],["ip","url-exact"],["url","ip"],t,["404s"]),requestCount:0}}function nr(){return{rows:[],saving:[],total:0,status:ke,table:Qe(["name"],["name","module"],[],"name",["groups"])}}function rr(){return{rows:[],saving:[],total:0,addTop:!1,status:ke,table:Qe(["url","position","last_count","id","last_access"],["group"],[],"id",[""])}}function or(){return{settings:Zn(),log:er(),error:tr(),io:{status:ke,file:!1,lastImport:!1,exportData:!1,importingStatus:!1,exportStatus:!1,importers:[]},group:nr(),redirect:rr(),message:{errors:[],notices:[],inProgress:0,saving:[]},info:{status:Ce,maps:{},agents:{},http:!1,error:""}}}var ar=function(){return function(e,t){return t().settings.loadStatus===Ce?null:(_t(st.get()).then(function(t){e({type:Ee,values:t.settings,groups:t.groups,postTypes:t.post_types,installed:t.installed,canDelete:t.canDelete})}).catch(function(t){e({type:we,error:t})}),e({type:ve}))}},ir=function(e){return function(t){return _t(st.update(e)).then(function(e){t({type:Se,values:e.settings,groups:e.groups,installed:e.installed})}).catch(function(e){t({type:xe,error:e})}),t({type:_e})}},lr=function(){return function(e){return _t(bt.delete()).then(function(e){document.location.href=e.location}).catch(function(t){e({type:xe,error:t})}),e({type:_e})}},ur=function(){return function(e){return _t(bt.status()).then(function(t){e({type:Oe,pluginStatus:t})}).catch(function(t){e({type:we,error:t})}),e({type:ve})}},cr=function(){return function(e){return _t(bt.fix()).then(function(t){e({type:Oe,pluginStatus:t})}).catch(function(t){e({type:we,error:t})}),e({type:ve})}},sr=function(e){var t=e.title,n=e.url,r=void 0!==n&&n;return x.a.createElement("tr",null,x.a.createElement("th",null,!r&&t,r&&x.a.createElement("a",{href:r,target:"_blank"},t)),x.a.createElement("td",null,e.children))},pr=function(e){return x.a.createElement("table",{className:"form-table"},x.a.createElement("tbody",null,e.children))};function fr(e){return(fr="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})(e)}var dr=function e(t){var n=t.value,r=t.text;return"object"===fr(n)?x.a.createElement("optgroup",{label:r},n.map(function(t,n){return x.a.createElement(e,{text:t.text,value:t.value,key:n})})):x.a.createElement("option",{value:n},r)},hr=function(e){var t=e.items,n=e.value,r=e.name,o=e.onChange,a=e.isEnabled,i=void 0===a||a;return x.a.createElement("select",{name:r,value:n,onChange:o,disabled:!i},t.map(function(e,t){return x.a.createElement(dr,{value:e.value,text:e.text,key:t})}))};function mr(e){return(mr="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})(e)}function yr(e,t){for(var n=0;n0?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");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gr(e,t)}(t,x.a.Component),function(e,t,n){t&&yr(e.prototype,t),n&&yr(e,n)}(t,[{key:"getSnapshotBeforeUpdate",value:function(e){return e.values.token!==this.props.values.token&&this.setState({token:this.props.values.token}),e.values.auto_target!==this.props.values.auto_target&&this.setState({auto_target:this.props.values.auto_target}),null}},{key:"renderMonitor",value:function(e){return x.a.createElement(sr,{title:Object(P.translate)("URL Monitor Changes")+":",url:this.supportLink("options","monitor")},x.a.createElement(hr,{items:e,name:"monitor_post",value:parseInt(this.state.monitor_post,10),onChange:this.onChange})," ",Object(P.translate)("Save changes to this group"),x.a.createElement("p",null,x.a.createElement("input",{type:"text",className:"regular-text",name:"associated_redirect",onChange:this.onChange,placeholder:Object(P.translate)('For example "/amp"'),value:this.state.associated_redirect})," ",Object(P.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],i=!!n.find(function(e){return e===o});r.push(x.a.createElement("p",{key:o},x.a.createElement("label",null,x.a.createElement("input",{type:"checkbox",name:"monitor_type_"+o,onChange:e.onMonitor,checked:i}),Object(P.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 x.a.createElement("form",{onSubmit:this.onSubmit},x.a.createElement(pr,null,x.a.createElement(sr,{title:""},x.a.createElement("label",null,x.a.createElement("input",{type:"checkbox",checked:this.state.support,name:"support",onChange:this.onChange}),x.a.createElement("span",{className:"sub"},Object(P.translate)("I'm a nice person and I have helped support the author of this plugin")))),x.a.createElement(sr,{title:Object(P.translate)("Redirect Logs")+":",url:this.supportLink("logs")},x.a.createElement(hr,{items:wr(),name:"expire_redirect",value:parseInt(this.state.expire_redirect,10),onChange:this.onChange})," ",Object(P.translate)("(time to keep logs for)")),x.a.createElement(sr,{title:Object(P.translate)("404 Logs")+":",url:this.supportLink("tracking-404-errors")},x.a.createElement(hr,{items:wr(),name:"expire_404",value:parseInt(this.state.expire_404,10),onChange:this.onChange})," ",Object(P.translate)("(time to keep logs for)")),x.a.createElement(sr,{title:Object(P.translate)("IP Logging")+":",url:this.supportLink("options","iplogging")},x.a.createElement(hr,{items:[{value:0,text:Object(P.translate)("No IP logging")},{value:1,text:Object(P.translate)("Full IP logging")},{value:2,text:Object(P.translate)("Anonymize IP (mask last part)")}],name:"ip_logging",value:parseInt(this.state.ip_logging,10),onChange:this.onChange})," ",Object(P.translate)("(select IP logging level)")," - ",x.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:this.supportLink("privacy-gdpr")},Object(P.translate)("GDPR / Privacy information"))),x.a.createElement(sr,{title:Object(P.translate)("URL Monitor")+":",url:this.supportLink("options","monitor")},this.renderPostTypes()),o&&this.renderMonitor(t),x.a.createElement(sr,{title:Object(P.translate)("RSS Token")+":",url:this.supportLink("options","rsstoken")},x.a.createElement("input",{className:"regular-text",type:"text",value:this.state.token,name:"token",onChange:this.onChange}),x.a.createElement("br",null),x.a.createElement("span",{className:"sub"},Object(P.translate)("A unique token allowing feed readers access to Redirection log RSS (leave blank to auto-generate)"))),x.a.createElement(sr,{title:Object(P.translate)("Auto-generate URL")+":",url:this.supportLink("options","autogenerate")},x.a.createElement("input",{className:"regular-text",type:"text",value:this.state.auto_target,name:"auto_target",onChange:this.onChange}),x.a.createElement("br",null),x.a.createElement("span",{className:"sub"},Object(P.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:x.a.createElement("code",null)}}))),x.a.createElement(sr,{title:Object(P.translate)("Apache Module"),url:this.supportLink("options","apache")},x.a.createElement("label",null,x.a.createElement("p",null,x.a.createElement("input",{type:"text",className:"regular-text",name:"location",value:this.state.location,onChange:this.onChange,placeholder:r})),x.a.createElement("p",{className:"sub"},Object(P.translate)("Enter the full path and filename if you want Redirection to automatically update your {{code}}.htaccess{{/code}}.",{components:{code:x.a.createElement("code",null)}})))),x.a.createElement(sr,{title:Object(P.translate)("Force HTTPS"),url:this.supportLink("options","force-https")},x.a.createElement("label",null,x.a.createElement("p",null,x.a.createElement("input",{type:"checkbox",name:"https",onChange:this.onChange,checked:this.state.https}),Object(P.translate)("Force a redirect from HTTP to HTTPS. Please ensure your HTTPS is working before enabling"),"  ",Object(P.translate)("(beta)")))),x.a.createElement(sr,{title:Object(P.translate)("Redirect Cache"),url:this.supportLink("options","cache")},x.a.createElement(hr,{items:[{value:-1,text:Object(P.translate)("Never cache")},{value:1,text:Object(P.translate)("An hour")},{value:24,text:Object(P.translate)("A day")},{value:168,text:Object(P.translate)("A week")},{value:0,text:Object(P.translate)("Forever")}],name:"redirect_cache",value:parseInt(this.state.redirect_cache,10),onChange:this.onChange}),"  ",x.a.createElement("span",{className:"sub"},Object(P.translate)('How long to cache redirected 301 URLs (via "Expires" HTTP header)'))),x.a.createElement(sr,{title:Object(P.translate)("REST API"),url:this.supportLink("options","restapi")},x.a.createElement(hr,{items:Or(),name:"rest_api",value:parseInt(this.state.rest_api,10),onChange:this.onChange}),"  ",x.a.createElement("span",{className:"sub"},Object(P.translate)("How Redirection uses the REST API - don't change unless necessary")))),x.a.createElement("input",{className:"button-primary",type:"submit",name:"update",value:Object(P.translate)("Update"),disabled:n===ke}))}}]),t}();var Sr=he(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(ir(t))}}})(_r),xr=n(3),kr=n.n(xr);n(45);function jr(e){return(jr="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})(e)}function Cr(e,t){for(var n=0;n=t[n][0])return t[n][1];return t[t.length-1][1]}},{key:"renderSupported",value:function(){return x.a.createElement("div",null,Object(P.translate)("You've supported this plugin - thank you!"),"  ",x.a.createElement("a",{href:"#",onClick:this.onDonate},Object(P.translate)("I'd like to support some more.")))}},{key:"renderUnsupported",value:function(){for(var e=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},16,""),t=20;t<=100;t+=20)e[t]="";return x.a.createElement("div",null,x.a.createElement("label",null,x.a.createElement("p",null,Object(P.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:x.a.createElement("strong",null)}})," ",Object(P.translate)("You get useful software and I get to carry on making it better."))),x.a.createElement("input",{type:"hidden",name:"cmd",value:"_xclick"}),x.a.createElement("input",{type:"hidden",name:"business",value:"admin@urbangiraffe.com"}),x.a.createElement("input",{type:"hidden",name:"item_name",value:"Redirection (WordPress Plugin)"}),x.a.createElement("input",{type:"hidden",name:"buyer_credit_promo_code",value:""}),x.a.createElement("input",{type:"hidden",name:"buyer_credit_product_category",value:""}),x.a.createElement("input",{type:"hidden",name:"buyer_credit_shipping_method",value:""}),x.a.createElement("input",{type:"hidden",name:"buyer_credit_user_address_change",value:""}),x.a.createElement("input",{type:"hidden",name:"no_shipping",value:"1"}),x.a.createElement("input",{type:"hidden",name:"return",value:this.getReturnUrl()}),x.a.createElement("input",{type:"hidden",name:"no_note",value:"1"}),x.a.createElement("input",{type:"hidden",name:"currency_code",value:"USD"}),x.a.createElement("input",{type:"hidden",name:"tax",value:"0"}),x.a.createElement("input",{type:"hidden",name:"lc",value:"US"}),x.a.createElement("input",{type:"hidden",name:"bn",value:"PP-DonationsBF"}),x.a.createElement("div",{className:"donation-amount"},"$",x.a.createElement("input",{type:"number",name:"amount",min:16,value:this.state.amount,onChange:this.onInput,onBlur:this.onBlur}),x.a.createElement("span",null,this.getAmountoji(this.state.amount)),x.a.createElement("input",{type:"submit",className:"button-primary",value:Object(P.translate)("Support 💰")})))}},{key:"render",value:function(){var e=this.state.support;return x.a.createElement("form",{action:"https://www.paypal.com/cgi-bin/webscr",method:"post",className:"donation"},x.a.createElement(pr,null,x.a.createElement(sr,{title:Object(P.translate)("Plugin Support")+":"},e?this.renderSupported():this.renderUnsupported())))}}]),t}();function Kr(e){return(Kr="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})(e)}function Yr(e,t){for(var n=0;n0&&x.a.createElement(Oo,null))},xo=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=vo(this,Eo(t).call(this,e))).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");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wo(e,t)}(t,x.a.Component),function(e,t,n){t&&go(e.prototype,t),n&&go(e,n)}(t,[{key:"render",value:function(){var e=this.props.pluginStatus;return x.a.createElement("div",null,x.a.createElement("h2",null,Object(P.translate)("Plugin Status")),e.length>0&&x.a.createElement(So,{status:e}),0===e.length&&x.a.createElement("div",{className:"placeholder-inline"},x.a.createElement("div",{className:"placeholder-loading"})))}}]),t}();var ko=he(function(e){return{pluginStatus:e.settings.pluginStatus}},function(e){return{onLoadStatus:function(){e(ur())},onFix:function(){e(cr())}}})(xo);function jo(e){return(jo="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})(e)}function Co(e,t){for(var n=0;n0&&(p=x.a.createElement(Fo,{rows:r,status:i,selected:a.selected,row:n})),x.a.createElement("table",{className:"wp-list-table widefat fixed striped items"},x.a.createElement("thead",null,x.a.createElement(Uo,{table:a,isDisabled:c,isSelected:s,headers:t,rows:r,total:o,onSetOrderBy:u,onSetAllSelected:l})),p,x.a.createElement("tfoot",null,x.a.createElement(Uo,{table:a,isDisabled:c,isSelected:s,headers:t,rows:r,total:o,onSetOrderBy:u,onSetAllSelected:l})))});function $o(e){return($o="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})(e)}function Ho(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qo(e,t){for(var n=0;n0,onClick:this.onFirst})," ",x.a.createElement(Zo,{title:Object(P.translate)("Prev page"),button:"‹",className:"prev-page",enabled:e>0,onClick:this.onPrev}),x.a.createElement("span",{className:"paging-input"},x.a.createElement("label",{htmlFor:"current-page-selector",className:"screen-reader-text"},Object(P.translate)("Current Page"))," ",x.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}),x.a.createElement("span",{className:"tablenav-paging-text"},Object(P.translate)("of %(page)s",{components:{total:x.a.createElement("span",{className:"total-pages"})},args:{page:Object(P.numberFormat)(t)}})))," ",x.a.createElement(Zo,{title:Object(P.translate)("Next page"),button:"›",className:"next-page",enabled:e0&&x.a.createElement(ta,{per_page:n.per_page,page:n.page,total:t,onChangePage:this.props.onChangePage,inProgress:o===ke}))}}]),t}();function ua(e){return(ua="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})(e)}function ca(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Ca(e)},Ta=function(e,t){return Ca({orderby:e,direction:t})},Da=function(e){return Ca({page:e})},Na=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Ca({filter:e,filterBy:""===e?"":t,page:0,orderby:""})},Ra=function(e,t){return Ca({filterBy:e,filter:t,orderby:"",page:0})},Aa=function(e){return{type:Ie,items:e.map(parseInt)}},Ia=function(e){return{type:Le,onoff:e}},La=function(e){return Ca(e)},Ua=(n(63),function(){return x.a.createElement("div",{className:"redirection-poweredby"},Object(P.translate)("Powered by {{link}}redirect.li{{/link}}",{components:{link:x.a.createElement("a",{href:"https://redirect.li",target:"_blank",rel:"noopener noreferrer"})}}))});n(65);function Fa(e){return(Fa="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})(e)}function Ma(e,t){for(var n=0;n0},x.a.createElement(Ea,{logType:"log"}),x.a.createElement("button",{className:"button-secondary",onClick:this.handleRSS},"RSS"),x.a.createElement(va,{onDelete:this.props.onDeleteAll,table:r}))))}}]),t}();var hi=he(function(e){return{log:e.log}},function(e){return{onLoad:function(t){e(Pa(t))},onDeleteAll:function(t,n){e(ka(t,n))},onSearch:function(t,n){e(Na(t,n))},onChangePage:function(t){e(Da(t))},onTableAction:function(t){e(ja(t))},onSetAllSelected:function(t){e(Ia(t))},onSetOrderBy:function(t,n){e(Ta(t,n))}}})(di);function mi(e){return(mi="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})(e)}function yi(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Ci(e)},Ti=function(e,t){return Ci({orderby:e,direction:t})},Di=function(e){return Ci({page:e})},Ni=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Ci({filter:e,filterBy:""===e?"":t,page:0,orderby:""})},Ri=function(e,t){return Ci({filter:e,filterBy:t,page:0,orderby:"",groupBy:""})},Ai=function(e,t){return Ci({filterBy:e,filter:t,orderby:"",page:0})},Ii=function(e){return{type:Kt,items:e}},Li=function(e){return{type:Yt,onoff:e}},Ui=function(e){return Ci({groupBy:e,page:0,orderby:"total",direction:"desc",filterBy:"",filter:""})},Fi=function(e){return Ci(e)},Mi=function(e){var t=e.url;if(t){var n=wa.parse(t).hostname;return x.a.createElement("a",{href:t,rel:"noreferrer noopener",target:"_blank"},n)}return null};function Bi(e){return(Bi="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})(e)}function zi(e,t){for(var n=0;n0?u:p[0].id,action_code:n.getCode()?parseInt(c,10):0,action_data:_u(n.state)};f.id?n.props.onSave(f.id,f):n.props.onCreate(f),n.props.onCancel?n.props.onCancel(e):n.reset(),n.props.childSave&&n.props.childSave()}),Du(Tu(Tu(n)),"onAdvanced",function(e){e.preventDefault(),n.setState({advanced:!n.state.advanced},n.triggerCallback)}),Du(Tu(Tu(n)),"onGroup",function(e){n.setState({group_id:parseInt(e.target.value,10)})}),Du(Tu(Tu(n)),"onChange",function(e){var t=e.target,r="checkbox"===t.type?t.checked:t.value,o=Du({},t.name,r);"action_type"===t.name?t.value===yu?o.action_code=301:t.value===bu&&(o.action_code=404):"match_type"===t.name&&(o=ku({},o,n.resetActionData()),t.value===Eu&&(o.action_type=yu)),n.setState(o,n.triggerCallback)}),Du(Tu(Tu(n)),"triggerCallback",function(){n.props.callback&&n.props.callback(n.ref.current.clientHeight)});var r=e.item,o=r.url,a=r.regex,i=r.match_type,l=r.action_type,u=r.action_data,c=r.group_id,s=void 0===c?0:c,p=r.title,f=r.action_code,d=r.position,h=void 0===d?0:d,m=u||{},y=m.logged_in,b=void 0===y?"":y,g=m.logged_out,v=void 0===g?"":g;return n.state={url:o,title:p,regex:a,match_type:i,action_type:l,action_code:f,action_data:u,group_id:n.getValidGroup(s),position:h,login:{logged_in:b,logged_out:v},target:u||{},agent:n.getAgentState(u),referrer:n.getReferrerState(u),cookie:n.getHeaderState(u),header:n.getHeaderState(u),custom:n.getCustomState(u),role:n.getRoleState(u),server:n.getServerState(u),ip:n.getIpState(u),page:n.getPageState(u)},n.state.advanced=!n.canShowAdvanced(),n.ref=x.a.createRef(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pu(e,t)}(t,x.a.Component),function(e,t,n){t&&ju(e.prototype,t),n&&ju(e,n)}(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(ku({url:"",regex:!1,match_type:vu,action_type:yu,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:""},ip:{ip:[],url_from:"",url_notfrom:""},page:{page:"404",url:""}}}},{key:"canShowAdvanced",value:function(){var e=this.state,t=e.match_type,n=e.action_type;return t===vu&&n===yu}},{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,u=t.url_notfrom;return{agent:r,regex:a,url_from:l,url_notfrom:void 0===u?"":u}}},{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,u=t.url_notfrom;return{referrer:r,regex:a,url_from:l,url_notfrom:void 0===u?"":u}}},{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:"getIpState",value:function(e){var t=e||{},n=t.ip,r=void 0===n?[]:n,o=t.url_from,a=void 0===o?"":o,i=t.url_notfrom;return{ip:r,url_from:a,url_notfrom:void 0===i?"":i}}},{key:"getPageState",value:function(e){var t=e||{},n=t.page,r=void 0===n?"404":n,o=t.url;return{page:r,url:void 0===o?"":o}}},{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,u=t.url_from,c=void 0===u?"":u,s=t.url_notfrom;return{name:r,value:a,regex:l,url_from:c,url_notfrom:void 0===s?"":s}}},{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 this.state.action_type===bu?x.a.createElement("select",{name:"action_code",value:this.state.action_code,onChange:this.onChange},[{value:400,name:Object(P.translate)("400 - Bad Request")},{value:401,name:Object(P.translate)("401 - Unauthorized")},{value:403,name:Object(P.translate)("403 - Forbidden")},{value:404,name:Object(P.translate)("404 - Not Found")},{value:410,name:Object(P.translate)("410 - Gone")},{value:418,name:Object(P.translate)("418 - I'm a teapot")}].map(function(e){return x.a.createElement("option",{key:e.value,value:e.value},e.name)})):this.state.action_type===yu||"random"===this.state.action_type?x.a.createElement("select",{name:"action_code",value:this.state.action_code,onChange:this.onChange},[{value:301,name:Object(P.translate)("301 - Moved Permanently")},{value:302,name:Object(P.translate)("302 - Found")},{value:303,name:Object(P.translate)("303 - See Other")},{value:304,name:Object(P.translate)("304 - Not Modified")},{value:307,name:Object(P.translate)("307 - Temporary Redirect")},{value:308,name:Object(P.translate)("308 - Permanent Redirect")}].map(function(e){return x.a.createElement("option",{key:e.value,value:e.value},e.name)})):null}},{key:"getMatchExtra",value:function(){var e=this.state,t=e.match_type,n=e.agent,r=e.referrer,o=e.cookie,a=e.header,i=e.custom,l=e.role,u=e.server,c=e.ip,s=e.page;switch(t){case"agent":return x.a.createElement(Hi,{agent:n.agent,regex:n.regex,onChange:this.onSetData,onCustomAgent:this.onCustomAgent});case"referrer":return x.a.createElement(Xi,{referrer:r.referrer,regex:r.regex,onChange:this.onSetData});case"cookie":return x.a.createElement(bl,{name:o.name,value:o.value,regex:o.regex,onChange:this.onSetData});case"header":return x.a.createElement(ol,{name:a.name,value:a.value,regex:a.regex,onChange:this.onSetData});case"custom":return x.a.createElement(sl,{filter:i.filter,onChange:this.onSetData});case"role":return x.a.createElement(_l,{role:l.role,onChange:this.onSetData});case"server":return x.a.createElement(Pl,{server:u.server,onChange:this.onSetData});case wu:return x.a.createElement(Il,{ip:c.ip,onChange:this.onSetData});case"page":return x.a.createElement(zl,{page:s.page,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,i=e.cookie,l=e.target,u=e.header,c=e.custom,s=e.role,p=e.server,f=e.ip,d=e.page;if(!Ou(n))return null;switch(t){case"agent":return x.a.createElement(eu,{url_from:r.url_from,url_notfrom:r.url_notfrom,target:"agent",onChange:this.onSetData});case"referrer":return x.a.createElement(eu,{url_from:o.url_from,url_notfrom:o.url_notfrom,target:"referrer",onChange:this.onSetData});case Eu:return x.a.createElement(Vl,{logged_in:a.logged_in,logged_out:a.logged_out,onChange:this.onSetData});case vu:return x.a.createElement(Kl,{url:l.url,target:"target",onChange:this.onSetData});case"cookie":return x.a.createElement(eu,{url_from:i.url_from,url_notfrom:i.url_notfrom,target:"cookie",onChange:this.onSetData});case"header":return x.a.createElement(eu,{url_from:u.url_from,url_notfrom:u.url_notfrom,target:"header",onChange:this.onSetData});case"custom":return x.a.createElement(eu,{url_from:c.url_from,url_notfrom:c.url_notfrom,target:"custom",onChange:this.onSetData});case"role":return x.a.createElement(eu,{url_from:s.url_from,url_notfrom:s.url_notfrom,target:"role",onChange:this.onSetData});case"server":return x.a.createElement(eu,{url_from:p.url_from,url_notfrom:p.url_notfrom,target:"server",onChange:this.onSetData});case wu:return x.a.createElement(eu,{url_from:f.url_from,url_notfrom:f.url_notfrom,target:"ip",onChange:this.onSetData});case"page":return x.a.createElement(Kl,{url:d.url,target:"page",onChange:this.onSetData})}return null}},{key:"getTitle",value:function(){var e=this.state.title;return x.a.createElement("tr",null,x.a.createElement("th",null,Object(P.translate)("Title")),x.a.createElement("td",null,x.a.createElement("input",{type:"text",name:"title",value:e,onChange:this.onChange,placeholder:Object(P.translate)("Describe the purpose of this redirect (optional)")})))}},{key:"getMatch",value:function(){var e=this.state.match_type;return x.a.createElement("tr",null,x.a.createElement("th",null,Object(P.translate)("Match")),x.a.createElement("td",null,x.a.createElement("select",{name:"match_type",value:e,onChange:this.onChange},[{value:vu,name:Object(P.translate)("URL only")},{value:Eu,name:Object(P.translate)("URL and login status")},{value:"role",name:Object(P.translate)("URL and role/capability")},{value:"referrer",name:Object(P.translate)("URL and referrer")},{value:"agent",name:Object(P.translate)("URL and user agent")},{value:"cookie",name:Object(P.translate)("URL and cookie")},{value:wu,name:Object(P.translate)("URL and IP")},{value:"server",name:Object(P.translate)("URL and server")},{value:"header",name:Object(P.translate)("URL and HTTP header")},{value:"custom",name:Object(P.translate)("URL and custom filter")},{value:"page",name:Object(P.translate)("URL and WordPress page type")}].map(function(e){return x.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 x.a.createElement("tr",null,x.a.createElement("th",null,Object(P.translate)("When matched")),x.a.createElement("td",{className:"edit-left"},x.a.createElement("select",{name:"action_type",value:t,onChange:this.onChange},[{value:yu,name:Object(P.translate)("Redirect to URL")},{value:"random",name:Object(P.translate)("Redirect to random post")},{value:"pass",name:Object(P.translate)("Pass-through")},{value:bu,name:Object(P.translate)("Error (404)")},{value:gu,name:Object(P.translate)("Do nothing (ignore)")}].filter(function(e){return!(n===Eu&&!Ou(e.value))}).map(function(e){return x.a.createElement("option",{value:e.value,key:e.value},e.name)})),r&&x.a.createElement(x.a.Fragment,null,x.a.createElement("strong",{className:"small-flex"},Object(P.translate)("with HTTP code"))," ",x.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 x.a.createElement("tr",null,x.a.createElement("th",null,Object(P.translate)("Group")),x.a.createElement("td",{className:"edit-left"},x.a.createElement(hr,{name:"group",value:t,items:tu(e),onChange:this.onGroup}),r&&x.a.createElement("span",{className:"edit-redirection-position"},x.a.createElement("strong",null,Object(P.translate)("Position")),x.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,u=e.header,c=e.cookie,s=e.role,p=e.server,f=e.ip,d=e.page;if(""===Redirectioni10n.autoGenerate&&""===t)return!1;if(Ou(o)){if(n===vu&&""===r)return!1;if("referrer"===n&&""===a.url_from&&""===a.url_notfrom)return!1;if(n===Eu&&""===i.logged_in&&""===i.logged_out)return!1;if("agent"===n&&""===l.url_from&&""===l.url_notfrom)return!1;if("cookie"===n&&""===c.url_from&&""===c.url_notfrom)return!1;if("header"===n&&""===u.url_from&&""===u.url_notfrom)return!1;if("role"===n&&""===s.url_from&&""===s.url_notfrom)return!1;if("server"===n&&""===p.url_from&&""===p.url_notfrom)return!1;if(n===wu&&""===f.url_from&&""===f.url_notfrom)return!1;if("page"===n&&""===d.url)return!1}return!0}},{key:"renderExtra",value:function(){return x.a.createElement(x.a.Fragment,null,this.getTitle(),this.getMatch(),this.getMatchExtra(),this.getTargetCode())}},{key:"renderSingleUrl",value:function(){var e=this.state,t=e.url,n=e.regex,r=this.props.autoFocus,o=void 0!==r&&r;return x.a.createElement(x.a.Fragment,null,x.a.createElement("input",{type:"text",name:"url",value:t,onChange:this.onChange,autoFocus:o,placeholder:Object(P.translate)("The relative URL you want to redirect from")}),x.a.createElement("label",{className:"edit-redirection-regex"},Object(P.translate)("Regex")," ",x.a.createElement("sup",null,x.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",x.a.createElement("input",{type:"checkbox",name:"regex",checked:n,onChange:this.onChange})))}},{key:"renderMultiUrl",value:function(){var e=this.state.url;return x.a.createElement("textarea",{value:e.join("\n"),readOnly:!0})}},{key:"render",value:function(){var e=this.state,t=e.url,n=e.advanced,r=this.props,o=r.saveButton,a=void 0===o?Object(P.translate)("Save"):o,i=r.onCancel,l=r.addTop,u=r.onClose;return x.a.createElement("form",{onSubmit:this.onSave,ref:this.ref},x.a.createElement("table",{className:"edit edit-redirection"},x.a.createElement("tbody",null,x.a.createElement("tr",null,x.a.createElement("th",{className:Array.isArray(t)?"top":""},Object(P.translate)("Source URL")),x.a.createElement("td",null,Array.isArray(t)?this.renderMultiUrl():this.renderSingleUrl())),n&&this.renderExtra(),this.getTarget(),this.getGroup(),this.props.children&&this.props.children,x.a.createElement("tr",null,x.a.createElement("th",null),x.a.createElement("td",{className:"edit-left"},x.a.createElement("div",{className:"table-actions"},x.a.createElement("input",{className:"button-primary",type:"submit",name:"save",value:a,disabled:!this.canSave()}),"  ",i&&x.a.createElement("input",{className:"button-secondary",type:"submit",name:"cancel",value:Object(P.translate)("Cancel"),onClick:i}),l&&!i&&x.a.createElement("input",{className:"button-secondary",type:"submit",name:"cancel",value:Object(P.translate)("Close"),onClick:u})," ",this.canShowAdvanced()&&x.a.createElement("a",{href:"#",onClick:this.onAdvanced,className:"advanced",title:Object(P.translate)("Show advanced options")},"⚙")))))))}}]),t}();var Ru=he(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(au(t,n))},onCreate:function(t){e(ou(t))},onClose:function(t){t.preventDefault(),e(hu(!1))}}})(Nu);function Au(e){return(Au="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})(e)}function Iu(e,t){for(var n=0;n1&&(o.url=n),x.a.createElement(Ar,{onClose:t,width:"700",height:this.state.height},x.a.createElement("div",{className:"add-new"},x.a.createElement(Ru,{item:o,saveButton:Object(P.translate)("Add Redirect"),onCancel:t,childSave:this.onDelete,autoFocus:!0,callback:this.setHeight},x.a.createElement("tr",null,x.a.createElement("th",null,Object(P.translate)("Delete Log Entries")),x.a.createElement("td",{className:"edit-left",style:{padding:"7px 0px"}},x.a.createElement("label",null,x.a.createElement("input",{type:"checkbox",name:"delete_log",checked:this.state.deleteLog,onChange:this.onDeleteLog}),1===n.length?Object(P.translate)("Delete all logs for this entry"):Object(P.translate)("Delete all logs for these entries")))))))}}]),t}();var pc=he(function(e){return{selected:e.error.table.selected}},function(e){return{onDelete:function(t){e(xi(t))}}})(sc),fc={store:"group",saving:bn,saved:vn,failed:gn,order:"name"},dc={store:"group",saving:fn,saved:dn,failed:hn,order:"name"},hc=function(e){return Tt(ft.create,e,fc)},mc=function(e,t){return Dt(ft.update,e,t,fc)},yc=function(e,t){return Ct(gt.group,e,t,fc)},bc=function(e){return function(t,n){return Rt(ft.list,t,dc,e,n().group)}},gc=function(e,t){return bc({orderby:e,direction:t})},vc=function(e){return bc({page:e})},Ec=function(e){return bc({filter:e,filterBy:"",page:0,orderby:""})},wc=function(e,t){return bc({filterBy:e,filter:t,orderby:"",page:0})},Oc=function(e){return{type:mn,items:e.map(parseInt)}},_c=function(e){return{type:yn,onoff:e}},Sc=function(e){return bc(e)};function xc(e){return(xc="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})(e)}function kc(e,t){for(var n=0;n0},x.a.createElement(Ea,{logType:"404"}),x.a.createElement(va,{onDelete:this.props.onDeleteAll,table:r}))))}}]),t}();var Nc=he(function(e){return{error:e.error}},function(e){return{onLoad:function(){e(Pi())},onLoadGroups:function(){e(bc())},onDeleteAll:function(t,n){e(ki(t,n))},onSearch:function(t,n){e(Ni(t,n))},onChangePage:function(t){e(Di(t))},onTableAction:function(t){e(ji(t,null))},onSetAllSelected:function(t){e(Li(t))},onSetOrderBy:function(t,n){e(Ti(t,n))},onGroup:function(t){e(Ui(t))},onSetSelected:function(t){e(Ii(t))}}})(Dc),Rc=n(22),Ac=n.n(Rc),Ic=("function"==typeof Symbol&&Symbol.iterator,"undefined"==typeof document||!document||!document.createElement||"multiple"in document.createElement("input"));function Lc(e,t){return"application/x-moz-file"===e.type||Ac()(e,t)}function Uc(e){return!e.dataTransfer||Array.prototype.every.call(e.dataTransfer.types,function(e){return"Files"===e||"application/x-moz-file"===e})}function Fc(e){e.preventDefault()}var Mc={borderStyle:"solid",backgroundColor:"#eee"},Bc={borderStyle:"solid",borderColor:"#6c6",backgroundColor:"#eee"},zc={borderStyle:"solid",borderColor:"#c66",backgroundColor:"#eee"},Gc={width:200,height:200,borderWidth:2,borderColor:"#666",borderStyle:"dashed",borderRadius:5},Wc={opacity:.5},$c=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var Vc=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($c({},r.state,{isDragActive:t,isDragAccept:n,isDragReject:o,open:r.open})):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.open=r.open.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,x.a.Component),Hc(t,[{key:"componentDidMount",value:function(){var e=this.props.preventDropOnDocument;this.dragTargets=[],e&&(document.addEventListener("dragover",Fc,!1),document.addEventListener("drop",this.onDocumentDrop,!1)),null!=this.fileInputEl&&this.fileInputEl.addEventListener("click",this.onInputElementClick,!1),window.addEventListener("focus",this.onFileDialogCancel,!1)}},{key:"componentWillUnmount",value:function(){this.props.preventDropOnDocument&&(document.removeEventListener("dragover",Fc),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){e.persist(),this.props.onDragStart&&Uc(e)&&this.props.onDragStart.call(this,e)}},{key:"onDragEnter",value:function(e){var t=this;e.preventDefault(),-1===this.dragTargets.indexOf(e.target)&&this.dragTargets.push(e.target),e.persist(),Uc(e)&&(Promise.resolve(this.props.getDataTransferItems(e)).then(function(n){e.isPropagationStopped()||t.setState({draggedFiles:n,isDragActive:!0})}),this.props.onDragEnter&&this.props.onDragEnter.call(this,e))}},{key:"onDragOver",value:function(e){e.preventDefault(),e.persist();try{e.dataTransfer.dropEffect=this.isFileDialogActive?"none":"copy"}catch(e){}return this.props.onDragOver&&Uc(e)&&this.props.onDragOver.call(this,e),!1}},{key:"onDragLeave",value:function(e){var t=this;e.preventDefault(),e.persist(),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&&Uc(e)&&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.accept,u=n.getDataTransferItems;e.preventDefault(),e.persist(),this.dragTargets=[],this.isFileDialogActive=!1,this.draggedFiles=null,this.setState({isDragActive:!1,draggedFiles:[]}),Uc(e)&&Promise.resolve(u(e)).then(function(n){var u=[],c=[];e.isPropagationStopped()||(n.forEach(function(e){Lc(e,l)&&function(e,t,n){return e.size<=t&&e.size>=n}(e,t.props.maxSize,t.props.minSize)?u.push(e):c.push(e)}),!i&&u.length>1&&c.push.apply(c,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&a&&a.call(t,c,e),u.length>0&&o&&o.call(t,u,e)}))})}},{key:"onClick",value:function(e){var t=this.props,n=t.onClick,r=t.disableClick;n&&n.call(this,e),r||e.isDefaultPrevented()||(e.stopPropagation(),!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,0))}},{key:"onInputElementClick",value:function(e){e.stopPropagation(),this.props.inputProps&&this.props.inputProps.onClick&&this.props.inputProps.onClick(e)}},{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,i=e.disabledClassName,l=e.inputProps,u=e.multiple,c=e.name,s=e.rejectClassName,p=qc(e,["accept","acceptClassName","activeClassName","children","disabled","disabledClassName","inputProps","multiple","name","rejectClassName"]),f=p.acceptStyle,d=p.activeStyle,h=p.className,m=void 0===h?"":h,y=p.disabledStyle,b=p.rejectStyle,g=p.style,v=qc(p,["acceptStyle","activeStyle","className","disabledStyle","rejectStyle","style"]),E=this.state,w=E.isDragActive,O=E.draggedFiles,_=O.length,S=u||_<=1,k=_>0&&function(e,t){return e.every(function(e){return Lc(e,t)})}(O,this.props.accept),j=_>0&&(!k||!S),C=!(m||g||d||f||b||y);w&&r&&(m+=" "+r),k&&n&&(m+=" "+n),j&&s&&(m+=" "+s),a&&i&&(m+=" "+i),C&&(g=Gc,d=Mc,f=Bc,b=zc,y=Wc);var P=$c({position:"relative"},g);d&&w&&(P=$c({},P,d)),f&&k&&(P=$c({},P,f)),b&&j&&(P=$c({},P,b)),y&&a&&(P=$c({},P,y));var T={accept:t,disabled:a,type:"file",style:$c({position:"absolute",top:0,right:0,bottom:0,left:0,opacity:1e-5,pointerEvents:"none"},l.style),multiple:Ic&&u,ref:this.setRefs,onChange:this.onDrop,autoComplete:"off"};c&&c.length&&(T.name=c);v.acceptedFiles,v.preventDropOnDocument,v.disableClick,v.onDropAccepted,v.onDropRejected,v.onFileDialogCancel,v.maxSize,v.minSize,v.getDataTransferItems;var D=qc(v,["acceptedFiles","preventDropOnDocument","disableClick","onDropAccepted","onDropRejected","onFileDialogCancel","maxSize","minSize","getDataTransferItems"]);return x.a.createElement("div",$c({className:m,style:P},D,{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,w,k,j),x.a.createElement("input",$c({},l,T)))}}]),t}(),Kc=Vc;Vc.propTypes={accept:R.a.oneOfType([R.a.string,R.a.arrayOf(R.a.string)]),children:R.a.oneOfType([R.a.node,R.a.func]),disableClick:R.a.bool,disabled:R.a.bool,preventDropOnDocument:R.a.bool,inputProps:R.a.object,multiple:R.a.bool,name:R.a.string,maxSize:R.a.number,minSize:R.a.number,className:R.a.string,activeClassName:R.a.string,acceptClassName:R.a.string,rejectClassName:R.a.string,disabledClassName:R.a.string,style:R.a.object,activeStyle:R.a.object,acceptStyle:R.a.object,rejectStyle:R.a.object,disabledStyle:R.a.object,getDataTransferItems:R.a.func,onClick:R.a.func,onDrop:R.a.func,onDropAccepted:R.a.func,onDropRejected:R.a.func,onDragStart:R.a.func,onDragEnter:R.a.func,onDragOver:R.a.func,onDragLeave:R.a.func,onFileDialogCancel:R.a.func},Vc.defaultProps={preventDropOnDocument:!0,disabled:!1,disableClick:!1,inputProps:{},multiple:!0,maxSize:1/0,minSize:0,getDataTransferItems:function(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)}};var Yc=function(e,t){return function(n){return _t(yt.file(e,t)).then(function(e){n({type:tn,data:e.data})}).catch(function(e){n({type:an,error:e})}),n({type:nn})}},Qc=function(e){return document.location.href=e,{type:"NOTHING"}},Xc=function(e,t){return function(n){return _t(mt.upload(t,e)).then(function(e){n({type:on,total:e.imported})}).catch(function(e){n({type:an,error:e})}),n({type:rn,file:e})}},Jc=function(){return{type:ln}},Zc=function(e){return{type:un,file:e}},es=function(){return function(e){_t(mt.pluginList()).then(function(t){e({type:cn,importers:t.importers})}).catch(function(t){e({type:an,error:t})})}},ts=function(e){return function(t){return _t(mt.pluginImport(e)).then(function(e){t({type:on,total:e.imported})}).catch(function(e){t({type:an,error:e})}),t({type:rn})}},ns=function(e){var t=e.plugin,n=e.doImport,r=t.name,o=t.total;return x.a.createElement("div",{className:"plugin-importer"},x.a.createElement("p",null,x.a.createElement("strong",null,r)," (",Object(P.translate)("total = ")+o," )"),x.a.createElement("button",{onClick:function(){n(t)},className:"button-secondary"},Object(P.translate)("Import from %s",{args:r})))};n(69);function rs(e){return(rs="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})(e)}function os(e,t){for(var n=0;n0&&t!==ke&&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 x.a.createElement("div",{className:"groups"},Object(P.translate)("Import to group")," ",x.a.createElement(hr,{items:tu(e),name:"group",value:this.state.group,onChange:this.handleInput}))}},{key:"renderInitialDrop",value:function(){return x.a.createElement("div",null,x.a.createElement("h3",null,Object(P.translate)("Import a CSV, .htaccess, or JSON file.")),x.a.createElement("p",null,Object(P.translate)("Click 'Add File' or drag and drop here.")),x.a.createElement("button",{type:"button",className:"button-secondary",onClick:this.handleOpen},Object(P.translate)("Add File")))}},{key:"renderDropBeforeUpload",value:function(){var e=this.props.io.file,t="application/json"===e.type;return x.a.createElement("div",null,x.a.createElement("h3",null,Object(P.translate)("File selected")),x.a.createElement("p",null,x.a.createElement("code",null,e.name)),!t&&this.renderGroupSelect(),x.a.createElement("button",{className:"button-primary",onClick:this.handleImport},Object(P.translate)("Upload")),"  ",x.a.createElement("button",{className:"button-secondary",onClick:this.handleCancel},Object(P.translate)("Cancel")))}},{key:"renderUploading",value:function(){var e=this.props.io.file;return x.a.createElement("div",null,x.a.createElement("h3",null,Object(P.translate)("Importing")),x.a.createElement("p",null,x.a.createElement("code",null,e.name)),x.a.createElement("div",{className:"is-placeholder"},x.a.createElement("div",{className:"placeholder-loading"})))}},{key:"renderUploaded",value:function(){var e=this.props.io.lastImport;return x.a.createElement("div",null,x.a.createElement("h3",null,Object(P.translate)("Finished importing")),x.a.createElement("p",null,Object(P.translate)("Total redirects imported:")," ",e),0===e&&x.a.createElement("p",null,Object(P.translate)("Double-check the file is the correct format!")),x.a.createElement("button",{className:"button-secondary",onClick:this.handleCancel},Object(P.translate)("OK")))}},{key:"renderDropzoneContent",value:function(){var e=this.props.io,t=e.importingStatus,n=e.lastImport,r=e.file;return t===ke?this.renderUploading():t===Ce&&!1!==n&&!1===r?this.renderUploaded():!1===r?this.renderInitialDrop():this.renderDropBeforeUpload()}},{key:"renderExport",value:function(e){return x.a.createElement("div",null,x.a.createElement("textarea",{className:"module-export",rows:"14",readOnly:!0,value:e}),x.a.createElement("input",{className:"button-secondary",type:"submit",value:Object(P.translate)("Close"),onClick:this.handleCancel}))}},{key:"renderExporting",value:function(){return x.a.createElement("div",{className:"loader-wrapper loader-textarea"},x.a.createElement("div",{className:"placeholder-loading"}))}},{key:"renderImporters",value:function(e){var t=this;return x.a.createElement("div",null,x.a.createElement("h3",null,Object(P.translate)("Plugin Importers")),x.a.createElement("p",null,Object(P.translate)("The following redirect plugins were detected on your site and can be imported from.")),e.map(function(e,n){return x.a.createElement(ns,{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,i=t.importers,l=kr()({dropzone:!0,"dropzone-dropped":!1!==r,"dropzone-importing":n===ke,"dropzone-hover":e});return x.a.createElement("div",{className:"import"},x.a.createElement("h2",null,Object(P.translate)("Import")),x.a.createElement(Kc,{ref:this.setDropzone,onDrop:this.handleDrop,onDragLeave:this.handleLeave,onDragEnter:this.handleEnter,className:l,disableClick:!0,multiple:!1},this.renderDropzoneContent()),x.a.createElement("p",null,Object(P.translate)("All imports will be appended to the current database.")),x.a.createElement("div",{className:"inline-notice notice-warning"},x.a.createElement("p",null,Object(P.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:x.a.createElement("code",null),strong:x.a.createElement("strong",null)}}))),x.a.createElement("h2",null,Object(P.translate)("Export")),x.a.createElement("p",null,Object(P.translate)("Export to CSV, Apache .htaccess, Nginx, or Redirection JSON (which contains all redirects and groups).")),x.a.createElement("select",{name:"module",onChange:this.handleInput,value:this.state.module},x.a.createElement("option",{value:"0"},Object(P.translate)("Everything")),x.a.createElement("option",{value:"1"},Object(P.translate)("WordPress redirects")),x.a.createElement("option",{value:"2"},Object(P.translate)("Apache redirects")),x.a.createElement("option",{value:"3"},Object(P.translate)("Nginx redirects"))),x.a.createElement("select",{name:"format",onChange:this.handleInput,value:this.state.format},x.a.createElement("option",{value:"csv"},Object(P.translate)("CSV")),x.a.createElement("option",{value:"apache"},Object(P.translate)("Apache .htaccess")),x.a.createElement("option",{value:"nginx"},Object(P.translate)("Nginx rewrite rules")),x.a.createElement("option",{value:"json"},Object(P.translate)("Redirection JSON")))," ",x.a.createElement("button",{className:"button-primary",onClick:this.handleView},Object(P.translate)("View"))," ",x.a.createElement("button",{className:"button-secondary",onClick:this.handleDownload},Object(P.translate)("Download")),a===ke&&this.renderExporting(),o&&a!==ke&&this.renderExport(o),x.a.createElement("p",null,Object(P.translate)("Log files can be exported from the log pages.")),i.length>0&&this.renderImporters(i))}}]),t}();var ss=he(function(e){return{group:e.group,io:e.io}},function(e){return{onLoadGroups:function(){e(bc())},onImport:function(t,n){e(Xc(t,n))},onAddFile:function(t){e(Zc(t))},onClearFile:function(){e(Jc())},onExport:function(t,n){e(Yc(t,n))},onDownloadFile:function(t){e(Qc(t))},onLoadImport:function(){e(es())},pluginImport:function(t){e(ts(t))}}})(cs);function ps(e){return(ps="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})(e)}function fs(e,t){for(var n=0;n0&&window.scrollTo(0,0)}},{key:"dismiss",value:function(){this.props.onClear()}},{key:"getDebug",value:function(e){for(var t=[Redirectioni10n.versions],n=0;n1?e[e.length-1]+" ("+e.length+")":e[0]}},{key:"renderNotice",value:function(e){var t="notice notice-info redirection-notice"+(this.state.shrunk?" redirection-notice_shrunk":"");return x.a.createElement("div",{className:t,onClick:this.onClick},x.a.createElement("div",{className:"closer"},"✔"),x.a.createElement("p",null,this.state.shrunk?x.a.createElement("span",{title:Object(P.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 gp=he(function(e){return{notices:e.message.notices}},function(e){return{onClear:function(){e(rp())}}})(bp);n(77);function vp(e){return(vp="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})(e)}function Ep(e,t){for(var n=0;n1?Object(P.translate)("Saving...")+" ("+e+")":Object(P.translate)("Saving...")}},{key:"renderProgress",value:function(e){return x.a.createElement("div",{className:"notice notice-progress redirection-notice"},x.a.createElement(lo,null),x.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 xp=he(function(e){return{inProgress:e.message.inProgress}},null)(Sp),kp=function(e){var t=e.item,n=e.isCurrent,r=e.onClick,o=Redirectioni10n.pluginRoot+(""===t.value?"":"&sub="+t.value);return x.a.createElement("li",null,x.a.createElement("a",{className:n?"current":"",href:o,onClick:function(e){e.preventDefault(),r(t.value,o)}},t.name))},jp=(n(79),function(e){var t=e.onChangePage,n=He();return x.a.createElement("div",{className:"subsubsub-container"},x.a.createElement("ul",{className:"subsubsub"},[{name:Object(P.translate)("Redirects"),value:""},{name:Object(P.translate)("Groups"),value:"groups"},{name:Object(P.translate)("Log"),value:"log"},{name:Object(P.translate)("404s"),value:"404s"},{name:Object(P.translate)("Import/Export"),value:"io"},{name:Object(P.translate)("Options"),value:"options"},{name:Object(P.translate)("Support"),value:"support"}].map(function(e,r){return x.a.createElement(kp,{key:r,item:e,isCurrent:n===e.value||"redirect"===n&&""===e.value,onClick:t})}).reduce(function(e,t){return[e," | ",t]})))});n(81);function Cp(e){return(Cp="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})(e)}function Pp(e,t){for(var n=0;n0?document.location.href=t:(n.props.onClear(),history.pushState({},null,t),n.changePage(e),n.setState({page:e,clicked:n.state.clicked+1}))}),Rp(Np(Np(n)),"onAdd",function(e){e.preventDefault(),n.props.onAdd()}),n.state={page:He(),clicked:0,stack:!1,error:"3.6.1"!==Redirectioni10n.version,info:!1},window.addEventListener("popstate",n.onPageChanged),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Dp(e,t)}(t,x.a.Component),function(e,t,n){t&&Pp(e.prototype,t),n&&Pp(e,n)}(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:!0,stack:e,info:t})}},{key:"componentWillUnmount",value:function(){window.removeEventListener("popstate",this.onPageChanged)}},{key:"changePage",value:function(e){var t=this.props,n=t.onSet404Table,r=t.onSetLogTable,o=t.onSetRedirectTable,a=t.onSetGroupTable;"404s"===e?n(tr().table):"log"===e?r(er().table):"redirect"===e?o(rr().table):"groups"===e&&a(nr().table)}},{key:"getContent",value:function(e){var t=this.state.clicked;switch(e){case"support":return x.a.createElement(Ro,null);case"404s":return x.a.createElement(Nc,{key:t});case"log":return x.a.createElement(hi,{key:t});case"io":return x.a.createElement(ss,null);case"groups":return x.a.createElement(Rs,{key:t});case"options":return x.a.createElement(eo,null)}return x.a.createElement(tp,{key:t})}},{key:"renderError",value:function(){var e=[Redirectioni10n.versions,"Buster: 3.6.1 === "+Redirectioni10n.version,"",this.state.stack];return this.state.info&&this.state.info.componentStack&&e.push(this.state.info.componentStack),"3.6.1"!==Redirectioni10n.version?x.a.createElement("div",{className:"notice notice-error"},x.a.createElement("h2",null,Object(P.translate)("Cached Redirection detected")),x.a.createElement("p",null,Object(P.translate)("Please clear your browser cache and reload this page.")),x.a.createElement("p",null,Object(P.translate)("If you are using a caching system such as Cloudflare then please read this: "),x.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(P.translate)("clearing your cache."))),x.a.createElement("p",null,x.a.createElement("textarea",{readOnly:!0,rows:e.length+3,cols:"120",value:e.join("\n"),spellCheck:!1}))):x.a.createElement("div",{className:"notice notice-error"},x.a.createElement("h2",null,Object(P.translate)("Something went wrong 🙁")),x.a.createElement("p",null,Object(P.translate)("Redirection is not working. Try clearing your browser cache and reloading this page."),"  ",Object(P.translate)("If you are using a page caching plugin or service (CloudFlare, OVH, etc) then you can also try clearing that cache.")),x.a.createElement("p",null,Object(P.translate)("If that doesn't help, open your browser's error console and create a {{link}}new issue{{/link}} with the details.",{components:{link:x.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/johngodley/redirection/issues"})}})),x.a.createElement("p",null,Object(P.translate)("Please mention {{code}}%s{{/code}}, and explain what you were doing at the time",{components:{code:x.a.createElement("code",null)},args:this.state.page})),x.a.createElement("p",null,x.a.createElement("textarea",{readOnly:!0,rows:e.length+8,cols:"120",value:e.join("\n"),spellCheck:!1})))}},{key:"render",value:function(){var e={redirect:Object(P.translate)("Redirections"),groups:Object(P.translate)("Groups"),io:Object(P.translate)("Import/Export"),log:Object(P.translate)("Logs"),"404s":Object(P.translate)("404 errors"),options:Object(P.translate)("Options"),support:Object(P.translate)("Support")}[this.state.page];return this.state.error?this.renderError():x.a.createElement("div",{className:"wrap redirection"},x.a.createElement("h1",{className:"wp-heading-inline"},e),"redirect"===this.state.page&&x.a.createElement("a",{href:"#",onClick:this.onAdd,className:"page-title-action"},Object(P.translate)("Add New")),x.a.createElement(jp,{onChangePage:this.onChangePage}),x.a.createElement(sp,null),this.getContent(this.state.page),x.a.createElement(xp,null),x.a.createElement(gp,null))}}]),t}();var Ip=he(function(e){return{errors:e.message.errors}},function(e){return{onClear:function(){e(np())},onAdd:function(){e(hu(!0))},onSet404Table:function(t){e(Fi(t))},onSetLogTable:function(t){e(La(t))},onSetGroupTable:function(t){e(Sc(t))},onSetRedirectTable:function(t){e(mu(t))}}})(Ap),Lp=function(){return x.a.createElement(L,{store:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(te.createStore)(Qn,e,Xn(te.applyMiddleware.apply(void 0,Jn)))}(or())},x.a.createElement(Ip,null))};document.querySelector("#react-ui")&&function(e){T.a.setLocale({"":{localeSlug:Redirectioni10n.localeSlug}}),T.a.addTranslations(Redirectioni10n.locale),function(e,t){j.a.render(x.a.createElement(C.AppContainer,null,x.a.createElement(e,null)),document.getElementById(t))}(Lp,e)}("react-ui"),window.redirection=Redirectioni10n.version}]); \ No newline at end of file + */Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,l=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116;function y(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case p:case i:case u:case l:return e;default:switch(e=e&&e.$$typeof){case s:case f:case c:return e;default:return t}}case a:return t}}}function b(e){return y(e)===p}t.typeOf=y,t.AsyncMode=p,t.ConcurrentMode=p,t.ContextConsumer=s,t.ContextProvider=c,t.Element=o,t.ForwardRef=f,t.Fragment=i,t.Profiler=u,t.Portal=a,t.StrictMode=l,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===u||e===l||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===c||e.$$typeof===s||e.$$typeof===f)},t.isAsyncMode=function(e){return b(e)},t.isConcurrentMode=b,t.isContextConsumer=function(e){return y(e)===s},t.isContextProvider=function(e){return y(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return y(e)===f},t.isFragment=function(e){return y(e)===i},t.isProfiler=function(e){return y(e)===u},t.isPortal=function(e){return y(e)===a},t.isStrictMode=function(e){return y(e)===l}},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";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 u=1e3;a&&"number"==typeof a.maxKeys&&(u=a.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var s=0;s=0?(p=m.substr(0,y),f=m.substr(y+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,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*{justify-content:center;align-self:center;margin-left:calc(50% - 30px);margin-top:40px}@media screen and (max-width: 782px){.redirection-modal_main .redirection-modal_content{width:80%;margin-right:10%}}\n",""])},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=n(49);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,'@-webkit-keyframes loading-fade{0%{opacity:0.5}50%{opacity:1}100%{opacity:0.5}}@keyframes loading-fade{0%{opacity:0.5}50%{opacity:1}100%{opacity:0.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;-webkit-animation:loading-fade 1.6s ease-in-out infinite;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:0.3}\n',""])},function(e,t,n){var r=n(51);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".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:0px;margin-bottom:0px}.donation input[type=submit]{margin-left:10px}\n",""])},function(e,t,n){var r=n(53);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!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 1.0s infinite ease-in-out;animation:sk-scaleout 1.0s infinite ease-in-out}@-webkit-keyframes sk-scaleout{0%{-webkit-transform:scale(0)}100%{-webkit-transform:scale(1);opacity:0}}@keyframes sk-scaleout{0%{-webkit-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.spinner-small .css-spinner{width:20px;height:20px;top:-15px;left:5px}\n",""])},function(e,t,n){var r=n(55);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".http-tester input[type=text]{width:80%}.http-tester table{width:95%}.http-tester table th,.http-tester table td{vertical-align:top;padding:5px 5px;overflow:hidden}.http-tester table td{max-width:500px}.http-tester table th{text-align:right;padding-right:10px;width:150px}.http-tester table p{padding-top:0;margin-top:0}.http-tester table code{background-color:transparent;font-size:12px;padding:0}.http-tester ul{list-style-type:disc;margin-left:20px}.http-tester ul li span{margin:-20px}.http-tester ul ul{list-style-type:disc;margin-left:20px}\n",""])},function(e,t,n){var r=n(57);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".plugin-status th{text-align:left;padding:5px;vertical-align:top}.plugin-status td,.plugin-status span{vertical-align:top;padding:5px}.plugin-status .plugin-status-good{background-color:#4ab866;color:white}.plugin-status .plugin-status-problem{background-color:orange;color:white}.plugin-status .plugin-status-error{background-color:#ff3860;color:white}.github{margin-top:8px}.github a{text-decoration:none}.github img{padding-right:10px;margin-bottom:-10px}\n",""])},function(e,t,n){var r=n(59);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,'.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-module,.redirection .wp-list-table .column-total,.redirection .wp-list-table .column-ip{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 .check-column-red{vertical-align:middle;padding:4px 0 0 3px !important;width:2.2em;margin:0px}.redirection .wp-list-table strike{opacity:0.7}.redirection .form-table th a{color:#444}table.edit-redirection{width:100%;padding-right:15px}table.edit-redirection th{width:130px;font-weight:bold;text-align:left}table.edit-redirection th.top{vertical-align:top}table.edit-redirection tbody tr td{display:flex;padding:0px}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}table.edit-redirection tbody td.edit-left>*{flex:none}table.edit-redirection textarea{width:100%;height:100px}.edit-groups{width:100%}.edit-groups th{line-height:1.2;vertical-align:top;padding:2px;padding-top:5px !important;padding-left:0px;font-size:13px;font-weight:bold}.edit-groups td{padding:2px}.edit-groups input[type=text]{width:100%}.table-buttons{float:left;padding-top:2px}.table-buttons>button,.table-buttons>form,.table-buttons>div.table-button-item{margin-right:5px !important;display:inline}.table-buttons .redirection-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 td,.redirection .wp-list-table input,.redirection .wp-list-table select,.redirection .wp-list-table th{font-size:1em !important}.redirection .wp-list-table td.column-code,.redirection .wp-list-table th.column-code,.redirection .wp-list-table td.column-url .target,.redirection .wp-list-table td.column-date,.redirection .wp-list-table th.column-date,.redirection .wp-list-table td.column-referrer{display:none !important}table.edit-redirection{padding-right:0}table.edit-redirection th{display:block;font-weight:bold;padding-left:0px !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="text"],table.edit-redirection select,table.edit-redirection input[type="number"]{width:100%}table.edit-redirection select,table.edit-redirection input[type="number"]{height:30px !important}table.edit-groups select,table.edit-groups input[type="number"]{height:30px !important}}\n',""])},function(e,t,n){(function(e,r){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(a){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof r&&r;i.global!==i&&i.window!==i&&i.self;var l,u=2147483647,c=36,s=1,p=26,f=38,d=700,h=72,m=128,y="-",b=/^xn--/,g=/[^\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=c-s,O=Math.floor,_=String.fromCharCode;function S(e){throw new RangeError(E[e])}function x(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function k(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+x((e=e.replace(v,".")).split("."),t).join(".")}function j(e){for(var t,n,r=[],o=0,a=e.length;o=55296&&t<=56319&&o65535&&(t+=_((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=_(e)}).join("")}function P(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function T(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function D(e,t,n){var r=0;for(e=n?O(e/d):e>>1,e+=O(e/t);e>w*p>>1;r+=c)e=O(e/w);return O(r+(w+1)*e/(e+f))}function N(e){var t,n,r,o,a,i,l,f,d,b,g=[],v=e.length,E=0,w=m,_=h;for((n=e.lastIndexOf(y))<0&&(n=0),r=0;r=128&&S("not-basic"),g.push(e.charCodeAt(r));for(o=n>0?n+1:0;o=v&&S("invalid-input"),((f=P(e.charCodeAt(o++)))>=c||f>O((u-E)/i))&&S("overflow"),E+=f*i,!(f<(d=l<=_?s:l>=_+p?p:l-_));l+=c)i>O(u/(b=c-d))&&S("overflow"),i*=b;_=D(E-a,t=g.length+1,0==a),O(E/t)>u-w&&S("overflow"),w+=O(E/t),E%=t,g.splice(E++,0,w)}return C(g)}function R(e){var t,n,r,o,a,i,l,f,d,b,g,v,E,w,x,k=[];for(v=(e=j(e)).length,t=m,n=0,a=h,i=0;i=t&&gO((u-n)/(E=r+1))&&S("overflow"),n+=(l-t)*E,t=l,i=0;iu&&S("overflow"),g==t){for(f=n,d=c;!(f<(b=d<=a?s:d>=a+p?p:d-a));d+=c)x=f-b,w=c-b,k.push(_(T(b+x%w,0))),f=O(x/w);k.push(_(T(f,0))),a=D(n,E,r==o),n=0,++r}++n,++t}return k.join("")}l={version:"1.4.1",ucs2:{decode:j,encode:C},decode:N,encode:R,toASCII:function(e){return k(e,function(e){return g.test(e)?"xn--"+R(e):e})},toUnicode:function(e){return k(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(61)(e),n(16))},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){"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,n){var r=n(64);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".redirection-poweredby{position:absolute;right:15px;bottom:10px}\n",""])},function(e,t,n){var r=n(66);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".redirection-geomap{padding-bottom:10px;width:100%;position:relative}.redirection-geomap .redirection-geomap_full{height:600px}.redirection-geomap iframe{position:absolute;top:0;left:0;width:100%;background-color:#f3f6f8;height:450px;max-height:90%}.redirection-geomap table{background-color:#fff;padding:10px;padding-bottom:30px;position:absolute;bottom:0;left:0;height:130px;width:100%}.redirection-geomap table th,.redirection-geomap table td{padding:0}.redirection-geomap table th{font-weight:bold;text-align:left;width:150px}.redirection-geomap table td{text-align:left}.redirection-geomap h2{line-height:1;margin:0;padding-bottom:10px}@media screen and (max-width: 782px){.redirection-modal_main .redirection-geomap iframe{height:255px}.redirection-modal_main .redirection-geomap .redirection-geomap_full{height:400px !important}}.redirection-geomap_small{height:100px;padding-top:20px}\n",""])},function(e,t,n){var r=n(68);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".redirection-useragent{box-sizing:border-box;padding-bottom:30px}.redirection-useragent th{width:120px;vertical-align:top;line-height:1;text-align:left;padding-left:10px}.redirection-useragent td{line-height:1.2}.redirection-useragent td,.redirection-useragent h2{text-align:left}.redirection-useragent h2{margin-bottom:0;padding-left:12px;padding-bottom:5px}.redirection-useragent .redirection-useragent_agent{font-size:12px}.redirection-useragent .redirection-useragent_unknown,.redirection-useragent .redirection-useragent_unknown h2{text-align:center;padding:5px}.redirection-useragent table{padding-bottom:15px;padding-top:10px}\n",""])},function(e,t,n){var r=n(70);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".dropzone{border:3px dashed #bbb;text-align:center;padding:10px;padding-bottom:15px;margin-bottom:10px;border-radius:4px;color:#666}.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,.dropzone-hover{border-color:#86bfd4}.dropzone-importing{border-color:transparent}\n",""])},function(e,t,n){var r=n(72);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".redirection-httpcheck_results{display:flex;padding-bottom:40px}.redirection-httpcheck_results .redirection-httpcheck_info{text-align:left}.redirection-httpcheck table{width:100%}.redirection-httpcheck .redirection-httpcheck_status{width:80px}.redirection-httpcheck .redirection-httpcheck_status .dashicons{font-size:70px;width:70px;height:70px}.redirection-httpcheck .redirection-httpcheck_status .dashicons-yes{color:#4ab866}.redirection-httpcheck .redirection-httpcheck_status .dashicons-no{color:#ff3860}.redirection-httpcheck h2{margin-bottom:0;padding-bottom:5px;text-align:left;padding-left:10px}\n",""])},function(e,t,n){var r=n(74);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".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,Monaco,monospace;font-size:12px;background-color:#eee;width:100%}.notice-error span code{background-color:transparent}\n",""])},function(e,t,n){var r=n(76);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".redirection-notice{position:fixed;bottom:25px;right:0;font-weight:bold;box-shadow:3px 3px 3px rgba(0,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:0.8}.redirection-notice.notice-shrunk{width:20px}.redirection-notice.notice-shrunk p{font-size:16px}.redirection-notice.notice-shrunk .closer{display:none}\n",""])},function(e,t,n){var r=n(78);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".notice-progress{border-left:5px solid green;padding:10px;cursor:auto;bottom:80px}.notice-progress p{margin-left:50px;-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite}.notice-progress .spinner-container{position:absolute;left:0;top:33px}\n",""])},function(e,t,n){var r=n(80);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,'.subsubsub-container::before,.subsubsub-container::after{content:"";display:table}.subsubsub-container::after{clear:both}\n',""])},function(e,t,n){var r=n(82);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(5)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,'.wp-core-ui .button-delete{box-shadow:none;text-shadow:none;background-color:#ff3860;border-color:transparent;color:#fff}.wp-core-ui .button-delete:hover{background-color:#ff3860;border-color:transparent;box-shadow:none;text-shadow:none}.inline-notice{background:#fff;border-left:4px solid #fff;box-shadow:0 1px 1px 0 rgba(0,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 0px}.import select{width:100%;margin:5px 0px}.plugin-importer button{width:100%}p.search-box input[name="s"]{margin-top:20px}}.module-export{border:1px solid #ddd;padding:5px;font-family:courier,Monaco,monospace;margin-top:15px;width:100%;background-color:white !important}.redirects a.advanced{text-decoration:none}\n',""])},function(e,t,n){"use strict";n.r(t);var r=n(17),o=n.n(r),a={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(a.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return a.iterable&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function h(e){var t=new FileReader,n=d(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a.arrayBuffer&&a.blob&&function(e){return e&&DataView.prototype.isPrototypeOf(e)}(e)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=d(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function v(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function E(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},y.call(g.prototype),y.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];E.redirect=function(e,t){if(-1===w.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})};var O=self.DOMException;try{new O}catch(e){(O=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),O.prototype.constructor=O}function _(e,t){return new Promise(function(n,r){var o=new g(e,t);if(o.signal&&o.signal.aborted)return r(new O("Aborted","AbortError"));var i=new XMLHttpRequest;function l(){i.abort()}i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:function(e){var t=new p;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;n(new E(t,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.onabort=function(){r(new O("Aborted","AbortError"))},i.open(o.method,o.url,!0),"include"===o.credentials?i.withCredentials=!0:"omit"===o.credentials&&(i.withCredentials=!1),"responseType"in i&&a.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),o.signal&&(o.signal.addEventListener("abort",l),i.onreadystatechange=function(){4===i.readyState&&o.signal.removeEventListener("abort",l)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})}_.polyfill=!0,self.fetch||(self.fetch=_,self.Headers=p,self.Request=g,self.Response=E),!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>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],o=0;o=0||(o[n]=e[n]);return o}var B=n(19),z=n.n(B),G=n(10),W=n.n(G),$=n(11),H=null,q={notify:function(){}};var V=function(){function e(e,t,n){this.store=e,this.parentSub=t,this.onStateChange=n,this.unsubscribe=null,this.listeners=q}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=function(){var e=[],t=[];return{clear:function(){t=H,e=H},notify:function(){for(var n=e=t,r=0;r, or explicitly pass "'+h+'" as a prop to "'+r+'".'),o.initSelector(),o.initSubscription(),o}D(a,n);var i=a.prototype;return i.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[g]=t||this.context[g],e},i.componentDidMount=function(){f&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},i.componentWillReceiveProps=function(e){this.selector.run(e)},i.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},i.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=Q,this.store=null,this.selector.run=Q,this.selector.shouldComponentUpdate=!1},i.getWrappedInstance=function(){return W()(y,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+u+"() call."),this.wrappedInstance},i.setWrappedInstance=function(e){this.wrappedInstance=e},i.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.initSubscription=function(){if(f){var e=(this.propsMode?this.props:this.context)[g];this.subscription=new V(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},i.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(Y)):this.notifyNestedSubs()},i.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},i.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},i.addExtraProps=function(e){if(!(y||s||this.propsMode&&this.subscription))return e;var t=F({},e);return y&&(t.ref=this.setWrappedInstance),s&&(t[s]=this.renderCount++),this.propsMode&&this.subscription&&(t[g]=this.subscription),t},i.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(S.createElement)(t,this.addExtraProps(e.props))},a}(S.Component);return a.WrappedComponent=t,a.displayName=r,a.childContextTypes=w,a.contextTypes=E,a.propTypes=E,z()(a,t)}}var J=Object.prototype.hasOwnProperty;function Z(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function ee(e,t){if(Z(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=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 de(e,t){return e===t}var he=function(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?X:n,o=t.mapStateToPropsFactories,a=void 0===o?ie:o,i=t.mapDispatchToPropsFactories,l=void 0===i?ae:i,u=t.mergePropsFactories,c=void 0===u?ue:u,s=t.selectorFactory,p=void 0===s?pe:s;return function(e,t,n,o){void 0===o&&(o={});var i=o,u=i.pure,s=void 0===u||u,f=i.areStatesEqual,d=void 0===f?de:f,h=i.areOwnPropsEqual,m=void 0===h?ee:h,y=i.areStatePropsEqual,b=void 0===y?ee:y,g=i.areMergedPropsEqual,v=void 0===g?ee:g,E=M(i,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),w=fe(e,a,"mapStateToProps"),O=fe(t,l,"mapDispatchToProps"),_=fe(n,c,"mergeProps");return r(p,F({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:w,initMapDispatchToProps:O,initMergeProps:_,pure:s,areStatesEqual:d,areOwnPropsEqual:m,areStatePropsEqual:b,areMergedPropsEqual:v},E))}}(),me=n(21);function ye(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 be=ye();be.withExtraArgument=ye;var ge=be,ve="SETTING_LOAD_START",Ee="SETTING_LOAD_SUCCESS",we="SETTING_LOAD_FAILED",Oe="SETTING_LOAD_STATUS",_e="SETTING_SAVING",Se="SETTING_SAVED",xe="SETTING_SAVE_FAILED",ke="STATUS_IN_PROGRESS",je="STATUS_FAILED",Ce="STATUS_COMPLETE",Pe="STATUS_SAVING";function Te(e){for(var t=1;t0&&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=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=$e(),i={orderby:r,direction:"desc",page:0,per_page:parseInt(Redirectioni10n.per_page,10),selected:[],filterBy:"",filter:"",groupBy:""},l=void 0===a.sub?"":a.sub;return-1===o.indexOf(l)?i:qe({},i,{orderby:a.orderby&&-1!==e.indexOf(a.orderby)?a.orderby:i.orderby,direction:a.direction&&"asc"===a.direction?"asc":i.direction,page:a.offset&&parseInt(a.offset,10)>0?parseInt(a.offset,10):i.page,per_page:Redirectioni10n.per_page?parseInt(Redirectioni10n.per_page,10):i.per_page,filterBy:a.filterby&&-1!==t.indexOf(a.filterby)?a.filterby:i.filterBy,filter:a.filter?a.filter:i.filter,groupBy:a.groupby&&-1!==n.indexOf(a.groupby)?a.groupby:i.groupBy})},Xe=function(e,t){for(var n=Object.assign({},e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=Redirectioni10n.WP_API_root+"redirection/v1/"+e+"/";if(t._wpnonce=Redirectioni10n.WP_API_nonce,t&&Object.keys(t).length>0&&(t=function(e){return Object.keys(e).filter(function(t){return e[t]}).reduce(function(t,n){return t[n]=e[n],t},{})}(t),Object.keys(t).length>0)){var r=n+(-1===Redirectioni10n.WP_API_root.indexOf("?")?"?":"&")+ze.a.stringify(t);return-1!==Redirectioni10n.WP_API_root.indexOf("page=redirection.php")?r.replace(/page=(\d+)/,"ppage=$1"):r}return n},it=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"}},lt=function(e,t){var n=rt({},t),r={};return t.items&&(r.items=t.items,delete n.items),rt({},it(at(e,n)),{method:"post",body:r.items?JSON.stringify(r):null})},ut=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rt({},it(at(e,t)),{method:"get"})},ct=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=rt({},it(at(e,n)),{method:"post",params:t});return Object.keys(t).length>0&&(r.body=JSON.stringify(t)),r},st={get:function(){return ut("setting")},update:function(e){return ct("setting",e)}},pt={list:function(e){return ut("redirect",e)},update:function(e,t){return ct("redirect/"+e,t)},create:function(e){return ct("redirect",e)}},ft={list:function(e){return ut("group",e)},update:function(e,t){return ct("group/"+e,t)},create:function(e){return ct("group",e)}},dt={list:function(e){return ut("log",e)},deleteAll:function(e){return lt("log",e)}},ht={list:function(e){return ut("404",e)},deleteAll:function(e){return lt("404",e)}},mt={get:function(){return ut("import")},upload:function(e,t){return function(e,t){var n=rt({},it(at(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 ut("import/plugin")},pluginImport:function(e){return ct("import/plugin/"+e)}},yt={file:function(e,t){return ut("export/"+e+"/"+t)}},bt={status:function(){return ut("plugin")},fix:function(){return ct("plugin")},delete:function(){return lt("plugin/delete")}},gt={redirect:function(e,t,n){return ct("bulk/redirect/"+e,t,n)},group:function(e,t,n){return ct("bulk/group/"+e,t,n)},log:function(e,t,n){return ct("bulk/log/"+e,t,n)},error:function(e,t,n){return ct("bulk/404/"+e,t,n)}},vt=function(e){return"https://api.redirect.li/v1/"+e+(-1===e.indexOf("?")?"?":"&")+"ref=redirection"},Et={getGeo:function(e){return{url:vt("ip/"+e+"?locale="+Redirectioni10n.localeSlug.substr(0,2)),method:"get"}}},wt={get:function(e){return{url:vt("useragent/"+encodeURIComponent(e)),method:"get"}}},Ot={get:function(e){return{url:vt("http?url="+encodeURIComponent(e)),method:"get"}}},_t=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}})};function St(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t4&&void 0!==arguments[4]?arguments[4]:{};return function(a,i){var l=i()[r.store],u=l.table,c=l.total,s={items:n?[n]:u.selected,bulk:t};if("delete"===t&&u.page>0&&u.per_page*u.page==c-1&&(u.page-=1),"delete"!==t||confirm(Object(P.translate)("Are you sure you want to delete this item?","Are you sure you want to delete these items?",{count:s.items.length}))){var p=Xe(u,s),f=kt({},{items:s.items.join(",")},o);return _t(e(t,f,Je(u,r.order))).then(function(e){a(kt({type:r.saved},e,{saving:s.items}))}).catch(function(e){a({type:r.failed,error:e,saving:s.items})}),a({type:r.saving,table:p,saving:s.items})}}},Pt=function(e,t,n,r,o){return _t(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]})},Tt=function(e,t,n){return function(r,o){var a=xt({},o()[n.store]);return a.page=0,a.orderby="id",a.direction="desc",Pt(e(t),a,t,n,r)}},Dt=function(e,t,n,r){return function(o,a){var i=a()[r.store].table;return Pt(e(t,n),i,n,r,o)}},Nt=function(e,t){for(var n in e)if(e[n]!==t[n])return!1;return!0},Rt=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,u=o.rows,c=a(Xe(l,r)),s=Je(kt({},l,r),n.order);if(!(Nt(c,l)&&u.length>0&&Nt(r,{})))return _t(e(s)).then(function(e){t(kt({type:n.saved},e))}).catch(function(e){t({type:n.failed,error:e})}),t(kt({table:c,type:n.saving},function(e,t){var n={};for(var r in t)void 0===e[r]&&(n[r]=t[r]);return n}(c,r)))},At=function(e,t,n,r,o){var a=o.table,i=Je(kt({},a,r),n.order);_t(e(i)).then(function(e){t(kt({type:n.saved},e))}).catch(function(e){t({type:n.failed,error:e})})},It=function(e,t,n){for(var r=e.slice(0),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ve:return Te({},e,{loadStatus:ke});case Ee:return Te({},e,{loadStatus:Ce,values:t.values,groups:t.groups,postTypes:t.postTypes,installed:t.installed,canDelete:t.canDelete});case we:return Te({},e,{loadStatus:je,error:t.error});case _e:return Te({},e,{saveStatus:ke});case Se:return Te({},e,{saveStatus:Ce,values:t.values,groups:t.groups,installed:t.installed});case xe:return Te({},e,{saveStatus:je,error:t.error});case Oe:return Te({},e,{pluginStatus:t.pluginStatus})}return e},log:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Le:return Wt({},e,{table:tt(e.table,e.rows,t.onoff)});case Ie:return Wt({},e,{table:et(e.table,t.items)});case Ue:return Wt({},e,{table:Ze(Mt(e,t)),saving:zt(e,t),rows:Lt(e,t)});case Fe:return Wt({},e,{rows:Ft(e,t),total:Bt(e,t),saving:Gt(e,t)});case Ne:return Wt({},e,{table:Mt(e,t),status:ke,saving:[],logType:t.logType,requestCount:e.requestCount+1});case Ae:return Wt({},e,{status:je,saving:[]});case Re:return Wt({},e,{rows:Ft(e,t),status:Ce,total:Bt(e,t),table:Ze(e.table)});case Me:return Wt({},e,{saving:Gt(e,t),rows:Ut(e,t)})}return e},error:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Yt:return Zt({},e,{table:tt(e.table,e.rows,t.onoff)});case Kt:return Zt({},e,{table:et(e.table,t.items)});case Qt:return Zt({},e,{table:Ze(Mt(e,t)),saving:zt(e,t),rows:Lt(e,t)});case Xt:return Zt({},e,{rows:Ft(e,t),total:Bt(e,t),saving:Gt(e,t)});case Ht:return Zt({},e,{table:Mt(e,t),status:ke,saving:[],requestCount:e.requestCount+1});case Vt:return Zt({},e,{status:je,saving:[]});case qt:return Zt({},e,{rows:Ft(e,t),status:Ce,total:Bt(e,t),table:Ze(e.table)});case Jt:return Zt({},e,{saving:Gt(e,t),rows:Ut(e,t)})}return e},io:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case nn:return sn({},e,{exportStatus:ke});case tn:return sn({},e,{exportStatus:Ce,exportData:t.data});case un:return sn({},e,{file:t.file});case ln:return sn({},e,{file:!1,lastImport:!1,exportData:!1});case an:return sn({},e,{importingStatus:je,exportStatus:je,lastImport:!1,file:!1,exportData:!1});case rn:return sn({},e,{importingStatus:ke,lastImport:!1,file:!!t.file&&t.file});case on:return sn({},e,{lastImport:t.total,importingStatus:Ce,file:!1});case cn:return sn({},e,{importers:t.importers})}return e},group:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case fn:return En({},e,{table:Mt(e,t),status:ke,saving:[]});case dn:return En({},e,{rows:Ft(e,t),status:Ce,total:Bt(e,t),table:Ze(e.table)});case bn:return En({},e,{table:Ze(Mt(e,t)),saving:zt(e,t),rows:Lt(e,t)});case vn:return En({},e,{rows:Ft(e,t),total:Bt(e,t),saving:Gt(e,t)});case yn:return En({},e,{table:tt(e.table,e.rows,t.onoff)});case mn:return En({},e,{table:et(e.table,t.items)});case hn:return En({},e,{status:je,saving:[]});case gn:return En({},e,{saving:Gt(e,t),rows:Ut(e,t)})}return e},redirect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Tn:return Dn({},e,{addTop:t.onoff});case On:return Dn({},e,{table:Mt(e,t),status:ke,saving:[]});case _n:return Dn({},e,{rows:Ft(e,t),status:Ce,total:Bt(e,t),table:Ze(e.table)});case jn:return Dn({},e,{table:Ze(Mt(e,t)),saving:zt(e,t),rows:Lt(e,t)});case Pn:return Dn({},e,{rows:Ft(e,t),total:Bt(e,t),saving:Gt(e,t)});case kn:return Dn({},e,{table:tt(e.table,e.rows,t.onoff)});case xn:return Dn({},e,{table:et(e.table,t.items)});case Sn:return Dn({},e,{status:je,saving:[]});case Cn:return Dn({},e,{saving:Gt(e,t),rows:Ut(e,t)})}return e},message:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case an:case hn:case Cn:case gn:case Ae:case Me:case we:case xe:case Jt:case Vt:case Sn:var n=Un(e.errors,t.error);return console.error(t.error.message),In({},e,{errors:n,inProgress:Mn(e)});case Ue:case jn:case _e:case Qt:case bn:return In({},e,{inProgress:e.inProgress+1});case Fe:case Pn:case Se:case vn:case Xt:return In({},e,{notices:Fn(e.notices,Bn[t.type]),inProgress:Mn(e)});case An:return In({},e,{notices:[]});case Rn:return In({},e,{errors:[]})}return e},info:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case zn:return Vn({},e,{status:ke,http:!1});case Gn:return Vn({},e,{status:Ce,maps:Yn(e.maps,t.map,"ip")});case Wn:return Vn({},e,{status:Ce,agents:Yn(e.agents,t.agent,"agent")});case $n:return Vn({},e,{status:je,error:t.error});case Hn:return Vn({},e,{status:Ce,http:t.http});case qn:return Vn({},e,{http:!1})}return e}}),Xn=Object(me.composeWithDevTools)({name:"Redirection"}),Jn=[ge,function(){return function(e){return function(t){switch(t.type){case jn:case bn:case On:case fn:case Ne:case Ht:!function(e,t){var n=He(),r={redirect:[[On,jn],"id"],groups:[[fn,bn],"name"],log:[[Ne],"date"],"404s":[[Ht],"date"]};if(r[n]&&e===r[n][0].find(function(t){return t===e})){var o=t.orderby,a=t.direction,i=t.page,l=t.per_page,u=t.filter,c=t.filterBy,s=t.groupBy,p={orderby:o,direction:a,offset:i,per_page:l,filter:u,filterBy:c,groupBy:s},f={orderby:r[n][1],direction:"desc",offset:0,filter:"",filterBy:"",per_page:parseInt(Redirectioni10n.per_page,10),groupBy:""};s&&(f.orderby="total"),We(p,f)}}(t.type,t.table?t.table:t)}return e(t)}}}];function Zn(){var e=Redirectioni10n&&Redirectioni10n.preload&&Redirectioni10n.preload.pluginStatus?Redirectioni10n.preload.pluginStatus:[];return{loadStatus:ke,saveStatus:!1,error:!1,installed:"",settings:{},postTypes:[],pluginStatus:e,canDelete:!1}}function er(){return{rows:[],saving:[],total:0,status:ke,table:Qe(["ip","url"],["ip"],[],"date",["log"]),requestCount:0}}function tr(){var e=$e(),t="date";return"404s"===e.sub&&e.groupby&&(t="total"),{rows:[],saving:[],total:0,status:ke,table:Qe(["ip","url","total"],["ip","url-exact"],["url","ip"],t,["404s"]),requestCount:0}}function nr(){return{rows:[],saving:[],total:0,status:ke,table:Qe(["name"],["name","module"],[],"name",["groups"])}}function rr(){return{rows:[],saving:[],total:0,addTop:!1,status:ke,table:Qe(["url","position","last_count","id","last_access"],["group"],[],"id",[""])}}function or(){return{settings:Zn(),log:er(),error:tr(),io:{status:ke,file:!1,lastImport:!1,exportData:!1,importingStatus:!1,exportStatus:!1,importers:[]},group:nr(),redirect:rr(),message:{errors:[],notices:[],inProgress:0,saving:[]},info:{status:Ce,maps:{},agents:{},http:!1,error:""}}}var ar=function(){return function(e,t){return t().settings.loadStatus===Ce?null:(_t(st.get()).then(function(t){e({type:Ee,values:t.settings,groups:t.groups,postTypes:t.post_types,installed:t.installed,canDelete:t.canDelete})}).catch(function(t){e({type:we,error:t})}),e({type:ve}))}},ir=function(e){return function(t){return _t(st.update(e)).then(function(e){t({type:Se,values:e.settings,groups:e.groups,installed:e.installed})}).catch(function(e){t({type:xe,error:e})}),t({type:_e})}},lr=function(){return function(e){return _t(bt.delete()).then(function(e){document.location.href=e.location}).catch(function(t){e({type:xe,error:t})}),e({type:_e})}},ur=function(){return function(e){return _t(bt.status()).then(function(t){e({type:Oe,pluginStatus:t})}).catch(function(t){e({type:we,error:t})}),e({type:ve})}},cr=function(){return function(e){return _t(bt.fix()).then(function(t){e({type:Oe,pluginStatus:t})}).catch(function(t){e({type:we,error:t})}),e({type:ve})}},sr=function(e){var t=e.title,n=e.url,r=void 0!==n&&n;return x.a.createElement("tr",null,x.a.createElement("th",null,!r&&t,r&&x.a.createElement("a",{href:r,target:"_blank"},t)),x.a.createElement("td",null,e.children))},pr=function(e){return x.a.createElement("table",{className:"form-table"},x.a.createElement("tbody",null,e.children))};function fr(e){return(fr="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})(e)}var dr=function e(t){var n=t.value,r=t.text;return"object"===fr(n)?x.a.createElement("optgroup",{label:r},n.map(function(t,n){return x.a.createElement(e,{text:t.text,value:t.value,key:n})})):x.a.createElement("option",{value:n},r)},hr=function(e){var t=e.items,n=e.value,r=e.name,o=e.onChange,a=e.isEnabled,i=void 0===a||a;return x.a.createElement("select",{name:r,value:n,onChange:o,disabled:!i},t.map(function(e,t){return x.a.createElement(dr,{value:e.value,text:e.text,key:t})}))};function mr(e){return(mr="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})(e)}function yr(e,t){for(var n=0;n0?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");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gr(e,t)}(t,x.a.Component),function(e,t,n){t&&yr(e.prototype,t),n&&yr(e,n)}(t,[{key:"getSnapshotBeforeUpdate",value:function(e){return e.values.token!==this.props.values.token&&this.setState({token:this.props.values.token}),e.values.auto_target!==this.props.values.auto_target&&this.setState({auto_target:this.props.values.auto_target}),null}},{key:"renderMonitor",value:function(e){return x.a.createElement(sr,{title:Object(P.translate)("URL Monitor Changes")+":",url:this.supportLink("options","monitor")},x.a.createElement(hr,{items:e,name:"monitor_post",value:parseInt(this.state.monitor_post,10),onChange:this.onChange})," ",Object(P.translate)("Save changes to this group"),x.a.createElement("p",null,x.a.createElement("input",{type:"text",className:"regular-text",name:"associated_redirect",onChange:this.onChange,placeholder:Object(P.translate)('For example "/amp"'),value:this.state.associated_redirect})," ",Object(P.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],i=!!n.find(function(e){return e===o});r.push(x.a.createElement("p",{key:o},x.a.createElement("label",null,x.a.createElement("input",{type:"checkbox",name:"monitor_type_"+o,onChange:e.onMonitor,checked:i}),Object(P.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 x.a.createElement("form",{onSubmit:this.onSubmit},x.a.createElement(pr,null,x.a.createElement(sr,{title:""},x.a.createElement("label",null,x.a.createElement("input",{type:"checkbox",checked:this.state.support,name:"support",onChange:this.onChange}),x.a.createElement("span",{className:"sub"},Object(P.translate)("I'm a nice person and I have helped support the author of this plugin")))),x.a.createElement(sr,{title:Object(P.translate)("Redirect Logs")+":",url:this.supportLink("logs")},x.a.createElement(hr,{items:wr(),name:"expire_redirect",value:parseInt(this.state.expire_redirect,10),onChange:this.onChange})," ",Object(P.translate)("(time to keep logs for)")),x.a.createElement(sr,{title:Object(P.translate)("404 Logs")+":",url:this.supportLink("tracking-404-errors")},x.a.createElement(hr,{items:wr(),name:"expire_404",value:parseInt(this.state.expire_404,10),onChange:this.onChange})," ",Object(P.translate)("(time to keep logs for)")),x.a.createElement(sr,{title:Object(P.translate)("IP Logging")+":",url:this.supportLink("options","iplogging")},x.a.createElement(hr,{items:[{value:0,text:Object(P.translate)("No IP logging")},{value:1,text:Object(P.translate)("Full IP logging")},{value:2,text:Object(P.translate)("Anonymize IP (mask last part)")}],name:"ip_logging",value:parseInt(this.state.ip_logging,10),onChange:this.onChange})," ",Object(P.translate)("(select IP logging level)")," - ",x.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:this.supportLink("privacy-gdpr")},Object(P.translate)("GDPR / Privacy information"))),x.a.createElement(sr,{title:Object(P.translate)("URL Monitor")+":",url:this.supportLink("options","monitor")},this.renderPostTypes()),o&&this.renderMonitor(t),x.a.createElement(sr,{title:Object(P.translate)("RSS Token")+":",url:this.supportLink("options","rsstoken")},x.a.createElement("input",{className:"regular-text",type:"text",value:this.state.token,name:"token",onChange:this.onChange}),x.a.createElement("br",null),x.a.createElement("span",{className:"sub"},Object(P.translate)("A unique token allowing feed readers access to Redirection log RSS (leave blank to auto-generate)"))),x.a.createElement(sr,{title:Object(P.translate)("Auto-generate URL")+":",url:this.supportLink("options","autogenerate")},x.a.createElement("input",{className:"regular-text",type:"text",value:this.state.auto_target,name:"auto_target",onChange:this.onChange}),x.a.createElement("br",null),x.a.createElement("span",{className:"sub"},Object(P.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:x.a.createElement("code",null)}}))),x.a.createElement(sr,{title:Object(P.translate)("Apache Module"),url:this.supportLink("options","apache")},x.a.createElement("label",null,x.a.createElement("p",null,x.a.createElement("input",{type:"text",className:"regular-text",name:"location",value:this.state.location,onChange:this.onChange,placeholder:r})),x.a.createElement("p",{className:"sub"},Object(P.translate)("Enter the full path and filename if you want Redirection to automatically update your {{code}}.htaccess{{/code}}.",{components:{code:x.a.createElement("code",null)}})))),x.a.createElement(sr,{title:Object(P.translate)("Force HTTPS"),url:this.supportLink("options","force-https")},x.a.createElement("label",null,x.a.createElement("p",null,x.a.createElement("input",{type:"checkbox",name:"https",onChange:this.onChange,checked:this.state.https}),Object(P.translate)("Force a redirect from HTTP to HTTPS. Please ensure your HTTPS is working before enabling"),"  ",Object(P.translate)("(beta)")))),x.a.createElement(sr,{title:Object(P.translate)("Redirect Cache"),url:this.supportLink("options","cache")},x.a.createElement(hr,{items:[{value:-1,text:Object(P.translate)("Never cache")},{value:1,text:Object(P.translate)("An hour")},{value:24,text:Object(P.translate)("A day")},{value:168,text:Object(P.translate)("A week")},{value:0,text:Object(P.translate)("Forever")}],name:"redirect_cache",value:parseInt(this.state.redirect_cache,10),onChange:this.onChange}),"  ",x.a.createElement("span",{className:"sub"},Object(P.translate)('How long to cache redirected 301 URLs (via "Expires" HTTP header)'))),x.a.createElement(sr,{title:Object(P.translate)("REST API"),url:this.supportLink("options","restapi")},x.a.createElement(hr,{items:Or(),name:"rest_api",value:parseInt(this.state.rest_api,10),onChange:this.onChange}),"  ",x.a.createElement("span",{className:"sub"},Object(P.translate)("How Redirection uses the REST API - don't change unless necessary")))),x.a.createElement("input",{className:"button-primary",type:"submit",name:"update",value:Object(P.translate)("Update"),disabled:n===ke}))}}]),t}();var Sr=he(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(ir(t))}}})(_r),xr=n(3),kr=n.n(xr);n(45);function jr(e){return(jr="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})(e)}function Cr(e,t){for(var n=0;n=t[n][0])return t[n][1];return t[t.length-1][1]}},{key:"renderSupported",value:function(){return x.a.createElement("div",null,Object(P.translate)("You've supported this plugin - thank you!"),"  ",x.a.createElement("a",{href:"#",onClick:this.onDonate},Object(P.translate)("I'd like to support some more.")))}},{key:"renderUnsupported",value:function(){for(var e=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},16,""),t=20;t<=100;t+=20)e[t]="";return x.a.createElement("div",null,x.a.createElement("label",null,x.a.createElement("p",null,Object(P.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:x.a.createElement("strong",null)}})," ",Object(P.translate)("You get useful software and I get to carry on making it better."))),x.a.createElement("input",{type:"hidden",name:"cmd",value:"_xclick"}),x.a.createElement("input",{type:"hidden",name:"business",value:"admin@urbangiraffe.com"}),x.a.createElement("input",{type:"hidden",name:"item_name",value:"Redirection (WordPress Plugin)"}),x.a.createElement("input",{type:"hidden",name:"buyer_credit_promo_code",value:""}),x.a.createElement("input",{type:"hidden",name:"buyer_credit_product_category",value:""}),x.a.createElement("input",{type:"hidden",name:"buyer_credit_shipping_method",value:""}),x.a.createElement("input",{type:"hidden",name:"buyer_credit_user_address_change",value:""}),x.a.createElement("input",{type:"hidden",name:"no_shipping",value:"1"}),x.a.createElement("input",{type:"hidden",name:"return",value:this.getReturnUrl()}),x.a.createElement("input",{type:"hidden",name:"no_note",value:"1"}),x.a.createElement("input",{type:"hidden",name:"currency_code",value:"USD"}),x.a.createElement("input",{type:"hidden",name:"tax",value:"0"}),x.a.createElement("input",{type:"hidden",name:"lc",value:"US"}),x.a.createElement("input",{type:"hidden",name:"bn",value:"PP-DonationsBF"}),x.a.createElement("div",{className:"donation-amount"},"$",x.a.createElement("input",{type:"number",name:"amount",min:16,value:this.state.amount,onChange:this.onInput,onBlur:this.onBlur}),x.a.createElement("span",null,this.getAmountoji(this.state.amount)),x.a.createElement("input",{type:"submit",className:"button-primary",value:Object(P.translate)("Support 💰")})))}},{key:"render",value:function(){var e=this.state.support;return x.a.createElement("form",{action:"https://www.paypal.com/cgi-bin/webscr",method:"post",className:"donation"},x.a.createElement(pr,null,x.a.createElement(sr,{title:Object(P.translate)("Plugin Support")+":"},e?this.renderSupported():this.renderUnsupported())))}}]),t}();function Kr(e){return(Kr="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})(e)}function Yr(e,t){for(var n=0;n0&&x.a.createElement(Oo,null))},xo=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=vo(this,Eo(t).call(this,e))).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");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wo(e,t)}(t,x.a.Component),function(e,t,n){t&&go(e.prototype,t),n&&go(e,n)}(t,[{key:"render",value:function(){var e=this.props.pluginStatus;return x.a.createElement("div",null,x.a.createElement("h2",null,Object(P.translate)("Plugin Status")),e.length>0&&x.a.createElement(So,{status:e}),0===e.length&&x.a.createElement("div",{className:"placeholder-inline"},x.a.createElement("div",{className:"placeholder-loading"})))}}]),t}();var ko=he(function(e){return{pluginStatus:e.settings.pluginStatus}},function(e){return{onLoadStatus:function(){e(ur())},onFix:function(){e(cr())}}})(xo);function jo(e){return(jo="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})(e)}function Co(e,t){for(var n=0;n0&&(p=x.a.createElement(Fo,{rows:r,status:i,selected:a.selected,row:n})),x.a.createElement("table",{className:"wp-list-table widefat fixed striped items"},x.a.createElement("thead",null,x.a.createElement(Uo,{table:a,isDisabled:c,isSelected:s,headers:t,rows:r,total:o,onSetOrderBy:u,onSetAllSelected:l})),p,x.a.createElement("tfoot",null,x.a.createElement(Uo,{table:a,isDisabled:c,isSelected:s,headers:t,rows:r,total:o,onSetOrderBy:u,onSetAllSelected:l})))});function $o(e){return($o="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})(e)}function Ho(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qo(e,t){for(var n=0;n0,onClick:this.onFirst})," ",x.a.createElement(Zo,{title:Object(P.translate)("Prev page"),button:"‹",className:"prev-page",enabled:e>0,onClick:this.onPrev}),x.a.createElement("span",{className:"paging-input"},x.a.createElement("label",{htmlFor:"current-page-selector",className:"screen-reader-text"},Object(P.translate)("Current Page"))," ",x.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}),x.a.createElement("span",{className:"tablenav-paging-text"},Object(P.translate)("of %(page)s",{components:{total:x.a.createElement("span",{className:"total-pages"})},args:{page:Object(P.numberFormat)(t)}})))," ",x.a.createElement(Zo,{title:Object(P.translate)("Next page"),button:"›",className:"next-page",enabled:e0&&x.a.createElement(ta,{per_page:n.per_page,page:n.page,total:t,onChangePage:this.props.onChangePage,inProgress:o===ke}))}}]),t}();function ua(e){return(ua="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})(e)}function ca(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Ca(e)},Ta=function(e,t){return Ca({orderby:e,direction:t})},Da=function(e){return Ca({page:e})},Na=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Ca({filter:e,filterBy:""===e?"":t,page:0,orderby:""})},Ra=function(e,t){return Ca({filterBy:e,filter:t,orderby:"",page:0})},Aa=function(e){return{type:Ie,items:e.map(parseInt)}},Ia=function(e){return{type:Le,onoff:e}},La=function(e){return Ca(e)},Ua=(n(63),function(){return x.a.createElement("div",{className:"redirection-poweredby"},Object(P.translate)("Powered by {{link}}redirect.li{{/link}}",{components:{link:x.a.createElement("a",{href:"https://redirect.li",target:"_blank",rel:"noopener noreferrer"})}}))});n(65);function Fa(e){return(Fa="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})(e)}function Ma(e,t){for(var n=0;n0},x.a.createElement(Ea,{logType:"log"}),x.a.createElement("button",{className:"button-secondary",onClick:this.handleRSS},"RSS"),x.a.createElement(va,{onDelete:this.props.onDeleteAll,table:r}))))}}]),t}();var hi=he(function(e){return{log:e.log}},function(e){return{onLoad:function(t){e(Pa(t))},onDeleteAll:function(t,n){e(ka(t,n))},onSearch:function(t,n){e(Na(t,n))},onChangePage:function(t){e(Da(t))},onTableAction:function(t){e(ja(t))},onSetAllSelected:function(t){e(Ia(t))},onSetOrderBy:function(t,n){e(Ta(t,n))}}})(di);function mi(e){return(mi="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})(e)}function yi(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Ci(e)},Ti=function(e,t){return Ci({orderby:e,direction:t})},Di=function(e){return Ci({page:e})},Ni=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Ci({filter:e,filterBy:""===e?"":t,page:0,orderby:""})},Ri=function(e,t){return Ci({filter:e,filterBy:t,page:0,orderby:"",groupBy:""})},Ai=function(e,t){return Ci({filterBy:e,filter:t,orderby:"",page:0})},Ii=function(e){return{type:Kt,items:e}},Li=function(e){return{type:Yt,onoff:e}},Ui=function(e){return Ci({groupBy:e,page:0,orderby:"total",direction:"desc",filterBy:"",filter:""})},Fi=function(e){return Ci(e)},Mi=function(e){var t=e.url;if(t){var n=wa.parse(t).hostname;return x.a.createElement("a",{href:t,rel:"noreferrer noopener",target:"_blank"},n)}return null};function Bi(e){return(Bi="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})(e)}function zi(e,t){for(var n=0;n0?u:p[0].id,action_code:n.getCode()?parseInt(c,10):0,action_data:_u(n.state)};f.id?n.props.onSave(f.id,f):n.props.onCreate(f),n.props.onCancel?n.props.onCancel(e):n.reset(),n.props.childSave&&n.props.childSave()}),Du(Tu(Tu(n)),"onAdvanced",function(e){e.preventDefault(),n.setState({advanced:!n.state.advanced},n.triggerCallback)}),Du(Tu(Tu(n)),"onGroup",function(e){n.setState({group_id:parseInt(e.target.value,10)})}),Du(Tu(Tu(n)),"onChange",function(e){var t=e.target,r="checkbox"===t.type?t.checked:t.value,o=Du({},t.name,r);"action_type"===t.name?t.value===yu?o.action_code=301:t.value===bu&&(o.action_code=404):"match_type"===t.name&&(o=ku({},o,n.resetActionData()),t.value===Eu&&(o.action_type=yu)),n.setState(o,n.triggerCallback)}),Du(Tu(Tu(n)),"triggerCallback",function(){n.props.callback&&n.props.callback(n.ref.current.clientHeight)});var r=e.item,o=r.url,a=r.regex,i=r.match_type,l=r.action_type,u=r.action_data,c=r.group_id,s=void 0===c?0:c,p=r.title,f=r.action_code,d=r.position,h=void 0===d?0:d,m=u||{},y=m.logged_in,b=void 0===y?"":y,g=m.logged_out,v=void 0===g?"":g;return n.state={url:o,title:p,regex:a,match_type:i,action_type:l,action_code:f,action_data:u,group_id:n.getValidGroup(s),position:h,login:{logged_in:b,logged_out:v},target:u||{},agent:n.getAgentState(u),referrer:n.getReferrerState(u),cookie:n.getHeaderState(u),header:n.getHeaderState(u),custom:n.getCustomState(u),role:n.getRoleState(u),server:n.getServerState(u),ip:n.getIpState(u),page:n.getPageState(u)},n.state.advanced=!n.canShowAdvanced(),n.ref=x.a.createRef(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pu(e,t)}(t,x.a.Component),function(e,t,n){t&&ju(e.prototype,t),n&&ju(e,n)}(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(ku({url:"",regex:!1,match_type:vu,action_type:yu,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:""},ip:{ip:[],url_from:"",url_notfrom:""},page:{page:"404",url:""}}}},{key:"canShowAdvanced",value:function(){var e=this.state,t=e.match_type,n=e.action_type;return t===vu&&n===yu}},{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,u=t.url_notfrom;return{agent:r,regex:a,url_from:l,url_notfrom:void 0===u?"":u}}},{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,u=t.url_notfrom;return{referrer:r,regex:a,url_from:l,url_notfrom:void 0===u?"":u}}},{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:"getIpState",value:function(e){var t=e||{},n=t.ip,r=void 0===n?[]:n,o=t.url_from,a=void 0===o?"":o,i=t.url_notfrom;return{ip:r,url_from:a,url_notfrom:void 0===i?"":i}}},{key:"getPageState",value:function(e){var t=e||{},n=t.page,r=void 0===n?"404":n,o=t.url;return{page:r,url:void 0===o?"":o}}},{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,u=t.url_from,c=void 0===u?"":u,s=t.url_notfrom;return{name:r,value:a,regex:l,url_from:c,url_notfrom:void 0===s?"":s}}},{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 this.state.action_type===bu?x.a.createElement("select",{name:"action_code",value:this.state.action_code,onChange:this.onChange},[{value:400,name:Object(P.translate)("400 - Bad Request")},{value:401,name:Object(P.translate)("401 - Unauthorized")},{value:403,name:Object(P.translate)("403 - Forbidden")},{value:404,name:Object(P.translate)("404 - Not Found")},{value:410,name:Object(P.translate)("410 - Gone")},{value:418,name:Object(P.translate)("418 - I'm a teapot")}].map(function(e){return x.a.createElement("option",{key:e.value,value:e.value},e.name)})):this.state.action_type===yu||"random"===this.state.action_type?x.a.createElement("select",{name:"action_code",value:this.state.action_code,onChange:this.onChange},[{value:301,name:Object(P.translate)("301 - Moved Permanently")},{value:302,name:Object(P.translate)("302 - Found")},{value:303,name:Object(P.translate)("303 - See Other")},{value:304,name:Object(P.translate)("304 - Not Modified")},{value:307,name:Object(P.translate)("307 - Temporary Redirect")},{value:308,name:Object(P.translate)("308 - Permanent Redirect")}].map(function(e){return x.a.createElement("option",{key:e.value,value:e.value},e.name)})):null}},{key:"getMatchExtra",value:function(){var e=this.state,t=e.match_type,n=e.agent,r=e.referrer,o=e.cookie,a=e.header,i=e.custom,l=e.role,u=e.server,c=e.ip,s=e.page;switch(t){case"agent":return x.a.createElement(Hi,{agent:n.agent,regex:n.regex,onChange:this.onSetData,onCustomAgent:this.onCustomAgent});case"referrer":return x.a.createElement(Xi,{referrer:r.referrer,regex:r.regex,onChange:this.onSetData});case"cookie":return x.a.createElement(bl,{name:o.name,value:o.value,regex:o.regex,onChange:this.onSetData});case"header":return x.a.createElement(ol,{name:a.name,value:a.value,regex:a.regex,onChange:this.onSetData});case"custom":return x.a.createElement(sl,{filter:i.filter,onChange:this.onSetData});case"role":return x.a.createElement(_l,{role:l.role,onChange:this.onSetData});case"server":return x.a.createElement(Pl,{server:u.server,onChange:this.onSetData});case wu:return x.a.createElement(Il,{ip:c.ip,onChange:this.onSetData});case"page":return x.a.createElement(zl,{page:s.page,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,i=e.cookie,l=e.target,u=e.header,c=e.custom,s=e.role,p=e.server,f=e.ip,d=e.page;if(!Ou(n))return null;switch(t){case"agent":return x.a.createElement(eu,{url_from:r.url_from,url_notfrom:r.url_notfrom,target:"agent",onChange:this.onSetData});case"referrer":return x.a.createElement(eu,{url_from:o.url_from,url_notfrom:o.url_notfrom,target:"referrer",onChange:this.onSetData});case Eu:return x.a.createElement(Vl,{logged_in:a.logged_in,logged_out:a.logged_out,onChange:this.onSetData});case vu:return x.a.createElement(Kl,{url:l.url,target:"target",onChange:this.onSetData});case"cookie":return x.a.createElement(eu,{url_from:i.url_from,url_notfrom:i.url_notfrom,target:"cookie",onChange:this.onSetData});case"header":return x.a.createElement(eu,{url_from:u.url_from,url_notfrom:u.url_notfrom,target:"header",onChange:this.onSetData});case"custom":return x.a.createElement(eu,{url_from:c.url_from,url_notfrom:c.url_notfrom,target:"custom",onChange:this.onSetData});case"role":return x.a.createElement(eu,{url_from:s.url_from,url_notfrom:s.url_notfrom,target:"role",onChange:this.onSetData});case"server":return x.a.createElement(eu,{url_from:p.url_from,url_notfrom:p.url_notfrom,target:"server",onChange:this.onSetData});case wu:return x.a.createElement(eu,{url_from:f.url_from,url_notfrom:f.url_notfrom,target:"ip",onChange:this.onSetData});case"page":return x.a.createElement(Kl,{url:d.url,target:"page",onChange:this.onSetData})}return null}},{key:"getTitle",value:function(){var e=this.state.title;return x.a.createElement("tr",null,x.a.createElement("th",null,Object(P.translate)("Title")),x.a.createElement("td",null,x.a.createElement("input",{type:"text",name:"title",value:e,onChange:this.onChange,placeholder:Object(P.translate)("Describe the purpose of this redirect (optional)")})))}},{key:"getMatch",value:function(){var e=this.state.match_type;return x.a.createElement("tr",null,x.a.createElement("th",null,Object(P.translate)("Match")),x.a.createElement("td",null,x.a.createElement("select",{name:"match_type",value:e,onChange:this.onChange},[{value:vu,name:Object(P.translate)("URL only")},{value:Eu,name:Object(P.translate)("URL and login status")},{value:"role",name:Object(P.translate)("URL and role/capability")},{value:"referrer",name:Object(P.translate)("URL and referrer")},{value:"agent",name:Object(P.translate)("URL and user agent")},{value:"cookie",name:Object(P.translate)("URL and cookie")},{value:wu,name:Object(P.translate)("URL and IP")},{value:"server",name:Object(P.translate)("URL and server")},{value:"header",name:Object(P.translate)("URL and HTTP header")},{value:"custom",name:Object(P.translate)("URL and custom filter")},{value:"page",name:Object(P.translate)("URL and WordPress page type")}].map(function(e){return x.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 x.a.createElement("tr",null,x.a.createElement("th",null,Object(P.translate)("When matched")),x.a.createElement("td",{className:"edit-left"},x.a.createElement("select",{name:"action_type",value:t,onChange:this.onChange},[{value:yu,name:Object(P.translate)("Redirect to URL")},{value:"random",name:Object(P.translate)("Redirect to random post")},{value:"pass",name:Object(P.translate)("Pass-through")},{value:bu,name:Object(P.translate)("Error (404)")},{value:gu,name:Object(P.translate)("Do nothing (ignore)")}].filter(function(e){return!(n===Eu&&!Ou(e.value))}).map(function(e){return x.a.createElement("option",{value:e.value,key:e.value},e.name)})),r&&x.a.createElement(x.a.Fragment,null,x.a.createElement("strong",{className:"small-flex"},Object(P.translate)("with HTTP code"))," ",x.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 x.a.createElement("tr",null,x.a.createElement("th",null,Object(P.translate)("Group")),x.a.createElement("td",{className:"edit-left"},x.a.createElement(hr,{name:"group",value:t,items:tu(e),onChange:this.onGroup}),r&&x.a.createElement("span",{className:"edit-redirection-position"},x.a.createElement("strong",null,Object(P.translate)("Position")),x.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,u=e.header,c=e.cookie,s=e.role,p=e.server,f=e.ip,d=e.page;if(""===Redirectioni10n.autoGenerate&&""===t)return!1;if(Ou(o)){if(n===vu&&""===r)return!1;if("referrer"===n&&""===a.url_from&&""===a.url_notfrom)return!1;if(n===Eu&&""===i.logged_in&&""===i.logged_out)return!1;if("agent"===n&&""===l.url_from&&""===l.url_notfrom)return!1;if("cookie"===n&&""===c.url_from&&""===c.url_notfrom)return!1;if("header"===n&&""===u.url_from&&""===u.url_notfrom)return!1;if("role"===n&&""===s.url_from&&""===s.url_notfrom)return!1;if("server"===n&&""===p.url_from&&""===p.url_notfrom)return!1;if(n===wu&&""===f.url_from&&""===f.url_notfrom)return!1;if("page"===n&&""===d.url)return!1}return!0}},{key:"renderExtra",value:function(){return x.a.createElement(x.a.Fragment,null,this.getTitle(),this.getMatch(),this.getMatchExtra(),this.getTargetCode())}},{key:"renderSingleUrl",value:function(){var e=this.state,t=e.url,n=e.regex,r=this.props.autoFocus,o=void 0!==r&&r;return x.a.createElement(x.a.Fragment,null,x.a.createElement("input",{type:"text",name:"url",value:t,onChange:this.onChange,autoFocus:o,placeholder:Object(P.translate)("The relative URL you want to redirect from")}),x.a.createElement("label",{className:"edit-redirection-regex"},Object(P.translate)("Regex")," ",x.a.createElement("sup",null,x.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",x.a.createElement("input",{type:"checkbox",name:"regex",checked:n,onChange:this.onChange})))}},{key:"renderMultiUrl",value:function(){var e=this.state.url;return x.a.createElement("textarea",{value:e.join("\n"),readOnly:!0})}},{key:"render",value:function(){var e=this.state,t=e.url,n=e.advanced,r=this.props,o=r.saveButton,a=void 0===o?Object(P.translate)("Save"):o,i=r.onCancel,l=r.addTop,u=r.onClose;return x.a.createElement("form",{onSubmit:this.onSave,ref:this.ref},x.a.createElement("table",{className:"edit edit-redirection"},x.a.createElement("tbody",null,x.a.createElement("tr",null,x.a.createElement("th",{className:Array.isArray(t)?"top":""},Object(P.translate)("Source URL")),x.a.createElement("td",null,Array.isArray(t)?this.renderMultiUrl():this.renderSingleUrl())),n&&this.renderExtra(),this.getTarget(),this.getGroup(),this.props.children&&this.props.children,x.a.createElement("tr",null,x.a.createElement("th",null),x.a.createElement("td",{className:"edit-left"},x.a.createElement("div",{className:"table-actions"},x.a.createElement("input",{className:"button-primary",type:"submit",name:"save",value:a,disabled:!this.canSave()}),"  ",i&&x.a.createElement("input",{className:"button-secondary",type:"submit",name:"cancel",value:Object(P.translate)("Cancel"),onClick:i}),l&&!i&&x.a.createElement("input",{className:"button-secondary",type:"submit",name:"cancel",value:Object(P.translate)("Close"),onClick:u})," ",this.canShowAdvanced()&&x.a.createElement("a",{href:"#",onClick:this.onAdvanced,className:"advanced",title:Object(P.translate)("Show advanced options")},"⚙")))))))}}]),t}();var Ru=he(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(au(t,n))},onCreate:function(t){e(ou(t))},onClose:function(t){t.preventDefault(),e(hu(!1))}}})(Nu);function Au(e){return(Au="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})(e)}function Iu(e,t){for(var n=0;n1&&(o.url=r),x.a.createElement(Ar,{onClose:t,width:"700",height:this.state.height},x.a.createElement("div",{className:"add-new"},x.a.createElement(Ru,{item:o,saveButton:Object(P.translate)("Add Redirect"),onCancel:t,childSave:this.onDelete,autoFocus:!0,callback:this.setHeight},x.a.createElement("tr",null,x.a.createElement("th",null,Object(P.translate)("Delete Log Entries")),x.a.createElement("td",{className:"edit-left",style:{padding:"7px 0px"}},x.a.createElement("label",null,x.a.createElement("input",{type:"checkbox",name:"delete_log",checked:this.state.deleteLog,onChange:this.onDeleteLog}),1===r.length?Object(P.translate)("Delete all logs for this entry"):Object(P.translate)("Delete all logs for these entries")))))))}}]),t}();cc(sc,"defaultProps",{transform:null});var pc=he(function(e){return{selected:e.error.table.selected}},function(e){return{onDelete:function(t){e(xi(t))}}})(sc),fc={store:"group",saving:bn,saved:vn,failed:gn,order:"name"},dc={store:"group",saving:fn,saved:dn,failed:hn,order:"name"},hc=function(e){return Tt(ft.create,e,fc)},mc=function(e,t){return Dt(ft.update,e,t,fc)},yc=function(e,t){return Ct(gt.group,e,t,fc)},bc=function(e){return function(t,n){return Rt(ft.list,t,dc,e,n().group)}},gc=function(e,t){return bc({orderby:e,direction:t})},vc=function(e){return bc({page:e})},Ec=function(e){return bc({filter:e,filterBy:"",page:0,orderby:""})},wc=function(e,t){return bc({filterBy:e,filter:t,orderby:"",page:0})},Oc=function(e){return{type:mn,items:e.map(parseInt)}},_c=function(e){return{type:yn,onoff:e}},Sc=function(e){return bc(e)};function xc(e){return(xc="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})(e)}function kc(e,t){for(var n=0;n0},x.a.createElement(Ea,{logType:"404"}),x.a.createElement(va,{onDelete:this.props.onDeleteAll,table:r}))))}}]),t}();var Nc=he(function(e){return{error:e.error}},function(e){return{onLoad:function(){e(Pi())},onLoadGroups:function(){e(bc())},onDeleteAll:function(t,n){e(ki(t,n))},onSearch:function(t,n){e(Ni(t,n))},onChangePage:function(t){e(Di(t))},onTableAction:function(t){e(ji(t,null))},onSetAllSelected:function(t){e(Li(t))},onSetOrderBy:function(t,n){e(Ti(t,n))},onGroup:function(t){e(Ui(t))},onSetSelected:function(t){e(Ii(t))}}})(Dc),Rc=n(22),Ac=n.n(Rc),Ic=("function"==typeof Symbol&&Symbol.iterator,"undefined"==typeof document||!document||!document.createElement||"multiple"in document.createElement("input"));function Lc(e,t){return"application/x-moz-file"===e.type||Ac()(e,t)}function Uc(e){return!e.dataTransfer||Array.prototype.every.call(e.dataTransfer.types,function(e){return"Files"===e||"application/x-moz-file"===e})}function Fc(e){e.preventDefault()}var Mc={borderStyle:"solid",backgroundColor:"#eee"},Bc={borderStyle:"solid",borderColor:"#6c6",backgroundColor:"#eee"},zc={borderStyle:"solid",borderColor:"#c66",backgroundColor:"#eee"},Gc={width:200,height:200,borderWidth:2,borderColor:"#666",borderStyle:"dashed",borderRadius:5},Wc={opacity:.5},$c=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var Vc=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($c({},r.state,{isDragActive:t,isDragAccept:n,isDragReject:o,open:r.open})):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.open=r.open.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,x.a.Component),Hc(t,[{key:"componentDidMount",value:function(){var e=this.props.preventDropOnDocument;this.dragTargets=[],e&&(document.addEventListener("dragover",Fc,!1),document.addEventListener("drop",this.onDocumentDrop,!1)),null!=this.fileInputEl&&this.fileInputEl.addEventListener("click",this.onInputElementClick,!1),window.addEventListener("focus",this.onFileDialogCancel,!1)}},{key:"componentWillUnmount",value:function(){this.props.preventDropOnDocument&&(document.removeEventListener("dragover",Fc),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){e.persist(),this.props.onDragStart&&Uc(e)&&this.props.onDragStart.call(this,e)}},{key:"onDragEnter",value:function(e){var t=this;e.preventDefault(),-1===this.dragTargets.indexOf(e.target)&&this.dragTargets.push(e.target),e.persist(),Uc(e)&&(Promise.resolve(this.props.getDataTransferItems(e)).then(function(n){e.isPropagationStopped()||t.setState({draggedFiles:n,isDragActive:!0})}),this.props.onDragEnter&&this.props.onDragEnter.call(this,e))}},{key:"onDragOver",value:function(e){e.preventDefault(),e.persist();try{e.dataTransfer.dropEffect=this.isFileDialogActive?"none":"copy"}catch(e){}return this.props.onDragOver&&Uc(e)&&this.props.onDragOver.call(this,e),!1}},{key:"onDragLeave",value:function(e){var t=this;e.preventDefault(),e.persist(),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&&Uc(e)&&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.accept,u=n.getDataTransferItems;e.preventDefault(),e.persist(),this.dragTargets=[],this.isFileDialogActive=!1,this.draggedFiles=null,this.setState({isDragActive:!1,draggedFiles:[]}),Uc(e)&&Promise.resolve(u(e)).then(function(n){var u=[],c=[];e.isPropagationStopped()||(n.forEach(function(e){Lc(e,l)&&function(e,t,n){return e.size<=t&&e.size>=n}(e,t.props.maxSize,t.props.minSize)?u.push(e):c.push(e)}),!i&&u.length>1&&c.push.apply(c,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&a&&a.call(t,c,e),u.length>0&&o&&o.call(t,u,e)}))})}},{key:"onClick",value:function(e){var t=this.props,n=t.onClick,r=t.disableClick;n&&n.call(this,e),r||e.isDefaultPrevented()||(e.stopPropagation(),!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,0))}},{key:"onInputElementClick",value:function(e){e.stopPropagation(),this.props.inputProps&&this.props.inputProps.onClick&&this.props.inputProps.onClick(e)}},{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,i=e.disabledClassName,l=e.inputProps,u=e.multiple,c=e.name,s=e.rejectClassName,p=qc(e,["accept","acceptClassName","activeClassName","children","disabled","disabledClassName","inputProps","multiple","name","rejectClassName"]),f=p.acceptStyle,d=p.activeStyle,h=p.className,m=void 0===h?"":h,y=p.disabledStyle,b=p.rejectStyle,g=p.style,v=qc(p,["acceptStyle","activeStyle","className","disabledStyle","rejectStyle","style"]),E=this.state,w=E.isDragActive,O=E.draggedFiles,_=O.length,S=u||_<=1,k=_>0&&function(e,t){return e.every(function(e){return Lc(e,t)})}(O,this.props.accept),j=_>0&&(!k||!S),C=!(m||g||d||f||b||y);w&&r&&(m+=" "+r),k&&n&&(m+=" "+n),j&&s&&(m+=" "+s),a&&i&&(m+=" "+i),C&&(g=Gc,d=Mc,f=Bc,b=zc,y=Wc);var P=$c({position:"relative"},g);d&&w&&(P=$c({},P,d)),f&&k&&(P=$c({},P,f)),b&&j&&(P=$c({},P,b)),y&&a&&(P=$c({},P,y));var T={accept:t,disabled:a,type:"file",style:$c({position:"absolute",top:0,right:0,bottom:0,left:0,opacity:1e-5,pointerEvents:"none"},l.style),multiple:Ic&&u,ref:this.setRefs,onChange:this.onDrop,autoComplete:"off"};c&&c.length&&(T.name=c);v.acceptedFiles,v.preventDropOnDocument,v.disableClick,v.onDropAccepted,v.onDropRejected,v.onFileDialogCancel,v.maxSize,v.minSize,v.getDataTransferItems;var D=qc(v,["acceptedFiles","preventDropOnDocument","disableClick","onDropAccepted","onDropRejected","onFileDialogCancel","maxSize","minSize","getDataTransferItems"]);return x.a.createElement("div",$c({className:m,style:P},D,{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,w,k,j),x.a.createElement("input",$c({},l,T)))}}]),t}(),Kc=Vc;Vc.propTypes={accept:R.a.oneOfType([R.a.string,R.a.arrayOf(R.a.string)]),children:R.a.oneOfType([R.a.node,R.a.func]),disableClick:R.a.bool,disabled:R.a.bool,preventDropOnDocument:R.a.bool,inputProps:R.a.object,multiple:R.a.bool,name:R.a.string,maxSize:R.a.number,minSize:R.a.number,className:R.a.string,activeClassName:R.a.string,acceptClassName:R.a.string,rejectClassName:R.a.string,disabledClassName:R.a.string,style:R.a.object,activeStyle:R.a.object,acceptStyle:R.a.object,rejectStyle:R.a.object,disabledStyle:R.a.object,getDataTransferItems:R.a.func,onClick:R.a.func,onDrop:R.a.func,onDropAccepted:R.a.func,onDropRejected:R.a.func,onDragStart:R.a.func,onDragEnter:R.a.func,onDragOver:R.a.func,onDragLeave:R.a.func,onFileDialogCancel:R.a.func},Vc.defaultProps={preventDropOnDocument:!0,disabled:!1,disableClick:!1,inputProps:{},multiple:!0,maxSize:1/0,minSize:0,getDataTransferItems:function(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)}};var Yc=function(e,t){return function(n){return _t(yt.file(e,t)).then(function(e){n({type:tn,data:e.data})}).catch(function(e){n({type:an,error:e})}),n({type:nn})}},Qc=function(e){return document.location.href=e,{type:"NOTHING"}},Xc=function(e,t){return function(n){return _t(mt.upload(t,e)).then(function(e){n({type:on,total:e.imported})}).catch(function(e){n({type:an,error:e})}),n({type:rn,file:e})}},Jc=function(){return{type:ln}},Zc=function(e){return{type:un,file:e}},es=function(){return function(e){_t(mt.pluginList()).then(function(t){e({type:cn,importers:t.importers})}).catch(function(t){e({type:an,error:t})})}},ts=function(e){return function(t){return _t(mt.pluginImport(e)).then(function(e){t({type:on,total:e.imported})}).catch(function(e){t({type:an,error:e})}),t({type:rn})}},ns=function(e){var t=e.plugin,n=e.doImport,r=t.name,o=t.total;return x.a.createElement("div",{className:"plugin-importer"},x.a.createElement("p",null,x.a.createElement("strong",null,r)," (",Object(P.translate)("total = ")+o," )"),x.a.createElement("button",{onClick:function(){n(t)},className:"button-secondary"},Object(P.translate)("Import from %s",{args:r})))};n(69);function rs(e){return(rs="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})(e)}function os(e,t){for(var n=0;n0&&t!==ke&&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 x.a.createElement("div",{className:"groups"},Object(P.translate)("Import to group")," ",x.a.createElement(hr,{items:tu(e),name:"group",value:this.state.group,onChange:this.handleInput}))}},{key:"renderInitialDrop",value:function(){return x.a.createElement("div",null,x.a.createElement("h3",null,Object(P.translate)("Import a CSV, .htaccess, or JSON file.")),x.a.createElement("p",null,Object(P.translate)("Click 'Add File' or drag and drop here.")),x.a.createElement("button",{type:"button",className:"button-secondary",onClick:this.handleOpen},Object(P.translate)("Add File")))}},{key:"renderDropBeforeUpload",value:function(){var e=this.props.io.file,t="application/json"===e.type;return x.a.createElement("div",null,x.a.createElement("h3",null,Object(P.translate)("File selected")),x.a.createElement("p",null,x.a.createElement("code",null,e.name)),!t&&this.renderGroupSelect(),x.a.createElement("button",{className:"button-primary",onClick:this.handleImport},Object(P.translate)("Upload")),"  ",x.a.createElement("button",{className:"button-secondary",onClick:this.handleCancel},Object(P.translate)("Cancel")))}},{key:"renderUploading",value:function(){var e=this.props.io.file;return x.a.createElement("div",null,x.a.createElement("h3",null,Object(P.translate)("Importing")),x.a.createElement("p",null,x.a.createElement("code",null,e.name)),x.a.createElement("div",{className:"is-placeholder"},x.a.createElement("div",{className:"placeholder-loading"})))}},{key:"renderUploaded",value:function(){var e=this.props.io.lastImport;return x.a.createElement("div",null,x.a.createElement("h3",null,Object(P.translate)("Finished importing")),x.a.createElement("p",null,Object(P.translate)("Total redirects imported:")," ",e),0===e&&x.a.createElement("p",null,Object(P.translate)("Double-check the file is the correct format!")),x.a.createElement("button",{className:"button-secondary",onClick:this.handleCancel},Object(P.translate)("OK")))}},{key:"renderDropzoneContent",value:function(){var e=this.props.io,t=e.importingStatus,n=e.lastImport,r=e.file;return t===ke?this.renderUploading():t===Ce&&!1!==n&&!1===r?this.renderUploaded():!1===r?this.renderInitialDrop():this.renderDropBeforeUpload()}},{key:"renderExport",value:function(e){return x.a.createElement("div",null,x.a.createElement("textarea",{className:"module-export",rows:"14",readOnly:!0,value:e}),x.a.createElement("input",{className:"button-secondary",type:"submit",value:Object(P.translate)("Close"),onClick:this.handleCancel}))}},{key:"renderExporting",value:function(){return x.a.createElement("div",{className:"loader-wrapper loader-textarea"},x.a.createElement("div",{className:"placeholder-loading"}))}},{key:"renderImporters",value:function(e){var t=this;return x.a.createElement("div",null,x.a.createElement("h3",null,Object(P.translate)("Plugin Importers")),x.a.createElement("p",null,Object(P.translate)("The following redirect plugins were detected on your site and can be imported from.")),e.map(function(e,n){return x.a.createElement(ns,{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,i=t.importers,l=kr()({dropzone:!0,"dropzone-dropped":!1!==r,"dropzone-importing":n===ke,"dropzone-hover":e});return x.a.createElement("div",{className:"import"},x.a.createElement("h2",null,Object(P.translate)("Import")),x.a.createElement(Kc,{ref:this.setDropzone,onDrop:this.handleDrop,onDragLeave:this.handleLeave,onDragEnter:this.handleEnter,className:l,disableClick:!0,multiple:!1},this.renderDropzoneContent()),x.a.createElement("p",null,Object(P.translate)("All imports will be appended to the current database.")),x.a.createElement("div",{className:"inline-notice notice-warning"},x.a.createElement("p",null,Object(P.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:x.a.createElement("code",null),strong:x.a.createElement("strong",null)}}))),x.a.createElement("h2",null,Object(P.translate)("Export")),x.a.createElement("p",null,Object(P.translate)("Export to CSV, Apache .htaccess, Nginx, or Redirection JSON (which contains all redirects and groups).")),x.a.createElement("select",{name:"module",onChange:this.handleInput,value:this.state.module},x.a.createElement("option",{value:"0"},Object(P.translate)("Everything")),x.a.createElement("option",{value:"1"},Object(P.translate)("WordPress redirects")),x.a.createElement("option",{value:"2"},Object(P.translate)("Apache redirects")),x.a.createElement("option",{value:"3"},Object(P.translate)("Nginx redirects"))),x.a.createElement("select",{name:"format",onChange:this.handleInput,value:this.state.format},x.a.createElement("option",{value:"csv"},Object(P.translate)("CSV")),x.a.createElement("option",{value:"apache"},Object(P.translate)("Apache .htaccess")),x.a.createElement("option",{value:"nginx"},Object(P.translate)("Nginx rewrite rules")),x.a.createElement("option",{value:"json"},Object(P.translate)("Redirection JSON")))," ",x.a.createElement("button",{className:"button-primary",onClick:this.handleView},Object(P.translate)("View"))," ",x.a.createElement("button",{className:"button-secondary",onClick:this.handleDownload},Object(P.translate)("Download")),a===ke&&this.renderExporting(),o&&a!==ke&&this.renderExport(o),x.a.createElement("p",null,Object(P.translate)("Log files can be exported from the log pages.")),i.length>0&&this.renderImporters(i))}}]),t}();var ss=he(function(e){return{group:e.group,io:e.io}},function(e){return{onLoadGroups:function(){e(bc())},onImport:function(t,n){e(Xc(t,n))},onAddFile:function(t){e(Zc(t))},onClearFile:function(){e(Jc())},onExport:function(t,n){e(Yc(t,n))},onDownloadFile:function(t){e(Qc(t))},onLoadImport:function(){e(es())},pluginImport:function(t){e(ts(t))}}})(cs);function ps(e){return(ps="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})(e)}function fs(e,t){for(var n=0;n0&&window.scrollTo(0,0)}},{key:"dismiss",value:function(){this.props.onClear()}},{key:"getDebug",value:function(e){for(var t=[Redirectioni10n.versions],n=0;n1?e[e.length-1]+" ("+e.length+")":e[0]}},{key:"renderNotice",value:function(e){var t="notice notice-info redirection-notice"+(this.state.shrunk?" redirection-notice_shrunk":"");return x.a.createElement("div",{className:t,onClick:this.onClick},x.a.createElement("div",{className:"closer"},"✔"),x.a.createElement("p",null,this.state.shrunk?x.a.createElement("span",{title:Object(P.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 gp=he(function(e){return{notices:e.message.notices}},function(e){return{onClear:function(){e(rp())}}})(bp);n(77);function vp(e){return(vp="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})(e)}function Ep(e,t){for(var n=0;n1?Object(P.translate)("Saving...")+" ("+e+")":Object(P.translate)("Saving...")}},{key:"renderProgress",value:function(e){return x.a.createElement("div",{className:"notice notice-progress redirection-notice"},x.a.createElement(lo,null),x.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 xp=he(function(e){return{inProgress:e.message.inProgress}},null)(Sp),kp=function(e){var t=e.item,n=e.isCurrent,r=e.onClick,o=Redirectioni10n.pluginRoot+(""===t.value?"":"&sub="+t.value);return x.a.createElement("li",null,x.a.createElement("a",{className:n?"current":"",href:o,onClick:function(e){e.preventDefault(),r(t.value,o)}},t.name))},jp=(n(79),function(e){var t=e.onChangePage,n=He();return x.a.createElement("div",{className:"subsubsub-container"},x.a.createElement("ul",{className:"subsubsub"},[{name:Object(P.translate)("Redirects"),value:""},{name:Object(P.translate)("Groups"),value:"groups"},{name:Object(P.translate)("Log"),value:"log"},{name:Object(P.translate)("404s"),value:"404s"},{name:Object(P.translate)("Import/Export"),value:"io"},{name:Object(P.translate)("Options"),value:"options"},{name:Object(P.translate)("Support"),value:"support"}].map(function(e,r){return x.a.createElement(kp,{key:r,item:e,isCurrent:n===e.value||"redirect"===n&&""===e.value,onClick:t})}).reduce(function(e,t){return[e," | ",t]})))});n(81);function Cp(e){return(Cp="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})(e)}function Pp(e,t){for(var n=0;n0?document.location.href=t:(n.props.onClear(),history.pushState({},null,t),n.changePage(e),n.setState({page:e,clicked:n.state.clicked+1}))}),Rp(Np(Np(n)),"onAdd",function(e){e.preventDefault(),n.props.onAdd()}),n.state={page:He(),clicked:0,stack:!1,error:"3.6.2"!==Redirectioni10n.version,info:!1},window.addEventListener("popstate",n.onPageChanged),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Dp(e,t)}(t,x.a.Component),function(e,t,n){t&&Pp(e.prototype,t),n&&Pp(e,n)}(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:!0,stack:e,info:t})}},{key:"componentWillUnmount",value:function(){window.removeEventListener("popstate",this.onPageChanged)}},{key:"changePage",value:function(e){var t=this.props,n=t.onSet404Table,r=t.onSetLogTable,o=t.onSetRedirectTable,a=t.onSetGroupTable;"404s"===e?n(tr().table):"log"===e?r(er().table):"redirect"===e?o(rr().table):"groups"===e&&a(nr().table)}},{key:"getContent",value:function(e){var t=this.state.clicked;switch(e){case"support":return x.a.createElement(Ro,null);case"404s":return x.a.createElement(Nc,{key:t});case"log":return x.a.createElement(hi,{key:t});case"io":return x.a.createElement(ss,null);case"groups":return x.a.createElement(Rs,{key:t});case"options":return x.a.createElement(eo,null)}return x.a.createElement(tp,{key:t})}},{key:"renderError",value:function(){var e=[Redirectioni10n.versions,"Buster: 3.6.2 === "+Redirectioni10n.version,"",this.state.stack];return this.state.info&&this.state.info.componentStack&&e.push(this.state.info.componentStack),"3.6.2"!==Redirectioni10n.version?x.a.createElement("div",{className:"notice notice-error"},x.a.createElement("h2",null,Object(P.translate)("Cached Redirection detected")),x.a.createElement("p",null,Object(P.translate)("Please clear your browser cache and reload this page.")),x.a.createElement("p",null,Object(P.translate)("If you are using a caching system such as Cloudflare then please read this: "),x.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(P.translate)("clearing your cache."))),x.a.createElement("p",null,x.a.createElement("textarea",{readOnly:!0,rows:e.length+3,cols:"120",value:e.join("\n"),spellCheck:!1}))):x.a.createElement("div",{className:"notice notice-error"},x.a.createElement("h2",null,Object(P.translate)("Something went wrong 🙁")),x.a.createElement("p",null,Object(P.translate)("Redirection is not working. Try clearing your browser cache and reloading this page."),"  ",Object(P.translate)("If you are using a page caching plugin or service (CloudFlare, OVH, etc) then you can also try clearing that cache.")),x.a.createElement("p",null,Object(P.translate)("If that doesn't help, open your browser's error console and create a {{link}}new issue{{/link}} with the details.",{components:{link:x.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/johngodley/redirection/issues"})}})),x.a.createElement("p",null,Object(P.translate)("Please mention {{code}}%s{{/code}}, and explain what you were doing at the time",{components:{code:x.a.createElement("code",null)},args:this.state.page})),x.a.createElement("p",null,x.a.createElement("textarea",{readOnly:!0,rows:e.length+8,cols:"120",value:e.join("\n"),spellCheck:!1})))}},{key:"render",value:function(){var e={redirect:Object(P.translate)("Redirections"),groups:Object(P.translate)("Groups"),io:Object(P.translate)("Import/Export"),log:Object(P.translate)("Logs"),"404s":Object(P.translate)("404 errors"),options:Object(P.translate)("Options"),support:Object(P.translate)("Support")}[this.state.page];return this.state.error?this.renderError():x.a.createElement("div",{className:"wrap redirection"},x.a.createElement("h1",{className:"wp-heading-inline"},e),"redirect"===this.state.page&&x.a.createElement("a",{href:"#",onClick:this.onAdd,className:"page-title-action"},Object(P.translate)("Add New")),x.a.createElement(jp,{onChangePage:this.onChangePage}),x.a.createElement(sp,null),this.getContent(this.state.page),x.a.createElement(xp,null),x.a.createElement(gp,null))}}]),t}();var Ip=he(function(e){return{errors:e.message.errors}},function(e){return{onClear:function(){e(np())},onAdd:function(){e(hu(!0))},onSet404Table:function(t){e(Fi(t))},onSetLogTable:function(t){e(La(t))},onSetGroupTable:function(t){e(Sc(t))},onSetRedirectTable:function(t){e(mu(t))}}})(Ap),Lp=function(){return x.a.createElement(L,{store:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(te.createStore)(Qn,e,Xn(te.applyMiddleware.apply(void 0,Jn)))}(or())},x.a.createElement(Ip,null))};document.querySelector("#react-ui")&&function(e){T.a.setLocale({"":{localeSlug:Redirectioni10n.localeSlug}}),T.a.addTranslations(Redirectioni10n.locale),function(e,t){j.a.render(x.a.createElement(C.AppContainer,null,x.a.createElement(e,null)),document.getElementById(t))}(Lp,e)}("react-ui"),window.redirection=Redirectioni10n.version}]); \ No newline at end of file diff --git a/redirection.php b/redirection.php index a30a4a53..42402078 100644 --- a/redirection.php +++ b/redirection.php @@ -3,7 +3,7 @@ Plugin Name: Redirection Plugin URI: https://redirection.me/ Description: Manage all your 301 redirects and monitor 404 errors -Version: 3.6.1 +Version: 3.6.2 Author: John Godley Author URI: https://johngodley.com Text Domain: redirection