@effect-app/vue-components 3.2.0 → 4.0.0-beta.0
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/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +11 -13
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +6 -4
- package/dist/types/utils/index.d.ts +4 -3
- package/dist/vue-components.es.js +13 -14
- package/dist/vue-components.es10.js +109 -115
- package/dist/vue-components.es11.js +1 -1
- package/dist/vue-components.es12.js +290 -341
- package/dist/vue-components.es17.js +723 -4
- package/dist/vue-components.es18.js +140 -9
- package/dist/vue-components.es19.js +4 -55
- package/dist/vue-components.es2.js +17 -18
- package/dist/vue-components.es20.js +11 -68
- package/dist/vue-components.es21.js +3 -6
- package/dist/vue-components.es22.js +24 -6
- package/dist/vue-components.es23.js +4 -3
- package/dist/vue-components.es24.js +8 -3
- package/dist/vue-components.es25.js +55 -2
- package/dist/vue-components.es26.js +69 -2
- package/dist/vue-components.es27.js +6 -2
- package/dist/vue-components.es28.js +6 -2
- package/dist/vue-components.es29.js +3 -17
- package/dist/vue-components.es3.js +9 -9
- package/dist/vue-components.es30.js +3 -192
- package/dist/vue-components.es31.js +4 -0
- package/dist/vue-components.es32.js +2 -42
- package/dist/vue-components.es33.js +1 -1
- package/dist/vue-components.es34.js +1 -1
- package/dist/vue-components.es35.js +17 -111
- package/dist/vue-components.es36.js +40 -0
- package/dist/vue-components.es37.js +4 -7
- package/dist/vue-components.es38.js +82 -31
- package/dist/vue-components.es39.js +54 -0
- package/dist/vue-components.es40.js +561 -4
- package/dist/vue-components.es41.js +40 -22
- package/dist/vue-components.es42.js +27 -5
- package/dist/vue-components.es43.js +5 -21
- package/dist/vue-components.es44.js +39 -29
- package/dist/vue-components.es45.js +313 -21
- package/dist/vue-components.es46.js +31 -12
- package/dist/vue-components.es47.js +4 -5
- package/dist/vue-components.es48.js +23 -18
- package/dist/vue-components.es49.js +74 -8
- package/dist/vue-components.es50.js +98 -30
- package/dist/vue-components.es51.js +2 -48
- package/dist/vue-components.es52.js +317 -25
- package/dist/vue-components.es53.js +64 -11
- package/dist/vue-components.es54.js +2 -65
- package/dist/vue-components.es55.js +2 -56
- package/dist/vue-components.es56.js +110 -16
- package/dist/vue-components.es58.js +7 -29
- package/dist/vue-components.es59.js +31 -41
- package/dist/vue-components.es61.js +190 -42
- package/dist/vue-components.es63.js +6 -0
- package/dist/vue-components.es64.js +103 -0
- package/dist/vue-components.es65.js +4 -0
- package/dist/vue-components.es66.js +23 -0
- package/dist/vue-components.es67.js +84 -0
- package/dist/vue-components.es68.js +14 -0
- package/dist/vue-components.es69.js +115 -0
- package/dist/vue-components.es7.js +1 -1
- package/dist/vue-components.es70.js +5 -0
- package/dist/vue-components.es71.js +34 -0
- package/dist/vue-components.es72.js +4 -0
- package/dist/vue-components.es73.js +4 -0
- package/dist/vue-components.es74.js +17 -0
- package/dist/vue-components.es75.js +72 -0
- package/dist/vue-components.es76.js +25 -0
- package/dist/vue-components.es77.js +7 -0
- package/dist/vue-components.es78.js +23 -0
- package/dist/vue-components.es79.js +32 -0
- package/dist/vue-components.es80.js +24 -0
- package/dist/vue-components.es81.js +14 -0
- package/dist/vue-components.es82.js +7 -0
- package/dist/vue-components.es83.js +21 -0
- package/dist/vue-components.es84.js +11 -0
- package/dist/vue-components.es85.js +33 -0
- package/dist/vue-components.es86.js +50 -0
- package/dist/vue-components.es87.js +28 -0
- package/dist/vue-components.es88.js +17 -0
- package/dist/vue-components.es89.js +18 -0
- package/dist/vue-components.es90.js +10 -0
- package/dist/vue-components.es91.js +13 -0
- package/dist/vue-components.es92.js +67 -0
- package/dist/vue-components.es93.js +58 -0
- package/dist/vue-components.es94.js +19 -0
- package/dist/{vue-components.es57.js → vue-components.es95.js} +3 -3
- package/dist/vue-components.es96.js +31 -0
- package/dist/vue-components.es97.js +44 -0
- package/dist/vue-components.es99.js +46 -0
- package/package.json +25 -24
- package/src/components/OmegaForm/OmegaAutoGen.vue +11 -10
- package/src/components/OmegaForm/OmegaErrorsInternal.vue +3 -2
- package/src/components/OmegaForm/OmegaFormStuff.ts +249 -274
- package/src/components/OmegaForm/OmegaInternalInput.vue +1 -1
- package/src/components/OmegaForm/useOmegaForm.ts +27 -28
- package/src/utils/index.ts +7 -7
- /package/dist/{vue-components.es62.js → vue-components.es100.js} +0 -0
- /package/dist/{vue-components.es60.js → vue-components.es98.js} +0 -0
|
@@ -1,6 +1,725 @@
|
|
|
1
|
-
import "vue";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { append as xe } from "./vue-components.es36.js";
|
|
2
|
+
import { findError as P } from "./vue-components.es37.js";
|
|
3
|
+
import { fnUntracedEager as le, succeedSome as Se, succeedNone as fe, fail as p, exit as M, succeed as ke } from "./vue-components.es22.js";
|
|
4
|
+
import { format as Oe, formatPropertyKey as Te } from "./vue-components.es38.js";
|
|
5
|
+
import { memoize as Q } from "./vue-components.es39.js";
|
|
6
|
+
import { effectIsExit as L } from "./vue-components.es40.js";
|
|
7
|
+
import { some as I, none as Ne } from "./vue-components.es24.js";
|
|
8
|
+
import { Class as de } from "./vue-components.es41.js";
|
|
9
|
+
import { isUnknown as _e, isBoolean as Ae, isNumber as Ee, isString as ve } from "./vue-components.es42.js";
|
|
10
|
+
import { isFailure as R } from "./vue-components.es43.js";
|
|
11
|
+
import { transform as C, Number as Fe } from "./vue-components.es44.js";
|
|
12
|
+
import { make as $e, InvalidType as X, OneOf as je, AnyOf as Ue, Pointer as N, Composite as k, MissingKey as W, UnexpectedKey as Ce, Filter as Ie } from "./vue-components.es45.js";
|
|
13
|
+
import { Transformation as Z, numberFromString as he } from "./vue-components.es46.js";
|
|
14
|
+
function w(e) {
|
|
15
|
+
return (t) => t._tag === e;
|
|
16
|
+
}
|
|
17
|
+
const kt = /* @__PURE__ */ w("Declaration"), Ot = /* @__PURE__ */ w("Null"), Tt = /* @__PURE__ */ w("Undefined"), Pe = /* @__PURE__ */ w("Never"), Nt = /* @__PURE__ */ w("String"), _t = /* @__PURE__ */ w("Number"), At = /* @__PURE__ */ w("Boolean"), K = /* @__PURE__ */ w("Literal"), Me = /* @__PURE__ */ w("UniqueSymbol"), Et = /* @__PURE__ */ w("Arrays"), vt = /* @__PURE__ */ w("Objects"), Ft = /* @__PURE__ */ w("Union");
|
|
18
|
+
class O {
|
|
19
|
+
to;
|
|
20
|
+
transformation;
|
|
21
|
+
constructor(t, n) {
|
|
22
|
+
this.to = t, this.transformation = n;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const $t = {};
|
|
26
|
+
class ne {
|
|
27
|
+
isOptional;
|
|
28
|
+
isMutable;
|
|
29
|
+
/** Used for constructor default values (e.g. `withConstructorDefault` API) */
|
|
30
|
+
defaultValue;
|
|
31
|
+
annotations;
|
|
32
|
+
constructor(t, n, r = void 0, o = void 0) {
|
|
33
|
+
this.isOptional = t, this.isMutable = n, this.defaultValue = r, this.annotations = o;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const re = "~effect/Schema";
|
|
37
|
+
class S {
|
|
38
|
+
[re] = re;
|
|
39
|
+
annotations;
|
|
40
|
+
checks;
|
|
41
|
+
encoding;
|
|
42
|
+
context;
|
|
43
|
+
constructor(t = void 0, n = void 0, r = void 0, o = void 0) {
|
|
44
|
+
this.annotations = t, this.checks = n, this.encoding = r, this.context = o;
|
|
45
|
+
}
|
|
46
|
+
toString() {
|
|
47
|
+
return `<${this._tag}>`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
class Le extends S {
|
|
51
|
+
_tag = "Null";
|
|
52
|
+
/** @internal */
|
|
53
|
+
getParser() {
|
|
54
|
+
return te(this, null);
|
|
55
|
+
}
|
|
56
|
+
/** @internal */
|
|
57
|
+
getExpected() {
|
|
58
|
+
return "null";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const Re = /* @__PURE__ */ new Le();
|
|
62
|
+
class Be extends S {
|
|
63
|
+
_tag = "Undefined";
|
|
64
|
+
/** @internal */
|
|
65
|
+
getParser() {
|
|
66
|
+
return te(this, void 0);
|
|
67
|
+
}
|
|
68
|
+
/** @internal */
|
|
69
|
+
encodeToNull() {
|
|
70
|
+
return x(this, [Ke]);
|
|
71
|
+
}
|
|
72
|
+
/** @internal */
|
|
73
|
+
getExpected() {
|
|
74
|
+
return "undefined";
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const Ke = /* @__PURE__ */ new O(Re, /* @__PURE__ */ new Z(/* @__PURE__ */ C(() => {
|
|
78
|
+
}), /* @__PURE__ */ C(() => null))), jt = /* @__PURE__ */ new Be();
|
|
79
|
+
class qe extends S {
|
|
80
|
+
_tag = "Unknown";
|
|
81
|
+
/** @internal */
|
|
82
|
+
getParser() {
|
|
83
|
+
return V(this, _e);
|
|
84
|
+
}
|
|
85
|
+
/** @internal */
|
|
86
|
+
getExpected() {
|
|
87
|
+
return "unknown";
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const Ut = /* @__PURE__ */ new qe();
|
|
91
|
+
class B extends S {
|
|
92
|
+
_tag = "Literal";
|
|
93
|
+
literal;
|
|
94
|
+
constructor(t, n, r, o, i) {
|
|
95
|
+
if (super(n, r, o, i), typeof t == "number" && !globalThis.Number.isFinite(t))
|
|
96
|
+
throw new Error(`A numeric literal must be finite, got ${Oe(t)}`);
|
|
97
|
+
this.literal = t;
|
|
98
|
+
}
|
|
99
|
+
/** @internal */
|
|
100
|
+
getParser() {
|
|
101
|
+
return te(this, this.literal);
|
|
102
|
+
}
|
|
103
|
+
/** @internal */
|
|
104
|
+
toCodecJson() {
|
|
105
|
+
return typeof this.literal == "bigint" ? se(this) : this;
|
|
106
|
+
}
|
|
107
|
+
/** @internal */
|
|
108
|
+
toCodecStringTree() {
|
|
109
|
+
return typeof this.literal == "string" ? this : se(this);
|
|
110
|
+
}
|
|
111
|
+
/** @internal */
|
|
112
|
+
getExpected() {
|
|
113
|
+
return typeof this.literal == "string" ? JSON.stringify(this.literal) : globalThis.String(this.literal);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function se(e) {
|
|
117
|
+
const t = globalThis.String(e.literal);
|
|
118
|
+
return x(e, [new O(new B(t), new Z(C(() => e.literal), C(() => t)))]);
|
|
119
|
+
}
|
|
120
|
+
class De extends S {
|
|
121
|
+
_tag = "String";
|
|
122
|
+
/** @internal */
|
|
123
|
+
getParser() {
|
|
124
|
+
return V(this, ve);
|
|
125
|
+
}
|
|
126
|
+
/** @internal */
|
|
127
|
+
getExpected() {
|
|
128
|
+
return "string";
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const Je = /* @__PURE__ */ new De();
|
|
132
|
+
class Ve extends S {
|
|
133
|
+
_tag = "Number";
|
|
134
|
+
/** @internal */
|
|
135
|
+
getParser() {
|
|
136
|
+
return V(this, Ee);
|
|
137
|
+
}
|
|
138
|
+
/** @internal */
|
|
139
|
+
toCodecJson() {
|
|
140
|
+
return this.checks && (U(this.checks, "isFinite") || U(this.checks, "isInt")) ? this : x(this, [Xe]);
|
|
141
|
+
}
|
|
142
|
+
/** @internal */
|
|
143
|
+
toCodecStringTree() {
|
|
144
|
+
return this.checks && (U(this.checks, "isFinite") || U(this.checks, "isInt")) ? x(this, [ot]) : x(this, [ct]);
|
|
145
|
+
}
|
|
146
|
+
/** @internal */
|
|
147
|
+
getExpected() {
|
|
148
|
+
return "number";
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function U(e, t) {
|
|
152
|
+
return e.some((n) => {
|
|
153
|
+
switch (n._tag) {
|
|
154
|
+
case "Filter":
|
|
155
|
+
return n.annotations?.meta?._tag === t;
|
|
156
|
+
case "FilterGroup":
|
|
157
|
+
return U(n.checks, t);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
const Ge = /* @__PURE__ */ new Ve();
|
|
162
|
+
class ze extends S {
|
|
163
|
+
_tag = "Boolean";
|
|
164
|
+
/** @internal */
|
|
165
|
+
getParser() {
|
|
166
|
+
return V(this, Ae);
|
|
167
|
+
}
|
|
168
|
+
/** @internal */
|
|
169
|
+
getExpected() {
|
|
170
|
+
return "boolean";
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const Ct = /* @__PURE__ */ new ze();
|
|
174
|
+
class ge extends S {
|
|
175
|
+
_tag = "Arrays";
|
|
176
|
+
isMutable;
|
|
177
|
+
elements;
|
|
178
|
+
rest;
|
|
179
|
+
constructor(t, n, r, o, i, s, c) {
|
|
180
|
+
super(o, i, s, c), this.isMutable = t, this.elements = n, this.rest = r;
|
|
181
|
+
const u = n.findIndex(A);
|
|
182
|
+
if (u !== -1 && (n.slice(u + 1).some((l) => !A(l)) || r.length > 1))
|
|
183
|
+
throw new Error("A required element cannot follow an optional element. ts(1257)");
|
|
184
|
+
if (r.length > 1 && r.slice(1).some(A))
|
|
185
|
+
throw new Error("An optional element cannot follow a rest element. ts(1266)");
|
|
186
|
+
}
|
|
187
|
+
/** @internal */
|
|
188
|
+
getParser(t) {
|
|
189
|
+
const n = this, r = n.elements.map((s) => ({
|
|
190
|
+
ast: s,
|
|
191
|
+
parser: t(s)
|
|
192
|
+
})), o = n.rest.map((s) => ({
|
|
193
|
+
ast: s,
|
|
194
|
+
parser: t(s)
|
|
195
|
+
})), i = r.length;
|
|
196
|
+
return le(function* (s, c) {
|
|
197
|
+
if (s._tag === "None")
|
|
198
|
+
return s;
|
|
199
|
+
const u = s.value;
|
|
200
|
+
if (!Array.isArray(u))
|
|
201
|
+
return yield* p(new X(n, s));
|
|
202
|
+
const l = [];
|
|
203
|
+
let a;
|
|
204
|
+
const b = c.errors === "all";
|
|
205
|
+
let d = 0;
|
|
206
|
+
for (; d < i; d++) {
|
|
207
|
+
const h = r[d], m = d < u.length ? I(u[d]) : Ne(), F = h.parser(m, c), g = L(F) ? F : yield* M(F);
|
|
208
|
+
if (g._tag === "Failure") {
|
|
209
|
+
const f = P(g.cause);
|
|
210
|
+
if (R(f))
|
|
211
|
+
return yield* g;
|
|
212
|
+
const y = new N([d], f.success);
|
|
213
|
+
if (b)
|
|
214
|
+
a ? a.push(y) : a = [y];
|
|
215
|
+
else
|
|
216
|
+
return yield* p(new k(n, s, [y]));
|
|
217
|
+
} else if (g.value._tag === "Some")
|
|
218
|
+
l[d] = g.value.value;
|
|
219
|
+
else if (!A(h.ast)) {
|
|
220
|
+
const f = new N([d], new W(h.ast.context?.annotations));
|
|
221
|
+
if (b)
|
|
222
|
+
a ? a.push(f) : a = [f];
|
|
223
|
+
else
|
|
224
|
+
return yield* p(new k(n, s, [f]));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
const T = u.length;
|
|
228
|
+
if (n.rest.length > 0) {
|
|
229
|
+
const [h, ...m] = o, F = h.ast.context?.annotations;
|
|
230
|
+
for (; d < T - m.length; d++) {
|
|
231
|
+
const g = h.parser(I(u[d]), c), f = L(g) ? g : yield* M(g);
|
|
232
|
+
if (f._tag === "Failure") {
|
|
233
|
+
const y = P(f.cause);
|
|
234
|
+
if (R(y))
|
|
235
|
+
return yield* f;
|
|
236
|
+
const $ = new N([d], y.success);
|
|
237
|
+
if (b)
|
|
238
|
+
a ? a.push($) : a = [$];
|
|
239
|
+
else
|
|
240
|
+
return yield* p(new k(n, s, [$]));
|
|
241
|
+
} else if (f.value._tag === "Some")
|
|
242
|
+
l[d] = f.value.value;
|
|
243
|
+
else {
|
|
244
|
+
const y = new N([d], new W(F));
|
|
245
|
+
if (b)
|
|
246
|
+
a ? a.push(y) : a = [y];
|
|
247
|
+
else
|
|
248
|
+
return yield* p(new k(n, s, [y]));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
for (let g = 0; g < m.length; g++) {
|
|
252
|
+
const f = d + g;
|
|
253
|
+
if (!(T < f)) {
|
|
254
|
+
const y = m[g], $ = y.ast.context?.annotations, G = y.parser(I(u[f]), c), j = L(G) ? G : yield* M(G);
|
|
255
|
+
if (j._tag === "Failure") {
|
|
256
|
+
const _ = P(j.cause);
|
|
257
|
+
if (R(_))
|
|
258
|
+
return yield* j;
|
|
259
|
+
const z = new N([f], _.success);
|
|
260
|
+
if (b)
|
|
261
|
+
a ? a.push(z) : a = [z];
|
|
262
|
+
else
|
|
263
|
+
return yield* p(new k(n, s, [z]));
|
|
264
|
+
} else if (j.value._tag === "Some")
|
|
265
|
+
l[f] = j.value.value;
|
|
266
|
+
else {
|
|
267
|
+
const _ = new N([f], new W($));
|
|
268
|
+
if (b)
|
|
269
|
+
a ? a.push(_) : a = [_];
|
|
270
|
+
else
|
|
271
|
+
return yield* p(new k(n, s, [_]));
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
} else
|
|
276
|
+
for (let h = i; h <= T - 1; h++) {
|
|
277
|
+
const m = new N([h], new Ce(n, u[h]));
|
|
278
|
+
if (b)
|
|
279
|
+
a ? a.push(m) : a = [m];
|
|
280
|
+
else
|
|
281
|
+
return yield* p(new k(n, s, [m]));
|
|
282
|
+
}
|
|
283
|
+
return a ? yield* p(new k(n, s, a)) : I(l);
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
/** @internal */
|
|
287
|
+
recur(t) {
|
|
288
|
+
const n = Y(this.elements, t), r = Y(this.rest, t);
|
|
289
|
+
return n === this.elements && r === this.rest ? this : new ge(this.isMutable, n, r, this.annotations, this.checks, void 0, this.context);
|
|
290
|
+
}
|
|
291
|
+
/** @internal */
|
|
292
|
+
getExpected() {
|
|
293
|
+
return "array";
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
const We = "[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?";
|
|
297
|
+
function Ye(e) {
|
|
298
|
+
return e.ast;
|
|
299
|
+
}
|
|
300
|
+
function It(e, t, n) {
|
|
301
|
+
return new v(e.map(Ye), t, void 0, n);
|
|
302
|
+
}
|
|
303
|
+
function me(e) {
|
|
304
|
+
switch (e._tag) {
|
|
305
|
+
case "Null":
|
|
306
|
+
return ["null"];
|
|
307
|
+
case "Undefined":
|
|
308
|
+
case "Void":
|
|
309
|
+
return ["undefined"];
|
|
310
|
+
case "String":
|
|
311
|
+
case "TemplateLiteral":
|
|
312
|
+
return ["string"];
|
|
313
|
+
case "Number":
|
|
314
|
+
return ["number"];
|
|
315
|
+
case "Boolean":
|
|
316
|
+
return ["boolean"];
|
|
317
|
+
case "Symbol":
|
|
318
|
+
case "UniqueSymbol":
|
|
319
|
+
return ["symbol"];
|
|
320
|
+
case "BigInt":
|
|
321
|
+
return ["bigint"];
|
|
322
|
+
case "Arrays":
|
|
323
|
+
return ["array"];
|
|
324
|
+
case "ObjectKeyword":
|
|
325
|
+
return ["object", "array", "function"];
|
|
326
|
+
case "Objects":
|
|
327
|
+
return e.propertySignatures.length || e.indexSignatures.length ? ["object"] : ["object", "array"];
|
|
328
|
+
case "Enum":
|
|
329
|
+
return Array.from(new Set(e.enums.map(([, t]) => typeof t)));
|
|
330
|
+
case "Literal":
|
|
331
|
+
return [typeof e.literal];
|
|
332
|
+
case "Union":
|
|
333
|
+
return Array.from(new Set(e.types.flatMap(me)));
|
|
334
|
+
default:
|
|
335
|
+
return ["null", "undefined", "string", "number", "boolean", "symbol", "bigint", "object", "array", "function"];
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
function ye(e) {
|
|
339
|
+
switch (e._tag) {
|
|
340
|
+
default:
|
|
341
|
+
return [];
|
|
342
|
+
case "Declaration": {
|
|
343
|
+
const t = e.annotations?.["~sentinels"];
|
|
344
|
+
return Array.isArray(t) ? t : [];
|
|
345
|
+
}
|
|
346
|
+
case "Objects":
|
|
347
|
+
return e.propertySignatures.flatMap((t) => {
|
|
348
|
+
const n = t.type;
|
|
349
|
+
if (!A(n)) {
|
|
350
|
+
if (K(n))
|
|
351
|
+
return [{
|
|
352
|
+
key: t.name,
|
|
353
|
+
literal: n.literal
|
|
354
|
+
}];
|
|
355
|
+
if (Me(n))
|
|
356
|
+
return [{
|
|
357
|
+
key: t.name,
|
|
358
|
+
literal: n.symbol
|
|
359
|
+
}];
|
|
360
|
+
}
|
|
361
|
+
return [];
|
|
362
|
+
});
|
|
363
|
+
case "Arrays":
|
|
364
|
+
return e.elements.flatMap((t, n) => K(t) && !A(t) ? [{
|
|
365
|
+
key: n,
|
|
366
|
+
literal: t.literal
|
|
367
|
+
}] : []);
|
|
368
|
+
case "Suspend":
|
|
369
|
+
return ye(e.thunk());
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
const ie = /* @__PURE__ */ new WeakMap();
|
|
373
|
+
function He(e) {
|
|
374
|
+
let t = ie.get(e);
|
|
375
|
+
if (t) return t;
|
|
376
|
+
t = {};
|
|
377
|
+
for (const n of e) {
|
|
378
|
+
const r = ee(n);
|
|
379
|
+
if (Pe(r)) continue;
|
|
380
|
+
const o = me(r), i = ye(r);
|
|
381
|
+
t.byType ??= {};
|
|
382
|
+
for (const s of o) (t.byType[s] ??= []).push(n);
|
|
383
|
+
if (i.length > 0) {
|
|
384
|
+
t.bySentinel ??= /* @__PURE__ */ new Map();
|
|
385
|
+
for (const {
|
|
386
|
+
key: s,
|
|
387
|
+
literal: c
|
|
388
|
+
} of i) {
|
|
389
|
+
let u = t.bySentinel.get(s);
|
|
390
|
+
u || t.bySentinel.set(s, u = /* @__PURE__ */ new Map());
|
|
391
|
+
let l = u.get(c);
|
|
392
|
+
l || u.set(c, l = []), l.push(n);
|
|
393
|
+
}
|
|
394
|
+
} else {
|
|
395
|
+
t.otherwise ??= {};
|
|
396
|
+
for (const s of o) (t.otherwise[s] ??= []).push(n);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return ie.set(e, t), t;
|
|
400
|
+
}
|
|
401
|
+
function oe(e) {
|
|
402
|
+
return (t) => {
|
|
403
|
+
const n = ee(t);
|
|
404
|
+
return n._tag === "Literal" ? n.literal === e : n._tag === "UniqueSymbol" ? n.symbol === e : !0;
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
function Qe(e, t) {
|
|
408
|
+
const n = He(t), r = e === null ? "null" : Array.isArray(e) ? "array" : typeof e;
|
|
409
|
+
if (n.bySentinel) {
|
|
410
|
+
const o = n.otherwise?.[r] ?? [];
|
|
411
|
+
if (r === "object" || r === "array") {
|
|
412
|
+
for (const [i, s] of n.bySentinel)
|
|
413
|
+
if (Object.hasOwn(e, i)) {
|
|
414
|
+
const c = s.get(e[i]);
|
|
415
|
+
if (c) return [...c, ...o].filter(oe(e));
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return o;
|
|
419
|
+
}
|
|
420
|
+
return (n.byType?.[r] ?? []).filter(oe(e));
|
|
421
|
+
}
|
|
422
|
+
class v extends S {
|
|
423
|
+
_tag = "Union";
|
|
424
|
+
types;
|
|
425
|
+
mode;
|
|
426
|
+
constructor(t, n, r, o, i, s) {
|
|
427
|
+
super(r, o, i, s), this.types = t, this.mode = n;
|
|
428
|
+
}
|
|
429
|
+
/** @internal */
|
|
430
|
+
getParser(t) {
|
|
431
|
+
const n = this;
|
|
432
|
+
return le(function* (r, o) {
|
|
433
|
+
if (r._tag === "None")
|
|
434
|
+
return r;
|
|
435
|
+
const i = r.value, s = n.mode === "oneOf", c = Qe(i, n.types);
|
|
436
|
+
let u;
|
|
437
|
+
const l = {
|
|
438
|
+
out: void 0,
|
|
439
|
+
successes: []
|
|
440
|
+
};
|
|
441
|
+
for (let a = 0; a < c.length; a++) {
|
|
442
|
+
const b = c[a], T = t(b)(r, o), h = L(T) ? T : yield* M(T);
|
|
443
|
+
if (h._tag === "Failure") {
|
|
444
|
+
const m = P(h.cause);
|
|
445
|
+
if (R(m))
|
|
446
|
+
return yield* h;
|
|
447
|
+
u ? u.push(m.success) : u = [m.success];
|
|
448
|
+
continue;
|
|
449
|
+
} else {
|
|
450
|
+
if (l.out && s)
|
|
451
|
+
return l.successes.push(b), yield* p(new je(n, i, l.successes));
|
|
452
|
+
if (l.out = h.value, l.successes.push(b), !s)
|
|
453
|
+
break;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
return l.out ? l.out : yield* p(new Ue(n, i, u ?? []));
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
/** @internal */
|
|
460
|
+
recur(t) {
|
|
461
|
+
const n = Y(this.types, t);
|
|
462
|
+
return n === this.types ? this : new v(n, this.mode, this.annotations, this.checks, void 0, this.context);
|
|
463
|
+
}
|
|
464
|
+
/** @internal */
|
|
465
|
+
getExpected(t) {
|
|
466
|
+
const n = this.annotations?.expected;
|
|
467
|
+
if (typeof n == "string") return n;
|
|
468
|
+
if (this.types.length === 0) return "never";
|
|
469
|
+
const r = this.types.map((o) => {
|
|
470
|
+
const i = ee(o);
|
|
471
|
+
switch (i._tag) {
|
|
472
|
+
case "Arrays": {
|
|
473
|
+
const s = i.elements.filter(K);
|
|
474
|
+
if (s.length > 0)
|
|
475
|
+
return `${ce(i.isMutable)}[ ${s.map((c) => t(c) + ae(c.context?.isOptional)).join(", ")}, ... ]`;
|
|
476
|
+
break;
|
|
477
|
+
}
|
|
478
|
+
case "Objects": {
|
|
479
|
+
const s = i.propertySignatures.filter((c) => K(c.type));
|
|
480
|
+
if (s.length > 0)
|
|
481
|
+
return `{ ${s.map((c) => `${ce(c.type.context?.isMutable)}${Te(c.name)}${ae(c.type.context?.isOptional)}: ${t(c.type)}`).join(", ")}, ... }`;
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return t(i);
|
|
486
|
+
});
|
|
487
|
+
return Array.from(new Set(r)).join(" | ");
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
const pe = /* @__PURE__ */ new v([/* @__PURE__ */ new B("Infinity"), /* @__PURE__ */ new B("-Infinity"), /* @__PURE__ */ new B("NaN")], "anyOf"), Xe = /* @__PURE__ */ new O(/* @__PURE__ */ new v([Ge, pe], "anyOf"), /* @__PURE__ */ new Z(/* @__PURE__ */ Fe(), /* @__PURE__ */ C((e) => globalThis.Number.isFinite(e) ? e : globalThis.String(e))));
|
|
491
|
+
function ce(e) {
|
|
492
|
+
return e ? "" : "readonly ";
|
|
493
|
+
}
|
|
494
|
+
function ae(e) {
|
|
495
|
+
return e ? "?" : "";
|
|
496
|
+
}
|
|
497
|
+
class q extends de {
|
|
498
|
+
_tag = "Filter";
|
|
499
|
+
run;
|
|
500
|
+
annotations;
|
|
501
|
+
/**
|
|
502
|
+
* Whether the parsing process should be aborted after this check has failed.
|
|
503
|
+
*/
|
|
504
|
+
aborted;
|
|
505
|
+
constructor(t, n = void 0, r = !1) {
|
|
506
|
+
super(), this.run = t, this.annotations = n, this.aborted = r;
|
|
507
|
+
}
|
|
508
|
+
annotate(t) {
|
|
509
|
+
return new q(this.run, {
|
|
510
|
+
...this.annotations,
|
|
511
|
+
...t
|
|
512
|
+
}, this.aborted);
|
|
513
|
+
}
|
|
514
|
+
abort() {
|
|
515
|
+
return new q(this.run, this.annotations, !0);
|
|
516
|
+
}
|
|
517
|
+
and(t, n) {
|
|
518
|
+
return new D([this, t], n);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
class D extends de {
|
|
522
|
+
_tag = "FilterGroup";
|
|
523
|
+
checks;
|
|
524
|
+
annotations;
|
|
525
|
+
constructor(t, n = void 0) {
|
|
526
|
+
super(), this.checks = t, this.annotations = n;
|
|
527
|
+
}
|
|
528
|
+
annotate(t) {
|
|
529
|
+
return new D(this.checks, {
|
|
530
|
+
...this.annotations,
|
|
531
|
+
...t
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
and(t, n) {
|
|
535
|
+
return new D([this, t], n);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
function Ze(e, t, n = !1) {
|
|
539
|
+
return new q((r, o, i) => $e(r, e(r, o, i)), t, n);
|
|
540
|
+
}
|
|
541
|
+
function et(e, t) {
|
|
542
|
+
const n = e.source;
|
|
543
|
+
return Ze((r) => e.test(r), {
|
|
544
|
+
expected: `a string matching the RegExp ${n}`,
|
|
545
|
+
meta: {
|
|
546
|
+
_tag: "isPattern",
|
|
547
|
+
regExp: e
|
|
548
|
+
},
|
|
549
|
+
toArbitraryConstraint: {
|
|
550
|
+
string: {
|
|
551
|
+
patterns: [e.source]
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
...t
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
function J(e, t) {
|
|
558
|
+
const n = Object.getOwnPropertyDescriptors(e);
|
|
559
|
+
return t(n), Object.create(Object.getPrototypeOf(e), n);
|
|
560
|
+
}
|
|
561
|
+
function x(e, t) {
|
|
562
|
+
return e.encoding === t ? e : J(e, (n) => {
|
|
563
|
+
n.encoding.value = t;
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
function tt(e, t) {
|
|
567
|
+
return e.context === t ? e : J(e, (n) => {
|
|
568
|
+
n.context.value = t;
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
function Pt(e, t) {
|
|
572
|
+
if (e.checks) {
|
|
573
|
+
const n = e.checks[e.checks.length - 1];
|
|
574
|
+
return we(e, xe(e.checks.slice(0, -1), n.annotate(t)));
|
|
575
|
+
}
|
|
576
|
+
return J(e, (n) => {
|
|
577
|
+
n.annotations.value = {
|
|
578
|
+
...n.annotations.value,
|
|
579
|
+
...t
|
|
580
|
+
};
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
function we(e, t) {
|
|
584
|
+
return e.checks === t ? e : J(e, (n) => {
|
|
585
|
+
n.checks.value = t;
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
function nt(e, t) {
|
|
589
|
+
return we(e, e.checks ? [...e.checks, ...t] : t);
|
|
590
|
+
}
|
|
591
|
+
function rt(e, t, n) {
|
|
592
|
+
const r = new O(e, t);
|
|
593
|
+
return x(n, n.encoding ? [...n.encoding, r] : [r]);
|
|
594
|
+
}
|
|
595
|
+
function Y(e, t) {
|
|
596
|
+
let n = !1;
|
|
597
|
+
const r = new Array(e.length);
|
|
598
|
+
for (let o = 0; o < e.length; o++) {
|
|
599
|
+
const i = e[o], s = t(i);
|
|
600
|
+
s !== i && (n = !0), r[o] = s;
|
|
601
|
+
}
|
|
602
|
+
return n ? r : e;
|
|
603
|
+
}
|
|
604
|
+
function Mt(e, t) {
|
|
605
|
+
const n = e.context ? new ne(e.context.isOptional, e.context.isMutable, e.context.defaultValue, {
|
|
606
|
+
...e.context.annotations,
|
|
607
|
+
...t
|
|
608
|
+
}) : new ne(!1, !1, void 0, t);
|
|
609
|
+
return tt(e, n);
|
|
610
|
+
}
|
|
611
|
+
function Lt(e, t, n) {
|
|
612
|
+
return rt(e, n, t);
|
|
613
|
+
}
|
|
614
|
+
function A(e) {
|
|
615
|
+
return e.context?.isOptional ?? !1;
|
|
616
|
+
}
|
|
617
|
+
const H = /* @__PURE__ */ Q((e) => {
|
|
618
|
+
if (e.encoding)
|
|
619
|
+
return H(x(e, void 0));
|
|
620
|
+
const t = e;
|
|
621
|
+
return t.recur?.(H) ?? t;
|
|
622
|
+
}), ee = /* @__PURE__ */ Q((e) => H(E(e)));
|
|
623
|
+
function st(e, t) {
|
|
624
|
+
const n = t, r = n.length, o = n[r - 1], i = [new O(E(x(e, void 0)), n[0].transformation.flip())];
|
|
625
|
+
for (let c = 1; c < r; c++)
|
|
626
|
+
i.unshift(new O(E(n[c - 1].to), n[c].transformation.flip()));
|
|
627
|
+
const s = E(o.to);
|
|
628
|
+
return s.encoding ? x(s, [...s.encoding, ...i]) : x(s, i);
|
|
629
|
+
}
|
|
630
|
+
const E = /* @__PURE__ */ Q((e) => {
|
|
631
|
+
if (e.encoding)
|
|
632
|
+
return st(e, e.encoding);
|
|
633
|
+
const t = e;
|
|
634
|
+
return t.flip?.(E) ?? t.recur?.(E) ?? t;
|
|
635
|
+
});
|
|
636
|
+
function te(e, t) {
|
|
637
|
+
const n = Se(t);
|
|
638
|
+
return (r) => r._tag === "None" ? fe : r.value === t ? n : p(new X(e, r));
|
|
639
|
+
}
|
|
640
|
+
function V(e, t) {
|
|
641
|
+
return (n) => n._tag === "None" ? fe : t(n.value) ? ke(n) : p(new X(e, n));
|
|
642
|
+
}
|
|
643
|
+
const ue = /* @__PURE__ */ new globalThis.RegExp(`^${We}$`);
|
|
644
|
+
function it(e) {
|
|
645
|
+
return et(ue, {
|
|
646
|
+
expected: "a string representing a finite number",
|
|
647
|
+
meta: {
|
|
648
|
+
_tag: "isStringFinite",
|
|
649
|
+
regExp: ue
|
|
650
|
+
},
|
|
651
|
+
...e
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
const be = /* @__PURE__ */ nt(Je, [/* @__PURE__ */ it()]), ot = /* @__PURE__ */ new O(be, he), ct = /* @__PURE__ */ new O(/* @__PURE__ */ new v([be, pe], "anyOf"), he);
|
|
655
|
+
function at(e, t, n, r, o) {
|
|
656
|
+
for (let i = 0; i < e.length; i++) {
|
|
657
|
+
const s = e[i];
|
|
658
|
+
if (s._tag === "FilterGroup")
|
|
659
|
+
at(s.checks, t, n, r, o);
|
|
660
|
+
else {
|
|
661
|
+
const c = s.run(t, r, o);
|
|
662
|
+
if (c && (n.push(new Ie(t, s, c)), s.aborted || o?.errors !== "all"))
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
const Rt = "~effect/Schema/Class", Bt = "~structural";
|
|
4
668
|
export {
|
|
5
|
-
|
|
669
|
+
ge as Arrays,
|
|
670
|
+
S as Base,
|
|
671
|
+
ze as Boolean,
|
|
672
|
+
Rt as ClassTypeId,
|
|
673
|
+
ne as Context,
|
|
674
|
+
We as FINITE_PATTERN,
|
|
675
|
+
q as Filter,
|
|
676
|
+
D as FilterGroup,
|
|
677
|
+
O as Link,
|
|
678
|
+
B as Literal,
|
|
679
|
+
Le as Null,
|
|
680
|
+
Ve as Number,
|
|
681
|
+
Bt as STRUCTURAL_ANNOTATION_KEY,
|
|
682
|
+
De as String,
|
|
683
|
+
Be as Undefined,
|
|
684
|
+
v as Union,
|
|
685
|
+
qe as Unknown,
|
|
686
|
+
Pt as annotate,
|
|
687
|
+
Mt as annotateKey,
|
|
688
|
+
nt as appendChecks,
|
|
689
|
+
Ct as boolean,
|
|
690
|
+
at as collectIssues,
|
|
691
|
+
ye as collectSentinels,
|
|
692
|
+
Lt as decodeTo,
|
|
693
|
+
$t as defaultParseOptions,
|
|
694
|
+
E as flip,
|
|
695
|
+
Ye as getAST,
|
|
696
|
+
Qe as getCandidates,
|
|
697
|
+
Et as isArrays,
|
|
698
|
+
At as isBoolean,
|
|
699
|
+
kt as isDeclaration,
|
|
700
|
+
K as isLiteral,
|
|
701
|
+
Pe as isNever,
|
|
702
|
+
Ot as isNull,
|
|
703
|
+
_t as isNumber,
|
|
704
|
+
vt as isObjects,
|
|
705
|
+
A as isOptional,
|
|
706
|
+
et as isPattern,
|
|
707
|
+
Nt as isString,
|
|
708
|
+
it as isStringFinite,
|
|
709
|
+
Tt as isUndefined,
|
|
710
|
+
Ft as isUnion,
|
|
711
|
+
Me as isUniqueSymbol,
|
|
712
|
+
Ze as makeFilter,
|
|
713
|
+
Y as mapOrSame,
|
|
714
|
+
Re as null,
|
|
715
|
+
Ge as number,
|
|
716
|
+
we as replaceChecks,
|
|
717
|
+
tt as replaceContext,
|
|
718
|
+
x as replaceEncoding,
|
|
719
|
+
Je as string,
|
|
720
|
+
ee as toEncoded,
|
|
721
|
+
H as toType,
|
|
722
|
+
jt as undefined,
|
|
723
|
+
It as union,
|
|
724
|
+
Ut as unknown
|
|
6
725
|
};
|