Version Description
(2022/10/12) = * Add: Consider WebP as an "Image" (which it is ). * Fix: The 'Featured Only' and 'Images Only' were not working perfectly. * Update: Optimized the way options are updated and retrieved. * Update: Some refactoring to simplify the code. * Note: Please try my new Database Cleaner! You'll love it.
Download this release
Release Info
Developer | TigrouMeow |
Plugin | Media File Renamer |
Version | 5.4.7 |
Comparing to | |
See all releases |
Code changes from version 5.4.6 to 5.4.7
- app/index.js +1 -1
- media-file-renamer.php +2 -2
- readme.txt +2 -2
app/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
!function(e){function t(t){for(var r,o,l=t[0],i=t[1],s=t[2],m=0,d=[];m<l.length;m++)o=l[m],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&d.push(a[o][0]),a[o]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,s||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],r=!0,l=1;l<n.length;l++){var i=n[l];0!==a[i]&&(r=!1)}r&&(c.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={0:0},c=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var l=window.wpJsonMfrh=window.wpJsonMfrh||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var s=0;s<l.length;s++)t(l[s]);var u=i;c.push([142,1]),n()}({0:function(e,t){e.exports=React},1:function(e,t,n){"use strict";var r=n(15);n.d(t,"b",(function(){return r.a}));var a=n(11);n.d(t,"c",(function(){return a.a}));n(39);var c=n(51);n.d(t,"q",(function(){return c.a}));var o=n(52);n.d(t,"a",(function(){return o.a}));var l=n(53);n.d(t,"g",(function(){return l.a}));var i=n(54);n.d(t,"v",(function(){return i.a}));n(55);var s=n(40);n.d(t,"C",(function(){return s.b})),n.d(t,"f",(function(){return s.a}));var u=n(56);n.d(t,"d",(function(){return u.a}));var m=n(57);n.d(t,"e",(function(){return m.a}));var d=n(18);n.d(t,"k",(function(){return d.a}));n(58);var p=n(41);n.d(t,"u",(function(){return p.b})),n.d(t,"p",(function(){return p.a}));n(59),n(60),n(7),n(42),n(24);var f=n(61);n.d(t,"s",(function(){return f.a}));var h=n(62);n.d(t,"i",(function(){return h.a}));var y=n(25);n.d(t,"r",(function(){return y.a}));var g=n(6);n.d(t,"j",(function(){return g.a}));var b=n(17);n.d(t,"B",(function(){return b.a}));var v=n(43);n.d(t,"t",(function(){return v.b})),n.d(t,"l",(function(){return v.a}));var E=n(63);n.d(t,"h",(function(){return E.a}));var R=n(44);n.d(t,"m",(function(){return R.a})),n.d(t,"n",(function(){return R.b}));n(64),n(26),n(21),n(16),n(65);var w=n(27);n.d(t,"o",(function(){return w.a}));n(70);var _=n(28);n.d(t,"x",(function(){return _.a}));var k=n(46);n.d(t,"y",(function(){return k.b})),n.d(t,"w",(function(){return k.a}));n(47);var x=n(71);n.d(t,"A",(function(){return x.a}));var O=n(3);n.d(t,"z",(function(){return O.a}));var T=n(8);n.d(t,"J",(function(){return T.d})),n.d(t,"H",(function(){return T.b})),n.d(t,"I",(function(){return T.c}));var P=n(12);n.d(t,"G",(function(){return P.d})),n.d(t,"F",(function(){return P.c})),n.d(t,"E",(function(){return P.b})),n.d(t,"D",(function(){return P.a}));n(22)},133:function(e,t){e.exports=ReactDOM},142:function(e,t,n){"use strict";n.r(t);var r=n(13),a=n(1),c=n(4),o=wp.i18n.__,l={};l.RENAME=o("Rename","media-file-renamer"),l.MOVE=o("Move","media-file-renamer"),l.DASHBOARD=o("Dashboard","media-file-renamer"),l.PENDING=o("Pending","media-file-renamer"),l.RENAMED=o("Renamed","media-file-renamer"),l.ALL=o("All","media-file-renamer"),l.THUMB=o("","media-file-renamer"),l.TITLE=o("Title","media-file-renamer"),l.ATTACHED_TO=o("Attached To","media-file-renamer"),l.FILENAME=o("Filename","media-file-renamer");var i,s=l,u=mfrh_media_file_renamer.prefix,m=mfrh_media_file_renamer.domain,d=mfrh_media_file_renamer.rest_url.replace(/\/+$/,""),p=mfrh_media_file_renamer.api_url.replace(/\/+$/,""),f=mfrh_media_file_renamer.plugin_url.replace(/\/+$/,""),h="1"===mfrh_media_file_renamer.is_pro,y=h&&"1"===mfrh_media_file_renamer.is_registered,g=mfrh_media_file_renamer.rest_nonce,b=mfrh_media_file_renamer.options,v="1"===mfrh_media_file_renamer.mfrh_undo,E="1"===mfrh_media_file_renamer.mfrh_move,R="1"===mfrh_media_file_renamer.mfrh_manual_rename;function w(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){w(c,r,a,o,l,"next",e)}function l(e){w(c,r,a,o,l,"throw",e)}o(void 0)}))}}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var O,T,P,A,S,j,C,I=wp.element,D=I.useState,M=I.useEffect,U=c.a.div(i||(O=["\n display: flex;\n flex-direction: column;\n\n .renamer-field {\n display: flex;\n margin-bottom: 5px;\n }\n\n .renamer-actions {\n display: flex;\n align-items: center;\n }\n\n \n @media (min-width: 1400px) {\n flex-direction: row;\n\n .renamer-field {\n flex: auto;\n margin-right: 5px;\n margin-bottom: 0;\n }\n }\n"],T||(T=O.slice(0)),i=Object.freeze(Object.defineProperties(O,{raw:{value:Object.freeze(T)}})))),B=function(e){var t=e.mutate,n=k(D(e.entry),2),r=n[0],c=n[1],o=k(D(!1),2),l=o[0],i=o[1],u=k(D(""),2),m=u[0],d=u[1],f=k(D(null),2),h=f[0],y=f[1],b=e.natural,w=void 0!==b&&b,x=Object(a.I)({concurrency:2}).runTask;M((function(){d(""),e.entry?c(e.entry):e.mediaId&&O(e.mediaId)}),[e.entry]);var O=function(){var e=_(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i((function(e){return e+1})),e.next=3,x(_(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(a.G)("".concat(p,"/analyze"),{nonce:g,json:{mediaId:t}}));case 1:case"end":return e.stop()}}),e)}))));case 3:n=e.sent,c(n.data),i((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),T=function(){var e=_(regeneratorRuntime.mark((function e(t){var n,r,a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.length<=220)){e.next=3;break}return d(t),e.abrupt("return");case 3:n=t.lastIndexOf("."),r=-1===n?"":".".concat(t.slice(n+1)),a=r.length>0?r.length:0,c="".concat(t.slice(0,220-a)).concat(r),d(c);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=function(){var e=_(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c(n),t&&t();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),A=function(){var e=_(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i((function(e){return e+1})),e.next=3,Object(a.G)("".concat(p,"/rename"),{nonce:g,json:{mediaId:r.ID}});case 3:t=e.sent,P(t.data),y(null),i((function(e){return e-1}));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),S=function(){var e=_(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i((function(e){return e+1})),e.next=3,Object(a.G)("".concat(p,"/rename"),{nonce:g,json:{mediaId:r.ID,filename:m}});case 3:t=e.sent,P(t.data),y(null),d(""),i((function(e){return e-1}));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),j=function(){var e=_(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i((function(e){return e+1})),e.next=3,Object(a.G)("".concat(p,"/undo"),{nonce:g,json:{mediaId:r.ID}});case 3:t=e.sent,P(t.data,r.current_filename),i((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=function(){var e=_(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i((function(e){return e+1})),e.next=3,Object(a.G)("".concat(p,"/set_lock"),{nonce:g,json:{mediaId:r.ID,lock:!r.locked}});case 3:t=e.sent,P(t.data),i((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=_(regeneratorRuntime.mark((function e(){var t,n,c,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log({entry:r}),t=r.metadata.file||"",n="/"+t.substring(0,t.lastIndexOf("/")),!(c=(c=(c=prompt("Where would you like to move this file (in the /uploads directory)?",n)).replace(/\/+$/,""))||"/")){e.next=13;break}return i((function(e){return e+1})),e.next=10,Object(a.G)("".concat(p,"/move"),{nonce:g,json:{mediaId:r.ID,newPath:c}});case 10:o=e.sent,P(o.data),i((function(e){return e-1}));case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=!!m,N=B?m:h||(null==r?void 0:r.current_filename);return React.createElement(a.b,{busy:l},React.createElement(U,null,React.createElement("div",{className:"renamer-field"},React.createElement(a.k,{natural:w,readOnly:!R||l,value:N,onChange:T,onEnter:S,maxLength:220,style:{marginRight:0,flex:"auto"}}),!B&&React.createElement(a.j,{icon:null!=r&&r.locked?"lock":"lock-open",width:24,title:null!=r&&r.locked?"Unlock, to allow future actions":"Lock, to avoid future actions",style:{position:"relative",left:-26,marginRight:-22},color:null!=r&&r.locked?a.z.blue:"#5a5a5a82",onClick:C}),B&&React.createElement(a.j,{icon:"close",width:24,style:{position:"relative",left:-26,marginRight:-22},color:null!=r&&r.locked?a.z.blue:"#5a5a5a82",onClick:function(){d("")}}),(null==r?void 0:r.proposed_filename_exists)&&React.createElement(a.j,{icon:"alert",color:"orange",tooltip:{text:"The ideal filename (".concat(r.proposed_filename,") already exists."),position:"left"}}),v&&!B&&(null==r?void 0:r.original_filename)&&React.createElement(a.j,{icon:"file-undo",title:"Rollback to original",color:a.z.red,onClick:j,onMouseEnter:function(){return y(null==r?void 0:r.original_filename)},onMouseLeave:function(){return y(null)}})),React.createElement("div",{className:"renamer-actions"},!B&&(null==r?void 0:r.proposed_filename)&&!(null!=r&&r.proposed_filename_exists)&&React.createElement(a.c,{style:{flex:3},title:"Rename automatically",onMouseEnter:function(){return y(null==r?void 0:r.proposed_filename)},onMouseLeave:function(){return y(null)},onClick:A},"Auto Rename"),R&&B&&React.createElement(a.c,{style:{flex:3},title:"Rename manually",onClick:S},s.RENAME),E&&React.createElement(a.c,{style:{flex:1},title:"Move",onClick:I},s.MOVE))))};function N(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var L=c.a.div(P||(P=N(["\n color: white;\n padding: 15px;\n margin-bottom: -15px;\n\n a {\n color: #7dedff;\n text-decoration: none;\n }\n\n p {\n font-size: 15px;\n }\n"]))),F=Object(c.a)(a.a)(A||(A=N(["\n\n .nui-block-title {\n display: none;\n }\n\n .nui-block-content {\n display: flex;\n padding: 10px;\n\n h2 {\n color: #055082;\n font-size: 16px;\n margin: 5px 0 5px 0;\n\n a {\n text-decoration: none;\n }\n }\n\n p {\n margin: 0px;\n line-height: 18px;\n }\n }\n"]))),q=c.a.img(S||(S=N(["\n width: 85px;\n height: 85px;\n padding-right: 10px;\n"]))),G=c.a.div(j||(j=N(["\n\n margin: 15px;\n\n .center {\n background: white;\n border-radius: 10px;\n padding: 10px;\n max-width: 100%\n overflow: none;\n\n h2 {\n font-size: 26px;\n }\n\n table {\n width: 100%;\n\n tr td:first-child {\n width: 220px;\n font-weight: bold;\n color: #1e7cba;\n }\n\n * {\n overflow-wrap: anywhere;\n }\n }\n }\n\n hr {\n border-color: #1e7cba;\n }\n"]))),z=c.a.ul(C||(C=N(["\n margin-top: 10px;\n background: rgb(0, 72, 88);\n padding: 10px;\n color: rgb(58, 212, 58);\n max-height: 600px;\n min-height: 200px;\n display: block;\n font-family: monospace;\n font-size: 12px;\n white-space: pre;\n overflow-x: auto;\n width: calc(100vw - 276px);\n\n .log-date {\n color: white;\n margin-left: 8px;\n }\n\n .log-type {\n background: #0000004d;\n padding: 2px 5px;\n border-radius: 8px;\n text-transform: uppercase;\n }\n\n .log-content {\n display: block;\n }\n\n .log-warning .log-type {\n background: #ccb028;\n color: white;\n }\n\n .log-fatal .log-type {\n background: #cc2828;\n color: white;\n }\n"])));function H(e){return function(e){if(Array.isArray(e))return J(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Y(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function W(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){Y(c,r,a,o,l,"next",e)}function l(e){Y(c,r,a,o,l,"throw",e)}o(void 0)}))}}function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||$(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){if(e){if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J(e,t):void 0}}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var K=wp.element,X=K.useState,Q=K.useEffect,Z="".concat(d,"/meow-common/v1"),ee=function(e){var t=e.request,n=e.title,r=e.max,c=V(X(!1),2),o=c[0],l=c[1],i=V(X([]),2),s=i[0],u=i[1],m=s.length>0?s.reduce((function(e,t){return e+t})):0,d=s.length>0?Math.ceil(m/s.length):0,p=!s.length&&o;Q((function(){o&&setTimeout(W(regeneratorRuntime.mark((function e(){var n,r,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),e.next=3,Object(a.G)("".concat(Z,"/").concat(t),{nonce:g});case 3:r=(new Date).getTime(),c=r-n,u((function(e){return[].concat(H(e),[c])}));case 6:case"end":return e.stop()}}),e)}))),1e3)}),[s]);return React.createElement(L,{style:{width:200,textAlign:"center"}},React.createElement(a.B,{h2:!0,style:{color:"white"}},n),React.createElement(a.h,{size:200,value:p?r:d,max:r},React.createElement("span",{style:{fontSize:20}},p?"START":d+" ms"),React.createElement("span",{style:{fontSize:12}},p?"YOUR ENGINE":s.length+" requests")),React.createElement(a.c,{style:{width:"100%",marginTop:10},color:o?"#cc3627":"#ccb027",onClick:function(){o||u([]),l(!o)}},o?"Stop":"Start"))};function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach((function(t){re(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ae(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function ce(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){ae(c,r,a,o,l,"next",e)}function l(e){ae(c,r,a,o,l,"throw",e)}o(void 0)}))}}function oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return le(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ie=wp.element,se=ie.useState,ue=ie.useEffect;p&&d&&f||console.error("[@common/dashboard] apiUrl, restUrl and pluginUrl are mandatory.");var me="".concat(d,"/meow-common/v1"),de=React.createElement(L,null,React.createElement(a.B,{p:!0},"Meow Apps is run by Jordy Meow, a photographer and software developer living in Japan (and taking ",React.createElement("a",{target:"_blank",href:"https://offbeatjapan.org"},"a lot of photos"),"). Meow Apps proposes a suite of plugins focusing on photography, imaging, optimization and SEO. The ultimate goal is to make your website better, faster, while making it easy. Meow Apps also teams up with the best players in the community. For more information, please check ",React.createElement("a",{href:"http://meowapps.com",target:"_blank"},"Meow Apps"),".")),pe=React.createElement(L,null,React.createElement(a.B,{p:!0},"The ",React.createElement("b",null,"Empty Request Time")," helps you analyzing the raw performance of your install by giving you the average time it takes to run an empty request to your server. You can try to disable some plugins (or change their options) then Start this again to see how it influences the results. An excellent install would have an Empty Request Time of less than 500 ms. Keep it absolutely under 2,000 ms! For more information, ",React.createElement("a",{href:"https://meowapps.com/clean-optimize-wordpress/#Optimize_your_Empty_Request_Time",target:"_blank"},"click here"),"."),React.createElement(a.B,{p:!0},React.createElement("b",null,"File Operation Time")," creates a temporary size of 10MB every time. ",React.createElement("b",null,"SQL Request Time")," counts the number of posts. Those two should be very fast, and almost the same as the ",React.createElement("b",null,"Empty Request Time"),".")),fe=React.createElement(L,null,React.createElement(a.B,{p:!0},"Too many WordPress installs are blown-up with useless and/or heavy plugins, and not aware of best practices. That's not the fault of the users; WordPress pretends to be simple but it is in fact very complex, and the immensity and diversity of the community around it makes it a real jungle where everything is possible."),React.createElement(a.B,{p:!0},"A rule of thumb is to keep your WordPress install as simple as possible, with the least number of plugins installed (run away from the heavy ones) and an excellent hosting service. Avoid VPS or self-hosted solutions; you must be a professional to actually set them up so that they are actually performant."),React.createElement(a.B,{p:!0},"On the Meow Apps website, you will find articles which are always updated with the latest recommendations.",React.createElement("ul",null,React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/how-to-debug-wordpress-errors/",target:"_blank"},"How To Debug WordPress")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-improve-seo-wordpress/",target:"_blank"},"SEO Checklist & Optimization")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-faster-wordpress-optimize/",target:"_blank"},"Optimize your WordPress Speed")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-optimize-images-wordpress/",target:"_blank"},"Optimize Images (CDN, and so on)")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-hosting-service-wordpress/",target:"_blank"},"Best Hosting Services for WordPress"))))),he=["".concat(me,"/all_settings/"),{headers:{"X-WP-Nonce":g}}],ye=function(){var e=oe(se(!1),2),t=e[0],n=e[1],c=Object(r.b)(he,a.F),o=c.data,l=c.mutate,i=c.error,s=null==o?void 0:o.data,u=null==s?void 0:s.meowapps_hide_meowapps,m=null==s?void 0:s.force_sslverify,d=oe(se(!1),2),p=d[0],h=d[1],y=oe(se([]),2),b=y[0],v=y[1],E=oe(se(""),2),R=E[0],w=E[1];ue((function(){i&&!t&&(n(!0),console.error("Error from UseSWR",i.message))}),[i]),ue((function(){var e=document.getElementById("meow-common-phpinfo");w(e.innerHTML)}),[]);var _=function(){var e=ce(regeneratorRuntime.mark((function e(t,n){var r,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=ne({},o.data))[n]=t,l(ne(ne({},o),{},{data:r}),!1),h(!0),e.next=6,Object(a.G)("".concat(me,"/update_option"),{json:{name:n,value:t},nonce:g});case 6:c=e.sent,h(!1),c.success||alert(c.message),l();case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),k=function(){var e=ce(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.next=3,Object(a.G)("".concat(me,"/error_logs"),{nonce:g});case 3:t=e.sent,n=t&&t.data?t.data:[],v(n.reverse()),h(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=React.createElement(a.v,{title:"Main Menu"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"meowapps_hide_meowapps",label:"Hide (Not Recommended)",description:React.createElement(a.B,{p:!0},"This will hide the Meow Apps Menu (on the left side) and everything it contains. You can re-enable it through though an option that will be added in Settings → General."),value:"1",disabled:p,checked:u,onChange:_}))),O=React.createElement(a.v,{title:"SSL Verify"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"force_sslverify",label:"Force (Not Recommended)",description:React.createElement(a.B,{p:!0},"This will enforce the usage of SSL when checking the license or updating the plugin."),value:"1",disabled:p,checked:m,onChange:_})));return React.createElement(a.q,{showRestError:t},React.createElement(a.i,{title:"The Dashboard"}),React.createElement(a.C,null,React.createElement(a.f,{full:!0},React.createElement(a.y,null,React.createElement(a.w,{title:"Meow Apps"},de,React.createElement(a.C,null,React.createElement(a.f,{minimal:!0},React.createElement(F,{title:"Media Cleaner",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/media-cleaner.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/media-cleaner/"},"Media Cleaner")),React.createElement("p",null,"The Cleaner analyzes your WordPress entirely to find out which files are not used. You can trash them, before deleting them permanently. Your WordPress will breath again :)"))),React.createElement(F,{title:"Database Cleaner",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/database-cleaner.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/database-cleaner/"},"Database Cleaner")),React.createElement("p",null,"Clean your WordPress database. This plugin is simple, handles risk levels, and aims to work even on oversized databases on which other plugins fail to operate."))),React.createElement(F,{title:"Media File Renamer",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/media-file-renamer.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/media-file-renamer/"},"Media File Renamer")),React.createElement("p",null,"The Renamer will help you in getting nicer filenames for an improved SEO and a tidier filesystem. It's mostly automatic and very fun to use."))),React.createElement(F,{title:"Social Engine",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/social-engine.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/social-engine/"},"Social Engine")),React.createElement("p",null,"Organize, schedule and automate the publishing of your content and photos on social accounts. Similar to Buffer, TweetDeck, etc, but without all the limitations, and in your WordPress."))),React.createElement(F,{title:"Meow Analytics",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/meow-analytics.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-analytics/"},"Meow Analytics")),React.createElement("p",null,"Are you tired of those heavy plugins, accessing your Google Analytics deliberately? Switch to Meow Analytics!")))),React.createElement(a.f,{minimal:!0},React.createElement(F,{title:"Photo Engine",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/wplr-sync.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/wplr-sync/"},"Photo Engine")),React.createElement("p",null,"Are you using Lightroom? So you know Photo Engine already. Wait, you don't? You must try it! This plugin will be your favorite very soon."))),React.createElement(F,{title:"Meow Gallery",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/meow-gallery.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-gallery/"},"Meow Gallery")),React.createElement("p",null,"This is the fastest gallery system... and it is pretty as well! It is 100% compatible with the native WordPress galleries and therefore, works right away."))),React.createElement(F,{title:"Meow Lightbox",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/meow-lightbox.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-lightbox/"},"Meow Lightbox")),React.createElement("p",null,"A very sleek and performant Lightbox which will also display your EXIF data (camera, lens, aperture...). Photographers love it."))),React.createElement(F,{title:"Perfect Images (Retina)",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/wp-retina-2x.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/wp-retina-2x/"},"Perfect Images + Retina")),React.createElement("p",null,"It handles Retina, help you managing the Image Sizes registered in your WP, and much more."))),React.createElement(F,{title:"Contact Form Block",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/contact-form-block.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/contact-form-block/"},"Contact Form Block")),React.createElement("p",null,"A simple, pretty and superlight contact form. If you simply want your visitors to get in touch with you, this contact form will be perfect for you and your WordPress.")))))),React.createElement(a.w,{title:"Performance"},pe,React.createElement("div",{style:{display:"flex",justifyContent:"space-around",marginBottom:25}},React.createElement(ee,{title:"Empty Request Time",request:"empty_request",max:2500}),React.createElement(ee,{title:"File Operation Time",request:"file_operation",max:2600}),React.createElement(ee,{title:"SQL Request Time",request:"sql_request",max:2800}))),React.createElement(a.w,{title:"Recommendations"},fe),React.createElement(a.w,{title:"PHP Info"},React.createElement(G,{dangerouslySetInnerHTML:{__html:R}})),React.createElement(a.w,{title:"PHP Error Logs"},React.createElement(L,null,React.createElement(a.c,{style:{marginBottom:10},color:"#ccb027",onClick:k},"Load PHP Error Logs"),React.createElement(z,null,b.map((function(e){return React.createElement("li",{class:"log-".concat(e.type)},React.createElement("span",{class:"log-type"},e.type),React.createElement("span",{class:"log-date"},e.date),React.createElement("span",{class:"log-content"},e.content))}))))),React.createElement(a.w,{title:"Settings"},React.createElement(a.a,{title:"Settings",className:"primary"},x,O))))))};function ge(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function be(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){ge(c,r,a,o,l,"next",e)}function l(e){ge(c,r,a,o,l,"throw",e)}o(void 0)}))}}function ve(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ee(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Re=wp.element,we=Re.useState,_e=Re.useEffect,ke="".concat(d,"/meow-licenser/").concat(u,"/v1"),xe=function(){var e=ve(we(!1),2),t=e[0],n=e[1],r=ve(we(!1),2),c=r[0],o=r[1],l=ve(we(null),2),i=l[0],s=l[1],u=ve(we(null),2),m=u[0],d=u[1],p=ve(we(""),2),f=p[0],b=p[1],v=y&&(!m||"valid"!==m.license),E=function(){var e=be(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h){e.next=2;break}return e.abrupt("return");case 2:return n(!0),e.next=5,Object(a.G)("".concat(ke,"/get_license"),{nonce:g});case 5:t=e.sent,d(t.data),t.data.key&&b(t.data.key),n(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=be(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,Object(a.G)("".concat(ke,"/set_license"),{nonce:g,json:{serialKey:null}});case 3:e.sent.success&&(b(""),d(null),s("licenseRemoved")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),w=function(){var e=be(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,Object(a.G)("".concat(ke,"/set_license"),{nonce:g,json:{serialKey:f,override:!0}});case 3:(t=e.sent).success&&(d(t.data),t.data&&!t.data.issue&&s("licenseAdded")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_=function(){var e=be(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MEOW_OVERRIDE"!==f){e.next=5;break}return o(!0),d(null),b(""),e.abrupt("return");case 5:return n(!0),e.next=8,Object(a.G)("".concat(ke,"/set_license"),{nonce:g,json:{serialKey:f}});case 8:(t=e.sent).success&&(d(t.data),t.data&&!t.data.issue&&s("licenseAdded")),n(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();_e((function(){E()}),[]);var k=v?"Forced License":y?"Enabled":"Disabled",x=v||m&&"valid"===m.license,O="Your license is active. Thanks a lot for your support :)";v&&m&&m.check_url&&(O=React.createElement(React.Fragment,null,React.createElement("span",null,O),React.createElement("br",null),React.createElement("small",null,"This license was enabled manually. To check your license status, please click ",React.createElement("a",{target:"_blank",href:m.check_url+"&cache="+642e3*Math.random()},"here"),"."))),x||(m?"no_activations_left"===m.issue?O=React.createElement("span",null,"There are no activations left for this license. You can visit your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"Meow Apps Store"),", unregister a site, and click on ",React.createElement("i",null,"Retry to validate"),"."):"expired"===m.issue?O=React.createElement("span",null,"Your license has expired. You can get another license or renew the current one by visiting your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"Meow Apps Store"),"."):"missing"===m.issue?O="This license does not exist.":"disabled"===m.issue?O="This license has been disabled.":"item_name_mismatch"===m.issue?O="This license seems to be for a different plugin... isn't it? :)":"forced"===m.issue?O="ABC":(O=React.createElement("span",null,"There is an unknown error related to the system or this serial key. Really sorry about this! Make sure your security plugins and systems are off temporarily. If you are still experiencing an issue, please ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/contact/"},"contact us"),"."),console.error({license:m})):O="Unknown error :(");var T=React.createElement(a.a,{title:"Pro Version (Not Installed)",className:"primary"},"You will find more information about the Pro Version ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"here"),". If you actually bought the Pro Version already, please remove the current plugin and download the Pro Version from your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/"},"Meow Apps Store"),"."),P=React.createElement(a.a,{title:"Pro Version (".concat(k,")"),busy:t,className:"primary"},React.createElement(a.v,{title:"Serial Key",style:{fontWeight:"bold"}},React.createElement(a.k,{id:"mfrh_pro_serial",name:"mfrh_pro_serial",disabled:t,value:f,onChange:function(e){return b(e)},placeholder:""})),m&&!x&&React.createElement(a.m,null,O),m&&x&&React.createElement(a.n,null,O),!m&&React.createElement(a.B,{p:!0},"Insert your serial key above. If you don't have one yet, you can get one ",React.createElement("a",{href:"https://meowapps.com"},"here"),". If there was an error during the validation, try the ",React.createElement("i",null,"Retry")," to ",React.createElement("i",null,"validate")," button."),React.createElement(a.v,{contentAlign:"right"},m&&!x&&React.createElement(a.c,{className:"secondary",disabled:t||!f,onClick:_},"Retry to validate"),m&&m.key===f&&React.createElement(a.c,{className:"secondary",disabled:t||!f,onClick:R},"Remove License"),React.createElement(a.c,{disabled:t||!f||m&&m.key===f,onClick:_},"Validate License"),c&&!x&&React.createElement(a.c,{disabled:t||!f||m&&m.key===f,onClick:w,className:"danger"},"Force License")),React.createElement(a.o,{isOpen:"licenseAdded"===i,title:"Thank you :)",content:"The Pro features have been enabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}),React.createElement(a.o,{isOpen:"licenseRemoved"===i,title:"Goodbye :(",content:"The Pro features have been disabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}));return h?P:T},Oe=wp.element.render;function Te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(n),!0).forEach((function(t){Ae(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Se(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function je(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){Se(c,r,a,o,l,"next",e)}function l(e){Se(c,r,a,o,l,"throw",e)}o(void 0)}))}}function Ce(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ie(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}document.meowDashboardLoaded||(document.meowDashboardLoaded=!0,document.addEventListener("DOMContentLoaded",(function(e){var t=document.getElementById("meow-common-dashboard");t&&Oe(React.createElement(ye,null),t)})));var De=wp.element,Me=De.useState,Ue=De.useMemo,Be=De.useCallback,Ne={marginTop:10,background:"rgb(0, 72, 88)",padding:10,color:"rgb(58, 212, 58)",maxHeight:600,minHeight:200,display:"block",fontFamily:"monospace",fontSize:12,whiteSpace:"pre",overflowX:"auto",width:"calc(100vw - 276px)"},Le=["".concat(p,"/all_settings/"),{headers:{"X-WP-Nonce":g}}],Fe=function(){var e,t,n,c=Object(r.b)(Le,a.F),o=c.data,l=(c.mutate,Object(a.H)(o,{},!0)),i=l.busy,s=(l.data,l.error),d=Ce(Me(""),2),f=d[0],v=d[1],E=Ce(Me(!1),2),R=E[0],w=E[1],_=Ce(Me(b),2),k=_[0],x=_[1],O=i||R,T=k.auto_rename,P=k.on_upload,A=k.rename_slug,S=k.convert_to_ascii,j=k.update_posts,C=k.update_excerpts,I=k.update_postmeta,D=k.update_elementor,M=k.undo,U=k.move,B=k.manual_rename,N=k.manual_sanitize,L=k.numbered_files,F=k.sync_alt,q=k.sync_media_title,G=k.force_rename,z=k.log,H=k.logsql,Y=k.rename_guid,W=k.case_insensitive_check,V=k.rename_on_save,$=null!==(e=k.acf_field_name)&&void 0!==e?e:null,J=null!==(t=k.images_only)&&void 0!==t&&t,K=null!==(n=k.featured_only)&&void 0!==n&&n,X=k.clean_uninstall,Q=k.delay,Z=k.autolock_auto,ee=k.autolock_manual,te=[{id:"media_title",value:"media_title",label:React.createElement("span",null,"Based on Media Title"),requirePro:!1},{id:"post_acf_field",value:"post_acf_field",label:React.createElement("span",null,"Based on Attached Post (ACF Field)"),requirePro:!1},{id:"post_title",value:"post_title",label:React.createElement("span",null,"Based on Attached Post Title"),requirePro:!y},{id:"alt_text",value:"alt_text",label:React.createElement("span",null,"Based on Alternative Text"),requirePro:!y},{id:"anonymize_md5",value:"anonymize_md5",label:React.createElement("span",null,"Anonymize with MD5"),requirePro:!y},{id:"none",value:"none",label:React.createElement("span",null,"Disable Automatic Rename"),requirePro:!1}],ne=Be(function(){var e=je(regeneratorRuntime.mark((function e(t,n){var r,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Pe(Pe({},k),{},Ae({},n,t)),w(!0),e.prev=2,e.next=5,Object(a.G)("".concat(p,"/update_option"),{nonce:g,json:{options:r}});case 5:(c=e.sent).success||alert(c.message),x(c.options),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),alert(e.t0.message);case 13:return e.prev=13,w(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[2,10,13,16]])})));return function(t,n){return e.apply(this,arguments)}}(),[k]),re=function(){var e=je(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,Object(a.G)("".concat(p,"/refresh_logs"),{nonce:g});case 3:(t=e.sent).success&&v(t.data),w(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ae=function(){var e=je(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,Object(a.G)("".concat(p,"/clear_logs"),{nonce:g});case 3:(t=e.sent).success&&v(t.data),w(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ce=React.createElement(a.a,{busy:O,title:"Side Updates",className:"primary"},React.createElement(a.B,{p:!0,style:{marginTop:0}},"When the files are renamed, many links to them on your WordPress might be broken. Those options are updating the references to those files. ",React.createElement("strong",null,"Give it a try, every install is different and it might not work for certain kind of references.")),React.createElement(a.v,{title:"Posts"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"update_posts",disabled:O,label:"Enable",description:React.createElement(a.B,{p:!0},"Update the references to the renamed files in the ",React.createElement("strong",null,"content")," of the posts (of all types)."),value:"1",checked:j,onChange:ne}))),React.createElement(a.v,{title:"Excerpts"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"update_excerpts",disabled:O,label:"Enable",description:React.createElement(a.B,{p:!0},"Update the references to the renamed files in the ",React.createElement("strong",null,"excerpts")," of the posts (of all types)."),value:"1",checked:C,onChange:ne}))),React.createElement(a.v,{title:"Post Meta"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"update_postmeta",disabled:O,label:"Enable",description:React.createElement(a.B,{p:!0},"Update the references in the ",React.createElement("strong",null,"custom fields")," of the posts (including pages and custom types metadata)."),value:"1",checked:I,onChange:ne}))),React.createElement(a.v,{title:"Elementor"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"update_elementor",disabled:O,label:"Enable",description:React.createElement(a.B,{p:!0},"Update the references in the ",React.createElement("strong",null,"encrypted data")," of the posts handled by Elementor. ",React.createElement("span",null,"This will probably slow down the renaming extremely and cause timeouts. Test it carefully.")),value:"1",checked:D,onChange:ne})))),oe=React.createElement(a.v,{title:"Method"},React.createElement(a.u,{id:"auto_rename",disabled:O,value:T,scrolldown:!0,name:"auto_rename",description:"Attached Post includes all kinds of Post Types: Posts, Pages, Products, etc.",onChange:ne},te.map((function(e){return React.createElement(a.p,{key:e.id,id:e.id,value:e.value,label:e.label,requirePro:e.requirePro})})))),le=Ue((function(){return"post_acf_field"!==T?null:React.createElement(a.v,{title:"ACF Field Name"},React.createElement(a.k,{id:"acf_field_name",name:"acf_field_name",value:$,onBlur:ne}))}),[$,T,ne]),ie=React.createElement(a.v,{title:"Images Only"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"images_only",label:"Enable",description:"Restricts the renaming to images and icons. Nothing else will be renamed.",value:"1",checked:J,onChange:ne}))),se=React.createElement(a.v,{title:"Featured Only"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"featured_only",label:"Enable",description:"Restricts the renaming to Featured Images only.",value:"1",checked:K,onChange:ne}))),ue=React.createElement(a.v,{title:"On Upload"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"on_upload",disabled:O,label:"Enable",description:React.createElement(React.Fragment,null,React.createElement("span",null,"If your image has an EXIF title, it will be used to decide the filename. "),"post_title"===T&&React.createElement("span",null,"Note: The Attached Post Title ",React.createElement("u",null,"will not be used")," at the time of the upload due to WordPress API constraints.")),value:"1",checked:P,onChange:ne}))),me=React.createElement(a.v,{title:"Slug/Permalink"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"rename_slug",disabled:O,label:"Sync with filename",description:"Better to keep this un-checked as the link might have been referenced somewhere else.",value:"1",checked:A,onChange:ne}))),de=React.createElement(a.v,{title:"Transliteration"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"convert_to_ascii",disabled:O,label:"Enable (Recommended)",description:React.createElement(a.B,{p:!0},"Replace accents, emoticons, diacritics, umlauts, cyrillic and any kind of tricky characters by their ASCII equivalent.",React.createElement("br",null)," ",React.createElement("i",null,"Examples: tête → tete, schön → schon, Добро → dobro, etc.")),value:"1",requirePro:!y,checked:S,onChange:ne}))),pe=React.createElement(a.v,{title:"Undo"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"undo",disabled:O,label:"Enable",description:"An undo icon will be added to the UI. This allows to rollback to the original filename.",value:"1",checked:M,onChange:ne}))),fe=React.createElement(a.v,{title:"Move"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"move",disabled:O,label:"Enable",description:"A move button will be added, and will allow you to move a file to another directory.",value:"1",checked:U,onChange:ne,requirePro:!y}))),he=React.createElement(a.v,{title:"Rename Field"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"manual_rename",disabled:O,label:"Enable",description:"An editable field will be added everywhere your files appear in the UI.",value:"1",checked:B,onChange:ne}))),ye=React.createElement(a.v,{title:"Sanitize"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"manual_sanitize",disabled:O,label:"Enable",description:"Even if it is manual, the plugin will sanitize the filename you type. That way, you are sure the final filename will be clean and safe to use.",value:"1",checked:N,onChange:ne}))),ge=React.createElement(a.v,{title:"Force Rename"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"force_rename",disabled:O,label:"Enable",description:"Update the references to the file even if the file renaming itself was not successful. You might want to use that option if your install is broken and you are trying to link your Media to files for which the filenames has been altered (after a migration for exemple)",value:"1",requirePro:!y,checked:G,onChange:ne}))),be=React.createElement(a.v,{title:"Numbered Files"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"numbered_files",disabled:O,label:"Enable Numbering",description:"Identical filenames will be allowed by the plugin and a number will be appended automatically (myfile.jpg, myfile-2.jpg, myfile-3.jpg, etc).",requirePro:!y,value:"1",checked:L,onChange:ne}))),ve=React.createElement(a.v,{title:"ALT Text"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"sync_alt",disabled:O||"alt_text"==T,label:React.createElement(a.B,null,"Synchronize"),description:"The ALT Text will be synchronized with the same source used for the filename.",requirePro:!y,value:"1",checked:F,onChange:ne}))),Ee=React.createElement(a.v,{title:"Media Title"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"sync_media_title",disabled:O||"media_title"===T,label:React.createElement(a.B,null,"Synchronize"),description:"The Media Title will be synchronized with the same source used for the filename.",requirePro:!y,value:"1",checked:q,onChange:ne}))),Re=React.createElement(a.v,{title:"Logs"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"log",label:"Enable",description:React.createElement(a.B,{p:!0},"Simple logging that explains which actions has been run."),value:"1",checked:z,onChange:ne}),React.createElement("div",{style:{marginTop:20}},React.createElement(a.c,{onClick:re},"Refresh Logs"),React.createElement(a.c,{className:"danger",onClick:ae},"Clear Logs")))),we=React.createElement(a.v,{title:"SQL Logs"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"logsql",disabled:O,label:"Enable",description:React.createElement(a.B,{p:!0},"The files sql.log and sql_revert.log will be created in the /logs directory and will include the raw SQL queries which were run by the plugin. If there is an issue, the revert SQL file can help you."),requirePro:!y,value:"1",checked:H,onChange:ne}))),_e=React.createElement(a.v,{title:"GUID"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"rename_guid",disabled:O,label:"Sync with filename",description:"The GUID will be renamed like the new filename. Better to keep this un-checked.",value:"1",checked:Y,onChange:ne}))),ke=React.createElement(a.v,{title:"Case Insensitive"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"case_insensitive_check",label:"Enable",value:"1",checked:W,onChange:ne,description:React.createElement(React.Fragment,null,'This will consider the file such as "abc.jpg" and "ABC.JPG" as the same file. More information ',React.createElement("a",{target:"_blank",href:"https://meowapps.com/media-file-renamer-faq-issues/"},"here"),". You should check this if you are on a Windows-based server.")}))),Oe=React.createElement(a.v,{title:"Rename on Post Save"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"rename_on_save",disabled:O,label:"Enable (Unsafe)",description:"You can modify the titles of your media while editing a post but, of course, the plugin can't update the HTML at this stage. With this option, the plugin will update the filenames and HTML after that you saved the post.",value:"1",checked:V,onChange:ne}))),Te=React.createElement(a.v,{title:"Plugin Data"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"clean_uninstall",label:"Delete all",description:"The database and all the options of the plugin will be removed on uninstall. This also includes the information about the plugin's trash.",value:"1",checked:X,onChange:ne}))),Se=React.createElement(a.v,{title:"Delay (in ms)"},React.createElement(a.k,{id:"delay",type:"number",value:Q,min:"0",max:"20000",onEnter:ne,onBlur:ne,description:"Time to wait between each request (in milliseconds). The overall process is intensive so this gives the chance to your server to chill out a bit. A very good server doesn't need it, but a slow/shared hosting might even reject requests if they are too fast and frequent. Recommended value is actually 0, 100 for safety, 2000 or 5000 if your hosting is kind of cheap."})),Ie=React.createElement(a.v,{title:"Automatic Rename"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"autolock_auto",disabled:O,label:"Lock",description:"This is disabled by default; your media will be always renamed when needed.",value:"1",checked:Z,onChange:ne}))),De=React.createElement(a.v,{title:"Manual Rename"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"autolock_manual",disabled:O,label:"Lock",description:"This is enabled by default; when you rename a media manually, it normally means that you want to fix the filename by yourself.",value:"1",checked:ee,onChange:ne})));return React.createElement(a.q,{nekoErrors:[s]},React.createElement(a.i,{title:"Media File Renamer | Settings",subtitle:"By Jordy Meow"},React.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},React.createElement(a.c,{className:"header",onClick:function(){return window.open("https://meowapps.com/media-file-renamer-tutorial/","_blank")}},"Tutorial"),React.createElement(a.c,{className:"header",icon:"dashboard",onClick:function(){return location.href="upload.php?page=dashboard"}},"Dashboard"))),React.createElement(a.C,null,React.createElement(a.f,{full:!0},React.createElement(a.g,null,React.createElement(a.B,{p:!0},"It works out of the box, the default settings are good for most installs. However, you should really have a look at the ",React.createElement("a",{href:"https://meowapps.com/plugin/media-file-renamer/"},"tutorial"),". If you are a SEO guru or someone who loves having a perfectly neat filesystem, it is recommended to use automatic renaming first, then to tweak specific files with manual renaming. The ",React.createElement("a",{href:"/wp-admin/upload.php?page=dashboard"},"Renamer Dashboard")," makes it very easy.")),React.createElement(a.y,{keepTabOnReload:!0},React.createElement(a.w,{title:"Basic"},React.createElement(a.C,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:O,title:"Settings",className:"primary"},React.createElement(a.B,{h2:!0},"Automatic"),React.createElement(a.B,{p:!0},"This plugin's main goal is to make the process of optimizing your filenames entirely automatic. By default, your files will be named after the title of your media entry."),oe,le,React.createElement(a.B,{h2:!0},"Manual"),he,ye,React.createElement(a.B,{h2:!0},"Extra Options"),ue,ie,se)),React.createElement(a.f,{minimal:!0},ce,React.createElement(a.a,{busy:O,title:"UI (Extra Features)",className:"primary"},pe,fe)))),React.createElement(a.w,{title:"Advanced"},React.createElement(a.C,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:O,title:"Renaming",className:"primary"},de,be),React.createElement(a.a,{busy:O,title:"Fields Syncing",className:"primary"},me,_e,ve,Ee,React.createElement(a.B,{p:!0},"The fields in the database will be synchronized, but the data already written in your HTML will not be overwritten.")),React.createElement(a.a,{busy:O,title:"Auto Lock",className:"primary"},Ie,De),React.createElement(a.a,{busy:O,title:"On Uninstall",className:"primary"},Te)),React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:O,title:"Performance",className:"primary"},Se),React.createElement(a.a,{busy:O,title:"For Developers",className:"primary"},ke,ge,we,Oe)))),React.createElement(a.w,{title:"License (Pro)"},React.createElement(xe,{domain:m,prefix:u,isPro:h,isRegistered:y})),React.createElement(a.w,{title:"Logs & Debug"},React.createElement(a.a,{busy:O,className:"primary"},Re),React.createElement("div",{style:Ne},f))))))},qe=n(0);function Ge(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ze(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function He(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?He(Object(n),!0).forEach((function(t){We(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function We(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ve(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function $e(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){Ve(c,r,a,o,l,"next",e)}function l(e){Ve(c,r,a,o,l,"throw",e)}o(void 0)}))}}var Je,Ke,Xe={pending:"-",renamed:"-",locked:"-",all:"-"},Qe={accessor:"id",by:"asc"},Ze=0,et={filterBy:"pending",sort:Qe,page:1,limit:parseInt(b.posts_per_page),search:"",busy:!1,stats:Xe,apiErrors:null,status:"",entries:[],selectedItems:[],total:0,options:b,autoRename:b.auto_rename,onUpload:b.on_upload,renameSlug:b.rename_slug,convertToAscii:b.convert_to_ascii,updatePosts:b.update_posts,updatePostmeta:b.update_postmeta,undo:b.undo,move:b.move,manualRename:b.manual_rename,numberedFiles:b.numbered_files,syncAlt:b.sync_alt,syncMedia_title:b.sync_media_title,forceRename:b.force_rename,log:b.log,logsql:b.logsql,renameGuid:b.rename_guid,caseInsensitiveCheck:b.case_insensitive_check,renameOnSave:b.rename_on_save,acfFieldName:b.acf_field_name,imagesOnly:b.images_only,delay:parseInt(b.delay),modals:{renameAll:!1,undoAll:!1,editTitle:!1,autoAttach:!1},mutateEntries:(Ke=$e(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return Ke.apply(this,arguments)}),mutateStats:(Je=$e(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return Je.apply(this,arguments)})},tt=function(e,t){switch(t.type){case"ENTRIES_UPDATED":var n=t.entries;return Ye(Ye({},e),{},{entries:n});case"STATS_UPDATED":var r=t.stats;return Ye(Ye({},e),{},{stats:r});case"ERROR_UPDATED":var a=t.apiErrors;return Ye(Ye({},e),{},{apiErrors:a});case"PAGE_UPDATED":var c=t.page;return Ye(Ye({},e),{},{page:c});case"SET_ENTRIES_MUTATE":var o=t.mutateEntries;return Ye(Ye({},e),{},{mutateEntries:o});case"SET_STATS_MUTATE":var l=t.mutateStats;return Ye(Ye({},e),{},{mutateStats:l});case"LIMIT_UPDATED":var i=t.limit;return Ye(Ye({},e),{},{limit:i});case"FILTER_UPDATED":var s=t.filter;return Ye(Ye({},e),{},{filterBy:s});case"SORT_UPDATED":var u=t.sort,m=void 0===u?Qe:u;return Ye(Ye({},e),{},{sort:m});case"SEARCH_UPDATED":var d=t.search;return Ye(Ye({},e),{},{search:d});case"TOTAL_UPDATED":var p=t.total;return Ye(Ye({},e),{},{total:p});case"TOGGLE_MODAL":var f=t.modal,h=t.enable;if(void 0===e.modals[f])return alert("The modal ".concat(f," doesn't exist.")),console.error("The modal ".concat(f," doesn't exist.")),e;void 0===h&&(h=!e.modals[f]);var y=Ye({},e);return y.modals=Ye({},y.modals),y.modals[f]=h,y;case"PUSH_BUSY":var g=t.status,b=void 0===g?"":g;return Ye(Ye({},e),{},{busy:++Ze>0,status:b});case"POP_BUSY":var v=t.status,E=void 0===v?"":v;return Ye(Ye({},e),{},{busy:--Ze>0,status:E});case"STATUS_UPDATED":var R=t.status,w=void 0===R?"":R;return Ye(Ye({},e),{},{status:w});case"SETTINGS_UPDATED":var _,k,x,O,T,P,A,S,j,C,I,D,M,U,B,N,L,F,q,G,z=t.options,H=null!==(_=z.auto_rename)&&void 0!==_&&_,Y=null!==(k=z.on_upload)&&void 0!==k&&k,W=null!==(x=z.rename_slug)&&void 0!==x&&x,V=null!==(O=z.convert_to_ascii)&&void 0!==O&&O,$=null===(T=z.update_posts)||void 0===T||T,J=null===(P=z.update_postmeta)||void 0===P||P,K=(A=z.update_elementor,null!==(S=z.undo)&&void 0!==S&&S),X=null!==(j=z.move)&&void 0!==j&&j,Q=null!==(C=z.manual_rename)&&void 0!==C&&C,Z=null!==(I=z.numbered_files)&&void 0!==I&&I,ee=null!==(D=z.sync_alt)&&void 0!==D&&D,te=null!==(M=z.sync_media_title)&&void 0!==M&&M,ne=null!==(U=z.force_rename)&&void 0!==U&&U,re=null!==(B=z.log)&&void 0!==B&&B,ae=null!==(N=z.logsql)&&void 0!==N&&N,ce=null!==(L=z.rename_guid)&&void 0!==L&&L,oe=null!==(F=z.case_insensitive_check)&&void 0!==F&&F,le=null!==(q=z.rename_on_save)&&void 0!==q&&q,ie=z.acf_field_name,se=null!==(G=z.images_only)&&void 0!==G&&G,ue=z.posts_per_page?parseInt(z.posts_per_page):10,me=z.delay?parseInt(z.delay):0;return Ye(Ye({},e),{},{options:z,autoRename:H,onUpload:Y,renameSlug:W,convertToAscii:V,updatePosts:$,updatePostmeta:J,undo:K,move:X,manualRename:Q,numberedFiles:Z,syncAlt:ee,syncMedia_title:te,forceRename:ne,log:re,logsql:ae,renameGuid:ce,caseInsensitiveCheck:oe,renameOnSave:le,acfFieldName:ie,imagesOnly:se,limit:ue,delay:me});case"ITEMS_SELECTED":var de=t.selectedItems;return Ye(Ye({},e),{},{selectedItems:de});default:return e}},nt=Object(qe.createContext)(),rt=function(e){var t=e.children,n=Ge(Object(qe.useReducer)(tt,et),2),c=n[0],o=n[1],l=c.filterBy,i=c.sort,s=c.search,u=c.page,m=c.limit,d=Object(qe.useMemo)((function(){return[Object(a.D)("".concat(p,"/media"),{limit:m,skip:(u-1)*m,filterBy:l,orderBy:i.accessor,order:i.by,search:s}),{headers:{"X-WP-Nonce":g}}]}),[m,u,l,i,s]),f=Object(qe.useMemo)((function(){return[Object(a.D)("".concat(p,"/stats"),{search:s}),{headers:{"X-WP-Nonce":g}}]}),[s]),h=Object(r.b)(d,a.F),y=h.data,b=h.mutate;Object(qe.useEffect)((function(){o({type:"SET_ENTRIES_MUTATE",mutateEntries:b})}),[b]),Object(qe.useEffect)((function(){o({type:"SET_STATS_MUTATE",mutateStats:O})}),[O]);var v=Object(a.H)(y,[],!0),E=v.busy,R=v.data,w=v.total,_=v.error;Object(qe.useEffect)((function(){o({type:E?"PUSH_BUSY":"POP_BUSY"})}),[E]),Object(qe.useEffect)((function(){o({type:"ENTRIES_UPDATED",entries:R})}),[R]),Object(qe.useEffect)((function(){o({type:"TOTAL_UPDATED",total:w})}),[w]),Object(qe.useEffect)((function(){o({type:"ERROR_UPDATED",apiError:_})}),[_]);var k=Object(r.b)(f,a.F),x=k.data,O=k.mutate,T=Object(a.H)(x,Xe,!0),P=T.busy,A=T.data,S=T.error;return Object(qe.useEffect)((function(){o({type:P?"PUSH_BUSY":"POP_BUSY"})}),[P]),Object(qe.useEffect)((function(){o({type:"STATS_UPDATED",stats:A})}),[A]),Object(qe.useEffect)((function(){o({type:"ERROR_UPDATED",apiError:S})}),[S]),React.createElement(nt.Provider,{value:[c,o]},t)},at=function(){var e={},t=Ge(Object(qe.useContext)(nt),2),n=t[0],r=t[1];return e.setSelectedItems=function(e){r({type:"ITEMS_SELECTED",selectedItems:e})},e.setStatus=function(e){r({type:"STATUS_UPDATED",status:e})},e.updateOption=function(){var e=$e(regeneratorRuntime.mark((function e(t,c){var o,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r({type:"PUSH_BUSY"}),o=Ye(Ye({},n.options),{},We({},c,t)),e.prev=2,e.next=5,Object(a.G)("".concat(p,"/update_option"),{nonce:g,json:{options:o}});case 5:(l=e.sent).success&&r({type:"SETTINGS_UPDATED",options:l.options}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),alert(e.t0);case 12:return e.prev=12,r({type:"POP_BUSY"}),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[2,9,12,15]])})));return function(t,n){return e.apply(this,arguments)}}(),e.updateEntry=function(){var e=$e(regeneratorRuntime.mark((function e(t,c){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r({type:"STATUS_UPDATED",status:"Updating..."}),r({type:"PUSH_BUSY"}),e.prev=2,e.next=5,Object(a.G)("".concat(p,"/update_media"),{nonce:g,json:Ye({id:c},t)});case 5:if(e.sent.success){e.next=8;break}throw new Error("Failed to move the folder/gallery.");case 8:n.mutateEntries(),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),alert(e.t0.message);case 14:return e.prev=14,r({type:"POP_BUSY"}),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(t,n){return e.apply(this,arguments)}}(),e.setPage=function(e){r({type:"PAGE_UPDATED",page:e})},e.setLimit=function(e){r({type:"LIMIT_UPDATED",limit:e})},e.setFilter=function(e){r({type:"FILTER_UPDATED",filter:e})},e.setSort=function(e){r({type:"SORT_UPDATED",sort:e})},e.setSearch=function(e){r({type:"SEARCH_UPDATED",search:e})},e.toggleModal=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;r({type:"TOGGLE_MODAL",modal:e,enable:t})},e.pushBusy=function(){r({type:"PUSH_BUSY"})},e.popBusy=function(){r({type:"POP_BUSY"})},Ye(Ye({},n),e)},ct=function(e){return new Promise((function(t){return setTimeout(t,e)}))};function ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(n),!0).forEach((function(t){it(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function it(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function st(e){return function(e){if(Array.isArray(e))return ft(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||pt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ut(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function mt(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){ut(c,r,a,o,l,"next",e)}function l(e){ut(c,r,a,o,l,"throw",e)}o(void 0)}))}}function dt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||pt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pt(e,t){if(e){if("string"==typeof e)return ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ft(e,t):void 0}}function ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ht=wp.element,yt=ht.useState,gt=ht.useEffect,bt=ht.useMemo,vt={width:40,height:40,objectFit:"cover"},Et=[{accessor:"thumbnail_url",title:s.THUMB,style:{width:16}},{accessor:"post_title",title:s.TITLE,sortable:!0,style:{width:"25%"}},{accessor:"post_parent",title:s.ATTACHED_TO,sortable:!0,style:{width:"25%"}},{accessor:"current_filename",title:s.FILENAME,sortable:!0}],Rt=function(){var e=at(),t=e.apiErrors,n=e.busy,r=e.selectedItems,c=e.entries,o=e.stats,l=e.total,i=e.filterBy,u=e.search,m=e.status,d=e.sort,f=e.page,h=e.limit,b=e.modals,E=at(),R=E.setSelectedItems,w=E.setSearch,_=E.setStatus,k=E.setSort,x=E.setPage,O=E.setLimit,T=E.setFilter,P=E.delay,A=E.mutateEntries,S=E.mutateStats,j=E.toggleModal,C=E.updateOption,I=E.updateEntry,D=dt(yt(!1),2),M=D[0],U=D[1],N=dt(yt(""),2),L=N[0],F=N[1],q=dt(yt(),2),G=q[0],z=q[1],H=Object(a.J)(),Y=bt((function(){return c.map((function(e){return{id:e.ID,thumbnail_url:React.createElement("img",{src:e.thumbnail_url,style:vt}),post_title:React.createElement("div",{style:{display:"flex",alignItems:"center"}},React.createElement("a",{href:"post.php?post=".concat(e.ID,"&action=edit")},e.post_title),React.createElement(a.j,{icon:"pencil",width:"20",height:"20",color:a.z.blue,style:{marginLeft:"2px",cursor:"pointer"},onClick:function(){z(e),j("editTitle")}})),post_parent:React.createElement("div",{style:{maxHeight:35,overflow:"hidden"}},e.post_parent_title?e.post_parent_title:React.createElement("i",{style:{color:"#c1c1c1"}},"None")),current_filename:React.createElement(B,{entry:e,mutate:function(){A(),S()}})}}))}),[c]);gt((function(){R([]),k(),x(1)}),[i,u]),gt((function(){if(null!==H.busy&&(U(H.busy),!H.busy)){var e=H.getErrorCount();e>0&&F("The process has finished, but ".concat(e," error(s) occurred (check your console).")),H.reset(),R([]),A(),S()}}),[H.busy]);var W=function(){var e=mt(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(P>0)){e.next=3;break}return e.next=3,ct(P);case 3:return e.next=5,Object(a.G)("".concat(p,"/get_all_ids"),{nonce:g,json:{unlockedOnly:t}});case 5:if((n=e.sent).success){e.next=9;break}return alert(n.message),e.abrupt("return",[]);case 9:return e.abrupt("return",n.data);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),V=function(){var e=mt(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(P>0)){e.next=3;break}return e.next=3,ct(P);case 3:return e.next=5,Object(a.G)("".concat(p,"/get_all_post_ids"),{nonce:g});case 5:if((t=e.sent).success){e.next=9;break}return alert(t.message),e.abrupt("return",[]);case 9:return e.abrupt("return",t.data);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=mt(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _("Preparing..."),U(!0),e.next=4,V();case 4:if(!(t=e.sent)){e.next=11;break}return _("Auto attaching..."),n=Object(a.E)(t,20),r=n.map((function(e){return function(){var t=mt(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(P>0)){t.next=3;break}return t.next=3,ct(P);case 3:return t.next=5,Object(a.G)("".concat(p,"/auto_attach"),{nonce:g,json:{postIds:e},signal:n});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),H.start(r),e.abrupt("return");case 11:U(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=mt(regeneratorRuntime.mark((function e(){var t,n,r,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:null,_("Preparing..."),U(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,W(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return _("Undoing..."),r=n.map((function(e){return function(){var t=mt(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(_("Undo Media ".concat(e)),!(P>0)){t.next=4;break}return t.next=4,ct(P);case 4:return t.next=6,Object(a.G)("".concat(p,"/undo"),{nonce:g,json:{mediaId:e},signal:n});case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),H.start(r),e.abrupt("return");case 16:U(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=mt(regeneratorRuntime.mark((function e(){var t,n,r,c,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,_("Preparing..."),U(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,W(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=17;break}return _("Analyzing..."),r=Object(a.E)(n,20),c=r.map((function(e){return function(){var t=mt(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(P>0)){t.next=3;break}return t.next=3,ct(P);case 3:return t.next=5,Object(a.G)("".concat(p,"/analyze"),{nonce:g,json:{mediaIds:e},signal:n});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),H.start(c),e.abrupt("return");case 17:U(!1);case 18:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){var e=mt(regeneratorRuntime.mark((function e(){var t,n,r,c,o,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(l.length>0&&void 0!==l[0])||l[0],n=l.length>1&&void 0!==l[1]?l[1]:null,_("Preparing..."),U(!0),!n){e.next=8;break}e.t0=n,e.next=11;break;case 8:return e.next=10,W(t);case 10:e.t0=e.sent;case 11:if(!(r=e.t0)){e.next=18;break}return _("".concat(t?"Locking..":"Unlocking...")),c=Object(a.E)(r,50),o=c.map((function(e){return function(){var e=mt(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(P>0)){e.next=3;break}return e.next=3,ct(P);case 3:return e.next=5,Object(a.G)("".concat(p,"/set_lock"),{nonce:g,json:{mediaIds:r,lock:t},signal:n});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()})),H.start(o),e.abrupt("return");case 18:U(!1);case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Q=function(){var e=mt(regeneratorRuntime.mark((function e(){var t,n,r,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:null,_("Preparing..."),U(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,W(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=15;break}return r=n.map((function(e){return function(){var t=mt(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(_("Renaming #".concat(e)),!(P>0)){t.next=4;break}return t.next=4,ct(P);case 4:return t.next=6,Object(a.G)("".concat(p,"/rename"),{nonce:g,json:{mediaId:e},signal:n});case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),H.start(r),e.abrupt("return");case 15:U(!1);case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Z=function(){var e=mt(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:I({post_title:t.post_title},t.ID);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ee=function(){var e=mt(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C(t,"posts_per_page");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),te=function(){var e=mt(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:H.stop();case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=React.createElement(React.Fragment,null,React.createElement("div",null,"All your posts, pages, products (and other post types) will be scanned, and if images are used in them, they will be attached. Currently, Featured Images and Product Galleries are supported. Should we start?"),!y&&React.createElement("div",{style:{marginTop:20}},React.createElement("b",null,"This feature is only available in the Pro version."))),re=React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return window.open("https://meowapps.com/plugin/media-file-renamer/","_blank")}},"Get the Pro Version"),React.createElement(a.c,{className:"primary",onClick:function(){return window.open("https://meowapps.com/media-file-renamer-tutorial/","_blank")}},"Read the tutorial"));return React.createElement(a.q,{nekoErrors:[t]},React.createElement(a.i,{title:"Media File Renamer | Dashboard",subtitle:"By Jordy Meow"},React.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},React.createElement(a.c,{className:"header",onClick:function(){return window.open("https://meowapps.com/media-file-renamer-tutorial/","_blank")}},"Tutorial"),React.createElement(a.c,{icon:"cog",className:"header",onClick:function(){return location.href="admin.php?page=mfrh_settings"}},"Settings"))),React.createElement(a.C,null,React.createElement(a.f,{full:!0},!y&&React.createElement(a.g,{footer:re},React.createElement(a.B,{p:!0},"You must ",React.createElement("b",null,"backup the uploads folder and DB")," before using the Renamer. If you don't know how, give a try to ",React.createElement("a",{target:"_blank",href:"https://meow.click/blogvault"},"BlogVault"),". It is also highly recommanded to read the tutorial. Last but not least, check the ",React.createElement("b",null,"Pro Version"),", as it adds many features and also supports the development. This message is only displayed in the free version. Thank you!")),React.createElement(a.A,null,React.createElement(a.c,{onClick:function(){return K()}},"Analyze Library"),React.createElement(a.c,{onClick:function(){return j("autoAttach")}},"Auto Attach"),"pending"===i&&r.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return Q(r)}},"Rename ",React.createElement("strong",null,r.length)," entries"),React.createElement(a.c,{className:"secondary",onClick:function(){return X(!0,r)}},"Lock ",React.createElement("strong",null,r.length)," entries")),v&&"renamed"===i&&r.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return J(r)}},"Undo ",React.createElement("strong",null,r.length)," entries")),React.createElement("div",{style:{flex:1}},M&&React.createElement(a.s,{status:function(e){return"".concat(m," (").concat(e,"%)")},busy:M,value:H.value,max:H.max,onStopClick:te})),!(n||M)&&React.createElement(React.Fragment,null,React.createElement(a.k,{onBlur:function(e){w(e)},value:u,onEnter:function(e){w(e)}}),!u&&React.createElement(a.j,{icon:"search",width:24,style:{position:"relative",left:-34,marginRight:-22},color:"#5a5a5a82"}),u&&React.createElement(a.j,{icon:"close",width:24,style:{position:"relative",left:-34,marginRight:-22},color:a.z.blue,onClick:function(){w("")}})),"all"===i&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return X(!0)}},"Lock ",React.createElement("strong",null,"All")),React.createElement(a.c,{className:"secondary",onClick:function(){return X(!1)}},"Unlock ",React.createElement("strong",null,"All"))),("all"===i||"pending"===i)&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"primary",onClick:function(){return j("renameAll")}},"Rename ",React.createElement("strong",null,"All"))),v&&("all"===i||"renamed"===i)&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"danger",onClick:function(){return j("undoAll")}},"Undo ",React.createElement("strong",null,"All")))),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10,marginBottom:10}},React.createElement(a.t,{value:i,busy:n||M,onChange:function(e){T(e),x(1)}},React.createElement(a.l,{title:s.PENDING,value:"pending",count:o.pending}),React.createElement(a.l,{title:"Renamed",value:"renamed",count:o.renamed}),React.createElement(a.l,{title:"Locked",value:"locked",count:o.locked}),React.createElement(a.l,{title:"All",value:"all",count:o.all})),React.createElement(a.r,{currentPage:f,limit:h,total:l,onClick:function(e){return x(e)},onCurrentPageChanged:function(e){return x(e)}})),React.createElement(a.x,{busy:n||M,data:Y,columns:Et,sort:d,onSortChange:function(e,t){k({accessor:e,by:t})},onSelect:function(e){R([].concat(st(r),st(e)))},onUnselect:function(e){R(st(r.filter((function(t){return!e.includes(t)}))))},selectedItems:r}),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10}},React.createElement(a.u,{scrolldown:!0,value:h,onChange:function(e){O(e),x(1),ee(e)}},React.createElement(a.p,{value:5,label:"5 items per page"}),React.createElement(a.p,{value:10,label:"10 items per page"}),React.createElement(a.p,{value:25,label:"25 items per page"}),React.createElement(a.p,{value:50,label:"50 items per page"}),React.createElement(a.p,{value:100,label:"100 items per page"}),React.createElement(a.p,{value:200,label:"200 items per page"})),React.createElement(a.r,{currentPage:f,limit:h,total:l,onClick:function(e){return x(e)},onCurrentPageChanged:function(e){return x(e)}}))),React.createElement(a.o,{isOpen:b.autoAttach,onRequestClose:function(){return j("autoAttach",!1)},title:"Automatically attach your images to your posts",content:ne,ok:y?"Run":"I need the Pro Version",onOkClick:function(){j("autoAttach",!1),y&&$()},onCancelClick:function(){j("autoAttach",!1)}}),React.createElement(a.o,{isOpen:b.renameAll,onRequestClose:function(){return j("renameAll",!1)},title:"You are about to rename all your (unlocked) files",content:"Renaming files is a dangerous operation. Please make sure you made a backup or your entire WordPress install. Should we start?",onOkClick:function(){j("renameAll",!1),Q()},onCancelClick:function(){j("renameAll",!1)}}),React.createElement(a.o,{isOpen:b.undoAll,onRequestClose:function(){return j("undoAll",!1)},title:"You are about to undo the renaming for all your files",content:"Are you sure you would like to proceed?",onOkClick:function(){j("undoAll",!1),J()},onCancelClick:function(){j("undoAll",!1)}}),React.createElement(a.o,{isOpen:L,title:"Success",ok:"Close",content:L,onOkClick:function(){F(""),H.reset()}}),React.createElement(a.o,{isOpen:H.error,onRequestClose:te,title:"Error",content:React.createElement(React.Fragment,null,React.createElement("b",null,H.error?H.error.message:"N/A")),customButtons:React.createElement("div",{style:{display:"flex",width:"100%",flexDirection:"column"}},React.createElement("div",{style:{display:"flex",alignItems:"center"}},React.createElement(a.c,{className:"primary",onClick:function(){H.retry()}},"Retry"),React.createElement("small",{style:{marginLeft:5}},React.createElement("a",{href:"#",onClick:function(){H.autoRetry(10)}},"AUTO RETRY")),React.createElement("div",{style:{flex:"auto"}}),React.createElement(a.c,{className:"secondary",onClick:function(){H.resume()}},"Skip"),React.createElement("small",{style:{marginLeft:5,marginRight:10}},React.createElement("a",{href:"#",onClick:function(){H.setAlwaysSkip(),H.resume()}},"ALWAYS SKIP")),React.createElement(a.c,{className:"danger",onClick:te},"Stop")),React.createElement("small",{style:{marginTop:10,lineHeight:"13px"}},"AUTO RETRY will retry the actions up to 10 times. At every retry, it will increase the delay (in order to avoid timeouts). ALWAYS SKIP will simply skip the failed action (not recommended)."))}),React.createElement(a.o,{isOpen:b.editTitle,onRequestClose:function(){return j("editTitle",!1)},title:"Edit the title",okOnEnter:!0,content:React.createElement(a.k,{autoFocus:!0,id:"mfrh_edit_title",name:"mfrh_edit_title",placeholder:"title...",value:null==G?void 0:G.post_title,onBlur:function(e){return z(lt(lt({},G),{},{post_title:e}))}}),onOkClick:function(){j("editTitle",!1),Z(G)},onCancelClick:function(){j("editTitle",!1)}})))},wt=wp.element.render,_t={fetcher:a.F,revalidateOnFocus:!1};function kt(){Array.from(document.getElementsByClassName("mfrh-renamer-field")).forEach((function(e){var t=e.getAttribute("data-id");wt(React.createElement(B,{natural:!0,mediaId:t}),e)}))}document.addEventListener("DOMContentLoaded",(function(e){var t,n;new MutationObserver((function(){kt()})).observe(document.documentElement,{childList:!0,subtree:!0}),(t=document.getElementById("mfrh-admin-settings"))&&wt(React.createElement(r.a,{value:_t},React.createElement(Fe,null)),t),(n=document.getElementById("mfrh-media-rename"))&&wt(React.createElement(r.a,{value:_t},React.createElement(rt,null,React.createElement(Rt,null))),n),kt()}))}});
|
2 |
//# sourceMappingURL=index.js.map
|
1 |
+
!function(e){function t(t){for(var r,o,l=t[0],i=t[1],s=t[2],m=0,d=[];m<l.length;m++)o=l[m],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&d.push(a[o][0]),a[o]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,s||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],r=!0,l=1;l<n.length;l++){var i=n[l];0!==a[i]&&(r=!1)}r&&(c.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={0:0},c=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var l=window.wpJsonMfrh=window.wpJsonMfrh||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var s=0;s<l.length;s++)t(l[s]);var u=i;c.push([142,1]),n()}({0:function(e,t){e.exports=React},1:function(e,t,n){"use strict";var r=n(15);n.d(t,"b",(function(){return r.a}));var a=n(11);n.d(t,"c",(function(){return a.a}));n(39);var c=n(51);n.d(t,"q",(function(){return c.a}));var o=n(52);n.d(t,"a",(function(){return o.a}));var l=n(53);n.d(t,"g",(function(){return l.a}));var i=n(54);n.d(t,"v",(function(){return i.a}));n(55);var s=n(40);n.d(t,"C",(function(){return s.b})),n.d(t,"f",(function(){return s.a}));var u=n(56);n.d(t,"d",(function(){return u.a}));var m=n(57);n.d(t,"e",(function(){return m.a}));var d=n(18);n.d(t,"k",(function(){return d.a}));n(58);var p=n(41);n.d(t,"u",(function(){return p.b})),n.d(t,"p",(function(){return p.a}));n(59),n(60),n(7),n(42),n(24);var f=n(61);n.d(t,"s",(function(){return f.a}));var h=n(62);n.d(t,"i",(function(){return h.a}));var y=n(25);n.d(t,"r",(function(){return y.a}));var g=n(6);n.d(t,"j",(function(){return g.a}));var b=n(17);n.d(t,"B",(function(){return b.a}));var v=n(43);n.d(t,"t",(function(){return v.b})),n.d(t,"l",(function(){return v.a}));var E=n(63);n.d(t,"h",(function(){return E.a}));var R=n(44);n.d(t,"m",(function(){return R.a})),n.d(t,"n",(function(){return R.b}));n(64),n(26),n(21),n(16),n(65);var w=n(27);n.d(t,"o",(function(){return w.a}));n(70);var _=n(28);n.d(t,"x",(function(){return _.a}));var k=n(46);n.d(t,"y",(function(){return k.b})),n.d(t,"w",(function(){return k.a}));n(47);var x=n(71);n.d(t,"A",(function(){return x.a}));var O=n(3);n.d(t,"z",(function(){return O.a}));var T=n(8);n.d(t,"J",(function(){return T.d})),n.d(t,"H",(function(){return T.b})),n.d(t,"I",(function(){return T.c}));var P=n(12);n.d(t,"G",(function(){return P.d})),n.d(t,"F",(function(){return P.c})),n.d(t,"E",(function(){return P.b})),n.d(t,"D",(function(){return P.a}));n(22)},133:function(e,t){e.exports=ReactDOM},142:function(e,t,n){"use strict";n.r(t);var r=n(13),a=n(1),c=n(4),o=wp.i18n.__,l={};l.RENAME=o("Rename","media-file-renamer"),l.MOVE=o("Move","media-file-renamer"),l.DASHBOARD=o("Dashboard","media-file-renamer"),l.PENDING=o("Pending","media-file-renamer"),l.RENAMED=o("Renamed","media-file-renamer"),l.ALL=o("All","media-file-renamer"),l.THUMB=o("","media-file-renamer"),l.TITLE=o("Title","media-file-renamer"),l.ATTACHED_TO=o("Attached To","media-file-renamer"),l.FILENAME=o("Filename","media-file-renamer");var i,s=l,u=mfrh_media_file_renamer.prefix,m=mfrh_media_file_renamer.domain,d=mfrh_media_file_renamer.rest_url.replace(/\/+$/,""),p=mfrh_media_file_renamer.api_url.replace(/\/+$/,""),f=mfrh_media_file_renamer.plugin_url.replace(/\/+$/,""),h="1"===mfrh_media_file_renamer.is_pro,y=h&&"1"===mfrh_media_file_renamer.is_registered,g=mfrh_media_file_renamer.rest_nonce,b=mfrh_media_file_renamer.options,v=b.undo,E=b.move,R=b.manual_rename;function w(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){w(c,r,a,o,l,"next",e)}function l(e){w(c,r,a,o,l,"throw",e)}o(void 0)}))}}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var O,T,P,A,S,j,C,I=wp.element,D=I.useState,M=I.useEffect,U=c.a.div(i||(O=["\n display: flex;\n flex-direction: column;\n\n .renamer-field {\n display: flex;\n margin-bottom: 5px;\n }\n\n .renamer-actions {\n display: flex;\n align-items: center;\n }\n\n \n @media (min-width: 1400px) {\n flex-direction: row;\n\n .renamer-field {\n flex: auto;\n margin-right: 5px;\n margin-bottom: 0;\n }\n }\n"],T||(T=O.slice(0)),i=Object.freeze(Object.defineProperties(O,{raw:{value:Object.freeze(T)}})))),B=function(e){var t=e.mutate,n=k(D(e.entry),2),r=n[0],c=n[1],o=k(D(!1),2),l=o[0],i=o[1],u=k(D(""),2),m=u[0],d=u[1],f=k(D(null),2),h=f[0],y=f[1],b=e.natural,w=void 0!==b&&b,x=Object(a.I)({concurrency:2}).runTask;M((function(){d(""),e.entry?c(e.entry):e.mediaId&&O(e.mediaId)}),[e.entry]);var O=function(){var e=_(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i((function(e){return e+1})),e.next=3,x(_(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(a.G)("".concat(p,"/analyze"),{nonce:g,json:{mediaId:t}}));case 1:case"end":return e.stop()}}),e)}))));case 3:n=e.sent,c(n.data),i((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),T=function(){var e=_(regeneratorRuntime.mark((function e(t){var n,r,a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.length<=220)){e.next=3;break}return d(t),e.abrupt("return");case 3:n=t.lastIndexOf("."),r=-1===n?"":".".concat(t.slice(n+1)),a=r.length>0?r.length:0,c="".concat(t.slice(0,220-a)).concat(r),d(c);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=function(){var e=_(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c(n),t&&t();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),A=function(){var e=_(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i((function(e){return e+1})),e.next=3,Object(a.G)("".concat(p,"/rename"),{nonce:g,json:{mediaId:r.ID}});case 3:t=e.sent,P(t.data),y(null),i((function(e){return e-1}));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),S=function(){var e=_(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i((function(e){return e+1})),e.next=3,Object(a.G)("".concat(p,"/rename"),{nonce:g,json:{mediaId:r.ID,filename:m}});case 3:t=e.sent,P(t.data),y(null),d(""),i((function(e){return e-1}));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),j=function(){var e=_(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i((function(e){return e+1})),e.next=3,Object(a.G)("".concat(p,"/undo"),{nonce:g,json:{mediaId:r.ID}});case 3:t=e.sent,P(t.data,r.current_filename),i((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=function(){var e=_(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i((function(e){return e+1})),e.next=3,Object(a.G)("".concat(p,"/set_lock"),{nonce:g,json:{mediaId:r.ID,lock:!r.locked}});case 3:t=e.sent,P(t.data),i((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=_(regeneratorRuntime.mark((function e(){var t,n,c,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log({entry:r}),t=r.metadata.file||"",n="/"+t.substring(0,t.lastIndexOf("/")),!(c=(c=(c=prompt("Where would you like to move this file (in the /uploads directory)?",n)).replace(/\/+$/,""))||"/")){e.next=13;break}return i((function(e){return e+1})),e.next=10,Object(a.G)("".concat(p,"/move"),{nonce:g,json:{mediaId:r.ID,newPath:c}});case 10:o=e.sent,P(o.data),i((function(e){return e-1}));case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=!!m,N=B?m:h||(null==r?void 0:r.current_filename);return React.createElement(a.b,{busy:l},React.createElement(U,null,React.createElement("div",{className:"renamer-field"},React.createElement(a.k,{natural:w,readOnly:!R||l,value:N,onChange:T,onEnter:S,maxLength:220,style:{marginRight:0,flex:"auto"}}),!B&&React.createElement(a.j,{icon:null!=r&&r.locked?"lock":"lock-open",width:24,title:null!=r&&r.locked?"Unlock, to allow future actions":"Lock, to avoid future actions",style:{position:"relative",left:-26,marginRight:-22},color:null!=r&&r.locked?a.z.blue:"#5a5a5a82",onClick:C}),B&&React.createElement(a.j,{icon:"close",width:24,style:{position:"relative",left:-26,marginRight:-22},color:null!=r&&r.locked?a.z.blue:"#5a5a5a82",onClick:function(){d("")}}),(null==r?void 0:r.proposed_filename_exists)&&React.createElement(a.j,{icon:"alert",color:"orange",tooltip:{text:"The ideal filename (".concat(r.proposed_filename,") already exists."),position:"left"}}),v&&!B&&(null==r?void 0:r.original_filename)&&React.createElement(a.j,{icon:"file-undo",title:"Rollback to original",color:a.z.red,onClick:j,onMouseEnter:function(){return y(null==r?void 0:r.original_filename)},onMouseLeave:function(){return y(null)}})),React.createElement("div",{className:"renamer-actions"},!B&&(null==r?void 0:r.proposed_filename)&&!(null!=r&&r.proposed_filename_exists)&&React.createElement(a.c,{style:{flex:3},title:"Rename automatically",onMouseEnter:function(){return y(null==r?void 0:r.proposed_filename)},onMouseLeave:function(){return y(null)},onClick:A},"Auto Rename"),R&&B&&React.createElement(a.c,{style:{flex:3},title:"Rename manually",onClick:S},s.RENAME),E&&React.createElement(a.c,{style:{flex:1},title:"Move",onClick:I},s.MOVE))))};function N(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var L=c.a.div(P||(P=N(["\n color: white;\n padding: 15px;\n margin-bottom: -15px;\n\n a {\n color: #7dedff;\n text-decoration: none;\n }\n\n p {\n font-size: 15px;\n }\n"]))),F=Object(c.a)(a.a)(A||(A=N(["\n\n .nui-block-title {\n display: none;\n }\n\n .nui-block-content {\n display: flex;\n padding: 10px;\n\n h2 {\n color: #055082;\n font-size: 16px;\n margin: 5px 0 5px 0;\n\n a {\n text-decoration: none;\n }\n }\n\n p {\n margin: 0px;\n line-height: 18px;\n }\n }\n"]))),q=c.a.img(S||(S=N(["\n width: 85px;\n height: 85px;\n padding-right: 10px;\n"]))),G=c.a.div(j||(j=N(["\n\n margin: 15px;\n\n .center {\n background: white;\n border-radius: 10px;\n padding: 10px;\n max-width: 100%\n overflow: none;\n\n h2 {\n font-size: 26px;\n }\n\n table {\n width: 100%;\n\n tr td:first-child {\n width: 220px;\n font-weight: bold;\n color: #1e7cba;\n }\n\n * {\n overflow-wrap: anywhere;\n }\n }\n }\n\n hr {\n border-color: #1e7cba;\n }\n"]))),z=c.a.ul(C||(C=N(["\n margin-top: 10px;\n background: rgb(0, 72, 88);\n padding: 10px;\n color: rgb(58, 212, 58);\n max-height: 600px;\n min-height: 200px;\n display: block;\n font-family: monospace;\n font-size: 12px;\n white-space: pre;\n overflow-x: auto;\n width: calc(100vw - 276px);\n\n .log-date {\n color: white;\n margin-left: 8px;\n }\n\n .log-type {\n background: #0000004d;\n padding: 2px 5px;\n border-radius: 8px;\n text-transform: uppercase;\n }\n\n .log-content {\n display: block;\n }\n\n .log-warning .log-type {\n background: #ccb028;\n color: white;\n }\n\n .log-fatal .log-type {\n background: #cc2828;\n color: white;\n }\n"])));function H(e){return function(e){if(Array.isArray(e))return J(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Y(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function W(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){Y(c,r,a,o,l,"next",e)}function l(e){Y(c,r,a,o,l,"throw",e)}o(void 0)}))}}function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||$(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){if(e){if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J(e,t):void 0}}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var K=wp.element,X=K.useState,Q=K.useEffect,Z="".concat(d,"/meow-common/v1"),ee=function(e){var t=e.request,n=e.title,r=e.max,c=V(X(!1),2),o=c[0],l=c[1],i=V(X([]),2),s=i[0],u=i[1],m=s.length>0?s.reduce((function(e,t){return e+t})):0,d=s.length>0?Math.ceil(m/s.length):0,p=!s.length&&o;Q((function(){o&&setTimeout(W(regeneratorRuntime.mark((function e(){var n,r,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),e.next=3,Object(a.G)("".concat(Z,"/").concat(t),{nonce:g});case 3:r=(new Date).getTime(),c=r-n,u((function(e){return[].concat(H(e),[c])}));case 6:case"end":return e.stop()}}),e)}))),1e3)}),[s]);return React.createElement(L,{style:{width:200,textAlign:"center"}},React.createElement(a.B,{h2:!0,style:{color:"white"}},n),React.createElement(a.h,{size:200,value:p?r:d,max:r},React.createElement("span",{style:{fontSize:20}},p?"START":d+" ms"),React.createElement("span",{style:{fontSize:12}},p?"YOUR ENGINE":s.length+" requests")),React.createElement(a.c,{style:{width:"100%",marginTop:10},color:o?"#cc3627":"#ccb027",onClick:function(){o||u([]),l(!o)}},o?"Stop":"Start"))};function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach((function(t){re(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ae(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function ce(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){ae(c,r,a,o,l,"next",e)}function l(e){ae(c,r,a,o,l,"throw",e)}o(void 0)}))}}function oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return le(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ie=wp.element,se=ie.useState,ue=ie.useEffect;p&&d&&f||console.error("[@common/dashboard] apiUrl, restUrl and pluginUrl are mandatory.");var me="".concat(d,"/meow-common/v1"),de=React.createElement(L,null,React.createElement(a.B,{p:!0},"Meow Apps is run by Jordy Meow, a photographer and software developer living in Japan (and taking ",React.createElement("a",{target:"_blank",href:"https://offbeatjapan.org"},"a lot of photos"),"). Meow Apps proposes a suite of plugins focusing on photography, imaging, optimization and SEO. The ultimate goal is to make your website better, faster, while making it easy. Meow Apps also teams up with the best players in the community. For more information, please check ",React.createElement("a",{href:"http://meowapps.com",target:"_blank"},"Meow Apps"),".")),pe=React.createElement(L,null,React.createElement(a.B,{p:!0},"The ",React.createElement("b",null,"Empty Request Time")," helps you analyzing the raw performance of your install by giving you the average time it takes to run an empty request to your server. You can try to disable some plugins (or change their options) then Start this again to see how it influences the results. An excellent install would have an Empty Request Time of less than 500 ms. Keep it absolutely under 2,000 ms! For more information, ",React.createElement("a",{href:"https://meowapps.com/clean-optimize-wordpress/#Optimize_your_Empty_Request_Time",target:"_blank"},"click here"),"."),React.createElement(a.B,{p:!0},React.createElement("b",null,"File Operation Time")," creates a temporary size of 10MB every time. ",React.createElement("b",null,"SQL Request Time")," counts the number of posts. Those two should be very fast, and almost the same as the ",React.createElement("b",null,"Empty Request Time"),".")),fe=React.createElement(L,null,React.createElement(a.B,{p:!0},"Too many WordPress installs are blown-up with useless and/or heavy plugins, and not aware of best practices. That's not the fault of the users; WordPress pretends to be simple but it is in fact very complex, and the immensity and diversity of the community around it makes it a real jungle where everything is possible."),React.createElement(a.B,{p:!0},"A rule of thumb is to keep your WordPress install as simple as possible, with the least number of plugins installed (run away from the heavy ones) and an excellent hosting service. Avoid VPS or self-hosted solutions; you must be a professional to actually set them up so that they are actually performant."),React.createElement(a.B,{p:!0},"On the Meow Apps website, you will find articles which are always updated with the latest recommendations.",React.createElement("ul",null,React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/how-to-debug-wordpress-errors/",target:"_blank"},"How To Debug WordPress")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-improve-seo-wordpress/",target:"_blank"},"SEO Checklist & Optimization")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-faster-wordpress-optimize/",target:"_blank"},"Optimize your WordPress Speed")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-optimize-images-wordpress/",target:"_blank"},"Optimize Images (CDN, and so on)")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-hosting-service-wordpress/",target:"_blank"},"Best Hosting Services for WordPress"))))),he=["".concat(me,"/all_settings/"),{headers:{"X-WP-Nonce":g}}],ye=function(){var e=oe(se(!1),2),t=e[0],n=e[1],c=Object(r.b)(he,a.F),o=c.data,l=c.mutate,i=c.error,s=null==o?void 0:o.data,u=null==s?void 0:s.meowapps_hide_meowapps,m=null==s?void 0:s.force_sslverify,d=oe(se(!1),2),p=d[0],h=d[1],y=oe(se([]),2),b=y[0],v=y[1],E=oe(se(""),2),R=E[0],w=E[1];ue((function(){i&&!t&&(n(!0),console.error("Error from UseSWR",i.message))}),[i]),ue((function(){var e=document.getElementById("meow-common-phpinfo");w(e.innerHTML)}),[]);var _=function(){var e=ce(regeneratorRuntime.mark((function e(t,n){var r,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=ne({},o.data))[n]=t,l(ne(ne({},o),{},{data:r}),!1),h(!0),e.next=6,Object(a.G)("".concat(me,"/update_option"),{json:{name:n,value:t},nonce:g});case 6:c=e.sent,h(!1),c.success||alert(c.message),l();case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),k=function(){var e=ce(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.next=3,Object(a.G)("".concat(me,"/error_logs"),{nonce:g});case 3:t=e.sent,n=t&&t.data?t.data:[],v(n.reverse()),h(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=React.createElement(a.v,{title:"Main Menu"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"meowapps_hide_meowapps",label:"Hide (Not Recommended)",description:React.createElement(a.B,{p:!0},"This will hide the Meow Apps Menu (on the left side) and everything it contains. You can re-enable it through though an option that will be added in Settings → General."),value:"1",disabled:p,checked:u,onChange:_}))),O=React.createElement(a.v,{title:"SSL Verify"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"force_sslverify",label:"Force (Not Recommended)",description:React.createElement(a.B,{p:!0},"This will enforce the usage of SSL when checking the license or updating the plugin."),value:"1",disabled:p,checked:m,onChange:_})));return React.createElement(a.q,{showRestError:t},React.createElement(a.i,{title:"The Dashboard"}),React.createElement(a.C,null,React.createElement(a.f,{full:!0},React.createElement(a.y,null,React.createElement(a.w,{title:"Meow Apps"},de,React.createElement(a.C,null,React.createElement(a.f,{minimal:!0},React.createElement(F,{title:"Media Cleaner",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/media-cleaner.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/media-cleaner/"},"Media Cleaner")),React.createElement("p",null,"The Cleaner analyzes your WordPress entirely to find out which files are not used. You can trash them, before deleting them permanently. Your WordPress will breath again :)"))),React.createElement(F,{title:"Database Cleaner",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/database-cleaner.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/database-cleaner/"},"Database Cleaner")),React.createElement("p",null,"Clean your WordPress database. This plugin is simple, handles risk levels, and aims to work even on oversized databases on which other plugins fail to operate."))),React.createElement(F,{title:"Media File Renamer",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/media-file-renamer.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/media-file-renamer/"},"Media File Renamer")),React.createElement("p",null,"The Renamer will help you in getting nicer filenames for an improved SEO and a tidier filesystem. It's mostly automatic and very fun to use."))),React.createElement(F,{title:"Social Engine",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/social-engine.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/social-engine/"},"Social Engine")),React.createElement("p",null,"Organize, schedule and automate the publishing of your content and photos on social accounts. Similar to Buffer, TweetDeck, etc, but without all the limitations, and in your WordPress."))),React.createElement(F,{title:"Meow Analytics",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/meow-analytics.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-analytics/"},"Meow Analytics")),React.createElement("p",null,"Are you tired of those heavy plugins, accessing your Google Analytics deliberately? Switch to Meow Analytics!")))),React.createElement(a.f,{minimal:!0},React.createElement(F,{title:"Photo Engine",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/wplr-sync.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/wplr-sync/"},"Photo Engine")),React.createElement("p",null,"Are you using Lightroom? So you know Photo Engine already. Wait, you don't? You must try it! This plugin will be your favorite very soon."))),React.createElement(F,{title:"Meow Gallery",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/meow-gallery.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-gallery/"},"Meow Gallery")),React.createElement("p",null,"This is the fastest gallery system... and it is pretty as well! It is 100% compatible with the native WordPress galleries and therefore, works right away."))),React.createElement(F,{title:"Meow Lightbox",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/meow-lightbox.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-lightbox/"},"Meow Lightbox")),React.createElement("p",null,"A very sleek and performant Lightbox which will also display your EXIF data (camera, lens, aperture...). Photographers love it."))),React.createElement(F,{title:"Perfect Images (Retina)",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/wp-retina-2x.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/wp-retina-2x/"},"Perfect Images + Retina")),React.createElement("p",null,"It handles Retina, help you managing the Image Sizes registered in your WP, and much more."))),React.createElement(F,{title:"Contact Form Block",className:"primary"},React.createElement(q,{src:"".concat(f,"/common/img/contact-form-block.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/contact-form-block/"},"Contact Form Block")),React.createElement("p",null,"A simple, pretty and superlight contact form. If you simply want your visitors to get in touch with you, this contact form will be perfect for you and your WordPress.")))))),React.createElement(a.w,{title:"Performance"},pe,React.createElement("div",{style:{display:"flex",justifyContent:"space-around",marginBottom:25}},React.createElement(ee,{title:"Empty Request Time",request:"empty_request",max:2500}),React.createElement(ee,{title:"File Operation Time",request:"file_operation",max:2600}),React.createElement(ee,{title:"SQL Request Time",request:"sql_request",max:2800}))),React.createElement(a.w,{title:"Recommendations"},fe),React.createElement(a.w,{title:"PHP Info"},React.createElement(G,{dangerouslySetInnerHTML:{__html:R}})),React.createElement(a.w,{title:"PHP Error Logs"},React.createElement(L,null,React.createElement(a.c,{style:{marginBottom:10},color:"#ccb027",onClick:k},"Load PHP Error Logs"),React.createElement(z,null,b.map((function(e){return React.createElement("li",{class:"log-".concat(e.type)},React.createElement("span",{class:"log-type"},e.type),React.createElement("span",{class:"log-date"},e.date),React.createElement("span",{class:"log-content"},e.content))}))))),React.createElement(a.w,{title:"Settings"},React.createElement(a.a,{title:"Settings",className:"primary"},x,O))))))};function ge(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function be(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){ge(c,r,a,o,l,"next",e)}function l(e){ge(c,r,a,o,l,"throw",e)}o(void 0)}))}}function ve(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ee(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Re=wp.element,we=Re.useState,_e=Re.useEffect,ke="".concat(d,"/meow-licenser/").concat(u,"/v1"),xe=function(){var e=ve(we(!1),2),t=e[0],n=e[1],r=ve(we(!1),2),c=r[0],o=r[1],l=ve(we(null),2),i=l[0],s=l[1],u=ve(we(null),2),m=u[0],d=u[1],p=ve(we(""),2),f=p[0],b=p[1],v=y&&(!m||"valid"!==m.license),E=function(){var e=be(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h){e.next=2;break}return e.abrupt("return");case 2:return n(!0),e.next=5,Object(a.G)("".concat(ke,"/get_license"),{nonce:g});case 5:t=e.sent,d(t.data),t.data.key&&b(t.data.key),n(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=be(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,Object(a.G)("".concat(ke,"/set_license"),{nonce:g,json:{serialKey:null}});case 3:e.sent.success&&(b(""),d(null),s("licenseRemoved")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),w=function(){var e=be(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,Object(a.G)("".concat(ke,"/set_license"),{nonce:g,json:{serialKey:f,override:!0}});case 3:(t=e.sent).success&&(d(t.data),t.data&&!t.data.issue&&s("licenseAdded")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_=function(){var e=be(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MEOW_OVERRIDE"!==f){e.next=5;break}return o(!0),d(null),b(""),e.abrupt("return");case 5:return n(!0),e.next=8,Object(a.G)("".concat(ke,"/set_license"),{nonce:g,json:{serialKey:f}});case 8:(t=e.sent).success&&(d(t.data),t.data&&!t.data.issue&&s("licenseAdded")),n(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();_e((function(){E()}),[]);var k=v?"Forced License":y?"Enabled":"Disabled",x=v||m&&"valid"===m.license,O="Your license is active. Thanks a lot for your support :)";v&&m&&m.check_url&&(O=React.createElement(React.Fragment,null,React.createElement("span",null,O),React.createElement("br",null),React.createElement("small",null,"This license was enabled manually. To check your license status, please click ",React.createElement("a",{target:"_blank",href:m.check_url+"&cache="+642e3*Math.random()},"here"),"."))),x||(m?"no_activations_left"===m.issue?O=React.createElement("span",null,"There are no activations left for this license. You can visit your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"Meow Apps Store"),", unregister a site, and click on ",React.createElement("i",null,"Retry to validate"),"."):"expired"===m.issue?O=React.createElement("span",null,"Your license has expired. You can get another license or renew the current one by visiting your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"Meow Apps Store"),"."):"missing"===m.issue?O="This license does not exist.":"disabled"===m.issue?O="This license has been disabled.":"item_name_mismatch"===m.issue?O="This license seems to be for a different plugin... isn't it? :)":"forced"===m.issue?O="ABC":(O=React.createElement("span",null,"There is an unknown error related to the system or this serial key. Really sorry about this! Make sure your security plugins and systems are off temporarily. If you are still experiencing an issue, please ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/contact/"},"contact us"),"."),console.error({license:m})):O="Unknown error :(");var T=React.createElement(a.a,{title:"Pro Version (Not Installed)",className:"primary"},"You will find more information about the Pro Version ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"here"),". If you actually bought the Pro Version already, please remove the current plugin and download the Pro Version from your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/"},"Meow Apps Store"),"."),P=React.createElement(a.a,{title:"Pro Version (".concat(k,")"),busy:t,className:"primary"},React.createElement(a.v,{title:"Serial Key",style:{fontWeight:"bold"}},React.createElement(a.k,{id:"mfrh_pro_serial",name:"mfrh_pro_serial",disabled:t,value:f,onChange:function(e){return b(e)},placeholder:""})),m&&!x&&React.createElement(a.m,null,O),m&&x&&React.createElement(a.n,null,O),!m&&React.createElement(a.B,{p:!0},"Insert your serial key above. If you don't have one yet, you can get one ",React.createElement("a",{href:"https://meowapps.com"},"here"),". If there was an error during the validation, try the ",React.createElement("i",null,"Retry")," to ",React.createElement("i",null,"validate")," button."),React.createElement(a.v,{contentAlign:"right"},m&&!x&&React.createElement(a.c,{className:"secondary",disabled:t||!f,onClick:_},"Retry to validate"),m&&m.key===f&&React.createElement(a.c,{className:"secondary",disabled:t||!f,onClick:R},"Remove License"),React.createElement(a.c,{disabled:t||!f||m&&m.key===f,onClick:_},"Validate License"),c&&!x&&React.createElement(a.c,{disabled:t||!f||m&&m.key===f,onClick:w,className:"danger"},"Force License")),React.createElement(a.o,{isOpen:"licenseAdded"===i,title:"Thank you :)",content:"The Pro features have been enabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}),React.createElement(a.o,{isOpen:"licenseRemoved"===i,title:"Goodbye :(",content:"The Pro features have been disabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}));return h?P:T},Oe=wp.element.render;function Te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(n),!0).forEach((function(t){Ae(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Se(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function je(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){Se(c,r,a,o,l,"next",e)}function l(e){Se(c,r,a,o,l,"throw",e)}o(void 0)}))}}function Ce(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ie(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}document.meowDashboardLoaded||(document.meowDashboardLoaded=!0,document.addEventListener("DOMContentLoaded",(function(e){var t=document.getElementById("meow-common-dashboard");t&&Oe(React.createElement(ye,null),t)})));var De=wp.element,Me=De.useState,Ue=De.useMemo,Be=De.useCallback,Ne={marginTop:10,background:"rgb(0, 72, 88)",padding:10,color:"rgb(58, 212, 58)",maxHeight:600,minHeight:200,display:"block",fontFamily:"monospace",fontSize:12,whiteSpace:"pre",overflowX:"auto",width:"calc(100vw - 276px)"},Le=["".concat(p,"/all_settings/"),{headers:{"X-WP-Nonce":g}}],Fe=function(){var e,t,n,c=Object(r.b)(Le,a.F),o=c.data,l=(c.mutate,Object(a.H)(o,{},!0)),i=l.busy,s=(l.data,l.error),d=Ce(Me(""),2),f=d[0],v=d[1],E=Ce(Me(!1),2),R=E[0],w=E[1],_=Ce(Me(b),2),k=_[0],x=_[1],O=i||R,T=k.auto_rename,P=k.on_upload,A=k.rename_slug,S=k.convert_to_ascii,j=k.update_posts,C=k.update_excerpts,I=k.update_postmeta,D=k.update_elementor,M=k.undo,U=k.move,B=k.manual_rename,N=k.manual_sanitize,L=k.numbered_files,F=k.sync_alt,q=k.sync_media_title,G=k.force_rename,z=k.log,H=k.logsql,Y=k.rename_guid,W=k.case_insensitive_check,V=k.rename_on_save,$=null!==(e=k.acf_field_name)&&void 0!==e?e:null,J=null!==(t=k.images_only)&&void 0!==t&&t,K=null!==(n=k.featured_only)&&void 0!==n&&n,X=k.clean_uninstall,Q=k.delay,Z=k.autolock_auto,ee=k.autolock_manual,te=[{id:"media_title",value:"media_title",label:React.createElement("span",null,"Based on Media Title"),requirePro:!1},{id:"post_acf_field",value:"post_acf_field",label:React.createElement("span",null,"Based on Attached Post (ACF Field)"),requirePro:!1},{id:"post_title",value:"post_title",label:React.createElement("span",null,"Based on Attached Post Title"),requirePro:!y},{id:"alt_text",value:"alt_text",label:React.createElement("span",null,"Based on Alternative Text"),requirePro:!y},{id:"anonymize_md5",value:"anonymize_md5",label:React.createElement("span",null,"Anonymize with MD5"),requirePro:!y},{id:"none",value:"none",label:React.createElement("span",null,"Disable Automatic Rename"),requirePro:!1}],ne=Be(function(){var e=je(regeneratorRuntime.mark((function e(t,n){var r,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Pe(Pe({},k),{},Ae({},n,t)),w(!0),e.prev=2,e.next=5,Object(a.G)("".concat(p,"/update_option"),{nonce:g,json:{options:r}});case 5:(c=e.sent).success||alert(c.message),x(c.options),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),alert(e.t0.message);case 13:return e.prev=13,w(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[2,10,13,16]])})));return function(t,n){return e.apply(this,arguments)}}(),[k]),re=function(){var e=je(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,Object(a.G)("".concat(p,"/refresh_logs"),{nonce:g});case 3:(t=e.sent).success&&v(t.data),w(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ae=function(){var e=je(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,Object(a.G)("".concat(p,"/clear_logs"),{nonce:g});case 3:(t=e.sent).success&&v(t.data),w(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ce=React.createElement(a.a,{busy:O,title:"Side Updates",className:"primary"},React.createElement(a.B,{p:!0,style:{marginTop:0}},"When the files are renamed, many links to them on your WordPress might be broken. Those options are updating the references to those files. ",React.createElement("strong",null,"Give it a try, every install is different and it might not work for certain kind of references.")),React.createElement(a.v,{title:"Posts"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"update_posts",disabled:O,label:"Enable",description:React.createElement(a.B,{p:!0},"Update the references to the renamed files in the ",React.createElement("strong",null,"content")," of the posts (of all types)."),value:"1",checked:j,onChange:ne}))),React.createElement(a.v,{title:"Excerpts"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"update_excerpts",disabled:O,label:"Enable",description:React.createElement(a.B,{p:!0},"Update the references to the renamed files in the ",React.createElement("strong",null,"excerpts")," of the posts (of all types)."),value:"1",checked:C,onChange:ne}))),React.createElement(a.v,{title:"Post Meta"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"update_postmeta",disabled:O,label:"Enable",description:React.createElement(a.B,{p:!0},"Update the references in the ",React.createElement("strong",null,"custom fields")," of the posts (including pages and custom types metadata)."),value:"1",checked:I,onChange:ne}))),React.createElement(a.v,{title:"Elementor"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"update_elementor",disabled:O,label:"Enable",description:React.createElement(a.B,{p:!0},"Update the references in the ",React.createElement("strong",null,"encrypted data")," of the posts handled by Elementor. ",React.createElement("span",null,"This will probably slow down the renaming extremely and cause timeouts. Test it carefully.")),value:"1",checked:D,onChange:ne})))),oe=React.createElement(a.v,{title:"Method"},React.createElement(a.u,{id:"auto_rename",disabled:O,value:T,scrolldown:!0,name:"auto_rename",description:"Attached Post includes all kinds of Post Types: Posts, Pages, Products, etc.",onChange:ne},te.map((function(e){return React.createElement(a.p,{key:e.id,id:e.id,value:e.value,label:e.label,requirePro:e.requirePro})})))),le=Ue((function(){return"post_acf_field"!==T?null:React.createElement(a.v,{title:"ACF Field Name"},React.createElement(a.k,{id:"acf_field_name",name:"acf_field_name",value:$,onBlur:ne}))}),[$,T,ne]),ie=React.createElement(a.v,{title:"Images Only"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"images_only",label:"Enable",description:"Restricts the renaming to images and icons. Nothing else will be renamed.",value:"1",checked:J,onChange:ne}))),se=React.createElement(a.v,{title:"Featured Only"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"featured_only",label:"Enable",description:"Restricts the renaming to Featured Images only.",value:"1",checked:K,onChange:ne}))),ue=React.createElement(a.v,{title:"On Upload"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"on_upload",disabled:O,label:"Enable",description:React.createElement(React.Fragment,null,React.createElement("span",null,"If your image has an EXIF title, it will be used to decide the filename. "),"post_title"===T&&React.createElement("span",null,"Note: The Attached Post Title ",React.createElement("u",null,"will not be used")," at the time of the upload due to WordPress API constraints.")),value:"1",checked:P,onChange:ne}))),me=React.createElement(a.v,{title:"Slug/Permalink"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"rename_slug",disabled:O,label:"Sync with filename",description:"Better to keep this un-checked as the link might have been referenced somewhere else.",value:"1",checked:A,onChange:ne}))),de=React.createElement(a.v,{title:"Transliteration"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"convert_to_ascii",disabled:O,label:"Enable (Recommended)",description:React.createElement(a.B,{p:!0},"Replace accents, emoticons, diacritics, umlauts, cyrillic and any kind of tricky characters by their ASCII equivalent.",React.createElement("br",null)," ",React.createElement("i",null,"Examples: tête → tete, schön → schon, Добро → dobro, etc.")),value:"1",requirePro:!y,checked:S,onChange:ne}))),pe=React.createElement(a.v,{title:"Undo"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"undo",disabled:O,label:"Enable",description:"An undo icon will be added to the UI. This allows to rollback to the original filename.",value:"1",checked:M,onChange:ne}))),fe=React.createElement(a.v,{title:"Move"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"move",disabled:O,label:"Enable",description:"A move button will be added, and will allow you to move a file to another directory.",value:"1",checked:U,onChange:ne,requirePro:!y}))),he=React.createElement(a.v,{title:"Rename Field"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"manual_rename",disabled:O,label:"Enable",description:"An editable field will be added everywhere your files appear in the UI.",value:"1",checked:B,onChange:ne}))),ye=React.createElement(a.v,{title:"Sanitize"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"manual_sanitize",disabled:O,label:"Enable",description:"Even if it is manual, the plugin will sanitize the filename you type. That way, you are sure the final filename will be clean and safe to use.",value:"1",checked:N,onChange:ne}))),ge=React.createElement(a.v,{title:"Force Rename"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"force_rename",disabled:O,label:"Enable",description:"Update the references to the file even if the file renaming itself was not successful. You might want to use that option if your install is broken and you are trying to link your Media to files for which the filenames has been altered (after a migration for exemple)",value:"1",requirePro:!y,checked:G,onChange:ne}))),be=React.createElement(a.v,{title:"Numbered Files"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"numbered_files",disabled:O,label:"Enable Numbering",description:"Identical filenames will be allowed by the plugin and a number will be appended automatically (myfile.jpg, myfile-2.jpg, myfile-3.jpg, etc).",requirePro:!y,value:"1",checked:L,onChange:ne}))),ve=React.createElement(a.v,{title:"ALT Text"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"sync_alt",disabled:O||"alt_text"==T,label:React.createElement(a.B,null,"Synchronize"),description:"The ALT Text will be synchronized with the same source used for the filename.",requirePro:!y,value:"1",checked:F,onChange:ne}))),Ee=React.createElement(a.v,{title:"Media Title"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"sync_media_title",disabled:O||"media_title"===T,label:React.createElement(a.B,null,"Synchronize"),description:"The Media Title will be synchronized with the same source used for the filename.",requirePro:!y,value:"1",checked:q,onChange:ne}))),Re=React.createElement(a.v,{title:"Logs"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"log",label:"Enable",description:React.createElement(a.B,{p:!0},"Simple logging that explains which actions has been run."),value:"1",checked:z,onChange:ne}),React.createElement("div",{style:{marginTop:20}},React.createElement(a.c,{onClick:re},"Refresh Logs"),React.createElement(a.c,{className:"danger",onClick:ae},"Clear Logs")))),we=React.createElement(a.v,{title:"SQL Logs"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"logsql",disabled:O,label:"Enable",description:React.createElement(a.B,{p:!0},"The files sql.log and sql_revert.log will be created in the /logs directory and will include the raw SQL queries which were run by the plugin. If there is an issue, the revert SQL file can help you."),requirePro:!y,value:"1",checked:H,onChange:ne}))),_e=React.createElement(a.v,{title:"GUID"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"rename_guid",disabled:O,label:"Sync with filename",description:"The GUID will be renamed like the new filename. Better to keep this un-checked.",value:"1",checked:Y,onChange:ne}))),ke=React.createElement(a.v,{title:"Case Insensitive"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"case_insensitive_check",label:"Enable",value:"1",checked:W,onChange:ne,description:React.createElement(React.Fragment,null,'This will consider the file such as "abc.jpg" and "ABC.JPG" as the same file. More information ',React.createElement("a",{target:"_blank",href:"https://meowapps.com/media-file-renamer-faq-issues/"},"here"),". You should check this if you are on a Windows-based server.")}))),Oe=React.createElement(a.v,{title:"Rename on Post Save"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"rename_on_save",disabled:O,label:"Enable (Unsafe)",description:"You can modify the titles of your media while editing a post but, of course, the plugin can't update the HTML at this stage. With this option, the plugin will update the filenames and HTML after that you saved the post.",value:"1",checked:V,onChange:ne}))),Te=React.createElement(a.v,{title:"Plugin Data"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"clean_uninstall",label:"Delete all",description:"The database and all the options of the plugin will be removed on uninstall. This also includes the information about the plugin's trash.",value:"1",checked:X,onChange:ne}))),Se=React.createElement(a.v,{title:"Delay (in ms)"},React.createElement(a.k,{id:"delay",type:"number",value:Q,min:"0",max:"20000",onEnter:ne,onBlur:ne,description:"Time to wait between each request (in milliseconds). The overall process is intensive so this gives the chance to your server to chill out a bit. A very good server doesn't need it, but a slow/shared hosting might even reject requests if they are too fast and frequent. Recommended value is actually 0, 100 for safety, 2000 or 5000 if your hosting is kind of cheap."})),Ie=React.createElement(a.v,{title:"Automatic Rename"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"autolock_auto",disabled:O,label:"Lock",description:"This is disabled by default; your media will be always renamed when needed.",value:"1",checked:Z,onChange:ne}))),De=React.createElement(a.v,{title:"Manual Rename"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"autolock_manual",disabled:O,label:"Lock",description:"This is enabled by default; when you rename a media manually, it normally means that you want to fix the filename by yourself.",value:"1",checked:ee,onChange:ne})));return React.createElement(a.q,{nekoErrors:[s]},React.createElement(a.i,{title:"Media File Renamer | Settings",subtitle:"By Jordy Meow"},React.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},React.createElement(a.c,{className:"header",onClick:function(){return window.open("https://meowapps.com/media-file-renamer-tutorial/","_blank")}},"Tutorial"),React.createElement(a.c,{className:"header",icon:"dashboard",onClick:function(){return location.href="upload.php?page=dashboard"}},"Dashboard"))),React.createElement(a.C,null,React.createElement(a.f,{full:!0},React.createElement(a.g,null,React.createElement(a.B,{p:!0},"It works out of the box, the default settings are good for most installs. However, you should really have a look at the ",React.createElement("a",{href:"https://meowapps.com/plugin/media-file-renamer/"},"tutorial"),". If you are a SEO guru or someone who loves having a perfectly neat filesystem, it is recommended to use automatic renaming first, then to tweak specific files with manual renaming. The ",React.createElement("a",{href:"/wp-admin/upload.php?page=dashboard"},"Renamer Dashboard")," makes it very easy.")),React.createElement(a.y,{keepTabOnReload:!0},React.createElement(a.w,{title:"Basic"},React.createElement(a.C,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:O,title:"Settings",className:"primary"},React.createElement(a.B,{h2:!0},"Automatic"),React.createElement(a.B,{p:!0},"This plugin's main goal is to make the process of optimizing your filenames entirely automatic. By default, your files will be named after the title of your media entry."),oe,le,React.createElement(a.B,{h2:!0},"Manual"),he,ye,React.createElement(a.B,{h2:!0},"Extra Options"),ue,ie,se)),React.createElement(a.f,{minimal:!0},ce,React.createElement(a.a,{busy:O,title:"UI (Extra Features)",className:"primary"},pe,fe)))),React.createElement(a.w,{title:"Advanced"},React.createElement(a.C,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:O,title:"Renaming",className:"primary"},de,be),React.createElement(a.a,{busy:O,title:"Fields Syncing",className:"primary"},me,_e,ve,Ee,React.createElement(a.B,{p:!0},"The fields in the database will be synchronized, but the data already written in your HTML will not be overwritten.")),React.createElement(a.a,{busy:O,title:"Auto Lock",className:"primary"},Ie,De),React.createElement(a.a,{busy:O,title:"On Uninstall",className:"primary"},Te)),React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:O,title:"Performance",className:"primary"},Se),React.createElement(a.a,{busy:O,title:"For Developers",className:"primary"},ke,ge,we,Oe)))),React.createElement(a.w,{title:"License (Pro)"},React.createElement(xe,{domain:m,prefix:u,isPro:h,isRegistered:y})),React.createElement(a.w,{title:"Logs & Debug"},React.createElement(a.a,{busy:O,className:"primary"},Re),React.createElement("div",{style:Ne},f))))))},qe=n(0);function Ge(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ze(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function He(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?He(Object(n),!0).forEach((function(t){We(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function We(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ve(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function $e(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){Ve(c,r,a,o,l,"next",e)}function l(e){Ve(c,r,a,o,l,"throw",e)}o(void 0)}))}}var Je,Ke,Xe={pending:"-",renamed:"-",locked:"-",all:"-"},Qe={accessor:"id",by:"asc"},Ze=0,et={filterBy:"pending",sort:Qe,page:1,limit:parseInt(b.posts_per_page),search:"",busy:!1,stats:Xe,apiErrors:null,status:"",entries:[],selectedItems:[],total:0,options:b,autoRename:b.auto_rename,onUpload:b.on_upload,renameSlug:b.rename_slug,convertToAscii:b.convert_to_ascii,updatePosts:b.update_posts,updatePostmeta:b.update_postmeta,undo:b.undo,move:b.move,manualRename:b.manual_rename,numberedFiles:b.numbered_files,syncAlt:b.sync_alt,syncMedia_title:b.sync_media_title,forceRename:b.force_rename,log:b.log,logsql:b.logsql,renameGuid:b.rename_guid,caseInsensitiveCheck:b.case_insensitive_check,renameOnSave:b.rename_on_save,acfFieldName:b.acf_field_name,imagesOnly:b.images_only,delay:parseInt(b.delay),modals:{renameAll:!1,undoAll:!1,editTitle:!1,autoAttach:!1},mutateEntries:(Ke=$e(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return Ke.apply(this,arguments)}),mutateStats:(Je=$e(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return Je.apply(this,arguments)})},tt=function(e,t){switch(t.type){case"ENTRIES_UPDATED":var n=t.entries;return Ye(Ye({},e),{},{entries:n});case"STATS_UPDATED":var r=t.stats;return Ye(Ye({},e),{},{stats:r});case"ERROR_UPDATED":var a=t.apiErrors;return Ye(Ye({},e),{},{apiErrors:a});case"PAGE_UPDATED":var c=t.page;return Ye(Ye({},e),{},{page:c});case"SET_ENTRIES_MUTATE":var o=t.mutateEntries;return Ye(Ye({},e),{},{mutateEntries:o});case"SET_STATS_MUTATE":var l=t.mutateStats;return Ye(Ye({},e),{},{mutateStats:l});case"LIMIT_UPDATED":var i=t.limit;return Ye(Ye({},e),{},{limit:i});case"FILTER_UPDATED":var s=t.filter;return Ye(Ye({},e),{},{filterBy:s});case"SORT_UPDATED":var u=t.sort,m=void 0===u?Qe:u;return Ye(Ye({},e),{},{sort:m});case"SEARCH_UPDATED":var d=t.search;return Ye(Ye({},e),{},{search:d});case"TOTAL_UPDATED":var p=t.total;return Ye(Ye({},e),{},{total:p});case"TOGGLE_MODAL":var f=t.modal,h=t.enable;if(void 0===e.modals[f])return alert("The modal ".concat(f," doesn't exist.")),console.error("The modal ".concat(f," doesn't exist.")),e;void 0===h&&(h=!e.modals[f]);var y=Ye({},e);return y.modals=Ye({},y.modals),y.modals[f]=h,y;case"PUSH_BUSY":var g=t.status,b=void 0===g?"":g;return Ye(Ye({},e),{},{busy:++Ze>0,status:b});case"POP_BUSY":var v=t.status,E=void 0===v?"":v;return Ye(Ye({},e),{},{busy:--Ze>0,status:E});case"STATUS_UPDATED":var R=t.status,w=void 0===R?"":R;return Ye(Ye({},e),{},{status:w});case"SETTINGS_UPDATED":var _,k,x,O,T,P,A,S,j,C,I,D,M,U,B,N,L,F,q,G,z=t.options,H=null!==(_=z.auto_rename)&&void 0!==_&&_,Y=null!==(k=z.on_upload)&&void 0!==k&&k,W=null!==(x=z.rename_slug)&&void 0!==x&&x,V=null!==(O=z.convert_to_ascii)&&void 0!==O&&O,$=null===(T=z.update_posts)||void 0===T||T,J=null===(P=z.update_postmeta)||void 0===P||P,K=(A=z.update_elementor,null!==(S=z.undo)&&void 0!==S&&S),X=null!==(j=z.move)&&void 0!==j&&j,Q=null!==(C=z.manual_rename)&&void 0!==C&&C,Z=null!==(I=z.numbered_files)&&void 0!==I&&I,ee=null!==(D=z.sync_alt)&&void 0!==D&&D,te=null!==(M=z.sync_media_title)&&void 0!==M&&M,ne=null!==(U=z.force_rename)&&void 0!==U&&U,re=null!==(B=z.log)&&void 0!==B&&B,ae=null!==(N=z.logsql)&&void 0!==N&&N,ce=null!==(L=z.rename_guid)&&void 0!==L&&L,oe=null!==(F=z.case_insensitive_check)&&void 0!==F&&F,le=null!==(q=z.rename_on_save)&&void 0!==q&&q,ie=z.acf_field_name,se=null!==(G=z.images_only)&&void 0!==G&&G,ue=z.posts_per_page?parseInt(z.posts_per_page):10,me=z.delay?parseInt(z.delay):0;return Ye(Ye({},e),{},{options:z,autoRename:H,onUpload:Y,renameSlug:W,convertToAscii:V,updatePosts:$,updatePostmeta:J,undo:K,move:X,manualRename:Q,numberedFiles:Z,syncAlt:ee,syncMedia_title:te,forceRename:ne,log:re,logsql:ae,renameGuid:ce,caseInsensitiveCheck:oe,renameOnSave:le,acfFieldName:ie,imagesOnly:se,limit:ue,delay:me});case"ITEMS_SELECTED":var de=t.selectedItems;return Ye(Ye({},e),{},{selectedItems:de});default:return e}},nt=Object(qe.createContext)(),rt=function(e){var t=e.children,n=Ge(Object(qe.useReducer)(tt,et),2),c=n[0],o=n[1],l=c.filterBy,i=c.sort,s=c.search,u=c.page,m=c.limit,d=Object(qe.useMemo)((function(){return[Object(a.D)("".concat(p,"/media"),{limit:m,skip:(u-1)*m,filterBy:l,orderBy:i.accessor,order:i.by,search:s}),{headers:{"X-WP-Nonce":g}}]}),[m,u,l,i,s]),f=Object(qe.useMemo)((function(){return[Object(a.D)("".concat(p,"/stats"),{search:s}),{headers:{"X-WP-Nonce":g}}]}),[s]),h=Object(r.b)(d,a.F),y=h.data,b=h.mutate;Object(qe.useEffect)((function(){o({type:"SET_ENTRIES_MUTATE",mutateEntries:b})}),[b]),Object(qe.useEffect)((function(){o({type:"SET_STATS_MUTATE",mutateStats:O})}),[O]);var v=Object(a.H)(y,[],!0),E=v.busy,R=v.data,w=v.total,_=v.error;Object(qe.useEffect)((function(){o({type:E?"PUSH_BUSY":"POP_BUSY"})}),[E]),Object(qe.useEffect)((function(){o({type:"ENTRIES_UPDATED",entries:R})}),[R]),Object(qe.useEffect)((function(){o({type:"TOTAL_UPDATED",total:w})}),[w]),Object(qe.useEffect)((function(){o({type:"ERROR_UPDATED",apiError:_})}),[_]);var k=Object(r.b)(f,a.F),x=k.data,O=k.mutate,T=Object(a.H)(x,Xe,!0),P=T.busy,A=T.data,S=T.error;return Object(qe.useEffect)((function(){o({type:P?"PUSH_BUSY":"POP_BUSY"})}),[P]),Object(qe.useEffect)((function(){o({type:"STATS_UPDATED",stats:A})}),[A]),Object(qe.useEffect)((function(){o({type:"ERROR_UPDATED",apiError:S})}),[S]),React.createElement(nt.Provider,{value:[c,o]},t)},at=function(){var e={},t=Ge(Object(qe.useContext)(nt),2),n=t[0],r=t[1];return e.setSelectedItems=function(e){r({type:"ITEMS_SELECTED",selectedItems:e})},e.setStatus=function(e){r({type:"STATUS_UPDATED",status:e})},e.updateOption=function(){var e=$e(regeneratorRuntime.mark((function e(t,c){var o,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r({type:"PUSH_BUSY"}),o=Ye(Ye({},n.options),{},We({},c,t)),e.prev=2,e.next=5,Object(a.G)("".concat(p,"/update_option"),{nonce:g,json:{options:o}});case 5:(l=e.sent).success&&r({type:"SETTINGS_UPDATED",options:l.options}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),alert(e.t0);case 12:return e.prev=12,r({type:"POP_BUSY"}),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[2,9,12,15]])})));return function(t,n){return e.apply(this,arguments)}}(),e.updateEntry=function(){var e=$e(regeneratorRuntime.mark((function e(t,c){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r({type:"STATUS_UPDATED",status:"Updating..."}),r({type:"PUSH_BUSY"}),e.prev=2,e.next=5,Object(a.G)("".concat(p,"/update_media"),{nonce:g,json:Ye({id:c},t)});case 5:if(e.sent.success){e.next=8;break}throw new Error("Failed to move the folder/gallery.");case 8:n.mutateEntries(),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),alert(e.t0.message);case 14:return e.prev=14,r({type:"POP_BUSY"}),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(t,n){return e.apply(this,arguments)}}(),e.setPage=function(e){r({type:"PAGE_UPDATED",page:e})},e.setLimit=function(e){r({type:"LIMIT_UPDATED",limit:e})},e.setFilter=function(e){r({type:"FILTER_UPDATED",filter:e})},e.setSort=function(e){r({type:"SORT_UPDATED",sort:e})},e.setSearch=function(e){r({type:"SEARCH_UPDATED",search:e})},e.toggleModal=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;r({type:"TOGGLE_MODAL",modal:e,enable:t})},e.pushBusy=function(){r({type:"PUSH_BUSY"})},e.popBusy=function(){r({type:"POP_BUSY"})},Ye(Ye({},n),e)},ct=function(e){return new Promise((function(t){return setTimeout(t,e)}))};function ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(n),!0).forEach((function(t){it(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function it(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function st(e){return function(e){if(Array.isArray(e))return ft(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||pt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ut(e,t,n,r,a,c,o){try{var l=e[c](o),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function mt(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){ut(c,r,a,o,l,"next",e)}function l(e){ut(c,r,a,o,l,"throw",e)}o(void 0)}))}}function dt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,c=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return c}(e,t)||pt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pt(e,t){if(e){if("string"==typeof e)return ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ft(e,t):void 0}}function ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ht=wp.element,yt=ht.useState,gt=ht.useEffect,bt=ht.useMemo,vt={width:40,height:40,objectFit:"cover"},Et=[{accessor:"thumbnail_url",title:s.THUMB,style:{width:16}},{accessor:"post_title",title:s.TITLE,sortable:!0,style:{width:"25%"}},{accessor:"post_parent",title:s.ATTACHED_TO,sortable:!0,style:{width:"25%"}},{accessor:"current_filename",title:s.FILENAME,sortable:!0}],Rt=function(){var e=at(),t=e.apiErrors,n=e.busy,r=e.selectedItems,c=e.entries,o=e.stats,l=e.total,i=e.filterBy,u=e.search,m=e.status,d=e.sort,f=e.page,h=e.limit,b=e.modals,E=at(),R=E.setSelectedItems,w=E.setSearch,_=E.setStatus,k=E.setSort,x=E.setPage,O=E.setLimit,T=E.setFilter,P=E.delay,A=E.mutateEntries,S=E.mutateStats,j=E.toggleModal,C=E.updateOption,I=E.updateEntry,D=dt(yt(!1),2),M=D[0],U=D[1],N=dt(yt(""),2),L=N[0],F=N[1],q=dt(yt(),2),G=q[0],z=q[1],H=Object(a.J)(),Y=bt((function(){return c.map((function(e){return{id:e.ID,thumbnail_url:React.createElement("img",{src:e.thumbnail_url,style:vt}),post_title:React.createElement("div",{style:{display:"flex",alignItems:"center"}},React.createElement("a",{href:"post.php?post=".concat(e.ID,"&action=edit")},e.post_title),React.createElement(a.j,{icon:"pencil",width:"20",height:"20",color:a.z.blue,style:{marginLeft:"2px",cursor:"pointer"},onClick:function(){z(e),j("editTitle")}})),post_parent:React.createElement("div",{style:{maxHeight:35,overflow:"hidden"}},e.post_parent_title?e.post_parent_title:React.createElement("i",{style:{color:"#c1c1c1"}},"None")),current_filename:React.createElement(B,{entry:e,mutate:function(){A(),S()}})}}))}),[c]);gt((function(){R([]),k(),x(1)}),[i,u]),gt((function(){if(null!==H.busy&&(U(H.busy),!H.busy)){var e=H.getErrorCount();e>0&&F("The process has finished, but ".concat(e," error(s) occurred (check your console).")),H.reset(),R([]),A(),S()}}),[H.busy]);var W=function(){var e=mt(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(P>0)){e.next=3;break}return e.next=3,ct(P);case 3:return e.next=5,Object(a.G)("".concat(p,"/get_all_ids"),{nonce:g,json:{unlockedOnly:t}});case 5:if((n=e.sent).success){e.next=9;break}return alert(n.message),e.abrupt("return",[]);case 9:return e.abrupt("return",n.data);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),V=function(){var e=mt(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(P>0)){e.next=3;break}return e.next=3,ct(P);case 3:return e.next=5,Object(a.G)("".concat(p,"/get_all_post_ids"),{nonce:g});case 5:if((t=e.sent).success){e.next=9;break}return alert(t.message),e.abrupt("return",[]);case 9:return e.abrupt("return",t.data);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=mt(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _("Preparing..."),U(!0),e.next=4,V();case 4:if(!(t=e.sent)){e.next=11;break}return _("Auto attaching..."),n=Object(a.E)(t,20),r=n.map((function(e){return function(){var t=mt(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(P>0)){t.next=3;break}return t.next=3,ct(P);case 3:return t.next=5,Object(a.G)("".concat(p,"/auto_attach"),{nonce:g,json:{postIds:e},signal:n});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),H.start(r),e.abrupt("return");case 11:U(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=mt(regeneratorRuntime.mark((function e(){var t,n,r,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:null,_("Preparing..."),U(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,W(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return _("Undoing..."),r=n.map((function(e){return function(){var t=mt(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(_("Undo Media ".concat(e)),!(P>0)){t.next=4;break}return t.next=4,ct(P);case 4:return t.next=6,Object(a.G)("".concat(p,"/undo"),{nonce:g,json:{mediaId:e},signal:n});case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),H.start(r),e.abrupt("return");case 16:U(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=mt(regeneratorRuntime.mark((function e(){var t,n,r,c,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,_("Preparing..."),U(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,W(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=17;break}return _("Analyzing..."),r=Object(a.E)(n,20),c=r.map((function(e){return function(){var t=mt(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(P>0)){t.next=3;break}return t.next=3,ct(P);case 3:return t.next=5,Object(a.G)("".concat(p,"/analyze"),{nonce:g,json:{mediaIds:e},signal:n});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),H.start(c),e.abrupt("return");case 17:U(!1);case 18:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){var e=mt(regeneratorRuntime.mark((function e(){var t,n,r,c,o,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(l.length>0&&void 0!==l[0])||l[0],n=l.length>1&&void 0!==l[1]?l[1]:null,_("Preparing..."),U(!0),!n){e.next=8;break}e.t0=n,e.next=11;break;case 8:return e.next=10,W(t);case 10:e.t0=e.sent;case 11:if(!(r=e.t0)){e.next=18;break}return _("".concat(t?"Locking..":"Unlocking...")),c=Object(a.E)(r,50),o=c.map((function(e){return function(){var e=mt(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(P>0)){e.next=3;break}return e.next=3,ct(P);case 3:return e.next=5,Object(a.G)("".concat(p,"/set_lock"),{nonce:g,json:{mediaIds:r,lock:t},signal:n});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()})),H.start(o),e.abrupt("return");case 18:U(!1);case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Q=function(){var e=mt(regeneratorRuntime.mark((function e(){var t,n,r,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:null,_("Preparing..."),U(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,W(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=15;break}return r=n.map((function(e){return function(){var t=mt(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(_("Renaming #".concat(e)),!(P>0)){t.next=4;break}return t.next=4,ct(P);case 4:return t.next=6,Object(a.G)("".concat(p,"/rename"),{nonce:g,json:{mediaId:e},signal:n});case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),H.start(r),e.abrupt("return");case 15:U(!1);case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Z=function(){var e=mt(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:I({post_title:t.post_title},t.ID);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ee=function(){var e=mt(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C(t,"posts_per_page");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),te=function(){var e=mt(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:H.stop();case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=React.createElement(React.Fragment,null,React.createElement("div",null,"All your posts, pages, products (and other post types) will be scanned, and if images are used in them, they will be attached. Currently, Featured Images and Product Galleries are supported. Should we start?"),!y&&React.createElement("div",{style:{marginTop:20}},React.createElement("b",null,"This feature is only available in the Pro version."))),re=React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return window.open("https://meowapps.com/plugin/media-file-renamer/","_blank")}},"Get the Pro Version"),React.createElement(a.c,{className:"primary",onClick:function(){return window.open("https://meowapps.com/media-file-renamer-tutorial/","_blank")}},"Read the tutorial"));return React.createElement(a.q,{nekoErrors:[t]},React.createElement(a.i,{title:"Media File Renamer | Dashboard",subtitle:"By Jordy Meow"},React.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},React.createElement(a.c,{className:"header",onClick:function(){return window.open("https://meowapps.com/media-file-renamer-tutorial/","_blank")}},"Tutorial"),React.createElement(a.c,{icon:"cog",className:"header",onClick:function(){return location.href="admin.php?page=mfrh_settings"}},"Settings"))),React.createElement(a.C,null,React.createElement(a.f,{full:!0},!y&&React.createElement(a.g,{footer:re},React.createElement(a.B,{p:!0},"You must ",React.createElement("b",null,"backup the uploads folder and DB")," before using the Renamer. If you don't know how, give a try to ",React.createElement("a",{target:"_blank",href:"https://meow.click/blogvault"},"BlogVault"),". It is also highly recommanded to read the tutorial. Last but not least, check the ",React.createElement("b",null,"Pro Version"),", as it adds many features and also supports the development. This message is only displayed in the free version. Thank you!")),React.createElement(a.A,null,React.createElement(a.c,{onClick:function(){return K()}},"Analyze Library"),React.createElement(a.c,{onClick:function(){return j("autoAttach")}},"Auto Attach"),"pending"===i&&r.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return Q(r)}},"Rename ",React.createElement("strong",null,r.length)," entries"),React.createElement(a.c,{className:"secondary",onClick:function(){return X(!0,r)}},"Lock ",React.createElement("strong",null,r.length)," entries")),v&&"renamed"===i&&r.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return J(r)}},"Undo ",React.createElement("strong",null,r.length)," entries")),React.createElement("div",{style:{flex:1}},M&&React.createElement(a.s,{status:function(e){return"".concat(m," (").concat(e,"%)")},busy:M,value:H.value,max:H.max,onStopClick:te})),!(n||M)&&React.createElement(React.Fragment,null,React.createElement(a.k,{onBlur:function(e){w(e)},value:u,onEnter:function(e){w(e)}}),!u&&React.createElement(a.j,{icon:"search",width:24,style:{position:"relative",left:-34,marginRight:-22},color:"#5a5a5a82"}),u&&React.createElement(a.j,{icon:"close",width:24,style:{position:"relative",left:-34,marginRight:-22},color:a.z.blue,onClick:function(){w("")}})),"all"===i&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return X(!0)}},"Lock ",React.createElement("strong",null,"All")),React.createElement(a.c,{className:"secondary",onClick:function(){return X(!1)}},"Unlock ",React.createElement("strong",null,"All"))),("all"===i||"pending"===i)&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"primary",onClick:function(){return j("renameAll")}},"Rename ",React.createElement("strong",null,"All"))),v&&("all"===i||"renamed"===i)&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"danger",onClick:function(){return j("undoAll")}},"Undo ",React.createElement("strong",null,"All")))),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10,marginBottom:10}},React.createElement(a.t,{value:i,busy:n||M,onChange:function(e){T(e),x(1)}},React.createElement(a.l,{title:s.PENDING,value:"pending",count:o.pending}),React.createElement(a.l,{title:"Renamed",value:"renamed",count:o.renamed}),React.createElement(a.l,{title:"Locked",value:"locked",count:o.locked}),React.createElement(a.l,{title:"All",value:"all",count:o.all})),React.createElement(a.r,{currentPage:f,limit:h,total:l,onClick:function(e){return x(e)},onCurrentPageChanged:function(e){return x(e)}})),React.createElement(a.x,{busy:n||M,data:Y,columns:Et,sort:d,onSortChange:function(e,t){k({accessor:e,by:t})},onSelect:function(e){R([].concat(st(r),st(e)))},onUnselect:function(e){R(st(r.filter((function(t){return!e.includes(t)}))))},selectedItems:r,emptyMessage:React.createElement(React.Fragment,null,"It's all clean & nice here! 👍",React.createElement("br",null),"Why not trying to give a boost to your database with ",React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/database-cleaner/"},"Database Cleaner"),"? 😌")}),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10}},React.createElement(a.u,{scrolldown:!0,value:h,onChange:function(e){O(e),x(1),ee(e)}},React.createElement(a.p,{value:5,label:"5 items per page"}),React.createElement(a.p,{value:10,label:"10 items per page"}),React.createElement(a.p,{value:25,label:"25 items per page"}),React.createElement(a.p,{value:50,label:"50 items per page"}),React.createElement(a.p,{value:100,label:"100 items per page"}),React.createElement(a.p,{value:200,label:"200 items per page"})),React.createElement(a.r,{currentPage:f,limit:h,total:l,onClick:function(e){return x(e)},onCurrentPageChanged:function(e){return x(e)}}))),React.createElement(a.o,{isOpen:b.autoAttach,onRequestClose:function(){return j("autoAttach",!1)},title:"Automatically attach your images to your posts",content:ne,ok:y?"Run":"I need the Pro Version",onOkClick:function(){j("autoAttach",!1),y&&$()},onCancelClick:function(){j("autoAttach",!1)}}),React.createElement(a.o,{isOpen:b.renameAll,onRequestClose:function(){return j("renameAll",!1)},title:"You are about to rename all your (unlocked) files",content:"Renaming files is a dangerous operation. Please make sure you made a backup or your entire WordPress install. Should we start?",onOkClick:function(){j("renameAll",!1),Q()},onCancelClick:function(){j("renameAll",!1)}}),React.createElement(a.o,{isOpen:b.undoAll,onRequestClose:function(){return j("undoAll",!1)},title:"You are about to undo the renaming for all your files",content:"Are you sure you would like to proceed?",onOkClick:function(){j("undoAll",!1),J()},onCancelClick:function(){j("undoAll",!1)}}),React.createElement(a.o,{isOpen:L,title:"Success",ok:"Close",content:L,onOkClick:function(){F(""),H.reset()}}),React.createElement(a.o,{isOpen:H.error,onRequestClose:te,title:"Error",content:React.createElement(React.Fragment,null,React.createElement("b",null,H.error?H.error.message:"N/A")),customButtons:React.createElement("div",{style:{display:"flex",width:"100%",flexDirection:"column"}},React.createElement("div",{style:{display:"flex",alignItems:"center"}},React.createElement(a.c,{className:"primary",onClick:function(){H.retry()}},"Retry"),React.createElement("small",{style:{marginLeft:5}},React.createElement("a",{href:"#",onClick:function(){H.autoRetry(10)}},"AUTO RETRY")),React.createElement("div",{style:{flex:"auto"}}),React.createElement(a.c,{className:"secondary",onClick:function(){H.resume()}},"Skip"),React.createElement("small",{style:{marginLeft:5,marginRight:10}},React.createElement("a",{href:"#",onClick:function(){H.setAlwaysSkip(),H.resume()}},"ALWAYS SKIP")),React.createElement(a.c,{className:"danger",onClick:te},"Stop")),React.createElement("small",{style:{marginTop:10,lineHeight:"13px"}},"AUTO RETRY will retry the actions up to 10 times. At every retry, it will increase the delay (in order to avoid timeouts). ALWAYS SKIP will simply skip the failed action (not recommended)."))}),React.createElement(a.o,{isOpen:b.editTitle,onRequestClose:function(){return j("editTitle",!1)},title:"Edit the title",okOnEnter:!0,content:React.createElement(a.k,{autoFocus:!0,id:"mfrh_edit_title",name:"mfrh_edit_title",placeholder:"title...",value:null==G?void 0:G.post_title,onBlur:function(e){return z(lt(lt({},G),{},{post_title:e}))}}),onOkClick:function(){j("editTitle",!1),Z(G)},onCancelClick:function(){j("editTitle",!1)}})))},wt=wp.element.render,_t={fetcher:a.F,revalidateOnFocus:!1};function kt(){Array.from(document.getElementsByClassName("mfrh-renamer-field")).forEach((function(e){var t=e.getAttribute("data-id");wt(React.createElement(B,{natural:!0,mediaId:t}),e)}))}document.addEventListener("DOMContentLoaded",(function(e){var t,n;new MutationObserver((function(){kt()})).observe(document.documentElement,{childList:!0,subtree:!0}),(t=document.getElementById("mfrh-admin-settings"))&&wt(React.createElement(r.a,{value:_t},React.createElement(Fe,null)),t),(n=document.getElementById("mfrh-media-rename"))&&wt(React.createElement(r.a,{value:_t},React.createElement(rt,null,React.createElement(Rt,null))),n),kt()}))}});
|
2 |
//# sourceMappingURL=index.js.map
|
media-file-renamer.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Media File Renamer
|
4 |
Plugin URI: https://meowapps.com
|
5 |
Description: Rename your files and images for a better SEO, automatically and manually.
|
6 |
-
Version: 5.4.
|
7 |
Author: Jordy Meow
|
8 |
Author URI: https://meowapps.com
|
9 |
Text Domain: media-file-renamer
|
@@ -15,7 +15,7 @@ Originally developed for two of my websites:
|
|
15 |
*/
|
16 |
|
17 |
if ( !defined( 'MFRH_VERSION' ) ) {
|
18 |
-
define( 'MFRH_VERSION', '5.4.
|
19 |
define( 'MFRH_PREFIX', 'mfrh' );
|
20 |
define( 'MFRH_DOMAIN', 'media-file-renamer' );
|
21 |
define( 'MFRH_ENTRY', __FILE__ );
|
3 |
Plugin Name: Media File Renamer
|
4 |
Plugin URI: https://meowapps.com
|
5 |
Description: Rename your files and images for a better SEO, automatically and manually.
|
6 |
+
Version: 5.4.7
|
7 |
Author: Jordy Meow
|
8 |
Author URI: https://meowapps.com
|
9 |
Text Domain: media-file-renamer
|
15 |
*/
|
16 |
|
17 |
if ( !defined( 'MFRH_VERSION' ) ) {
|
18 |
+
define( 'MFRH_VERSION', '5.4.7' );
|
19 |
define( 'MFRH_PREFIX', 'mfrh' );
|
20 |
define( 'MFRH_DOMAIN', 'media-file-renamer' );
|
21 |
define( 'MFRH_ENTRY', __FILE__ );
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Donate link: https://meowapps.com/donation/
|
|
5 |
Requires at least: 5.0
|
6 |
Tested up to: 6.0.1
|
7 |
Requires PHP: 7.0
|
8 |
-
Stable tag: 5.4.
|
9 |
|
10 |
Rename your files and images for a better SEO, automatically and manually.
|
11 |
|
@@ -69,7 +69,7 @@ The plugin can be tweaked in many ways, there are many actions and filters avail
|
|
69 |
|
70 |
== Changelog ==
|
71 |
|
72 |
-
= 5.4.
|
73 |
* Add: Consider WebP as an "Image" (which it is 😏).
|
74 |
* Fix: The 'Featured Only' and 'Images Only' were not working perfectly.
|
75 |
* Update: Optimized the way options are updated and retrieved.
|
5 |
Requires at least: 5.0
|
6 |
Tested up to: 6.0.1
|
7 |
Requires PHP: 7.0
|
8 |
+
Stable tag: 5.4.7
|
9 |
|
10 |
Rename your files and images for a better SEO, automatically and manually.
|
11 |
|
69 |
|
70 |
== Changelog ==
|
71 |
|
72 |
+
= 5.4.7 (2022/10/12) =
|
73 |
* Add: Consider WebP as an "Image" (which it is 😏).
|
74 |
* Fix: The 'Featured Only' and 'Images Only' were not working perfectly.
|
75 |
* Update: Optimized the way options are updated and retrieved.
|