This commit is contained in:
2024-05-20 15:37:46 +03:00
commit 00b7dbd0b7
10404 changed files with 3285853 additions and 0 deletions

View File

@ -0,0 +1,22 @@
"use strict";
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
(self["webpackChunk"] = self["webpackChunk"] || []).push([["node_modules_jsquash_oxipng_codec_pkg-parallel_index_js"],{
/***/ "./node_modules/@jsquash/oxipng/codec/pkg-parallel/index.js":
/*!******************************************************************!*\
!*** ./node_modules/@jsquash/oxipng/codec/pkg-parallel/index.js ***!
\******************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* empty/unused harmony star reexport */\nObject(function webpackMissingModule() { var e = new Error(\"Cannot find module './optimise'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }());\n\n\n\n//# sourceURL=webpack:///./node_modules/@jsquash/oxipng/codec/pkg-parallel/index.js?");
/***/ })
}]);

View File

@ -0,0 +1,157 @@
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js":
/*!***************************************************************************************************************************!*\
!*** ./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js ***!
\***************************************************************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"startWorkers\": () => (/* binding */ startWorkers)\n/* harmony export */ });\n/**\n * Copyright 2021 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Note: we use `wasm_bindgen_worker_`-prefixed message types to make sure\n// we can handle bundling into other files, which might happen to have their\n// own `postMessage`/`onmessage` communication channels.\n//\n// If we didn't take that into the account, we could send much simpler signals\n// like just `0` or whatever, but the code would be less resilient.\n\nfunction waitForMsgType(target, type) {\n return new Promise(resolve => {\n target.addEventListener('message', function onMsg({ data }) {\n if (data == null || data.type !== type) return;\n target.removeEventListener('message', onMsg);\n resolve(data);\n });\n });\n}\n\nwaitForMsgType(self, 'wasm_bindgen_worker_init').then(async data => {\n // # Note 1\n // Our JS should have been generated in\n // `[out-dir]/snippets/wasm-bindgen-rayon-[hash]/workerHelpers.js`,\n // resolve the main module via `../../..`.\n //\n // This might need updating if the generated structure changes on wasm-bindgen\n // side ever in the future, but works well with bundlers today. The whole\n // point of this crate, after all, is to abstract away unstable features\n // and temporary bugs so that you don't need to deal with them in your code.\n //\n // # Note 2\n // This could be a regular import, but then some bundlers complain about\n // circular deps.\n //\n // Dynamic import could be cheap if this file was inlined into the parent,\n // which would require us just using `../../..` in `new Worker` below,\n // but that doesn't work because wasm-pack unconditionally adds\n // \"sideEffects\":false (see below).\n //\n // OTOH, even though it can't be inlined, it should be still reasonably\n // cheap since the requested file is already in cache (it was loaded by\n // the main thread).\n const pkg = await __webpack_require__.e(/*! import() */ \"vendors-node_modules_jsquash_oxipng_codec_pkg-parallel_squoosh_oxipng_js\").then(__webpack_require__.bind(__webpack_require__, /*! ../../../squoosh_oxipng */ \"./node_modules/@jsquash/oxipng/codec/pkg-parallel/squoosh_oxipng.js\"));\n await pkg.default(data.module, data.memory);\n postMessage({ type: 'wasm_bindgen_worker_ready' });\n pkg.wbg_rayon_start_worker(data.receiver);\n});\n\nasync function startWorkers(module, memory, builder) {\n const workerInit = {\n type: 'wasm_bindgen_worker_init',\n module,\n memory,\n receiver: builder.receiver()\n };\n\n try {\n await Promise.all(\n Array.from({ length: builder.numThreads() }, () => {\n // Self-spawn into a new Worker.\n //\n // TODO: while `new URL('...', import.meta.url) becomes a semi-standard\n // way to get asset URLs relative to the module across various bundlers\n // and browser, ideally we should switch to `import.meta.resolve`\n // once it becomes a standard.\n //\n // Note: we could use `../../..` as the URL here to inline workerHelpers.js\n // into the parent entry instead of creating another split point -\n // this would be preferable from optimization perspective -\n // however, Webpack then eliminates all message handler code\n // because wasm-pack produces \"sideEffects\":false in package.json\n // unconditionally.\n //\n // The only way to work around that is to have side effect code\n // in an entry point such as Worker file itself.\n const worker = new Worker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u(\"node_modules_jsquash_oxipng_codec_pkg-parallel_snippets_wasm-bindgen-rayon-3d2df09ebec17a22_s-312b0a0\"), __webpack_require__.b), {\n type: undefined\n });\n worker.postMessage(workerInit);\n return waitForMsgType(worker, 'wasm_bindgen_worker_ready');\n })\n );\n builder.build();\n } finally {\n builder.free();\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/ensure chunk */
/******/ (() => {
/******/ __webpack_require__.f = {};
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = (chunkId) => {
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
/******/ __webpack_require__.f[key](chunkId, promises);
/******/ return promises;
/******/ }, []));
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/get javascript chunk filename */
/******/ (() => {
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // return url for filenames based on template
/******/ return "" + chunkId + ".js";
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/publicPath */
/******/ (() => {
/******/ __webpack_require__.p = "/test/wp-content/plugins/squeeze/assets/js/";
/******/ })();
/******/
/******/ /* webpack/runtime/importScripts chunk loading */
/******/ (() => {
/******/ __webpack_require__.b = self.location + "";
/******/
/******/ // object to store loaded chunks
/******/ // "1" means "already loaded"
/******/ var installedChunks = {
/******/ "node_modules_jsquash_oxipng_codec_pkg-parallel_snippets_wasm-bindgen-rayon-3d2df09ebec17a22_s-312b0a0": 1
/******/ };
/******/
/******/ // importScripts chunk loading
/******/ var installChunk = (data) => {
/******/ var [chunkIds, moreModules, runtime] = data;
/******/ for(var moduleId in moreModules) {
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(runtime) runtime(__webpack_require__);
/******/ while(chunkIds.length)
/******/ installedChunks[chunkIds.pop()] = 1;
/******/ parentChunkLoadingFunction(data);
/******/ };
/******/ __webpack_require__.f.i = (chunkId, promises) => {
/******/ // "1" is the signal for "already loaded"
/******/ if(!installedChunks[chunkId]) {
/******/ if(true) { // all chunks have JS
/******/ importScripts(__webpack_require__.p + __webpack_require__.u(chunkId));
/******/ }
/******/ }
/******/ };
/******/
/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || [];
/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);
/******/ chunkLoadingGlobal.push = installChunk;
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__("./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js");
/******/
/******/ })()
;

View File

@ -0,0 +1,184 @@
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js":
/*!***************************************************************************************************************************!*\
!*** ./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js ***!
\***************************************************************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"startWorkers\": () => (/* binding */ startWorkers)\n/* harmony export */ });\n/**\n * Copyright 2021 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Note: we use `wasm_bindgen_worker_`-prefixed message types to make sure\n// we can handle bundling into other files, which might happen to have their\n// own `postMessage`/`onmessage` communication channels.\n//\n// If we didn't take that into the account, we could send much simpler signals\n// like just `0` or whatever, but the code would be less resilient.\n\nfunction waitForMsgType(target, type) {\n return new Promise(resolve => {\n target.addEventListener('message', function onMsg({ data }) {\n if (data == null || data.type !== type) return;\n target.removeEventListener('message', onMsg);\n resolve(data);\n });\n });\n}\n\nwaitForMsgType(self, 'wasm_bindgen_worker_init').then(async data => {\n // # Note 1\n // Our JS should have been generated in\n // `[out-dir]/snippets/wasm-bindgen-rayon-[hash]/workerHelpers.js`,\n // resolve the main module via `../../..`.\n //\n // This might need updating if the generated structure changes on wasm-bindgen\n // side ever in the future, but works well with bundlers today. The whole\n // point of this crate, after all, is to abstract away unstable features\n // and temporary bugs so that you don't need to deal with them in your code.\n //\n // # Note 2\n // This could be a regular import, but then some bundlers complain about\n // circular deps.\n //\n // Dynamic import could be cheap if this file was inlined into the parent,\n // which would require us just using `../../..` in `new Worker` below,\n // but that doesn't work because wasm-pack unconditionally adds\n // \"sideEffects\":false (see below).\n //\n // OTOH, even though it can't be inlined, it should be still reasonably\n // cheap since the requested file is already in cache (it was loaded by\n // the main thread).\n const pkg = await __webpack_require__.e(/*! import() */ \"vendors-node_modules_jsquash_oxipng_codec_pkg-parallel_squoosh_oxipng_js\").then(__webpack_require__.bind(__webpack_require__, /*! ../../../squoosh_oxipng */ \"./node_modules/@jsquash/oxipng/codec/pkg-parallel/squoosh_oxipng.js\"));\n await pkg.default(data.module, data.memory);\n postMessage({ type: 'wasm_bindgen_worker_ready' });\n pkg.wbg_rayon_start_worker(data.receiver);\n});\n\nasync function startWorkers(module, memory, builder) {\n const workerInit = {\n type: 'wasm_bindgen_worker_init',\n module,\n memory,\n receiver: builder.receiver()\n };\n\n try {\n await Promise.all(\n Array.from({ length: builder.numThreads() }, () => {\n // Self-spawn into a new Worker.\n //\n // TODO: while `new URL('...', import.meta.url) becomes a semi-standard\n // way to get asset URLs relative to the module across various bundlers\n // and browser, ideally we should switch to `import.meta.resolve`\n // once it becomes a standard.\n //\n // Note: we could use `../../..` as the URL here to inline workerHelpers.js\n // into the parent entry instead of creating another split point -\n // this would be preferable from optimization perspective -\n // however, Webpack then eliminates all message handler code\n // because wasm-pack produces \"sideEffects\":false in package.json\n // unconditionally.\n //\n // The only way to work around that is to have side effect code\n // in an entry point such as Worker file itself.\n const worker = new Worker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u(\"node_modules_jsquash_oxipng_codec_pkg-parallel_snippets_wasm-bindgen-rayon-3d2df09ebec17a22_s-312b0a0\"), __webpack_require__.b), {\n type: undefined\n });\n worker.postMessage(workerInit);\n return waitForMsgType(worker, 'wasm_bindgen_worker_ready');\n })\n );\n builder.build();\n } finally {\n builder.free();\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/ensure chunk */
/******/ (() => {
/******/ __webpack_require__.f = {};
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = (chunkId) => {
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
/******/ __webpack_require__.f[key](chunkId, promises);
/******/ return promises;
/******/ }, []));
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/get javascript chunk filename */
/******/ (() => {
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // return url for filenames based on template
/******/ return "" + chunkId + ".script.bundle.js";
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/global */
/******/ (() => {
/******/ __webpack_require__.g = (function() {
/******/ if (typeof globalThis === 'object') return globalThis;
/******/ try {
/******/ return this || new Function('return this')();
/******/ } catch (e) {
/******/ if (typeof window === 'object') return window;
/******/ }
/******/ })();
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/publicPath */
/******/ (() => {
/******/ var scriptUrl;
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
/******/ var document = __webpack_require__.g.document;
/******/ if (!scriptUrl && document) {
/******/ if (document.currentScript)
/******/ scriptUrl = document.currentScript.src;
/******/ if (!scriptUrl) {
/******/ var scripts = document.getElementsByTagName("script");
/******/ if(scripts.length) scriptUrl = scripts[scripts.length - 1].src
/******/ }
/******/ }
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
/******/ __webpack_require__.p = scriptUrl;
/******/ })();
/******/
/******/ /* webpack/runtime/importScripts chunk loading */
/******/ (() => {
/******/ __webpack_require__.b = self.location + "";
/******/
/******/ // object to store loaded chunks
/******/ // "1" means "already loaded"
/******/ var installedChunks = {
/******/ "node_modules_jsquash_oxipng_codec_pkg-parallel_snippets_wasm-bindgen-rayon-3d2df09ebec17a22_s-312b0a0": 1
/******/ };
/******/
/******/ // importScripts chunk loading
/******/ var installChunk = (data) => {
/******/ var [chunkIds, moreModules, runtime] = data;
/******/ for(var moduleId in moreModules) {
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(runtime) runtime(__webpack_require__);
/******/ while(chunkIds.length)
/******/ installedChunks[chunkIds.pop()] = 1;
/******/ parentChunkLoadingFunction(data);
/******/ };
/******/ __webpack_require__.f.i = (chunkId, promises) => {
/******/ // "1" is the signal for "already loaded"
/******/ if(!installedChunks[chunkId]) {
/******/ if(true) { // all chunks have JS
/******/ importScripts(__webpack_require__.p + __webpack_require__.u(chunkId));
/******/ }
/******/ }
/******/ };
/******/
/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || [];
/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);
/******/ chunkLoadingGlobal.push = installChunk;
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__("./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js");
/******/
/******/ })()
;

View File

@ -0,0 +1,22 @@
"use strict";
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
(self["webpackChunk"] = self["webpackChunk"] || []).push([["node_modules_jsquash_oxipng_codec_pkg-parallel_snippets_wasm-bindgen-rayon-3d2df09ebec17a22_s-312b0a1"],{
/***/ "./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js":
/*!***************************************************************************************************************************!*\
!*** ./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js ***!
\***************************************************************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"startWorkers\": () => (/* binding */ startWorkers)\n/* harmony export */ });\n/**\n * Copyright 2021 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Note: we use `wasm_bindgen_worker_`-prefixed message types to make sure\n// we can handle bundling into other files, which might happen to have their\n// own `postMessage`/`onmessage` communication channels.\n//\n// If we didn't take that into the account, we could send much simpler signals\n// like just `0` or whatever, but the code would be less resilient.\n\nfunction waitForMsgType(target, type) {\n return new Promise(resolve => {\n target.addEventListener('message', function onMsg({ data }) {\n if (data == null || data.type !== type) return;\n target.removeEventListener('message', onMsg);\n resolve(data);\n });\n });\n}\n\nwaitForMsgType(self, 'wasm_bindgen_worker_init').then(async data => {\n // # Note 1\n // Our JS should have been generated in\n // `[out-dir]/snippets/wasm-bindgen-rayon-[hash]/workerHelpers.js`,\n // resolve the main module via `../../..`.\n //\n // This might need updating if the generated structure changes on wasm-bindgen\n // side ever in the future, but works well with bundlers today. The whole\n // point of this crate, after all, is to abstract away unstable features\n // and temporary bugs so that you don't need to deal with them in your code.\n //\n // # Note 2\n // This could be a regular import, but then some bundlers complain about\n // circular deps.\n //\n // Dynamic import could be cheap if this file was inlined into the parent,\n // which would require us just using `../../..` in `new Worker` below,\n // but that doesn't work because wasm-pack unconditionally adds\n // \"sideEffects\":false (see below).\n //\n // OTOH, even though it can't be inlined, it should be still reasonably\n // cheap since the requested file is already in cache (it was loaded by\n // the main thread).\n const pkg = await __webpack_require__.e(/*! import() */ \"vendors-node_modules_jsquash_oxipng_codec_pkg-parallel_squoosh_oxipng_js\").then(__webpack_require__.bind(__webpack_require__, /*! ../../../squoosh_oxipng */ \"./node_modules/@jsquash/oxipng/codec/pkg-parallel/squoosh_oxipng.js\"));\n await pkg.default(data.module, data.memory);\n postMessage({ type: 'wasm_bindgen_worker_ready' });\n pkg.wbg_rayon_start_worker(data.receiver);\n});\n\nasync function startWorkers(module, memory, builder) {\n const workerInit = {\n type: 'wasm_bindgen_worker_init',\n module,\n memory,\n receiver: builder.receiver()\n };\n\n try {\n await Promise.all(\n Array.from({ length: builder.numThreads() }, () => {\n // Self-spawn into a new Worker.\n //\n // TODO: while `new URL('...', import.meta.url) becomes a semi-standard\n // way to get asset URLs relative to the module across various bundlers\n // and browser, ideally we should switch to `import.meta.resolve`\n // once it becomes a standard.\n //\n // Note: we could use `../../..` as the URL here to inline workerHelpers.js\n // into the parent entry instead of creating another split point -\n // this would be preferable from optimization perspective -\n // however, Webpack then eliminates all message handler code\n // because wasm-pack produces \"sideEffects\":false in package.json\n // unconditionally.\n //\n // The only way to work around that is to have side effect code\n // in an entry point such as Worker file itself.\n const worker = new Worker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u(\"node_modules_jsquash_oxipng_codec_pkg-parallel_snippets_wasm-bindgen-rayon-3d2df09ebec17a22_s-312b0a0\"), __webpack_require__.b), {\n type: undefined\n });\n worker.postMessage(workerInit);\n return waitForMsgType(worker, 'wasm_bindgen_worker_ready');\n })\n );\n builder.build();\n } finally {\n builder.free();\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js?");
/***/ })
}]);

