| Server IP : 195.130.67.5 / Your IP : 216.73.217.127 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /inetpub/wwwroot/engineering/wp-content/plugins/nextgen-gallery/adminApp/ |
Upload File : |
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _createForOfIteratorHelper(t,e){var o,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length)return r&&(t=r),o=0,{s:e=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){a=!0,n=t},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw n}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(o="Object"===o&&t.constructor?t.constructor.name:o)||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,r=new Array(e);o<e;o++)r[o]=t[o];return r}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_toPropertyKey(r.key),r)}}function _createClass(t,e,o){return e&&_defineProperties(t.prototype,e),o&&_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:String(t)}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0===o)return("string"===e?String:Number)(t);o=o.call(t,e||"default");if("object"!=_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}var fs=require("fs"),path=require("path"),MakepotPlugin=function(){return _createClass(function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,t),this.options={output:e.output||"translations.pot",scriptPath:e.scriptPath||"",tempOutput:e.tempOutput||e.output+".temp"}},[{key:"safeUnlink",value:function(e){try{fs.existsSync(e)&&fs.unlinkSync(e)}catch(t){console.warn("[MakepotPlugin] Could not delete temp file ".concat(e,":"),t.message)}}},{key:"apply",value:function(a){var u=this;a.hooks.beforeCompile.tap("MakepotPlugin",function(){u.safeUnlink(u.options.tempOutput)}),a.hooks.afterPlugins.tap("MakepotPlugin",function(){var t,e=_createForOfIteratorHelper(a.options.module.rules);try{for(e.s();!(t=e.n()).done;){var o=t.value;if(o.test&&o.test.toString().includes("tsx")&&o.use){var r,n=_createForOfIteratorHelper(o.use);try{for(n.s();!(r=n.n()).done;){var i=r.value;"babel-loader"===i.loader&&(i.options.plugins=i.options.plugins||[],i.options.plugins.push(["@wordpress/babel-plugin-makepot",{output:u.options.tempOutput},"makepot-".concat(path.basename(u.options.output))]))}}catch(t){n.e(t)}finally{n.f()}}}}catch(t){e.e(t)}finally{e.f()}}),a.hooks.afterEmit.tapAsync("MakepotPlugin",function(t,e){if(!fs.existsSync(u.options.tempOutput))return console.warn("[MakepotPlugin] No POT file found at ".concat(u.options.tempOutput)),void e();try{var o=fs.readFileSync(u.options.tempOutput,"utf8").replace(/#: src\/[^\s]+\.tsx?:(\d+)/g,"#: ".concat(u.options.scriptPath,":$1"));fs.writeFileSync(u.options.output,o,"utf8"),console.warn("[MakepotPlugin] Generated: ".concat(u.options.output))}catch(t){console.error("[MakepotPlugin] Error processing POT file:",t)}finally{u.safeUnlink(u.options.tempOutput)}e()}),a.hooks.failed.tap("MakepotPlugin",function(){u.safeUnlink(u.options.tempOutput)})}}])}();module.exports=MakepotPlugin;