diff --git a/node_modules/@jimp/plugin-resize/node_modules/zod/v4-mini/index.cjs b/node_modules/@jimp/plugin-resize/node_modules/zod/v4-mini/index.cjs
new file mode 100644
index 0000000000000000000000000000000000000000..fcc365e7a5435ca2010ed935cdd00853f56c7f99
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/node_modules/zod/v4-mini/index.cjs
@@ -0,0 +1,17 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+__exportStar(require("../v4/mini/index.cjs"), exports);
diff --git a/node_modules/@jimp/plugin-resize/node_modules/zod/v4-mini/index.d.cts b/node_modules/@jimp/plugin-resize/node_modules/zod/v4-mini/index.d.cts
new file mode 100644
index 0000000000000000000000000000000000000000..511ff3a931005a87b0df1f8aa08379d16908ad2a
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/node_modules/zod/v4-mini/index.d.cts
@@ -0,0 +1 @@
+export * from "../v4/mini/index.cjs";
diff --git a/node_modules/@jimp/plugin-resize/node_modules/zod/v4-mini/index.d.ts b/node_modules/@jimp/plugin-resize/node_modules/zod/v4-mini/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..87b293a4f15e3f68f506e98c2abdde6f7b0e2dc9
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/node_modules/zod/v4-mini/index.d.ts
@@ -0,0 +1 @@
+export * from "../v4/mini/index.js";
diff --git a/node_modules/@jimp/plugin-resize/node_modules/zod/v4-mini/index.js b/node_modules/@jimp/plugin-resize/node_modules/zod/v4-mini/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..87b293a4f15e3f68f506e98c2abdde6f7b0e2dc9
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/node_modules/zod/v4-mini/index.js
@@ -0,0 +1 @@
+export * from "../v4/mini/index.js";
diff --git a/node_modules/@jimp/plugin-resize/package.json b/node_modules/@jimp/plugin-resize/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..7c5cd53760de3cf3c84a30b327b20202e8e3292b
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/package.json
@@ -0,0 +1,67 @@
+{
+ "name": "@jimp/plugin-resize",
+ "version": "1.6.1",
+ "repository": "jimp-dev/jimp",
+ "engines": {
+ "node": ">=18"
+ },
+ "scripts": {
+ "lint": "eslint .",
+ "test": "vitest",
+ "test:browser": "vitest --config vitest.config.browser.mjs",
+ "build": "tshy",
+ "dev": "tshy --watch",
+ "clean": "rm -rf node_modules .tshy .tshy-build dist .turbo"
+ },
+ "author": "Andrew Lisowski ",
+ "license": "MIT",
+ "dependencies": {
+ "@jimp/core": "1.6.1",
+ "@jimp/types": "1.6.1",
+ "zod": "^3.23.8"
+ },
+ "devDependencies": {
+ "@jimp/config-eslint": "1.6.1",
+ "@jimp/config-typescript": "1.6.1",
+ "@jimp/config-vitest": "1.6.1",
+ "@jimp/test-utils": "1.6.1",
+ "@types/node": "^18.19.48",
+ "@vitest/browser": "^2.0.5",
+ "eslint": "^9.9.1",
+ "tshy": "^3.0.2",
+ "typescript": "^5.5.4",
+ "vite-plugin-node-polyfills": "^0.22.0",
+ "vitest": "^2.0.5"
+ },
+ "tshy": {
+ "exclude": [
+ "**/*.test.ts"
+ ],
+ "exports": {
+ "./package.json": "./package.json",
+ ".": "./src/index.ts"
+ }
+ },
+ "exports": {
+ "./package.json": "./package.json",
+ ".": {
+ "import": {
+ "types": "./dist/esm/index.d.ts",
+ "default": "./dist/esm/index.js"
+ },
+ "require": {
+ "types": "./dist/commonjs/index.d.ts",
+ "default": "./dist/commonjs/index.js"
+ }
+ }
+ },
+ "main": "./dist/commonjs/index.js",
+ "types": "./dist/commonjs/index.d.ts",
+ "type": "module",
+ "publishConfig": {
+ "access": "public"
+ },
+ "sideEffects": false,
+ "module": "./dist/esm/index.js",
+ "gitHead": "7e6a95694e00a8b6f1bdd9aad709f5413eb9b08c"
+}
diff --git a/node_modules/@jimp/plugin-resize/src/__snapshots__/index.test.ts.snap b/node_modules/@jimp/plugin-resize/src/__snapshots__/index.test.ts.snap
new file mode 100644
index 0000000000000000000000000000000000000000..d1a3183ca9324b83869b2f8f981ed892e4282b99
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/src/__snapshots__/index.test.ts.snap
@@ -0,0 +1,445 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`Resize images > max contrast 8x8 > to BEZIER 2x5 1`] = `
+Visualization:
+
+■▩
+■▩
+■▩
+□D
+□D
+
+Data:
+
+00-00-00ᶠᶠ DF-DF-DFᶠᶠ
+00-00-00ᶠᶠ DF-DF-DFᶠᶠ
+00-00-00ᶠᶠ DF-DF-DFᶠᶠ
+FF-FF-FFᶠᶠ 20-20-20ᶠᶠ
+FF-FF-FFᶠᶠ 20-20-20ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 8x8 > to BEZIER 4x4 1`] = `
+Visualization:
+
+■■D□
+■■D□
+DD3▩
+□□▩■
+
+Data:
+
+00-00-00ᶠᶠ 00-00-00ᶠᶠ C0-C0-C0ᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ C0-C0-C0ᶠᶠ FF-FF-FFᶠᶠ
+C0-C0-C0ᶠᶠ C0-C0-C0ᶠᶠ 60-60-60ᶠᶠ 40-40-40ᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 40-40-40ᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 8x8 > to BICUBIC 2x5 1`] = `
+Visualization:
+
+■▩
+■▩
+■▩
+□D
+□D
+
+Data:
+
+00-00-00ᶠᶠ DF-DF-DFᶠᶠ
+00-00-00ᶠᶠ DF-DF-DFᶠᶠ
+00-00-00ᶠᶠ DF-DF-DFᶠᶠ
+FF-FF-FFᶠᶠ 20-20-20ᶠᶠ
+FF-FF-FFᶠᶠ 20-20-20ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 8x8 > to BICUBIC 4x4 1`] = `
+Visualization:
+
+■■▥□
+■■▥□
+▥▥!▩
+□□▩■
+
+Data:
+
+00-00-00ᶠᶠ 00-00-00ᶠᶠ BF-BF-BFᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ BF-BF-BFᶠᶠ FF-FF-FFᶠᶠ
+BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ 5F-5F-5Fᶠᶠ 40-40-40ᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 40-40-40ᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 8x8 > to BILINEAR 2x5 1`] = `
+Visualization:
+
+■□
+■□
+3C
+□■
+□■
+
+Data:
+
+00-00-00ᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ FF-FF-FFᶠᶠ
+33-33-33ᶠᶠ CC-CC-CCᶠᶠ
+FF-FF-FFᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 8x8 > to BILINEAR 4x4 1`] = `
+Visualization:
+
+■■□□
+■■□□
+□□■■
+□□■■
+
+Data:
+
+00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 8x8 > to HERMITE 2x5 1`] = `
+Visualization:
+
+■▩
+■▩
+■▩
+□D
+□D
+
+Data:
+
+00-00-00ᶠᶠ DF-DF-DFᶠᶠ
+00-00-00ᶠᶠ DF-DF-DFᶠᶠ
+00-00-00ᶠᶠ DF-DF-DFᶠᶠ
+FF-FF-FFᶠᶠ 20-20-20ᶠᶠ
+FF-FF-FFᶠᶠ 20-20-20ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 8x8 > to HERMITE 4x4 1`] = `
+Visualization:
+
+■■D□
+■■D□
+DD3▩
+□□▩■
+
+Data:
+
+00-00-00ᶠᶠ 00-00-00ᶠᶠ C0-C0-C0ᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ C0-C0-C0ᶠᶠ FF-FF-FFᶠᶠ
+C0-C0-C0ᶠᶠ C0-C0-C0ᶠᶠ 60-60-60ᶠᶠ 40-40-40ᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 40-40-40ᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 8x8 > to NEAREST_NEIGHBOR 2x5 1`] = `
+Visualization:
+
+■□
+■□
+■□
+□■
+□■
+
+Data:
+
+00-00-00ᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ FF-FF-FFᶠᶠ
+FF-FF-FFᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 8x8 > to NEAREST_NEIGHBOR 4x4 1`] = `
+Visualization:
+
+■■□□
+■■□□
+□□■■
+□□■■
+
+Data:
+
+00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 8x8 > to default 2x5 1`] = `
+Visualization:
+
+■□
+■□
+▦▦
+□■
+□■
+
+Data:
+
+00-00-00ᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ FF-FF-FFᶠᶠ
+80-80-80ᶠᶠ 80-80-80ᶠᶠ
+FF-FF-FFᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 8x8 > to default 4x4 1`] = `
+Visualization:
+
+■■□□
+■■□□
+□□■■
+□□■■
+
+Data:
+
+00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 12x12 with dots > to BEZIER 6x6 1`] = `
+Visualization:
+
+■■■D□□
+■4◇D◇□
+■■■D□□
+DDD3▩▩
+□▴◇▩3■
+□D▩▩▴■
+
+Data:
+
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ C0-C0-C0ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 44-44-44ᶠᶠ 1D-1D-1Dᶠᶠ C0-C0-C0ᶠᶠ 9F-9F-9Fᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ C0-C0-C0ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+C0-C0-C0ᶠᶠ C0-C0-C0ᶠᶠ C0-C0-C0ᶠᶠ 60-60-60ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ
+FF-FF-FFᶠᶠ F0-F0-F0ᶠᶠ F9-F9-F9ᶠᶠ 40-40-40ᶠᶠ 15-15-15ᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ CA-CA-CAᶠᶠ E9-E9-E9ᶠᶠ 40-40-40ᶠᶠ 4B-4B-4Bᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 12x12 with dots > to BICUBIC 6x6 1`] = `
+Visualization:
+
+■■■▥□□
+■3D▥3□
+■■■▥□□
+▥▥▥!▩▩
+□ED▩◇■
+□3▴▩▩■
+
+Data:
+
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ BF-BF-BFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 47-47-47ᶠᶠ 20-20-20ᶠᶠ BF-BF-BFᶠᶠ 97-97-97ᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ BF-BF-BFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ 5F-5F-5Fᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ
+FF-FF-FFᶠᶠ EE-EE-EEᶠᶠ F7-F7-F7ᶠᶠ 40-40-40ᶠᶠ 18-18-18ᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ C9-C9-C9ᶠᶠ E6-E6-E6ᶠᶠ 40-40-40ᶠᶠ 4E-4E-4Eᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 12x12 with dots > to BILINEAR 6x6 1`] = `
+Visualization:
+
+■■■□□□
+■■■□■□
+■■■□□□
+□□□■■■
+□□□■■■
+□□□■■■
+
+Data:
+
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 12x12 with dots > to HERMITE 6x6 1`] = `
+Visualization:
+
+■■■D□□
+■▩▴D3□
+■■■D□□
+DDD3▩▩
+□▩▴▩1■
+□▩▴▩D■
+
+Data:
+
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ C0-C0-C0ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 40-40-40ᶠᶠ 19-19-19ᶠᶠ C0-C0-C0ᶠᶠ A6-A6-A6ᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ C0-C0-C0ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+C0-C0-C0ᶠᶠ C0-C0-C0ᶠᶠ C0-C0-C0ᶠᶠ 60-60-60ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ
+FF-FF-FFᶠᶠ F3-F3-F3ᶠᶠ FA-FA-FAᶠᶠ 40-40-40ᶠᶠ 11-11-11ᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ CB-CB-CBᶠᶠ EB-EB-EBᶠᶠ 40-40-40ᶠᶠ 48-48-48ᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 12x12 with dots > to NEAREST_NEIGHBOR 6x6 1`] = `
+Visualization:
+
+■■■□□□
+■■■□■□
+■■■□□□
+□□□■■■
+□□□■■■
+□□□■■■
+
+Data:
+
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > max contrast 12x12 with dots > to default 6x6 1`] = `
+Visualization:
+
+■■■□□□
+■▩■□▥□
+■■■□□□
+□□□■■■
+□▥□■▩■
+□□□■■■
+
+Data:
+
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 40-40-40ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ BF-BF-BFᶠᶠ FF-FF-FFᶠᶠ
+00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ BF-BF-BFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 40-40-40ᶠᶠ 00-00-00ᶠᶠ
+FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ FF-FF-FFᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ 00-00-00ᶠᶠ
+`;
+
+exports[`Resize images > mutch contrast 4x4 > to BEZIER 6x6 1`] = `
+Visualization:
+
+▩D▩▦▥▩
+D▩D▦▩D
+▩D▩▦▥▩
+▦▦▦▦▦▦
+▥▩▥▦▩D
+▩D▩▦D▩
+
+Data:
+
+40-40-40ᶠᶠ 34-34-34ᶠᶠ 40-40-40ᶠᶠ 80-80-80ᶠᶠ BF-BF-BFᶠᶠ CB-CB-CBᶠᶠ
+34-34-34ᶠᶠ 26-26-26ᶠᶠ 34-34-34ᶠᶠ 80-80-80ᶠᶠ CB-CB-CBᶠᶠ D9-D9-D9ᶠᶠ
+40-40-40ᶠᶠ 34-34-34ᶠᶠ 40-40-40ᶠᶠ 80-80-80ᶠᶠ BF-BF-BFᶠᶠ CB-CB-CBᶠᶠ
+80-80-80ᶠᶠ 80-80-80ᶠᶠ 80-80-80ᶠᶠ 80-80-80ᶠᶠ 80-80-80ᶠᶠ 80-80-80ᶠᶠ
+BF-BF-BFᶠᶠ CB-CB-CBᶠᶠ BF-BF-BFᶠᶠ 80-80-80ᶠᶠ 40-40-40ᶠᶠ 34-34-34ᶠᶠ
+CB-CB-CBᶠᶠ D9-D9-D9ᶠᶠ CB-CB-CBᶠᶠ 80-80-80ᶠᶠ 34-34-34ᶠᶠ 26-26-26ᶠᶠ
+`;
+
+exports[`Resize images > mutch contrast 4x4 > to BICUBIC 6x6 1`] = `
+Visualization:
+
+▩▩▩D▥3
+▩▩▩D3▴
+▩▩▩D▥3
+DDDDDD
+▥3▥D▩▩
+3▴3D▩▩
+
+Data:
+
+40-40-40ᶠᶠ 30-30-30ᶠᶠ 40-40-40ᶠᶠ 7F-7F-7Fᶠᶠ BF-BF-BFᶠᶠ CE-CE-CEᶠᶠ
+30-30-30ᶠᶠ 1C-1C-1Cᶠᶠ 30-30-30ᶠᶠ 7F-7F-7Fᶠᶠ CE-CE-CEᶠᶠ E1-E1-E1ᶠᶠ
+40-40-40ᶠᶠ 30-30-30ᶠᶠ 40-40-40ᶠᶠ 7F-7F-7Fᶠᶠ BF-BF-BFᶠᶠ CE-CE-CEᶠᶠ
+7F-7F-7Fᶠᶠ 7F-7F-7Fᶠᶠ 7F-7F-7Fᶠᶠ 7F-7F-7Fᶠᶠ 7F-7F-7Fᶠᶠ 7F-7F-7Fᶠᶠ
+BF-BF-BFᶠᶠ CE-CE-CEᶠᶠ BF-BF-BFᶠᶠ 7F-7F-7Fᶠᶠ 40-40-40ᶠᶠ 30-30-30ᶠᶠ
+CE-CE-CEᶠᶠ E1-E1-E1ᶠᶠ CE-CE-CEᶠᶠ 7F-7F-7Fᶠᶠ 30-30-30ᶠᶠ 1C-1C-1Cᶠᶠ
+`;
+
+exports[`Resize images > mutch contrast 4x4 > to BILINEAR 6x6 1`] = `
+Visualization:
+
+▩▩3▥▥▥
+▩▩3▥▥▥
+33▴◇◇◇
+▥▥◇▩▩▩
+▥▥◇▩▩▩
+▥▥◇▩▩▩
+
+Data:
+
+40-40-40ᶠᶠ 40-40-40ᶠᶠ 6A-6A-6Aᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ
+40-40-40ᶠᶠ 40-40-40ᶠᶠ 6A-6A-6Aᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ
+6A-6A-6Aᶠᶠ 6A-6A-6Aᶠᶠ 78-78-78ᶠᶠ 95-95-95ᶠᶠ 95-95-95ᶠᶠ 95-95-95ᶠᶠ
+BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ 95-95-95ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ
+BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ 95-95-95ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ
+BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ 95-95-95ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ
+`;
+
+exports[`Resize images > mutch contrast 4x4 > to HERMITE 6x6 1`] = `
+Visualization:
+
+▩3▩▦▥◇
+3D3▦◇▩
+▩3▩▦▥◇
+▦▦▦▦▦▦
+▥◇▥▦▩3
+◇▩◇▦3D
+
+Data:
+
+40-40-40ᶠᶠ 38-38-38ᶠᶠ 40-40-40ᶠᶠ 80-80-80ᶠᶠ BF-BF-BFᶠᶠ C7-C7-C7ᶠᶠ
+38-38-38ᶠᶠ 2F-2F-2Fᶠᶠ 38-38-38ᶠᶠ 80-80-80ᶠᶠ C7-C7-C7ᶠᶠ D0-D0-D0ᶠᶠ
+40-40-40ᶠᶠ 38-38-38ᶠᶠ 40-40-40ᶠᶠ 80-80-80ᶠᶠ BF-BF-BFᶠᶠ C7-C7-C7ᶠᶠ
+80-80-80ᶠᶠ 80-80-80ᶠᶠ 80-80-80ᶠᶠ 80-80-80ᶠᶠ 80-80-80ᶠᶠ 80-80-80ᶠᶠ
+BF-BF-BFᶠᶠ C7-C7-C7ᶠᶠ BF-BF-BFᶠᶠ 80-80-80ᶠᶠ 40-40-40ᶠᶠ 38-38-38ᶠᶠ
+C7-C7-C7ᶠᶠ D0-D0-D0ᶠᶠ C7-C7-C7ᶠᶠ 80-80-80ᶠᶠ 38-38-38ᶠᶠ 2F-2F-2Fᶠᶠ
+`;
+
+exports[`Resize images > mutch contrast 4x4 > to NEAREST_NEIGHBOR 6x6 1`] = `
+Visualization:
+
+▩▩▩▥▥▥
+▩▩▩▥▥▥
+▩▩▩▥▥▥
+▥▥▥▩▩▩
+▥▥▥▩▩▩
+▥▥▥▩▩▩
+
+Data:
+
+40-40-40ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ
+40-40-40ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ
+40-40-40ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ
+BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ
+BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ
+BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ
+`;
+
+exports[`Resize images > mutch contrast 4x4 > to default 6x6 1`] = `
+Visualization:
+
+▩▩▩◇▥▥
+▩▩▩◇▥▥
+▩▩▩◇▥▥
+◇◇◇▴33
+▥▥▥3▩▩
+▥▥▥3▩▩
+
+Data:
+
+40-40-40ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ 95-95-95ᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ
+40-40-40ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ 95-95-95ᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ
+40-40-40ᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ 95-95-95ᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ
+95-95-95ᶠᶠ 95-95-95ᶠᶠ 95-95-95ᶠᶠ 78-78-78ᶠᶠ 6A-6A-6Aᶠᶠ 6A-6A-6Aᶠᶠ
+BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ 6A-6A-6Aᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ
+BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ BF-BF-BFᶠᶠ 6A-6A-6Aᶠᶠ 40-40-40ᶠᶠ 40-40-40ᶠᶠ
+`;
diff --git a/node_modules/@jimp/plugin-resize/src/constants.ts b/node_modules/@jimp/plugin-resize/src/constants.ts
new file mode 100644
index 0000000000000000000000000000000000000000..11b9bda293b4275e322e32c4178147a4edbd748d
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/src/constants.ts
@@ -0,0 +1,26 @@
+/**
+ * What resizing algorithm to use.
+ */
+export enum ResizeStrategy {
+ /**
+ * Nearest Neighbor resizing is a method used in image processing that assigns the value of the nearest pixel to the output pixel when resizing an image.
+ * While fast, it can lead to lower quality outputs with noticeable pixelation, especially at larger scaling factors.
+ */
+ NEAREST_NEIGHBOR = "nearestNeighbor",
+ /**
+ * Bilinear resizing is an image scaling method that uses the weighted average of the four nearest pixel values, providing smoother gradients than nearest neighbor resizing.
+ * It's computationally more intense than nearest neighbor but results in images of higher quality and fewer artifacts.
+ */
+ BILINEAR = "bilinearInterpolation",
+ /**
+ * Bicubic resizing is an image interpolation method that uses the values of the nearest 16 pixels in the input image to calculate the output pixel value, providing even more smoothness and sharpness than bilinear resizing.
+ * Although it's computationally more expensive than bilinear and nearest neighbor, it produces higher quality images, making it ideal for photographic image scaling.
+ */
+ BICUBIC = "bicubicInterpolation",
+ /**
+ * Hermite resizing is an image resizing method that uses Hermite interpolation, a mathematical formula, to determine the values of output pixels based on a weighted average of the surrounding pixels.
+ * Although slower than some simpler techniques like bilinear or nearest neighbor, Hermite resizing can produce higher quality visuals and detailed renderings with less blurring.
+ */
+ HERMITE = "hermiteInterpolation",
+ BEZIER = "bezierInterpolation",
+}
diff --git a/node_modules/@jimp/plugin-resize/src/index.test.ts b/node_modules/@jimp/plugin-resize/src/index.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..add703737274e58e60b0231b0db3cf532d963260
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/src/index.test.ts
@@ -0,0 +1,101 @@
+import { expect, test, describe } from "vitest";
+
+import { makeTestImage } from "@jimp/test-utils";
+import { createJimp } from "@jimp/core";
+
+import { methods, ResizeStrategy } from "./index.js";
+
+const jimp = createJimp({ plugins: [methods], formats: [] });
+
+describe("Resize images", () => {
+ const testImages = [
+ {
+ title: "max contrast 8x8",
+ src: jimp.fromBitmap(
+ makeTestImage(
+ "■■■■□□□□",
+ "■■■■□□□□",
+ "■■■■□□□□",
+ "■■■■□□□□",
+ "□□□□■■■■",
+ "□□□□■■■■",
+ "□□□□■■■■",
+ "□□□□■■■■"
+ )
+ ),
+ tests: [
+ { mode: "default", size: { height: 4, width: 4 } },
+ { mode: "NEAREST_NEIGHBOR", size: { height: 4, width: 4 } },
+ { mode: "BILINEAR", size: { height: 4, width: 4 } },
+ { mode: "BICUBIC", size: { height: 4, width: 4 } },
+ { mode: "HERMITE", size: { height: 4, width: 4 } },
+ { mode: "BEZIER", size: { height: 4, width: 4 } },
+ { mode: "default", size: { height: 5, width: 2 } },
+ { mode: "NEAREST_NEIGHBOR", size: { height: 5, width: 2 } },
+ { mode: "BILINEAR", size: { height: 5, width: 2 } },
+ { mode: "BICUBIC", size: { height: 5, width: 2 } },
+ { mode: "HERMITE", size: { height: 5, width: 2 } },
+ { mode: "BEZIER", size: { height: 5, width: 2 } },
+ ],
+ },
+ /**********************************************************************/
+ {
+ title: "max contrast 12x12 with dots",
+ src: jimp.fromBitmap(
+ makeTestImage(
+ "■■■■■■□□□□□□",
+ "■■■■■■□□□□□□",
+ "■■■□■■□□■□□□",
+ "■■■■■■□□□□□□",
+ "■■■■■■□□□□□□",
+ "■■■■■■□□□□□□",
+ "□□□□□□■■■■■■",
+ "□□□□□□■■■■■■",
+ "□□□□□□■■■■■■",
+ "□□□■□□■■□■■■",
+ "□□□□□□■■■■■■",
+ "□□□□□□■■■■■■"
+ )
+ ),
+ tests: [
+ { mode: "default", size: { height: 6, width: 6 } },
+ { mode: "NEAREST_NEIGHBOR", size: { height: 6, width: 6 } },
+ { mode: "BILINEAR", size: { height: 6, width: 6 } },
+ { mode: "BICUBIC", size: { height: 6, width: 6 } },
+ { mode: "HERMITE", size: { height: 6, width: 6 } },
+ { mode: "BEZIER", size: { height: 6, width: 6 } },
+ ],
+ },
+ /**********************************************************************/
+ {
+ title: "mutch contrast 4x4",
+ src: jimp.fromBitmap(makeTestImage("▩▩▥▥", "▩▩▥▥", "▥▥▩▩", "▥▥▩▩")),
+ tests: [
+ { mode: "default", size: { height: 6, width: 6 } },
+ { mode: "NEAREST_NEIGHBOR", size: { height: 6, width: 6 } },
+ { mode: "BILINEAR", size: { height: 6, width: 6 } },
+ { mode: "BICUBIC", size: { height: 6, width: 6 } },
+ { mode: "HERMITE", size: { height: 6, width: 6 } },
+ { mode: "BEZIER", size: { height: 6, width: 6 } },
+ ],
+ },
+ ];
+
+ testImages.forEach((image) => {
+ describe(image.title, () => {
+ image.tests.forEach(({ mode: modeType, size }) => {
+ test(`to ${modeType} ${size.width}x${size.height}`, () => {
+ const mode = ResizeStrategy[modeType as keyof typeof ResizeStrategy];
+
+ expect(
+ image.src.clone().resize({
+ w: size.width,
+ h: size.height,
+ mode,
+ })
+ ).toMatchSnapshot();
+ });
+ });
+ });
+ });
+});
diff --git a/node_modules/@jimp/plugin-resize/src/index.ts b/node_modules/@jimp/plugin-resize/src/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2b4bc73487784b96edff2a9f717307c587b279fb
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/src/index.ts
@@ -0,0 +1,176 @@
+import { JimpClass } from "@jimp/types";
+import { ResizeStrategy } from "./constants.js";
+import { z } from "zod";
+
+import Resize from "./modules/resize.js";
+import { operations as Resize2 } from "./modules/resize2.js";
+
+export * from "./constants.js";
+
+interface ResizeClass {
+ // eslint-disable-next-line @typescript-eslint/no-misused-new
+ new (
+ widthOriginal: number,
+ heightOriginal: number,
+ targetWidth: number,
+ targetHeight: number,
+ blendAlpha: boolean,
+ interpolationPass: boolean,
+ resizeCallback: (buffer: Buffer) => void
+ ): ResizeClass;
+ resize(buffer: Buffer): void;
+}
+
+type Constructable = new (...args: unknown[]) => T;
+
+const ResizeOptionsSchema = z.union([
+ z.object({
+ /** the width to resize the image to */
+ w: z.number().min(0),
+ /** the height to resize the image to */
+ h: z.number().min(0).optional(),
+ /** a scaling method (e.g. ResizeStrategy.BEZIER) */
+ mode: z.nativeEnum(ResizeStrategy).optional(),
+ }),
+ z.object({
+ /** the width to resize the image to */
+ w: z.number().min(0).optional(),
+ /** the height to resize the image to */
+ h: z.number().min(0),
+ /** a scaling method (e.g. ResizeStrategy.BEZIER) */
+ mode: z.nativeEnum(ResizeStrategy).optional(),
+ }),
+]);
+
+export type ResizeOptions = z.infer;
+
+const ScaleToFitOptionsSchema = z.object({
+ /** the width to resize the image to */
+ w: z.number().min(0),
+ /** the height to resize the image to */
+ h: z.number().min(0),
+ /** a scaling method (e.g. Jimp.RESIZE_BEZIER) */
+ mode: z.nativeEnum(ResizeStrategy).optional(),
+});
+
+export type ScaleToFitOptions = z.infer;
+
+const ScaleComplexOptionsSchema = z.object({
+ /** the width to resize the image to */
+ f: z.number().min(0),
+ /** a scaling method (e.g. Jimp.RESIZE_BEZIER) */
+ mode: z.nativeEnum(ResizeStrategy).optional(),
+});
+
+export type ScaleComplexOptions = z.infer;
+export type ScaleOptions = number | ScaleComplexOptions;
+
+export const methods = {
+ /**
+ * Resizes the image to a set width and height using a 2-pass bilinear algorithm
+ * @example
+ * ```ts
+ * import { Jimp } from "jimp";
+ *
+ * const image = await Jimp.read("test/image.png");
+ *
+ * image.resize({ w: 150 });
+ * ```
+ */
+ resize(image: I, options: ResizeOptions) {
+ const { mode } = ResizeOptionsSchema.parse(options);
+
+ let w: number;
+ let h: number;
+
+ if (typeof options.w === "number") {
+ w = options.w;
+ h = options.h ?? image.bitmap.height * (w / image.bitmap.width);
+ } else if (typeof options.h === "number") {
+ h = options.h;
+ w = options.w ?? image.bitmap.width * (h / image.bitmap.height);
+ } else {
+ throw new Error("w must be a number");
+ }
+
+ // round inputs
+ w = Math.round(w) || 1;
+ h = Math.round(h) || 1;
+
+ if (mode && typeof Resize2[mode] === "function") {
+ const dst = {
+ data: Buffer.alloc(w * h * 4),
+ width: w,
+ height: h,
+ };
+ Resize2[mode](image.bitmap, dst);
+ image.bitmap = dst;
+ } else {
+ const resize = new (Resize as unknown as Constructable)(
+ image.bitmap.width,
+ image.bitmap.height,
+ w,
+ h,
+ true,
+ true,
+ (buffer: Buffer) => {
+ image.bitmap.data = Buffer.from(buffer);
+ image.bitmap.width = w;
+ image.bitmap.height = h;
+ }
+ );
+
+ resize.resize(image.bitmap.data);
+ }
+
+ return image;
+ },
+
+ /**
+ * Uniformly scales the image by a factor.
+ * @param f the factor to scale the image by
+ * @param mode (optional) a scaling method (e.g. Jimp.RESIZE_BEZIER)
+ * @example
+ * ```ts
+ * import { Jimp } from "jimp";
+ *
+ * const image = await Jimp.read("test/image.png");
+ *
+ * image.scale(0.5);
+ * ```
+ */
+ scale(image: I, options: ScaleOptions) {
+ const { f, mode } =
+ typeof options === "number"
+ ? ({ f: options } as ScaleComplexOptions)
+ : ScaleComplexOptionsSchema.parse(options);
+ const w = image.bitmap.width * f;
+ const h = image.bitmap.height * f;
+
+ return this.resize(image, { w, h, mode: mode });
+ },
+
+ /**
+ * Scale the image to the largest size that fits inside the rectangle that has the given width and height.
+ * @param w the width to resize the image to
+ * @param h the height to resize the image to
+ * @param mode a scaling method (e.g. ResizeStrategy.BEZIER)
+ * @example
+ * ```ts
+ * import { Jimp } from "jimp";
+ *
+ * const image = await Jimp.read("test/image.png");
+ *
+ * image.scaleToFit(100, 100);
+ * ```
+ */
+ scaleToFit(image: I, options: ScaleToFitOptions) {
+ const { h, w, mode } = ScaleToFitOptionsSchema.parse(options);
+ const f =
+ w / h > image.bitmap.width / image.bitmap.height
+ ? h / image.bitmap.height
+ : w / image.bitmap.width;
+
+ return this.scale(image, { f, mode: mode });
+ },
+};
diff --git a/node_modules/@jimp/plugin-resize/src/modules/resize.ts b/node_modules/@jimp/plugin-resize/src/modules/resize.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ae1512ed424b4d0e3dc6574fe5c5bc5dc906e9f5
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/src/modules/resize.ts
@@ -0,0 +1,555 @@
+// eslint-disable-next-line @typescript-eslint/ban-ts-comment
+// @ts-nocheck
+
+// JavaScript Image Resizer (c) 2012 - Grant Galitz
+// Released to public domain 29 July 2013: https://github.com/grantgalitz/JS-Image-Resizer/issues/4
+
+function Resize(
+ widthOriginal,
+ heightOriginal,
+ targetWidth,
+ targetHeight,
+ blendAlpha,
+ interpolationPass,
+ resizeCallback
+) {
+ this.widthOriginal = Math.abs(Math.floor(widthOriginal) || 0);
+ this.heightOriginal = Math.abs(Math.floor(heightOriginal) || 0);
+ this.targetWidth = Math.abs(Math.floor(targetWidth) || 0);
+ this.targetHeight = Math.abs(Math.floor(targetHeight) || 0);
+ this.colorChannels = blendAlpha ? 4 : 3;
+ this.interpolationPass = Boolean(interpolationPass);
+ this.resizeCallback =
+ typeof resizeCallback === "function" ? resizeCallback : function () {};
+
+ this.targetWidthMultipliedByChannels = this.targetWidth * this.colorChannels;
+ this.originalWidthMultipliedByChannels =
+ this.widthOriginal * this.colorChannels;
+ this.originalHeightMultipliedByChannels =
+ this.heightOriginal * this.colorChannels;
+ this.widthPassResultSize =
+ this.targetWidthMultipliedByChannels * this.heightOriginal;
+ this.finalResultSize =
+ this.targetWidthMultipliedByChannels * this.targetHeight;
+ this.initialize();
+}
+
+Resize.prototype.initialize = function () {
+ // Perform some checks:
+ if (
+ this.widthOriginal > 0 &&
+ this.heightOriginal > 0 &&
+ this.targetWidth > 0 &&
+ this.targetHeight > 0
+ ) {
+ this.configurePasses();
+ } else {
+ console.log(this);
+ throw new Error("Invalid settings specified for the resizer.");
+ }
+};
+
+Resize.prototype.configurePasses = function () {
+ if (this.widthOriginal === this.targetWidth) {
+ // Bypass the width resizer pass:
+ this.resizeWidth = this.bypassResizer;
+ } else {
+ // Setup the width resizer pass:
+ this.ratioWeightWidthPass = this.widthOriginal / this.targetWidth;
+ if (this.ratioWeightWidthPass < 1 && this.interpolationPass) {
+ this.initializeFirstPassBuffers(true);
+ this.resizeWidth =
+ this.colorChannels === 4
+ ? this.resizeWidthInterpolatedRGBA
+ : this.resizeWidthInterpolatedRGB;
+ } else {
+ this.initializeFirstPassBuffers(false);
+ this.resizeWidth =
+ this.colorChannels === 4 ? this.resizeWidthRGBA : this.resizeWidthRGB;
+ }
+ }
+
+ if (this.heightOriginal === this.targetHeight) {
+ // Bypass the height resizer pass:
+ this.resizeHeight = this.bypassResizer;
+ } else {
+ // Setup the height resizer pass:
+ this.ratioWeightHeightPass = this.heightOriginal / this.targetHeight;
+ if (this.ratioWeightHeightPass < 1 && this.interpolationPass) {
+ this.initializeSecondPassBuffers(true);
+ this.resizeHeight = this.resizeHeightInterpolated;
+ } else {
+ this.initializeSecondPassBuffers(false);
+ this.resizeHeight =
+ this.colorChannels === 4 ? this.resizeHeightRGBA : this.resizeHeightRGB;
+ }
+ }
+};
+
+Resize.prototype._resizeWidthInterpolatedRGBChannels = function (
+ buffer,
+ fourthChannel
+) {
+ const channelsNum = fourthChannel ? 4 : 3;
+ const ratioWeight = this.ratioWeightWidthPass;
+ const outputBuffer = this.widthBuffer;
+
+ let weight = 0;
+ let finalOffset = 0;
+ let pixelOffset = 0;
+ let firstWeight = 0;
+ let secondWeight = 0;
+ let targetPosition;
+
+ // Handle for only one interpolation input being valid for start calculation:
+ for (
+ targetPosition = 0;
+ weight < 1 / 3;
+ targetPosition += channelsNum, weight += ratioWeight
+ ) {
+ for (
+ finalOffset = targetPosition, pixelOffset = 0;
+ finalOffset < this.widthPassResultSize;
+ pixelOffset += this.originalWidthMultipliedByChannels,
+ finalOffset += this.targetWidthMultipliedByChannels
+ ) {
+ outputBuffer[finalOffset] = buffer[pixelOffset];
+ outputBuffer[finalOffset + 1] = buffer[pixelOffset + 1];
+ outputBuffer[finalOffset + 2] = buffer[pixelOffset + 2];
+ if (fourthChannel)
+ outputBuffer[finalOffset + 3] = buffer[pixelOffset + 3];
+ }
+ }
+
+ // Adjust for overshoot of the last pass's counter:
+ weight -= 1 / 3;
+ let interpolationWidthSourceReadStop;
+
+ for (
+ interpolationWidthSourceReadStop = this.widthOriginal - 1;
+ weight < interpolationWidthSourceReadStop;
+ targetPosition += channelsNum, weight += ratioWeight
+ ) {
+ // Calculate weightings:
+ secondWeight = weight % 1;
+ firstWeight = 1 - secondWeight;
+ // Interpolate:
+ for (
+ finalOffset = targetPosition,
+ pixelOffset = Math.floor(weight) * channelsNum;
+ finalOffset < this.widthPassResultSize;
+ pixelOffset += this.originalWidthMultipliedByChannels,
+ finalOffset += this.targetWidthMultipliedByChannels
+ ) {
+ outputBuffer[finalOffset + 0] =
+ buffer[pixelOffset + 0] * firstWeight +
+ buffer[pixelOffset + channelsNum + 0] * secondWeight;
+ outputBuffer[finalOffset + 1] =
+ buffer[pixelOffset + 1] * firstWeight +
+ buffer[pixelOffset + channelsNum + 1] * secondWeight;
+ outputBuffer[finalOffset + 2] =
+ buffer[pixelOffset + 2] * firstWeight +
+ buffer[pixelOffset + channelsNum + 2] * secondWeight;
+ if (fourthChannel)
+ outputBuffer[finalOffset + 3] =
+ buffer[pixelOffset + 3] * firstWeight +
+ buffer[pixelOffset + channelsNum + 3] * secondWeight;
+ }
+ }
+
+ // Handle for only one interpolation input being valid for end calculation:
+ for (
+ interpolationWidthSourceReadStop =
+ this.originalWidthMultipliedByChannels - channelsNum;
+ targetPosition < this.targetWidthMultipliedByChannels;
+ targetPosition += channelsNum
+ ) {
+ for (
+ finalOffset = targetPosition,
+ pixelOffset = interpolationWidthSourceReadStop;
+ finalOffset < this.widthPassResultSize;
+ pixelOffset += this.originalWidthMultipliedByChannels,
+ finalOffset += this.targetWidthMultipliedByChannels
+ ) {
+ outputBuffer[finalOffset] = buffer[pixelOffset];
+ outputBuffer[finalOffset + 1] = buffer[pixelOffset + 1];
+ outputBuffer[finalOffset + 2] = buffer[pixelOffset + 2];
+ if (fourthChannel)
+ outputBuffer[finalOffset + 3] = buffer[pixelOffset + 3];
+ }
+ }
+
+ return outputBuffer;
+};
+
+Resize.prototype._resizeWidthRGBChannels = function (buffer, fourthChannel) {
+ const channelsNum = fourthChannel ? 4 : 3;
+ const ratioWeight = this.ratioWeightWidthPass;
+ const ratioWeightDivisor = 1 / ratioWeight;
+ const nextLineOffsetOriginalWidth =
+ this.originalWidthMultipliedByChannels - channelsNum + 1;
+ const nextLineOffsetTargetWidth =
+ this.targetWidthMultipliedByChannels - channelsNum + 1;
+ const output = this.outputWidthWorkBench;
+ const outputBuffer = this.widthBuffer;
+ const trustworthyColorsCount = this.outputWidthWorkBenchOpaquePixelsCount;
+
+ let weight = 0;
+ let amountToNext = 0;
+ let actualPosition = 0;
+ let currentPosition = 0;
+ let line = 0;
+ let pixelOffset = 0;
+ let outputOffset = 0;
+ let multiplier = 1;
+ let r = 0;
+ let g = 0;
+ let b = 0;
+ let a = 0;
+
+ do {
+ for (line = 0; line < this.originalHeightMultipliedByChannels; ) {
+ output[line++] = 0;
+ output[line++] = 0;
+ output[line++] = 0;
+ if (fourthChannel) {
+ output[line++] = 0;
+ trustworthyColorsCount[line / channelsNum - 1] = 0;
+ }
+ }
+
+ weight = ratioWeight;
+
+ do {
+ amountToNext = 1 + actualPosition - currentPosition;
+ multiplier = Math.min(weight, amountToNext);
+ for (
+ line = 0, pixelOffset = actualPosition;
+ line < this.originalHeightMultipliedByChannels;
+ pixelOffset += nextLineOffsetOriginalWidth
+ ) {
+ r = buffer[pixelOffset];
+ g = buffer[++pixelOffset];
+ b = buffer[++pixelOffset];
+ a = fourthChannel ? buffer[++pixelOffset] : 255;
+ // Ignore RGB values if pixel is completely transparent
+ output[line++] += (a ? r : 0) * multiplier;
+ output[line++] += (a ? g : 0) * multiplier;
+ output[line++] += (a ? b : 0) * multiplier;
+ if (fourthChannel) {
+ output[line++] += a * multiplier;
+ trustworthyColorsCount[line / channelsNum - 1] += a ? multiplier : 0;
+ }
+ }
+
+ if (weight >= amountToNext) {
+ actualPosition += channelsNum;
+ currentPosition = actualPosition;
+ weight -= amountToNext;
+ } else {
+ currentPosition += weight;
+ break;
+ }
+ } while (
+ weight > 0 &&
+ actualPosition < this.originalWidthMultipliedByChannels
+ );
+
+ for (
+ line = 0, pixelOffset = outputOffset;
+ line < this.originalHeightMultipliedByChannels;
+ pixelOffset += nextLineOffsetTargetWidth
+ ) {
+ weight = fourthChannel ? trustworthyColorsCount[line / channelsNum] : 1;
+ multiplier = fourthChannel
+ ? weight
+ ? 1 / weight
+ : 0
+ : ratioWeightDivisor;
+ outputBuffer[pixelOffset] = output[line++] * multiplier;
+ outputBuffer[++pixelOffset] = output[line++] * multiplier;
+ outputBuffer[++pixelOffset] = output[line++] * multiplier;
+ if (fourthChannel)
+ outputBuffer[++pixelOffset] = output[line++] * ratioWeightDivisor;
+ }
+
+ outputOffset += channelsNum;
+ } while (outputOffset < this.targetWidthMultipliedByChannels);
+
+ return outputBuffer;
+};
+
+Resize.prototype._resizeHeightRGBChannels = function (buffer, fourthChannel) {
+ const ratioWeight = this.ratioWeightHeightPass;
+ const ratioWeightDivisor = 1 / ratioWeight;
+ const output = this.outputHeightWorkBench;
+ const outputBuffer = this.heightBuffer;
+ const trustworthyColorsCount = this.outputHeightWorkBenchOpaquePixelsCount;
+
+ let weight = 0;
+ let amountToNext = 0;
+ let actualPosition = 0;
+ let currentPosition = 0;
+ let pixelOffset = 0;
+ let outputOffset = 0;
+ let caret = 0;
+ let multiplier = 1;
+ let r = 0;
+ let g = 0;
+ let b = 0;
+ let a = 0;
+
+ do {
+ for (
+ pixelOffset = 0;
+ pixelOffset < this.targetWidthMultipliedByChannels;
+
+ ) {
+ output[pixelOffset++] = 0;
+ output[pixelOffset++] = 0;
+ output[pixelOffset++] = 0;
+
+ if (fourthChannel) {
+ output[pixelOffset++] = 0;
+ trustworthyColorsCount[pixelOffset / 4 - 1] = 0;
+ }
+ }
+
+ weight = ratioWeight;
+
+ do {
+ amountToNext = 1 + actualPosition - currentPosition;
+ multiplier = Math.min(weight, amountToNext);
+ caret = actualPosition;
+
+ for (
+ pixelOffset = 0;
+ pixelOffset < this.targetWidthMultipliedByChannels;
+
+ ) {
+ r = buffer[caret++];
+ g = buffer[caret++];
+ b = buffer[caret++];
+ a = fourthChannel ? buffer[caret++] : 255;
+ // Ignore RGB values if pixel is completely transparent
+ output[pixelOffset++] += (a ? r : 0) * multiplier;
+ output[pixelOffset++] += (a ? g : 0) * multiplier;
+ output[pixelOffset++] += (a ? b : 0) * multiplier;
+
+ if (fourthChannel) {
+ output[pixelOffset++] += a * multiplier;
+ trustworthyColorsCount[pixelOffset / 4 - 1] += a ? multiplier : 0;
+ }
+ }
+
+ if (weight >= amountToNext) {
+ actualPosition = caret;
+ currentPosition = actualPosition;
+ weight -= amountToNext;
+ } else {
+ currentPosition += weight;
+ break;
+ }
+ } while (weight > 0 && actualPosition < this.widthPassResultSize);
+
+ for (
+ pixelOffset = 0;
+ pixelOffset < this.targetWidthMultipliedByChannels;
+
+ ) {
+ weight = fourthChannel ? trustworthyColorsCount[pixelOffset / 4] : 1;
+ multiplier = fourthChannel
+ ? weight
+ ? 1 / weight
+ : 0
+ : ratioWeightDivisor;
+ outputBuffer[outputOffset++] = Math.round(
+ output[pixelOffset++] * multiplier
+ );
+ outputBuffer[outputOffset++] = Math.round(
+ output[pixelOffset++] * multiplier
+ );
+ outputBuffer[outputOffset++] = Math.round(
+ output[pixelOffset++] * multiplier
+ );
+
+ if (fourthChannel) {
+ outputBuffer[outputOffset++] = Math.round(
+ output[pixelOffset++] * ratioWeightDivisor
+ );
+ }
+ }
+ } while (outputOffset < this.finalResultSize);
+
+ return outputBuffer;
+};
+
+Resize.prototype.resizeWidthInterpolatedRGB = function (buffer) {
+ return this._resizeWidthInterpolatedRGBChannels(buffer, false);
+};
+
+Resize.prototype.resizeWidthInterpolatedRGBA = function (buffer) {
+ return this._resizeWidthInterpolatedRGBChannels(buffer, true);
+};
+
+Resize.prototype.resizeWidthRGB = function (buffer) {
+ return this._resizeWidthRGBChannels(buffer, false);
+};
+
+Resize.prototype.resizeWidthRGBA = function (buffer) {
+ return this._resizeWidthRGBChannels(buffer, true);
+};
+
+Resize.prototype.resizeHeightInterpolated = function (buffer) {
+ const ratioWeight = this.ratioWeightHeightPass;
+ const outputBuffer = this.heightBuffer;
+
+ let weight = 0;
+ let finalOffset = 0;
+ let pixelOffset = 0;
+ let pixelOffsetAccumulated = 0;
+ let pixelOffsetAccumulated2 = 0;
+ let firstWeight = 0;
+ let secondWeight = 0;
+ let interpolationHeightSourceReadStop;
+
+ // Handle for only one interpolation input being valid for start calculation:
+ for (; weight < 1 / 3; weight += ratioWeight) {
+ for (
+ pixelOffset = 0;
+ pixelOffset < this.targetWidthMultipliedByChannels;
+
+ ) {
+ outputBuffer[finalOffset++] = Math.round(buffer[pixelOffset++]);
+ }
+ }
+
+ // Adjust for overshoot of the last pass's counter:
+ weight -= 1 / 3;
+
+ for (
+ interpolationHeightSourceReadStop = this.heightOriginal - 1;
+ weight < interpolationHeightSourceReadStop;
+ weight += ratioWeight
+ ) {
+ // Calculate weightings:
+ secondWeight = weight % 1;
+ firstWeight = 1 - secondWeight;
+ // Interpolate:
+ pixelOffsetAccumulated =
+ Math.floor(weight) * this.targetWidthMultipliedByChannels;
+ pixelOffsetAccumulated2 =
+ pixelOffsetAccumulated + this.targetWidthMultipliedByChannels;
+ for (
+ pixelOffset = 0;
+ pixelOffset < this.targetWidthMultipliedByChannels;
+ ++pixelOffset
+ ) {
+ outputBuffer[finalOffset++] = Math.round(
+ buffer[pixelOffsetAccumulated++] * firstWeight +
+ buffer[pixelOffsetAccumulated2++] * secondWeight
+ );
+ }
+ }
+
+ // Handle for only one interpolation input being valid for end calculation:
+ while (finalOffset < this.finalResultSize) {
+ for (
+ pixelOffset = 0,
+ pixelOffsetAccumulated =
+ interpolationHeightSourceReadStop *
+ this.targetWidthMultipliedByChannels;
+ pixelOffset < this.targetWidthMultipliedByChannels;
+ ++pixelOffset
+ ) {
+ outputBuffer[finalOffset++] = Math.round(
+ buffer[pixelOffsetAccumulated++]
+ );
+ }
+ }
+
+ return outputBuffer;
+};
+
+Resize.prototype.resizeHeightRGB = function (buffer) {
+ return this._resizeHeightRGBChannels(buffer, false);
+};
+
+Resize.prototype.resizeHeightRGBA = function (buffer) {
+ return this._resizeHeightRGBChannels(buffer, true);
+};
+
+Resize.prototype.resize = function (buffer) {
+ this.resizeCallback(this.resizeHeight(this.resizeWidth(buffer)));
+};
+
+Resize.prototype.bypassResizer = function (buffer) {
+ // Just return the buffer passed:
+ return buffer;
+};
+
+Resize.prototype.initializeFirstPassBuffers = function (BILINEARAlgo) {
+ // Initialize the internal width pass buffers:
+ this.widthBuffer = this.generateFloatBuffer(this.widthPassResultSize);
+
+ if (!BILINEARAlgo) {
+ this.outputWidthWorkBench = this.generateFloatBuffer(
+ this.originalHeightMultipliedByChannels
+ );
+
+ if (this.colorChannels > 3) {
+ this.outputWidthWorkBenchOpaquePixelsCount = this.generateFloat64Buffer(
+ this.heightOriginal
+ );
+ }
+ }
+};
+
+Resize.prototype.initializeSecondPassBuffers = function (BILINEARAlgo) {
+ // Initialize the internal height pass buffers:
+ this.heightBuffer = this.generateUint8Buffer(this.finalResultSize);
+
+ if (!BILINEARAlgo) {
+ this.outputHeightWorkBench = this.generateFloatBuffer(
+ this.targetWidthMultipliedByChannels
+ );
+
+ if (this.colorChannels > 3) {
+ this.outputHeightWorkBenchOpaquePixelsCount = this.generateFloat64Buffer(
+ this.targetWidth
+ );
+ }
+ }
+};
+
+Resize.prototype.generateFloatBuffer = function (bufferLength) {
+ // Generate a float32 typed array buffer:
+ try {
+ return new Float32Array(bufferLength);
+ } catch (error) {
+ console.error(error);
+ return [];
+ }
+};
+
+Resize.prototype.generateFloat64Buffer = function (bufferLength) {
+ // Generate a float64 typed array buffer:
+ try {
+ return new Float64Array(bufferLength);
+ } catch (error) {
+ console.error(error);
+ return [];
+ }
+};
+
+Resize.prototype.generateUint8Buffer = function (bufferLength) {
+ // Generate a uint8 typed array buffer:
+ try {
+ return new Uint8Array(bufferLength);
+ } catch (error) {
+ console.error(error);
+ return [];
+ }
+};
+
+export default Resize;
diff --git a/node_modules/@jimp/plugin-resize/src/modules/resize2.ts b/node_modules/@jimp/plugin-resize/src/modules/resize2.ts
new file mode 100644
index 0000000000000000000000000000000000000000..25b1e08ecf71fb2d37e58bb4a547b30dd2c9868c
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/src/modules/resize2.ts
@@ -0,0 +1,327 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
+/**
+ * Copyright (c) 2015 Guyon Roche
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+export const operations = {
+ nearestNeighbor(src: any, dst: any) {
+ const wSrc = src.width;
+ const hSrc = src.height;
+
+ const wDst = dst.width;
+ const hDst = dst.height;
+
+ const bufSrc = src.data;
+ const bufDst = dst.data;
+
+ for (let i = 0; i < hDst; i++) {
+ for (let j = 0; j < wDst; j++) {
+ let posDst = (i * wDst + j) * 4;
+
+ const iSrc = Math.floor((i * hSrc) / hDst);
+ const jSrc = Math.floor((j * wSrc) / wDst);
+ let posSrc = (iSrc * wSrc + jSrc) * 4;
+
+ bufDst[posDst++] = bufSrc[posSrc++];
+ bufDst[posDst++] = bufSrc[posSrc++];
+ bufDst[posDst++] = bufSrc[posSrc++];
+ bufDst[posDst++] = bufSrc[posSrc++];
+ }
+ }
+ },
+
+ bilinearInterpolation(src: any, dst: any) {
+ const wSrc = src.width;
+ const hSrc = src.height;
+
+ const wDst = dst.width;
+ const hDst = dst.height;
+
+ const bufSrc = src.data;
+ const bufDst = dst.data;
+
+ const interpolate = function (
+ k: number,
+ kMin: number,
+ vMin: number,
+ kMax: number,
+ vMax: number,
+ ) {
+ // special case - k is integer
+ if (kMin === kMax) {
+ return vMin;
+ }
+
+ return Math.round((k - kMin) * vMax + (kMax - k) * vMin);
+ };
+
+ const assign = function (
+ pos: number,
+ offset: number,
+ x: number,
+ xMin: number,
+ xMax: number,
+ y: number,
+ yMin: number,
+ yMax: number,
+ ) {
+ let posMin = (yMin * wSrc + xMin) * 4 + offset;
+ let posMax = (yMin * wSrc + xMax) * 4 + offset;
+ const vMin = interpolate(x, xMin, bufSrc[posMin], xMax, bufSrc[posMax]);
+
+ // special case, y is integer
+ if (yMax === yMin) {
+ bufDst[pos + offset] = vMin;
+ } else {
+ posMin = (yMax * wSrc + xMin) * 4 + offset;
+ posMax = (yMax * wSrc + xMax) * 4 + offset;
+ const vMax = interpolate(x, xMin, bufSrc[posMin], xMax, bufSrc[posMax]);
+
+ bufDst[pos + offset] = interpolate(y, yMin, vMin, yMax, vMax);
+ }
+ };
+
+ for (let i = 0; i < hDst; i++) {
+ for (let j = 0; j < wDst; j++) {
+ const posDst = (i * wDst + j) * 4;
+ // x & y in src coordinates
+ const x = (j * wSrc) / wDst;
+ const xMin = Math.floor(x);
+ const xMax = Math.min(Math.ceil(x), wSrc - 1);
+
+ const y = (i * hSrc) / hDst;
+ const yMin = Math.floor(y);
+ const yMax = Math.min(Math.ceil(y), hSrc - 1);
+
+ assign(posDst, 0, x, xMin, xMax, y, yMin, yMax);
+ assign(posDst, 1, x, xMin, xMax, y, yMin, yMax);
+ assign(posDst, 2, x, xMin, xMax, y, yMin, yMax);
+ assign(posDst, 3, x, xMin, xMax, y, yMin, yMax);
+ }
+ }
+ },
+
+ _interpolate2D(src: any, dst: any, options?: any, interpolate?: any) {
+ const bufSrc = src.data;
+ const bufDst = dst.data;
+
+ const wSrc = src.width;
+ const hSrc = src.height;
+
+ const wDst = dst.width;
+ const hDst = dst.height;
+
+ // when dst smaller than src/2, interpolate first to a multiple between 0.5 and 1.0 src, then sum squares
+ const wM = Math.max(1, Math.floor(wSrc / wDst));
+ const wDst2 = wDst * wM;
+ const hM = Math.max(1, Math.floor(hSrc / hDst));
+ const hDst2 = hDst * hM;
+
+ // ===========================================================
+ // Pass 1 - interpolate rows
+ // buf1 has width of dst2 and height of src
+ const buf1 = Buffer.alloc(wDst2 * hSrc * 4);
+ for (let i = 0; i < hSrc; i++) {
+ for (let j = 0; j < wDst2; j++) {
+ // i in src coords, j in dst coords
+
+ // calculate x in src coords
+ // this interpolation requires 4 sample points and the two inner ones must be real
+ // the outer points can be fudged for the edges.
+ // therefore (wSrc-1)/wDst2
+ const x = (j * (wSrc - 1)) / wDst2;
+ const xPos = Math.floor(x);
+ const t = x - xPos;
+ const srcPos = (i * wSrc + xPos) * 4;
+ const buf1Pos = (i * wDst2 + j) * 4;
+
+ for (let k = 0; k < 4; k++) {
+ const kPos = srcPos + k;
+ const x0 =
+ xPos > 0 ? bufSrc[kPos - 4] : 2 * bufSrc[kPos] - bufSrc[kPos + 4];
+ const x1 = bufSrc[kPos];
+ const x2 = bufSrc[kPos + 4];
+ const x3 =
+ xPos < wSrc - 2
+ ? bufSrc[kPos + 8]
+ : 2 * bufSrc[kPos + 4] - bufSrc[kPos];
+ buf1[buf1Pos + k] = interpolate(x0, x1, x2, x3, t);
+ }
+ }
+ }
+ // this._writeFile(wDst2, hSrc, buf1, "out/buf1.jpg");
+
+ // ===========================================================
+ // Pass 2 - interpolate columns
+ // buf2 has width and height of dst2
+ const buf2 = Buffer.alloc(wDst2 * hDst2 * 4);
+ for (let i = 0; i < hDst2; i++) {
+ for (let j = 0; j < wDst2; j++) {
+ // i&j in dst2 coords
+
+ // calculate y in buf1 coords
+ // this interpolation requires 4 sample points and the two inner ones must be real
+ // the outer points can be fudged for the edges.
+ // therefore (hSrc-1)/hDst2
+ const y = (i * (hSrc - 1)) / hDst2;
+ const yPos = Math.floor(y);
+ const t = y - yPos;
+ const buf1Pos = (yPos * wDst2 + j) * 4;
+ const buf2Pos = (i * wDst2 + j) * 4;
+ for (let k = 0; k < 4; k++) {
+ const kPos = buf1Pos + k;
+ const y0 =
+ yPos > 0
+ ? buf1[kPos - wDst2 * 4]
+ : 2 * buf1[kPos]! - buf1[kPos + wDst2 * 4]!;
+ const y1 = buf1[kPos];
+ const y2 = buf1[kPos + wDst2 * 4];
+ const y3 =
+ yPos < hSrc - 2
+ ? buf1[kPos + wDst2 * 8]
+ : 2 * buf1[kPos + wDst2 * 4]! - buf1[kPos]!;
+
+ buf2[buf2Pos + k] = interpolate(y0, y1, y2, y3, t);
+ }
+ }
+ }
+ // this._writeFile(wDst2, hDst2, buf2, "out/buf2.jpg");
+
+ // ===========================================================
+ // Pass 3 - scale to dst
+ const m = wM * hM;
+ if (m > 1) {
+ for (let i = 0; i < hDst; i++) {
+ for (let j = 0; j < wDst; j++) {
+ // i&j in dst bounded coords
+ let r = 0;
+ let g = 0;
+ let b = 0;
+ let a = 0;
+ let realColors = 0;
+
+ for (let y = 0; y < hM; y++) {
+ const yPos = i * hM + y;
+
+ for (let x = 0; x < wM; x++) {
+ const xPos = j * wM + x;
+ const xyPos = (yPos * wDst2 + xPos) * 4;
+ const pixelAlpha = buf2[xyPos + 3]!;
+
+ if (pixelAlpha) {
+ r += buf2[xyPos]!;
+ g += buf2[xyPos + 1]!;
+ b += buf2[xyPos + 2]!;
+ realColors++;
+ }
+
+ a += pixelAlpha;
+ }
+ }
+
+ const pos = (i * wDst + j) * 4;
+ bufDst[pos] = realColors ? Math.round(r / realColors) : 0;
+ bufDst[pos + 1] = realColors ? Math.round(g / realColors) : 0;
+ bufDst[pos + 2] = realColors ? Math.round(b / realColors) : 0;
+ bufDst[pos + 3] = Math.round(a / m);
+ }
+ }
+ } else {
+ // replace dst buffer with buf2
+ dst.data = buf2;
+ }
+ },
+
+ bicubicInterpolation(src: any, dst: any, options?: any) {
+ const interpolateCubic = function (
+ x0: number,
+ x1: number,
+ x2: number,
+ x3: number,
+ t: number,
+ ) {
+ const a0 = x3 - x2 - x0 + x1;
+ const a1 = x0 - x1 - a0;
+ const a2 = x2 - x0;
+ const a3 = x1;
+ return Math.max(
+ 0,
+ Math.min(255, a0 * (t * t * t) + a1 * (t * t) + a2 * t + a3),
+ );
+ };
+
+ return this._interpolate2D(src, dst, options, interpolateCubic);
+ },
+
+ hermiteInterpolation(src: any, dst: any, options?: any) {
+ const interpolateHermite = function (
+ x0: number,
+ x1: number,
+ x2: number,
+ x3: number,
+ t: number,
+ ) {
+ const c0 = x1;
+ const c1 = 0.5 * (x2 - x0);
+ const c2 = x0 - 2.5 * x1 + 2 * x2 - 0.5 * x3;
+ const c3 = 0.5 * (x3 - x0) + 1.5 * (x1 - x2);
+ return Math.max(
+ 0,
+ Math.min(255, Math.round(((c3 * t + c2) * t + c1) * t + c0)),
+ );
+ };
+
+ return this._interpolate2D(src, dst, options, interpolateHermite);
+ },
+
+ bezierInterpolation(src: any, dst: any, options?: any) {
+ // between 2 points y(n), y(n+1), use next points out, y(n-1), y(n+2)
+ // to predict control points (a & b) to be placed at n+0.5
+ // ya(n) = y(n) + (y(n+1)-y(n-1))/4
+ // yb(n) = y(n+1) - (y(n+2)-y(n))/4
+ // then use std bezier to interpolate [n,n+1)
+ // y(n+t) = y(n)*(1-t)^3 + 3 * ya(n)*(1-t)^2*t + 3 * yb(n)*(1-t)*t^2 + y(n+1)*t^3
+ // note the 3* factor for the two control points
+ // for edge cases, can choose:
+ // y(-1) = y(0) - 2*(y(1)-y(0))
+ // y(w) = y(w-1) + 2*(y(w-1)-y(w-2))
+ // but can go with y(-1) = y(0) and y(w) = y(w-1)
+ const interpolateBezier = function (
+ x0: number,
+ x1: number,
+ x2: number,
+ x3: number,
+ t: number,
+ ) {
+ // x1, x2 are the knots, use x0 and x3 to calculate control points
+ const cp1 = x1 + (x2 - x0) / 4;
+ const cp2 = x2 - (x3 - x1) / 4;
+ const nt = 1 - t;
+ const c0 = x1 * nt * nt * nt;
+ const c1 = 3 * cp1 * nt * nt * t;
+ const c2 = 3 * cp2 * nt * t * t;
+ const c3 = x2 * t * t * t;
+ return Math.max(0, Math.min(255, Math.round(c0 + c1 + c2 + c3)));
+ };
+
+ return this._interpolate2D(src, dst, options, interpolateBezier);
+ },
+};
diff --git a/node_modules/@jimp/plugin-resize/tsconfig.json b/node_modules/@jimp/plugin-resize/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..ad7f216ca2b10874329665feda994727844e4305
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/tsconfig.json
@@ -0,0 +1,6 @@
+{
+ "extends": "@jimp/config-typescript/base.json",
+ "compilerOptions": {
+ "outDir": "dist"
+ }
+}
diff --git a/node_modules/@jimp/plugin-resize/vitest.config.browser.mjs b/node_modules/@jimp/plugin-resize/vitest.config.browser.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..dfe6aff6b16f48bc45697e4c14219f2034754cf5
--- /dev/null
+++ b/node_modules/@jimp/plugin-resize/vitest.config.browser.mjs
@@ -0,0 +1,3 @@
+import config from "@jimp/config-vitest/browser";
+
+export default config;
diff --git a/node_modules/@jimp/plugin-rotate/.tshy/build.json b/node_modules/@jimp/plugin-rotate/.tshy/build.json
new file mode 100644
index 0000000000000000000000000000000000000000..aea1a9e93b5db3468973ebeaad6dac0a77b10c02
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/.tshy/build.json
@@ -0,0 +1,8 @@
+{
+ "extends": "../tsconfig.json",
+ "compilerOptions": {
+ "rootDir": "../src",
+ "module": "nodenext",
+ "moduleResolution": "nodenext"
+ }
+}
diff --git a/node_modules/@jimp/plugin-rotate/.tshy/commonjs.json b/node_modules/@jimp/plugin-rotate/.tshy/commonjs.json
new file mode 100644
index 0000000000000000000000000000000000000000..75bcfc1d756dcb1baafc973385c81c5aa93f3174
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/.tshy/commonjs.json
@@ -0,0 +1,17 @@
+{
+ "extends": "./build.json",
+ "include": [
+ "../src/**/*.ts",
+ "../src/**/*.cts",
+ "../src/**/*.tsx",
+ "../src/**/*.json"
+ ],
+ "exclude": [
+ "../**/*.test.ts",
+ "../src/**/*.mts",
+ "../src/package.json"
+ ],
+ "compilerOptions": {
+ "outDir": "../.tshy-build/commonjs"
+ }
+}
diff --git a/node_modules/@jimp/plugin-rotate/.tshy/esm.json b/node_modules/@jimp/plugin-rotate/.tshy/esm.json
new file mode 100644
index 0000000000000000000000000000000000000000..fdc4fa775818876f2e8f6cd606e9bb337515ac56
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/.tshy/esm.json
@@ -0,0 +1,16 @@
+{
+ "extends": "./build.json",
+ "include": [
+ "../src/**/*.ts",
+ "../src/**/*.mts",
+ "../src/**/*.tsx",
+ "../src/**/*.json"
+ ],
+ "exclude": [
+ "../**/*.test.ts",
+ "../src/package.json"
+ ],
+ "compilerOptions": {
+ "outDir": "../.tshy-build/esm"
+ }
+}
diff --git a/node_modules/@jimp/plugin-rotate/CHANGELOG.md b/node_modules/@jimp/plugin-rotate/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..4f73f2001e77293f520dce427a3a2197bd9f7e80
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/CHANGELOG.md
@@ -0,0 +1,64 @@
+# v1.1.3 (Mon Sep 02 2024)
+
+#### 🐛 Bug Fix
+
+- Update deps [#1319](https://github.com/jimp-dev/jimp/pull/1319) ([@hipstersmoothie](https://github.com/hipstersmoothie))
+
+#### Authors: 1
+
+- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
+
+---
+
+# v1.1.2 (Mon Sep 02 2024)
+
+#### 🐛 Bug Fix
+
+- Rotate short circuit [#1317](https://github.com/jimp-dev/jimp/pull/1317) ([@hipstersmoothie](https://github.com/hipstersmoothie))
+
+#### Authors: 1
+
+- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
+
+---
+
+# v1.1.0 (Sun Sep 01 2024)
+
+#### ⚠️ Pushed to `main`
+
+- upgrade tshy ([@hipstersmoothie](https://github.com/hipstersmoothie))
+- update more docs ([@hipstersmoothie](https://github.com/hipstersmoothie))
+
+#### Authors: 1
+
+- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
+
+---
+
+# v1.0.3 (Sat Aug 31 2024)
+
+#### 🐛 Bug Fix
+
+- Fix build [#1303](https://github.com/jimp-dev/jimp/pull/1303) ([@hipstersmoothie](https://github.com/hipstersmoothie))
+
+#### ⚠️ Pushed to `main`
+
+- add clean script ([@hipstersmoothie](https://github.com/hipstersmoothie))
+
+#### Authors: 1
+
+- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
+
+---
+
+# v1.0.2 (Sat Aug 31 2024)
+
+#### ⚠️ Pushed to `main`
+
+- set side effects ([@hipstersmoothie](https://github.com/hipstersmoothie))
+- fix versions ([@hipstersmoothie](https://github.com/hipstersmoothie))
+- add publish config ([@hipstersmoothie](https://github.com/hipstersmoothie))
+
+#### Authors: 1
+
+- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
diff --git a/node_modules/@jimp/plugin-rotate/LICENSE b/node_modules/@jimp/plugin-rotate/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..baa5d48509a18b9ab4f6c39289362690ea68e688
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Oliver Moran
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/@jimp/plugin-rotate/README.md b/node_modules/@jimp/plugin-rotate/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..da083f70752b6b19488db9c6ac268f20d79dcd2b
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/README.md
@@ -0,0 +1,10 @@
+
+
+
@jimp/plugin-rotate
+
Rotate an image.
+
+
+Rotates the image counter-clockwise by a number of degrees. By default the width and height of the image will be resized appropriately.
+
+- [rotate](http://jimp-dev.github.io/jimp/api/jimp/classes/jimp#rotate)
diff --git a/node_modules/@jimp/plugin-rotate/dist/commonjs/index.d.ts b/node_modules/@jimp/plugin-rotate/dist/commonjs/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2bad34645c35ac84bab4bc88ad517a807ce276d1
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/dist/commonjs/index.d.ts
@@ -0,0 +1,32 @@
+import { ResizeStrategy } from "@jimp/plugin-resize";
+import { JimpClass } from "@jimp/types";
+import { z } from "zod";
+declare const RotateOptionsSchema: z.ZodUnion<[z.ZodNumber, z.ZodObject<{
+ /** the number of degrees to rotate the image by */
+ deg: z.ZodNumber;
+ /** resize mode or a boolean, if false then the width and height of the image will not be changed */
+ mode: z.ZodOptional]>>;
+}, "strip", z.ZodTypeAny, {
+ deg: number;
+ mode?: boolean | ResizeStrategy | undefined;
+}, {
+ deg: number;
+ mode?: boolean | ResizeStrategy | undefined;
+}>]>;
+export type RotateOptions = z.infer;
+export declare const methods: {
+ /**
+ * Rotates the image counter-clockwise by a number of degrees. By default the width and height of the image will be resized appropriately.
+ * @example
+ * ```ts
+ * import { Jimp } from "jimp";
+ *
+ * const image = await Jimp.read("test/image.png");
+ *
+ * image.rotate(90);
+ * ```
+ */
+ rotate(image: I, options: RotateOptions): I;
+};
+export {};
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@jimp/plugin-rotate/dist/commonjs/index.d.ts.map b/node_modules/@jimp/plugin-rotate/dist/commonjs/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..06cbbb11bcb72f1315a40c809f1e0784fd964c36
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/dist/commonjs/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA4B,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,mBAAmB;IAGrB,mDAAmD;;IAEnD,oGAAoG;;;;;;;;IAGtG,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAuMhE,eAAO,MAAM,OAAO;IAClB;;;;;;;;;;OAUG;WACI,CAAC,SAAS,SAAS,SAAS,CAAC,WAAW,aAAa;CA2B7D,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@jimp/plugin-rotate/dist/commonjs/index.js b/node_modules/@jimp/plugin-rotate/dist/commonjs/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..eb672ca22df6fe1a300b5c0453f6ef76aba791a4
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/dist/commonjs/index.js
@@ -0,0 +1,201 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.methods = void 0;
+const plugin_resize_1 = require("@jimp/plugin-resize");
+const utils_1 = require("@jimp/utils");
+const core_1 = require("@jimp/core");
+const plugin_crop_1 = require("@jimp/plugin-crop");
+const zod_1 = require("zod");
+const RotateOptionsSchema = zod_1.z.union([
+ zod_1.z.number(),
+ zod_1.z.object({
+ /** the number of degrees to rotate the image by */
+ deg: zod_1.z.number(),
+ /** resize mode or a boolean, if false then the width and height of the image will not be changed */
+ mode: zod_1.z.union([zod_1.z.boolean(), zod_1.z.nativeEnum(plugin_resize_1.ResizeStrategy)]).optional(),
+ }),
+]);
+/** function to translate the x, y coordinate to the index of the pixel in the buffer */
+function createIdxTranslationFunction(w) {
+ return function (x, y) {
+ return (y * w + x) << 2;
+ };
+}
+/**
+ * Rotates an image counter-clockwise by multiple of 90 degrees. NB: 'this' must be a Jimp object.
+ *
+ * This function is based on matrix rotation. Check this to get an initial idea how it works: https://stackoverflow.com/a/8664879/10561909
+ *
+ * @param deg the number of degrees to rotate the image by, it should be a multiple of 90
+ */
+function matrixRotate(image, deg) {
+ if (Math.abs(deg) % 90 !== 0) {
+ throw new Error("Unsupported matrix rotation degree");
+ }
+ const w = image.bitmap.width;
+ const h = image.bitmap.height;
+ // decide which rotation angle to use
+ let angle;
+ switch (deg) {
+ // 90 degree & -270 degree are same
+ case 90:
+ case -270:
+ angle = 90;
+ break;
+ case 180:
+ case -180:
+ angle = 180;
+ break;
+ case 270:
+ case -90:
+ angle = -90;
+ break;
+ default:
+ throw new Error("Unsupported matrix rotation degree");
+ }
+ // After this switch block, angle will be 90, 180 or -90
+ // calculate the new width and height
+ const nW = angle === 180 ? w : h;
+ const nH = angle === 180 ? h : w;
+ const dstBuffer = Buffer.alloc(image.bitmap.data.length);
+ const srcIdxFunction = createIdxTranslationFunction(w);
+ const dstIdxFunction = createIdxTranslationFunction(nW);
+ for (let x = 0; x < w; x++) {
+ for (let y = 0; y < h; y++) {
+ const srcIdx = srcIdxFunction(x, y);
+ const pixelRGBA = image.bitmap.data.readUInt32BE(srcIdx);
+ let dstIdx;
+ switch (angle) {
+ case 90:
+ dstIdx = dstIdxFunction(y, w - x - 1);
+ break;
+ case -90:
+ dstIdx = dstIdxFunction(h - y - 1, x);
+ break;
+ case 180:
+ dstIdx = dstIdxFunction(w - x - 1, h - y - 1);
+ break;
+ default:
+ throw new Error("Unsupported matrix rotation angle");
+ }
+ dstBuffer.writeUInt32BE(pixelRGBA, dstIdx);
+ }
+ }
+ image.bitmap.data = dstBuffer;
+ image.bitmap.width = nW;
+ image.bitmap.height = nH;
+}
+function createTranslationFunction(deltaX, deltaY) {
+ return function (x, y) {
+ return {
+ x: x + deltaX,
+ y: y + deltaY,
+ };
+ };
+}
+/**
+ * Rotates an image counter-clockwise by an arbitrary number of degrees. NB: 'this' must be a Jimp object.
+ * @param {number} deg the number of degrees to rotate the image by
+ */
+function advancedRotate(image, deg, mode) {
+ const rad = (deg * Math.PI) / 180;
+ const cosine = Math.cos(rad);
+ const sine = Math.sin(rad);
+ // the final width and height will change if resize == true
+ let w = image.bitmap.width;
+ let h = image.bitmap.height;
+ if (mode === true || typeof mode === "string") {
+ // resize the image to it maximum dimension and blit the existing image
+ // onto the center so that when it is rotated the image is kept in bounds
+ // http://stackoverflow.com/questions/3231176/how-to-get-size-of-a-rotated-rectangle
+ // Plus 1 border pixel to ensure to show all rotated result for some cases.
+ w =
+ Math.ceil(Math.abs(image.bitmap.width * cosine) +
+ Math.abs(image.bitmap.height * sine)) + 1;
+ h =
+ Math.ceil(Math.abs(image.bitmap.width * sine) +
+ Math.abs(image.bitmap.height * cosine)) + 1;
+ // Ensure destination to have even size to a better result.
+ if (w % 2 !== 0) {
+ w++;
+ }
+ if (h % 2 !== 0) {
+ h++;
+ }
+ const c = (0, utils_1.clone)(image);
+ image.scan((_, __, idx) => {
+ image.bitmap.data.writeUInt32BE(image.background, idx);
+ });
+ const max = Math.max(w, h, image.bitmap.width, image.bitmap.height);
+ image = plugin_resize_1.methods.resize(image, {
+ h: max,
+ w: max,
+ mode: mode === true ? undefined : mode,
+ });
+ image = (0, core_1.composite)(image, c, image.bitmap.width / 2 - c.bitmap.width / 2, image.bitmap.height / 2 - c.bitmap.height / 2);
+ }
+ const bW = image.bitmap.width;
+ const bH = image.bitmap.height;
+ const dstBuffer = Buffer.alloc(image.bitmap.data.length);
+ const translate2Cartesian = createTranslationFunction(-(bW / 2), -(bH / 2));
+ const translate2Screen = createTranslationFunction(bW / 2 + 0.5, bH / 2 + 0.5);
+ for (let y = 1; y <= bH; y++) {
+ for (let x = 1; x <= bW; x++) {
+ const cartesian = translate2Cartesian(x, y);
+ const source = translate2Screen(cosine * cartesian.x - sine * cartesian.y, cosine * cartesian.y + sine * cartesian.x);
+ const dstIdx = (bW * (y - 1) + x - 1) << 2;
+ if (source.x >= 0 && source.x < bW && source.y >= 0 && source.y < bH) {
+ const srcIdx = ((bW * (source.y | 0) + source.x) | 0) << 2;
+ const pixelRGBA = image.bitmap.data.readUInt32BE(srcIdx);
+ dstBuffer.writeUInt32BE(pixelRGBA, dstIdx);
+ }
+ else {
+ // reset off-image pixels
+ dstBuffer.writeUInt32BE(image.background, dstIdx);
+ }
+ }
+ }
+ image.bitmap.data = dstBuffer;
+ if (mode === true || typeof mode === "string") {
+ // now crop the image to the final size
+ const x = Math.max(bW / 2 - w / 2, 0);
+ const y = Math.max(bH / 2 - h / 2, 0);
+ image = plugin_crop_1.methods.crop(image, { x, y, w, h });
+ }
+}
+exports.methods = {
+ /**
+ * Rotates the image counter-clockwise by a number of degrees. By default the width and height of the image will be resized appropriately.
+ * @example
+ * ```ts
+ * import { Jimp } from "jimp";
+ *
+ * const image = await Jimp.read("test/image.png");
+ *
+ * image.rotate(90);
+ * ```
+ */
+ rotate(image, options) {
+ const parsed = RotateOptionsSchema.parse(options);
+ const actualOptions = typeof parsed === "number" ? { deg: parsed } : parsed;
+ const { mode = true } = actualOptions;
+ let { deg } = actualOptions;
+ // No need to do extra rotation
+ deg %= 360;
+ // no rotation for 0, 360, -360, 720, -720, ...
+ if (deg % 360 === 0) {
+ return image;
+ }
+ // use matrixRotate if the angle is a multiple of 90 degrees (eg: 180 or -90) and resize is allowed or not needed.
+ const matrixRotateAllowed = deg % 90 === 0 &&
+ (mode || image.bitmap.width === image.bitmap.height || deg % 180 === 0);
+ if (matrixRotateAllowed) {
+ matrixRotate(image, deg);
+ }
+ else {
+ advancedRotate(image, deg, mode);
+ }
+ return image;
+ },
+};
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/@jimp/plugin-rotate/dist/commonjs/index.js.map b/node_modules/@jimp/plugin-rotate/dist/commonjs/index.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..1676bbbdf1119562892dd3bbc4275fdc4d60908a
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/dist/commonjs/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
diff --git a/node_modules/@jimp/plugin-rotate/dist/commonjs/package.json b/node_modules/@jimp/plugin-rotate/dist/commonjs/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/dist/commonjs/package.json
@@ -0,0 +1,3 @@
+{
+ "type": "commonjs"
+}
diff --git a/node_modules/@jimp/plugin-rotate/dist/esm/index.d.ts b/node_modules/@jimp/plugin-rotate/dist/esm/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2bad34645c35ac84bab4bc88ad517a807ce276d1
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/dist/esm/index.d.ts
@@ -0,0 +1,32 @@
+import { ResizeStrategy } from "@jimp/plugin-resize";
+import { JimpClass } from "@jimp/types";
+import { z } from "zod";
+declare const RotateOptionsSchema: z.ZodUnion<[z.ZodNumber, z.ZodObject<{
+ /** the number of degrees to rotate the image by */
+ deg: z.ZodNumber;
+ /** resize mode or a boolean, if false then the width and height of the image will not be changed */
+ mode: z.ZodOptional]>>;
+}, "strip", z.ZodTypeAny, {
+ deg: number;
+ mode?: boolean | ResizeStrategy | undefined;
+}, {
+ deg: number;
+ mode?: boolean | ResizeStrategy | undefined;
+}>]>;
+export type RotateOptions = z.infer;
+export declare const methods: {
+ /**
+ * Rotates the image counter-clockwise by a number of degrees. By default the width and height of the image will be resized appropriately.
+ * @example
+ * ```ts
+ * import { Jimp } from "jimp";
+ *
+ * const image = await Jimp.read("test/image.png");
+ *
+ * image.rotate(90);
+ * ```
+ */
+ rotate(image: I, options: RotateOptions): I;
+};
+export {};
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@jimp/plugin-rotate/dist/esm/index.d.ts.map b/node_modules/@jimp/plugin-rotate/dist/esm/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..06cbbb11bcb72f1315a40c809f1e0784fd964c36
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/dist/esm/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA4B,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,mBAAmB;IAGrB,mDAAmD;;IAEnD,oGAAoG;;;;;;;;IAGtG,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAuMhE,eAAO,MAAM,OAAO;IAClB;;;;;;;;;;OAUG;WACI,CAAC,SAAS,SAAS,SAAS,CAAC,WAAW,aAAa;CA2B7D,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@jimp/plugin-rotate/dist/esm/index.js b/node_modules/@jimp/plugin-rotate/dist/esm/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..cd5ba19377bbbd00869e7abcd3e126999f9743b1
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/dist/esm/index.js
@@ -0,0 +1,198 @@
+import { ResizeStrategy, methods as resizeMethods } from "@jimp/plugin-resize";
+import { clone } from "@jimp/utils";
+import { composite } from "@jimp/core";
+import { methods as cropMethods } from "@jimp/plugin-crop";
+import { z } from "zod";
+const RotateOptionsSchema = z.union([
+ z.number(),
+ z.object({
+ /** the number of degrees to rotate the image by */
+ deg: z.number(),
+ /** resize mode or a boolean, if false then the width and height of the image will not be changed */
+ mode: z.union([z.boolean(), z.nativeEnum(ResizeStrategy)]).optional(),
+ }),
+]);
+/** function to translate the x, y coordinate to the index of the pixel in the buffer */
+function createIdxTranslationFunction(w) {
+ return function (x, y) {
+ return (y * w + x) << 2;
+ };
+}
+/**
+ * Rotates an image counter-clockwise by multiple of 90 degrees. NB: 'this' must be a Jimp object.
+ *
+ * This function is based on matrix rotation. Check this to get an initial idea how it works: https://stackoverflow.com/a/8664879/10561909
+ *
+ * @param deg the number of degrees to rotate the image by, it should be a multiple of 90
+ */
+function matrixRotate(image, deg) {
+ if (Math.abs(deg) % 90 !== 0) {
+ throw new Error("Unsupported matrix rotation degree");
+ }
+ const w = image.bitmap.width;
+ const h = image.bitmap.height;
+ // decide which rotation angle to use
+ let angle;
+ switch (deg) {
+ // 90 degree & -270 degree are same
+ case 90:
+ case -270:
+ angle = 90;
+ break;
+ case 180:
+ case -180:
+ angle = 180;
+ break;
+ case 270:
+ case -90:
+ angle = -90;
+ break;
+ default:
+ throw new Error("Unsupported matrix rotation degree");
+ }
+ // After this switch block, angle will be 90, 180 or -90
+ // calculate the new width and height
+ const nW = angle === 180 ? w : h;
+ const nH = angle === 180 ? h : w;
+ const dstBuffer = Buffer.alloc(image.bitmap.data.length);
+ const srcIdxFunction = createIdxTranslationFunction(w);
+ const dstIdxFunction = createIdxTranslationFunction(nW);
+ for (let x = 0; x < w; x++) {
+ for (let y = 0; y < h; y++) {
+ const srcIdx = srcIdxFunction(x, y);
+ const pixelRGBA = image.bitmap.data.readUInt32BE(srcIdx);
+ let dstIdx;
+ switch (angle) {
+ case 90:
+ dstIdx = dstIdxFunction(y, w - x - 1);
+ break;
+ case -90:
+ dstIdx = dstIdxFunction(h - y - 1, x);
+ break;
+ case 180:
+ dstIdx = dstIdxFunction(w - x - 1, h - y - 1);
+ break;
+ default:
+ throw new Error("Unsupported matrix rotation angle");
+ }
+ dstBuffer.writeUInt32BE(pixelRGBA, dstIdx);
+ }
+ }
+ image.bitmap.data = dstBuffer;
+ image.bitmap.width = nW;
+ image.bitmap.height = nH;
+}
+function createTranslationFunction(deltaX, deltaY) {
+ return function (x, y) {
+ return {
+ x: x + deltaX,
+ y: y + deltaY,
+ };
+ };
+}
+/**
+ * Rotates an image counter-clockwise by an arbitrary number of degrees. NB: 'this' must be a Jimp object.
+ * @param {number} deg the number of degrees to rotate the image by
+ */
+function advancedRotate(image, deg, mode) {
+ const rad = (deg * Math.PI) / 180;
+ const cosine = Math.cos(rad);
+ const sine = Math.sin(rad);
+ // the final width and height will change if resize == true
+ let w = image.bitmap.width;
+ let h = image.bitmap.height;
+ if (mode === true || typeof mode === "string") {
+ // resize the image to it maximum dimension and blit the existing image
+ // onto the center so that when it is rotated the image is kept in bounds
+ // http://stackoverflow.com/questions/3231176/how-to-get-size-of-a-rotated-rectangle
+ // Plus 1 border pixel to ensure to show all rotated result for some cases.
+ w =
+ Math.ceil(Math.abs(image.bitmap.width * cosine) +
+ Math.abs(image.bitmap.height * sine)) + 1;
+ h =
+ Math.ceil(Math.abs(image.bitmap.width * sine) +
+ Math.abs(image.bitmap.height * cosine)) + 1;
+ // Ensure destination to have even size to a better result.
+ if (w % 2 !== 0) {
+ w++;
+ }
+ if (h % 2 !== 0) {
+ h++;
+ }
+ const c = clone(image);
+ image.scan((_, __, idx) => {
+ image.bitmap.data.writeUInt32BE(image.background, idx);
+ });
+ const max = Math.max(w, h, image.bitmap.width, image.bitmap.height);
+ image = resizeMethods.resize(image, {
+ h: max,
+ w: max,
+ mode: mode === true ? undefined : mode,
+ });
+ image = composite(image, c, image.bitmap.width / 2 - c.bitmap.width / 2, image.bitmap.height / 2 - c.bitmap.height / 2);
+ }
+ const bW = image.bitmap.width;
+ const bH = image.bitmap.height;
+ const dstBuffer = Buffer.alloc(image.bitmap.data.length);
+ const translate2Cartesian = createTranslationFunction(-(bW / 2), -(bH / 2));
+ const translate2Screen = createTranslationFunction(bW / 2 + 0.5, bH / 2 + 0.5);
+ for (let y = 1; y <= bH; y++) {
+ for (let x = 1; x <= bW; x++) {
+ const cartesian = translate2Cartesian(x, y);
+ const source = translate2Screen(cosine * cartesian.x - sine * cartesian.y, cosine * cartesian.y + sine * cartesian.x);
+ const dstIdx = (bW * (y - 1) + x - 1) << 2;
+ if (source.x >= 0 && source.x < bW && source.y >= 0 && source.y < bH) {
+ const srcIdx = ((bW * (source.y | 0) + source.x) | 0) << 2;
+ const pixelRGBA = image.bitmap.data.readUInt32BE(srcIdx);
+ dstBuffer.writeUInt32BE(pixelRGBA, dstIdx);
+ }
+ else {
+ // reset off-image pixels
+ dstBuffer.writeUInt32BE(image.background, dstIdx);
+ }
+ }
+ }
+ image.bitmap.data = dstBuffer;
+ if (mode === true || typeof mode === "string") {
+ // now crop the image to the final size
+ const x = Math.max(bW / 2 - w / 2, 0);
+ const y = Math.max(bH / 2 - h / 2, 0);
+ image = cropMethods.crop(image, { x, y, w, h });
+ }
+}
+export const methods = {
+ /**
+ * Rotates the image counter-clockwise by a number of degrees. By default the width and height of the image will be resized appropriately.
+ * @example
+ * ```ts
+ * import { Jimp } from "jimp";
+ *
+ * const image = await Jimp.read("test/image.png");
+ *
+ * image.rotate(90);
+ * ```
+ */
+ rotate(image, options) {
+ const parsed = RotateOptionsSchema.parse(options);
+ const actualOptions = typeof parsed === "number" ? { deg: parsed } : parsed;
+ const { mode = true } = actualOptions;
+ let { deg } = actualOptions;
+ // No need to do extra rotation
+ deg %= 360;
+ // no rotation for 0, 360, -360, 720, -720, ...
+ if (deg % 360 === 0) {
+ return image;
+ }
+ // use matrixRotate if the angle is a multiple of 90 degrees (eg: 180 or -90) and resize is allowed or not needed.
+ const matrixRotateAllowed = deg % 90 === 0 &&
+ (mode || image.bitmap.width === image.bitmap.height || deg % 180 === 0);
+ if (matrixRotateAllowed) {
+ matrixRotate(image, deg);
+ }
+ else {
+ advancedRotate(image, deg, mode);
+ }
+ return image;
+ },
+};
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/@jimp/plugin-rotate/dist/esm/index.js.map b/node_modules/@jimp/plugin-rotate/dist/esm/index.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..5f312f7e3f17d4d1b5b0a30a6cf5345cad082ae7
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/dist/esm/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
diff --git a/node_modules/@jimp/plugin-rotate/dist/esm/package.json b/node_modules/@jimp/plugin-rotate/dist/esm/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/dist/esm/package.json
@@ -0,0 +1,3 @@
+{
+ "type": "module"
+}
diff --git a/node_modules/@jimp/plugin-rotate/eslint.config.mjs b/node_modules/@jimp/plugin-rotate/eslint.config.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..939816d0a4be5f347676861f9592614a0ca07046
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/eslint.config.mjs
@@ -0,0 +1,2 @@
+import shared from "@jimp/config-eslint/base.js";
+export default [...shared];
\ No newline at end of file
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/LICENSE b/node_modules/@jimp/plugin-rotate/node_modules/zod/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..c06579627b432d09779094cd0166b7f37fe51db8
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2025 Colin McDonnell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/README.md b/node_modules/@jimp/plugin-rotate/node_modules/zod/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..5ffbaa84a76c8873d22bfb83681558ea14f0a421
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/README.md
@@ -0,0 +1,208 @@
+
+
+
Zod
+
+ TypeScript-first schema validation with static type inference
+
+ by @colinhacks
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Featured sponsor: Jazz
+
+
+
+
+
+
+
+### [Read the docs →](https://zod.dev/api)
+
+
+
+
+## What is Zod?
+
+Zod is a TypeScript-first validation library. Define a schema and parse some data with it. You'll get back a strongly typed, validated result.
+
+```ts
+import * as z from "zod/v4";
+
+const User = z.object({
+ name: z.string(),
+});
+
+// some untrusted data...
+const input = {
+ /* stuff */
+};
+
+// the parsed result is validated and type safe!
+const data = User.parse(input);
+
+// so you can use it with confidence :)
+console.log(data.name);
+```
+
+
+
+## Features
+
+- Zero external dependencies
+- Works in Node.js and all modern browsers
+- Tiny: `2kb` core bundle (gzipped)
+- Immutable API: methods return a new instance
+- Concise interface
+- Works with TypeScript and plain JS
+- Built-in JSON Schema conversion
+- Extensive ecosystem
+
+
+
+## Installation
+
+```sh
+npm install zod
+```
+
+
+
+## Basic usage
+
+Before you can do anything else, you need to define a schema. For the purposes of this guide, we'll use a simple object schema.
+
+```ts
+import * as z from "zod/v4";
+
+const Player = z.object({
+ username: z.string(),
+ xp: z.number(),
+});
+```
+
+### Parsing data
+
+Given any Zod schema, use `.parse` to validate an input. If it's valid, Zod returns a strongly-typed _deep clone_ of the input.
+
+```ts
+Player.parse({ username: "billie", xp: 100 });
+// => returns { username: "billie", xp: 100 }
+```
+
+**Note** — If your schema uses certain asynchronous APIs like `async` [refinements](#refine) or [transforms](#transform), you'll need to use the `.parseAsync()` method instead.
+
+```ts
+const schema = z.string().refine(async (val) => val.length <= 8);
+
+await schema.parseAsync("hello");
+// => "hello"
+```
+
+### Handling errors
+
+When validation fails, the `.parse()` method will throw a `ZodError` instance with granular information about the validation issues.
+
+```ts
+try {
+ Player.parse({ username: 42, xp: "100" });
+} catch (err) {
+ if (err instanceof z.ZodError) {
+ err.issues;
+ /* [
+ {
+ expected: 'string',
+ code: 'invalid_type',
+ path: [ 'username' ],
+ message: 'Invalid input: expected string'
+ },
+ {
+ expected: 'number',
+ code: 'invalid_type',
+ path: [ 'xp' ],
+ message: 'Invalid input: expected number'
+ }
+ ] */
+ }
+}
+```
+
+To avoid a `try/catch` block, you can use the `.safeParse()` method to get back a plain result object containing either the successfully parsed data or a `ZodError`. The result type is a [discriminated union](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions), so you can handle both cases conveniently.
+
+```ts
+const result = Player.safeParse({ username: 42, xp: "100" });
+if (!result.success) {
+ result.error; // ZodError instance
+} else {
+ result.data; // { username: string; xp: number }
+}
+```
+
+**Note** — If your schema uses certain asynchronous APIs like `async` [refinements](#refine) or [transforms](#transform), you'll need to use the `.safeParseAsync()` method instead.
+
+```ts
+const schema = z.string().refine(async (val) => val.length <= 8);
+
+await schema.safeParseAsync("hello");
+// => { success: true; data: "hello" }
+```
+
+### Inferring types
+
+Zod infers a static type from your schema definitions. You can extract this type with the `z.infer<>` utility and use it however you like.
+
+```ts
+const Player = z.object({
+ username: z.string(),
+ xp: z.number(),
+});
+
+// extract the inferred type
+type Player = z.infer;
+
+// use it in your code
+const player: Player = { username: "billie", xp: 100 };
+```
+
+In some cases, the input & output types of a schema can diverge. For instance, the `.transform()` API can convert the input from one type to another. In these cases, you can extract the input and output types independently:
+
+```ts
+const mySchema = z.string().transform((val) => val.length);
+
+type MySchemaIn = z.input;
+// => string
+
+type MySchemaOut = z.output; // equivalent to z.infer
+// number
+```
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/index.cjs b/node_modules/@jimp/plugin-rotate/node_modules/zod/index.cjs
new file mode 100644
index 0000000000000000000000000000000000000000..62f74c802b220c1e095199b3e4431461032ae461
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/index.cjs
@@ -0,0 +1,33 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.z = void 0;
+const z = __importStar(require("./v3/external.cjs"));
+exports.z = z;
+__exportStar(require("./v3/external.cjs"), exports);
+exports.default = z;
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/index.d.cts b/node_modules/@jimp/plugin-rotate/node_modules/zod/index.d.cts
new file mode 100644
index 0000000000000000000000000000000000000000..665bd24d9fbbc120372baccfc26db2a028e0001d
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/index.d.cts
@@ -0,0 +1,4 @@
+import * as z from "./v3/external.cjs";
+export * from "./v3/external.cjs";
+export { z };
+export default z;
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/index.d.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..bf6f1643ab4526b97b1eb1a6dcdea48262f70194
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/index.d.ts
@@ -0,0 +1,4 @@
+import * as z from "./v3/external.js";
+export * from "./v3/external.js";
+export { z };
+export default z;
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/index.js b/node_modules/@jimp/plugin-rotate/node_modules/zod/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..bf6f1643ab4526b97b1eb1a6dcdea48262f70194
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/index.js
@@ -0,0 +1,4 @@
+import * as z from "./v3/external.js";
+export * from "./v3/external.js";
+export { z };
+export default z;
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/package.json b/node_modules/@jimp/plugin-rotate/node_modules/zod/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..eedcfb0f8e3343c8ac5ba32e5117a032352a986c
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/package.json
@@ -0,0 +1,118 @@
+{
+ "name": "zod",
+ "version": "3.25.76",
+ "type": "module",
+ "author": "Colin McDonnell ",
+ "description": "TypeScript-first schema declaration and validation library with static type inference",
+ "files": [
+ "src",
+ "**/*.js",
+ "**/*.mjs",
+ "**/*.cjs",
+ "**/*.d.ts",
+ "**/*.d.mts",
+ "**/*.d.cts"
+ ],
+ "funding": "https://github.com/sponsors/colinhacks",
+ "homepage": "https://zod.dev",
+ "keywords": [
+ "typescript",
+ "schema",
+ "validation",
+ "type",
+ "inference"
+ ],
+ "license": "MIT",
+ "sideEffects": false,
+ "main": "./index.cjs",
+ "types": "./index.d.cts",
+ "module": "./index.js",
+ "zshy": {
+ "exports": {
+ "./package.json": "./package.json",
+ ".": "./src/index.ts",
+ "./v3": "./src/v3/index.ts",
+ "./v4": "./src/v4/index.ts",
+ "./v4-mini": "./src/v4-mini/index.ts",
+ "./v4/mini": "./src/v4/mini/index.ts",
+ "./v4/core": "./src/v4/core/index.ts",
+ "./v4/locales": "./src/v4/locales/index.ts",
+ "./v4/locales/*": "./src/v4/locales/*"
+ },
+ "sourceDialects": [
+ "@zod/source"
+ ]
+ },
+ "exports": {
+ "./package.json": "./package.json",
+ ".": {
+ "@zod/source": "./src/index.ts",
+ "types": "./index.d.cts",
+ "import": "./index.js",
+ "require": "./index.cjs"
+ },
+ "./v3": {
+ "@zod/source": "./src/v3/index.ts",
+ "types": "./v3/index.d.cts",
+ "import": "./v3/index.js",
+ "require": "./v3/index.cjs"
+ },
+ "./v4": {
+ "@zod/source": "./src/v4/index.ts",
+ "types": "./v4/index.d.cts",
+ "import": "./v4/index.js",
+ "require": "./v4/index.cjs"
+ },
+ "./v4-mini": {
+ "@zod/source": "./src/v4-mini/index.ts",
+ "types": "./v4-mini/index.d.cts",
+ "import": "./v4-mini/index.js",
+ "require": "./v4-mini/index.cjs"
+ },
+ "./v4/mini": {
+ "@zod/source": "./src/v4/mini/index.ts",
+ "types": "./v4/mini/index.d.cts",
+ "import": "./v4/mini/index.js",
+ "require": "./v4/mini/index.cjs"
+ },
+ "./v4/core": {
+ "@zod/source": "./src/v4/core/index.ts",
+ "types": "./v4/core/index.d.cts",
+ "import": "./v4/core/index.js",
+ "require": "./v4/core/index.cjs"
+ },
+ "./v4/locales": {
+ "@zod/source": "./src/v4/locales/index.ts",
+ "types": "./v4/locales/index.d.cts",
+ "import": "./v4/locales/index.js",
+ "require": "./v4/locales/index.cjs"
+ },
+ "./v4/locales/*": {
+ "@zod/source": "./src/v4/locales/*",
+ "types": "./v4/locales/*",
+ "import": "./v4/locales/*",
+ "require": "./v4/locales/*"
+ }
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/colinhacks/zod.git"
+ },
+ "bugs": {
+ "url": "https://github.com/colinhacks/zod/issues"
+ },
+ "support": {
+ "backing": {
+ "npm-funding": true
+ }
+ },
+ "scripts": {
+ "clean": "git clean -xdf . -e node_modules",
+ "build": "zshy --project tsconfig.build.json",
+ "postbuild": "pnpm biome check --write .",
+ "test:watch": "pnpm vitest",
+ "test": "pnpm vitest run",
+ "bump:beta": "pnpm version \"v$(pnpm pkg get version | jq -r)-beta.$(date +%Y%m%dT%H%M%S)\"",
+ "pub:beta": "pnpm bump:beta && pnpm publish --tag next --publish-branch v4 --no-git-checks --dry-run"
+ }
+}
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/index.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..bf6f1643ab4526b97b1eb1a6dcdea48262f70194
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/index.ts
@@ -0,0 +1,4 @@
+import * as z from "./v3/external.js";
+export * from "./v3/external.js";
+export { z };
+export default z;
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/ZodError.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/ZodError.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6ee33c14a93b8bb8c5fd62fcc19803f843c619e7
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/ZodError.ts
@@ -0,0 +1,330 @@
+import type { Primitive } from "./helpers/typeAliases.js";
+import { util, type ZodParsedType } from "./helpers/util.js";
+import type { TypeOf, ZodType } from "./index.js";
+
+type allKeys = T extends any ? keyof T : never;
+
+export type inferFlattenedErrors, U = string> = typeToFlattenedError, U>;
+export type typeToFlattenedError = {
+ formErrors: U[];
+ fieldErrors: {
+ [P in allKeys]?: U[];
+ };
+};
+
+export const ZodIssueCode = util.arrayToEnum([
+ "invalid_type",
+ "invalid_literal",
+ "custom",
+ "invalid_union",
+ "invalid_union_discriminator",
+ "invalid_enum_value",
+ "unrecognized_keys",
+ "invalid_arguments",
+ "invalid_return_type",
+ "invalid_date",
+ "invalid_string",
+ "too_small",
+ "too_big",
+ "invalid_intersection_types",
+ "not_multiple_of",
+ "not_finite",
+]);
+
+export type ZodIssueCode = keyof typeof ZodIssueCode;
+
+export type ZodIssueBase = {
+ path: (string | number)[];
+ message?: string | undefined;
+};
+
+export interface ZodInvalidTypeIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.invalid_type;
+ expected: ZodParsedType;
+ received: ZodParsedType;
+}
+
+export interface ZodInvalidLiteralIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.invalid_literal;
+ expected: unknown;
+ received: unknown;
+}
+
+export interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.unrecognized_keys;
+ keys: string[];
+}
+
+export interface ZodInvalidUnionIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.invalid_union;
+ unionErrors: ZodError[];
+}
+
+export interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.invalid_union_discriminator;
+ options: Primitive[];
+}
+
+export interface ZodInvalidEnumValueIssue extends ZodIssueBase {
+ received: string | number;
+ code: typeof ZodIssueCode.invalid_enum_value;
+ options: (string | number)[];
+}
+
+export interface ZodInvalidArgumentsIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.invalid_arguments;
+ argumentsError: ZodError;
+}
+
+export interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.invalid_return_type;
+ returnTypeError: ZodError;
+}
+
+export interface ZodInvalidDateIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.invalid_date;
+}
+
+export type StringValidation =
+ | "email"
+ | "url"
+ | "emoji"
+ | "uuid"
+ | "nanoid"
+ | "regex"
+ | "cuid"
+ | "cuid2"
+ | "ulid"
+ | "datetime"
+ | "date"
+ | "time"
+ | "duration"
+ | "ip"
+ | "cidr"
+ | "base64"
+ | "jwt"
+ | "base64url"
+ | { includes: string; position?: number | undefined }
+ | { startsWith: string }
+ | { endsWith: string };
+
+export interface ZodInvalidStringIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.invalid_string;
+ validation: StringValidation;
+}
+
+export interface ZodTooSmallIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.too_small;
+ minimum: number | bigint;
+ inclusive: boolean;
+ exact?: boolean;
+ type: "array" | "string" | "number" | "set" | "date" | "bigint";
+}
+
+export interface ZodTooBigIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.too_big;
+ maximum: number | bigint;
+ inclusive: boolean;
+ exact?: boolean;
+ type: "array" | "string" | "number" | "set" | "date" | "bigint";
+}
+
+export interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.invalid_intersection_types;
+}
+
+export interface ZodNotMultipleOfIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.not_multiple_of;
+ multipleOf: number | bigint;
+}
+
+export interface ZodNotFiniteIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.not_finite;
+}
+
+export interface ZodCustomIssue extends ZodIssueBase {
+ code: typeof ZodIssueCode.custom;
+ params?: { [k: string]: any };
+}
+
+export type DenormalizedError = { [k: string]: DenormalizedError | string[] };
+
+export type ZodIssueOptionalMessage =
+ | ZodInvalidTypeIssue
+ | ZodInvalidLiteralIssue
+ | ZodUnrecognizedKeysIssue
+ | ZodInvalidUnionIssue
+ | ZodInvalidUnionDiscriminatorIssue
+ | ZodInvalidEnumValueIssue
+ | ZodInvalidArgumentsIssue
+ | ZodInvalidReturnTypeIssue
+ | ZodInvalidDateIssue
+ | ZodInvalidStringIssue
+ | ZodTooSmallIssue
+ | ZodTooBigIssue
+ | ZodInvalidIntersectionTypesIssue
+ | ZodNotMultipleOfIssue
+ | ZodNotFiniteIssue
+ | ZodCustomIssue;
+
+export type ZodIssue = ZodIssueOptionalMessage & {
+ fatal?: boolean | undefined;
+ message: string;
+};
+
+export const quotelessJson = (obj: any) => {
+ const json = JSON.stringify(obj, null, 2);
+ return json.replace(/"([^"]+)":/g, "$1:");
+};
+
+type recursiveZodFormattedError = T extends [any, ...any[]]
+ ? { [K in keyof T]?: ZodFormattedError }
+ : T extends any[]
+ ? { [k: number]: ZodFormattedError }
+ : T extends object
+ ? { [K in keyof T]?: ZodFormattedError }
+ : unknown;
+
+export type ZodFormattedError = {
+ _errors: U[];
+} & recursiveZodFormattedError>;
+
+export type inferFormattedError, U = string> = ZodFormattedError, U>;
+
+export class ZodError extends Error {
+ issues: ZodIssue[] = [];
+
+ get errors() {
+ return this.issues;
+ }
+
+ constructor(issues: ZodIssue[]) {
+ super();
+
+ const actualProto = new.target.prototype;
+ if (Object.setPrototypeOf) {
+ // eslint-disable-next-line ban/ban
+ Object.setPrototypeOf(this, actualProto);
+ } else {
+ (this as any).__proto__ = actualProto;
+ }
+ this.name = "ZodError";
+ this.issues = issues;
+ }
+
+ format(): ZodFormattedError;
+ format(mapper: (issue: ZodIssue) => U): ZodFormattedError;
+ format(_mapper?: any) {
+ const mapper: (issue: ZodIssue) => any =
+ _mapper ||
+ function (issue: ZodIssue) {
+ return issue.message;
+ };
+ const fieldErrors: ZodFormattedError = { _errors: [] } as any;
+ const processError = (error: ZodError) => {
+ for (const issue of error.issues) {
+ if (issue.code === "invalid_union") {
+ issue.unionErrors.map(processError);
+ } else if (issue.code === "invalid_return_type") {
+ processError(issue.returnTypeError);
+ } else if (issue.code === "invalid_arguments") {
+ processError(issue.argumentsError);
+ } else if (issue.path.length === 0) {
+ (fieldErrors as any)._errors.push(mapper(issue));
+ } else {
+ let curr: any = fieldErrors;
+ let i = 0;
+ while (i < issue.path.length) {
+ const el = issue.path[i]!;
+ const terminal = i === issue.path.length - 1;
+
+ if (!terminal) {
+ curr[el] = curr[el] || { _errors: [] };
+ // if (typeof el === "string") {
+ // curr[el] = curr[el] || { _errors: [] };
+ // } else if (typeof el === "number") {
+ // const errorArray: any = [];
+ // errorArray._errors = [];
+ // curr[el] = curr[el] || errorArray;
+ // }
+ } else {
+ curr[el] = curr[el] || { _errors: [] };
+ curr[el]._errors.push(mapper(issue));
+ }
+
+ curr = curr[el];
+ i++;
+ }
+ }
+ }
+ };
+
+ processError(this);
+ return fieldErrors;
+ }
+
+ static create = (issues: ZodIssue[]) => {
+ const error = new ZodError(issues);
+ return error;
+ };
+
+ static assert(value: unknown): asserts value is ZodError {
+ if (!(value instanceof ZodError)) {
+ throw new Error(`Not a ZodError: ${value}`);
+ }
+ }
+
+ override toString() {
+ return this.message;
+ }
+ override get message() {
+ return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
+ }
+
+ get isEmpty(): boolean {
+ return this.issues.length === 0;
+ }
+
+ addIssue = (sub: ZodIssue) => {
+ this.issues = [...this.issues, sub];
+ };
+
+ addIssues = (subs: ZodIssue[] = []) => {
+ this.issues = [...this.issues, ...subs];
+ };
+
+ flatten(): typeToFlattenedError;
+ flatten(mapper?: (issue: ZodIssue) => U): typeToFlattenedError;
+ flatten(mapper: (issue: ZodIssue) => U = (issue: ZodIssue) => issue.message as any): any {
+ const fieldErrors: any = {};
+ const formErrors: U[] = [];
+ for (const sub of this.issues) {
+ if (sub.path.length > 0) {
+ const firstEl = sub.path[0]!;
+ fieldErrors[firstEl] = fieldErrors[firstEl] || [];
+ fieldErrors[firstEl].push(mapper(sub));
+ } else {
+ formErrors.push(mapper(sub));
+ }
+ }
+ return { formErrors, fieldErrors };
+ }
+
+ get formErrors() {
+ return this.flatten();
+ }
+}
+
+type stripPath = T extends any ? util.OmitKeys : never;
+
+export type IssueData = stripPath & {
+ path?: (string | number)[];
+ fatal?: boolean | undefined;
+};
+
+export type ErrorMapCtx = {
+ defaultError: string;
+ data: any;
+};
+
+export type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => { message: string };
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/datetime.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/datetime.ts
new file mode 100644
index 0000000000000000000000000000000000000000..85552c254597cca742ff15351a99b5b862abd63e
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/datetime.ts
@@ -0,0 +1,58 @@
+import Benchmark from "benchmark";
+
+const datetimeValidationSuite = new Benchmark.Suite("datetime");
+
+const DATA = "2021-01-01";
+const MONTHS_31 = new Set([1, 3, 5, 7, 8, 10, 12]);
+const MONTHS_30 = new Set([4, 6, 9, 11]);
+
+const simpleDatetimeRegex = /^(\d{4})-(\d{2})-(\d{2})$/;
+const datetimeRegexNoLeapYearValidation =
+ /^\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\d|2\d))$/;
+const datetimeRegexWithLeapYearValidation =
+ /^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))$/;
+
+datetimeValidationSuite
+ .add("new Date()", () => {
+ return !Number.isNaN(new Date(DATA).getTime());
+ })
+ .add("regex (no validation)", () => {
+ return simpleDatetimeRegex.test(DATA);
+ })
+ .add("regex (no leap year)", () => {
+ return datetimeRegexNoLeapYearValidation.test(DATA);
+ })
+ .add("regex (w/ leap year)", () => {
+ return datetimeRegexWithLeapYearValidation.test(DATA);
+ })
+ .add("capture groups + code", () => {
+ const match = DATA.match(simpleDatetimeRegex);
+ if (!match) return false;
+
+ // Extract year, month, and day from the capture groups
+ const year = Number.parseInt(match[1], 10);
+ const month = Number.parseInt(match[2], 10); // month is 0-indexed in JavaScript Date, so subtract 1
+ const day = Number.parseInt(match[3], 10);
+
+ if (month === 2) {
+ if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {
+ return day <= 29;
+ }
+ return day <= 28;
+ }
+ if (MONTHS_30.has(month)) {
+ return day <= 30;
+ }
+ if (MONTHS_31.has(month)) {
+ return day <= 31;
+ }
+ return false;
+ })
+
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`${datetimeValidationSuite.name!}: ${e.target}`);
+ });
+
+export default {
+ suites: [datetimeValidationSuite],
+};
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts
new file mode 100644
index 0000000000000000000000000000000000000000..47737e6c382b0bf6b239bc7c147dbb336a20c778
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts
@@ -0,0 +1,80 @@
+import Benchmark from "benchmark";
+
+import { z } from "zod/v3";
+
+const doubleSuite = new Benchmark.Suite("z.discriminatedUnion: double");
+const manySuite = new Benchmark.Suite("z.discriminatedUnion: many");
+
+const aSchema = z.object({
+ type: z.literal("a"),
+});
+const objA = {
+ type: "a",
+};
+
+const bSchema = z.object({
+ type: z.literal("b"),
+});
+const objB = {
+ type: "b",
+};
+
+const cSchema = z.object({
+ type: z.literal("c"),
+});
+const objC = {
+ type: "c",
+};
+
+const dSchema = z.object({
+ type: z.literal("d"),
+});
+
+const double = z.discriminatedUnion("type", [aSchema, bSchema]);
+const many = z.discriminatedUnion("type", [aSchema, bSchema, cSchema, dSchema]);
+
+doubleSuite
+ .add("valid: a", () => {
+ double.parse(objA);
+ })
+ .add("valid: b", () => {
+ double.parse(objB);
+ })
+ .add("invalid: null", () => {
+ try {
+ double.parse(null);
+ } catch (_err) {}
+ })
+ .add("invalid: wrong shape", () => {
+ try {
+ double.parse(objC);
+ } catch (_err) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`${(doubleSuite as any).name}: ${e.target}`);
+ });
+
+manySuite
+ .add("valid: a", () => {
+ many.parse(objA);
+ })
+ .add("valid: c", () => {
+ many.parse(objC);
+ })
+ .add("invalid: null", () => {
+ try {
+ many.parse(null);
+ } catch (_err) {}
+ })
+ .add("invalid: wrong shape", () => {
+ try {
+ many.parse({ type: "unknown" });
+ } catch (_err) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`${(manySuite as any).name}: ${e.target}`);
+ });
+
+export default {
+ suites: [doubleSuite, manySuite],
+};
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/index.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ca81c5bb9e300b4917d46e31fdb87dc4f6146bcc
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/index.ts
@@ -0,0 +1,59 @@
+import type Benchmark from "benchmark";
+
+import datetimeBenchmarks from "./datetime.js";
+import discriminatedUnionBenchmarks from "./discriminatedUnion.js";
+import ipv4Benchmarks from "./ipv4.js";
+import objectBenchmarks from "./object.js";
+import primitiveBenchmarks from "./primitives.js";
+import realworld from "./realworld.js";
+import stringBenchmarks from "./string.js";
+import unionBenchmarks from "./union.js";
+
+const argv = process.argv.slice(2);
+let suites: Benchmark.Suite[] = [];
+
+if (!argv.length) {
+ suites = [
+ ...realworld.suites,
+ ...primitiveBenchmarks.suites,
+ ...stringBenchmarks.suites,
+ ...objectBenchmarks.suites,
+ ...unionBenchmarks.suites,
+ ...discriminatedUnionBenchmarks.suites,
+ ];
+} else {
+ if (argv.includes("--realworld")) {
+ suites.push(...realworld.suites);
+ }
+ if (argv.includes("--primitives")) {
+ suites.push(...primitiveBenchmarks.suites);
+ }
+ if (argv.includes("--string")) {
+ suites.push(...stringBenchmarks.suites);
+ }
+ if (argv.includes("--object")) {
+ suites.push(...objectBenchmarks.suites);
+ }
+ if (argv.includes("--union")) {
+ suites.push(...unionBenchmarks.suites);
+ }
+ if (argv.includes("--discriminatedUnion")) {
+ suites.push(...datetimeBenchmarks.suites);
+ }
+ if (argv.includes("--datetime")) {
+ suites.push(...datetimeBenchmarks.suites);
+ }
+ if (argv.includes("--ipv4")) {
+ suites.push(...ipv4Benchmarks.suites);
+ }
+}
+
+for (const suite of suites) {
+ suite.run({});
+}
+
+// exit on Ctrl-C
+process.on("SIGINT", function () {
+ console.log("Exiting...");
+ process.exit();
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/ipv4.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/ipv4.ts
new file mode 100644
index 0000000000000000000000000000000000000000..913ffd4166b7061b1505eb635687ea7eabf403d2
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/ipv4.ts
@@ -0,0 +1,57 @@
+import Benchmark from "benchmark";
+
+const suite = new Benchmark.Suite("ipv4");
+
+const DATA = "127.0.0.1";
+const ipv4RegexA =
+ /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
+const ipv4RegexB =
+ /^(?:(?:(?=(25[0-5]))\1|(?=(2[0-4][0-9]))\2|(?=(1[0-9]{2}))\3|(?=([0-9]{1,2}))\4)\.){3}(?:(?=(25[0-5]))\5|(?=(2[0-4][0-9]))\6|(?=(1[0-9]{2}))\7|(?=([0-9]{1,2}))\8)$/;
+const ipv4RegexC = /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;
+const ipv4RegexD = /^(\b25[0-5]|\b2[0-4][0-9]|\b[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/;
+const ipv4RegexE = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.){3}(25[0-5]|(2[0-4]|1\d|[1-9]|)\d)$/;
+const ipv4RegexF = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/;
+const ipv4RegexG = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/;
+const ipv4RegexH = /^((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(\.(?!$)|$)){4}$/;
+const ipv4RegexI =
+ /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
+
+suite
+ .add("A", () => {
+ return ipv4RegexA.test(DATA);
+ })
+ .add("B", () => {
+ return ipv4RegexB.test(DATA);
+ })
+ .add("C", () => {
+ return ipv4RegexC.test(DATA);
+ })
+ .add("D", () => {
+ return ipv4RegexD.test(DATA);
+ })
+ .add("E", () => {
+ return ipv4RegexE.test(DATA);
+ })
+ .add("F", () => {
+ return ipv4RegexF.test(DATA);
+ })
+ .add("G", () => {
+ return ipv4RegexG.test(DATA);
+ })
+ .add("H", () => {
+ return ipv4RegexH.test(DATA);
+ })
+ .add("I", () => {
+ return ipv4RegexI.test(DATA);
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`${suite.name!}: ${e.target}`);
+ });
+
+export default {
+ suites: [suite],
+};
+
+if (require.main === module) {
+ suite.run();
+}
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/object.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/object.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3c1da1022a6e049fe7a6fb6d4fd5cfa5da10d538
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/object.ts
@@ -0,0 +1,69 @@
+import Benchmark from "benchmark";
+
+import { z } from "zod/v3";
+
+const emptySuite = new Benchmark.Suite("z.object: empty");
+const shortSuite = new Benchmark.Suite("z.object: short");
+const longSuite = new Benchmark.Suite("z.object: long");
+
+const empty = z.object({});
+const short = z.object({
+ string: z.string(),
+});
+const long = z.object({
+ string: z.string(),
+ number: z.number(),
+ boolean: z.boolean(),
+});
+
+emptySuite
+ .add("valid", () => {
+ empty.parse({});
+ })
+ .add("valid: extra keys", () => {
+ empty.parse({ string: "string" });
+ })
+ .add("invalid: null", () => {
+ try {
+ empty.parse(null);
+ } catch (_err) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`${(emptySuite as any).name}: ${e.target}`);
+ });
+
+shortSuite
+ .add("valid", () => {
+ short.parse({ string: "string" });
+ })
+ .add("valid: extra keys", () => {
+ short.parse({ string: "string", number: 42 });
+ })
+ .add("invalid: null", () => {
+ try {
+ short.parse(null);
+ } catch (_err) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`${(shortSuite as any).name}: ${e.target}`);
+ });
+
+longSuite
+ .add("valid", () => {
+ long.parse({ string: "string", number: 42, boolean: true });
+ })
+ .add("valid: extra keys", () => {
+ long.parse({ string: "string", number: 42, boolean: true, list: [] });
+ })
+ .add("invalid: null", () => {
+ try {
+ long.parse(null);
+ } catch (_err) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`${(longSuite as any).name}: ${e.target}`);
+ });
+
+export default {
+ suites: [emptySuite, shortSuite, longSuite],
+};
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/primitives.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/primitives.ts
new file mode 100644
index 0000000000000000000000000000000000000000..fd61b38fefe0b9c31aa69f5ed247ef2d6dd88cb5
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/primitives.ts
@@ -0,0 +1,162 @@
+import Benchmark from "benchmark";
+
+import { z } from "zod/v3";
+import { Mocker } from "../tests/Mocker.js";
+
+const val = new Mocker();
+
+const enumSuite = new Benchmark.Suite("z.enum");
+const enumSchema = z.enum(["a", "b", "c"]);
+
+enumSuite
+ .add("valid", () => {
+ enumSchema.parse("a");
+ })
+ .add("invalid", () => {
+ try {
+ enumSchema.parse("x");
+ } catch (_e: any) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`z.enum: ${e.target}`);
+ });
+
+const longEnumSuite = new Benchmark.Suite("long z.enum");
+const longEnumSchema = z.enum([
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "ten",
+ "eleven",
+ "twelve",
+ "thirteen",
+ "fourteen",
+ "fifteen",
+ "sixteen",
+ "seventeen",
+]);
+
+longEnumSuite
+ .add("valid", () => {
+ longEnumSchema.parse("five");
+ })
+ .add("invalid", () => {
+ try {
+ longEnumSchema.parse("invalid");
+ } catch (_e: any) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`long z.enum: ${e.target}`);
+ });
+
+const undefinedSuite = new Benchmark.Suite("z.undefined");
+const undefinedSchema = z.undefined();
+
+undefinedSuite
+ .add("valid", () => {
+ undefinedSchema.parse(undefined);
+ })
+ .add("invalid", () => {
+ try {
+ undefinedSchema.parse(1);
+ } catch (_e: any) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`z.undefined: ${e.target}`);
+ });
+
+const literalSuite = new Benchmark.Suite("z.literal");
+const short = "short";
+const bad = "bad";
+const literalSchema = z.literal("short");
+
+literalSuite
+ .add("valid", () => {
+ literalSchema.parse(short);
+ })
+ .add("invalid", () => {
+ try {
+ literalSchema.parse(bad);
+ } catch (_e: any) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`z.literal: ${e.target}`);
+ });
+
+const numberSuite = new Benchmark.Suite("z.number");
+const numberSchema = z.number().int();
+
+numberSuite
+ .add("valid", () => {
+ numberSchema.parse(1);
+ })
+ .add("invalid type", () => {
+ try {
+ numberSchema.parse("bad");
+ } catch (_e: any) {}
+ })
+ .add("invalid number", () => {
+ try {
+ numberSchema.parse(0.5);
+ } catch (_e: any) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`z.number: ${e.target}`);
+ });
+
+const dateSuite = new Benchmark.Suite("z.date");
+
+const plainDate = z.date();
+const minMaxDate = z.date().min(new Date("2021-01-01")).max(new Date("2030-01-01"));
+
+dateSuite
+ .add("valid", () => {
+ plainDate.parse(new Date());
+ })
+ .add("invalid", () => {
+ try {
+ plainDate.parse(1);
+ } catch (_e: any) {}
+ })
+ .add("valid min and max", () => {
+ minMaxDate.parse(new Date("2023-01-01"));
+ })
+ .add("invalid min", () => {
+ try {
+ minMaxDate.parse(new Date("2019-01-01"));
+ } catch (_e: any) {}
+ })
+ .add("invalid max", () => {
+ try {
+ minMaxDate.parse(new Date("2031-01-01"));
+ } catch (_e: any) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`z.date: ${e.target}`);
+ });
+
+const symbolSuite = new Benchmark.Suite("z.symbol");
+const symbolSchema = z.symbol();
+
+symbolSuite
+ .add("valid", () => {
+ symbolSchema.parse(val.symbol);
+ })
+ .add("invalid", () => {
+ try {
+ symbolSchema.parse(1);
+ } catch (_e: any) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`z.symbol: ${e.target}`);
+ });
+
+export default {
+ suites: [enumSuite, longEnumSuite, undefinedSuite, literalSuite, numberSuite, dateSuite, symbolSuite],
+};
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/realworld.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/realworld.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d64c4f0d0986a4d0ce7b2c6cd394b65fab1ee7d5
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/realworld.ts
@@ -0,0 +1,63 @@
+import Benchmark from "benchmark";
+
+import { z } from "zod/v3";
+
+const shortSuite = new Benchmark.Suite("realworld");
+
+const People = z.array(
+ z.object({
+ type: z.literal("person"),
+ hair: z.enum(["blue", "brown"]),
+ active: z.boolean(),
+ name: z.string(),
+ age: z.number().int(),
+ hobbies: z.array(z.string()),
+ address: z.object({
+ street: z.string(),
+ zip: z.string(),
+ country: z.string(),
+ }),
+ })
+);
+
+let i = 0;
+
+function num() {
+ return ++i;
+}
+
+function str() {
+ return (++i % 100).toString(16);
+}
+
+function array(fn: () => T): T[] {
+ return Array.from({ length: ++i % 10 }, () => fn());
+}
+
+const people = Array.from({ length: 100 }, () => {
+ return {
+ type: "person",
+ hair: i % 2 ? "blue" : "brown",
+ active: !!(i % 2),
+ name: str(),
+ age: num(),
+ hobbies: array(str),
+ address: {
+ street: str(),
+ zip: str(),
+ country: str(),
+ },
+ };
+});
+
+shortSuite
+ .add("valid", () => {
+ People.parse(people);
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`${(shortSuite as any).name}: ${e.target}`);
+ });
+
+export default {
+ suites: [shortSuite],
+};
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/string.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/string.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6b3d29f94083571f7693a615849758cac5ef8b7f
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/string.ts
@@ -0,0 +1,55 @@
+import Benchmark from "benchmark";
+
+import { z } from "zod/v3";
+
+const SUITE_NAME = "z.string";
+const suite = new Benchmark.Suite(SUITE_NAME);
+
+const empty = "";
+const short = "short";
+const long = "long".repeat(256);
+const manual = (str: unknown) => {
+ if (typeof str !== "string") {
+ throw new Error("Not a string");
+ }
+
+ return str;
+};
+const stringSchema = z.string();
+const optionalStringSchema = z.string().optional();
+const optionalNullableStringSchema = z.string().optional().nullable();
+
+suite
+ .add("empty string", () => {
+ stringSchema.parse(empty);
+ })
+ .add("short string", () => {
+ stringSchema.parse(short);
+ })
+ .add("long string", () => {
+ stringSchema.parse(long);
+ })
+ .add("optional string", () => {
+ optionalStringSchema.parse(long);
+ })
+ .add("nullable string", () => {
+ optionalNullableStringSchema.parse(long);
+ })
+ .add("nullable (null) string", () => {
+ optionalNullableStringSchema.parse(null);
+ })
+ .add("invalid: null", () => {
+ try {
+ stringSchema.parse(null);
+ } catch (_err) {}
+ })
+ .add("manual parser: long", () => {
+ manual(long);
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`${SUITE_NAME}: ${e.target}`);
+ });
+
+export default {
+ suites: [suite],
+};
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/union.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/union.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d716dcef0eb61e1b94ea9b71ee20c093913c2327
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/benchmarks/union.ts
@@ -0,0 +1,80 @@
+import Benchmark from "benchmark";
+
+import { z } from "zod/v3";
+
+const doubleSuite = new Benchmark.Suite("z.union: double");
+const manySuite = new Benchmark.Suite("z.union: many");
+
+const aSchema = z.object({
+ type: z.literal("a"),
+});
+const objA = {
+ type: "a",
+};
+
+const bSchema = z.object({
+ type: z.literal("b"),
+});
+const objB = {
+ type: "b",
+};
+
+const cSchema = z.object({
+ type: z.literal("c"),
+});
+const objC = {
+ type: "c",
+};
+
+const dSchema = z.object({
+ type: z.literal("d"),
+});
+
+const double = z.union([aSchema, bSchema]);
+const many = z.union([aSchema, bSchema, cSchema, dSchema]);
+
+doubleSuite
+ .add("valid: a", () => {
+ double.parse(objA);
+ })
+ .add("valid: b", () => {
+ double.parse(objB);
+ })
+ .add("invalid: null", () => {
+ try {
+ double.parse(null);
+ } catch (_err) {}
+ })
+ .add("invalid: wrong shape", () => {
+ try {
+ double.parse(objC);
+ } catch (_err) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`${(doubleSuite as any).name}: ${e.target}`);
+ });
+
+manySuite
+ .add("valid: a", () => {
+ many.parse(objA);
+ })
+ .add("valid: c", () => {
+ many.parse(objC);
+ })
+ .add("invalid: null", () => {
+ try {
+ many.parse(null);
+ } catch (_err) {}
+ })
+ .add("invalid: wrong shape", () => {
+ try {
+ many.parse({ type: "unknown" });
+ } catch (_err) {}
+ })
+ .on("cycle", (e: Benchmark.Event) => {
+ console.log(`${(manySuite as any).name}: ${e.target}`);
+ });
+
+export default {
+ suites: [doubleSuite, manySuite],
+};
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/errors.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/errors.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3c0dae65964dc95c61870d9b28de67b97d6a94fa
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/errors.ts
@@ -0,0 +1,13 @@
+import type { ZodErrorMap } from "./ZodError.js";
+import defaultErrorMap from "./locales/en.js";
+
+let overrideErrorMap = defaultErrorMap;
+export { defaultErrorMap };
+
+export function setErrorMap(map: ZodErrorMap) {
+ overrideErrorMap = map;
+}
+
+export function getErrorMap() {
+ return overrideErrorMap;
+}
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/external.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/external.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f0a4be4c7aa63b363b654384b103396050a06e29
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/external.ts
@@ -0,0 +1,6 @@
+export * from "./errors.js";
+export * from "./helpers/parseUtil.js";
+export * from "./helpers/typeAliases.js";
+export * from "./helpers/util.js";
+export * from "./types.js";
+export * from "./ZodError.js";
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/enumUtil.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/enumUtil.ts
new file mode 100644
index 0000000000000000000000000000000000000000..526b22736af39391898dd888762d2eabe6ed5e04
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/enumUtil.ts
@@ -0,0 +1,17 @@
+export namespace enumUtil {
+ type UnionToIntersectionFn = (T extends unknown ? (k: () => T) => void : never) extends (
+ k: infer Intersection
+ ) => void
+ ? Intersection
+ : never;
+
+ type GetUnionLast = UnionToIntersectionFn extends () => infer Last ? Last : never;
+
+ type UnionToTuple = [T] extends [never]
+ ? Tuple
+ : UnionToTuple>, [GetUnionLast, ...Tuple]>;
+
+ type CastToStringTuple = T extends [string, ...string[]] ? T : never;
+
+ export type UnionToTupleString = CastToStringTuple>;
+}
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/errorUtil.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/errorUtil.ts
new file mode 100644
index 0000000000000000000000000000000000000000..319ef6b74c8fd0ffee2fe8ea60edc3d8bada9d0a
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/errorUtil.ts
@@ -0,0 +1,8 @@
+export namespace errorUtil {
+ export type ErrMessage = string | { message?: string | undefined };
+ export const errToObj = (message?: ErrMessage): { message?: string | undefined } =>
+ typeof message === "string" ? { message } : message || {};
+ // biome-ignore lint:
+ export const toString = (message?: ErrMessage): string | undefined =>
+ typeof message === "string" ? message : message?.message;
+}
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/parseUtil.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/parseUtil.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1076ad9de1418b0fee118cd210f041060a1e132a
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/parseUtil.ts
@@ -0,0 +1,176 @@
+import type { IssueData, ZodErrorMap, ZodIssue } from "../ZodError.js";
+import { getErrorMap } from "../errors.js";
+import defaultErrorMap from "../locales/en.js";
+import type { ZodParsedType } from "./util.js";
+
+export const makeIssue = (params: {
+ data: any;
+ path: (string | number)[];
+ errorMaps: ZodErrorMap[];
+ issueData: IssueData;
+}): ZodIssue => {
+ const { data, path, errorMaps, issueData } = params;
+ const fullPath = [...path, ...(issueData.path || [])];
+ const fullIssue = {
+ ...issueData,
+ path: fullPath,
+ };
+
+ if (issueData.message !== undefined) {
+ return {
+ ...issueData,
+ path: fullPath,
+ message: issueData.message,
+ };
+ }
+
+ let errorMessage = "";
+ const maps = errorMaps
+ .filter((m) => !!m)
+ .slice()
+ .reverse();
+ for (const map of maps) {
+ errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
+ }
+
+ return {
+ ...issueData,
+ path: fullPath,
+ message: errorMessage,
+ };
+};
+
+export type ParseParams = {
+ path: (string | number)[];
+ errorMap: ZodErrorMap;
+ async: boolean;
+};
+
+export type ParsePathComponent = string | number;
+export type ParsePath = ParsePathComponent[];
+export const EMPTY_PATH: ParsePath = [];
+
+export interface ParseContext {
+ readonly common: {
+ readonly issues: ZodIssue[];
+ readonly contextualErrorMap?: ZodErrorMap | undefined;
+ readonly async: boolean;
+ };
+ readonly path: ParsePath;
+ readonly schemaErrorMap?: ZodErrorMap | undefined;
+ readonly parent: ParseContext | null;
+ readonly data: any;
+ readonly parsedType: ZodParsedType;
+}
+
+export type ParseInput = {
+ data: any;
+ path: (string | number)[];
+ parent: ParseContext;
+};
+
+export function addIssueToContext(ctx: ParseContext, issueData: IssueData): void {
+ const overrideMap = getErrorMap();
+ const issue = makeIssue({
+ issueData: issueData,
+ data: ctx.data,
+ path: ctx.path,
+ errorMaps: [
+ ctx.common.contextualErrorMap, // contextual error map is first priority
+ ctx.schemaErrorMap, // then schema-bound map if available
+ overrideMap, // then global override map
+ overrideMap === defaultErrorMap ? undefined : defaultErrorMap, // then global default map
+ ].filter((x) => !!x),
+ });
+ ctx.common.issues.push(issue);
+}
+
+export type ObjectPair = {
+ key: SyncParseReturnType;
+ value: SyncParseReturnType;
+};
+export class ParseStatus {
+ value: "aborted" | "dirty" | "valid" = "valid";
+ dirty(): void {
+ if (this.value === "valid") this.value = "dirty";
+ }
+ abort(): void {
+ if (this.value !== "aborted") this.value = "aborted";
+ }
+
+ static mergeArray(status: ParseStatus, results: SyncParseReturnType[]): SyncParseReturnType {
+ const arrayValue: any[] = [];
+ for (const s of results) {
+ if (s.status === "aborted") return INVALID;
+ if (s.status === "dirty") status.dirty();
+ arrayValue.push(s.value);
+ }
+
+ return { status: status.value, value: arrayValue };
+ }
+
+ static async mergeObjectAsync(
+ status: ParseStatus,
+ pairs: { key: ParseReturnType; value: ParseReturnType }[]
+ ): Promise> {
+ const syncPairs: ObjectPair[] = [];
+ for (const pair of pairs) {
+ const key = await pair.key;
+ const value = await pair.value;
+ syncPairs.push({
+ key,
+ value,
+ });
+ }
+ return ParseStatus.mergeObjectSync(status, syncPairs);
+ }
+
+ static mergeObjectSync(
+ status: ParseStatus,
+ pairs: {
+ key: SyncParseReturnType;
+ value: SyncParseReturnType;
+ alwaysSet?: boolean;
+ }[]
+ ): SyncParseReturnType {
+ const finalObject: any = {};
+ for (const pair of pairs) {
+ const { key, value } = pair;
+ if (key.status === "aborted") return INVALID;
+ if (value.status === "aborted") return INVALID;
+ if (key.status === "dirty") status.dirty();
+ if (value.status === "dirty") status.dirty();
+
+ if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
+ finalObject[key.value] = value.value;
+ }
+ }
+
+ return { status: status.value, value: finalObject };
+ }
+}
+export interface ParseResult {
+ status: "aborted" | "dirty" | "valid";
+ data: any;
+}
+
+export type INVALID = { status: "aborted" };
+export const INVALID: INVALID = Object.freeze({
+ status: "aborted",
+});
+
+export type DIRTY = { status: "dirty"; value: T };
+export const DIRTY = (value: T): DIRTY => ({ status: "dirty", value });
+
+export type OK = { status: "valid"; value: T };
+export const OK = (value: T): OK => ({ status: "valid", value });
+
+export type SyncParseReturnType = OK | DIRTY | INVALID;
+export type AsyncParseReturnType = Promise>;
+export type ParseReturnType = SyncParseReturnType | AsyncParseReturnType;
+
+export const isAborted = (x: ParseReturnType): x is INVALID => (x as any).status === "aborted";
+export const isDirty = (x: ParseReturnType): x is OK | DIRTY => (x as any).status === "dirty";
+export const isValid = (x: ParseReturnType): x is OK => (x as any).status === "valid";
+export const isAsync = (x: ParseReturnType): x is AsyncParseReturnType =>
+ typeof Promise !== "undefined" && x instanceof Promise;
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/partialUtil.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/partialUtil.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0eff8ff34ca6b96f41383ef554752e9f9fda6db9
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/partialUtil.ts
@@ -0,0 +1,34 @@
+import type {
+ ZodArray,
+ ZodNullable,
+ ZodObject,
+ ZodOptional,
+ ZodRawShape,
+ ZodTuple,
+ ZodTupleItems,
+ ZodTypeAny,
+} from "../types.js";
+
+export namespace partialUtil {
+ export type DeepPartial = T extends ZodObject
+ ? ZodObject<
+ { [k in keyof T["shape"]]: ZodOptional> },
+ T["_def"]["unknownKeys"],
+ T["_def"]["catchall"]
+ >
+ : T extends ZodArray
+ ? ZodArray, Card>
+ : T extends ZodOptional
+ ? ZodOptional>
+ : T extends ZodNullable
+ ? ZodNullable>
+ : T extends ZodTuple
+ ? {
+ [k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial : never;
+ } extends infer PI
+ ? PI extends ZodTupleItems
+ ? ZodTuple
+ : never
+ : never
+ : T;
+}
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/typeAliases.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/typeAliases.ts
new file mode 100644
index 0000000000000000000000000000000000000000..32df022ca3b929528dace9023f77212204324422
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/typeAliases.ts
@@ -0,0 +1,2 @@
+export type Primitive = string | number | symbol | bigint | boolean | null | undefined;
+export type Scalars = Primitive | Primitive[];
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/util.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/util.ts
new file mode 100644
index 0000000000000000000000000000000000000000..030ea821b694ed03e210b418c8742c7a535ac816
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/helpers/util.ts
@@ -0,0 +1,224 @@
+export namespace util {
+ type AssertEqual = (() => V extends T ? 1 : 2) extends () => V extends U ? 1 : 2 ? true : false;
+
+ export type isAny = 0 extends 1 & T ? true : false;
+ export const assertEqual = (_: AssertEqual ): void => {};
+ export function assertIs(_arg: T): void {}
+ export function assertNever(_x: never): never {
+ throw new Error();
+ }
+
+ export type Omit = Pick>;
+ export type OmitKeys = Pick>;
+ export type MakePartial = Omit & Partial>;
+ export type Exactly = T & Record, never>;
+ export type InexactPartial = { [k in keyof T]?: T[k] | undefined };
+ export const arrayToEnum = (items: U): { [k in U[number]]: k } => {
+ const obj: any = {};
+ for (const item of items) {
+ obj[item] = item;
+ }
+ return obj;
+ };
+
+ export const getValidEnumValues = (obj: any): any[] => {
+ const validKeys = objectKeys(obj).filter((k: any) => typeof obj[obj[k]] !== "number");
+ const filtered: any = {};
+ for (const k of validKeys) {
+ filtered[k] = obj[k];
+ }
+ return objectValues(filtered);
+ };
+
+ export const objectValues = (obj: any): any[] => {
+ return objectKeys(obj).map(function (e) {
+ return obj[e];
+ });
+ };
+
+ export const objectKeys: ObjectConstructor["keys"] =
+ typeof Object.keys === "function" // eslint-disable-line ban/ban
+ ? (obj: any) => Object.keys(obj) // eslint-disable-line ban/ban
+ : (object: any) => {
+ const keys = [];
+ for (const key in object) {
+ if (Object.prototype.hasOwnProperty.call(object, key)) {
+ keys.push(key);
+ }
+ }
+ return keys;
+ };
+
+ export const find = (arr: T[], checker: (arg: T) => any): T | undefined => {
+ for (const item of arr) {
+ if (checker(item)) return item;
+ }
+ return undefined;
+ };
+
+ export type identity = objectUtil.identity;
+ export type flatten = objectUtil.flatten;
+
+ export type noUndefined = T extends undefined ? never : T;
+
+ export const isInteger: NumberConstructor["isInteger"] =
+ typeof Number.isInteger === "function"
+ ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban
+ : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
+
+ export function joinValues(array: T, separator = " | "): string {
+ return array.map((val) => (typeof val === "string" ? `'${val}'` : val)).join(separator);
+ }
+
+ export const jsonStringifyReplacer = (_: string, value: any): any => {
+ if (typeof value === "bigint") {
+ return value.toString();
+ }
+ return value;
+ };
+}
+
+export namespace objectUtil {
+ export type MergeShapes =
+ // fast path when there is no keys overlap
+ keyof U & keyof V extends never
+ ? U & V
+ : {
+ [k in Exclude]: U[k];
+ } & V;
+
+ type optionalKeys = {
+ [k in keyof T]: undefined extends T[k] ? k : never;
+ }[keyof T];
+ type requiredKeys = {
+ [k in keyof T]: undefined extends T[k] ? never : k;
+ }[keyof T];
+ export type addQuestionMarks = {
+ [K in requiredKeys]: T[K];
+ } & {
+ [K in optionalKeys]?: T[K];
+ } & { [k in keyof T]?: unknown };
+
+ export type identity = T;
+ export type flatten = identity<{ [k in keyof T]: T[k] }>;
+
+ export type noNeverKeys = {
+ [k in keyof T]: [T[k]] extends [never] ? never : k;
+ }[keyof T];
+
+ export type noNever = identity<{
+ [k in noNeverKeys]: k extends keyof T ? T[k] : never;
+ }>;
+
+ export const mergeShapes = (first: U, second: T): T & U => {
+ return {
+ ...first,
+ ...second, // second overwrites first
+ };
+ };
+
+ export type extendShape = keyof A & keyof B extends never // fast path when there is no keys overlap
+ ? A & B
+ : {
+ [K in keyof A as K extends keyof B ? never : K]: A[K];
+ } & {
+ [K in keyof B]: B[K];
+ };
+}
+
+export const ZodParsedType: {
+ string: "string";
+ nan: "nan";
+ number: "number";
+ integer: "integer";
+ float: "float";
+ boolean: "boolean";
+ date: "date";
+ bigint: "bigint";
+ symbol: "symbol";
+ function: "function";
+ undefined: "undefined";
+ null: "null";
+ array: "array";
+ object: "object";
+ unknown: "unknown";
+ promise: "promise";
+ void: "void";
+ never: "never";
+ map: "map";
+ set: "set";
+} = util.arrayToEnum([
+ "string",
+ "nan",
+ "number",
+ "integer",
+ "float",
+ "boolean",
+ "date",
+ "bigint",
+ "symbol",
+ "function",
+ "undefined",
+ "null",
+ "array",
+ "object",
+ "unknown",
+ "promise",
+ "void",
+ "never",
+ "map",
+ "set",
+]);
+
+export type ZodParsedType = keyof typeof ZodParsedType;
+
+export const getParsedType = (data: any): ZodParsedType => {
+ const t = typeof data;
+
+ switch (t) {
+ case "undefined":
+ return ZodParsedType.undefined;
+
+ case "string":
+ return ZodParsedType.string;
+
+ case "number":
+ return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
+
+ case "boolean":
+ return ZodParsedType.boolean;
+
+ case "function":
+ return ZodParsedType.function;
+
+ case "bigint":
+ return ZodParsedType.bigint;
+
+ case "symbol":
+ return ZodParsedType.symbol;
+
+ case "object":
+ if (Array.isArray(data)) {
+ return ZodParsedType.array;
+ }
+ if (data === null) {
+ return ZodParsedType.null;
+ }
+ if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
+ return ZodParsedType.promise;
+ }
+ if (typeof Map !== "undefined" && data instanceof Map) {
+ return ZodParsedType.map;
+ }
+ if (typeof Set !== "undefined" && data instanceof Set) {
+ return ZodParsedType.set;
+ }
+ if (typeof Date !== "undefined" && data instanceof Date) {
+ return ZodParsedType.date;
+ }
+ return ZodParsedType.object;
+
+ default:
+ return ZodParsedType.unknown;
+ }
+};
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/index.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a9dab57383baf1f27b9531f2dafc7a48c3dc4f81
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/index.ts
@@ -0,0 +1,4 @@
+import * as z from "./external.js";
+export * from "./external.js";
+export { z };
+export default z;
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/locales/en.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/locales/en.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0264f82ef2e381ed4e855932c1992a10da28b015
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/locales/en.ts
@@ -0,0 +1,124 @@
+import { type ZodErrorMap, ZodIssueCode } from "../ZodError.js";
+import { util, ZodParsedType } from "../helpers/util.js";
+
+const errorMap: ZodErrorMap = (issue, _ctx) => {
+ let message: string;
+ switch (issue.code) {
+ case ZodIssueCode.invalid_type:
+ if (issue.received === ZodParsedType.undefined) {
+ message = "Required";
+ } else {
+ message = `Expected ${issue.expected}, received ${issue.received}`;
+ }
+ break;
+ case ZodIssueCode.invalid_literal:
+ message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
+ break;
+ case ZodIssueCode.unrecognized_keys:
+ message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
+ break;
+ case ZodIssueCode.invalid_union:
+ message = `Invalid input`;
+ break;
+ case ZodIssueCode.invalid_union_discriminator:
+ message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
+ break;
+ case ZodIssueCode.invalid_enum_value:
+ message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
+ break;
+ case ZodIssueCode.invalid_arguments:
+ message = `Invalid function arguments`;
+ break;
+ case ZodIssueCode.invalid_return_type:
+ message = `Invalid function return type`;
+ break;
+ case ZodIssueCode.invalid_date:
+ message = `Invalid date`;
+ break;
+ case ZodIssueCode.invalid_string:
+ if (typeof issue.validation === "object") {
+ if ("includes" in issue.validation) {
+ message = `Invalid input: must include "${issue.validation.includes}"`;
+
+ if (typeof issue.validation.position === "number") {
+ message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
+ }
+ } else if ("startsWith" in issue.validation) {
+ message = `Invalid input: must start with "${issue.validation.startsWith}"`;
+ } else if ("endsWith" in issue.validation) {
+ message = `Invalid input: must end with "${issue.validation.endsWith}"`;
+ } else {
+ util.assertNever(issue.validation);
+ }
+ } else if (issue.validation !== "regex") {
+ message = `Invalid ${issue.validation}`;
+ } else {
+ message = "Invalid";
+ }
+ break;
+ case ZodIssueCode.too_small:
+ if (issue.type === "array")
+ message = `Array must contain ${
+ issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`
+ } ${issue.minimum} element(s)`;
+ else if (issue.type === "string")
+ message = `String must contain ${
+ issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`
+ } ${issue.minimum} character(s)`;
+ else if (issue.type === "number")
+ message = `Number must be ${
+ issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `
+ }${issue.minimum}`;
+ else if (issue.type === "bigint")
+ message = `Number must be ${
+ issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `
+ }${issue.minimum}`;
+ else if (issue.type === "date")
+ message = `Date must be ${
+ issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `
+ }${new Date(Number(issue.minimum))}`;
+ else message = "Invalid input";
+ break;
+ case ZodIssueCode.too_big:
+ if (issue.type === "array")
+ message = `Array must contain ${
+ issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`
+ } ${issue.maximum} element(s)`;
+ else if (issue.type === "string")
+ message = `String must contain ${
+ issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`
+ } ${issue.maximum} character(s)`;
+ else if (issue.type === "number")
+ message = `Number must be ${
+ issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`
+ } ${issue.maximum}`;
+ else if (issue.type === "bigint")
+ message = `BigInt must be ${
+ issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`
+ } ${issue.maximum}`;
+ else if (issue.type === "date")
+ message = `Date must be ${
+ issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`
+ } ${new Date(Number(issue.maximum))}`;
+ else message = "Invalid input";
+ break;
+ case ZodIssueCode.custom:
+ message = `Invalid input`;
+ break;
+ case ZodIssueCode.invalid_intersection_types:
+ message = `Intersection results could not be merged`;
+ break;
+ case ZodIssueCode.not_multiple_of:
+ message = `Number must be a multiple of ${issue.multipleOf}`;
+ break;
+ case ZodIssueCode.not_finite:
+ message = "Number must be finite";
+ break;
+ default:
+ message = _ctx.defaultError;
+ util.assertNever(issue);
+ }
+ return { message };
+};
+
+export default errorMap;
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/standard-schema.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/standard-schema.ts
new file mode 100644
index 0000000000000000000000000000000000000000..07193fd135b70d85ed46a806faf921fea9370ad3
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/standard-schema.ts
@@ -0,0 +1,113 @@
+/**
+ * The Standard Schema interface.
+ */
+export type StandardSchemaV1 = {
+ /**
+ * The Standard Schema properties.
+ */
+ readonly "~standard": StandardSchemaV1.Props ;
+};
+
+export declare namespace StandardSchemaV1 {
+ /**
+ * The Standard Schema properties interface.
+ */
+ export interface Props {
+ /**
+ * The version number of the standard.
+ */
+ readonly version: 1;
+ /**
+ * The vendor name of the schema library.
+ */
+ readonly vendor: string;
+ /**
+ * Validates unknown input values.
+ */
+ readonly validate: (value: unknown) => Result | Promise>;
+ /**
+ * Inferred types associated with the schema.
+ */
+ readonly types?: Types | undefined;
+ }
+
+ /**
+ * The result interface of the validate function.
+ */
+ export type Result = SuccessResult | FailureResult;
+
+ /**
+ * The result interface if validation succeeds.
+ */
+ export interface SuccessResult {
+ /**
+ * The typed output value.
+ */
+ readonly value: Output;
+ /**
+ * The non-existent issues.
+ */
+ readonly issues?: undefined;
+ }
+
+ /**
+ * The result interface if validation fails.
+ */
+ export interface FailureResult {
+ /**
+ * The issues of failed validation.
+ */
+ readonly issues: ReadonlyArray;
+ }
+
+ /**
+ * The issue interface of the failure output.
+ */
+ export interface Issue {
+ /**
+ * The error message of the issue.
+ */
+ readonly message: string;
+ /**
+ * The path of the issue, if any.
+ */
+ readonly path?: ReadonlyArray | undefined;
+ }
+
+ /**
+ * The path segment interface of the issue.
+ */
+ export interface PathSegment {
+ /**
+ * The key representing a path segment.
+ */
+ readonly key: PropertyKey;
+ }
+
+ /**
+ * The Standard Schema types interface.
+ */
+ export interface Types {
+ /**
+ * The input type of the schema.
+ */
+ readonly input: Input;
+ /**
+ * The output type of the schema.
+ */
+ readonly output: Output;
+ }
+
+ /**
+ * Infers the input type of a Standard Schema.
+ */
+ export type InferInput = NonNullable["input"];
+
+ /**
+ * Infers the output type of a Standard Schema.
+ */
+ export type InferOutput = NonNullable["output"];
+
+ // biome-ignore lint/complexity/noUselessEmptyExport: needed for granular visibility control of TS namespace
+ export {};
+}
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/Mocker.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/Mocker.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c9fbdd51a5aecd3fc18b2c8e3b7fbf362e30ee60
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/Mocker.ts
@@ -0,0 +1,54 @@
+function getRandomInt(max: number) {
+ return Math.floor(Math.random() * Math.floor(max));
+}
+
+const testSymbol = Symbol("test");
+
+export class Mocker {
+ pick = (...args: any[]): any => {
+ return args[getRandomInt(args.length)];
+ };
+
+ get string(): string {
+ return Math.random().toString(36).substring(7);
+ }
+ get number(): number {
+ return Math.random() * 100;
+ }
+ get bigint(): bigint {
+ return BigInt(Math.floor(Math.random() * 10000));
+ }
+ get boolean(): boolean {
+ return Math.random() < 0.5;
+ }
+ get date(): Date {
+ return new Date(Math.floor(Date.now() * Math.random()));
+ }
+ get symbol(): symbol {
+ return testSymbol;
+ }
+ get null(): null {
+ return null;
+ }
+ get undefined(): undefined {
+ return undefined;
+ }
+ get stringOptional(): string | undefined {
+ return this.pick(this.string, this.undefined);
+ }
+ get stringNullable(): string | null {
+ return this.pick(this.string, this.null);
+ }
+ get numberOptional(): number | undefined {
+ return this.pick(this.number, this.undefined);
+ }
+ get numberNullable(): number | null {
+ return this.pick(this.number, this.null);
+ }
+ get booleanOptional(): boolean | undefined {
+ return this.pick(this.boolean, this.undefined);
+ }
+ get booleanNullable(): boolean | null {
+ return this.pick(this.boolean, this.null);
+ }
+}
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/all-errors.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/all-errors.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8fdf8f42688de42dd29e13f66ff8f5a529dbe2ed
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/all-errors.test.ts
@@ -0,0 +1,157 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+import { util } from "../helpers/util.js";
+
+const Test = z.object({
+ f1: z.number(),
+ f2: z.string().optional(),
+ f3: z.string().nullable(),
+ f4: z.array(z.object({ t: z.union([z.string(), z.boolean()]) })),
+});
+type TestFlattenedErrors = z.inferFlattenedErrors;
+type TestFormErrors = z.inferFlattenedErrors;
+
+test("default flattened errors type inference", () => {
+ type TestTypeErrors = {
+ formErrors: string[];
+ fieldErrors: { [P in keyof z.TypeOf]?: string[] | undefined };
+ };
+
+ util.assertEqual, TestTypeErrors>(true);
+ util.assertEqual, TestTypeErrors>(false);
+});
+
+test("custom flattened errors type inference", () => {
+ type ErrorType = { message: string; code: number };
+ type TestTypeErrors = {
+ formErrors: ErrorType[];
+ fieldErrors: {
+ [P in keyof z.TypeOf]?: ErrorType[] | undefined;
+ };
+ };
+
+ util.assertEqual, TestTypeErrors>(false);
+ util.assertEqual, TestTypeErrors>(true);
+ util.assertEqual, TestTypeErrors>(false);
+});
+
+test("form errors type inference", () => {
+ type TestTypeErrors = {
+ formErrors: string[];
+ fieldErrors: { [P in keyof z.TypeOf]?: string[] | undefined };
+ };
+
+ util.assertEqual, TestTypeErrors>(true);
+});
+
+test(".flatten() type assertion", () => {
+ const parsed = Test.safeParse({}) as z.SafeParseError;
+ const validFlattenedErrors: TestFlattenedErrors = parsed.error.flatten(() => ({ message: "", code: 0 }));
+ // @ts-expect-error should fail assertion between `TestFlattenedErrors` and unmapped `flatten()`.
+ const invalidFlattenedErrors: TestFlattenedErrors = parsed.error.flatten();
+ const validFormErrors: TestFormErrors = parsed.error.flatten();
+ // @ts-expect-error should fail assertion between `TestFormErrors` and mapped `flatten()`.
+ const invalidFormErrors: TestFormErrors = parsed.error.flatten(() => ({
+ message: "string",
+ code: 0,
+ }));
+
+ [validFlattenedErrors, invalidFlattenedErrors, validFormErrors, invalidFormErrors];
+});
+
+test(".formErrors type assertion", () => {
+ const parsed = Test.safeParse({}) as z.SafeParseError;
+ const validFormErrors: TestFormErrors = parsed.error.formErrors;
+ // @ts-expect-error should fail assertion between `TestFlattenedErrors` and `.formErrors`.
+ const invalidFlattenedErrors: TestFlattenedErrors = parsed.error.formErrors;
+
+ [validFormErrors, invalidFlattenedErrors];
+});
+
+test("all errors", () => {
+ const propertySchema = z.string();
+ const schema = z
+ .object({
+ a: propertySchema,
+ b: propertySchema,
+ })
+ .refine(
+ (val) => {
+ return val.a === val.b;
+ },
+ { message: "Must be equal" }
+ );
+
+ try {
+ schema.parse({
+ a: "asdf",
+ b: "qwer",
+ });
+ } catch (error) {
+ if (error instanceof z.ZodError) {
+ expect(error.flatten()).toEqual({
+ formErrors: ["Must be equal"],
+ fieldErrors: {},
+ });
+ }
+ }
+
+ try {
+ schema.parse({
+ a: null,
+ b: null,
+ });
+ } catch (_error) {
+ const error = _error as z.ZodError;
+ expect(error.flatten()).toEqual({
+ formErrors: [],
+ fieldErrors: {
+ a: ["Expected string, received null"],
+ b: ["Expected string, received null"],
+ },
+ });
+
+ expect(error.flatten((iss) => iss.message.toUpperCase())).toEqual({
+ formErrors: [],
+ fieldErrors: {
+ a: ["EXPECTED STRING, RECEIVED NULL"],
+ b: ["EXPECTED STRING, RECEIVED NULL"],
+ },
+ });
+ // Test identity
+
+ expect(error.flatten((i: z.ZodIssue) => i)).toEqual({
+ formErrors: [],
+ fieldErrors: {
+ a: [
+ {
+ code: "invalid_type",
+ expected: "string",
+ message: "Expected string, received null",
+ path: ["a"],
+ received: "null",
+ },
+ ],
+ b: [
+ {
+ code: "invalid_type",
+ expected: "string",
+ message: "Expected string, received null",
+ path: ["b"],
+ received: "null",
+ },
+ ],
+ },
+ });
+ // Test mapping
+ expect(error.flatten((i: z.ZodIssue) => i.message.length)).toEqual({
+ formErrors: [],
+ fieldErrors: {
+ a: ["Expected string, received null".length],
+ b: ["Expected string, received null".length],
+ },
+ });
+ }
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/anyunknown.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/anyunknown.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..49d07db2c8b3a4600a6f7eeb0f51e1ec27228d98
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/anyunknown.test.ts
@@ -0,0 +1,28 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+import { util } from "../helpers/util.js";
+
+test("check any inference", () => {
+ const t1 = z.any();
+ t1.optional();
+ t1.nullable();
+ type t1 = z.infer;
+ util.assertEqual(true);
+});
+
+test("check unknown inference", () => {
+ const t1 = z.unknown();
+ t1.optional();
+ t1.nullable();
+ type t1 = z.infer;
+ util.assertEqual(true);
+});
+
+test("check never inference", () => {
+ const t1 = z.never();
+ expect(() => t1.parse(undefined)).toThrow();
+ expect(() => t1.parse("asdf")).toThrow();
+ expect(() => t1.parse(null)).toThrow();
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/array.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/array.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..df5b9d373ce740719c95908d00c11038a939e06c
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/array.test.ts
@@ -0,0 +1,71 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+import { util } from "../helpers/util.js";
+
+const minTwo = z.string().array().min(2);
+const maxTwo = z.string().array().max(2);
+const justTwo = z.string().array().length(2);
+const intNum = z.string().array().nonempty();
+const nonEmptyMax = z.string().array().nonempty().max(2);
+
+type t1 = z.infer;
+util.assertEqual<[string, ...string[]], t1>(true);
+
+type t2 = z.infer;
+util.assertEqual(true);
+
+test("passing validations", () => {
+ minTwo.parse(["a", "a"]);
+ minTwo.parse(["a", "a", "a"]);
+ maxTwo.parse(["a", "a"]);
+ maxTwo.parse(["a"]);
+ justTwo.parse(["a", "a"]);
+ intNum.parse(["a"]);
+ nonEmptyMax.parse(["a"]);
+});
+
+test("failing validations", () => {
+ expect(() => minTwo.parse(["a"])).toThrow();
+ expect(() => maxTwo.parse(["a", "a", "a"])).toThrow();
+ expect(() => justTwo.parse(["a"])).toThrow();
+ expect(() => justTwo.parse(["a", "a", "a"])).toThrow();
+ expect(() => intNum.parse([])).toThrow();
+ expect(() => nonEmptyMax.parse([])).toThrow();
+ expect(() => nonEmptyMax.parse(["a", "a", "a"])).toThrow();
+});
+
+test("parse empty array in nonempty", () => {
+ expect(() =>
+ z
+ .array(z.string())
+ .nonempty()
+ .parse([] as any)
+ ).toThrow();
+});
+
+test("get element", () => {
+ justTwo.element.parse("asdf");
+ expect(() => justTwo.element.parse(12)).toThrow();
+});
+
+test("continue parsing despite array size error", () => {
+ const schema = z.object({
+ people: z.string().array().min(2),
+ });
+
+ const result = schema.safeParse({
+ people: [123],
+ });
+ expect(result.success).toEqual(false);
+ if (!result.success) {
+ expect(result.error.issues.length).toEqual(2);
+ }
+});
+
+test("parse should fail given sparse array", () => {
+ const schema = z.array(z.string()).nonempty().min(1).max(3);
+
+ expect(() => schema.parse(new Array(3))).toThrow();
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/async-parsing.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/async-parsing.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..01dbc4f1e1acee18b28771fedfef1eb0fc8e4928
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/async-parsing.test.ts
@@ -0,0 +1,388 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+
+/// string
+const stringSchema = z.string();
+
+test("string async parse", async () => {
+ const goodData = "XXX";
+ const badData = 12;
+
+ const goodResult = await stringSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await stringSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// number
+const numberSchema = z.number();
+test("number async parse", async () => {
+ const goodData = 1234.2353;
+ const badData = "1234";
+
+ const goodResult = await numberSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await numberSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// bigInt
+const bigIntSchema = z.bigint();
+test("bigInt async parse", async () => {
+ const goodData = BigInt(145);
+ const badData = 134;
+
+ const goodResult = await bigIntSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await bigIntSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// boolean
+const booleanSchema = z.boolean();
+test("boolean async parse", async () => {
+ const goodData = true;
+ const badData = 1;
+
+ const goodResult = await booleanSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await booleanSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// date
+const dateSchema = z.date();
+test("date async parse", async () => {
+ const goodData = new Date();
+ const badData = new Date().toISOString();
+
+ const goodResult = await dateSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await dateSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// undefined
+const undefinedSchema = z.undefined();
+test("undefined async parse", async () => {
+ const goodData = undefined;
+ const badData = "XXX";
+
+ const goodResult = await undefinedSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(undefined);
+
+ const badResult = await undefinedSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// null
+const nullSchema = z.null();
+test("null async parse", async () => {
+ const goodData = null;
+ const badData = undefined;
+
+ const goodResult = await nullSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await nullSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// any
+const anySchema = z.any();
+test("any async parse", async () => {
+ const goodData = [{}];
+ // const badData = 'XXX';
+
+ const goodResult = await anySchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ // const badResult = await anySchema.safeParseAsync(badData);
+ // expect(badResult.success).toBe(false);
+ // if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// unknown
+const unknownSchema = z.unknown();
+test("unknown async parse", async () => {
+ const goodData = ["asdf", 124, () => {}];
+ // const badData = 'XXX';
+
+ const goodResult = await unknownSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ // const badResult = await unknownSchema.safeParseAsync(badData);
+ // expect(badResult.success).toBe(false);
+ // if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// void
+const voidSchema = z.void();
+test("void async parse", async () => {
+ const goodData = undefined;
+ const badData = 0;
+
+ const goodResult = await voidSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await voidSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// array
+const arraySchema = z.array(z.string());
+test("array async parse", async () => {
+ const goodData = ["XXX"];
+ const badData = "XXX";
+
+ const goodResult = await arraySchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await arraySchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// object
+const objectSchema = z.object({ string: z.string() });
+test("object async parse", async () => {
+ const goodData = { string: "XXX" };
+ const badData = { string: 12 };
+
+ const goodResult = await objectSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await objectSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// union
+const unionSchema = z.union([z.string(), z.undefined()]);
+test("union async parse", async () => {
+ const goodData = undefined;
+ const badData = null;
+
+ const goodResult = await unionSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await unionSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// record
+const recordSchema = z.record(z.object({}));
+test("record async parse", async () => {
+ const goodData = { adsf: {}, asdf: {} };
+ const badData = [{}];
+
+ const goodResult = await recordSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await recordSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// function
+const functionSchema = z.function();
+test("function async parse", async () => {
+ const goodData = () => {};
+ const badData = "XXX";
+
+ const goodResult = await functionSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(typeof goodResult.data).toEqual("function");
+
+ const badResult = await functionSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// literal
+const literalSchema = z.literal("asdf");
+test("literal async parse", async () => {
+ const goodData = "asdf";
+ const badData = "asdff";
+
+ const goodResult = await literalSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await literalSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// enum
+const enumSchema = z.enum(["fish", "whale"]);
+test("enum async parse", async () => {
+ const goodData = "whale";
+ const badData = "leopard";
+
+ const goodResult = await enumSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await enumSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// nativeEnum
+enum nativeEnumTest {
+ asdf = "qwer",
+}
+// @ts-ignore
+const nativeEnumSchema = z.nativeEnum(nativeEnumTest);
+test("nativeEnum async parse", async () => {
+ const goodData = nativeEnumTest.asdf;
+ const badData = "asdf";
+
+ const goodResult = await nativeEnumSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) expect(goodResult.data).toEqual(goodData);
+
+ const badResult = await nativeEnumSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(false);
+ if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
+});
+
+/// promise
+const promiseSchema = z.promise(z.number());
+test("promise async parse good", async () => {
+ const goodData = Promise.resolve(123);
+
+ const goodResult = await promiseSchema.safeParseAsync(goodData);
+ expect(goodResult.success).toBe(true);
+ if (goodResult.success) {
+ expect(goodResult.data).toBeInstanceOf(Promise);
+ const data = await goodResult.data;
+ expect(data).toEqual(123);
+ // expect(goodResult.data).resolves.toEqual(124);
+ // return goodResult.data;
+ } else {
+ throw new Error("success should be true");
+ }
+});
+
+test("promise async parse bad", async () => {
+ const badData = Promise.resolve("XXX");
+ const badResult = await promiseSchema.safeParseAsync(badData);
+ expect(badResult.success).toBe(true);
+ if (badResult.success) {
+ await expect(badResult.data).rejects.toBeInstanceOf(z.ZodError);
+ } else {
+ throw new Error("success should be true");
+ }
+});
+
+test("async validation non-empty strings", async () => {
+ const base = z.object({
+ hello: z.string().refine((x) => x && x.length > 0),
+ foo: z.string().refine((x) => x && x.length > 0),
+ });
+
+ const testval = { hello: "", foo: "" };
+ const result1 = base.safeParse(testval);
+ const result2 = base.safeParseAsync(testval);
+
+ const r1 = result1;
+ await result2.then((r2) => {
+ if (r1.success === false && r2.success === false) expect(r1.error.issues.length).toBe(r2.error.issues.length); // <--- r1 has length 2, r2 has length 1
+ });
+});
+
+test("async validation multiple errors 1", async () => {
+ const base = z.object({
+ hello: z.string(),
+ foo: z.number(),
+ });
+
+ const testval = { hello: 3, foo: "hello" };
+ const result1 = base.safeParse(testval);
+ const result2 = base.safeParseAsync(testval);
+
+ const r1 = result1;
+ await result2.then((r2) => {
+ if (r1.success === false && r2.success === false) expect(r2.error.issues.length).toBe(r1.error.issues.length);
+ });
+});
+
+test("async validation multiple errors 2", async () => {
+ const base = (is_async?: boolean) =>
+ z.object({
+ hello: z.string(),
+ foo: z.object({
+ bar: z.number().refine(is_async ? async () => false : () => false),
+ }),
+ });
+
+ const testval = { hello: 3, foo: { bar: 4 } };
+ const result1 = base().safeParse(testval);
+ const result2 = base(true).safeParseAsync(testval);
+
+ const r1 = result1;
+ await result2.then((r2) => {
+ if (r1.success === false && r2.success === false) expect(r2.error.issues.length).toBe(r1.error.issues.length);
+ });
+});
+
+test("ensure early async failure prevents follow-up refinement checks", async () => {
+ let count = 0;
+ const base = z.object({
+ hello: z.string(),
+ foo: z
+ .number()
+ .refine(async () => {
+ count++;
+ return true;
+ })
+ .refine(async () => {
+ count++;
+ return true;
+ }, "Good"),
+ });
+
+ const testval = { hello: "bye", foo: 3 };
+ const result = await base.safeParseAsync(testval);
+ if (result.success === false) {
+ expect(result.error.issues.length).toBe(1);
+ expect(count).toBe(1);
+ }
+
+ // await result.then((r) => {
+ // if (r.success === false) expect(r.error.issues.length).toBe(1);
+ // expect(count).toBe(2);
+ // });
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/async-refinements.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/async-refinements.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..509475db62905630d39959ef3af2c0033b55b18a
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/async-refinements.test.ts
@@ -0,0 +1,46 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+
+test("parse async test", async () => {
+ const schema1 = z.string().refine(async (_val) => false);
+ expect(() => schema1.parse("asdf")).toThrow();
+
+ const schema2 = z.string().refine((_val) => Promise.resolve(true));
+ return await expect(() => schema2.parse("asdf")).toThrow();
+});
+
+test("parseAsync async test", async () => {
+ const schema1 = z.string().refine(async (_val) => true);
+ await schema1.parseAsync("asdf");
+
+ const schema2 = z.string().refine(async (_val) => false);
+ return await expect(schema2.parseAsync("asdf")).rejects.toBeDefined();
+ // expect(async () => await schema2.parseAsync('asdf')).toThrow();
+});
+
+test("parseAsync async test", async () => {
+ // expect.assertions(2);
+
+ const schema1 = z.string().refine((_val) => Promise.resolve(true));
+ const v1 = await schema1.parseAsync("asdf");
+ expect(v1).toEqual("asdf");
+
+ const schema2 = z.string().refine((_val) => Promise.resolve(false));
+ await expect(schema2.parseAsync("asdf")).rejects.toBeDefined();
+
+ const schema3 = z.string().refine((_val) => Promise.resolve(true));
+ await expect(schema3.parseAsync("asdf")).resolves.toEqual("asdf");
+ return await expect(schema3.parseAsync("qwer")).resolves.toEqual("qwer");
+});
+
+test("parseAsync async with value", async () => {
+ const schema1 = z.string().refine(async (val) => {
+ return val.length > 5;
+ });
+ await expect(schema1.parseAsync("asdf")).rejects.toBeDefined();
+
+ const v = await schema1.parseAsync("asdf123");
+ return await expect(v).toEqual("asdf123");
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/base.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/base.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ab743d565d365ec62c13dde7506419c0468b4f92
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/base.test.ts
@@ -0,0 +1,29 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+import { util } from "../helpers/util.js";
+
+test("type guard", () => {
+ const stringToNumber = z.string().transform((arg) => arg.length);
+
+ const s1 = z.object({
+ stringToNumber,
+ });
+ type t1 = z.input;
+
+ const data = { stringToNumber: "asdf" };
+ const parsed = s1.safeParse(data);
+ if (parsed.success) {
+ util.assertEqual(true);
+ }
+});
+
+test("test this binding", () => {
+ const callback = (predicate: (val: string) => boolean) => {
+ return predicate("hello");
+ };
+
+ expect(callback((value) => z.string().safeParse(value).success)).toBe(true); // true
+ expect(callback((value) => z.string().safeParse(value).success)).toBe(true); // true
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/bigint.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/bigint.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9692f570018d981d89165772d23a68c6573f2f17
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/bigint.test.ts
@@ -0,0 +1,55 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+
+const gtFive = z.bigint().gt(BigInt(5));
+const gteFive = z.bigint().gte(BigInt(5));
+const ltFive = z.bigint().lt(BigInt(5));
+const lteFive = z.bigint().lte(BigInt(5));
+const positive = z.bigint().positive();
+const negative = z.bigint().negative();
+const nonnegative = z.bigint().nonnegative();
+const nonpositive = z.bigint().nonpositive();
+const multipleOfFive = z.bigint().multipleOf(BigInt(5));
+
+test("passing validations", () => {
+ z.bigint().parse(BigInt(1));
+ z.bigint().parse(BigInt(0));
+ z.bigint().parse(BigInt(-1));
+ gtFive.parse(BigInt(6));
+ gteFive.parse(BigInt(5));
+ gteFive.parse(BigInt(6));
+ ltFive.parse(BigInt(4));
+ lteFive.parse(BigInt(5));
+ lteFive.parse(BigInt(4));
+ positive.parse(BigInt(3));
+ negative.parse(BigInt(-2));
+ nonnegative.parse(BigInt(0));
+ nonnegative.parse(BigInt(7));
+ nonpositive.parse(BigInt(0));
+ nonpositive.parse(BigInt(-12));
+ multipleOfFive.parse(BigInt(15));
+});
+
+test("failing validations", () => {
+ expect(() => gtFive.parse(BigInt(5))).toThrow();
+ expect(() => gteFive.parse(BigInt(4))).toThrow();
+ expect(() => ltFive.parse(BigInt(5))).toThrow();
+ expect(() => lteFive.parse(BigInt(6))).toThrow();
+ expect(() => positive.parse(BigInt(0))).toThrow();
+ expect(() => positive.parse(BigInt(-2))).toThrow();
+ expect(() => negative.parse(BigInt(0))).toThrow();
+ expect(() => negative.parse(BigInt(3))).toThrow();
+ expect(() => nonnegative.parse(BigInt(-1))).toThrow();
+ expect(() => nonpositive.parse(BigInt(1))).toThrow();
+ expect(() => multipleOfFive.parse(BigInt(13))).toThrow();
+});
+
+test("min max getters", () => {
+ expect(z.bigint().min(BigInt(5)).minValue).toEqual(BigInt(5));
+ expect(z.bigint().min(BigInt(5)).min(BigInt(10)).minValue).toEqual(BigInt(10));
+
+ expect(z.bigint().max(BigInt(5)).maxValue).toEqual(BigInt(5));
+ expect(z.bigint().max(BigInt(5)).max(BigInt(1)).maxValue).toEqual(BigInt(1));
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/branded.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/branded.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b19786cf6bf501e1b23396df08fdfec268cc173f
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/branded.test.ts
@@ -0,0 +1,53 @@
+// @ts-ignore TS6133
+import { test } from "vitest";
+
+import * as z from "zod/v3";
+import { util } from "../helpers/util.js";
+
+test("branded types", () => {
+ const mySchema = z
+ .object({
+ name: z.string(),
+ })
+ .brand<"superschema">();
+
+ // simple branding
+ type MySchema = z.infer;
+ util.assertEqual(true);
+
+ const doStuff = (arg: MySchema) => arg;
+ doStuff(mySchema.parse({ name: "hello there" }));
+
+ // inheritance
+ const extendedSchema = mySchema.brand<"subschema">();
+ type ExtendedSchema = z.infer;
+ util.assertEqual & z.BRAND<"subschema">>(true);
+
+ doStuff(extendedSchema.parse({ name: "hello again" }));
+
+ // number branding
+ const numberSchema = z.number().brand<42>();
+ type NumberSchema = z.infer;
+ util.assertEqual(true);
+
+ // symbol branding
+ const MyBrand: unique symbol = Symbol("hello");
+ type MyBrand = typeof MyBrand;
+ const symbolBrand = z.number().brand<"sup">().brand();
+ type SymbolBrand = z.infer;
+ // number & { [z.BRAND]: { sup: true, [MyBrand]: true } }
+ util.assertEqual & z.BRAND>(true);
+
+ // keeping brands out of input types
+ const age = z.number().brand<"age">();
+
+ type Age = z.infer;
+ type AgeInput = z.input;
+
+ util.assertEqual(false);
+ util.assertEqual(true);
+ util.assertEqual, Age>(true);
+
+ // @ts-expect-error
+ doStuff({ name: "hello there!" });
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/catch.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/catch.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..94d12aa2b8314479e71472f451cba35c7b1c7fcd
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/catch.test.ts
@@ -0,0 +1,220 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import { z } from "zod/v3";
+import { util } from "../helpers/util.js";
+
+test("basic catch", () => {
+ expect(z.string().catch("default").parse(undefined)).toBe("default");
+});
+
+test("catch fn does not run when parsing succeeds", () => {
+ let isCalled = false;
+ const cb = () => {
+ isCalled = true;
+ return "asdf";
+ };
+ expect(z.string().catch(cb).parse("test")).toBe("test");
+ expect(isCalled).toEqual(false);
+});
+
+test("basic catch async", async () => {
+ const result = await z.string().catch("default").parseAsync(1243);
+ expect(result).toBe("default");
+});
+
+test("catch replace wrong types", () => {
+ expect(z.string().catch("default").parse(true)).toBe("default");
+ expect(z.string().catch("default").parse(true)).toBe("default");
+ expect(z.string().catch("default").parse(15)).toBe("default");
+ expect(z.string().catch("default").parse([])).toBe("default");
+ expect(z.string().catch("default").parse(new Map())).toBe("default");
+ expect(z.string().catch("default").parse(new Set())).toBe("default");
+ expect(z.string().catch("default").parse({})).toBe("default");
+});
+
+test("catch with transform", () => {
+ const stringWithDefault = z
+ .string()
+ .transform((val) => val.toUpperCase())
+ .catch("default");
+ expect(stringWithDefault.parse(undefined)).toBe("default");
+ expect(stringWithDefault.parse(15)).toBe("default");
+ expect(stringWithDefault).toBeInstanceOf(z.ZodCatch);
+ expect(stringWithDefault._def.innerType).toBeInstanceOf(z.ZodEffects);
+ expect(stringWithDefault._def.innerType._def.schema).toBeInstanceOf(z.ZodSchema);
+
+ type inp = z.input;
+ util.assertEqual(true);
+ type out = z.output;
+ util.assertEqual(true);
+});
+
+test("catch on existing optional", () => {
+ const stringWithDefault = z.string().optional().catch("asdf");
+ expect(stringWithDefault.parse(undefined)).toBe(undefined);
+ expect(stringWithDefault.parse(15)).toBe("asdf");
+ expect(stringWithDefault).toBeInstanceOf(z.ZodCatch);
+ expect(stringWithDefault._def.innerType).toBeInstanceOf(z.ZodOptional);
+ expect(stringWithDefault._def.innerType._def.innerType).toBeInstanceOf(z.ZodString);
+
+ type inp = z.input;
+ util.assertEqual(true);
+ type out = z.output;
+ util.assertEqual(true);
+});
+
+test("optional on catch", () => {
+ const stringWithDefault = z.string().catch("asdf").optional();
+
+ type inp = z.input;
+ util.assertEqual(true);
+ type out = z.output;
+ util.assertEqual(true);
+});
+
+test("complex chain example", () => {
+ const complex = z
+ .string()
+ .catch("asdf")
+ .transform((val) => val + "!")
+ .transform((val) => val.toUpperCase())
+ .catch("qwer")
+ .removeCatch()
+ .optional()
+ .catch("asdfasdf");
+
+ expect(complex.parse("qwer")).toBe("QWER!");
+ expect(complex.parse(15)).toBe("ASDF!");
+ expect(complex.parse(true)).toBe("ASDF!");
+});
+
+test("removeCatch", () => {
+ const stringWithRemovedDefault = z.string().catch("asdf").removeCatch();
+
+ type out = z.output;
+ util.assertEqual(true);
+});
+
+test("nested", () => {
+ const inner = z.string().catch("asdf");
+ const outer = z.object({ inner }).catch({
+ inner: "asdf",
+ });
+ type input = z.input;
+ util.assertEqual (true);
+ type out = z.output;
+ util.assertEqual(true);
+ expect(outer.parse(undefined)).toEqual({ inner: "asdf" });
+ expect(outer.parse({})).toEqual({ inner: "asdf" });
+ expect(outer.parse({ inner: undefined })).toEqual({ inner: "asdf" });
+});
+
+test("chained catch", () => {
+ const stringWithDefault = z.string().catch("inner").catch("outer");
+ const result = stringWithDefault.parse(undefined);
+ expect(result).toEqual("inner");
+ const resultDiff = stringWithDefault.parse(5);
+ expect(resultDiff).toEqual("inner");
+});
+
+test("factory", () => {
+ z.ZodCatch.create(z.string(), {
+ catch: "asdf",
+ }).parse(undefined);
+});
+
+test("native enum", () => {
+ enum Fruits {
+ apple = "apple",
+ orange = "orange",
+ }
+
+ const schema = z.object({
+ fruit: z.nativeEnum(Fruits).catch(Fruits.apple),
+ });
+
+ expect(schema.parse({})).toEqual({ fruit: Fruits.apple });
+ expect(schema.parse({ fruit: 15 })).toEqual({ fruit: Fruits.apple });
+});
+
+test("enum", () => {
+ const schema = z.object({
+ fruit: z.enum(["apple", "orange"]).catch("apple"),
+ });
+
+ expect(schema.parse({})).toEqual({ fruit: "apple" });
+ expect(schema.parse({ fruit: true })).toEqual({ fruit: "apple" });
+ expect(schema.parse({ fruit: 15 })).toEqual({ fruit: "apple" });
+});
+
+test("reported issues with nested usage", () => {
+ const schema = z.object({
+ string: z.string(),
+ obj: z.object({
+ sub: z.object({
+ lit: z.literal("a"),
+ subCatch: z.number().catch(23),
+ }),
+ midCatch: z.number().catch(42),
+ }),
+ number: z.number().catch(0),
+ bool: z.boolean(),
+ });
+
+ try {
+ schema.parse({
+ string: {},
+ obj: {
+ sub: {
+ lit: "b",
+ subCatch: "24",
+ },
+ midCatch: 444,
+ },
+ number: "",
+ bool: "yes",
+ });
+ } catch (error) {
+ const issues = (error as z.ZodError).issues;
+
+ expect(issues.length).toEqual(3);
+ expect(issues[0].message).toMatch("string");
+ expect(issues[1].message).toMatch("literal");
+ expect(issues[2].message).toMatch("boolean");
+ }
+});
+
+test("catch error", () => {
+ let catchError: z.ZodError | undefined = undefined;
+
+ const schema = z.object({
+ age: z.number(),
+ name: z.string().catch((ctx) => {
+ catchError = ctx.error;
+
+ return "John Doe";
+ }),
+ });
+
+ const result = schema.safeParse({
+ age: null,
+ name: null,
+ });
+
+ expect(result.success).toEqual(false);
+ expect(!result.success && result.error.issues.length).toEqual(1);
+ expect(!result.success && result.error.issues[0].message).toMatch("number");
+
+ expect(catchError).toBeInstanceOf(z.ZodError);
+ expect(catchError !== undefined && (catchError as z.ZodError).issues.length).toEqual(1);
+ expect(catchError !== undefined && (catchError as z.ZodError).issues[0].message).toMatch("string");
+});
+
+test("ctx.input", () => {
+ const schema = z.string().catch((ctx) => {
+ return String(ctx.input);
+ });
+
+ expect(schema.parse(123)).toEqual("123");
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/coerce.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/coerce.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1f5300416a727575e72a68cdcfcee6baad446ef3
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/coerce.test.ts
@@ -0,0 +1,133 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+
+test("string coercion", () => {
+ const schema = z.coerce.string();
+ expect(schema.parse("sup")).toEqual("sup");
+ expect(schema.parse("")).toEqual("");
+ expect(schema.parse(12)).toEqual("12");
+ expect(schema.parse(0)).toEqual("0");
+ expect(schema.parse(-12)).toEqual("-12");
+ expect(schema.parse(3.14)).toEqual("3.14");
+ expect(schema.parse(BigInt(15))).toEqual("15");
+ expect(schema.parse(Number.NaN)).toEqual("NaN");
+ expect(schema.parse(Number.POSITIVE_INFINITY)).toEqual("Infinity");
+ expect(schema.parse(Number.NEGATIVE_INFINITY)).toEqual("-Infinity");
+ expect(schema.parse(true)).toEqual("true");
+ expect(schema.parse(false)).toEqual("false");
+ expect(schema.parse(null)).toEqual("null");
+ expect(schema.parse(undefined)).toEqual("undefined");
+ expect(schema.parse({ hello: "world!" })).toEqual("[object Object]");
+ expect(schema.parse(["item", "another_item"])).toEqual("item,another_item");
+ expect(schema.parse([])).toEqual("");
+ expect(schema.parse(new Date("2022-01-01T00:00:00.000Z"))).toEqual(new Date("2022-01-01T00:00:00.000Z").toString());
+});
+
+test("number coercion", () => {
+ const schema = z.coerce.number();
+ expect(schema.parse("12")).toEqual(12);
+ expect(schema.parse("0")).toEqual(0);
+ expect(schema.parse("-12")).toEqual(-12);
+ expect(schema.parse("3.14")).toEqual(3.14);
+ expect(schema.parse("")).toEqual(0);
+ expect(() => schema.parse("NOT_A_NUMBER")).toThrow(); // z.ZodError
+ expect(schema.parse(12)).toEqual(12);
+ expect(schema.parse(0)).toEqual(0);
+ expect(schema.parse(-12)).toEqual(-12);
+ expect(schema.parse(3.14)).toEqual(3.14);
+ expect(schema.parse(BigInt(15))).toEqual(15);
+ expect(() => schema.parse(Number.NaN)).toThrow(); // z.ZodError
+ expect(schema.parse(Number.POSITIVE_INFINITY)).toEqual(Number.POSITIVE_INFINITY);
+ expect(schema.parse(Number.NEGATIVE_INFINITY)).toEqual(Number.NEGATIVE_INFINITY);
+ expect(schema.parse(true)).toEqual(1);
+ expect(schema.parse(false)).toEqual(0);
+ expect(schema.parse(null)).toEqual(0);
+ expect(() => schema.parse(undefined)).toThrow(); // z.ZodError
+ expect(() => schema.parse({ hello: "world!" })).toThrow(); // z.ZodError
+ expect(() => schema.parse(["item", "another_item"])).toThrow(); // z.ZodError
+ expect(schema.parse([])).toEqual(0);
+ expect(schema.parse(new Date(1670139203496))).toEqual(1670139203496);
+});
+
+test("boolean coercion", () => {
+ const schema = z.coerce.boolean();
+ expect(schema.parse("true")).toEqual(true);
+ expect(schema.parse("false")).toEqual(true);
+ expect(schema.parse("0")).toEqual(true);
+ expect(schema.parse("1")).toEqual(true);
+ expect(schema.parse("")).toEqual(false);
+ expect(schema.parse(1)).toEqual(true);
+ expect(schema.parse(0)).toEqual(false);
+ expect(schema.parse(-1)).toEqual(true);
+ expect(schema.parse(3.14)).toEqual(true);
+ expect(schema.parse(BigInt(15))).toEqual(true);
+ expect(schema.parse(Number.NaN)).toEqual(false);
+ expect(schema.parse(Number.POSITIVE_INFINITY)).toEqual(true);
+ expect(schema.parse(Number.NEGATIVE_INFINITY)).toEqual(true);
+ expect(schema.parse(true)).toEqual(true);
+ expect(schema.parse(false)).toEqual(false);
+ expect(schema.parse(null)).toEqual(false);
+ expect(schema.parse(undefined)).toEqual(false);
+ expect(schema.parse({ hello: "world!" })).toEqual(true);
+ expect(schema.parse(["item", "another_item"])).toEqual(true);
+ expect(schema.parse([])).toEqual(true);
+ expect(schema.parse(new Date(1670139203496))).toEqual(true);
+});
+
+test("bigint coercion", () => {
+ const schema = z.coerce.bigint();
+ expect(schema.parse("5")).toEqual(BigInt(5));
+ expect(schema.parse("0")).toEqual(BigInt(0));
+ expect(schema.parse("-5")).toEqual(BigInt(-5));
+ expect(() => schema.parse("3.14")).toThrow(); // not a z.ZodError!
+ expect(schema.parse("")).toEqual(BigInt(0));
+ expect(() => schema.parse("NOT_A_NUMBER")).toThrow(); // not a z.ZodError!
+ expect(schema.parse(5)).toEqual(BigInt(5));
+ expect(schema.parse(0)).toEqual(BigInt(0));
+ expect(schema.parse(-5)).toEqual(BigInt(-5));
+ expect(() => schema.parse(3.14)).toThrow(); // not a z.ZodError!
+ expect(schema.parse(BigInt(5))).toEqual(BigInt(5));
+ expect(() => schema.parse(Number.NaN)).toThrow(); // not a z.ZodError!
+ expect(() => schema.parse(Number.POSITIVE_INFINITY)).toThrow(); // not a z.ZodError!
+ expect(() => schema.parse(Number.NEGATIVE_INFINITY)).toThrow(); // not a z.ZodError!
+ expect(schema.parse(true)).toEqual(BigInt(1));
+ expect(schema.parse(false)).toEqual(BigInt(0));
+ expect(() => schema.parse(null)).toThrow(); // not a z.ZodError!
+ expect(() => schema.parse(undefined)).toThrow(); // not a z.ZodError!
+ expect(() => schema.parse({ hello: "world!" })).toThrow(); // not a z.ZodError!
+ expect(() => schema.parse(["item", "another_item"])).toThrow(); // not a z.ZodError!
+ expect(schema.parse([])).toEqual(BigInt(0));
+ expect(schema.parse(new Date(1670139203496))).toEqual(BigInt(1670139203496));
+});
+
+test("date coercion", () => {
+ const schema = z.coerce.date();
+ expect(schema.parse(new Date().toDateString())).toBeInstanceOf(Date);
+ expect(schema.parse(new Date().toISOString())).toBeInstanceOf(Date);
+ expect(schema.parse(new Date().toUTCString())).toBeInstanceOf(Date);
+ expect(schema.parse("5")).toBeInstanceOf(Date);
+ expect(schema.parse("2000-01-01")).toBeInstanceOf(Date);
+ // expect(schema.parse("0")).toBeInstanceOf(Date);
+ // expect(schema.parse("-5")).toBeInstanceOf(Date);
+ // expect(schema.parse("3.14")).toBeInstanceOf(Date);
+ expect(() => schema.parse("")).toThrow(); // z.ZodError
+ expect(() => schema.parse("NOT_A_DATE")).toThrow(); // z.ZodError
+ expect(schema.parse(5)).toBeInstanceOf(Date);
+ expect(schema.parse(0)).toBeInstanceOf(Date);
+ expect(schema.parse(-5)).toBeInstanceOf(Date);
+ expect(schema.parse(3.14)).toBeInstanceOf(Date);
+ expect(() => schema.parse(BigInt(5))).toThrow(); // not a z.ZodError!
+ expect(() => schema.parse(Number.NaN)).toThrow(); // z.ZodError
+ expect(() => schema.parse(Number.POSITIVE_INFINITY)).toThrow(); // z.ZodError
+ expect(() => schema.parse(Number.NEGATIVE_INFINITY)).toThrow(); // z.ZodError
+ expect(schema.parse(true)).toBeInstanceOf(Date);
+ expect(schema.parse(false)).toBeInstanceOf(Date);
+ expect(schema.parse(null)).toBeInstanceOf(Date);
+ expect(() => schema.parse(undefined)).toThrow(); // z.ZodError
+ expect(() => schema.parse({ hello: "world!" })).toThrow(); // z.ZodError
+ expect(() => schema.parse(["item", "another_item"])).toThrow(); // z.ZodError
+ expect(() => schema.parse([])).toThrow(); // z.ZodError
+ expect(schema.parse(new Date())).toBeInstanceOf(Date);
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/complex.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/complex.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7807b2b11f550f5323d0e9dffcd23603ee86d28d
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/complex.test.ts
@@ -0,0 +1,56 @@
+import { test } from "vitest";
+import * as z from "zod/v3";
+
+const crazySchema = z.object({
+ tuple: z.tuple([
+ z.string().nullable().optional(),
+ z.number().nullable().optional(),
+ z.boolean().nullable().optional(),
+ z.null().nullable().optional(),
+ z.undefined().nullable().optional(),
+ z.literal("1234").nullable().optional(),
+ ]),
+ merged: z
+ .object({
+ k1: z.string().optional(),
+ })
+ .merge(z.object({ k1: z.string().nullable(), k2: z.number() })),
+ union: z.array(z.union([z.literal("asdf"), z.literal(12)])).nonempty(),
+ array: z.array(z.number()),
+ // sumTransformer: z.transformer(z.array(z.number()), z.number(), (arg) => {
+ // return arg.reduce((a, b) => a + b, 0);
+ // }),
+ sumMinLength: z.array(z.number()).refine((arg) => arg.length > 5),
+ intersection: z.intersection(z.object({ p1: z.string().optional() }), z.object({ p1: z.number().optional() })),
+ enum: z.intersection(z.enum(["zero", "one"]), z.enum(["one", "two"])),
+ nonstrict: z.object({ points: z.number() }).nonstrict(),
+ numProm: z.promise(z.number()),
+ lenfun: z.function(z.tuple([z.string()]), z.boolean()),
+});
+
+// const asyncCrazySchema = crazySchema.extend({
+// // async_transform: z.transformer(
+// // z.array(z.number()),
+// // z.number(),
+// // async (arg) => {
+// // return arg.reduce((a, b) => a + b, 0);
+// // }
+// // ),
+// async_refine: z.array(z.number()).refine(async (arg) => arg.length > 5),
+// });
+
+test("parse", () => {
+ crazySchema.parse({
+ tuple: ["asdf", 1234, true, null, undefined, "1234"],
+ merged: { k1: "asdf", k2: 12 },
+ union: ["asdf", 12, "asdf", 12, "asdf", 12],
+ array: [12, 15, 16],
+ // sumTransformer: [12, 15, 16],
+ sumMinLength: [12, 15, 16, 98, 24, 63],
+ intersection: {},
+ enum: "one",
+ nonstrict: { points: 1234 },
+ numProm: Promise.resolve(12),
+ lenfun: (x: string) => x.length,
+ });
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/custom.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/custom.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b24b6762dcf11e40a69fc96486333e219f96e910
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/custom.test.ts
@@ -0,0 +1,31 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+
+test("passing validations", () => {
+ const example1 = z.custom((x) => typeof x === "number");
+ example1.parse(1234);
+ expect(() => example1.parse({})).toThrow();
+});
+
+test("string params", () => {
+ const example1 = z.custom((x) => typeof x !== "number", "customerr");
+ const result = example1.safeParse(1234);
+ expect(result.success).toEqual(false);
+ // @ts-ignore
+ expect(JSON.stringify(result.error).includes("customerr")).toEqual(true);
+});
+
+test("async validations", async () => {
+ const example1 = z.custom(async (x) => {
+ return typeof x === "number";
+ });
+ const r1 = await example1.safeParseAsync(1234);
+ expect(r1.success).toEqual(true);
+ expect(r1.data).toEqual(1234);
+
+ const r2 = await example1.safeParseAsync("asdf");
+ expect(r2.success).toEqual(false);
+ expect(r2.error!.issues.length).toEqual(1);
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/date.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/date.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c86dc84fc56062af09081fe7e444a9651e8b64b1
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/date.test.ts
@@ -0,0 +1,32 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+
+const beforeBenchmarkDate = new Date(2022, 10, 4);
+const benchmarkDate = new Date(2022, 10, 5);
+const afterBenchmarkDate = new Date(2022, 10, 6);
+
+const minCheck = z.date().min(benchmarkDate);
+const maxCheck = z.date().max(benchmarkDate);
+
+test("passing validations", () => {
+ minCheck.parse(benchmarkDate);
+ minCheck.parse(afterBenchmarkDate);
+
+ maxCheck.parse(benchmarkDate);
+ maxCheck.parse(beforeBenchmarkDate);
+});
+
+test("failing validations", () => {
+ expect(() => minCheck.parse(beforeBenchmarkDate)).toThrow();
+ expect(() => maxCheck.parse(afterBenchmarkDate)).toThrow();
+});
+
+test("min max getters", () => {
+ expect(minCheck.minDate).toEqual(benchmarkDate);
+ expect(minCheck.min(afterBenchmarkDate).minDate).toEqual(afterBenchmarkDate);
+
+ expect(maxCheck.maxDate).toEqual(benchmarkDate);
+ expect(maxCheck.max(beforeBenchmarkDate).maxDate).toEqual(beforeBenchmarkDate);
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/deepmasking.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/deepmasking.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d707e79a07f16373480571dd3466d2bce7f14200
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/deepmasking.test.ts
@@ -0,0 +1,186 @@
+// @ts-ignore TS6133
+import { test } from "vitest";
+
+import * as z from "zod/v3";
+
+test("test", () => {
+ z;
+});
+
+// const fish = z.object({
+// name: z.string(),
+// props: z.object({
+// color: z.string(),
+// numScales: z.number(),
+// }),
+// });
+
+// const nonStrict = z
+// .object({
+// name: z.string(),
+// color: z.string(),
+// })
+// .nonstrict();
+
+// test('object pick type', () => {
+// const modNonStrictFish = nonStrict.omit({ name: true });
+// modNonStrictFish.parse({ color: 'asdf' });
+
+// const bad1 = () => fish.pick({ props: { unknown: true } } as any);
+// const bad2 = () => fish.omit({ name: true, props: { unknown: true } } as any);
+
+// expect(bad1).toThrow();
+// expect(bad2).toThrow();
+// });
+
+// test('f1', () => {
+// const f1 = fish.pick(true);
+// f1.parse({ name: 'a', props: { color: 'b', numScales: 3 } });
+// });
+// test('f2', () => {
+// const f2 = fish.pick({ props: true });
+// f2.parse({ props: { color: 'asdf', numScales: 1 } });
+// const badcheck2 = () => f2.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any);
+// expect(badcheck2).toThrow();
+// });
+// test('f3', () => {
+// const f3 = fish.pick({ props: { color: true } });
+// f3.parse({ props: { color: 'b' } });
+// const badcheck3 = () => f3.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any);
+// expect(badcheck3).toThrow();
+// });
+// test('f4', () => {
+// const badcheck4 = () => fish.pick({ props: { color: true, unknown: true } });
+// expect(badcheck4).toThrow();
+// });
+// test('f6', () => {
+// const f6 = fish.omit({ props: true });
+// const badcheck6 = () => f6.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any);
+// f6.parse({ name: 'adsf' });
+// expect(badcheck6).toThrow();
+// });
+// test('f7', () => {
+// const f7 = fish.omit({ props: { color: true } });
+// f7.parse({ name: 'a', props: { numScales: 3 } });
+// const badcheck7 = () => f7.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any);
+// expect(badcheck7).toThrow();
+// });
+// test('f8', () => {
+// const badcheck8 = () => fish.omit({ props: { color: true, unknown: true } });
+// expect(badcheck8).toThrow();
+// });
+// test('f9', () => {
+// const f9 = nonStrict.pick(true);
+// f9.parse({ name: 'a', color: 'asdf' });
+// });
+// test('f10', () => {
+// const f10 = nonStrict.pick({ name: true });
+// f10.parse({ name: 'a' });
+// const val = f10.parse({ name: 'a', color: 'b' });
+// expect(val).toEqual({ name: 'a' });
+// });
+// test('f12', () => {
+// const badfcheck12 = () => nonStrict.omit({ color: true, asdf: true });
+// expect(badfcheck12).toThrow();
+// });
+
+// test('array masking', () => {
+// const fishArray = z.array(fish);
+// const modFishArray = fishArray.pick({
+// name: true,
+// props: {
+// numScales: true,
+// },
+// });
+
+// modFishArray.parse([{ name: 'fish', props: { numScales: 12 } }]);
+// const bad1 = () => modFishArray.parse([{ name: 'fish', props: { numScales: 12, color: 'asdf' } }] as any);
+// expect(bad1).toThrow();
+// });
+
+// test('array masking', () => {
+// const fishArray = z.array(fish);
+// const fail = () =>
+// fishArray.pick({
+// name: true,
+// props: {
+// whatever: true,
+// },
+// } as any);
+// expect(fail).toThrow();
+// });
+
+// test('array masking', () => {
+// const fishArray = z.array(fish);
+// const fail = () =>
+// fishArray.omit({
+// whateve: true,
+// } as any);
+// expect(fail).toThrow();
+// });
+
+// test('array masking', () => {
+// const fishArray = z.array(fish);
+// const modFishList = fishArray.omit({
+// name: true,
+// props: {
+// color: true,
+// },
+// });
+
+// modFishList.parse([{ props: { numScales: 12 } }]);
+// const fail = () => modFishList.parse([{ name: 'hello', props: { numScales: 12 } }] as any);
+// expect(fail).toThrow();
+// });
+
+// test('primitive array masking', () => {
+// const fishArray = z.array(z.number());
+// const fail = () => fishArray.pick({} as any);
+// expect(fail).toThrow();
+// });
+
+// test('other array masking', () => {
+// const fishArray = z.array(z.array(z.number()));
+// const fail = () => fishArray.pick({} as any);
+// expect(fail).toThrow();
+// });
+
+// test('invalid mask #1', () => {
+// const fail = () => fish.pick(1 as any);
+// expect(fail).toThrow();
+// });
+
+// test('invalid mask #2', () => {
+// const fail = () => fish.pick([] as any);
+// expect(fail).toThrow();
+// });
+
+// test('invalid mask #3', () => {
+// const fail = () => fish.pick(false as any);
+// expect(fail).toThrow();
+// });
+
+// test('invalid mask #4', () => {
+// const fail = () => fish.pick('asdf' as any);
+// expect(fail).toThrow();
+// });
+
+// test('invalid mask #5', () => {
+// const fail = () => fish.omit(1 as any);
+// expect(fail).toThrow();
+// });
+
+// test('invalid mask #6', () => {
+// const fail = () => fish.omit([] as any);
+// expect(fail).toThrow();
+// });
+
+// test('invalid mask #7', () => {
+// const fail = () => fish.omit(false as any);
+// expect(fail).toThrow();
+// });
+
+// test('invalid mask #8', () => {
+// const fail = () => fish.omit('asdf' as any);
+// expect(fail).toThrow();
+// });
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/default.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/default.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..29e007c93d030d20b00e7c19da6463e35f20ff37
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/default.test.ts
@@ -0,0 +1,112 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import { z } from "zod/v3";
+import { util } from "../helpers/util.js";
+
+test("basic defaults", () => {
+ expect(z.string().default("default").parse(undefined)).toBe("default");
+});
+
+test("default with transform", () => {
+ const stringWithDefault = z
+ .string()
+ .transform((val) => val.toUpperCase())
+ .default("default");
+ expect(stringWithDefault.parse(undefined)).toBe("DEFAULT");
+ expect(stringWithDefault).toBeInstanceOf(z.ZodDefault);
+ expect(stringWithDefault._def.innerType).toBeInstanceOf(z.ZodEffects);
+ expect(stringWithDefault._def.innerType._def.schema).toBeInstanceOf(z.ZodSchema);
+
+ type inp = z.input;
+ util.assertEqual(true);
+ type out = z.output;
+ util.assertEqual(true);
+});
+
+test("default on existing optional", () => {
+ const stringWithDefault = z.string().optional().default("asdf");
+ expect(stringWithDefault.parse(undefined)).toBe("asdf");
+ expect(stringWithDefault).toBeInstanceOf(z.ZodDefault);
+ expect(stringWithDefault._def.innerType).toBeInstanceOf(z.ZodOptional);
+ expect(stringWithDefault._def.innerType._def.innerType).toBeInstanceOf(z.ZodString);
+
+ type inp = z.input;
+ util.assertEqual(true);
+ type out = z.output;
+ util.assertEqual(true);
+});
+
+test("optional on default", () => {
+ const stringWithDefault = z.string().default("asdf").optional();
+
+ type inp = z.input;
+ util.assertEqual(true);
+ type out = z.output;
+ util.assertEqual(true);
+});
+
+test("complex chain example", () => {
+ const complex = z
+ .string()
+ .default("asdf")
+ .transform((val) => val.toUpperCase())
+ .default("qwer")
+ .removeDefault()
+ .optional()
+ .default("asdfasdf");
+
+ expect(complex.parse(undefined)).toBe("ASDFASDF");
+});
+
+test("removeDefault", () => {
+ const stringWithRemovedDefault = z.string().default("asdf").removeDefault();
+
+ type out = z.output;
+ util.assertEqual(true);
+});
+
+test("nested", () => {
+ const inner = z.string().default("asdf");
+ const outer = z.object({ inner }).default({
+ inner: undefined,
+ });
+ type input = z.input;
+ util.assertEqual (true);
+ type out = z.output;
+ util.assertEqual(true);
+ expect(outer.parse(undefined)).toEqual({ inner: "asdf" });
+ expect(outer.parse({})).toEqual({ inner: "asdf" });
+ expect(outer.parse({ inner: undefined })).toEqual({ inner: "asdf" });
+});
+
+test("chained defaults", () => {
+ const stringWithDefault = z.string().default("inner").default("outer");
+ const result = stringWithDefault.parse(undefined);
+ expect(result).toEqual("outer");
+});
+
+test("factory", () => {
+ expect(z.ZodDefault.create(z.string(), { default: "asdf" }).parse(undefined)).toEqual("asdf");
+});
+
+test("native enum", () => {
+ enum Fruits {
+ apple = "apple",
+ orange = "orange",
+ }
+
+ const schema = z.object({
+ fruit: z.nativeEnum(Fruits).default(Fruits.apple),
+ });
+
+ expect(schema.parse({})).toEqual({ fruit: Fruits.apple });
+});
+
+test("enum", () => {
+ const schema = z.object({
+ fruit: z.enum(["apple", "orange"]).default("apple"),
+ });
+
+ expect(schema.parse({})).toEqual({ fruit: "apple" });
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/description.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/description.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1edaa1cc2ee1a575db568d914992944bd9bfd210
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/description.test.ts
@@ -0,0 +1,33 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+
+const description = "a description";
+
+test("passing `description` to schema should add a description", () => {
+ expect(z.string({ description }).description).toEqual(description);
+ expect(z.number({ description }).description).toEqual(description);
+ expect(z.boolean({ description }).description).toEqual(description);
+});
+
+test("`.describe` should add a description", () => {
+ expect(z.string().describe(description).description).toEqual(description);
+ expect(z.number().describe(description).description).toEqual(description);
+ expect(z.boolean().describe(description).description).toEqual(description);
+});
+
+test("description should carry over to chained schemas", () => {
+ const schema = z.string({ description });
+ expect(schema.description).toEqual(description);
+ expect(schema.optional().description).toEqual(description);
+ expect(schema.optional().nullable().default("default").description).toEqual(description);
+});
+
+test("description should not carry over to chained array schema", () => {
+ const schema = z.string().describe(description);
+
+ expect(schema.description).toEqual(description);
+ expect(schema.array().description).toEqual(undefined);
+ expect(z.array(schema).description).toEqual(undefined);
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/discriminated-unions.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/discriminated-unions.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7fb5cfefe80b18f2c26bee891a47bc8c50153170
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/discriminated-unions.test.ts
@@ -0,0 +1,315 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+
+test("valid", () => {
+ expect(
+ z
+ .discriminatedUnion("type", [
+ z.object({ type: z.literal("a"), a: z.string() }),
+ z.object({ type: z.literal("b"), b: z.string() }),
+ ])
+ .parse({ type: "a", a: "abc" })
+ ).toEqual({ type: "a", a: "abc" });
+});
+
+test("valid - discriminator value of various primitive types", () => {
+ const schema = z.discriminatedUnion("type", [
+ z.object({ type: z.literal("1"), val: z.literal(1) }),
+ z.object({ type: z.literal(1), val: z.literal(2) }),
+ z.object({ type: z.literal(BigInt(1)), val: z.literal(3) }),
+ z.object({ type: z.literal("true"), val: z.literal(4) }),
+ z.object({ type: z.literal(true), val: z.literal(5) }),
+ z.object({ type: z.literal("null"), val: z.literal(6) }),
+ z.object({ type: z.literal(null), val: z.literal(7) }),
+ z.object({ type: z.literal("undefined"), val: z.literal(8) }),
+ z.object({ type: z.literal(undefined), val: z.literal(9) }),
+ z.object({ type: z.literal("transform"), val: z.literal(10) }),
+ z.object({ type: z.literal("refine"), val: z.literal(11) }),
+ z.object({ type: z.literal("superRefine"), val: z.literal(12) }),
+ ]);
+
+ expect(schema.parse({ type: "1", val: 1 })).toEqual({ type: "1", val: 1 });
+ expect(schema.parse({ type: 1, val: 2 })).toEqual({ type: 1, val: 2 });
+ expect(schema.parse({ type: BigInt(1), val: 3 })).toEqual({
+ type: BigInt(1),
+ val: 3,
+ });
+ expect(schema.parse({ type: "true", val: 4 })).toEqual({
+ type: "true",
+ val: 4,
+ });
+ expect(schema.parse({ type: true, val: 5 })).toEqual({
+ type: true,
+ val: 5,
+ });
+ expect(schema.parse({ type: "null", val: 6 })).toEqual({
+ type: "null",
+ val: 6,
+ });
+ expect(schema.parse({ type: null, val: 7 })).toEqual({
+ type: null,
+ val: 7,
+ });
+ expect(schema.parse({ type: "undefined", val: 8 })).toEqual({
+ type: "undefined",
+ val: 8,
+ });
+ expect(schema.parse({ type: undefined, val: 9 })).toEqual({
+ type: undefined,
+ val: 9,
+ });
+});
+
+test("invalid - null", () => {
+ try {
+ z.discriminatedUnion("type", [
+ z.object({ type: z.literal("a"), a: z.string() }),
+ z.object({ type: z.literal("b"), b: z.string() }),
+ ]).parse(null);
+ throw new Error();
+ } catch (e: any) {
+ expect(JSON.parse(e.message)).toEqual([
+ {
+ code: z.ZodIssueCode.invalid_type,
+ expected: z.ZodParsedType.object,
+ message: "Expected object, received null",
+ received: z.ZodParsedType.null,
+ path: [],
+ },
+ ]);
+ }
+});
+
+test("invalid discriminator value", () => {
+ try {
+ z.discriminatedUnion("type", [
+ z.object({ type: z.literal("a"), a: z.string() }),
+ z.object({ type: z.literal("b"), b: z.string() }),
+ ]).parse({ type: "x", a: "abc" });
+ throw new Error();
+ } catch (e: any) {
+ expect(JSON.parse(e.message)).toEqual([
+ {
+ code: z.ZodIssueCode.invalid_union_discriminator,
+ options: ["a", "b"],
+ message: "Invalid discriminator value. Expected 'a' | 'b'",
+ path: ["type"],
+ },
+ ]);
+ }
+});
+
+test("valid discriminator value, invalid data", () => {
+ try {
+ z.discriminatedUnion("type", [
+ z.object({ type: z.literal("a"), a: z.string() }),
+ z.object({ type: z.literal("b"), b: z.string() }),
+ ]).parse({ type: "a", b: "abc" });
+ throw new Error();
+ } catch (e: any) {
+ expect(JSON.parse(e.message)).toEqual([
+ {
+ code: z.ZodIssueCode.invalid_type,
+ expected: z.ZodParsedType.string,
+ message: "Required",
+ path: ["a"],
+ received: z.ZodParsedType.undefined,
+ },
+ ]);
+ }
+});
+
+test("wrong schema - missing discriminator", () => {
+ try {
+ z.discriminatedUnion("type", [
+ z.object({ type: z.literal("a"), a: z.string() }),
+ z.object({ b: z.string() }) as any,
+ ]);
+ throw new Error();
+ } catch (e: any) {
+ expect(e.message.includes("could not be extracted")).toBe(true);
+ }
+});
+
+test("wrong schema - duplicate discriminator values", () => {
+ try {
+ z.discriminatedUnion("type", [
+ z.object({ type: z.literal("a"), a: z.string() }),
+ z.object({ type: z.literal("a"), b: z.string() }),
+ ]);
+ throw new Error();
+ } catch (e: any) {
+ expect(e.message.includes("has duplicate value")).toEqual(true);
+ }
+});
+
+test("async - valid", async () => {
+ expect(
+ await z
+ .discriminatedUnion("type", [
+ z.object({
+ type: z.literal("a"),
+ a: z
+ .string()
+ .refine(async () => true)
+ .transform(async (val) => Number(val)),
+ }),
+ z.object({
+ type: z.literal("b"),
+ b: z.string(),
+ }),
+ ])
+ .parseAsync({ type: "a", a: "1" })
+ ).toEqual({ type: "a", a: 1 });
+});
+
+test("async - invalid", async () => {
+ try {
+ await z
+ .discriminatedUnion("type", [
+ z.object({
+ type: z.literal("a"),
+ a: z
+ .string()
+ .refine(async () => true)
+ .transform(async (val) => val),
+ }),
+ z.object({
+ type: z.literal("b"),
+ b: z.string(),
+ }),
+ ])
+ .parseAsync({ type: "a", a: 1 });
+ throw new Error();
+ } catch (e: any) {
+ expect(JSON.parse(e.message)).toEqual([
+ {
+ code: "invalid_type",
+ expected: "string",
+ received: "number",
+ path: ["a"],
+ message: "Expected string, received number",
+ },
+ ]);
+ }
+});
+
+test("valid - literals with .default or .preprocess", () => {
+ const schema = z.discriminatedUnion("type", [
+ z.object({
+ type: z.literal("foo").default("foo"),
+ a: z.string(),
+ }),
+ z.object({
+ type: z.literal("custom"),
+ method: z.string(),
+ }),
+ z.object({
+ type: z.preprocess((val) => String(val), z.literal("bar")),
+ c: z.string(),
+ }),
+ ]);
+ expect(schema.parse({ type: "foo", a: "foo" })).toEqual({
+ type: "foo",
+ a: "foo",
+ });
+});
+
+test("enum and nativeEnum", () => {
+ enum MyEnum {
+ d = 0,
+ e = "e",
+ }
+
+ const schema = z.discriminatedUnion("key", [
+ z.object({
+ key: z.literal("a"),
+ // Add other properties specific to this option
+ }),
+ z.object({
+ key: z.enum(["b", "c"]),
+ // Add other properties specific to this option
+ }),
+ z.object({
+ key: z.nativeEnum(MyEnum),
+ // Add other properties specific to this option
+ }),
+ ]);
+
+ // type schema = z.infer;
+
+ schema.parse({ key: "a" });
+ schema.parse({ key: "b" });
+ schema.parse({ key: "c" });
+ schema.parse({ key: MyEnum.d });
+ schema.parse({ key: MyEnum.e });
+ schema.parse({ key: "e" });
+});
+
+test("branded", () => {
+ const schema = z.discriminatedUnion("key", [
+ z.object({
+ key: z.literal("a"),
+ // Add other properties specific to this option
+ }),
+ z.object({
+ key: z.literal("b").brand("asdfaf"),
+ // Add other properties specific to this option
+ }),
+ ]);
+
+ // type schema = z.infer;
+
+ schema.parse({ key: "a" });
+ schema.parse({ key: "b" });
+ expect(() => {
+ schema.parse({ key: "c" });
+ }).toThrow();
+});
+
+test("optional and nullable", () => {
+ const schema = z.discriminatedUnion("key", [
+ z.object({
+ key: z.literal("a").optional(),
+ a: z.literal(true),
+ }),
+ z.object({
+ key: z.literal("b").nullable(),
+ b: z.literal(true),
+ // Add other properties specific to this option
+ }),
+ ]);
+
+ type schema = z.infer;
+ z.util.assertEqual(true);
+
+ schema.parse({ key: "a", a: true });
+ schema.parse({ key: undefined, a: true });
+ schema.parse({ key: "b", b: true });
+ schema.parse({ key: null, b: true });
+ expect(() => {
+ schema.parse({ key: null, a: true });
+ }).toThrow();
+ expect(() => {
+ schema.parse({ key: "b", a: true });
+ }).toThrow();
+
+ const value = schema.parse({ key: null, b: true });
+
+ if (!("key" in value)) value.a;
+ if (value.key === undefined) value.a;
+ if (value.key === "a") value.a;
+ if (value.key === "b") value.b;
+ if (value.key === null) value.b;
+});
+
+test("readonly array of options", () => {
+ const options = [
+ z.object({ type: z.literal("x"), val: z.literal(1) }),
+ z.object({ type: z.literal("y"), val: z.literal(2) }),
+ ] as const;
+
+ expect(z.discriminatedUnion("type", options).parse({ type: "x", val: 1 })).toEqual({ type: "x", val: 1 });
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/enum.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/enum.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..53f4a3e8444766a94563777dc5e9e30d8b2b9fb5
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/enum.test.ts
@@ -0,0 +1,80 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+import { util } from "../helpers/util.js";
+
+test("create enum", () => {
+ const MyEnum = z.enum(["Red", "Green", "Blue"]);
+ expect(MyEnum.Values.Red).toEqual("Red");
+ expect(MyEnum.Enum.Red).toEqual("Red");
+ expect(MyEnum.enum.Red).toEqual("Red");
+});
+
+test("infer enum", () => {
+ const MyEnum = z.enum(["Red", "Green", "Blue"]);
+ type MyEnum = z.infer;
+ util.assertEqual(true);
+});
+
+test("get options", () => {
+ expect(z.enum(["tuna", "trout"]).options).toEqual(["tuna", "trout"]);
+});
+
+test("readonly enum", () => {
+ const HTTP_SUCCESS = ["200", "201"] as const;
+ const arg = z.enum(HTTP_SUCCESS);
+ type arg = z.infer;
+ util.assertEqual(true);
+
+ arg.parse("201");
+ expect(() => arg.parse("202")).toThrow();
+});
+
+test("error params", () => {
+ const result = z.enum(["test"], { required_error: "REQUIRED" }).safeParse(undefined);
+ expect(result.success).toEqual(false);
+ if (!result.success) {
+ expect(result.error.issues[0].message).toEqual("REQUIRED");
+ }
+});
+
+test("extract/exclude", () => {
+ const foods = ["Pasta", "Pizza", "Tacos", "Burgers", "Salad"] as const;
+ const FoodEnum = z.enum(foods);
+ const ItalianEnum = FoodEnum.extract(["Pasta", "Pizza"]);
+ const UnhealthyEnum = FoodEnum.exclude(["Salad"]);
+ const EmptyFoodEnum = FoodEnum.exclude(foods);
+
+ util.assertEqual, "Pasta" | "Pizza">(true);
+ util.assertEqual, "Pasta" | "Pizza" | "Tacos" | "Burgers">(true);
+ // @ts-expect-error TS2344
+ util.assertEqual>(true);
+ util.assertEqual, never>(true);
+});
+
+test("error map in extract/exclude", () => {
+ const foods = ["Pasta", "Pizza", "Tacos", "Burgers", "Salad"] as const;
+ const FoodEnum = z.enum(foods, {
+ errorMap: () => ({ message: "This is not food!" }),
+ });
+ const ItalianEnum = FoodEnum.extract(["Pasta", "Pizza"]);
+ const foodsError = FoodEnum.safeParse("Cucumbers");
+ const italianError = ItalianEnum.safeParse("Tacos");
+ if (!foodsError.success && !italianError.success) {
+ expect(foodsError.error.issues[0].message).toEqual(italianError.error.issues[0].message);
+ }
+
+ const UnhealthyEnum = FoodEnum.exclude(["Salad"], {
+ errorMap: () => ({ message: "This is not healthy food!" }),
+ });
+ const unhealthyError = UnhealthyEnum.safeParse("Salad");
+ if (!unhealthyError.success) {
+ expect(unhealthyError.error.issues[0].message).toEqual("This is not healthy food!");
+ }
+});
+
+test("readonly in ZodEnumDef", () => {
+ let _t!: z.ZodEnumDef;
+ _t;
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/error.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/error.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5caaa6d81b34049f0c3467872905b60b1b60438d
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/error.test.ts
@@ -0,0 +1,551 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+import { ZodError, ZodIssueCode } from "../ZodError.js";
+import { ZodParsedType } from "../helpers/util.js";
+
+test("error creation", () => {
+ const err1 = ZodError.create([]);
+ err1.addIssue({
+ code: ZodIssueCode.invalid_type,
+ expected: ZodParsedType.object,
+ received: ZodParsedType.string,
+ path: [],
+ message: "",
+ fatal: true,
+ });
+ err1.isEmpty;
+
+ const err2 = ZodError.create(err1.issues);
+ const err3 = new ZodError([]);
+ err3.addIssues(err1.issues);
+ err3.addIssue(err1.issues[0]);
+ err1.message;
+ err2.message;
+ err3.message;
+});
+
+const errorMap: z.ZodErrorMap = (error, ctx) => {
+ if (error.code === ZodIssueCode.invalid_type) {
+ if (error.expected === "string") {
+ return { message: "bad type!" };
+ }
+ }
+ if (error.code === ZodIssueCode.custom) {
+ return { message: `less-than-${error.params?.minimum}` };
+ }
+ return { message: ctx.defaultError };
+};
+
+test("type error with custom error map", () => {
+ try {
+ z.string().parse(234, { errorMap });
+ } catch (err) {
+ const zerr: z.ZodError = err as any;
+
+ expect(zerr.issues[0].code).toEqual(z.ZodIssueCode.invalid_type);
+ expect(zerr.issues[0].message).toEqual(`bad type!`);
+ }
+});
+
+test("refinement fail with params", () => {
+ try {
+ z.number()
+ .refine((val) => val >= 3, {
+ params: { minimum: 3 },
+ })
+ .parse(2, { errorMap });
+ } catch (err) {
+ const zerr: z.ZodError = err as any;
+ expect(zerr.issues[0].code).toEqual(z.ZodIssueCode.custom);
+ expect(zerr.issues[0].message).toEqual(`less-than-3`);
+ }
+});
+
+test("custom error with custom errormap", () => {
+ try {
+ z.string()
+ .refine((val) => val.length > 12, {
+ params: { minimum: 13 },
+ message: "override",
+ })
+ .parse("asdf", { errorMap });
+ } catch (err) {
+ const zerr: z.ZodError = err as any;
+ expect(zerr.issues[0].message).toEqual("override");
+ }
+});
+
+test("default error message", () => {
+ try {
+ z.number()
+ .refine((x) => x > 3)
+ .parse(2);
+ } catch (err) {
+ const zerr: z.ZodError = err as any;
+ expect(zerr.issues.length).toEqual(1);
+ expect(zerr.issues[0].message).toEqual("Invalid input");
+ }
+});
+
+test("override error in refine", () => {
+ try {
+ z.number()
+ .refine((x) => x > 3, "override")
+ .parse(2);
+ } catch (err) {
+ const zerr: z.ZodError = err as any;
+ expect(zerr.issues.length).toEqual(1);
+ expect(zerr.issues[0].message).toEqual("override");
+ }
+});
+
+test("override error in refinement", () => {
+ try {
+ z.number()
+ .refine((x) => x > 3, {
+ message: "override",
+ })
+ .parse(2);
+ } catch (err) {
+ const zerr: z.ZodError = err as any;
+ expect(zerr.issues.length).toEqual(1);
+ expect(zerr.issues[0].message).toEqual("override");
+ }
+});
+
+test("array minimum", () => {
+ try {
+ z.array(z.string()).min(3, "tooshort").parse(["asdf", "qwer"]);
+ } catch (err) {
+ const zerr: ZodError = err as any;
+ expect(zerr.issues[0].code).toEqual(ZodIssueCode.too_small);
+ expect(zerr.issues[0].message).toEqual("tooshort");
+ }
+ try {
+ z.array(z.string()).min(3).parse(["asdf", "qwer"]);
+ } catch (err) {
+ const zerr: ZodError = err as any;
+ expect(zerr.issues[0].code).toEqual(ZodIssueCode.too_small);
+ expect(zerr.issues[0].message).toEqual(`Array must contain at least 3 element(s)`);
+ }
+});
+
+// implement test for semi-smart union logic that checks for type error on either left or right
+// test("union smart errors", () => {
+// // expect.assertions(2);
+
+// const p1 = z
+// .union([z.string(), z.number().refine((x) => x > 0)])
+// .safeParse(-3.2);
+
+// if (p1.success === true) throw new Error();
+// expect(p1.success).toBe(false);
+// expect(p1.error.issues[0].code).toEqual(ZodIssueCode.custom);
+
+// const p2 = z.union([z.string(), z.number()]).safeParse(false);
+// // .catch(err => expect(err.issues[0].code).toEqual(ZodIssueCode.invalid_union));
+// if (p2.success === true) throw new Error();
+// expect(p2.success).toBe(false);
+// expect(p2.error.issues[0].code).toEqual(ZodIssueCode.invalid_union);
+// });
+
+test("custom path in custom error map", () => {
+ const schema = z.object({
+ items: z.array(z.string()).refine((data) => data.length > 3, {
+ path: ["items-too-few"],
+ }),
+ });
+
+ const errorMap: z.ZodErrorMap = (error) => {
+ expect(error.path.length).toBe(2);
+ return { message: "doesnt matter" };
+ };
+ const result = schema.safeParse({ items: ["first"] }, { errorMap });
+ expect(result.success).toEqual(false);
+ if (!result.success) {
+ expect(result.error.issues[0].path).toEqual(["items", "items-too-few"]);
+ }
+});
+
+test("error metadata from value", () => {
+ const dynamicRefine = z.string().refine(
+ (val) => val === val.toUpperCase(),
+ (val) => ({ params: { val } })
+ );
+
+ const result = dynamicRefine.safeParse("asdf");
+ expect(result.success).toEqual(false);
+ if (!result.success) {
+ const sub = result.error.issues[0];
+ expect(result.error.issues[0].code).toEqual("custom");
+ if (sub.code === "custom") {
+ expect(sub.params!.val).toEqual("asdf");
+ }
+ }
+});
+
+// test("don't call refine after validation failed", () => {
+// const asdf = z
+// .union([
+// z.number(),
+// z.string().transform(z.number(), (val) => {
+// return parseFloat(val);
+// }),
+// ])
+// .refine((v) => v >= 1);
+
+// expect(() => asdf.safeParse("foo")).not.toThrow();
+// });
+
+test("root level formatting", () => {
+ const schema = z.string().email();
+ const result = schema.safeParse("asdfsdf");
+ expect(result.success).toEqual(false);
+ if (!result.success) {
+ expect(result.error.format()._errors).toEqual(["Invalid email"]);
+ }
+});
+
+test("custom path", () => {
+ const schema = z
+ .object({
+ password: z.string(),
+ confirm: z.string(),
+ })
+ .refine((val) => val.confirm === val.password, { path: ["confirm"] });
+
+ const result = schema.safeParse({
+ password: "peanuts",
+ confirm: "qeanuts",
+ });
+
+ expect(result.success).toEqual(false);
+ if (!result.success) {
+ // nested errors
+ const error = result.error.format();
+ expect(error._errors).toEqual([]);
+ expect(error.password?._errors).toEqual(undefined);
+ expect(error.confirm?._errors).toEqual(["Invalid input"]);
+ }
+});
+
+test("custom path", () => {
+ const schema = z
+ .object({
+ password: z.string().min(6),
+ confirm: z.string().min(6),
+ })
+ .refine((val) => val.confirm === val.password);
+
+ const result = schema.safeParse({
+ password: "qwer",
+ confirm: "asdf",
+ });
+
+ expect(result.success).toEqual(false);
+ if (!result.success) {
+ expect(result.error.issues.length).toEqual(3);
+ }
+});
+
+const schema = z.object({
+ inner: z.object({
+ name: z
+ .string()
+ .refine((val) => val.length > 5)
+ .array()
+ .refine((val) => val.length <= 1),
+ }),
+});
+
+test("no abort early on refinements", () => {
+ const invalidItem = {
+ inner: { name: ["aasd", "asdfasdfasfd"] },
+ };
+
+ const result1 = schema.safeParse(invalidItem);
+ expect(result1.success).toEqual(false);
+ if (!result1.success) {
+ expect(result1.error.issues.length).toEqual(2);
+ }
+});
+test("formatting", () => {
+ const invalidItem = {
+ inner: { name: ["aasd", "asdfasdfasfd"] },
+ };
+ const invalidArray = {
+ inner: { name: ["asdfasdf", "asdfasdfasfd"] },
+ };
+ const result1 = schema.safeParse(invalidItem);
+ const result2 = schema.safeParse(invalidArray);
+
+ expect(result1.success).toEqual(false);
+ expect(result2.success).toEqual(false);
+ if (!result1.success) {
+ const error = result1.error.format();
+
+ expect(error._errors).toEqual([]);
+ expect(error.inner?._errors).toEqual([]);
+ // expect(error.inner?.name?._errors).toEqual(["Invalid input"]);
+ // expect(error.inner?.name?.[0]._errors).toEqual(["Invalid input"]);
+ expect(error.inner?.name?.[1]).toEqual(undefined);
+ }
+ if (!result2.success) {
+ type FormattedError = z.inferFormattedError;
+ const error: FormattedError = result2.error.format();
+ expect(error._errors).toEqual([]);
+ expect(error.inner?._errors).toEqual([]);
+ expect(error.inner?.name?._errors).toEqual(["Invalid input"]);
+ expect(error.inner?.name?.[0]).toEqual(undefined);
+ expect(error.inner?.name?.[1]).toEqual(undefined);
+ expect(error.inner?.name?.[2]).toEqual(undefined);
+ }
+
+ // test custom mapper
+ if (!result2.success) {
+ type FormattedError = z.inferFormattedError;
+ const error: FormattedError = result2.error.format(() => 5);
+ expect(error._errors).toEqual([]);
+ expect(error.inner?._errors).toEqual([]);
+ expect(error.inner?.name?._errors).toEqual([5]);
+ }
+});
+
+test("formatting with nullable and optional fields", () => {
+ const nameSchema = z.string().refine((val) => val.length > 5);
+ const schema = z.object({
+ nullableObject: z.object({ name: nameSchema }).nullable(),
+ nullableArray: z.array(nameSchema).nullable(),
+ nullableTuple: z.tuple([nameSchema, nameSchema, z.number()]).nullable(),
+ optionalObject: z.object({ name: nameSchema }).optional(),
+ optionalArray: z.array(nameSchema).optional(),
+ optionalTuple: z.tuple([nameSchema, nameSchema, z.number()]).optional(),
+ });
+ const invalidItem = {
+ nullableObject: { name: "abcd" },
+ nullableArray: ["abcd"],
+ nullableTuple: ["abcd", "abcd", 1],
+ optionalObject: { name: "abcd" },
+ optionalArray: ["abcd"],
+ optionalTuple: ["abcd", "abcd", 1],
+ };
+ const result = schema.safeParse(invalidItem);
+ expect(result.success).toEqual(false);
+ if (!result.success) {
+ type FormattedError = z.inferFormattedError;
+ const error: FormattedError = result.error.format();
+ expect(error._errors).toEqual([]);
+ expect(error.nullableObject?._errors).toEqual([]);
+ expect(error.nullableObject?.name?._errors).toEqual(["Invalid input"]);
+ expect(error.nullableArray?._errors).toEqual([]);
+ expect(error.nullableArray?.[0]?._errors).toEqual(["Invalid input"]);
+ expect(error.nullableTuple?._errors).toEqual([]);
+ expect(error.nullableTuple?.[0]?._errors).toEqual(["Invalid input"]);
+ expect(error.nullableTuple?.[1]?._errors).toEqual(["Invalid input"]);
+ expect(error.optionalObject?._errors).toEqual([]);
+ expect(error.optionalObject?.name?._errors).toEqual(["Invalid input"]);
+ expect(error.optionalArray?._errors).toEqual([]);
+ expect(error.optionalArray?.[0]?._errors).toEqual(["Invalid input"]);
+ expect(error.optionalTuple?._errors).toEqual([]);
+ expect(error.optionalTuple?.[0]?._errors).toEqual(["Invalid input"]);
+ expect(error.optionalTuple?.[1]?._errors).toEqual(["Invalid input"]);
+ }
+});
+
+const stringWithCustomError = z.string({
+ errorMap: (issue, ctx) => ({
+ message: issue.code === "invalid_type" ? (ctx.data ? "Invalid name" : "Name is required") : ctx.defaultError,
+ }),
+});
+
+test("schema-bound error map", () => {
+ const result = stringWithCustomError.safeParse(1234);
+ expect(result.success).toEqual(false);
+ if (!result.success) {
+ expect(result.error.issues[0].message).toEqual("Invalid name");
+ }
+
+ const result2 = stringWithCustomError.safeParse(undefined);
+ expect(result2.success).toEqual(false);
+ if (!result2.success) {
+ expect(result2.error.issues[0].message).toEqual("Name is required");
+ }
+
+ // support contextual override
+ const result3 = stringWithCustomError.safeParse(undefined, {
+ errorMap: () => ({ message: "OVERRIDE" }),
+ });
+ expect(result3.success).toEqual(false);
+ if (!result3.success) {
+ expect(result3.error.issues[0].message).toEqual("OVERRIDE");
+ }
+});
+
+test("overrideErrorMap", () => {
+ // support overrideErrorMap
+ z.setErrorMap(() => ({ message: "OVERRIDE" }));
+ const result4 = stringWithCustomError.min(10).safeParse("tooshort");
+ expect(result4.success).toEqual(false);
+ if (!result4.success) {
+ expect(result4.error.issues[0].message).toEqual("OVERRIDE");
+ }
+ z.setErrorMap(z.defaultErrorMap);
+});
+
+test("invalid and required", () => {
+ const str = z.string({
+ invalid_type_error: "Invalid name",
+ required_error: "Name is required",
+ });
+ const result1 = str.safeParse(1234);
+ expect(result1.success).toEqual(false);
+ if (!result1.success) {
+ expect(result1.error.issues[0].message).toEqual("Invalid name");
+ }
+ const result2 = str.safeParse(undefined);
+ expect(result2.success).toEqual(false);
+ if (!result2.success) {
+ expect(result2.error.issues[0].message).toEqual("Name is required");
+ }
+});
+
+test("Fallback to default required error", () => {
+ const str = z.string({
+ invalid_type_error: "Invalid name",
+ // required_error: "Name is required",
+ });
+
+ const result2 = str.safeParse(undefined);
+ expect(result2.success).toEqual(false);
+ if (!result2.success) {
+ expect(result2.error.issues[0].message).toEqual("Required");
+ }
+});
+
+test("invalid and required and errorMap", () => {
+ expect(() => {
+ return z.string({
+ invalid_type_error: "Invalid name",
+ required_error: "Name is required",
+ errorMap: () => ({ message: "OVERRIDE" }),
+ });
+ }).toThrow();
+});
+
+test("strict error message", () => {
+ const errorMsg = "Invalid object";
+ const obj = z.object({ x: z.string() }).strict(errorMsg);
+ const result = obj.safeParse({ x: "a", y: "b" });
+ expect(result.success).toEqual(false);
+ if (!result.success) {
+ expect(result.error.issues[0].message).toEqual(errorMsg);
+ }
+});
+
+test("enum error message, invalid enum elementstring", () => {
+ try {
+ z.enum(["Tuna", "Trout"]).parse("Salmon");
+ } catch (err) {
+ const zerr: z.ZodError = err as any;
+ expect(zerr.issues.length).toEqual(1);
+ expect(zerr.issues[0].message).toEqual("Invalid enum value. Expected 'Tuna' | 'Trout', received 'Salmon'");
+ }
+});
+
+test("enum error message, invalid type", () => {
+ try {
+ z.enum(["Tuna", "Trout"]).parse(12);
+ } catch (err) {
+ const zerr: z.ZodError = err as any;
+ expect(zerr.issues.length).toEqual(1);
+ expect(zerr.issues[0].message).toEqual("Expected 'Tuna' | 'Trout', received number");
+ }
+});
+
+test("nativeEnum default error message", () => {
+ enum Fish {
+ Tuna = "Tuna",
+ Trout = "Trout",
+ }
+ try {
+ z.nativeEnum(Fish).parse("Salmon");
+ } catch (err) {
+ const zerr: z.ZodError = err as any;
+ expect(zerr.issues.length).toEqual(1);
+ expect(zerr.issues[0].message).toEqual("Invalid enum value. Expected 'Tuna' | 'Trout', received 'Salmon'");
+ }
+});
+
+test("literal default error message", () => {
+ try {
+ z.literal("Tuna").parse("Trout");
+ } catch (err) {
+ const zerr: z.ZodError = err as any;
+ expect(zerr.issues.length).toEqual(1);
+ expect(zerr.issues[0].message).toEqual(`Invalid literal value, expected "Tuna"`);
+ }
+});
+
+test("literal bigint default error message", () => {
+ try {
+ z.literal(BigInt(12)).parse(BigInt(13));
+ } catch (err) {
+ const zerr: z.ZodError = err as any;
+ expect(zerr.issues.length).toEqual(1);
+ expect(zerr.issues[0].message).toEqual(`Invalid literal value, expected "12"`);
+ }
+});
+
+test("enum with message returns the custom error message", () => {
+ const schema = z.enum(["apple", "banana"], {
+ message: "the value provided is invalid",
+ });
+
+ const result1 = schema.safeParse("berries");
+ expect(result1.success).toEqual(false);
+ if (!result1.success) {
+ expect(result1.error.issues[0].message).toEqual("the value provided is invalid");
+ }
+
+ const result2 = schema.safeParse(undefined);
+ expect(result2.success).toEqual(false);
+ if (!result2.success) {
+ expect(result2.error.issues[0].message).toEqual("the value provided is invalid");
+ }
+
+ const result3 = schema.safeParse("banana");
+ expect(result3.success).toEqual(true);
+
+ const result4 = schema.safeParse(null);
+ expect(result4.success).toEqual(false);
+ if (!result4.success) {
+ expect(result4.error.issues[0].message).toEqual("the value provided is invalid");
+ }
+});
+
+test("when the message is falsy, it is used as is provided", () => {
+ const schema = z.string().max(1, { message: "" });
+ const result = schema.safeParse("asdf");
+ expect(result.success).toEqual(false);
+ if (!result.success) {
+ expect(result.error.issues[0].message).toEqual("");
+ }
+});
+
+// test("dont short circuit on continuable errors", () => {
+// const user = z
+// .object({
+// password: z.string().min(6),
+// confirm: z.string(),
+// })
+// .refine((data) => data.password === data.confirm, {
+// message: "Passwords don't match",
+// path: ["confirm"],
+// });
+// const result = user.safeParse({ password: "asdf", confirm: "qwer" });
+// if (!result.success) {
+// expect(result.error.issues.length).toEqual(2);
+// }
+// });
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/firstparty.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/firstparty.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..017a1c13e48a2570642ce99d66b345020e3ca0aa
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/firstparty.test.ts
@@ -0,0 +1,87 @@
+// @ts-ignore TS6133
+import { test } from "vitest";
+
+import * as z from "zod/v3";
+import { util } from "../helpers/util.js";
+
+test("first party switch", () => {
+ const myType = z.string() as z.ZodFirstPartySchemaTypes;
+ const def = myType._def;
+
+ switch (def.typeName) {
+ case z.ZodFirstPartyTypeKind.ZodString:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodNumber:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodNaN:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodBigInt:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodBoolean:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodDate:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodUndefined:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodNull:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodAny:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodUnknown:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodNever:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodVoid:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodArray:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodObject:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodUnion:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodIntersection:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodTuple:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodRecord:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodMap:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodSet:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodFunction:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodLazy:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodLiteral:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodEnum:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodEffects:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodNativeEnum:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodOptional:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodNullable:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodDefault:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodCatch:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodPromise:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodBranded:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodPipeline:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodSymbol:
+ break;
+ case z.ZodFirstPartyTypeKind.ZodReadonly:
+ break;
+ default:
+ util.assertNever(def);
+ }
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ad397d8b8eb5ea9df3bf7af27662cf073fd5f2d9
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts
@@ -0,0 +1,21 @@
+// @ts-ignore TS6133
+import { test } from "vitest";
+
+import type { ZodFirstPartySchemaTypes, ZodFirstPartyTypeKind } from "zod/v3";
+import { util } from "../helpers/util.js";
+
+test("Identify missing [ZodFirstPartySchemaTypes]", () => {
+ type ZodFirstPartySchemaForType = ZodFirstPartySchemaTypes extends infer Schema
+ ? Schema extends { _def: { typeName: T } }
+ ? Schema
+ : never
+ : never;
+ type ZodMappedTypes = {
+ [key in ZodFirstPartyTypeKind]: ZodFirstPartySchemaForType;
+ };
+ type ZodFirstPartySchemaTypesMissingFromUnion = keyof {
+ [key in keyof ZodMappedTypes as ZodMappedTypes[key] extends { _def: never } ? key : never]: unknown;
+ };
+
+ util.assertEqual(true);
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/function.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/function.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a0f03bb5c15574b403ac0cc30d7f305121476c84
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/function.test.ts
@@ -0,0 +1,257 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+import { util } from "../helpers/util.js";
+
+const args1 = z.tuple([z.string()]);
+const returns1 = z.number();
+const func1 = z.function(args1, returns1);
+
+test("function parsing", () => {
+ const parsed = func1.parse((arg: any) => arg.length);
+ parsed("asdf");
+});
+
+test("parsed function fail 1", () => {
+ const parsed = func1.parse((x: string) => x);
+ expect(() => parsed("asdf")).toThrow();
+});
+
+test("parsed function fail 2", () => {
+ const parsed = func1.parse((x: string) => x);
+ expect(() => parsed(13 as any)).toThrow();
+});
+
+test("function inference 1", () => {
+ type func1 = z.TypeOf;
+ util.assertEqual number>(true);
+});
+
+test("method parsing", () => {
+ const methodObject = z.object({
+ property: z.number(),
+ method: z.function().args(z.string()).returns(z.number()),
+ });
+ const methodInstance = {
+ property: 3,
+ method: function (s: string) {
+ return s.length + this.property;
+ },
+ };
+ const parsed = methodObject.parse(methodInstance);
+ expect(parsed.method("length=8")).toBe(11); // 8 length + 3 property
+});
+
+test("async method parsing", async () => {
+ const methodObject = z.object({
+ property: z.number(),
+ method: z.function().args(z.string()).returns(z.promise(z.number())),
+ });
+ const methodInstance = {
+ property: 3,
+ method: async function (s: string) {
+ return s.length + this.property;
+ },
+ };
+ const parsed = methodObject.parse(methodInstance);
+ expect(await parsed.method("length=8")).toBe(11); // 8 length + 3 property
+});
+
+test("args method", () => {
+ const t1 = z.function();
+ type t1 = z.infer;
+ util.assertEqual unknown>(true);
+
+ const t2 = t1.args(z.string());
+ type t2 = z.infer;
+ util.assertEqual unknown>(true);
+
+ const t3 = t2.returns(z.boolean());
+ type t3 = z.infer;
+ util.assertEqual boolean>(true);
+});
+
+const args2 = z.tuple([
+ z.object({
+ f1: z.number(),
+ f2: z.string().nullable(),
+ f3: z.array(z.boolean().optional()).optional(),
+ }),
+]);
+const returns2 = z.union([z.string(), z.number()]);
+
+const func2 = z.function(args2, returns2);
+
+test("function inference 2", () => {
+ type func2 = z.TypeOf;
+ util.assertEqual<
+ func2,
+ (arg: {
+ f1: number;
+ f2: string | null;
+ f3?: (boolean | undefined)[] | undefined;
+ }) => string | number
+ >(true);
+});
+
+test("valid function run", () => {
+ const validFunc2Instance = func2.validate((_x) => {
+ return "adf" as any;
+ });
+
+ const checker = () => {
+ validFunc2Instance({
+ f1: 21,
+ f2: "asdf",
+ f3: [true, false],
+ });
+ };
+
+ checker();
+});
+
+test("input validation error", () => {
+ const invalidFuncInstance = func2.validate((_x) => {
+ return "adf" as any;
+ });
+
+ const checker = () => {
+ invalidFuncInstance("Invalid_input" as any);
+ };
+
+ expect(checker).toThrow();
+});
+
+test("output validation error", () => {
+ const invalidFuncInstance = func2.validate((_x) => {
+ return ["this", "is", "not", "valid", "output"] as any;
+ });
+
+ const checker = () => {
+ invalidFuncInstance({
+ f1: 21,
+ f2: "asdf",
+ f3: [true, false],
+ });
+ };
+
+ expect(checker).toThrow();
+});
+
+z.function(z.tuple([z.string()])).args()._def.args;
+
+test("special function error codes", () => {
+ const checker = z.function(z.tuple([z.string()]), z.boolean()).implement((arg) => {
+ return arg.length as any;
+ });
+ try {
+ checker("12" as any);
+ } catch (err) {
+ const zerr = err as z.ZodError;
+ const first = zerr.issues[0];
+ if (first.code !== z.ZodIssueCode.invalid_return_type) throw new Error();
+
+ expect(first.returnTypeError).toBeInstanceOf(z.ZodError);
+ }
+
+ try {
+ checker(12 as any);
+ } catch (err) {
+ const zerr = err as z.ZodError;
+ const first = zerr.issues[0];
+ if (first.code !== z.ZodIssueCode.invalid_arguments) throw new Error();
+ expect(first.argumentsError).toBeInstanceOf(z.ZodError);
+ }
+});
+
+test("function with async refinements", async () => {
+ const func = z
+ .function()
+ .args(z.string().refine(async (val) => val.length > 10))
+ .returns(z.promise(z.number().refine(async (val) => val > 10)))
+ .implement(async (val) => {
+ return val.length;
+ });
+ const results = [];
+ try {
+ await func("asdfasdf");
+ results.push("success");
+ } catch (_err) {
+ results.push("fail");
+ }
+ try {
+ await func("asdflkjasdflkjsf");
+ results.push("success");
+ } catch (_err) {
+ results.push("fail");
+ }
+
+ expect(results).toEqual(["fail", "success"]);
+});
+
+test("non async function with async refinements should fail", async () => {
+ const func = z
+ .function()
+ .args(z.string().refine(async (val) => val.length > 10))
+ .returns(z.number().refine(async (val) => val > 10))
+ .implement((val) => {
+ return val.length;
+ });
+
+ const results = [];
+ try {
+ await func("asdasdfasdffasdf");
+ results.push("success");
+ } catch (_err) {
+ results.push("fail");
+ }
+
+ expect(results).toEqual(["fail"]);
+});
+
+test("allow extra parameters", () => {
+ const maxLength5 = z
+ .function()
+ .args(z.string())
+ .returns(z.boolean())
+ .implement((str, _arg, _qewr) => {
+ return str.length <= 5;
+ });
+
+ const filteredList = ["apple", "orange", "pear", "banana", "strawberry"].filter(maxLength5);
+ expect(filteredList.length).toEqual(2);
+});
+
+test("params and returnType getters", () => {
+ const func = z.function().args(z.string()).returns(z.string());
+
+ func.parameters().items[0].parse("asdf");
+ func.returnType().parse("asdf");
+});
+
+test("inference with transforms", () => {
+ const funcSchema = z
+ .function()
+ .args(z.string().transform((val) => val.length))
+ .returns(z.object({ val: z.number() }));
+ const myFunc = funcSchema.implement((val) => {
+ return { val, extra: "stuff" };
+ });
+ myFunc("asdf");
+
+ util.assertEqual { val: number; extra: string }>(true);
+});
+
+test("fallback to OuterTypeOfFunction", () => {
+ const funcSchema = z
+ .function()
+ .args(z.string().transform((val) => val.length))
+ .returns(z.object({ arg: z.number() }).transform((val) => val.arg));
+
+ const myFunc = funcSchema.implement((val) => {
+ return { arg: val, arg2: false };
+ });
+
+ util.assertEqual number>(true);
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/generics.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/generics.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e0af470f07639a56497f748d520db2d13b82c56c
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/generics.test.ts
@@ -0,0 +1,48 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+import { util } from "../helpers/util.js";
+
+test("generics", () => {
+ async function stripOuter(schema: TData, data: unknown) {
+ return z
+ .object({
+ nested: schema, // as z.ZodTypeAny,
+ })
+ .transform((data) => {
+ return data.nested!;
+ })
+ .parse({ nested: data });
+ }
+
+ const result = stripOuter(z.object({ a: z.string() }), { a: "asdf" });
+ util.assertEqual>(true);
+});
+
+// test("assignability", () => {
+// const createSchemaAndParse = (
+// key: K,
+// valueSchema: VS,
+// data: unknown
+// ) => {
+// const schema = z.object({
+// [key]: valueSchema,
+// } as { [k in K]: VS });
+// return { [key]: valueSchema };
+// const parsed = schema.parse(data);
+// return parsed;
+// // const inferred: z.infer> = parsed;
+// // return inferred;
+// };
+// const parsed = createSchemaAndParse("foo", z.string(), { foo: "" });
+// util.assertEqual(true);
+// });
+
+test("nested no undefined", () => {
+ const inner = z.string().or(z.array(z.string()));
+ const outer = z.object({ inner });
+ type outerSchema = z.infer;
+ z.util.assertEqual(true);
+ expect(outer.safeParse({ inner: undefined }).success).toEqual(false);
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/instanceof.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/instanceof.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..de66f3f09f9127d970f431d7d54e12d9a38e0f43
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/instanceof.test.ts
@@ -0,0 +1,37 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+import { util } from "../helpers/util.js";
+
+test("instanceof", async () => {
+ class Test {}
+ class Subtest extends Test {}
+ abstract class AbstractBar {
+ constructor(public val: string) {}
+ }
+ class Bar extends AbstractBar {}
+
+ const TestSchema = z.instanceof(Test);
+ const SubtestSchema = z.instanceof(Subtest);
+ const AbstractSchema = z.instanceof(AbstractBar);
+ const BarSchema = z.instanceof(Bar);
+
+ TestSchema.parse(new Test());
+ TestSchema.parse(new Subtest());
+ SubtestSchema.parse(new Subtest());
+ AbstractSchema.parse(new Bar("asdf"));
+ const bar = BarSchema.parse(new Bar("asdf"));
+ expect(bar.val).toEqual("asdf");
+
+ await expect(() => SubtestSchema.parse(new Test())).toThrow(/Input not instance of Subtest/);
+ await expect(() => TestSchema.parse(12)).toThrow(/Input not instance of Test/);
+
+ util.assertEqual>(true);
+});
+
+test("instanceof fatal", () => {
+ const schema = z.instanceof(Date).refine((d) => d.toString());
+ const res = schema.safeParse(null);
+ expect(res.success).toBe(false);
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/intersection.test.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/intersection.test.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6d7936c199ca6202d32b84d47fe17719c68511b3
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/intersection.test.ts
@@ -0,0 +1,110 @@
+// @ts-ignore TS6133
+import { expect, test } from "vitest";
+
+import * as z from "zod/v3";
+
+test("object intersection", () => {
+ const BaseTeacher = z.object({
+ subjects: z.array(z.string()),
+ });
+ const HasID = z.object({ id: z.string() });
+
+ const Teacher = z.intersection(BaseTeacher.passthrough(), HasID); // BaseTeacher.merge(HasID);
+ const data = {
+ subjects: ["math"],
+ id: "asdfasdf",
+ };
+ expect(Teacher.parse(data)).toEqual(data);
+ expect(() => Teacher.parse({ subject: data.subjects })).toThrow();
+ expect(Teacher.parse({ ...data, extra: 12 })).toEqual({ ...data, extra: 12 });
+
+ expect(() => z.intersection(BaseTeacher.strict(), HasID).parse({ ...data, extra: 12 })).toThrow();
+});
+
+test("deep intersection", () => {
+ const Animal = z.object({
+ properties: z.object({
+ is_animal: z.boolean(),
+ }),
+ });
+ const Cat = z
+ .object({
+ properties: z.object({
+ jumped: z.boolean(),
+ }),
+ })
+ .and(Animal);
+
+ type _Cat = z.infer;
+ // const cat:Cat = 'asdf' as any;
+ const cat = Cat.parse({ properties: { is_animal: true, jumped: true } });
+ expect(cat.properties).toEqual({ is_animal: true, jumped: true });
+});
+
+test("deep intersection of arrays", async () => {
+ const Author = z.object({
+ posts: z.array(
+ z.object({
+ post_id: z.number(),
+ })
+ ),
+ });
+ const Registry = z
+ .object({
+ posts: z.array(
+ z.object({
+ title: z.string(),
+ })
+ ),
+ })
+ .and(Author);
+
+ const posts = [
+ { post_id: 1, title: "Novels" },
+ { post_id: 2, title: "Fairy tales" },
+ ];
+ const cat = Registry.parse({ posts });
+ expect(cat.posts).toEqual(posts);
+ const asyncCat = await Registry.parseAsync({ posts });
+ expect(asyncCat.posts).toEqual(posts);
+});
+
+test("invalid intersection types", async () => {
+ const numberIntersection = z.intersection(
+ z.number(),
+ z.number().transform((x) => x + 1)
+ );
+
+ const syncResult = numberIntersection.safeParse(1234);
+ expect(syncResult.success).toEqual(false);
+ if (!syncResult.success) {
+ expect(syncResult.error.issues[0].code).toEqual(z.ZodIssueCode.invalid_intersection_types);
+ }
+
+ const asyncResult = await numberIntersection.spa(1234);
+ expect(asyncResult.success).toEqual(false);
+ if (!asyncResult.success) {
+ expect(asyncResult.error.issues[0].code).toEqual(z.ZodIssueCode.invalid_intersection_types);
+ }
+});
+
+test("invalid array merge", async () => {
+ const stringArrInt = z.intersection(
+ z.string().array(),
+ z
+ .string()
+ .array()
+ .transform((val) => [...val, "asdf"])
+ );
+ const syncResult = stringArrInt.safeParse(["asdf", "qwer"]);
+ expect(syncResult.success).toEqual(false);
+ if (!syncResult.success) {
+ expect(syncResult.error.issues[0].code).toEqual(z.ZodIssueCode.invalid_intersection_types);
+ }
+
+ const asyncResult = await stringArrInt.spa(["asdf", "qwer"]);
+ expect(asyncResult.success).toEqual(false);
+ if (!asyncResult.success) {
+ expect(asyncResult.error.issues[0].code).toEqual(z.ZodIssueCode.invalid_intersection_types);
+ }
+});
diff --git a/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/language-server.source.ts b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/language-server.source.ts
new file mode 100644
index 0000000000000000000000000000000000000000..cbe818bb3783a8d625a9c6fa8eb08c0db6829b77
--- /dev/null
+++ b/node_modules/@jimp/plugin-rotate/node_modules/zod/src/v3/tests/language-server.source.ts
@@ -0,0 +1,76 @@
+import * as z from "zod/v3";
+
+export const filePath = __filename;
+
+// z.object()
+
+export const Test = z.object({
+ f1: z.number(),
+});
+
+export type Test = z.infer;
+
+export const instanceOfTest: Test = {
+ f1: 1,
+};
+
+// z.object().merge()
+
+export const TestMerge = z
+ .object({
+ f2: z.string().optional(),
+ })
+ .merge(Test);
+
+export type TestMerge = z.infer