@useinsider/guido 3.2.0-beta.ccaf9f5 → 3.2.0-beta.d3ae6f8

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.
Files changed (104) hide show
  1. package/README.md +117 -1
  2. package/dist/@types/config/schemas.js +153 -95
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +85 -84
  5. package/dist/components/organisms/AutoSaveController.vue.js +17 -0
  6. package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
  7. package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
  8. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
  9. package/dist/components/organisms/header/RightSlot.vue.js +8 -8
  10. package/dist/components/organisms/header/RightSlot.vue2.js +9 -8
  11. package/dist/composables/useAutoSave.js +71 -0
  12. package/dist/composables/useRecommendation.js +46 -26
  13. package/dist/composables/useResponsivePreview.js +1 -1
  14. package/dist/composables/useSave.js +19 -16
  15. package/dist/composables/useStripo.js +14 -16
  16. package/dist/composables/validators/useCouponBlockValidator.js +24 -0
  17. package/dist/config/compiler/recommendationCompilerRules.js +25 -25
  18. package/dist/config/compiler/utils/recommendationCompilerUtils.js +104 -71
  19. package/dist/config/migrator/index.js +9 -9
  20. package/dist/config/migrator/radioButtonMigrator.js +64 -44
  21. package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
  22. package/dist/config/migrator/recommendation/extractors.js +27 -0
  23. package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
  24. package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
  25. package/dist/config/migrator/recommendation/settingsMapper.js +70 -0
  26. package/dist/config/migrator/recommendation/themeMapper.js +93 -0
  27. package/dist/config/migrator/recommendationMigrator.js +74 -290
  28. package/dist/enums/extensions/recommendationBlock.js +2 -1
  29. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  30. package/dist/extensions/Blocks/Recommendation/block.js +35 -32
  31. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
  32. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +25 -24
  33. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +228 -181
  34. package/dist/extensions/Blocks/Recommendation/services/configService.js +65 -29
  35. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +130 -90
  36. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +22 -13
  37. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
  38. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +23 -13
  39. package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
  40. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +21 -0
  41. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
  42. package/dist/guido.css +1 -1
  43. package/dist/node_modules/valibot/dist/index.js +404 -266
  44. package/dist/src/@types/config/defaults.d.ts +5 -1
  45. package/dist/src/@types/config/index.d.ts +3 -3
  46. package/dist/src/@types/config/schemas.d.ts +217 -0
  47. package/dist/src/@types/config/types.d.ts +9 -1
  48. package/dist/src/components/Guido.vue.d.ts +1 -1
  49. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
  50. package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
  51. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  52. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  53. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  54. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  55. package/dist/src/composables/useAutoSave.d.ts +3 -0
  56. package/dist/src/composables/useConfig.d.ts +58 -0
  57. package/dist/src/composables/useRecommendation.d.ts +10 -1
  58. package/dist/src/composables/useRecommendation.test.d.ts +1 -0
  59. package/dist/src/composables/useSave.d.ts +1 -1
  60. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  61. package/dist/src/config/migrator/index.d.ts +2 -1
  62. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
  63. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
  64. package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
  65. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
  66. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
  67. package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
  68. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
  69. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
  70. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
  71. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
  72. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
  73. package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
  74. package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
  75. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
  76. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  77. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
  78. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +10 -0
  79. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
  80. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +34 -0
  81. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
  82. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +21 -0
  83. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +1 -0
  84. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
  85. package/dist/src/library.d.ts +1 -1
  86. package/dist/src/stores/autosave.d.ts +12 -0
  87. package/dist/src/stores/config.d.ts +522 -0
  88. package/dist/src/stores/editor.d.ts +23 -0
  89. package/dist/src/utils/htmlEscape.d.ts +5 -0
  90. package/dist/src/utils/htmlEscape.test.d.ts +1 -0
  91. package/dist/src/utils/timeUtil.d.ts +8 -0
  92. package/dist/stores/autosave.js +17 -0
  93. package/dist/stores/editor.js +3 -1
  94. package/dist/utils/htmlEscape.js +13 -0
  95. package/dist/utils/templatePreparation.js +72 -32
  96. package/dist/utils/timeUtil.js +19 -0
  97. package/package.json +34 -3
  98. package/dist/composables/useCortexBlueprintBridge.js +0 -38
  99. package/dist/composables/useEmailTemplateApplier.js +0 -41
  100. package/dist/enums/displayConditions.js +0 -80
  101. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
  102. package/dist/src/composables/useCortexBlueprintBridge.d.ts +0 -17
  103. package/dist/src/composables/useEmailTemplateApplier.d.ts +0 -21
  104. package/dist/src/enums/displayConditions.d.ts +0 -2
@@ -1,141 +1,136 @@
1
- var v;
1
+ let m;
2
2
  // @__NO_SIDE_EFFECTS__