View File

@ -0,0 +1,22 @@
"use strict";
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
(self["webpackChunk"] = self["webpackChunk"] || []).push([["node_modules_jsquash_oxipng_codec_pkg-parallel_snippets_wasm-bindgen-rayon-3d2df09ebec17a22_s-312b0a1"],{
/***/ "./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js":
/*!***************************************************************************************************************************!*\
!*** ./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js ***!
\***************************************************************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"startWorkers\": () => (/* binding */ startWorkers)\n/* harmony export */ });\n/**\n * Copyright 2021 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Note: we use `wasm_bindgen_worker_`-prefixed message types to make sure\n// we can handle bundling into other files, which might happen to have their\n// own `postMessage`/`onmessage` communication channels.\n//\n// If we didn't take that into the account, we could send much simpler signals\n// like just `0` or whatever, but the code would be less resilient.\n\nfunction waitForMsgType(target, type) {\n return new Promise(resolve => {\n target.addEventListener('message', function onMsg({ data }) {\n if (data == null || data.type !== type) return;\n target.removeEventListener('message', onMsg);\n resolve(data);\n });\n });\n}\n\nwaitForMsgType(self, 'wasm_bindgen_worker_init').then(async data => {\n // # Note 1\n // Our JS should have been generated in\n // `[out-dir]/snippets/wasm-bindgen-rayon-[hash]/workerHelpers.js`,\n // resolve the main module via `../../..`.\n //\n // This might need updating if the generated structure changes on wasm-bindgen\n // side ever in the future, but works well with bundlers today. The whole\n // point of this crate, after all, is to abstract away unstable features\n // and temporary bugs so that you don't need to deal with them in your code.\n //\n // # Note 2\n // This could be a regular import, but then some bundlers complain about\n // circular deps.\n //\n // Dynamic import could be cheap if this file was inlined into the parent,\n // which would require us just using `../../..` in `new Worker` below,\n // but that doesn't work because wasm-pack unconditionally adds\n // \"sideEffects\":false (see below).\n //\n // OTOH, even though it can't be inlined, it should be still reasonably\n // cheap since the requested file is already in cache (it was loaded by\n // the main thread).\n const pkg = await __webpack_require__.e(/*! import() */ \"vendors-node_modules_jsquash_oxipng_codec_pkg-parallel_squoosh_oxipng_js\").then(__webpack_require__.bind(__webpack_require__, /*! ../../../squoosh_oxipng */ \"./node_modules/@jsquash/oxipng/codec/pkg-parallel/squoosh_oxipng.js\"));\n await pkg.default(data.module, data.memory);\n postMessage({ type: 'wasm_bindgen_worker_ready' });\n pkg.wbg_rayon_start_worker(data.receiver);\n});\n\nasync function startWorkers(module, memory, builder) {\n const workerInit = {\n type: 'wasm_bindgen_worker_init',\n module,\n memory,\n receiver: builder.receiver()\n };\n\n try {\n await Promise.all(\n Array.from({ length: builder.numThreads() }, () => {\n // Self-spawn into a new Worker.\n //\n // TODO: while `new URL('...', import.meta.url) becomes a semi-standard\n // way to get asset URLs relative to the module across various bundlers\n // and browser, ideally we should switch to `import.meta.resolve`\n // once it becomes a standard.\n //\n // Note: we could use `../../..` as the URL here to inline workerHelpers.js\n // into the parent entry instead of creating another split point -\n // this would be preferable from optimization perspective -\n // however, Webpack then eliminates all message handler code\n // because wasm-pack produces \"sideEffects\":false in package.json\n // unconditionally.\n //\n // The only way to work around that is to have side effect code\n // in an entry point such as Worker file itself.\n const worker = new Worker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u(\"node_modules_jsquash_oxipng_codec_pkg-parallel_snippets_wasm-bindgen-rayon-3d2df09ebec17a22_s-312b0a0\"), __webpack_require__.b), {\n type: undefined\n });\n worker.postMessage(workerInit);\n return waitForMsgType(worker, 'wasm_bindgen_worker_ready');\n })\n );\n builder.build();\n } finally {\n builder.free();\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js?");
/***/ })
}]);

