@rpgjs/client 5.0.0-alpha.22 → 5.0.0-alpha.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Game/Object.d.ts +2 -0
- package/dist/RpgClientEngine.d.ts +115 -9
- package/dist/components/gui/mobile/index.d.ts +8 -0
- package/dist/components/prebuilt/index.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +13 -8
- package/dist/index.js.map +1 -1
- package/dist/index10.js +1 -1
- package/dist/index11.js +6 -5
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +2 -2
- package/dist/index13.js +102 -10
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +67 -9
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +10 -263
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +9 -97
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +300 -89
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +63 -80
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +96 -348
- package/dist/index19.js.map +1 -1
- package/dist/index2.js +176 -24
- package/dist/index2.js.map +1 -1
- package/dist/index20.js +360 -17
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +19 -50
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +212 -5
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +6 -395
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +4 -39
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +19 -20
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +43 -2624
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +5 -110
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +394 -65
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +40 -15
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +3 -3
- package/dist/index30.js +21 -23
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +2624 -86
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +107 -34
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +69 -22
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +19 -3
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +21 -329
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +91 -30
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +37 -7
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +22 -9
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +139 -10
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +3 -3
- package/dist/index40.js +16 -6
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +1 -325
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +530 -3680
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +24 -67
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +9 -184
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +6 -503
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +325 -2
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +3687 -17
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +69 -202
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +182 -7
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.js +497 -106
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +48 -130
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +17 -134
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +3 -109
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +9 -138
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +111 -7
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +130 -48
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +137 -0
- package/dist/index57.js.map +1 -0
- package/dist/index58.js +112 -0
- package/dist/index58.js.map +1 -0
- package/dist/index59.js +9 -0
- package/dist/index59.js.map +1 -0
- package/dist/index6.js +1 -1
- package/dist/index7.js +1 -1
- package/dist/index8.js +17 -2
- package/dist/index8.js.map +1 -1
- package/dist/index9.js +10 -27
- package/dist/index9.js.map +1 -1
- package/dist/services/keyboardControls.d.ts +1 -2
- package/dist/services/mmorpg.d.ts +1 -1
- package/dist/services/standalone.d.ts +1 -1
- package/package.json +9 -9
- package/src/Game/Object.ts +8 -0
- package/src/Gui/Gui.ts +4 -31
- package/src/RpgClientEngine.ts +193 -20
- package/src/components/character.ce +146 -9
- package/src/components/gui/mobile/index.ts +24 -0
- package/src/components/gui/mobile/mobile.ce +80 -0
- package/src/components/prebuilt/index.ts +1 -0
- package/src/components/prebuilt/light-halo.ce +148 -0
- package/src/components/scenes/canvas.ce +2 -2
- package/src/components/scenes/event-layer.ce +1 -0
- package/src/components/scenes/transition.ce +60 -0
- package/src/index.ts +6 -1
- package/src/module.ts +15 -0
- package/src/services/keyboardControls.ts +1 -1
package/dist/index53.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index53.js","sources":["../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js"],"sourcesContent":["import { ZodIssueCode } from \"../ZodError.js\";\nimport { util, ZodParsedType } from \"../helpers/util.js\";\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"bigint\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\nexport default errorMap;\n"],"names":[],"mappings":";;;AAEK,MAAC,QAAQ,GAAG,CAAC,KAAK,EAAE,IAAI,KAAK;AAClC,IAAI,IAAI,OAAO;AACf,IAAI,QAAQ,KAAK,CAAC,IAAI;AACtB,QAAQ,KAAK,YAAY,CAAC,YAAY;AACtC,YAAY,IAAI,KAAK,CAAC,QAAQ,KAAK,aAAa,CAAC,SAAS,EAAE;AAC5D,gBAAgB,OAAO,GAAG,UAAU;AACpC,YAAY;AACZ,iBAAiB;AACjB,gBAAgB,OAAO,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;AAClF,YAAY;AACZ,YAAY;AACZ,QAAQ,KAAK,YAAY,CAAC,eAAe;AACzC,YAAY,OAAO,GAAG,CAAC,gCAAgC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC;AACrH,YAAY;AACZ,QAAQ,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YAAY,OAAO,GAAG,CAAC,aAAa,CAAC;AACrC,YAAY;AACZ,QAAQ,KAAK,YAAY,CAAC,0BAA0B;AACpD,YAAY,OAAO,GAAG,CAAC,wCAAwC,CAAC;AAChE,YAAY;AACZ,QAAQ,KAAK,YAAY,CAAC,eAAe;AACzC,YAAY,OAAO,GAAG,CAAC,6BAA6B,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;AACxE,YAAY;AACZ,QAAQ,KAAK,YAAY,CAAC,UAAU;AACpC,YAAY,OAAO,GAAG,uBAAuB;AAC7C,YAAY;AACZ,QAAQ;AACR,YAAY,OAAO,GAAG,IAAI,CAAC,YAAY;AACvC,YAAY,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AACnC;AACA,IAAI,OAAO,EAAE,OAAO,EAAE;AACtB;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index53.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/index54.js
CHANGED
|
@@ -1,141 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { parseDynamicValue } from './index56.js';
|
|
1
|
+
import errorMap from './index58.js';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
12
|
-
t[p] = s[p];
|
|
13
|
-
}
|
|
14
|
-
return t;
|
|
15
|
-
};
|
|
16
|
-
return __assign.apply(this, arguments);
|
|
17
|
-
};
|
|
18
|
-
var object = defineProps().object;
|
|
19
|
-
var component = object._component;
|
|
20
|
-
var parseNumericStyleValue = function (value, object) {
|
|
21
|
-
if (value === undefined || value === null) {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
if (typeof value === 'number') {
|
|
25
|
-
return value;
|
|
26
|
-
}
|
|
27
|
-
if (typeof value === 'string') {
|
|
28
|
-
// Check if it contains dynamic references
|
|
29
|
-
if (value.includes('{')) {
|
|
30
|
-
// Parse dynamic value and convert to number
|
|
31
|
-
var parsed_1 = parseDynamicValue(value, object);
|
|
32
|
-
return computed(function () {
|
|
33
|
-
var str = parsed_1();
|
|
34
|
-
var num = parseFloat(str);
|
|
35
|
-
return isNaN(num) ? 0 : num;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
// Simple string number, convert directly
|
|
40
|
-
var num = parseFloat(value);
|
|
41
|
-
return isNaN(num) ? undefined : num;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return value;
|
|
45
|
-
};
|
|
46
|
-
var getComponentStyle = function (component) {
|
|
47
|
-
if (!component.style) {
|
|
48
|
-
return {};
|
|
49
|
-
}
|
|
50
|
-
var style = component.style;
|
|
51
|
-
var result = {};
|
|
52
|
-
// Map fill to color (shortcut property)
|
|
53
|
-
// fill can be a string (hex color) or a dynamic string
|
|
54
|
-
if (style.fill !== undefined) {
|
|
55
|
-
if (typeof style.fill === 'string' && style.fill.includes('{')) {
|
|
56
|
-
result.color = parseDynamicValue(style.fill, object);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
result.color = style.fill;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
// Map fontSize to size (shortcut property)
|
|
63
|
-
// fontSize can be number or string (with dynamic references)
|
|
64
|
-
if (style.fontSize !== undefined) {
|
|
65
|
-
var fontSizeValue = parseNumericStyleValue(style.fontSize, object);
|
|
66
|
-
if (fontSizeValue !== undefined) {
|
|
67
|
-
result.size = fontSizeValue;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
// Map fontFamily (shortcut property)
|
|
71
|
-
if (style.fontFamily !== undefined) {
|
|
72
|
-
if (typeof style.fontFamily === 'string' && style.fontFamily.includes('{')) {
|
|
73
|
-
result.fontFamily = parseDynamicValue(style.fontFamily, object);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
result.fontFamily = style.fontFamily;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
// Build style object for PixiJS Text properties
|
|
80
|
-
var textStyle = {};
|
|
81
|
-
// Font style properties
|
|
82
|
-
if (style.fontStyle !== undefined) {
|
|
83
|
-
if (typeof style.fontStyle === 'string' && style.fontStyle.includes('{')) {
|
|
84
|
-
textStyle.fontStyle = parseDynamicValue(style.fontStyle, object);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
textStyle.fontStyle = style.fontStyle;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (style.fontWeight !== undefined) {
|
|
91
|
-
if (typeof style.fontWeight === 'string' && style.fontWeight.includes('{')) {
|
|
92
|
-
textStyle.fontWeight = parseDynamicValue(style.fontWeight, object);
|
|
93
|
-
}
|
|
94
|
-
else if (typeof style.fontWeight === 'number') {
|
|
95
|
-
textStyle.fontWeight = style.fontWeight;
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
textStyle.fontWeight = style.fontWeight;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
// Stroke properties
|
|
102
|
-
if (style.stroke !== undefined) {
|
|
103
|
-
if (typeof style.stroke === 'string' && style.stroke.includes('{')) {
|
|
104
|
-
textStyle.stroke = parseDynamicValue(style.stroke, object);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
textStyle.stroke = style.stroke;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
// Opacity (can be number or string)
|
|
111
|
-
if (style.opacity !== undefined) {
|
|
112
|
-
var opacityValue = parseNumericStyleValue(style.opacity, object);
|
|
113
|
-
if (opacityValue !== undefined) {
|
|
114
|
-
textStyle.opacity = opacityValue;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
// Word wrap
|
|
118
|
-
if (style.wordWrap !== undefined) {
|
|
119
|
-
textStyle.wordWrap = style.wordWrap;
|
|
120
|
-
}
|
|
121
|
-
// Text alignment
|
|
122
|
-
if (style.align !== undefined) {
|
|
123
|
-
if (typeof style.align === 'string' && style.align.includes('{')) {
|
|
124
|
-
textStyle.align = parseDynamicValue(style.align, object);
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
textStyle.align = style.align;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
// Only add style prop if there are style properties
|
|
131
|
-
if (Object.keys(textStyle).length > 0) {
|
|
132
|
-
result.style = textStyle;
|
|
133
|
-
}
|
|
134
|
-
return result;
|
|
135
|
-
};
|
|
136
|
-
let $this = h(Text, { text: parseDynamicValue(component.value, object), ...getComponentStyle(component) });
|
|
137
|
-
return $this
|
|
138
|
-
}
|
|
3
|
+
let overrideErrorMap = errorMap;
|
|
4
|
+
function setErrorMap(map) {
|
|
5
|
+
overrideErrorMap = map;
|
|
6
|
+
}
|
|
7
|
+
function getErrorMap() {
|
|
8
|
+
return overrideErrorMap;
|
|
9
|
+
}
|
|
139
10
|
|
|
140
|
-
export {
|
|
11
|
+
export { errorMap as defaultErrorMap, getErrorMap, setErrorMap };
|
|
141
12
|
//# sourceMappingURL=index54.js.map
|
package/dist/index54.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index54.js","sources":["../src/components/dynamics/text.ce"],"sourcesContent":["<Text text={@parseDynamicValue(@component.@value, @object)} ...getComponentStyle(component) />\n\n<script>\nimport { computed } from \"canvasengine\";\nimport { parseDynamicValue } from \"./parse-value\";\n\nconst { object } = defineProps();\nconst component = object._component;\n\n/**\n * Parses a numeric style value that can be a number or a string\n * \n * If the value is a string, it may contain dynamic references like {hp}\n * which need to be parsed using parseDynamicValue. If it's a number,\n * it's returned as-is wrapped in a computed.\n * \n * @param value - Numeric value (number or string)\n * @param object - Object to resolve dynamic references from\n * @returns Computed signal with the numeric value\n */\nconst parseNumericStyleValue = (value, object) => {\n if (value === undefined || value === null) {\n return undefined;\n }\n \n if (typeof value === 'number') {\n return value;\n }\n \n if (typeof value === 'string') {\n // Check if it contains dynamic references\n if (value.includes('{')) {\n // Parse dynamic value and convert to number\n const parsed = parseDynamicValue(value, object);\n return computed(() => {\n const str = parsed();\n const num = parseFloat(str);\n return isNaN(num) ? 0 : num;\n });\n } else {\n // Simple string number, convert directly\n const num = parseFloat(value);\n return isNaN(num) ? undefined : num;\n }\n }\n \n return value;\n};\n\n/**\n * Maps component style properties to Canvas Engine Text component props\n * \n * Converts TextComponentOptions from the server to the format expected\n * by the Canvas Engine Text component. Supports all text styling properties\n * including fill, fontSize, fontFamily, fontStyle, fontWeight, stroke,\n * opacity, wordWrap, and align. Also supports dynamic values (number | string)\n * for numeric properties like fontSize and opacity.\n * \n * @param component - Component definition with style property\n * @returns Object with Text component props\n * \n * @example\n * ```ts\n * // Component with style\n * const component = {\n * style: {\n * fill: '#000000',\n * fontSize: 20,\n * fontFamily: 'Arial',\n * fontWeight: 'bold'\n * }\n * };\n * \n * const props = getComponentStyle(component);\n * // Returns: { color: '#000000', size: 20, fontFamily: 'Arial', style: { fontWeight: 'bold' } }\n * \n * // Component with dynamic fontSize\n * const component2 = {\n * style: {\n * fill: '#000000',\n * fontSize: '{hp}', // Will be resolved from object.hp\n * opacity: '0.8'\n * }\n * };\n * ```\n */\nconst getComponentStyle = (component) => {\n if (!component.style) {\n return {};\n }\n\n const style = component.style;\n const result = {};\n\n // Map fill to color (shortcut property)\n // fill can be a string (hex color) or a dynamic string\n if (style.fill !== undefined) {\n if (typeof style.fill === 'string' && style.fill.includes('{')) {\n result.color = parseDynamicValue(style.fill, object);\n } else {\n result.color = style.fill;\n }\n }\n\n // Map fontSize to size (shortcut property)\n // fontSize can be number or string (with dynamic references)\n if (style.fontSize !== undefined) {\n const fontSizeValue = parseNumericStyleValue(style.fontSize, object);\n if (fontSizeValue !== undefined) {\n result.size = fontSizeValue;\n }\n }\n\n // Map fontFamily (shortcut property)\n if (style.fontFamily !== undefined) {\n if (typeof style.fontFamily === 'string' && style.fontFamily.includes('{')) {\n result.fontFamily = parseDynamicValue(style.fontFamily, object);\n } else {\n result.fontFamily = style.fontFamily;\n }\n }\n\n // Build style object for PixiJS Text properties\n const textStyle = {};\n\n // Font style properties\n if (style.fontStyle !== undefined) {\n if (typeof style.fontStyle === 'string' && style.fontStyle.includes('{')) {\n textStyle.fontStyle = parseDynamicValue(style.fontStyle, object);\n } else {\n textStyle.fontStyle = style.fontStyle;\n }\n }\n\n if (style.fontWeight !== undefined) {\n if (typeof style.fontWeight === 'string' && style.fontWeight.includes('{')) {\n textStyle.fontWeight = parseDynamicValue(style.fontWeight, object);\n } else if (typeof style.fontWeight === 'number') {\n textStyle.fontWeight = style.fontWeight;\n } else {\n textStyle.fontWeight = style.fontWeight;\n }\n }\n\n // Stroke properties\n if (style.stroke !== undefined) {\n if (typeof style.stroke === 'string' && style.stroke.includes('{')) {\n textStyle.stroke = parseDynamicValue(style.stroke, object);\n } else {\n textStyle.stroke = style.stroke;\n }\n }\n\n // Opacity (can be number or string)\n if (style.opacity !== undefined) {\n const opacityValue = parseNumericStyleValue(style.opacity, object);\n if (opacityValue !== undefined) {\n textStyle.opacity = opacityValue;\n }\n }\n\n // Word wrap\n if (style.wordWrap !== undefined) {\n textStyle.wordWrap = style.wordWrap;\n }\n\n // Text alignment\n if (style.align !== undefined) {\n if (typeof style.align === 'string' && style.align.includes('{')) {\n textStyle.align = parseDynamicValue(style.align, object);\n } else {\n textStyle.align = style.align;\n }\n }\n\n // Only add style prop if there are style properties\n if (Object.keys(textStyle).length > 0) {\n result.style = textStyle;\n }\n\n return result;\n}\n</script>"],"names":[],"mappings":";;;AAOqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,QAAQ,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,YAAY;AAC9D,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,CAAC,EAAE;AAC5C,QAAQ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AAE,EAAE,IAAI,EAAE,iBAAiB,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,GAAG,iBAAiB,CAAC,SAAS,CAAC,EAAE;AACjH,QAAQ,OAAO;AACf,MAAM;;;;"}
|
|
1
|
+
{"version":3,"file":"index54.js","sources":["../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js"],"sourcesContent":["import defaultErrorMap from \"./locales/en.js\";\nlet overrideErrorMap = defaultErrorMap;\nexport { defaultErrorMap };\nexport function setErrorMap(map) {\n overrideErrorMap = map;\n}\nexport function getErrorMap() {\n return overrideErrorMap;\n}\n"],"names":["defaultErrorMap"],"mappings":";;AACA,IAAI,gBAAgB,GAAGA,QAAe;AAE/B,SAAS,WAAW,CAAC,GAAG,EAAE;AACjC,IAAI,gBAAgB,GAAG,GAAG;AAC1B;AACO,SAAS,WAAW,GAAG;AAC9B,IAAI,OAAO,gBAAgB;AAC3B;;;;","x_google_ignoreList":[0]}
|
package/dist/index55.js
CHANGED
|
@@ -1,9 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
4
|
-
// biome-ignore lint:
|
|
5
|
-
errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
6
|
-
})(errorUtil || (errorUtil = {}));
|
|
1
|
+
import { getErrorMap } from './index54.js';
|
|
2
|
+
import errorMap from './index58.js';
|
|
7
3
|
|
|
8
|
-
|
|
4
|
+
const makeIssue = (params) => {
|
|
5
|
+
const { data, path, errorMaps, issueData } = params;
|
|
6
|
+
const fullPath = [...path, ...(issueData.path || [])];
|
|
7
|
+
const fullIssue = {
|
|
8
|
+
...issueData,
|
|
9
|
+
path: fullPath,
|
|
10
|
+
};
|
|
11
|
+
if (issueData.message !== undefined) {
|
|
12
|
+
return {
|
|
13
|
+
...issueData,
|
|
14
|
+
path: fullPath,
|
|
15
|
+
message: issueData.message,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
let errorMessage = "";
|
|
19
|
+
const maps = errorMaps
|
|
20
|
+
.filter((m) => !!m)
|
|
21
|
+
.slice()
|
|
22
|
+
.reverse();
|
|
23
|
+
for (const map of maps) {
|
|
24
|
+
errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
...issueData,
|
|
28
|
+
path: fullPath,
|
|
29
|
+
message: errorMessage,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const EMPTY_PATH = [];
|
|
33
|
+
function addIssueToContext(ctx, issueData) {
|
|
34
|
+
const overrideMap = getErrorMap();
|
|
35
|
+
const issue = makeIssue({
|
|
36
|
+
issueData: issueData,
|
|
37
|
+
data: ctx.data,
|
|
38
|
+
path: ctx.path,
|
|
39
|
+
errorMaps: [
|
|
40
|
+
ctx.common.contextualErrorMap, // contextual error map is first priority
|
|
41
|
+
ctx.schemaErrorMap, // then schema-bound map if available
|
|
42
|
+
overrideMap, // then global override map
|
|
43
|
+
overrideMap === errorMap ? undefined : errorMap, // then global default map
|
|
44
|
+
].filter((x) => !!x),
|
|
45
|
+
});
|
|
46
|
+
ctx.common.issues.push(issue);
|
|
47
|
+
}
|
|
48
|
+
class ParseStatus {
|
|
49
|
+
constructor() {
|
|
50
|
+
this.value = "valid";
|
|
51
|
+
}
|
|
52
|
+
dirty() {
|
|
53
|
+
if (this.value === "valid")
|
|
54
|
+
this.value = "dirty";
|
|
55
|
+
}
|
|
56
|
+
abort() {
|
|
57
|
+
if (this.value !== "aborted")
|
|
58
|
+
this.value = "aborted";
|
|
59
|
+
}
|
|
60
|
+
static mergeArray(status, results) {
|
|
61
|
+
const arrayValue = [];
|
|
62
|
+
for (const s of results) {
|
|
63
|
+
if (s.status === "aborted")
|
|
64
|
+
return INVALID;
|
|
65
|
+
if (s.status === "dirty")
|
|
66
|
+
status.dirty();
|
|
67
|
+
arrayValue.push(s.value);
|
|
68
|
+
}
|
|
69
|
+
return { status: status.value, value: arrayValue };
|
|
70
|
+
}
|
|
71
|
+
static async mergeObjectAsync(status, pairs) {
|
|
72
|
+
const syncPairs = [];
|
|
73
|
+
for (const pair of pairs) {
|
|
74
|
+
const key = await pair.key;
|
|
75
|
+
const value = await pair.value;
|
|
76
|
+
syncPairs.push({
|
|
77
|
+
key,
|
|
78
|
+
value,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return ParseStatus.mergeObjectSync(status, syncPairs);
|
|
82
|
+
}
|
|
83
|
+
static mergeObjectSync(status, pairs) {
|
|
84
|
+
const finalObject = {};
|
|
85
|
+
for (const pair of pairs) {
|
|
86
|
+
const { key, value } = pair;
|
|
87
|
+
if (key.status === "aborted")
|
|
88
|
+
return INVALID;
|
|
89
|
+
if (value.status === "aborted")
|
|
90
|
+
return INVALID;
|
|
91
|
+
if (key.status === "dirty")
|
|
92
|
+
status.dirty();
|
|
93
|
+
if (value.status === "dirty")
|
|
94
|
+
status.dirty();
|
|
95
|
+
if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
|
|
96
|
+
finalObject[key.value] = value.value;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return { status: status.value, value: finalObject };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const INVALID = Object.freeze({
|
|
103
|
+
status: "aborted",
|
|
104
|
+
});
|
|
105
|
+
const DIRTY = (value) => ({ status: "dirty", value });
|
|
106
|
+
const OK = (value) => ({ status: "valid", value });
|
|
107
|
+
const isAborted = (x) => x.status === "aborted";
|
|
108
|
+
const isDirty = (x) => x.status === "dirty";
|
|
109
|
+
const isValid = (x) => x.status === "valid";
|
|
110
|
+
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
111
|
+
|
|
112
|
+
export { DIRTY, EMPTY_PATH, INVALID, OK, ParseStatus, addIssueToContext, isAborted, isAsync, isDirty, isValid, makeIssue };
|
|
9
113
|
//# sourceMappingURL=index55.js.map
|
package/dist/index55.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index55.js","sources":["../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/
|
|
1
|
+
{"version":3,"file":"index55.js","sources":["../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js"],"sourcesContent":["import { getErrorMap } from \"../errors.js\";\nimport defaultErrorMap from \"../locales/en.js\";\nexport const makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nexport const EMPTY_PATH = [];\nexport function addIssueToContext(ctx, issueData) {\n const overrideMap = getErrorMap();\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === defaultErrorMap ? undefined : defaultErrorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nexport class ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nexport const INVALID = Object.freeze({\n status: \"aborted\",\n});\nexport const DIRTY = (value) => ({ status: \"dirty\", value });\nexport const OK = (value) => ({ status: \"valid\", value });\nexport const isAborted = (x) => x.status === \"aborted\";\nexport const isDirty = (x) => x.status === \"dirty\";\nexport const isValid = (x) => x.status === \"valid\";\nexport const isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n"],"names":["defaultErrorMap"],"mappings":";;;AAEY,MAAC,SAAS,GAAG,CAAC,MAAM,KAAK;AACrC,IAAI,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,MAAM;AACvD,IAAI,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,IAAI,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;AACzD,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,GAAG,SAAS;AACpB,QAAQ,IAAI,EAAE,QAAQ;AACtB,KAAK;AACL,IAAI,IAAI,SAAS,CAAC,OAAO,KAAK,SAAS,EAAE;AACzC,QAAQ,OAAO;AACf,YAAY,GAAG,SAAS;AACxB,YAAY,IAAI,EAAE,QAAQ;AAC1B,YAAY,OAAO,EAAE,SAAS,CAAC,OAAO;AACtC,SAAS;AACT,IAAI;AACJ,IAAI,IAAI,YAAY,GAAG,EAAE;AACzB,IAAI,MAAM,IA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I,CAAC,YAAY;;;;","x_google_ignoreList":[0]}
|
package/dist/index56.js
CHANGED
|
@@ -1,54 +1,136 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
for (let i = matches.length - 1; i >= 0; i--) {
|
|
23
|
-
const { property, fullMatch } = matches[i];
|
|
24
|
-
let propertyValue = "";
|
|
25
|
-
try {
|
|
26
|
-
const propertyPath = property.split(".");
|
|
27
|
-
let currentValue = object;
|
|
28
|
-
for (let j = 0; j < propertyPath.length; j++) {
|
|
29
|
-
const prop = propertyPath[j];
|
|
30
|
-
if (typeof currentValue === "function") {
|
|
31
|
-
currentValue = currentValue();
|
|
32
|
-
}
|
|
33
|
-
if (currentValue && typeof currentValue === "object" && prop in currentValue) {
|
|
34
|
-
currentValue = currentValue[prop];
|
|
35
|
-
} else {
|
|
36
|
-
currentValue = void 0;
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
1
|
+
var util;
|
|
2
|
+
(function (util) {
|
|
3
|
+
util.assertEqual = (_) => { };
|
|
4
|
+
function assertIs(_arg) { }
|
|
5
|
+
util.assertIs = assertIs;
|
|
6
|
+
function assertNever(_x) {
|
|
7
|
+
throw new Error();
|
|
8
|
+
}
|
|
9
|
+
util.assertNever = assertNever;
|
|
10
|
+
util.arrayToEnum = (items) => {
|
|
11
|
+
const obj = {};
|
|
12
|
+
for (const item of items) {
|
|
13
|
+
obj[item] = item;
|
|
14
|
+
}
|
|
15
|
+
return obj;
|
|
16
|
+
};
|
|
17
|
+
util.getValidEnumValues = (obj) => {
|
|
18
|
+
const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
|
|
19
|
+
const filtered = {};
|
|
20
|
+
for (const k of validKeys) {
|
|
21
|
+
filtered[k] = obj[k];
|
|
39
22
|
}
|
|
40
|
-
|
|
41
|
-
|
|
23
|
+
return util.objectValues(filtered);
|
|
24
|
+
};
|
|
25
|
+
util.objectValues = (obj) => {
|
|
26
|
+
return util.objectKeys(obj).map(function (e) {
|
|
27
|
+
return obj[e];
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban
|
|
31
|
+
? (obj) => Object.keys(obj) // eslint-disable-line ban/ban
|
|
32
|
+
: (object) => {
|
|
33
|
+
const keys = [];
|
|
34
|
+
for (const key in object) {
|
|
35
|
+
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
36
|
+
keys.push(key);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return keys;
|
|
40
|
+
};
|
|
41
|
+
util.find = (arr, checker) => {
|
|
42
|
+
for (const item of arr) {
|
|
43
|
+
if (checker(item))
|
|
44
|
+
return item;
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
47
|
+
};
|
|
48
|
+
util.isInteger = typeof Number.isInteger === "function"
|
|
49
|
+
? (val) => Number.isInteger(val) // eslint-disable-line ban/ban
|
|
50
|
+
: (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
51
|
+
function joinValues(array, separator = " | ") {
|
|
52
|
+
return array.map((val) => (typeof val === "string" ? `'${val}'` : val)).join(separator);
|
|
53
|
+
}
|
|
54
|
+
util.joinValues = joinValues;
|
|
55
|
+
util.jsonStringifyReplacer = (_, value) => {
|
|
56
|
+
if (typeof value === "bigint") {
|
|
57
|
+
return value.toString();
|
|
42
58
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
59
|
+
return value;
|
|
60
|
+
};
|
|
61
|
+
})(util || (util = {}));
|
|
62
|
+
var objectUtil;
|
|
63
|
+
(function (objectUtil) {
|
|
64
|
+
objectUtil.mergeShapes = (first, second) => {
|
|
65
|
+
return {
|
|
66
|
+
...first,
|
|
67
|
+
...second, // second overwrites first
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
})(objectUtil || (objectUtil = {}));
|
|
71
|
+
const ZodParsedType = util.arrayToEnum([
|
|
72
|
+
"string",
|
|
73
|
+
"nan",
|
|
74
|
+
"number",
|
|
75
|
+
"integer",
|
|
76
|
+
"float",
|
|
77
|
+
"boolean",
|
|
78
|
+
"date",
|
|
79
|
+
"bigint",
|
|
80
|
+
"symbol",
|
|
81
|
+
"function",
|
|
82
|
+
"undefined",
|
|
83
|
+
"null",
|
|
84
|
+
"array",
|
|
85
|
+
"object",
|
|
86
|
+
"unknown",
|
|
87
|
+
"promise",
|
|
88
|
+
"void",
|
|
89
|
+
"never",
|
|
90
|
+
"map",
|
|
91
|
+
"set",
|
|
92
|
+
]);
|
|
93
|
+
const getParsedType = (data) => {
|
|
94
|
+
const t = typeof data;
|
|
95
|
+
switch (t) {
|
|
96
|
+
case "undefined":
|
|
97
|
+
return ZodParsedType.undefined;
|
|
98
|
+
case "string":
|
|
99
|
+
return ZodParsedType.string;
|
|
100
|
+
case "number":
|
|
101
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
102
|
+
case "boolean":
|
|
103
|
+
return ZodParsedType.boolean;
|
|
104
|
+
case "function":
|
|
105
|
+
return ZodParsedType.function;
|
|
106
|
+
case "bigint":
|
|
107
|
+
return ZodParsedType.bigint;
|
|
108
|
+
case "symbol":
|
|
109
|
+
return ZodParsedType.symbol;
|
|
110
|
+
case "object":
|
|
111
|
+
if (Array.isArray(data)) {
|
|
112
|
+
return ZodParsedType.array;
|
|
113
|
+
}
|
|
114
|
+
if (data === null) {
|
|
115
|
+
return ZodParsedType.null;
|
|
116
|
+
}
|
|
117
|
+
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
|
118
|
+
return ZodParsedType.promise;
|
|
119
|
+
}
|
|
120
|
+
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
121
|
+
return ZodParsedType.map;
|
|
122
|
+
}
|
|
123
|
+
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
124
|
+
return ZodParsedType.set;
|
|
125
|
+
}
|
|
126
|
+
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
127
|
+
return ZodParsedType.date;
|
|
128
|
+
}
|
|
129
|
+
return ZodParsedType.object;
|
|
130
|
+
default:
|
|
131
|
+
return ZodParsedType.unknown;
|
|
48
132
|
}
|
|
49
|
-
return result;
|
|
50
|
-
});
|
|
51
133
|
};
|
|
52
134
|
|
|
53
|
-
export {
|
|
135
|
+
export { ZodParsedType, getParsedType, objectUtil, util };
|
|
54
136
|
//# sourceMappingURL=index56.js.map
|
package/dist/index56.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index56.js","sources":["
|
|
1
|
+
{"version":3,"file":"index56.js","sources":["../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js"],"sourcesContent":["export var util;\n(function (util) {\n util.assertEqual = (_) => { };\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && Number.isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array.map((val) => (typeof val === \"string\" ? `'${val}'` : val)).join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nexport var objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nexport const ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined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