3
- function E(n) {
3
+ function j(n) {
4
4
  return {
5
- lang: (n == null ? void 0 : n.lang) ?? (v == null ? void 0 : v.lang),
5
+ lang: (n == null ? void 0 : n.lang) ?? (m == null ? void 0 : m.lang),
6
6
  message: n == null ? void 0 : n.message,
7
- abortEarly: (n == null ? void 0 : n.abortEarly) ?? (v == null ? void 0 : v.abortEarly),
8
- abortPipeEarly: (n == null ? void 0 : n.abortPipeEarly) ?? (v == null ? void 0 : v.abortPipeEarly)
7
+ abortEarly: (n == null ? void 0 : n.abortEarly) ?? (m == null ? void 0 : m.abortEarly),
8
+ abortPipeEarly: (n == null ? void 0 : n.abortPipeEarly) ?? (m == null ? void 0 : m.abortPipeEarly)
9
9
  };
10
10
  }
11
- var g;
11
+ let d;
12
12
  // @__NO_SIDE_EFFECTS__
13
- function D(n) {
14
- return g == null ? void 0 : g.get(n);
13
+ function A(n) {
14
+ return d == null ? void 0 : d.get(n);
15
15
  }
16
- var d;
16
+ let x;
17
17
  // @__NO_SIDE_EFFECTS__
18
- function w(n) {
19
- return d == null ? void 0 : d.get(n);
18
+ function q(n) {
19
+ return x == null ? void 0 : x.get(n);
20
20
  }
21
- var x;
21
+ let E;
22
22
  // @__NO_SIDE_EFFECTS__
23
- function A(n, r) {
23
+ function K(n, s) {
24
24
  var e;
25
- return (e = x == null ? void 0 : x.get(n)) == null ? void 0 : e.get(r);
25
+ return (e = E == null ? void 0 : E.get(n)) == null ? void 0 : e.get(s);
26
26
  }
27
27
  // @__NO_SIDE_EFFECTS__
28
- function $(n) {
28
+ function _(n) {
29
29
  var e, t;
30
- const r = typeof n;
31
- return r === "string" ? `"${n}"` : r === "number" || r === "bigint" || r === "boolean" ? `${n}` : r === "object" || r === "function" ? (n && ((t = (e = Object.getPrototypeOf(n)) == null ? void 0 : e.constructor) == null ? void 0 : t.name)) ?? "null" : r;
30
+ const s = typeof n;
31
+ return s === "string" ? `"${n}"` : s === "number" || s === "bigint" || s === "boolean" ? `${n}` : s === "object" || s === "function" ? (n && ((t = (e = Object.getPrototypeOf(n)) == null ? void 0 : e.constructor) == null ? void 0 : t.name)) ?? "null" : s;
32
32
  }
33
- function y(n, r, e, t, i) {
34
- const a = i && "input" in i ? i.input : e.value, s = (i == null ? void 0 : i.expected) ?? n.expects ?? null, l = (i == null ? void 0 : i.received) ?? /* @__PURE__ */ $(a), u = {
33
+ function y(n, s, e, t, r) {
34
+ const l = r && "input" in r ? r.input : e.value, i = (r == null ? void 0 : r.expected) ?? n.expects ?? null, p = (r == null ? void 0 : r.received) ?? /* @__PURE__ */ _(l), u = {
35
35
  kind: n.kind,
36
36
  type: n.type,
37
- input: a,
38
- expected: s,
39
- received: l,
40
- message: `Invalid ${r}: ${s ? `Expected ${s} but r` : "R"}eceived ${l}`,
37
+ input: l,
38
+ expected: i,
39
+ received: p,
40
+ message: `Invalid ${s}: ${i ? `Expected ${i} but r` : "R"}eceived ${p}`,
41
41
  requirement: n.requirement,
42
- path: i == null ? void 0 : i.path,
43
- issues: i == null ? void 0 : i.issues,
42
+ path: r == null ? void 0 : r.path,
43
+ issues: r == null ? void 0 : r.issues,
44
44
  lang: t.lang,
45
45
  abortEarly: t.abortEarly,
46
46
  abortPipeEarly: t.abortPipeEarly
47
- }, p = n.kind === "schema", c = (i == null ? void 0 : i.message) ?? n.message ?? /* @__PURE__ */ A(n.reference, u.lang) ?? (p ? /* @__PURE__ */ w(u.lang) : null) ?? t.message ?? /* @__PURE__ */ D(u.lang);
48
- c !== void 0 && (u.message = typeof c == "function" ? (
49
- // @ts-expect-error
50
- c(u)
51
- ) : c), p && (e.typed = !1), e.issues ? e.issues.push(u) : e.issues = [u];
47
+ }, a = n.kind === "schema", c = (r == null ? void 0 : r.message) ?? n.message ?? /* @__PURE__ */ K(n.reference, u.lang) ?? (a ? /* @__PURE__ */ q(u.lang) : null) ?? t.message ?? /* @__PURE__ */ A(u.lang);
48
+ c !== void 0 && (u.message = typeof c == "function" ? c(u) : c), a && (e.typed = !1), e.issues ? e.issues.push(u) : e.issues = [u];
52
49
  }
53
50
  // @__NO_SIDE_EFFECTS__
54
- function f(n) {
51
+ function o(n) {
55
52
  return {
56
53
  version: 1,
57
54
  vendor: "valibot",
58
- validate(r) {
59
- return n["~run"]({ value: r }, /* @__PURE__ */ E());
55
+ validate(s) {
56
+ return n["~run"]({ value: s }, /* @__PURE__ */ j());
60
57
  }
61
58
  };
62
59
  }
63
60
  // @__NO_SIDE_EFFECTS__
64
- function S(n, r) {
61
+ function S(n, s) {
62
+ return Object.hasOwn(n, s) && s !== "__proto__" && s !== "prototype" && s !== "constructor";
63
+ }
64
+ // @__NO_SIDE_EFFECTS__
65
+ function D(n, s) {
65
66
  const e = [...new Set(n)];
66
- return e.length > 1 ? `(${e.join(` ${r} `)})` : e[0] ?? "never";
67
+ return e.length > 1 ? `(${e.join(` ${s} `)})` : e[0] ?? "never";
67
68
  }
68
69
  // @__NO_SIDE_EFFECTS__
69
- function O(n, r) {
70
+ function M(n, s) {
70
71
  return {
71
72
  kind: "validation",
72
73
  type: "check",
73
- reference: O,
74
+ reference: M,
74
75
  async: !0,
75
76
  expects: null,
76
77
  requirement: n,
77
- message: r,
78
+ message: s,
78
79
  async "~run"(e, t) {
79
80
  return e.typed && !await this.requirement(e.value) && y(this, "input", e, t), e;
80
81
  }
81
82
  };
82
83
  }
83
84
  // @__NO_SIDE_EFFECTS__
84
- function I(n, r) {
85
+ function V(n, s) {
85
86
  return {
86
87
  kind: "validation",
87
88
  type: "max_length",
88
- reference: I,
89
+ reference: V,
89
90
  async: !1,
90
91
  expects: `<=${n}`,
91
92
  requirement: n,
92
- message: r,
93
+ message: s,
93
94
  "~run"(e, t) {
94
- return e.typed && e.value.length > this.requirement && y(this, "length", e, t, {
95
- received: `${e.value.length}`
96
- }), e;
95
+ return e.typed && e.value.length > this.requirement && y(this, "length", e, t, { received: `${e.value.length}` }), e;
97
96
  }
98
97
  };
99
98
  }
100
99
  // @__NO_SIDE_EFFECTS__
101
- function q(n, r) {
100
+ function G(n, s) {
102
101
  return {
103
102
  kind: "validation",
104
103
  type: "min_length",
105
- reference: q,
104
+ reference: G,
106
105
  async: !1,
107
106
  expects: `>=${n}`,
108
107
  requirement: n,
109
- message: r,
108
+ message: s,
110
109
  "~run"(e, t) {
111
- return e.typed && e.value.length < this.requirement && y(this, "length", e, t, {
112
- received: `${e.value.length}`
113
- }), e;
110
+ return e.typed && e.value.length < this.requirement && y(this, "length", e, t, { received: `${e.value.length}` }), e;
114
111
  }
115
112
  };
116
113
  }
117
114
  // @__NO_SIDE_EFFECTS__
118
- function M(n) {
115
+ function L(n) {
119
116
  return {
120
117
  kind: "validation",
121
118
  type: "non_empty",
122
- reference: M,
119
+ reference: L,
123
120
  async: !1,
124
121
  expects: "!0",
125
122
  message: n,
126
- "~run"(r, e) {
127
- return r.typed && r.value.length === 0 && y(this, "length", r, e, {
128
- received: "0"
129
- }), r;
123
+ "~run"(s, e) {
124
+ return s.typed && s.value.length === 0 && y(this, "length", s, e, { received: "0" }), s;
130
125
  }
131
126
  };
132
127
  }
133
128
  // @__NO_SIDE_EFFECTS__
134
- function G() {
129
+ function N() {
135
130
  return {
136
131
  kind: "transformation",
137
132
  type: "trim",
138
- reference: G,
133
+ reference: N,
139
134
  async: !1,
140
135
  "~run"(n) {
141
136
  return n.value = n.value.trim(), n;
@@ -143,55 +138,43 @@ function G() {
143
138
  };
144
139
  }
145
140
  // @__NO_SIDE_EFFECTS__
146
- function L(n, r, e) {
147
- return typeof n.fallback == "function" ? (
148
- // @ts-expect-error
149
- n.fallback(r, e)
150
- ) : (
151
- // @ts-expect-error
152
- n.fallback
153
- );
141
+ function I(n, s, e) {
142
+ return typeof n.fallback == "function" ? n.fallback(s, e) : n.fallback;
154
143
  }
155
144
  // @__NO_SIDE_EFFECTS__
156
- function _(n, r, e) {
157
- return typeof n.default == "function" ? (
158
- // @ts-expect-error
159
- n.default(r, e)
160
- ) : (
161
- // @ts-expect-error
162
- n.default
163
- );
145
+ function P(n, s, e) {
146
+ return typeof n.default == "function" ? n.default(s, e) : n.default;
164
147
  }
165
148
  // @__NO_SIDE_EFFECTS__
166
- function N(n, r) {
149
+ function C(n, s) {
167
150
  return {
168
151
  kind: "schema",
169
152
  type: "array",
170
- reference: N,
153
+ reference: C,
171
154
  expects: "Array",
172
155
  async: !1,
173
156
  item: n,
174
- message: r,
157
+ message: s,
175
158
  get "~standard"() {
176
- return /* @__PURE__ */ f(this);
159
+ return /* @__PURE__ */ o(this);
177
160
  },
178
161
  "~run"(e, t) {
179
- var a;
180
- const i = e.value;
181
- if (Array.isArray(i)) {
162
+ var l;
163
+ const r = e.value;
164
+ if (Array.isArray(r)) {
182
165
  e.typed = !0, e.value = [];
183
- for (let s = 0; s < i.length; s++) {
184
- const l = i[s], u = this.item["~run"]({ value: l }, t);
166
+ for (let i = 0; i < r.length; i++) {
167
+ const p = r[i], u = this.item["~run"]({ value: p }, t);
185
168
  if (u.issues) {
186
- const p = {
169
+ const a = {
187
170
  type: "array",
188
171
  origin: "value",
189
- input: i,
190
- key: s,
191
- value: l
172
+ input: r,
173
+ key: i,
174
+ value: p
192
175
  };
193
176
  for (const c of u.issues)
194
- c.path ? c.path.unshift(p) : c.path = [p], (a = e.issues) == null || a.push(c);
177
+ c.path ? c.path.unshift(a) : c.path = [a], (l = e.issues) == null || l.push(c);
195
178
  if (e.issues || (e.issues = u.issues), t.abortEarly) {
196
179
  e.typed = !1;
197
180
  break;
@@ -199,41 +182,40 @@ function N(n, r) {
199
182
  }
200
183
  u.typed || (e.typed = !1), e.value.push(u.value);
201
184
  }
202
- } else
203
- y(this, "type", e, t);
185
+ } else y(this, "type", e, t);
204
186
  return e;
205
187
  }
206
188
  };
207
189
  }
208
190
  // @__NO_SIDE_EFFECTS__
209
- function C(n) {
191
+ function F(n) {
210
192
  return {
211
193
  kind: "schema",
212
194
  type: "boolean",
213
- reference: C,
195
+ reference: F,
214
196
  expects: "boolean",
215
197
  async: !1,
216
198
  message: n,
217
199
  get "~standard"() {
218
- return /* @__PURE__ */ f(this);
200
+ return /* @__PURE__ */ o(this);
219
201
  },
220
- "~run"(r, e) {
221
- return typeof r.value == "boolean" ? r.typed = !0 : y(this, "type", r, e), r;
202
+ "~run"(s, e) {
203
+ return typeof s.value == "boolean" ? s.typed = !0 : y(this, "type", s, e), s;
222
204
  }
223
205
  };
224
206
  }
225
207
  // @__NO_SIDE_EFFECTS__
226
- function F(n, r) {
208
+ function R(n, s) {
227
209
  return {
228
210
  kind: "schema",
229
211
  type: "custom",
230
- reference: F,
212
+ reference: R,
231
213
  expects: "unknown",
232
214
  async: !1,
233
215
  check: n,
234
- message: r,
216
+ message: s,
235
217
  get "~standard"() {
236
- return /* @__PURE__ */ f(this);
218
+ return /* @__PURE__ */ o(this);
237
219
  },
238
220
  "~run"(e, t) {
239
221
  return this.check(e.value) ? e.typed = !0 : y(this, "type", e, t), e;
@@ -241,17 +223,17 @@ function F(n, r) {
241
223
  };
242
224
  }
243
225
  // @__NO_SIDE_EFFECTS__
244
- function K(n, r) {
226
+ function z(n, s) {
245
227
  return {
246
228
  kind: "schema",
247
229
  type: "literal",
248
- reference: K,
249
- expects: /* @__PURE__ */ $(n),
230
+ reference: z,
231
+ expects: /* @__PURE__ */ _(n),
250
232
  async: !1,
251
233
  literal: n,
252
- message: r,
234
+ message: s,
253
235
  get "~standard"() {
254
- return /* @__PURE__ */ f(this);
236
+ return /* @__PURE__ */ o(this);
255
237
  },
256
238
  "~run"(e, t) {
257
239
  return e.value === this.literal ? e.typed = !0 : y(this, "type", e, t), e;
@@ -259,118 +241,168 @@ function K(n, r) {
259
241
  };
260
242
  }
261
243
  // @__NO_SIDE_EFFECTS__
262
- function R(n) {
244
+ function B(n, s) {
245
+ return {
246
+ kind: "schema",
247
+ type: "loose_object",
248
+ reference: B,
249
+ expects: "Object",
250
+ async: !1,
251
+ entries: n,
252
+ message: s,
253
+ get "~standard"() {
254
+ return /* @__PURE__ */ o(this);
255
+ },
256
+ "~run"(e, t) {
257
+ var l;
258
+ const r = e.value;
259
+ if (r && typeof r == "object") {
260
+ e.typed = !0, e.value = {};
261
+ for (const i in this.entries) {
262
+ const p = this.entries[i];
263
+ if (i in r || (p.type === "exact_optional" || p.type === "optional" || p.type === "nullish") && p.default !== void 0) {
264
+ const u = i in r ? r[i] : /* @__PURE__ */ P(p), a = p["~run"]({ value: u }, t);
265
+ if (a.issues) {
266
+ const c = {
267
+ type: "object",
268
+ origin: "value",
269
+ input: r,
270
+ key: i,
271
+ value: u
272
+ };
273
+ for (const f of a.issues)
274
+ f.path ? f.path.unshift(c) : f.path = [c], (l = e.issues) == null || l.push(f);
275
+ if (e.issues || (e.issues = a.issues), t.abortEarly) {
276
+ e.typed = !1;
277
+ break;
278
+ }
279
+ }
280
+ a.typed || (e.typed = !1), e.value[i] = a.value;
281
+ } else if (p.fallback !== void 0) e.value[i] = /* @__PURE__ */ I(p);
282
+ else if (p.type !== "exact_optional" && p.type !== "optional" && p.type !== "nullish" && (y(this, "key", e, t, {
283
+ input: void 0,
284
+ expected: `"${i}"`,
285
+ path: [{
286
+ type: "object",
287
+ origin: "key",
288
+ input: r,
289
+ key: i,
290
+ value: r[i]
291
+ }]
292
+ }), t.abortEarly))
293
+ break;
294
+ }
295
+ if (!e.issues || !t.abortEarly)
296
+ for (const i in r) /* @__PURE__ */ S(r, i) && !(i in this.entries) && (e.value[i] = r[i]);
297
+ } else y(this, "type", e, t);
298
+ return e;
299
+ }
300
+ };
301
+ }
302
+ // @__NO_SIDE_EFFECTS__
303
+ function H(n) {
263
304
  return {
264
305
  kind: "schema",
265
306
  type: "number",
266
- reference: R,
307
+ reference: H,
267
308
  expects: "number",
268
309
  async: !1,
269
310
  message: n,
270
311
  get "~standard"() {
271
- return /* @__PURE__ */ f(this);
312
+ return /* @__PURE__ */ o(this);
272
313
  },
273
- "~run"(r, e) {
274
- return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : y(this, "type", r, e), r;
314
+ "~run"(s, e) {
315
+ return typeof s.value == "number" && !isNaN(s.value) ? s.typed = !0 : y(this, "type", s, e), s;
275
316
  }
276
317
  };
277
318
  }
278
319
  // @__NO_SIDE_EFFECTS__
279
- function V(n, r) {
320
+ function J(n, s) {
280
321
  return {
281
322
  kind: "schema",
282
323
  type: "object",
283
- reference: V,
324
+ reference: J,
284
325
  expects: "Object",
285
326
  async: !1,
286
327
  entries: n,
287
- message: r,
328
+ message: s,
288
329
  get "~standard"() {
289
- return /* @__PURE__ */ f(this);
330
+ return /* @__PURE__ */ o(this);
290
331
  },
291
332
  "~run"(e, t) {
292
- var a;
293
- const i = e.value;
294
- if (i && typeof i == "object") {
333
+ var l;
334
+ const r = e.value;
335
+ if (r && typeof r == "object") {
295
336
  e.typed = !0, e.value = {};
296
- for (const s in this.entries) {
297
- const l = this.entries[s];
298
- if (s in i || (l.type === "exact_optional" || l.type === "optional" || l.type === "nullish") && // @ts-expect-error
299
- l.default !== void 0) {
300
- const u = s in i ? (
301
- // @ts-expect-error
302
- i[s]
303
- ) : /* @__PURE__ */ _(l), p = l["~run"]({ value: u }, t);
304
- if (p.issues) {
337
+ for (const i in this.entries) {
338
+ const p = this.entries[i];
339
+ if (i in r || (p.type === "exact_optional" || p.type === "optional" || p.type === "nullish") && p.default !== void 0) {
340
+ const u = i in r ? r[i] : /* @__PURE__ */ P(p), a = p["~run"]({ value: u }, t);
341
+ if (a.issues) {
305
342
  const c = {
306
343
  type: "object",
307
344
  origin: "value",
308
- input: i,
309
- key: s,
345
+ input: r,
346
+ key: i,
310
347
  value: u
311
348
  };
312
- for (const m of p.issues)
313
- m.path ? m.path.unshift(c) : m.path = [c], (a = e.issues) == null || a.push(m);
314
- if (e.issues || (e.issues = p.issues), t.abortEarly) {
349
+ for (const f of a.issues)
350
+ f.path ? f.path.unshift(c) : f.path = [c], (l = e.issues) == null || l.push(f);
351
+ if (e.issues || (e.issues = a.issues), t.abortEarly) {
315
352
  e.typed = !1;
316
353
  break;
317
354
  }
318
355
  }
319
- p.typed || (e.typed = !1), e.value[s] = p.value;
320
- } else if (l.fallback !== void 0)
321
- e.value[s] = /* @__PURE__ */ L(l);
322
- else if (l.type !== "exact_optional" && l.type !== "optional" && l.type !== "nullish" && (y(this, "key", e, t, {
356
+ a.typed || (e.typed = !1), e.value[i] = a.value;
357
+ } else if (p.fallback !== void 0) e.value[i] = /* @__PURE__ */ I(p);
358
+ else if (p.type !== "exact_optional" && p.type !== "optional" && p.type !== "nullish" && (y(this, "key", e, t, {
323
359
  input: void 0,
324
- expected: `"${s}"`,
325
- path: [
326
- {
327
- type: "object",
328
- origin: "key",
329
- input: i,
330
- key: s,
331
- // @ts-expect-error
332
- value: i[s]
333
- }
334
- ]
360
+ expected: `"${i}"`,
361
+ path: [{
362
+ type: "object",
363
+ origin: "key",
364
+ input: r,
365
+ key: i,
366
+ value: r[i]
367
+ }]
335
368
  }), t.abortEarly))
336
369
  break;
337
370
  }
338
- } else
339
- y(this, "type", e, t);
371
+ } else y(this, "type", e, t);
340
372
  return e;
341
373
  }
342
374
  };
343
375
  }
344
376
  // @__NO_SIDE_EFFECTS__
345
- function z(n, r) {
377
+ function Q(n, s) {
346
378
  return {
347
379
  kind: "schema",
348
380
  type: "optional",
349
- reference: z,
381
+ reference: Q,
350
382
  expects: `(${n.expects} | undefined)`,
351
383
  async: !1,
352
384
  wrapped: n,
353
- default: r,
385
+ default: s,
354
386
  get "~standard"() {
355
- return /* @__PURE__ */ f(this);
387
+ return /* @__PURE__ */ o(this);
356
388
  },
357
389
  "~run"(e, t) {
358
- return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ _(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
390
+ return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ P(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
359
391
  }
360
392
  };
361
393
  }
362
394
  // @__NO_SIDE_EFFECTS__
363
- function B(n, r) {
395
+ function T(n, s) {
364
396
  return {
365
397
  kind: "schema",
366
398
  type: "picklist",
367
- reference: B,
368
- expects: /* @__PURE__ */ S(n.map($), "|"),
399
+ reference: T,
400
+ expects: /* @__PURE__ */ D(n.map(_), "|"),
369
401
  async: !1,
370
402
  options: n,
371
- message: r,
403
+ message: s,
372
404
  get "~standard"() {
373
- return /* @__PURE__ */ f(this);
405
+ return /* @__PURE__ */ o(this);
374
406
  },
375
407
  "~run"(e, t) {
376
408
  return this.options.includes(e.value) ? e.typed = !0 : y(this, "type", e, t), e;
@@ -378,138 +410,242 @@ function B(n, r) {
378
410
  };
379
411
  }
380
412
  // @__NO_SIDE_EFFECTS__
381
- function H(n) {
413
+ function U(n, s, e) {
414
+ return {
415
+ kind: "schema",
416
+ type: "record",
417
+ reference: U,
418
+ expects: "Object",
419
+ async: !1,
420
+ key: n,
421
+ value: s,
422
+ message: e,
423
+ get "~standard"() {
424
+ return /* @__PURE__ */ o(this);
425
+ },
426
+ "~run"(t, r) {
427
+ var i, p;
428
+ const l = t.value;
429
+ if (l && typeof l == "object") {
430
+ t.typed = !0, t.value = {};
431
+ for (const u in l) if (/* @__PURE__ */ S(l, u)) {
432
+ const a = l[u], c = this.key["~run"]({ value: u }, r);
433
+ if (c.issues) {
434
+ const b = {
435
+ type: "object",
436
+ origin: "key",
437
+ input: l,
438
+ key: u,
439
+ value: a
440
+ };
441
+ for (const h of c.issues)
442
+ h.path = [b], (i = t.issues) == null || i.push(h);
443
+ if (t.issues || (t.issues = c.issues), r.abortEarly) {
444
+ t.typed = !1;
445
+ break;
446
+ }
447
+ }
448
+ const f = this.value["~run"]({ value: a }, r);
449
+ if (f.issues) {
450
+ const b = {
451
+ type: "object",
452
+ origin: "value",
453
+ input: l,
454
+ key: u,
455
+ value: a
456
+ };
457
+ for (const h of f.issues)
458
+ h.path ? h.path.unshift(b) : h.path = [b], (p = t.issues) == null || p.push(h);
459
+ if (t.issues || (t.issues = f.issues), r.abortEarly) {
460
+ t.typed = !1;
461
+ break;
462
+ }
463
+ }
464
+ (!c.typed || !f.typed) && (t.typed = !1), c.typed && (t.value[c.value] = f.value);
465
+ }
466
+ } else y(this, "type", t, r);
467
+ return t;
468
+ }
469
+ };
470
+ }
471
+ // @__NO_SIDE_EFFECTS__
472
+ function W(n) {
382
473
  return {
383
474
  kind: "schema",
384
475
  type: "string",
385
- reference: H,
476
+ reference: W,
386
477
  expects: "string",
387
478
  async: !1,
388
479
  message: n,
389
480
  get "~standard"() {
390
- return /* @__PURE__ */ f(this);
481
+ return /* @__PURE__ */ o(this);
482
+ },
483
+ "~run"(s, e) {
484
+ return typeof s.value == "string" ? s.typed = !0 : y(this, "type", s, e), s;
485
+ }
486
+ };
487
+ }
488
+ // @__NO_SIDE_EFFECTS__
489
+ function O(n) {
490
+ let s;
491
+ if (n) for (const e of n) s ? s.push(...e.issues) : s = e.issues;
492
+ return s;
493
+ }
494
+ // @__NO_SIDE_EFFECTS__
495
+ function X(n, s) {
496
+ return {
497
+ kind: "schema",
498
+ type: "union",
499
+ reference: X,
500
+ expects: /* @__PURE__ */ D(n.map((e) => e.expects), "|"),
501
+ async: !1,
502
+ options: n,
503
+ message: s,
504
+ get "~standard"() {
505
+ return /* @__PURE__ */ o(this);
506
+ },
507
+ "~run"(e, t) {
508
+ let r, l, i;
509
+ for (const p of this.options) {
510
+ const u = p["~run"]({ value: e.value }, t);
511
+ if (u.typed) if (u.issues) l ? l.push(u) : l = [u];
512
+ else {
513
+ r = u;
514
+ break;
515
+ }
516
+ else i ? i.push(u) : i = [u];
517
+ }
518
+ if (r) return r;
519
+ if (l) {
520
+ if (l.length === 1) return l[0];
521
+ y(this, "type", e, t, { issues: /* @__PURE__ */ O(l) }), e.typed = !0;
522
+ } else {
523
+ if ((i == null ? void 0 : i.length) === 1) return i[0];
524
+ y(this, "type", e, t, { issues: /* @__PURE__ */ O(i) });
525
+ }
526
+ return e;
527
+ }
528
+ };
529
+ }
530
+ // @__NO_SIDE_EFFECTS__
531
+ function Y() {
532
+ return {
533
+ kind: "schema",
534
+ type: "unknown",
535
+ reference: Y,
536
+ expects: "unknown",
537
+ async: !1,
538
+ get "~standard"() {
539
+ return /* @__PURE__ */ o(this);
391
540
  },
392
- "~run"(r, e) {
393
- return typeof r.value == "string" ? r.typed = !0 : y(this, "type", r, e), r;
541
+ "~run"(n) {
542
+ return n.typed = !0, n;
394
543
  }
395
544
  };
396
545
  }
397
546
  // @__NO_SIDE_EFFECTS__
398
- function J(n, r, e) {
547
+ function Z(n, s, e) {
399
548
  return {
400
549
  kind: "schema",
401
550
  type: "variant",
402
- reference: J,
551
+ reference: Z,
403
552
  expects: "Object",
404
553
  async: !1,
405
554
  key: n,
406
- options: r,
555
+ options: s,
407
556
  message: e,
408
557
  get "~standard"() {
409
- return /* @__PURE__ */ f(this);
558
+ return /* @__PURE__ */ o(this);
410
559
  },
411
- "~run"(t, i) {
412
- const a = t.value;
413
- if (a && typeof a == "object") {
414
- let s, l = 0, u = this.key, p = [];
415
- const c = (m, j) => {
416
- for (const h of m.options) {
417
- if (h.type === "variant")
418
- c(h, new Set(j).add(h.key));
560
+ "~run"(t, r) {
561
+ const l = t.value;
562
+ if (l && typeof l == "object") {
563
+ let i, p = 0, u = this.key, a = [];
564
+ const c = (f, b) => {
565
+ for (const h of f.options) {
566
+ if (h.type === "variant") c(h, new Set(b).add(h.key));
419
567
  else {
420
- let P = !0, b = 0;
421
- for (const o of j) {
422
- const k = h.entries[o];
423
- if (o in a ? k["~run"](
424
- // @ts-expect-error
425
- { typed: !1, value: a[o] },
426
- { abortEarly: !0 }
427
- ).issues : k.type !== "exact_optional" && k.type !== "optional" && k.type !== "nullish") {
428
- P = !1, u !== o && (l < b || l === b && o in a && !(u in a)) && (l = b, u = o, p = []), u === o && p.push(
429
- h.entries[o].expects
430
- );
568
+ let w = !0, k = 0;
569
+ for (const v of b) {
570
+ const g = h.entries[v];
571
+ if (v in l ? g["~run"]({
572
+ typed: !1,
573
+ value: l[v]
574
+ }, { abortEarly: !0 }).issues : g.type !== "exact_optional" && g.type !== "optional" && g.type !== "nullish") {
575
+ w = !1, u !== v && (p < k || p === k && v in l && !(u in l)) && (p = k, u = v, a = []), u === v && a.push(h.entries[v].expects);
431
576
  break;
432
577
  }
433
- b++;
578
+ k++;
434
579
  }
435
- if (P) {
436
- const o = h["~run"]({ value: a }, i);
437
- (!s || !s.typed && o.typed) && (s = o);
580
+ if (w) {
581
+ const v = h["~run"]({ value: l }, r);
582
+ (!i || !i.typed && v.typed) && (i = v);
438
583
  }
439
584
  }
440
- if (s && !s.issues)
441
- break;
585
+ if (i && !i.issues) break;
442
586
  }
443
587
  };
444
- if (c(this, /* @__PURE__ */ new Set([this.key])), s)
445
- return s;
446
- y(this, "type", t, i, {
447
- // @ts-expect-error
448
- input: a[u],
449
- expected: /* @__PURE__ */ S(p, "|"),
450
- path: [
451
- {
452
- type: "object",
453
- origin: "value",
454
- input: a,
455
- key: u,
456
- // @ts-expect-error
457
- value: a[u]
458
- }
459
- ]
588
+ if (c(this, /* @__PURE__ */ new Set([this.key])), i) return i;
589
+ y(this, "type", t, r, {
590
+ input: l[u],
591
+ expected: /* @__PURE__ */ D(a, "|"),
592
+ path: [{
593
+ type: "object",
594
+ origin: "value",
595
+ input: l,
596
+ key: u,
597
+ value: l[u]
598
+ }]
460
599
  });
461
- } else
462
- y(this, "type", t, i);
600
+ } else y(this, "type", t, r);
463
601
  return t;
464
602
  }
465
603
  };
466
604
  }
467
605
  // @__NO_SIDE_EFFECTS__
468
- function Q(...n) {
606
+ function $(...n) {
469
607
  return {
470
608
  ...n[0],
471
609
  pipe: n,
472
610
  get "~standard"() {
473
- return /* @__PURE__ */ f(this);
611
+ return /* @__PURE__ */ o(this);
474
612
  },
475
- "~run"(r, e) {
476
- for (const t of n)
477
- if (t.kind !== "metadata") {
478
- if (r.issues && (t.kind === "schema" || t.kind === "transformation")) {
479
- r.typed = !1;
480
- break;
481
- }
482
- (!r.issues || !e.abortEarly && !e.abortPipeEarly) && (r = t["~run"](r, e));
613
+ "~run"(s, e) {
614
+ for (const t of n) if (t.kind !== "metadata") {
615
+ if (s.issues && (t.kind === "schema" || t.kind === "transformation")) {
616
+ s.typed = !1;
617
+ break;
483
618
  }
484
- return r;
619
+ (!s.issues || !e.abortEarly && !e.abortPipeEarly) && (s = t["~run"](s, e));
620
+ }
621
+ return s;
485
622
  }
486
623
  };
487
624
  }
488
625
  // @__NO_SIDE_EFFECTS__
489
- function T(...n) {
626
+ function ee(...n) {
490
627
  return {
491
628
  ...n[0],
492
629
  pipe: n,
493
630
  async: !0,
494
631
  get "~standard"() {
495
- return /* @__PURE__ */ f(this);
632
+ return /* @__PURE__ */ o(this);
496
633
  },
497
- async "~run"(r, e) {
498
- for (const t of n)
499
- if (t.kind !== "metadata") {
500
- if (r.issues && (t.kind === "schema" || t.kind === "transformation")) {
501
- r.typed = !1;
502
- break;
503
- }
504
- (!r.issues || !e.abortEarly && !e.abortPipeEarly) && (r = await t["~run"](r, e));
634
+ async "~run"(s, e) {
635
+ for (const t of n) if (t.kind !== "metadata") {
636
+ if (s.issues && (t.kind === "schema" || t.kind === "transformation")) {
637
+ s.typed = !1;
638
+ break;
505
639
  }
506
- return r;
640
+ (!s.issues || !e.abortEarly && !e.abortPipeEarly) && (s = await t["~run"](s, e));
641
+ }
642
+ return s;
507
643
  }
508
644
  };
509
645
  }
510
646
  // @__NO_SIDE_EFFECTS__
511
- function U(n, r, e) {
512
- const t = n["~run"]({ value: r }, /* @__PURE__ */ E(e));
647
+ function ne(n, s, e) {
648
+ const t = n["~run"]({ value: s }, /* @__PURE__ */ j(e));
513
649
  return {
514
650
  typed: t.typed,
515
651
  success: !t.issues,
@@ -518,11 +654,8 @@ function U(n, r, e) {
518
654
  };
519
655
  }
520
656
  // @__NO_SIDE_EFFECTS__
521
- async function W(n, r, e) {
522
- const t = await n["~run"](
523
- { value: r },
524
- /* @__PURE__ */ E(e)
525
- );
657
+ async function se(n, s, e) {
658
+ const t = await n["~run"]({ value: s }, /* @__PURE__ */ j(e));
526
659
  return {
527
660
  typed: t.typed,
528
661
  success: !t.issues,
@@ -532,32 +665,37 @@ async function W(n, r, e) {
532
665
  }
533
666
  export {
534
667
  y as _addIssue,
535
- f as _getStandardProps,
536
- S as _joinExpects,
537
- $ as _stringify,
538
- N as array,
539
- C as boolean,
540
- O as checkAsync,
541
- F as custom,
542
- _ as getDefault,
543
- L as getFallback,
544
- E as getGlobalConfig,
545
- D as getGlobalMessage,
546
- w as getSchemaMessage,
547
- A as getSpecificMessage,
548
- K as literal,
549
- I as maxLength,
550
- q as minLength,
551
- M as nonEmpty,
552
- R as number,
553
- V as object,
554
- z as optional,
555
- B as picklist,
556
- Q as pipe,
557
- T as pipeAsync,
558
- U as safeParse,
559
- W as safeParseAsync,
560
- H as string,
561
- G as trim,
562
- J as variant
668
+ o as _getStandardProps,
669
+ S as _isValidObjectKey,
670
+ D as _joinExpects,
671
+ _ as _stringify,
672
+ C as array,
673
+ F as boolean,
674
+ M as checkAsync,
675
+ R as custom,
676
+ P as getDefault,
677
+ I as getFallback,
678
+ j as getGlobalConfig,
679
+ A as getGlobalMessage,
680
+ q as getSchemaMessage,
681
+ K as getSpecificMessage,
682
+ z as literal,
683
+ B as looseObject,
684
+ V as maxLength,
685
+ G as minLength,
686
+ L as nonEmpty,
687
+ H as number,
688
+ J as object,
689
+ Q as optional,
690
+ T as picklist,
691
+ $ as pipe,
692
+ ee as pipeAsync,
693
+ U as record,
694
+ ne as safeParse,
695
+ se as safeParseAsync,
696
+ W as string,
697
+ N as trim,
698
+ X as union,
699
+ Y as unknown,
700
+ Z as variant
563
701
  };