View File

@ -0,0 +1,157 @@
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js":
/*!***************************************************************************************************************************!*\
!*** ./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js ***!
\***************************************************************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"startWorkers\": () => (/* binding */ startWorkers)\n/* harmony export */ });\n/**\n * Copyright 2021 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Note: we use `wasm_bindgen_worker_`-prefixed message types to make sure\n// we can handle bundling into other files, which might happen to have their\n// own `postMessage`/`onmessage` communication channels.\n//\n// If we didn't take that into the account, we could send much simpler signals\n// like just `0` or whatever, but the code would be less resilient.\n\nfunction waitForMsgType(target, type) {\n return new Promise(resolve => {\n target.addEventListener('message', function onMsg({ data }) {\n if (data == null || data.type !== type) return;\n target.removeEventListener('message', onMsg);\n resolve(data);\n });\n });\n}\n\nwaitForMsgType(self, 'wasm_bindgen_worker_init').then(async data => {\n // # Note 1\n // Our JS should have been generated in\n // `[out-dir]/snippets/wasm-bindgen-rayon-[hash]/workerHelpers.js`,\n // resolve the main module via `../../..`.\n //\n // This might need updating if the generated structure changes on wasm-bindgen\n // side ever in the future, but works well with bundlers today. The whole\n // point of this crate, after all, is to abstract away unstable features\n // and temporary bugs so that you don't need to deal with them in your code.\n //\n // # Note 2\n // This could be a regular import, but then some bundlers complain about\n // circular deps.\n //\n // Dynamic import could be cheap if this file was inlined into the parent,\n // which would require us just using `../../..` in `new Worker` below,\n // but that doesn't work because wasm-pack unconditionally adds\n // \"sideEffects\":false (see below).\n //\n // OTOH, even though it can't be inlined, it should be still reasonably\n // cheap since the requested file is already in cache (it was loaded by\n // the main thread).\n const pkg = await __webpack_require__.e(/*! import() */ \"node_modules_jsquash_oxipng_codec_pkg-parallel_squoosh_oxipng_js\").then(__webpack_require__.bind(__webpack_require__, /*! ../../../squoosh_oxipng */ \"./node_modules/@jsquash/oxipng/codec/pkg-parallel/squoosh_oxipng.js\"));\n await pkg.default(data.module, data.memory);\n postMessage({ type: 'wasm_bindgen_worker_ready' });\n pkg.wbg_rayon_start_worker(data.receiver);\n});\n\nasync function startWorkers(module, memory, builder) {\n const workerInit = {\n type: 'wasm_bindgen_worker_init',\n module,\n memory,\n receiver: builder.receiver()\n };\n\n try {\n await Promise.all(\n Array.from({ length: builder.numThreads() }, () => {\n // Self-spawn into a new Worker.\n //\n // TODO: while `new URL('...', import.meta.url) becomes a semi-standard\n // way to get asset URLs relative to the module across various bundlers\n // and browser, ideally we should switch to `import.meta.resolve`\n // once it becomes a standard.\n //\n // Note: we could use `../../..` as the URL here to inline workerHelpers.js\n // into the parent entry instead of creating another split point -\n // this would be preferable from optimization perspective -\n // however, Webpack then eliminates all message handler code\n // because wasm-pack produces \"sideEffects\":false in package.json\n // unconditionally.\n //\n // The only way to work around that is to have side effect code\n // in an entry point such as Worker file itself.\n const worker = new Worker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u(\"node_modules_jsquash_oxipng_codec_pkg-parallel_snippets_wasm-bindgen-rayon-3d2df09ebec17a22_s-3a2b7f\"), __webpack_require__.b), {\n type: undefined\n });\n worker.postMessage(workerInit);\n return waitForMsgType(worker, 'wasm_bindgen_worker_ready');\n })\n );\n builder.build();\n } finally {\n builder.free();\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/ensure chunk */
/******/ (() => {
/******/ __webpack_require__.f = {};
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = (chunkId) => {
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
/******/ __webpack_require__.f[key](chunkId, promises);
/******/ return promises;
/******/ }, []));
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/get javascript chunk filename */
/******/ (() => {
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // return url for filenames based on template
/******/ return "" + chunkId + ".script.bundle.js";
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/publicPath */
/******/ (() => {
/******/ __webpack_require__.p = "";
/******/ })();
/******/
/******/ /* webpack/runtime/importScripts chunk loading */
/******/ (() => {
/******/ __webpack_require__.b = self.location + "";
/******/
/******/ // object to store loaded chunks
/******/ // "1" means "already loaded"
/******/ var installedChunks = {
/******/ "node_modules_jsquash_oxipng_codec_pkg-parallel_snippets_wasm-bindgen-rayon-3d2df09ebec17a22_s-3a2b7f": 1
/******/ };
/******/
/******/ // importScripts chunk loading
/******/ var installChunk = (data) => {
/******/ var [chunkIds, moreModules, runtime] = data;
/******/ for(var moduleId in moreModules) {
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(runtime) runtime(__webpack_require__);
/******/ while(chunkIds.length)
/******/ installedChunks[chunkIds.pop()] = 1;
/******/ parentChunkLoadingFunction(data);
/******/ };
/******/ __webpack_require__.f.i = (chunkId, promises) => {
/******/ // "1" is the signal for "already loaded"
/******/ if(!installedChunks[chunkId]) {
/******/ if(true) { // all chunks have JS
/******/ importScripts(__webpack_require__.p + __webpack_require__.u(chunkId));
/******/ }
/******/ }
/******/ };
/******/
/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || [];
/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);
/******/ chunkLoadingGlobal.push = installChunk;
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__("./node_modules/@jsquash/oxipng/codec/pkg-parallel/snippets/wasm-bindgen-rayon-3d2df09ebec17a22/src/workerHelpers.js");
/******/
/******/ })()
;

View File

@ -0,0 +1,32 @@
"use strict";
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
(self["webpackChunk"] = self["webpackChunk"] || []).push([["node_modules_jsquash_oxipng_codec_pkg_squoosh_oxipng_js"],{
/***/ "./node_modules/@jsquash/oxipng/codec/pkg/squoosh_oxipng_bg.wasm":
/*!***********************************************************************!*\
!*** ./node_modules/@jsquash/oxipng/codec/pkg/squoosh_oxipng_bg.wasm ***!
\***********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
eval("module.exports = __webpack_require__.p + \"c96242667dc8e630897a.wasm\";\n\n//# sourceURL=webpack:///./node_modules/@jsquash/oxipng/codec/pkg/squoosh_oxipng_bg.wasm?");
/***/ }),
/***/ "./node_modules/@jsquash/oxipng/codec/pkg/squoosh_oxipng.js":
/*!******************************************************************!*\
!*** ./node_modules/@jsquash/oxipng/codec/pkg/squoosh_oxipng.js ***!
\******************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ \"optimise\": () => (/* binding */ optimise)\n/* harmony export */ });\n\nlet wasm;\n\nlet cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nlet cachegetUint8Memory0 = null;\nfunction getUint8Memory0() {\n if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {\n cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachegetUint8Memory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nfunction passArray8ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 1);\n getUint8Memory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nlet cachegetInt32Memory0 = null;\nfunction getInt32Memory0() {\n if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {\n cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);\n }\n return cachegetInt32Memory0;\n}\n\nfunction getArrayU8FromWasm0(ptr, len) {\n return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);\n}\n/**\n* @param {Uint8Array} data\n* @param {number} level\n* @param {boolean} interlace\n* @returns {Uint8Array}\n*/\nfunction optimise(data, level, interlace) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);\n var len0 = WASM_VECTOR_LEN;\n wasm.optimise(retptr, ptr0, len0, level, interlace);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var v1 = getArrayU8FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 1);\n return v1;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n\nasync function load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nasync function init(input) {\n if (typeof input === 'undefined') {\n input = new URL(/* asset import */ __webpack_require__(/*! squoosh_oxipng_bg.wasm */ \"./node_modules/@jsquash/oxipng/codec/pkg/squoosh_oxipng_bg.wasm\"), __webpack_require__.b);\n }\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n\n if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {\n input = fetch(input);\n }\n\n\n\n const { instance, module } = await load(await input, imports);\n\n wasm = instance.exports;\n init.__wbindgen_wasm_module = module;\n\n return wasm;\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (init);\n\n\n\n//# sourceURL=webpack:///./node_modules/@jsquash/oxipng/codec/pkg/squoosh_oxipng.js?");
/***/ })
}]);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,337 @@
//import * as avif from '@jsquash/avif'; // TBD
//import * as webp from '@jsquash/webp'; // TBD
import * as jpeg from '@jsquash/jpeg';
import * as png from '@jsquash/png';
import optimise from '@jsquash/oxipng/optimise';
const { __ } = wp.i18n; // Import __() from wp.i18n
(function () {
const bulkBtn = document.querySelector("input[name='squeeze_bulk']")
const bulkLogInput = document.querySelector("[name='squeeze_bulk_log']")
const squeeze_bulk_ids = document.querySelector("input[name='squeeze_bulk_ids']")?.value ?? null;
const uncompressedIDs = squeeze_bulk_ids ? squeeze_bulk_ids.split(",") : [];
async function decode(sourceType, fileBuffer) {
switch (sourceType) {
//case 'avif':
// return await avif.decode(fileBuffer);
case 'jpeg':
return await jpeg.decode(fileBuffer);
case 'png':
return await png.decode(fileBuffer);
//case 'webp':
// return await webp.decode(fileBuffer);
default:
throw new Error(`Unknown source type: ${sourceType}`);
}
}
async function encode(outputType, imageData) {
const options = JSON.parse(squeeze.options);
switch (outputType) {
//case 'avif':
// return await avif.encode(imageData);
case 'jpeg':
const jpegOptions = {}
for (const [key, value] of Object.entries(options)) {
if (key.includes('jpeg')) {
const keyName = key.replace('jpeg_', '')
jpegOptions[keyName] = value
}
}
return await jpeg.encode(imageData, jpegOptions);
case 'png':
const pngOptions = {}
for (const [key, value] of Object.entries(options)) {
if (key.includes('png')) {
const keyName = key.replace('png_', '')
pngOptions[keyName] = value
}
}
return await png.encode(imageData, pngOptions);
//case 'webp':
// return await webp.encode(imageData);
default:
throw new Error(`Unknown output type: ${outputType}`);
}
}
async function convert(sourceType, outputType, fileBuffer) {
const imageData = await decode(sourceType, fileBuffer);
return encode(outputType, imageData);
}
function blobToBase64(blob) {
return new Promise((resolve, _) => {
const reader = new FileReader();
reader.onloadend = () => resolve(reader.result);
reader.readAsDataURL(blob);
});
}
async function showOutput(imageBuffer, outputType) {
const imageBlob = new Blob([imageBuffer], { type: `image/${outputType}` });
const base64String = await blobToBase64(imageBlob);
return base64String;
}
async function handleUpload(attachment, isBulk = false, isSingle = false, target = null) {
const attachmentData = attachment.attributes;
const url = attachmentData?.originalImageURL ?? attachmentData.url;
const mime = attachmentData.mime;
const name = attachmentData.name;
const filename = attachmentData?.originalImageName ?? attachmentData.filename;
const attachmentID = attachmentData.id;
const format = mime.split("/")[1];
const sourceType = format;
const outputType = format;
const options = JSON.parse(squeeze.options);
let imageBuffer;
let fileBuffer;
let base64;
if (format === "png") {
const pngOptions = {}
for (const [key, value] of Object.entries(options)) {
if (key.includes('png')) {
const keyName = key.replace('png_', '')
pngOptions[keyName] = value
}
}
imageBuffer = await fetch(url).then(res => res.arrayBuffer()).then(pngImageBuffer => optimise(pngImageBuffer, pngOptions));
base64 = await showOutput(imageBuffer, outputType);
} else {
let response = await fetch(url);
let blob = await response.blob();
let metadata = {
type: mime
};
let imageObj = new File([blob], name, metadata);
fileBuffer = await imageObj.arrayBuffer();
/*
if (window.Worker) {
//const myWorker = new Worker(new URL(`${squeeze.pluginUrl}/assets/js/worker.js`), { type: "module" });
const myWorker = new Worker(/* webpackChunkName: "foo-worker" */ /*new URL(`./worker.js`, import.meta.url));
myWorker.postMessage(
{
fileBuffer: fileBuffer,
sourceType: sourceType,
outputType: outputType,
}
);
console.log('Message posted to worker');
myWorker.onmessage = function(e) {
console.log('Message received from worker', e.data);
myWorker.terminate();
}
} else {
console.log('Your browser doesn\'t support web workers.');
}
*/
imageBuffer = await convert(sourceType, outputType, fileBuffer);
base64 = await showOutput(imageBuffer, outputType);
}
let data = {
action: 'squeeze_update_attachment',
_ajax_nonce: squeeze.nonce,
filename: filename,
type: 'image',
format: format,
base64: base64,
attachmentID: attachmentID,
url: url,
}
jQuery.ajax({
url: squeeze.ajaxUrl,
type: 'POST',
data: data,
beforeSend: function () {
console.log('data', data)
if (isBulk)
bulkLogInput.value += `#${attachmentID}: ` + __('Compressed successfully, updating...', 'squeeze') + `\r\n`;
},
error: function (error) {
console.error(error)
if (target) {
target.closest("td").querySelector(".squeeze_status").innerText = __('An error has occured. Check the console for details.', 'squeeze')
target.remove();
}
},
success: function (response) {
console.log(response)
if (isBulk) {
if (response.success) {
bulkLogInput.value += `#${attachmentID}: ` + __('Updated successfully', 'squeeze') + `\r\n===============================\r\n`;
handleBulkUpload()
} else {
bulkLogInput.value += `#${attachmentID}: ${response.data}\r\n===============================\r\n`;
}
}
if (isSingle && target) {
target.closest("td").querySelector(".squeeze_status").innerText = response.data;
target.remove();
}
if (!isSingle && !isBulk) {
attachment.set('uploading', false) // resume uploading process
}
}
});
}
const handleBulkUpload = () => {
const data = {
action: 'squeeze_get_attachment',
_ajax_nonce: squeeze.nonce,
attachmentID: uncompressedIDs[0],
}
if (uncompressedIDs.length === 0) {
alert(__('All images have been compressed!', 'squeeze'))
bulkBtn.remove();
location.reload();
return;
}
bulkLogInput.value += `attachment #${uncompressedIDs[0]}: start compressing...\r\n`;
jQuery.ajax({
url: squeeze.ajaxUrl,
type: 'POST',
data: data,
error: function (error) {
console.error(error)
},
success: function (response) {
//console.log(response)
if (response.success) {
const responseData = response.data;
const attachment = {
attributes: {
url: responseData.url,
mime: responseData.mime,
name: responseData.name,
filename: responseData.filename,
id: responseData.id,
}
}
//console.log(attachment, 'attachment')
uncompressedIDs.shift();
handleUpload(attachment, true)
} else {
console.error(response.data)
}
}
});
}
function handleRestore(attachmentID, target) {
let data = {
action: 'squeeze_restore_attachment',
_ajax_nonce: squeeze.nonce,
attachmentID: attachmentID,
}
jQuery.ajax({
url: squeeze.ajaxUrl,
type: 'POST',
data: data,
beforeSend: function () {
target.disabled = true;
target.innerText = __('Restore in process...', 'squeeze')
},
error: function (error) {
console.error(error)
target.closest("td").querySelector(".squeeze_status").innerText = __('An error has occured. Check the console for details.', 'squeeze')
target.remove();
},
success: function (response) {
//console.log(response)
target.closest("td").querySelector(".squeeze_status").innerText = response.data; //__('Restored successfully', 'squeeze')
target.remove();
}
});
}
// Handle single compress button click
const handleSingleBtnClick = (event) => {
const attachmentID = event.target.dataset.attachment;
wp?.media?.attachment(attachmentID).fetch().then(function (data) {
const attachment = {
attributes: data
}
handleUpload(attachment, false, true, event.target)
});
}
// Handle restore button click
const handleRestoreBtnClick = (event) => {
const attachmentID = event.target.dataset.attachment;
handleRestore(attachmentID, event.target)
}
/**
* Handle single buttons click
*/
function handleSingleButtonsClick() {
document.addEventListener("click", (e) => {
//console.log(e.target, 'e.target')
const singleBtnName = 'squeeze_compress_single';
const restoreBtnName = 'squeeze_restore';
if (e.target.getAttribute("name") === singleBtnName) {
e.target.disabled = true;
e.target.innerText = __('Compressing...', 'squeeze')
handleSingleBtnClick(e)
}
if (e.target.getAttribute("name") === restoreBtnName) {
e.target.disabled = true;
handleRestoreBtnClick(e)
}
})
}
handleSingleButtonsClick()
/**
* Handle bulk button click
*/
bulkBtn?.addEventListener("click", (event) => {
if (uncompressedIDs.length === 0) {
return;
}
bulkBtn.disabled = true;
handleBulkUpload()
})
// https://wordpress.stackexchange.com/a/131295/186146 - override wp.Uploader.prototype.success
jQuery.extend(wp?.Uploader?.prototype, {
success: function (attachment) {
//console.log(attachment, 'success');
const options = JSON.parse(squeeze.options);
const isAutoCompress = options.auto_compress;
let isImage = attachment.attributes.type === 'image' &&
(attachment.attributes.subtype === 'jpeg' || attachment.attributes.subtype === 'png')
if (isImage && isAutoCompress) {
// set 'uploading' param to true, to pause the uploading process
attachment.set('uploading', true)
handleUpload(attachment)
}
},
});
})();
//console.log(JSON.parse(squeeze.options), 'squeeze.options')

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,104 @@
import * as jpeg from '@jsquash/jpeg';
import * as png from '@jsquash/png';
import optimise from '@jsquash/oxipng/optimise';
async function decode(sourceType, fileBuffer) {
switch (sourceType) {
//case 'avif':
// return await avif.decode(fileBuffer);
case 'jpeg':
return await jpeg.decode(fileBuffer);
case 'png':
return await png.decode(fileBuffer);
//case 'webp':
// return await webp.decode(fileBuffer);
default:
throw new Error(`Unknown source type: ${sourceType}`);
}
}
async function encode(outputType, imageData) {
const options = {
"jpeg_quality": 75,
"jpeg_baseline": false,
"jpeg_arithmetic": false,
"jpeg_progressive": true,
"jpeg_optimize_coding": true,
"jpeg_smoothing": 0,
"jpeg_color_space": 3,
"jpeg_quant_table": 3,
"jpeg_trellis_multipass": false,
"jpeg_trellis_opt_zero": false,
"jpeg_trellis_opt_table": false,
"jpeg_trellis_loops": 1,
"jpeg_auto_subsample": true,
"jpeg_chroma_subsample": 2,
"jpeg_separate_chroma_quality": false,
"jpeg_chroma_quality": 75,
"png_level": 2,
"png_interlace": false,
"auto_compress": true,
"backup_original": true
};
switch (outputType) {
//case 'avif':
// return await avif.encode(imageData);
case 'jpeg':
const jpegOptions = {}
for (const [key, value] of Object.entries(options)) {
if (key.includes('jpeg')) {
const keyName = key.replace('jpeg_', '')
jpegOptions[keyName] = value
}
}
return await jpeg.encode(imageData, jpegOptions);
case 'png':
const pngOptions = {}
for (const [key, value] of Object.entries(options)) {
if (key.includes('png')) {
const keyName = key.replace('png_', '')
pngOptions[keyName] = value
}
}
return await png.encode(imageData, pngOptions);
//case 'webp':
// return await webp.encode(imageData);
default:
throw new Error(`Unknown output type: ${outputType}`);
}
}
async function convert(sourceType, outputType, fileBuffer) {
const imageData = await decode(sourceType, fileBuffer);
return encode(outputType, imageData);
}
function blobToBase64(blob) {
return new Promise((resolve, _) => {
const reader = new FileReader();
reader.onloadend = () => resolve(reader.result);
reader.readAsDataURL(blob);
});
}
async function showOutput(imageBuffer, outputType) {
const imageBlob = new Blob([imageBuffer], { type: `image/${outputType}` });
const base64String = await blobToBase64(imageBlob);
return base64String;
}
self.onmessage = async function(e) {
console.log('Worker: Message received from main script');
const {fileBuffer, sourceType, outputType} = e.data;
let imageBuffer = await convert(sourceType, outputType, fileBuffer);
let base64 = await showOutput(imageBuffer, outputType);
console.log(e)
postMessage(base64)
}