obi-sdk 0.1.6 → 0.1.8
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/README.md +33 -232
- package/dist/{index-e52b38be.js → index-d9a81606.js} +792 -750
- package/dist/modular/index.js +109 -51
- package/dist/modular/index.js.map +1 -1
- package/dist/obi-sdk.es.js +1 -1
- package/dist/obi-sdk.standalone.iife.js +2 -2
- package/dist/obi-sdk.standalone.iife.js.map +1 -1
- package/dist/obi-sdk.umd.js +40 -40
- package/dist/{session-33b71dff.js → session-c2549ff3.js} +1 -1
- package/index.d.ts +10 -5
- package/package.json +2 -2
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { css as
|
|
1
|
+
import { css as ie, LitElement as re, html as E, svg as ut, nothing as ss } from "lit";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
const
|
|
8
|
-
let
|
|
7
|
+
const gt = globalThis, Gt = gt.ShadowRoot && (gt.ShadyCSS === void 0 || gt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, bs = Symbol(), is = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
let Ws = class {
|
|
9
9
|
constructor(e, t, i) {
|
|
10
|
-
if (this._$cssResult$ = !0, i !==
|
|
10
|
+
if (this._$cssResult$ = !0, i !== bs)
|
|
11
11
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
12
12
|
this.cssText = e, this.t = t;
|
|
13
13
|
}
|
|
14
14
|
get styleSheet() {
|
|
15
15
|
let e = this.o;
|
|
16
16
|
const t = this.t;
|
|
17
|
-
if (
|
|
17
|
+
if (Gt && e === void 0) {
|
|
18
18
|
const i = t !== void 0 && t.length === 1;
|
|
19
|
-
i && (e =
|
|
19
|
+
i && (e = is.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && is.set(t, e));
|
|
20
20
|
}
|
|
21
21
|
return e;
|
|
22
22
|
}
|
|
@@ -24,29 +24,29 @@ let zs = class {
|
|
|
24
24
|
return this.cssText;
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
27
|
+
const Fs = (s) => new Ws(typeof s == "string" ? s : s + "", void 0, bs), Hs = (s, e) => {
|
|
28
|
+
if (Gt)
|
|
29
29
|
s.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
30
30
|
else
|
|
31
31
|
for (const t of e) {
|
|
32
|
-
const i = document.createElement("style"), r =
|
|
32
|
+
const i = document.createElement("style"), r = gt.litNonce;
|
|
33
33
|
r !== void 0 && i.setAttribute("nonce", r), i.textContent = t.cssText, s.appendChild(i);
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, rs = Gt ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((e) => {
|
|
36
36
|
let t = "";
|
|
37
37
|
for (const i of e.cssRules)
|
|
38
38
|
t += i.cssText;
|
|
39
|
-
return
|
|
39
|
+
return Fs(t);
|
|
40
40
|
})(s) : s;
|
|
41
41
|
/**
|
|
42
42
|
* @license
|
|
43
43
|
* Copyright 2017 Google LLC
|
|
44
44
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
45
|
*/
|
|
46
|
-
const { is:
|
|
46
|
+
const { is: Ks, defineProperty: qs, getOwnPropertyDescriptor: Gs, getOwnPropertyNames: Ys, getOwnPropertySymbols: Js, getPrototypeOf: Xs } = Object, fe = globalThis, ns = fe.trustedTypes, Qs = ns ? ns.emptyScript : "", Zt = fe.reactiveElementPolyfillSupport, We = (s, e) => s, yt = { toAttribute(s, e) {
|
|
47
47
|
switch (e) {
|
|
48
48
|
case Boolean:
|
|
49
|
-
s = s ?
|
|
49
|
+
s = s ? Qs : null;
|
|
50
50
|
break;
|
|
51
51
|
case Object:
|
|
52
52
|
case Array:
|
|
@@ -71,8 +71,8 @@ const { is: Fs, defineProperty: Hs, getOwnPropertyDescriptor: Ws, getOwnProperty
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
return t;
|
|
74
|
-
} },
|
|
75
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
74
|
+
} }, Yt = (s, e) => !Ks(s, e), as = { attribute: !0, type: String, converter: yt, reflect: !1, useDefault: !1, hasChanged: Yt };
|
|
75
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), fe.litPropertyMetadata ?? (fe.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
76
76
|
let Ue = class extends HTMLElement {
|
|
77
77
|
static addInitializer(e) {
|
|
78
78
|
this._$Ei(), (this.l ?? (this.l = [])).push(e);
|
|
@@ -80,14 +80,14 @@ let Ue = class extends HTMLElement {
|
|
|
80
80
|
static get observedAttributes() {
|
|
81
81
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
82
82
|
}
|
|
83
|
-
static createProperty(e, t =
|
|
83
|
+
static createProperty(e, t = as) {
|
|
84
84
|
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
85
85
|
const i = Symbol(), r = this.getPropertyDescriptor(e, i, t);
|
|
86
|
-
r !== void 0 &&
|
|
86
|
+
r !== void 0 && qs(this.prototype, e, r);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
static getPropertyDescriptor(e, t, i) {
|
|
90
|
-
const { get: r, set: n } =
|
|
90
|
+
const { get: r, set: n } = Gs(this.prototype, e) ?? { get() {
|
|
91
91
|
return this[t];
|
|
92
92
|
}, set(a) {
|
|
93
93
|
this[t] = a;
|
|
@@ -98,19 +98,19 @@ let Ue = class extends HTMLElement {
|
|
|
98
98
|
}, configurable: !0, enumerable: !0 };
|
|
99
99
|
}
|
|
100
100
|
static getPropertyOptions(e) {
|
|
101
|
-
return this.elementProperties.get(e) ??
|
|
101
|
+
return this.elementProperties.get(e) ?? as;
|
|
102
102
|
}
|
|
103
103
|
static _$Ei() {
|
|
104
|
-
if (this.hasOwnProperty(
|
|
104
|
+
if (this.hasOwnProperty(We("elementProperties")))
|
|
105
105
|
return;
|
|
106
|
-
const e =
|
|
106
|
+
const e = Xs(this);
|
|
107
107
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
108
108
|
}
|
|
109
109
|
static finalize() {
|
|
110
|
-
if (this.hasOwnProperty(
|
|
110
|
+
if (this.hasOwnProperty(We("finalized")))
|
|
111
111
|
return;
|
|
112
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
113
|
-
const t = this.properties, i = [...
|
|
112
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(We("properties"))) {
|
|
113
|
+
const t = this.properties, i = [...Ys(t), ...Js(t)];
|
|
114
114
|
for (const r of i)
|
|
115
115
|
this.createProperty(r, t[r]);
|
|
116
116
|
}
|
|
@@ -133,9 +133,9 @@ let Ue = class extends HTMLElement {
|
|
|
133
133
|
if (Array.isArray(e)) {
|
|
134
134
|
const i = new Set(e.flat(1 / 0).reverse());
|
|
135
135
|
for (const r of i)
|
|
136
|
-
t.unshift(
|
|
136
|
+
t.unshift(rs(r));
|
|
137
137
|
} else
|
|
138
|
-
e !== void 0 && t.push(
|
|
138
|
+
e !== void 0 && t.push(rs(e));
|
|
139
139
|
return t;
|
|
140
140
|
}
|
|
141
141
|
static _$Eu(e, t) {
|
|
@@ -165,7 +165,7 @@ let Ue = class extends HTMLElement {
|
|
|
165
165
|
}
|
|
166
166
|
createRenderRoot() {
|
|
167
167
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
168
|
-
return
|
|
168
|
+
return Hs(e, this.constructor.elementStyles), e;
|
|
169
169
|
}
|
|
170
170
|
connectedCallback() {
|
|
171
171
|
var e;
|
|
@@ -190,7 +190,7 @@ let Ue = class extends HTMLElement {
|
|
|
190
190
|
var n;
|
|
191
191
|
const i = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, i);
|
|
192
192
|
if (r !== void 0 && i.reflect === !0) {
|
|
193
|
-
const a = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter :
|
|
193
|
+
const a = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter : yt).toAttribute(t, i.type);
|
|
194
194
|
this._$Em = e, a == null ? this.removeAttribute(r) : this.setAttribute(r, a), this._$Em = null;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
@@ -198,7 +198,7 @@ let Ue = class extends HTMLElement {
|
|
|
198
198
|
var n, a;
|
|
199
199
|
const i = this.constructor, r = i._$Eh.get(e);
|
|
200
200
|
if (r !== void 0 && this._$Em !== r) {
|
|
201
|
-
const o = i.getPropertyOptions(r), c = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter :
|
|
201
|
+
const o = i.getPropertyOptions(r), c = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : yt;
|
|
202
202
|
this._$Em = r, this[r] = c.fromAttribute(t, o.type) ?? ((a = this._$Ej) == null ? void 0 : a.get(r)) ?? null, this._$Em = null;
|
|
203
203
|
}
|
|
204
204
|
}
|
|
@@ -206,7 +206,7 @@ let Ue = class extends HTMLElement {
|
|
|
206
206
|
var r;
|
|
207
207
|
if (e !== void 0) {
|
|
208
208
|
const n = this.constructor, a = this[e];
|
|
209
|
-
if (i ?? (i = n.getPropertyOptions(e)), !((i.hasChanged ??
|
|
209
|
+
if (i ?? (i = n.getPropertyOptions(e)), !((i.hasChanged ?? Yt)(a, t) || i.useDefault && i.reflect && a === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(n._$Eu(e, i))))
|
|
210
210
|
return;
|
|
211
211
|
this.C(e, t, i);
|
|
212
212
|
}
|
|
@@ -286,13 +286,13 @@ let Ue = class extends HTMLElement {
|
|
|
286
286
|
firstUpdated(e) {
|
|
287
287
|
}
|
|
288
288
|
};
|
|
289
|
-
Ue.elementStyles = [], Ue.shadowRootOptions = { mode: "open" }, Ue[
|
|
289
|
+
Ue.elementStyles = [], Ue.shadowRootOptions = { mode: "open" }, Ue[We("elementProperties")] = /* @__PURE__ */ new Map(), Ue[We("finalized")] = /* @__PURE__ */ new Map(), Zt == null || Zt({ ReactiveElement: Ue }), (fe.reactiveElementVersions ?? (fe.reactiveElementVersions = [])).push("2.1.0");
|
|
290
290
|
/**
|
|
291
291
|
* @license
|
|
292
292
|
* Copyright 2017 Google LLC
|
|
293
293
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
294
294
|
*/
|
|
295
|
-
const
|
|
295
|
+
const ei = { attribute: !0, type: String, converter: yt, reflect: !1, hasChanged: Yt }, ti = (s = ei, e, t) => {
|
|
296
296
|
const { kind: i, metadata: r } = t;
|
|
297
297
|
let n = globalThis.litPropertyMetadata.get(r);
|
|
298
298
|
if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), n.set(t.name, s), i === "accessor") {
|
|
@@ -314,7 +314,7 @@ const Js = { attribute: !0, type: String, converter: gt, reflect: !1, hasChanged
|
|
|
314
314
|
throw Error("Unsupported decorator location: " + i);
|
|
315
315
|
};
|
|
316
316
|
function x(s) {
|
|
317
|
-
return (e, t) => typeof t == "object" ?
|
|
317
|
+
return (e, t) => typeof t == "object" ? ti(s, e, t) : ((i, r, n) => {
|
|
318
318
|
const a = r.hasOwnProperty(n);
|
|
319
319
|
return r.constructor.createProperty(n, i), a ? Object.getOwnPropertyDescriptor(r, n) : void 0;
|
|
320
320
|
})(s, e, t);
|
|
@@ -324,16 +324,16 @@ function x(s) {
|
|
|
324
324
|
* Copyright 2017 Google LLC
|
|
325
325
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
326
326
|
*/
|
|
327
|
-
function
|
|
327
|
+
function _e(s) {
|
|
328
328
|
return x({ ...s, state: !0, attribute: !1 });
|
|
329
329
|
}
|
|
330
|
-
const j = Symbol.for("@ts-pattern/matcher"),
|
|
331
|
-
if (
|
|
330
|
+
const j = Symbol.for("@ts-pattern/matcher"), ws = Symbol.for("@ts-pattern/isVariadic"), _t = "@ts-pattern/anonymous-select-key", zt = (s) => !!(s && typeof s == "object"), vt = (s) => s && !!s[j], I = (s, e, t) => {
|
|
331
|
+
if (vt(s)) {
|
|
332
332
|
const i = s[j](), { matched: r, selections: n } = i.match(e);
|
|
333
333
|
return r && n && Object.keys(n).forEach((a) => t(a, n[a])), r;
|
|
334
334
|
}
|
|
335
|
-
if (
|
|
336
|
-
if (!
|
|
335
|
+
if (zt(s)) {
|
|
336
|
+
if (!zt(e))
|
|
337
337
|
return !1;
|
|
338
338
|
if (Array.isArray(s)) {
|
|
339
339
|
if (!Array.isArray(e))
|
|
@@ -341,7 +341,7 @@ const j = Symbol.for("@ts-pattern/matcher"), ys = Symbol.for("@ts-pattern/isVari
|
|
|
341
341
|
let i = [], r = [], n = [];
|
|
342
342
|
for (const a of s.keys()) {
|
|
343
343
|
const o = s[a];
|
|
344
|
-
|
|
344
|
+
vt(o) && o[ws] ? n.push(o) : n.length ? r.push(o) : i.push(o);
|
|
345
345
|
}
|
|
346
346
|
if (n.length) {
|
|
347
347
|
if (n.length > 1)
|
|
@@ -355,16 +355,16 @@ const j = Symbol.for("@ts-pattern/matcher"), ys = Symbol.for("@ts-pattern/isVari
|
|
|
355
355
|
}
|
|
356
356
|
return Reflect.ownKeys(s).every((i) => {
|
|
357
357
|
const r = s[i];
|
|
358
|
-
return (i in e ||
|
|
358
|
+
return (i in e || vt(n = r) && n[j]().matcherType === "optional") && I(r, e[i], t);
|
|
359
359
|
var n;
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
362
|
return Object.is(e, s);
|
|
363
|
-
},
|
|
363
|
+
}, L = (s) => {
|
|
364
364
|
var e, t, i;
|
|
365
|
-
return
|
|
366
|
-
},
|
|
367
|
-
function
|
|
365
|
+
return zt(s) ? vt(s) ? (e = (t = (i = s[j]()).getSelectionKeys) == null ? void 0 : t.call(i)) != null ? e : [] : Array.isArray(s) ? Ke(s, L) : Ke(Object.values(s), L) : [];
|
|
366
|
+
}, Ke = (s, e) => s.reduce((t, i) => t.concat(e(i)), []);
|
|
367
|
+
function si(...s) {
|
|
368
368
|
if (s.length === 1) {
|
|
369
369
|
const [e] = s;
|
|
370
370
|
return (t) => I(e, t, () => {
|
|
@@ -378,33 +378,33 @@ function Qs(...s) {
|
|
|
378
378
|
throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${s.length}.`);
|
|
379
379
|
}
|
|
380
380
|
function P(s) {
|
|
381
|
-
return Object.assign(s, { optional: () =>
|
|
381
|
+
return Object.assign(s, { optional: () => Jt(s), and: (e) => S(s, e), or: (e) => xs(s, e), select: (e) => e === void 0 ? qe(s) : qe(e, s) });
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function Vt(s) {
|
|
384
384
|
return Object.assign(((e) => Object.assign(e, { [Symbol.iterator]() {
|
|
385
385
|
let t = 0;
|
|
386
|
-
const i = [{ value: Object.assign(e, { [
|
|
386
|
+
const i = [{ value: Object.assign(e, { [ws]: !0 }), done: !1 }, { done: !0, value: void 0 }];
|
|
387
387
|
return { next: () => {
|
|
388
388
|
var r;
|
|
389
389
|
return (r = i[t++]) != null ? r : i.at(-1);
|
|
390
390
|
} };
|
|
391
|
-
} }))(s), { optional: () =>
|
|
391
|
+
} }))(s), { optional: () => Vt(Jt(s)), select: (e) => Vt(e === void 0 ? qe(s) : qe(e, s)) });
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function Jt(s) {
|
|
394
394
|
return P({ [j]: () => ({ match: (e) => {
|
|
395
395
|
let t = {};
|
|
396
396
|
const i = (r, n) => {
|
|
397
397
|
t[r] = n;
|
|
398
398
|
};
|
|
399
|
-
return e === void 0 ? (
|
|
400
|
-
}, getSelectionKeys: () =>
|
|
399
|
+
return e === void 0 ? (L(s).forEach((r) => i(r, void 0)), { matched: !0, selections: t }) : { matched: I(s, e, i), selections: t };
|
|
400
|
+
}, getSelectionKeys: () => L(s), matcherType: "optional" }) });
|
|
401
401
|
}
|
|
402
|
-
const
|
|
402
|
+
const ii = (s, e) => {
|
|
403
403
|
for (const t of s)
|
|
404
404
|
if (!e(t))
|
|
405
405
|
return !1;
|
|
406
406
|
return !0;
|
|
407
|
-
},
|
|
407
|
+
}, ri = (s, e) => {
|
|
408
408
|
for (const [t, i] of s.entries())
|
|
409
409
|
if (!e(i, t))
|
|
410
410
|
return !1;
|
|
@@ -417,63 +417,63 @@ function S(...s) {
|
|
|
417
417
|
t[r] = n;
|
|
418
418
|
};
|
|
419
419
|
return { matched: s.every((r) => I(r, e, i)), selections: t };
|
|
420
|
-
}, getSelectionKeys: () =>
|
|
420
|
+
}, getSelectionKeys: () => Ke(s, L), matcherType: "and" }) });
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function xs(...s) {
|
|
423
423
|
return P({ [j]: () => ({ match: (e) => {
|
|
424
424
|
let t = {};
|
|
425
425
|
const i = (r, n) => {
|
|
426
426
|
t[r] = n;
|
|
427
427
|
};
|
|
428
|
-
return
|
|
429
|
-
}, getSelectionKeys: () =>
|
|
428
|
+
return Ke(s, L).forEach((r) => i(r, void 0)), { matched: s.some((r) => I(r, e, i)), selections: t };
|
|
429
|
+
}, getSelectionKeys: () => Ke(s, L), matcherType: "or" }) });
|
|
430
430
|
}
|
|
431
431
|
function b(s) {
|
|
432
432
|
return { [j]: () => ({ match: (e) => ({ matched: !!s(e) }) }) };
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function qe(...s) {
|
|
435
435
|
const e = typeof s[0] == "string" ? s[0] : void 0, t = s.length === 2 ? s[1] : typeof s[0] == "string" ? void 0 : s[0];
|
|
436
436
|
return P({ [j]: () => ({ match: (i) => {
|
|
437
|
-
let r = { [e ??
|
|
437
|
+
let r = { [e ?? _t]: i };
|
|
438
438
|
return { matched: t === void 0 || I(t, i, (n, a) => {
|
|
439
439
|
r[n] = a;
|
|
440
440
|
}), selections: r };
|
|
441
|
-
}, getSelectionKeys: () => [e ??
|
|
441
|
+
}, getSelectionKeys: () => [e ?? _t].concat(t === void 0 ? [] : L(t)) }) });
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function K(s) {
|
|
444
444
|
return typeof s == "number";
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function ce(s) {
|
|
447
447
|
return typeof s == "string";
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function de(s) {
|
|
450
450
|
return typeof s == "bigint";
|
|
451
451
|
}
|
|
452
|
-
const
|
|
452
|
+
const $s = P(b(function(s) {
|
|
453
453
|
return !0;
|
|
454
|
-
})),
|
|
455
|
-
return
|
|
454
|
+
})), ni = $s, le = (s) => Object.assign(P(s), { startsWith: (e) => {
|
|
455
|
+
return le(S(s, (t = e, b((i) => ce(i) && i.startsWith(t)))));
|
|
456
456
|
var t;
|
|
457
457
|
}, endsWith: (e) => {
|
|
458
|
-
return
|
|
458
|
+
return le(S(s, (t = e, b((i) => ce(i) && i.endsWith(t)))));
|
|
459
459
|
var t;
|
|
460
|
-
}, minLength: (e) =>
|
|
461
|
-
return
|
|
460
|
+
}, minLength: (e) => le(S(s, ((t) => b((i) => ce(i) && i.length >= t))(e))), length: (e) => le(S(s, ((t) => b((i) => ce(i) && i.length === t))(e))), maxLength: (e) => le(S(s, ((t) => b((i) => ce(i) && i.length <= t))(e))), includes: (e) => {
|
|
461
|
+
return le(S(s, (t = e, b((i) => ce(i) && i.includes(t)))));
|
|
462
462
|
var t;
|
|
463
463
|
}, regex: (e) => {
|
|
464
|
-
return
|
|
464
|
+
return le(S(s, (t = e, b((i) => ce(i) && !!i.match(t)))));
|
|
465
465
|
var t;
|
|
466
|
-
} }),
|
|
466
|
+
} }), ai = le(b(ce)), q = (s) => Object.assign(P(s), { between: (e, t) => q(S(s, ((i, r) => b((n) => K(n) && i <= n && r >= n))(e, t))), lt: (e) => q(S(s, ((t) => b((i) => K(i) && i < t))(e))), gt: (e) => q(S(s, ((t) => b((i) => K(i) && i > t))(e))), lte: (e) => q(S(s, ((t) => b((i) => K(i) && i <= t))(e))), gte: (e) => q(S(s, ((t) => b((i) => K(i) && i >= t))(e))), int: () => q(S(s, b((e) => K(e) && Number.isInteger(e)))), finite: () => q(S(s, b((e) => K(e) && Number.isFinite(e)))), positive: () => q(S(s, b((e) => K(e) && e > 0))), negative: () => q(S(s, b((e) => K(e) && e < 0))) }), oi = q(b(K)), ue = (s) => Object.assign(P(s), { between: (e, t) => ue(S(s, ((i, r) => b((n) => de(n) && i <= n && r >= n))(e, t))), lt: (e) => ue(S(s, ((t) => b((i) => de(i) && i < t))(e))), gt: (e) => ue(S(s, ((t) => b((i) => de(i) && i > t))(e))), lte: (e) => ue(S(s, ((t) => b((i) => de(i) && i <= t))(e))), gte: (e) => ue(S(s, ((t) => b((i) => de(i) && i >= t))(e))), positive: () => ue(S(s, b((e) => de(e) && e > 0))), negative: () => ue(S(s, b((e) => de(e) && e < 0))) }), ci = ue(b(de)), di = P(b(function(s) {
|
|
467
467
|
return typeof s == "boolean";
|
|
468
|
-
})),
|
|
468
|
+
})), li = P(b(function(s) {
|
|
469
469
|
return typeof s == "symbol";
|
|
470
|
-
})),
|
|
470
|
+
})), ui = P(b(function(s) {
|
|
471
471
|
return s == null;
|
|
472
|
-
})),
|
|
472
|
+
})), hi = P(b(function(s) {
|
|
473
473
|
return s != null;
|
|
474
474
|
}));
|
|
475
|
-
var
|
|
476
|
-
return
|
|
475
|
+
var pi = { __proto__: null, matcher: j, optional: Jt, array: function(...s) {
|
|
476
|
+
return Vt({ [j]: () => ({ match: (e) => {
|
|
477
477
|
if (!Array.isArray(e))
|
|
478
478
|
return { matched: !1 };
|
|
479
479
|
if (s.length === 0)
|
|
@@ -481,14 +481,14 @@ var li = { __proto__: null, matcher: j, optional: qt, array: function(...s) {
|
|
|
481
481
|
const t = s[0];
|
|
482
482
|
let i = {};
|
|
483
483
|
if (e.length === 0)
|
|
484
|
-
return
|
|
484
|
+
return L(t).forEach((n) => {
|
|
485
485
|
i[n] = [];
|
|
486
486
|
}), { matched: !0, selections: i };
|
|
487
487
|
const r = (n, a) => {
|
|
488
488
|
i[n] = (i[n] || []).concat([a]);
|
|
489
489
|
};
|
|
490
490
|
return { matched: e.every((n) => I(t, n, r)), selections: i };
|
|
491
|
-
}, getSelectionKeys: () => s.length === 0 ? [] :
|
|
491
|
+
}, getSelectionKeys: () => s.length === 0 ? [] : L(s[0]) }) });
|
|
492
492
|
}, set: function(...s) {
|
|
493
493
|
return P({ [j]: () => ({ match: (e) => {
|
|
494
494
|
if (!(e instanceof Set))
|
|
@@ -501,8 +501,8 @@ var li = { __proto__: null, matcher: j, optional: qt, array: function(...s) {
|
|
|
501
501
|
const i = (n, a) => {
|
|
502
502
|
t[n] = (t[n] || []).concat([a]);
|
|
503
503
|
}, r = s[0];
|
|
504
|
-
return { matched:
|
|
505
|
-
}, getSelectionKeys: () => s.length === 0 ? [] :
|
|
504
|
+
return { matched: ii(e, (n) => I(r, n, i)), selections: t };
|
|
505
|
+
}, getSelectionKeys: () => s.length === 0 ? [] : L(s[0]) }) });
|
|
506
506
|
}, map: function(...s) {
|
|
507
507
|
return P({ [j]: () => ({ match: (e) => {
|
|
508
508
|
if (!(e instanceof Map))
|
|
@@ -519,22 +519,22 @@ var li = { __proto__: null, matcher: j, optional: qt, array: function(...s) {
|
|
|
519
519
|
if (s.length === 1)
|
|
520
520
|
throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(r = s[0]) == null ? void 0 : r.toString()}`);
|
|
521
521
|
const [n, a] = s;
|
|
522
|
-
return { matched:
|
|
522
|
+
return { matched: ri(e, (o, c) => {
|
|
523
523
|
const d = I(n, c, i), u = I(a, o, i);
|
|
524
524
|
return d && u;
|
|
525
525
|
}), selections: t };
|
|
526
|
-
}, getSelectionKeys: () => s.length === 0 ? [] : [...
|
|
527
|
-
}, intersection: S, union:
|
|
526
|
+
}, getSelectionKeys: () => s.length === 0 ? [] : [...L(s[0]), ...L(s[1])] }) });
|
|
527
|
+
}, intersection: S, union: xs, not: function(s) {
|
|
528
528
|
return P({ [j]: () => ({ match: (e) => ({ matched: !I(s, e, () => {
|
|
529
529
|
}) }), getSelectionKeys: () => [], matcherType: "not" }) });
|
|
530
|
-
}, when: b, select:
|
|
530
|
+
}, when: b, select: qe, any: $s, _: ni, string: ai, number: oi, bigint: ci, boolean: di, symbol: li, nullish: ui, nonNullable: hi, instanceOf: function(s) {
|
|
531
531
|
return P(b(function(e) {
|
|
532
532
|
return (t) => t instanceof e;
|
|
533
533
|
}(s)));
|
|
534
534
|
}, shape: function(s) {
|
|
535
|
-
return P(b(
|
|
535
|
+
return P(b(si(s)));
|
|
536
536
|
} };
|
|
537
|
-
class
|
|
537
|
+
class fi extends Error {
|
|
538
538
|
constructor(e) {
|
|
539
539
|
let t;
|
|
540
540
|
try {
|
|
@@ -545,11 +545,11 @@ class ui extends Error {
|
|
|
545
545
|
super(`Pattern matching error: no pattern matches value ${t}`), this.input = void 0, this.input = e;
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
const
|
|
549
|
-
function
|
|
550
|
-
return new
|
|
548
|
+
const Bt = { matched: !1, value: void 0 };
|
|
549
|
+
function os(s) {
|
|
550
|
+
return new mi(s, Bt);
|
|
551
551
|
}
|
|
552
|
-
let
|
|
552
|
+
let mi = class Wt {
|
|
553
553
|
constructor(e, t) {
|
|
554
554
|
this.input = void 0, this.state = void 0, this.input = e, this.state = t;
|
|
555
555
|
}
|
|
@@ -562,19 +562,19 @@ let hi = class Vt {
|
|
|
562
562
|
let n = !1, a = {};
|
|
563
563
|
const o = (d, u) => {
|
|
564
564
|
n = !0, a[d] = u;
|
|
565
|
-
}, c = !i.some((d) => I(d, this.input, o)) || r && !r(this.input) ?
|
|
566
|
-
return new
|
|
565
|
+
}, c = !i.some((d) => I(d, this.input, o)) || r && !r(this.input) ? Bt : { matched: !0, value: t(n ? _t in a ? a[_t] : a : this.input, this.input) };
|
|
566
|
+
return new Wt(this.input, c);
|
|
567
567
|
}
|
|
568
568
|
when(e, t) {
|
|
569
569
|
if (this.state.matched)
|
|
570
570
|
return this;
|
|
571
571
|
const i = !!e(this.input);
|
|
572
|
-
return new
|
|
572
|
+
return new Wt(this.input, i ? { matched: !0, value: t(this.input, this.input) } : Bt);
|
|
573
573
|
}
|
|
574
574
|
otherwise(e) {
|
|
575
575
|
return this.state.matched ? this.state.value : e(this.input);
|
|
576
576
|
}
|
|
577
|
-
exhaustive(e =
|
|
577
|
+
exhaustive(e = gi) {
|
|
578
578
|
return this.state.matched ? this.state.value : e(this.input);
|
|
579
579
|
}
|
|
580
580
|
run() {
|
|
@@ -584,8 +584,8 @@ let hi = class Vt {
|
|
|
584
584
|
return this;
|
|
585
585
|
}
|
|
586
586
|
};
|
|
587
|
-
function
|
|
588
|
-
throw new
|
|
587
|
+
function gi(s) {
|
|
588
|
+
throw new fi(s);
|
|
589
589
|
}
|
|
590
590
|
var w;
|
|
591
591
|
(function(s) {
|
|
@@ -623,14 +623,14 @@ var w;
|
|
|
623
623
|
}
|
|
624
624
|
s.joinValues = i, s.jsonStringifyReplacer = (r, n) => typeof n == "bigint" ? n.toString() : n;
|
|
625
625
|
})(w || (w = {}));
|
|
626
|
-
var
|
|
626
|
+
var Ft;
|
|
627
627
|
(function(s) {
|
|
628
628
|
s.mergeShapes = (e, t) => ({
|
|
629
629
|
...e,
|
|
630
630
|
...t
|
|
631
631
|
// second overwrites first
|
|
632
632
|
});
|
|
633
|
-
})(
|
|
633
|
+
})(Ft || (Ft = {}));
|
|
634
634
|
const p = w.arrayToEnum([
|
|
635
635
|
"string",
|
|
636
636
|
"nan",
|
|
@@ -652,7 +652,7 @@ const p = w.arrayToEnum([
|
|
|
652
652
|
"never",
|
|
653
653
|
"map",
|
|
654
654
|
"set"
|
|
655
|
-
]),
|
|
655
|
+
]), te = (s) => {
|
|
656
656
|
switch (typeof s) {
|
|
657
657
|
case "undefined":
|
|
658
658
|
return p.undefined;
|
|
@@ -690,8 +690,8 @@ const p = w.arrayToEnum([
|
|
|
690
690
|
"invalid_intersection_types",
|
|
691
691
|
"not_multiple_of",
|
|
692
692
|
"not_finite"
|
|
693
|
-
]),
|
|
694
|
-
class
|
|
693
|
+
]), vi = (s) => JSON.stringify(s, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
694
|
+
class U extends Error {
|
|
695
695
|
get errors() {
|
|
696
696
|
return this.issues;
|
|
697
697
|
}
|
|
@@ -728,7 +728,7 @@ class L extends Error {
|
|
|
728
728
|
return r(this), i;
|
|
729
729
|
}
|
|
730
730
|
static assert(e) {
|
|
731
|
-
if (!(e instanceof
|
|
731
|
+
if (!(e instanceof U))
|
|
732
732
|
throw new Error(`Not a ZodError: ${e}`);
|
|
733
733
|
}
|
|
734
734
|
toString() {
|
|
@@ -750,8 +750,8 @@ class L extends Error {
|
|
|
750
750
|
return this.flatten();
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
|
-
|
|
754
|
-
const
|
|
753
|
+
U.create = (s) => new U(s);
|
|
754
|
+
const Ie = (s, e) => {
|
|
755
755
|
let t;
|
|
756
756
|
switch (s.code) {
|
|
757
757
|
case l.invalid_type:
|
|
@@ -807,14 +807,14 @@ const Ne = (s, e) => {
|
|
|
807
807
|
}
|
|
808
808
|
return { message: t };
|
|
809
809
|
};
|
|
810
|
-
let
|
|
811
|
-
function
|
|
812
|
-
|
|
810
|
+
let As = Ie;
|
|
811
|
+
function yi(s) {
|
|
812
|
+
As = s;
|
|
813
813
|
}
|
|
814
|
-
function
|
|
815
|
-
return
|
|
814
|
+
function bt() {
|
|
815
|
+
return As;
|
|
816
816
|
}
|
|
817
|
-
const
|
|
817
|
+
const wt = (s) => {
|
|
818
818
|
const { data: e, path: t, errorMaps: i, issueData: r } = s, n = [...t, ...r.path || []], a = {
|
|
819
819
|
...r,
|
|
820
820
|
path: n
|
|
@@ -834,9 +834,9 @@ const _t = (s) => {
|
|
|
834
834
|
path: n,
|
|
835
835
|
message: o
|
|
836
836
|
};
|
|
837
|
-
},
|
|
837
|
+
}, _i = [];
|
|
838
838
|
function h(s, e) {
|
|
839
|
-
const t =
|
|
839
|
+
const t = bt(), i = wt({
|
|
840
840
|
issueData: e,
|
|
841
841
|
data: s.data,
|
|
842
842
|
path: s.path,
|
|
@@ -847,7 +847,7 @@ function h(s, e) {
|
|
|
847
847
|
// then schema-bound map if available
|
|
848
848
|
t,
|
|
849
849
|
// then global override map
|
|
850
|
-
t ===
|
|
850
|
+
t === Ie ? void 0 : Ie
|
|
851
851
|
// then global default map
|
|
852
852
|
].filter((r) => !!r)
|
|
853
853
|
});
|
|
@@ -896,15 +896,15 @@ class M {
|
|
|
896
896
|
}
|
|
897
897
|
const v = Object.freeze({
|
|
898
898
|
status: "aborted"
|
|
899
|
-
}),
|
|
900
|
-
function
|
|
899
|
+
}), Re = (s) => ({ status: "dirty", value: s }), Z = (s) => ({ status: "valid", value: s }), Ht = (s) => s.status === "aborted", Kt = (s) => s.status === "dirty", Ae = (s) => s.status === "valid", Ge = (s) => typeof Promise < "u" && s instanceof Promise;
|
|
900
|
+
function xt(s, e, t, i) {
|
|
901
901
|
if (t === "a" && !i)
|
|
902
902
|
throw new TypeError("Private accessor was defined without a getter");
|
|
903
903
|
if (typeof e == "function" ? s !== e || !i : !e.has(s))
|
|
904
904
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
905
905
|
return t === "m" ? i : t === "a" ? i.call(s) : i ? i.value : e.get(s);
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function Ss(s, e, t, i, r) {
|
|
908
908
|
if (i === "m")
|
|
909
909
|
throw new TypeError("Private method is not writable");
|
|
910
910
|
if (i === "a" && !r)
|
|
@@ -917,8 +917,8 @@ var f;
|
|
|
917
917
|
(function(s) {
|
|
918
918
|
s.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, s.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
919
919
|
})(f || (f = {}));
|
|
920
|
-
var
|
|
921
|
-
class
|
|
920
|
+
var Ve, Be;
|
|
921
|
+
class Y {
|
|
922
922
|
constructor(e, t, i, r) {
|
|
923
923
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = i, this._key = r;
|
|
924
924
|
}
|
|
@@ -926,8 +926,8 @@ class q {
|
|
|
926
926
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
|
-
const
|
|
930
|
-
if (
|
|
929
|
+
const cs = (s, e) => {
|
|
930
|
+
if (Ae(e))
|
|
931
931
|
return { success: !0, data: e.value };
|
|
932
932
|
if (!s.common.issues.length)
|
|
933
933
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -936,7 +936,7 @@ const as = (s, e) => {
|
|
|
936
936
|
get error() {
|
|
937
937
|
if (this._error)
|
|
938
938
|
return this._error;
|
|
939
|
-
const t = new
|
|
939
|
+
const t = new U(s.common.issues);
|
|
940
940
|
return this._error = t, this._error;
|
|
941
941
|
}
|
|
942
942
|
};
|
|
@@ -958,13 +958,13 @@ class _ {
|
|
|
958
958
|
return this._def.description;
|
|
959
959
|
}
|
|
960
960
|
_getType(e) {
|
|
961
|
-
return
|
|
961
|
+
return te(e.data);
|
|
962
962
|
}
|
|
963
963
|
_getOrReturnCtx(e, t) {
|
|
964
964
|
return t || {
|
|
965
965
|
common: e.parent.common,
|
|
966
966
|
data: e.data,
|
|
967
|
-
parsedType:
|
|
967
|
+
parsedType: te(e.data),
|
|
968
968
|
schemaErrorMap: this._def.errorMap,
|
|
969
969
|
path: e.path,
|
|
970
970
|
parent: e.parent
|
|
@@ -976,7 +976,7 @@ class _ {
|
|
|
976
976
|
ctx: {
|
|
977
977
|
common: e.parent.common,
|
|
978
978
|
data: e.data,
|
|
979
|
-
parsedType:
|
|
979
|
+
parsedType: te(e.data),
|
|
980
980
|
schemaErrorMap: this._def.errorMap,
|
|
981
981
|
path: e.path,
|
|
982
982
|
parent: e.parent
|
|
@@ -1011,9 +1011,9 @@ class _ {
|
|
|
1011
1011
|
schemaErrorMap: this._def.errorMap,
|
|
1012
1012
|
parent: null,
|
|
1013
1013
|
data: e,
|
|
1014
|
-
parsedType:
|
|
1014
|
+
parsedType: te(e)
|
|
1015
1015
|
}, n = this._parseSync({ data: e, path: r.path, parent: r });
|
|
1016
|
-
return
|
|
1016
|
+
return cs(r, n);
|
|
1017
1017
|
}
|
|
1018
1018
|
"~validate"(e) {
|
|
1019
1019
|
var t, i;
|
|
@@ -1026,12 +1026,12 @@ class _ {
|
|
|
1026
1026
|
schemaErrorMap: this._def.errorMap,
|
|
1027
1027
|
parent: null,
|
|
1028
1028
|
data: e,
|
|
1029
|
-
parsedType:
|
|
1029
|
+
parsedType: te(e)
|
|
1030
1030
|
};
|
|
1031
1031
|
if (!this["~standard"].async)
|
|
1032
1032
|
try {
|
|
1033
1033
|
const n = this._parseSync({ data: e, path: [], parent: r });
|
|
1034
|
-
return
|
|
1034
|
+
return Ae(n) ? {
|
|
1035
1035
|
value: n.value
|
|
1036
1036
|
} : {
|
|
1037
1037
|
issues: r.common.issues
|
|
@@ -1042,7 +1042,7 @@ class _ {
|
|
|
1042
1042
|
async: !0
|
|
1043
1043
|
};
|
|
1044
1044
|
}
|
|
1045
|
-
return this._parseAsync({ data: e, path: [], parent: r }).then((n) =>
|
|
1045
|
+
return this._parseAsync({ data: e, path: [], parent: r }).then((n) => Ae(n) ? {
|
|
1046
1046
|
value: n.value
|
|
1047
1047
|
} : {
|
|
1048
1048
|
issues: r.common.issues
|
|
@@ -1065,9 +1065,9 @@ class _ {
|
|
|
1065
1065
|
schemaErrorMap: this._def.errorMap,
|
|
1066
1066
|
parent: null,
|
|
1067
1067
|
data: e,
|
|
1068
|
-
parsedType:
|
|
1068
|
+
parsedType: te(e)
|
|
1069
1069
|
}, r = this._parse({ data: e, path: i.path, parent: i }), n = await (Ge(r) ? r : Promise.resolve(r));
|
|
1070
|
-
return
|
|
1070
|
+
return cs(i, n);
|
|
1071
1071
|
}
|
|
1072
1072
|
refine(e, t) {
|
|
1073
1073
|
const i = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -1103,22 +1103,22 @@ class _ {
|
|
|
1103
1103
|
return G.create(this, this._def);
|
|
1104
1104
|
}
|
|
1105
1105
|
nullable() {
|
|
1106
|
-
return
|
|
1106
|
+
return ye.create(this, this._def);
|
|
1107
1107
|
}
|
|
1108
1108
|
nullish() {
|
|
1109
1109
|
return this.nullable().optional();
|
|
1110
1110
|
}
|
|
1111
1111
|
array() {
|
|
1112
|
-
return
|
|
1112
|
+
return W.create(this);
|
|
1113
1113
|
}
|
|
1114
1114
|
promise() {
|
|
1115
|
-
return
|
|
1115
|
+
return Me.create(this, this._def);
|
|
1116
1116
|
}
|
|
1117
1117
|
or(e) {
|
|
1118
|
-
return
|
|
1118
|
+
return Qe.create([this, e], this._def);
|
|
1119
1119
|
}
|
|
1120
1120
|
and(e) {
|
|
1121
|
-
return
|
|
1121
|
+
return et.create(this, e, this._def);
|
|
1122
1122
|
}
|
|
1123
1123
|
transform(e) {
|
|
1124
1124
|
return new F({
|
|
@@ -1130,7 +1130,7 @@ class _ {
|
|
|
1130
1130
|
}
|
|
1131
1131
|
default(e) {
|
|
1132
1132
|
const t = typeof e == "function" ? e : () => e;
|
|
1133
|
-
return new
|
|
1133
|
+
return new nt({
|
|
1134
1134
|
...y(this._def),
|
|
1135
1135
|
innerType: this,
|
|
1136
1136
|
defaultValue: t,
|
|
@@ -1138,7 +1138,7 @@ class _ {
|
|
|
1138
1138
|
});
|
|
1139
1139
|
}
|
|
1140
1140
|
brand() {
|
|
1141
|
-
return new
|
|
1141
|
+
return new Xt({
|
|
1142
1142
|
typeName: g.ZodBranded,
|
|
1143
1143
|
type: this,
|
|
1144
1144
|
...y(this._def)
|
|
@@ -1146,7 +1146,7 @@ class _ {
|
|
|
1146
1146
|
}
|
|
1147
1147
|
catch(e) {
|
|
1148
1148
|
const t = typeof e == "function" ? e : () => e;
|
|
1149
|
-
return new
|
|
1149
|
+
return new at({
|
|
1150
1150
|
...y(this._def),
|
|
1151
1151
|
innerType: this,
|
|
1152
1152
|
catchValue: t,
|
|
@@ -1161,10 +1161,10 @@ class _ {
|
|
|
1161
1161
|
});
|
|
1162
1162
|
}
|
|
1163
1163
|
pipe(e) {
|
|
1164
|
-
return
|
|
1164
|
+
return ht.create(this, e);
|
|
1165
1165
|
}
|
|
1166
1166
|
readonly() {
|
|
1167
|
-
return
|
|
1167
|
+
return ot.create(this);
|
|
1168
1168
|
}
|
|
1169
1169
|
isOptional() {
|
|
1170
1170
|
return this.safeParse(void 0).success;
|
|
@@ -1173,26 +1173,26 @@ class _ {
|
|
|
1173
1173
|
return this.safeParse(null).success;
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
|
-
const
|
|
1177
|
-
let
|
|
1178
|
-
const
|
|
1179
|
-
function
|
|
1176
|
+
const bi = /^c[^\s-]{8,}$/i, wi = /^[0-9a-z]+$/, xi = /^[0-9A-HJKMNP-TV-Z]{26}$/i, $i = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ai = /^[a-z0-9_-]{21}$/i, Si = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ki = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Ei = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ci = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1177
|
+
let jt;
|
|
1178
|
+
const Ti = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Oi = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ri = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Ni = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ii = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Pi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, ks = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Mi = new RegExp(`^${ks}$`);
|
|
1179
|
+
function Es(s) {
|
|
1180
1180
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
1181
1181
|
return s.precision ? e = `${e}\\.\\d{${s.precision}}` : s.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
1182
1182
|
}
|
|
1183
|
-
function
|
|
1184
|
-
return new RegExp(`^${
|
|
1183
|
+
function Zi(s) {
|
|
1184
|
+
return new RegExp(`^${Es(s)}$`);
|
|
1185
1185
|
}
|
|
1186
|
-
function
|
|
1187
|
-
let e = `${
|
|
1186
|
+
function Cs(s) {
|
|
1187
|
+
let e = `${ks}T${Es(s)}`;
|
|
1188
1188
|
const t = [];
|
|
1189
1189
|
return t.push(s.local ? "Z?" : "Z"), s.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1192
|
-
return !!((e === "v4" || !e) &&
|
|
1191
|
+
function ji(s, e) {
|
|
1192
|
+
return !!((e === "v4" || !e) && Ti.test(s) || (e === "v6" || !e) && Ri.test(s));
|
|
1193
1193
|
}
|
|
1194
|
-
function
|
|
1195
|
-
if (!
|
|
1194
|
+
function Di(s, e) {
|
|
1195
|
+
if (!Si.test(s))
|
|
1196
1196
|
return !1;
|
|
1197
1197
|
try {
|
|
1198
1198
|
const [t] = s.split("."), i = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), r = JSON.parse(atob(i));
|
|
@@ -1201,10 +1201,10 @@ function Mi(s, e) {
|
|
|
1201
1201
|
return !1;
|
|
1202
1202
|
}
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1205
|
-
return !!((e === "v4" || !e) &&
|
|
1204
|
+
function Li(s, e) {
|
|
1205
|
+
return !!((e === "v4" || !e) && Oi.test(s) || (e === "v6" || !e) && Ni.test(s));
|
|
1206
1206
|
}
|
|
1207
|
-
class
|
|
1207
|
+
class B extends _ {
|
|
1208
1208
|
_parse(e) {
|
|
1209
1209
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== p.string) {
|
|
1210
1210
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1253,43 +1253,43 @@ class V extends _ {
|
|
|
1253
1253
|
message: n.message
|
|
1254
1254
|
}), i.dirty());
|
|
1255
1255
|
} else if (n.kind === "email")
|
|
1256
|
-
|
|
1256
|
+
Ei.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1257
1257
|
validation: "email",
|
|
1258
1258
|
code: l.invalid_string,
|
|
1259
1259
|
message: n.message
|
|
1260
1260
|
}), i.dirty());
|
|
1261
1261
|
else if (n.kind === "emoji")
|
|
1262
|
-
|
|
1262
|
+
jt || (jt = new RegExp(Ci, "u")), jt.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1263
1263
|
validation: "emoji",
|
|
1264
1264
|
code: l.invalid_string,
|
|
1265
1265
|
message: n.message
|
|
1266
1266
|
}), i.dirty());
|
|
1267
1267
|
else if (n.kind === "uuid")
|
|
1268
|
-
|
|
1268
|
+
$i.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1269
1269
|
validation: "uuid",
|
|
1270
1270
|
code: l.invalid_string,
|
|
1271
1271
|
message: n.message
|
|
1272
1272
|
}), i.dirty());
|
|
1273
1273
|
else if (n.kind === "nanoid")
|
|
1274
|
-
|
|
1274
|
+
Ai.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1275
1275
|
validation: "nanoid",
|
|
1276
1276
|
code: l.invalid_string,
|
|
1277
1277
|
message: n.message
|
|
1278
1278
|
}), i.dirty());
|
|
1279
1279
|
else if (n.kind === "cuid")
|
|
1280
|
-
|
|
1280
|
+
bi.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1281
1281
|
validation: "cuid",
|
|
1282
1282
|
code: l.invalid_string,
|
|
1283
1283
|
message: n.message
|
|
1284
1284
|
}), i.dirty());
|
|
1285
1285
|
else if (n.kind === "cuid2")
|
|
1286
|
-
|
|
1286
|
+
wi.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1287
1287
|
validation: "cuid2",
|
|
1288
1288
|
code: l.invalid_string,
|
|
1289
1289
|
message: n.message
|
|
1290
1290
|
}), i.dirty());
|
|
1291
1291
|
else if (n.kind === "ulid")
|
|
1292
|
-
|
|
1292
|
+
xi.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1293
1293
|
validation: "ulid",
|
|
1294
1294
|
code: l.invalid_string,
|
|
1295
1295
|
message: n.message
|
|
@@ -1321,39 +1321,39 @@ class V extends _ {
|
|
|
1321
1321
|
code: l.invalid_string,
|
|
1322
1322
|
validation: { endsWith: n.value },
|
|
1323
1323
|
message: n.message
|
|
1324
|
-
}), i.dirty()) : n.kind === "datetime" ?
|
|
1324
|
+
}), i.dirty()) : n.kind === "datetime" ? Cs(n).test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1325
1325
|
code: l.invalid_string,
|
|
1326
1326
|
validation: "datetime",
|
|
1327
1327
|
message: n.message
|
|
1328
|
-
}), i.dirty()) : n.kind === "date" ?
|
|
1328
|
+
}), i.dirty()) : n.kind === "date" ? Mi.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1329
1329
|
code: l.invalid_string,
|
|
1330
1330
|
validation: "date",
|
|
1331
1331
|
message: n.message
|
|
1332
|
-
}), i.dirty()) : n.kind === "time" ?
|
|
1332
|
+
}), i.dirty()) : n.kind === "time" ? Zi(n).test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1333
1333
|
code: l.invalid_string,
|
|
1334
1334
|
validation: "time",
|
|
1335
1335
|
message: n.message
|
|
1336
|
-
}), i.dirty()) : n.kind === "duration" ?
|
|
1336
|
+
}), i.dirty()) : n.kind === "duration" ? ki.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1337
1337
|
validation: "duration",
|
|
1338
1338
|
code: l.invalid_string,
|
|
1339
1339
|
message: n.message
|
|
1340
|
-
}), i.dirty()) : n.kind === "ip" ?
|
|
1340
|
+
}), i.dirty()) : n.kind === "ip" ? ji(e.data, n.version) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1341
1341
|
validation: "ip",
|
|
1342
1342
|
code: l.invalid_string,
|
|
1343
1343
|
message: n.message
|
|
1344
|
-
}), i.dirty()) : n.kind === "jwt" ?
|
|
1344
|
+
}), i.dirty()) : n.kind === "jwt" ? Di(e.data, n.alg) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1345
1345
|
validation: "jwt",
|
|
1346
1346
|
code: l.invalid_string,
|
|
1347
1347
|
message: n.message
|
|
1348
|
-
}), i.dirty()) : n.kind === "cidr" ?
|
|
1348
|
+
}), i.dirty()) : n.kind === "cidr" ? Li(e.data, n.version) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1349
1349
|
validation: "cidr",
|
|
1350
1350
|
code: l.invalid_string,
|
|
1351
1351
|
message: n.message
|
|
1352
|
-
}), i.dirty()) : n.kind === "base64" ?
|
|
1352
|
+
}), i.dirty()) : n.kind === "base64" ? Ii.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1353
1353
|
validation: "base64",
|
|
1354
1354
|
code: l.invalid_string,
|
|
1355
1355
|
message: n.message
|
|
1356
|
-
}), i.dirty()) : n.kind === "base64url" ?
|
|
1356
|
+
}), i.dirty()) : n.kind === "base64url" ? Pi.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
|
|
1357
1357
|
validation: "base64url",
|
|
1358
1358
|
code: l.invalid_string,
|
|
1359
1359
|
message: n.message
|
|
@@ -1368,7 +1368,7 @@ class V extends _ {
|
|
|
1368
1368
|
});
|
|
1369
1369
|
}
|
|
1370
1370
|
_addCheck(e) {
|
|
1371
|
-
return new
|
|
1371
|
+
return new B({
|
|
1372
1372
|
...this._def,
|
|
1373
1373
|
checks: [...this._def.checks, e]
|
|
1374
1374
|
});
|
|
@@ -1505,19 +1505,19 @@ class V extends _ {
|
|
|
1505
1505
|
return this.min(1, f.errToObj(e));
|
|
1506
1506
|
}
|
|
1507
1507
|
trim() {
|
|
1508
|
-
return new
|
|
1508
|
+
return new B({
|
|
1509
1509
|
...this._def,
|
|
1510
1510
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
1511
1511
|
});
|
|
1512
1512
|
}
|
|
1513
1513
|
toLowerCase() {
|
|
1514
|
-
return new
|
|
1514
|
+
return new B({
|
|
1515
1515
|
...this._def,
|
|
1516
1516
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1517
1517
|
});
|
|
1518
1518
|
}
|
|
1519
1519
|
toUpperCase() {
|
|
1520
|
-
return new
|
|
1520
|
+
return new B({
|
|
1521
1521
|
...this._def,
|
|
1522
1522
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1523
1523
|
});
|
|
@@ -1583,20 +1583,20 @@ class V extends _ {
|
|
|
1583
1583
|
return e;
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
|
-
|
|
1586
|
+
B.create = (s) => {
|
|
1587
1587
|
var e;
|
|
1588
|
-
return new
|
|
1588
|
+
return new B({
|
|
1589
1589
|
checks: [],
|
|
1590
1590
|
typeName: g.ZodString,
|
|
1591
1591
|
coerce: (e = s == null ? void 0 : s.coerce) !== null && e !== void 0 ? e : !1,
|
|
1592
1592
|
...y(s)
|
|
1593
1593
|
});
|
|
1594
1594
|
};
|
|
1595
|
-
function
|
|
1595
|
+
function Ui(s, e) {
|
|
1596
1596
|
const t = (s.toString().split(".")[1] || "").length, i = (e.toString().split(".")[1] || "").length, r = t > i ? t : i, n = parseInt(s.toFixed(r).replace(".", "")), a = parseInt(e.toFixed(r).replace(".", ""));
|
|
1597
1597
|
return n % a / Math.pow(10, r);
|
|
1598
1598
|
}
|
|
1599
|
-
class
|
|
1599
|
+
class me extends _ {
|
|
1600
1600
|
constructor() {
|
|
1601
1601
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1602
1602
|
}
|
|
@@ -1631,7 +1631,7 @@ class fe extends _ {
|
|
|
1631
1631
|
inclusive: n.inclusive,
|
|
1632
1632
|
exact: !1,
|
|
1633
1633
|
message: n.message
|
|
1634
|
-
}), r.dirty()) : n.kind === "multipleOf" ?
|
|
1634
|
+
}), r.dirty()) : n.kind === "multipleOf" ? Ui(e.data, n.value) !== 0 && (i = this._getOrReturnCtx(e, i), h(i, {
|
|
1635
1635
|
code: l.not_multiple_of,
|
|
1636
1636
|
multipleOf: n.value,
|
|
1637
1637
|
message: n.message
|
|
@@ -1654,7 +1654,7 @@ class fe extends _ {
|
|
|
1654
1654
|
return this.setLimit("max", e, !1, f.toString(t));
|
|
1655
1655
|
}
|
|
1656
1656
|
setLimit(e, t, i, r) {
|
|
1657
|
-
return new
|
|
1657
|
+
return new me({
|
|
1658
1658
|
...this._def,
|
|
1659
1659
|
checks: [
|
|
1660
1660
|
...this._def.checks,
|
|
@@ -1668,7 +1668,7 @@ class fe extends _ {
|
|
|
1668
1668
|
});
|
|
1669
1669
|
}
|
|
1670
1670
|
_addCheck(e) {
|
|
1671
|
-
return new
|
|
1671
|
+
return new me({
|
|
1672
1672
|
...this._def,
|
|
1673
1673
|
checks: [...this._def.checks, e]
|
|
1674
1674
|
});
|
|
@@ -1762,13 +1762,13 @@ class fe extends _ {
|
|
|
1762
1762
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1763
1763
|
}
|
|
1764
1764
|
}
|
|
1765
|
-
|
|
1765
|
+
me.create = (s) => new me({
|
|
1766
1766
|
checks: [],
|
|
1767
1767
|
typeName: g.ZodNumber,
|
|
1768
1768
|
coerce: (s == null ? void 0 : s.coerce) || !1,
|
|
1769
1769
|
...y(s)
|
|
1770
1770
|
});
|
|
1771
|
-
class
|
|
1771
|
+
class ge extends _ {
|
|
1772
1772
|
constructor() {
|
|
1773
1773
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1774
1774
|
}
|
|
@@ -1824,7 +1824,7 @@ class me extends _ {
|
|
|
1824
1824
|
return this.setLimit("max", e, !1, f.toString(t));
|
|
1825
1825
|
}
|
|
1826
1826
|
setLimit(e, t, i, r) {
|
|
1827
|
-
return new
|
|
1827
|
+
return new ge({
|
|
1828
1828
|
...this._def,
|
|
1829
1829
|
checks: [
|
|
1830
1830
|
...this._def.checks,
|
|
@@ -1838,7 +1838,7 @@ class me extends _ {
|
|
|
1838
1838
|
});
|
|
1839
1839
|
}
|
|
1840
1840
|
_addCheck(e) {
|
|
1841
|
-
return new
|
|
1841
|
+
return new ge({
|
|
1842
1842
|
...this._def,
|
|
1843
1843
|
checks: [...this._def.checks, e]
|
|
1844
1844
|
});
|
|
@@ -1895,16 +1895,16 @@ class me extends _ {
|
|
|
1895
1895
|
return e;
|
|
1896
1896
|
}
|
|
1897
1897
|
}
|
|
1898
|
-
|
|
1898
|
+
ge.create = (s) => {
|
|
1899
1899
|
var e;
|
|
1900
|
-
return new
|
|
1900
|
+
return new ge({
|
|
1901
1901
|
checks: [],
|
|
1902
1902
|
typeName: g.ZodBigInt,
|
|
1903
1903
|
coerce: (e = s == null ? void 0 : s.coerce) !== null && e !== void 0 ? e : !1,
|
|
1904
1904
|
...y(s)
|
|
1905
1905
|
});
|
|
1906
1906
|
};
|
|
1907
|
-
class
|
|
1907
|
+
class Ye extends _ {
|
|
1908
1908
|
_parse(e) {
|
|
1909
1909
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== p.boolean) {
|
|
1910
1910
|
const i = this._getOrReturnCtx(e);
|
|
@@ -1917,12 +1917,12 @@ class qe extends _ {
|
|
|
1917
1917
|
return Z(e.data);
|
|
1918
1918
|
}
|
|
1919
1919
|
}
|
|
1920
|
-
|
|
1920
|
+
Ye.create = (s) => new Ye({
|
|
1921
1921
|
typeName: g.ZodBoolean,
|
|
1922
1922
|
coerce: (s == null ? void 0 : s.coerce) || !1,
|
|
1923
1923
|
...y(s)
|
|
1924
1924
|
});
|
|
1925
|
-
class
|
|
1925
|
+
class Se extends _ {
|
|
1926
1926
|
_parse(e) {
|
|
1927
1927
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== p.date) {
|
|
1928
1928
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1962,7 +1962,7 @@ class Ae extends _ {
|
|
|
1962
1962
|
};
|
|
1963
1963
|
}
|
|
1964
1964
|
_addCheck(e) {
|
|
1965
|
-
return new
|
|
1965
|
+
return new Se({
|
|
1966
1966
|
...this._def,
|
|
1967
1967
|
checks: [...this._def.checks, e]
|
|
1968
1968
|
});
|
|
@@ -1994,13 +1994,13 @@ class Ae extends _ {
|
|
|
1994
1994
|
return e != null ? new Date(e) : null;
|
|
1995
1995
|
}
|
|
1996
1996
|
}
|
|
1997
|
-
|
|
1997
|
+
Se.create = (s) => new Se({
|
|
1998
1998
|
checks: [],
|
|
1999
1999
|
coerce: (s == null ? void 0 : s.coerce) || !1,
|
|
2000
2000
|
typeName: g.ZodDate,
|
|
2001
2001
|
...y(s)
|
|
2002
2002
|
});
|
|
2003
|
-
class
|
|
2003
|
+
class $t extends _ {
|
|
2004
2004
|
_parse(e) {
|
|
2005
2005
|
if (this._getType(e) !== p.symbol) {
|
|
2006
2006
|
const i = this._getOrReturnCtx(e);
|
|
@@ -2013,11 +2013,11 @@ class wt extends _ {
|
|
|
2013
2013
|
return Z(e.data);
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
2016
|
-
|
|
2016
|
+
$t.create = (s) => new $t({
|
|
2017
2017
|
typeName: g.ZodSymbol,
|
|
2018
2018
|
...y(s)
|
|
2019
2019
|
});
|
|
2020
|
-
class
|
|
2020
|
+
class Je extends _ {
|
|
2021
2021
|
_parse(e) {
|
|
2022
2022
|
if (this._getType(e) !== p.undefined) {
|
|
2023
2023
|
const i = this._getOrReturnCtx(e);
|
|
@@ -2030,11 +2030,11 @@ class Ye extends _ {
|
|
|
2030
2030
|
return Z(e.data);
|
|
2031
2031
|
}
|
|
2032
2032
|
}
|
|
2033
|
-
|
|
2033
|
+
Je.create = (s) => new Je({
|
|
2034
2034
|
typeName: g.ZodUndefined,
|
|
2035
2035
|
...y(s)
|
|
2036
2036
|
});
|
|
2037
|
-
class
|
|
2037
|
+
class Xe extends _ {
|
|
2038
2038
|
_parse(e) {
|
|
2039
2039
|
if (this._getType(e) !== p.null) {
|
|
2040
2040
|
const i = this._getOrReturnCtx(e);
|
|
@@ -2047,11 +2047,11 @@ class Je extends _ {
|
|
|
2047
2047
|
return Z(e.data);
|
|
2048
2048
|
}
|
|
2049
2049
|
}
|
|
2050
|
-
|
|
2050
|
+
Xe.create = (s) => new Xe({
|
|
2051
2051
|
typeName: g.ZodNull,
|
|
2052
2052
|
...y(s)
|
|
2053
2053
|
});
|
|
2054
|
-
class
|
|
2054
|
+
class Pe extends _ {
|
|
2055
2055
|
constructor() {
|
|
2056
2056
|
super(...arguments), this._any = !0;
|
|
2057
2057
|
}
|
|
@@ -2059,11 +2059,11 @@ class Ie extends _ {
|
|
|
2059
2059
|
return Z(e.data);
|
|
2060
2060
|
}
|
|
2061
2061
|
}
|
|
2062
|
-
|
|
2062
|
+
Pe.create = (s) => new Pe({
|
|
2063
2063
|
typeName: g.ZodAny,
|
|
2064
2064
|
...y(s)
|
|
2065
2065
|
});
|
|
2066
|
-
class
|
|
2066
|
+
class $e extends _ {
|
|
2067
2067
|
constructor() {
|
|
2068
2068
|
super(...arguments), this._unknown = !0;
|
|
2069
2069
|
}
|
|
@@ -2071,11 +2071,11 @@ class xe extends _ {
|
|
|
2071
2071
|
return Z(e.data);
|
|
2072
2072
|
}
|
|
2073
2073
|
}
|
|
2074
|
-
|
|
2074
|
+
$e.create = (s) => new $e({
|
|
2075
2075
|
typeName: g.ZodUnknown,
|
|
2076
2076
|
...y(s)
|
|
2077
2077
|
});
|
|
2078
|
-
class
|
|
2078
|
+
class se extends _ {
|
|
2079
2079
|
_parse(e) {
|
|
2080
2080
|
const t = this._getOrReturnCtx(e);
|
|
2081
2081
|
return h(t, {
|
|
@@ -2085,11 +2085,11 @@ class te extends _ {
|
|
|
2085
2085
|
}), v;
|
|
2086
2086
|
}
|
|
2087
2087
|
}
|
|
2088
|
-
|
|
2088
|
+
se.create = (s) => new se({
|
|
2089
2089
|
typeName: g.ZodNever,
|
|
2090
2090
|
...y(s)
|
|
2091
2091
|
});
|
|
2092
|
-
class
|
|
2092
|
+
class At extends _ {
|
|
2093
2093
|
_parse(e) {
|
|
2094
2094
|
if (this._getType(e) !== p.undefined) {
|
|
2095
2095
|
const i = this._getOrReturnCtx(e);
|
|
@@ -2102,11 +2102,11 @@ class xt extends _ {
|
|
|
2102
2102
|
return Z(e.data);
|
|
2103
2103
|
}
|
|
2104
2104
|
}
|
|
2105
|
-
|
|
2105
|
+
At.create = (s) => new At({
|
|
2106
2106
|
typeName: g.ZodVoid,
|
|
2107
2107
|
...y(s)
|
|
2108
2108
|
});
|
|
2109
|
-
class
|
|
2109
|
+
class W extends _ {
|
|
2110
2110
|
_parse(e) {
|
|
2111
2111
|
const { ctx: t, status: i } = this._processInputParams(e), r = this._def;
|
|
2112
2112
|
if (t.parsedType !== p.array)
|
|
@@ -2142,27 +2142,27 @@ class B extends _ {
|
|
|
2142
2142
|
exact: !1,
|
|
2143
2143
|
message: r.maxLength.message
|
|
2144
2144
|
}), i.dirty()), t.common.async)
|
|
2145
|
-
return Promise.all([...t.data].map((a, o) => r.type._parseAsync(new
|
|
2146
|
-
const n = [...t.data].map((a, o) => r.type._parseSync(new
|
|
2145
|
+
return Promise.all([...t.data].map((a, o) => r.type._parseAsync(new Y(t, a, t.path, o)))).then((a) => M.mergeArray(i, a));
|
|
2146
|
+
const n = [...t.data].map((a, o) => r.type._parseSync(new Y(t, a, t.path, o)));
|
|
2147
2147
|
return M.mergeArray(i, n);
|
|
2148
2148
|
}
|
|
2149
2149
|
get element() {
|
|
2150
2150
|
return this._def.type;
|
|
2151
2151
|
}
|
|
2152
2152
|
min(e, t) {
|
|
2153
|
-
return new
|
|
2153
|
+
return new W({
|
|
2154
2154
|
...this._def,
|
|
2155
2155
|
minLength: { value: e, message: f.toString(t) }
|
|
2156
2156
|
});
|
|
2157
2157
|
}
|
|
2158
2158
|
max(e, t) {
|
|
2159
|
-
return new
|
|
2159
|
+
return new W({
|
|
2160
2160
|
...this._def,
|
|
2161
2161
|
maxLength: { value: e, message: f.toString(t) }
|
|
2162
2162
|
});
|
|
2163
2163
|
}
|
|
2164
2164
|
length(e, t) {
|
|
2165
|
-
return new
|
|
2165
|
+
return new W({
|
|
2166
2166
|
...this._def,
|
|
2167
2167
|
exactLength: { value: e, message: f.toString(t) }
|
|
2168
2168
|
});
|
|
@@ -2171,7 +2171,7 @@ class B extends _ {
|
|
|
2171
2171
|
return this.min(1, e);
|
|
2172
2172
|
}
|
|
2173
2173
|
}
|
|
2174
|
-
|
|
2174
|
+
W.create = (s, e) => new W({
|
|
2175
2175
|
type: s,
|
|
2176
2176
|
minLength: null,
|
|
2177
2177
|
maxLength: null,
|
|
@@ -2179,22 +2179,22 @@ B.create = (s, e) => new B({
|
|
|
2179
2179
|
typeName: g.ZodArray,
|
|
2180
2180
|
...y(e)
|
|
2181
2181
|
});
|
|
2182
|
-
function
|
|
2182
|
+
function Oe(s) {
|
|
2183
2183
|
if (s instanceof T) {
|
|
2184
2184
|
const e = {};
|
|
2185
2185
|
for (const t in s.shape) {
|
|
2186
2186
|
const i = s.shape[t];
|
|
2187
|
-
e[t] = G.create(
|
|
2187
|
+
e[t] = G.create(Oe(i));
|
|
2188
2188
|
}
|
|
2189
2189
|
return new T({
|
|
2190
2190
|
...s._def,
|
|
2191
2191
|
shape: () => e
|
|
2192
2192
|
});
|
|
2193
2193
|
} else
|
|
2194
|
-
return s instanceof
|
|
2194
|
+
return s instanceof W ? new W({
|
|
2195
2195
|
...s._def,
|
|
2196
|
-
type:
|
|
2197
|
-
}) : s instanceof G ? G.create(
|
|
2196
|
+
type: Oe(s.element)
|
|
2197
|
+
}) : s instanceof G ? G.create(Oe(s.unwrap())) : s instanceof ye ? ye.create(Oe(s.unwrap())) : s instanceof J ? J.create(s.items.map((e) => Oe(e))) : s;
|
|
2198
2198
|
}
|
|
2199
2199
|
class T extends _ {
|
|
2200
2200
|
constructor() {
|
|
@@ -2216,7 +2216,7 @@ class T extends _ {
|
|
|
2216
2216
|
}), v;
|
|
2217
2217
|
}
|
|
2218
2218
|
const { status: i, ctx: r } = this._processInputParams(e), { shape: n, keys: a } = this._getCached(), o = [];
|
|
2219
|
-
if (!(this._def.catchall instanceof
|
|
2219
|
+
if (!(this._def.catchall instanceof se && this._def.unknownKeys === "strip"))
|
|
2220
2220
|
for (const d in r.data)
|
|
2221
2221
|
a.includes(d) || o.push(d);
|
|
2222
2222
|
const c = [];
|
|
@@ -2224,11 +2224,11 @@ class T extends _ {
|
|
|
2224
2224
|
const u = n[d], m = r.data[d];
|
|
2225
2225
|
c.push({
|
|
2226
2226
|
key: { status: "valid", value: d },
|
|
2227
|
-
value: u._parse(new
|
|
2227
|
+
value: u._parse(new Y(r, m, r.path, d)),
|
|
2228
2228
|
alwaysSet: d in r.data
|
|
2229
2229
|
});
|
|
2230
2230
|
}
|
|
2231
|
-
if (this._def.catchall instanceof
|
|
2231
|
+
if (this._def.catchall instanceof se) {
|
|
2232
2232
|
const d = this._def.unknownKeys;
|
|
2233
2233
|
if (d === "passthrough")
|
|
2234
2234
|
for (const u of o)
|
|
@@ -2250,7 +2250,7 @@ class T extends _ {
|
|
|
2250
2250
|
c.push({
|
|
2251
2251
|
key: { status: "valid", value: u },
|
|
2252
2252
|
value: d._parse(
|
|
2253
|
-
new
|
|
2253
|
+
new Y(r, m, r.path, u)
|
|
2254
2254
|
//, ctx.child(key), value, getParsedType(value)
|
|
2255
2255
|
),
|
|
2256
2256
|
alwaysSet: u in r.data
|
|
@@ -2431,7 +2431,7 @@ class T extends _ {
|
|
|
2431
2431
|
* @deprecated
|
|
2432
2432
|
*/
|
|
2433
2433
|
deepPartial() {
|
|
2434
|
-
return
|
|
2434
|
+
return Oe(this);
|
|
2435
2435
|
}
|
|
2436
2436
|
partial(e) {
|
|
2437
2437
|
const t = {};
|
|
@@ -2460,31 +2460,31 @@ class T extends _ {
|
|
|
2460
2460
|
});
|
|
2461
2461
|
}
|
|
2462
2462
|
keyof() {
|
|
2463
|
-
return
|
|
2463
|
+
return Ts(w.objectKeys(this.shape));
|
|
2464
2464
|
}
|
|
2465
2465
|
}
|
|
2466
2466
|
T.create = (s, e) => new T({
|
|
2467
2467
|
shape: () => s,
|
|
2468
2468
|
unknownKeys: "strip",
|
|
2469
|
-
catchall:
|
|
2469
|
+
catchall: se.create(),
|
|
2470
2470
|
typeName: g.ZodObject,
|
|
2471
2471
|
...y(e)
|
|
2472
2472
|
});
|
|
2473
2473
|
T.strictCreate = (s, e) => new T({
|
|
2474
2474
|
shape: () => s,
|
|
2475
2475
|
unknownKeys: "strict",
|
|
2476
|
-
catchall:
|
|
2476
|
+
catchall: se.create(),
|
|
2477
2477
|
typeName: g.ZodObject,
|
|
2478
2478
|
...y(e)
|
|
2479
2479
|
});
|
|
2480
2480
|
T.lazycreate = (s, e) => new T({
|
|
2481
2481
|
shape: s,
|
|
2482
2482
|
unknownKeys: "strip",
|
|
2483
|
-
catchall:
|
|
2483
|
+
catchall: se.create(),
|
|
2484
2484
|
typeName: g.ZodObject,
|
|
2485
2485
|
...y(e)
|
|
2486
2486
|
});
|
|
2487
|
-
class
|
|
2487
|
+
class Qe extends _ {
|
|
2488
2488
|
_parse(e) {
|
|
2489
2489
|
const { ctx: t } = this._processInputParams(e), i = this._def.options;
|
|
2490
2490
|
function r(n) {
|
|
@@ -2494,7 +2494,7 @@ class Xe extends _ {
|
|
|
2494
2494
|
for (const o of n)
|
|
2495
2495
|
if (o.result.status === "dirty")
|
|
2496
2496
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
2497
|
-
const a = n.map((o) => new
|
|
2497
|
+
const a = n.map((o) => new U(o.ctx.common.issues));
|
|
2498
2498
|
return h(t, {
|
|
2499
2499
|
code: l.invalid_union,
|
|
2500
2500
|
unionErrors: a
|
|
@@ -2541,7 +2541,7 @@ class Xe extends _ {
|
|
|
2541
2541
|
}
|
|
2542
2542
|
if (n)
|
|
2543
2543
|
return t.common.issues.push(...n.ctx.common.issues), n.result;
|
|
2544
|
-
const o = a.map((c) => new
|
|
2544
|
+
const o = a.map((c) => new U(c));
|
|
2545
2545
|
return h(t, {
|
|
2546
2546
|
code: l.invalid_union,
|
|
2547
2547
|
unionErrors: o
|
|
@@ -2552,13 +2552,13 @@ class Xe extends _ {
|
|
|
2552
2552
|
return this._def.options;
|
|
2553
2553
|
}
|
|
2554
2554
|
}
|
|
2555
|
-
|
|
2555
|
+
Qe.create = (s, e) => new Qe({
|
|
2556
2556
|
options: s,
|
|
2557
2557
|
typeName: g.ZodUnion,
|
|
2558
2558
|
...y(e)
|
|
2559
2559
|
});
|
|
2560
|
-
const
|
|
2561
|
-
class
|
|
2560
|
+
const ee = (s) => s instanceof st ? ee(s.schema) : s instanceof F ? ee(s.innerType()) : s instanceof it ? [s.value] : s instanceof ve ? s.options : s instanceof rt ? w.objectValues(s.enum) : s instanceof nt ? ee(s._def.innerType) : s instanceof Je ? [void 0] : s instanceof Xe ? [null] : s instanceof G ? [void 0, ...ee(s.unwrap())] : s instanceof ye ? [null, ...ee(s.unwrap())] : s instanceof Xt || s instanceof ot ? ee(s.unwrap()) : s instanceof at ? ee(s._def.innerType) : [];
|
|
2561
|
+
class Ot extends _ {
|
|
2562
2562
|
_parse(e) {
|
|
2563
2563
|
const { ctx: t } = this._processInputParams(e);
|
|
2564
2564
|
if (t.parsedType !== p.object)
|
|
@@ -2602,7 +2602,7 @@ class Ct extends _ {
|
|
|
2602
2602
|
static create(e, t, i) {
|
|
2603
2603
|
const r = /* @__PURE__ */ new Map();
|
|
2604
2604
|
for (const n of t) {
|
|
2605
|
-
const a =
|
|
2605
|
+
const a = ee(n.shape[e]);
|
|
2606
2606
|
if (!a.length)
|
|
2607
2607
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2608
2608
|
for (const o of a) {
|
|
@@ -2611,7 +2611,7 @@ class Ct extends _ {
|
|
|
2611
2611
|
r.set(o, n);
|
|
2612
2612
|
}
|
|
2613
2613
|
}
|
|
2614
|
-
return new
|
|
2614
|
+
return new Ot({
|
|
2615
2615
|
typeName: g.ZodDiscriminatedUnion,
|
|
2616
2616
|
discriminator: e,
|
|
2617
2617
|
options: t,
|
|
@@ -2620,14 +2620,14 @@ class Ct extends _ {
|
|
|
2620
2620
|
});
|
|
2621
2621
|
}
|
|
2622
2622
|
}
|
|
2623
|
-
function
|
|
2624
|
-
const t =
|
|
2623
|
+
function qt(s, e) {
|
|
2624
|
+
const t = te(s), i = te(e);
|
|
2625
2625
|
if (s === e)
|
|
2626
2626
|
return { valid: !0, data: s };
|
|
2627
2627
|
if (t === p.object && i === p.object) {
|
|
2628
2628
|
const r = w.objectKeys(e), n = w.objectKeys(s).filter((o) => r.indexOf(o) !== -1), a = { ...s, ...e };
|
|
2629
2629
|
for (const o of n) {
|
|
2630
|
-
const c =
|
|
2630
|
+
const c = qt(s[o], e[o]);
|
|
2631
2631
|
if (!c.valid)
|
|
2632
2632
|
return { valid: !1 };
|
|
2633
2633
|
a[o] = c.data;
|
|
@@ -2638,7 +2638,7 @@ function Wt(s, e) {
|
|
|
2638
2638
|
return { valid: !1 };
|
|
2639
2639
|
const r = [];
|
|
2640
2640
|
for (let n = 0; n < s.length; n++) {
|
|
2641
|
-
const a = s[n], o = e[n], c =
|
|
2641
|
+
const a = s[n], o = e[n], c = qt(a, o);
|
|
2642
2642
|
if (!c.valid)
|
|
2643
2643
|
return { valid: !1 };
|
|
2644
2644
|
r.push(c.data);
|
|
@@ -2647,13 +2647,13 @@ function Wt(s, e) {
|
|
|
2647
2647
|
} else
|
|
2648
2648
|
return t === p.date && i === p.date && +s == +e ? { valid: !0, data: s } : { valid: !1 };
|
|
2649
2649
|
}
|
|
2650
|
-
class
|
|
2650
|
+
class et extends _ {
|
|
2651
2651
|
_parse(e) {
|
|
2652
2652
|
const { status: t, ctx: i } = this._processInputParams(e), r = (n, a) => {
|
|
2653
|
-
if (
|
|
2653
|
+
if (Ht(n) || Ht(a))
|
|
2654
2654
|
return v;
|
|
2655
|
-
const o =
|
|
2656
|
-
return o.valid ? ((
|
|
2655
|
+
const o = qt(n.value, a.value);
|
|
2656
|
+
return o.valid ? ((Kt(n) || Kt(a)) && t.dirty(), { status: t.value, value: o.data }) : (h(i, {
|
|
2657
2657
|
code: l.invalid_intersection_types
|
|
2658
2658
|
}), v);
|
|
2659
2659
|
};
|
|
@@ -2679,13 +2679,13 @@ class Qe extends _ {
|
|
|
2679
2679
|
}));
|
|
2680
2680
|
}
|
|
2681
2681
|
}
|
|
2682
|
-
|
|
2682
|
+
et.create = (s, e, t) => new et({
|
|
2683
2683
|
left: s,
|
|
2684
2684
|
right: e,
|
|
2685
2685
|
typeName: g.ZodIntersection,
|
|
2686
2686
|
...y(t)
|
|
2687
2687
|
});
|
|
2688
|
-
class
|
|
2688
|
+
class J extends _ {
|
|
2689
2689
|
_parse(e) {
|
|
2690
2690
|
const { status: t, ctx: i } = this._processInputParams(e);
|
|
2691
2691
|
if (i.parsedType !== p.array)
|
|
@@ -2711,7 +2711,7 @@ class Y extends _ {
|
|
|
2711
2711
|
}), t.dirty());
|
|
2712
2712
|
const n = [...i.data].map((a, o) => {
|
|
2713
2713
|
const c = this._def.items[o] || this._def.rest;
|
|
2714
|
-
return c ? c._parse(new
|
|
2714
|
+
return c ? c._parse(new Y(i, a, i.path, o)) : null;
|
|
2715
2715
|
}).filter((a) => !!a);
|
|
2716
2716
|
return i.common.async ? Promise.all(n).then((a) => M.mergeArray(t, a)) : M.mergeArray(t, n);
|
|
2717
2717
|
}
|
|
@@ -2719,23 +2719,23 @@ class Y extends _ {
|
|
|
2719
2719
|
return this._def.items;
|
|
2720
2720
|
}
|
|
2721
2721
|
rest(e) {
|
|
2722
|
-
return new
|
|
2722
|
+
return new J({
|
|
2723
2723
|
...this._def,
|
|
2724
2724
|
rest: e
|
|
2725
2725
|
});
|
|
2726
2726
|
}
|
|
2727
2727
|
}
|
|
2728
|
-
|
|
2728
|
+
J.create = (s, e) => {
|
|
2729
2729
|
if (!Array.isArray(s))
|
|
2730
2730
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2731
|
-
return new
|
|
2731
|
+
return new J({
|
|
2732
2732
|
items: s,
|
|
2733
2733
|
typeName: g.ZodTuple,
|
|
2734
2734
|
rest: null,
|
|
2735
2735
|
...y(e)
|
|
2736
2736
|
});
|
|
2737
2737
|
};
|
|
2738
|
-
class
|
|
2738
|
+
class tt extends _ {
|
|
2739
2739
|
get keySchema() {
|
|
2740
2740
|
return this._def.keyType;
|
|
2741
2741
|
}
|
|
@@ -2753,8 +2753,8 @@ class et extends _ {
|
|
|
2753
2753
|
const r = [], n = this._def.keyType, a = this._def.valueType;
|
|
2754
2754
|
for (const o in i.data)
|
|
2755
2755
|
r.push({
|
|
2756
|
-
key: n._parse(new
|
|
2757
|
-
value: a._parse(new
|
|
2756
|
+
key: n._parse(new Y(i, o, i.path, o)),
|
|
2757
|
+
value: a._parse(new Y(i, i.data[o], i.path, o)),
|
|
2758
2758
|
alwaysSet: o in i.data
|
|
2759
2759
|
});
|
|
2760
2760
|
return i.common.async ? M.mergeObjectAsync(t, r) : M.mergeObjectSync(t, r);
|
|
@@ -2763,20 +2763,20 @@ class et extends _ {
|
|
|
2763
2763
|
return this._def.valueType;
|
|
2764
2764
|
}
|
|
2765
2765
|
static create(e, t, i) {
|
|
2766
|
-
return t instanceof _ ? new
|
|
2766
|
+
return t instanceof _ ? new tt({
|
|
2767
2767
|
keyType: e,
|
|
2768
2768
|
valueType: t,
|
|
2769
2769
|
typeName: g.ZodRecord,
|
|
2770
2770
|
...y(i)
|
|
2771
|
-
}) : new
|
|
2772
|
-
keyType:
|
|
2771
|
+
}) : new tt({
|
|
2772
|
+
keyType: B.create(),
|
|
2773
2773
|
valueType: e,
|
|
2774
2774
|
typeName: g.ZodRecord,
|
|
2775
2775
|
...y(t)
|
|
2776
2776
|
});
|
|
2777
2777
|
}
|
|
2778
2778
|
}
|
|
2779
|
-
class
|
|
2779
|
+
class St extends _ {
|
|
2780
2780
|
get keySchema() {
|
|
2781
2781
|
return this._def.keyType;
|
|
2782
2782
|
}
|
|
@@ -2792,8 +2792,8 @@ class $t extends _ {
|
|
|
2792
2792
|
received: i.parsedType
|
|
2793
2793
|
}), v;
|
|
2794
2794
|
const r = this._def.keyType, n = this._def.valueType, a = [...i.data.entries()].map(([o, c], d) => ({
|
|
2795
|
-
key: r._parse(new
|
|
2796
|
-
value: n._parse(new
|
|
2795
|
+
key: r._parse(new Y(i, o, i.path, [d, "key"])),
|
|
2796
|
+
value: n._parse(new Y(i, c, i.path, [d, "value"]))
|
|
2797
2797
|
}));
|
|
2798
2798
|
if (i.common.async) {
|
|
2799
2799
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2818,13 +2818,13 @@ class $t extends _ {
|
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
2820
2820
|
}
|
|
2821
|
-
|
|
2821
|
+
St.create = (s, e, t) => new St({
|
|
2822
2822
|
valueType: e,
|
|
2823
2823
|
keyType: s,
|
|
2824
2824
|
typeName: g.ZodMap,
|
|
2825
2825
|
...y(t)
|
|
2826
2826
|
});
|
|
2827
|
-
class
|
|
2827
|
+
class ke extends _ {
|
|
2828
2828
|
_parse(e) {
|
|
2829
2829
|
const { status: t, ctx: i } = this._processInputParams(e);
|
|
2830
2830
|
if (i.parsedType !== p.set)
|
|
@@ -2859,17 +2859,17 @@ class Se extends _ {
|
|
|
2859
2859
|
}
|
|
2860
2860
|
return { status: t.value, value: d };
|
|
2861
2861
|
}
|
|
2862
|
-
const o = [...i.data.values()].map((c, d) => n._parse(new
|
|
2862
|
+
const o = [...i.data.values()].map((c, d) => n._parse(new Y(i, c, i.path, d)));
|
|
2863
2863
|
return i.common.async ? Promise.all(o).then((c) => a(c)) : a(o);
|
|
2864
2864
|
}
|
|
2865
2865
|
min(e, t) {
|
|
2866
|
-
return new
|
|
2866
|
+
return new ke({
|
|
2867
2867
|
...this._def,
|
|
2868
2868
|
minSize: { value: e, message: f.toString(t) }
|
|
2869
2869
|
});
|
|
2870
2870
|
}
|
|
2871
2871
|
max(e, t) {
|
|
2872
|
-
return new
|
|
2872
|
+
return new ke({
|
|
2873
2873
|
...this._def,
|
|
2874
2874
|
maxSize: { value: e, message: f.toString(t) }
|
|
2875
2875
|
});
|
|
@@ -2881,14 +2881,14 @@ class Se extends _ {
|
|
|
2881
2881
|
return this.min(1, e);
|
|
2882
2882
|
}
|
|
2883
2883
|
}
|
|
2884
|
-
|
|
2884
|
+
ke.create = (s, e) => new ke({
|
|
2885
2885
|
valueType: s,
|
|
2886
2886
|
minSize: null,
|
|
2887
2887
|
maxSize: null,
|
|
2888
2888
|
typeName: g.ZodSet,
|
|
2889
2889
|
...y(e)
|
|
2890
2890
|
});
|
|
2891
|
-
class
|
|
2891
|
+
class Ne extends _ {
|
|
2892
2892
|
constructor() {
|
|
2893
2893
|
super(...arguments), this.validate = this.implement;
|
|
2894
2894
|
}
|
|
@@ -2901,14 +2901,14 @@ class Re extends _ {
|
|
|
2901
2901
|
received: t.parsedType
|
|
2902
2902
|
}), v;
|
|
2903
2903
|
function i(o, c) {
|
|
2904
|
-
return
|
|
2904
|
+
return wt({
|
|
2905
2905
|
data: o,
|
|
2906
2906
|
path: t.path,
|
|
2907
2907
|
errorMaps: [
|
|
2908
2908
|
t.common.contextualErrorMap,
|
|
2909
2909
|
t.schemaErrorMap,
|
|
2910
|
-
|
|
2911
|
-
|
|
2910
|
+
bt(),
|
|
2911
|
+
Ie
|
|
2912
2912
|
].filter((d) => !!d),
|
|
2913
2913
|
issueData: {
|
|
2914
2914
|
code: l.invalid_arguments,
|
|
@@ -2917,14 +2917,14 @@ class Re extends _ {
|
|
|
2917
2917
|
});
|
|
2918
2918
|
}
|
|
2919
2919
|
function r(o, c) {
|
|
2920
|
-
return
|
|
2920
|
+
return wt({
|
|
2921
2921
|
data: o,
|
|
2922
2922
|
path: t.path,
|
|
2923
2923
|
errorMaps: [
|
|
2924
2924
|
t.common.contextualErrorMap,
|
|
2925
2925
|
t.schemaErrorMap,
|
|
2926
|
-
|
|
2927
|
-
|
|
2926
|
+
bt(),
|
|
2927
|
+
Ie
|
|
2928
2928
|
].filter((d) => !!d),
|
|
2929
2929
|
issueData: {
|
|
2930
2930
|
code: l.invalid_return_type,
|
|
@@ -2933,10 +2933,10 @@ class Re extends _ {
|
|
|
2933
2933
|
});
|
|
2934
2934
|
}
|
|
2935
2935
|
const n = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
2936
|
-
if (this._def.returns instanceof
|
|
2936
|
+
if (this._def.returns instanceof Me) {
|
|
2937
2937
|
const o = this;
|
|
2938
2938
|
return Z(async function(...c) {
|
|
2939
|
-
const d = new
|
|
2939
|
+
const d = new U([]), u = await o._def.args.parseAsync(c, n).catch((O) => {
|
|
2940
2940
|
throw d.addIssue(i(c, O)), d;
|
|
2941
2941
|
}), m = await Reflect.apply(a, this, u);
|
|
2942
2942
|
return await o._def.returns._def.type.parseAsync(m, n).catch((O) => {
|
|
@@ -2948,10 +2948,10 @@ class Re extends _ {
|
|
|
2948
2948
|
return Z(function(...c) {
|
|
2949
2949
|
const d = o._def.args.safeParse(c, n);
|
|
2950
2950
|
if (!d.success)
|
|
2951
|
-
throw new
|
|
2951
|
+
throw new U([i(c, d.error)]);
|
|
2952
2952
|
const u = Reflect.apply(a, this, d.data), m = o._def.returns.safeParse(u, n);
|
|
2953
2953
|
if (!m.success)
|
|
2954
|
-
throw new
|
|
2954
|
+
throw new U([r(u, m.error)]);
|
|
2955
2955
|
return m.data;
|
|
2956
2956
|
});
|
|
2957
2957
|
}
|
|
@@ -2963,13 +2963,13 @@ class Re extends _ {
|
|
|
2963
2963
|
return this._def.returns;
|
|
2964
2964
|
}
|
|
2965
2965
|
args(...e) {
|
|
2966
|
-
return new
|
|
2966
|
+
return new Ne({
|
|
2967
2967
|
...this._def,
|
|
2968
|
-
args:
|
|
2968
|
+
args: J.create(e).rest($e.create())
|
|
2969
2969
|
});
|
|
2970
2970
|
}
|
|
2971
2971
|
returns(e) {
|
|
2972
|
-
return new
|
|
2972
|
+
return new Ne({
|
|
2973
2973
|
...this._def,
|
|
2974
2974
|
returns: e
|
|
2975
2975
|
});
|
|
@@ -2981,15 +2981,15 @@ class Re extends _ {
|
|
|
2981
2981
|
return this.parse(e);
|
|
2982
2982
|
}
|
|
2983
2983
|
static create(e, t, i) {
|
|
2984
|
-
return new
|
|
2985
|
-
args: e ||
|
|
2986
|
-
returns: t ||
|
|
2984
|
+
return new Ne({
|
|
2985
|
+
args: e || J.create([]).rest($e.create()),
|
|
2986
|
+
returns: t || $e.create(),
|
|
2987
2987
|
typeName: g.ZodFunction,
|
|
2988
2988
|
...y(i)
|
|
2989
2989
|
});
|
|
2990
2990
|
}
|
|
2991
2991
|
}
|
|
2992
|
-
class
|
|
2992
|
+
class st extends _ {
|
|
2993
2993
|
get schema() {
|
|
2994
2994
|
return this._def.getter();
|
|
2995
2995
|
}
|
|
@@ -2998,12 +2998,12 @@ class tt extends _ {
|
|
|
2998
2998
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2999
2999
|
}
|
|
3000
3000
|
}
|
|
3001
|
-
|
|
3001
|
+
st.create = (s, e) => new st({
|
|
3002
3002
|
getter: s,
|
|
3003
3003
|
typeName: g.ZodLazy,
|
|
3004
3004
|
...y(e)
|
|
3005
3005
|
});
|
|
3006
|
-
class
|
|
3006
|
+
class it extends _ {
|
|
3007
3007
|
_parse(e) {
|
|
3008
3008
|
if (e.data !== this._def.value) {
|
|
3009
3009
|
const t = this._getOrReturnCtx(e);
|
|
@@ -3019,21 +3019,21 @@ class st extends _ {
|
|
|
3019
3019
|
return this._def.value;
|
|
3020
3020
|
}
|
|
3021
3021
|
}
|
|
3022
|
-
|
|
3022
|
+
it.create = (s, e) => new it({
|
|
3023
3023
|
value: s,
|
|
3024
3024
|
typeName: g.ZodLiteral,
|
|
3025
3025
|
...y(e)
|
|
3026
3026
|
});
|
|
3027
|
-
function
|
|
3028
|
-
return new
|
|
3027
|
+
function Ts(s, e) {
|
|
3028
|
+
return new ve({
|
|
3029
3029
|
values: s,
|
|
3030
3030
|
typeName: g.ZodEnum,
|
|
3031
3031
|
...y(e)
|
|
3032
3032
|
});
|
|
3033
3033
|
}
|
|
3034
|
-
class
|
|
3034
|
+
class ve extends _ {
|
|
3035
3035
|
constructor() {
|
|
3036
|
-
super(...arguments),
|
|
3036
|
+
super(...arguments), Ve.set(this, void 0);
|
|
3037
3037
|
}
|
|
3038
3038
|
_parse(e) {
|
|
3039
3039
|
if (typeof e.data != "string") {
|
|
@@ -3044,7 +3044,7 @@ class ge extends _ {
|
|
|
3044
3044
|
code: l.invalid_type
|
|
3045
3045
|
}), v;
|
|
3046
3046
|
}
|
|
3047
|
-
if (
|
|
3047
|
+
if (xt(this, Ve, "f") || Ss(this, Ve, new Set(this._def.values), "f"), !xt(this, Ve, "f").has(e.data)) {
|
|
3048
3048
|
const t = this._getOrReturnCtx(e), i = this._def.values;
|
|
3049
3049
|
return h(t, {
|
|
3050
3050
|
received: t.data,
|
|
@@ -3076,23 +3076,23 @@ class ge extends _ {
|
|
|
3076
3076
|
return e;
|
|
3077
3077
|
}
|
|
3078
3078
|
extract(e, t = this._def) {
|
|
3079
|
-
return
|
|
3079
|
+
return ve.create(e, {
|
|
3080
3080
|
...this._def,
|
|
3081
3081
|
...t
|
|
3082
3082
|
});
|
|
3083
3083
|
}
|
|
3084
3084
|
exclude(e, t = this._def) {
|
|
3085
|
-
return
|
|
3085
|
+
return ve.create(this.options.filter((i) => !e.includes(i)), {
|
|
3086
3086
|
...this._def,
|
|
3087
3087
|
...t
|
|
3088
3088
|
});
|
|
3089
3089
|
}
|
|
3090
3090
|
}
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
class
|
|
3091
|
+
Ve = /* @__PURE__ */ new WeakMap();
|
|
3092
|
+
ve.create = Ts;
|
|
3093
|
+
class rt extends _ {
|
|
3094
3094
|
constructor() {
|
|
3095
|
-
super(...arguments),
|
|
3095
|
+
super(...arguments), Be.set(this, void 0);
|
|
3096
3096
|
}
|
|
3097
3097
|
_parse(e) {
|
|
3098
3098
|
const t = w.getValidEnumValues(this._def.values), i = this._getOrReturnCtx(e);
|
|
@@ -3104,7 +3104,7 @@ class it extends _ {
|
|
|
3104
3104
|
code: l.invalid_type
|
|
3105
3105
|
}), v;
|
|
3106
3106
|
}
|
|
3107
|
-
if (
|
|
3107
|
+
if (xt(this, Be, "f") || Ss(this, Be, new Set(w.getValidEnumValues(this._def.values)), "f"), !xt(this, Be, "f").has(e.data)) {
|
|
3108
3108
|
const r = w.objectValues(t);
|
|
3109
3109
|
return h(i, {
|
|
3110
3110
|
received: i.data,
|
|
@@ -3118,13 +3118,13 @@ class it extends _ {
|
|
|
3118
3118
|
return this._def.values;
|
|
3119
3119
|
}
|
|
3120
3120
|
}
|
|
3121
|
-
|
|
3122
|
-
|
|
3121
|
+
Be = /* @__PURE__ */ new WeakMap();
|
|
3122
|
+
rt.create = (s, e) => new rt({
|
|
3123
3123
|
values: s,
|
|
3124
3124
|
typeName: g.ZodNativeEnum,
|
|
3125
3125
|
...y(e)
|
|
3126
3126
|
});
|
|
3127
|
-
class
|
|
3127
|
+
class Me extends _ {
|
|
3128
3128
|
unwrap() {
|
|
3129
3129
|
return this._def.type;
|
|
3130
3130
|
}
|
|
@@ -3143,7 +3143,7 @@ class Pe extends _ {
|
|
|
3143
3143
|
})));
|
|
3144
3144
|
}
|
|
3145
3145
|
}
|
|
3146
|
-
|
|
3146
|
+
Me.create = (s, e) => new Me({
|
|
3147
3147
|
type: s,
|
|
3148
3148
|
typeName: g.ZodPromise,
|
|
3149
3149
|
...y(e)
|
|
@@ -3175,7 +3175,7 @@ class F extends _ {
|
|
|
3175
3175
|
path: i.path,
|
|
3176
3176
|
parent: i
|
|
3177
3177
|
});
|
|
3178
|
-
return c.status === "aborted" ? v : c.status === "dirty" || t.value === "dirty" ?
|
|
3178
|
+
return c.status === "aborted" ? v : c.status === "dirty" || t.value === "dirty" ? Re(c.value) : c;
|
|
3179
3179
|
});
|
|
3180
3180
|
{
|
|
3181
3181
|
if (t.value === "aborted")
|
|
@@ -3185,7 +3185,7 @@ class F extends _ {
|
|
|
3185
3185
|
path: i.path,
|
|
3186
3186
|
parent: i
|
|
3187
3187
|
});
|
|
3188
|
-
return o.status === "aborted" ? v : o.status === "dirty" || t.value === "dirty" ?
|
|
3188
|
+
return o.status === "aborted" ? v : o.status === "dirty" || t.value === "dirty" ? Re(o.value) : o;
|
|
3189
3189
|
}
|
|
3190
3190
|
}
|
|
3191
3191
|
if (r.type === "refinement") {
|
|
@@ -3214,14 +3214,14 @@ class F extends _ {
|
|
|
3214
3214
|
path: i.path,
|
|
3215
3215
|
parent: i
|
|
3216
3216
|
});
|
|
3217
|
-
if (
|
|
3217
|
+
if (!Ae(a))
|
|
3218
3218
|
return a;
|
|
3219
3219
|
const o = r.transform(a.value, n);
|
|
3220
3220
|
if (o instanceof Promise)
|
|
3221
3221
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3222
3222
|
return { status: t.value, value: o };
|
|
3223
3223
|
} else
|
|
3224
|
-
return this._def.schema._parseAsync({ data: i.data, path: i.path, parent: i }).then((a) =>
|
|
3224
|
+
return this._def.schema._parseAsync({ data: i.data, path: i.path, parent: i }).then((a) => Ae(a) ? Promise.resolve(r.transform(a.value, n)).then((o) => ({ status: t.value, value: o })) : a);
|
|
3225
3225
|
w.assertNever(r);
|
|
3226
3226
|
}
|
|
3227
3227
|
}
|
|
@@ -3250,7 +3250,7 @@ G.create = (s, e) => new G({
|
|
|
3250
3250
|
typeName: g.ZodOptional,
|
|
3251
3251
|
...y(e)
|
|
3252
3252
|
});
|
|
3253
|
-
class
|
|
3253
|
+
class ye extends _ {
|
|
3254
3254
|
_parse(e) {
|
|
3255
3255
|
return this._getType(e) === p.null ? Z(null) : this._def.innerType._parse(e);
|
|
3256
3256
|
}
|
|
@@ -3258,12 +3258,12 @@ class ve extends _ {
|
|
|
3258
3258
|
return this._def.innerType;
|
|
3259
3259
|
}
|
|
3260
3260
|
}
|
|
3261
|
-
|
|
3261
|
+
ye.create = (s, e) => new ye({
|
|
3262
3262
|
innerType: s,
|
|
3263
3263
|
typeName: g.ZodNullable,
|
|
3264
3264
|
...y(e)
|
|
3265
3265
|
});
|
|
3266
|
-
class
|
|
3266
|
+
class nt extends _ {
|
|
3267
3267
|
_parse(e) {
|
|
3268
3268
|
const { ctx: t } = this._processInputParams(e);
|
|
3269
3269
|
let i = t.data;
|
|
@@ -3277,13 +3277,13 @@ class rt extends _ {
|
|
|
3277
3277
|
return this._def.innerType;
|
|
3278
3278
|
}
|
|
3279
3279
|
}
|
|
3280
|
-
|
|
3280
|
+
nt.create = (s, e) => new nt({
|
|
3281
3281
|
innerType: s,
|
|
3282
3282
|
typeName: g.ZodDefault,
|
|
3283
3283
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
3284
3284
|
...y(e)
|
|
3285
3285
|
});
|
|
3286
|
-
class
|
|
3286
|
+
class at extends _ {
|
|
3287
3287
|
_parse(e) {
|
|
3288
3288
|
const { ctx: t } = this._processInputParams(e), i = {
|
|
3289
3289
|
...t,
|
|
@@ -3302,7 +3302,7 @@ class nt extends _ {
|
|
|
3302
3302
|
status: "valid",
|
|
3303
3303
|
value: n.status === "valid" ? n.value : this._def.catchValue({
|
|
3304
3304
|
get error() {
|
|
3305
|
-
return new
|
|
3305
|
+
return new U(i.common.issues);
|
|
3306
3306
|
},
|
|
3307
3307
|
input: i.data
|
|
3308
3308
|
})
|
|
@@ -3310,7 +3310,7 @@ class nt extends _ {
|
|
|
3310
3310
|
status: "valid",
|
|
3311
3311
|
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
3312
3312
|
get error() {
|
|
3313
|
-
return new
|
|
3313
|
+
return new U(i.common.issues);
|
|
3314
3314
|
},
|
|
3315
3315
|
input: i.data
|
|
3316
3316
|
})
|
|
@@ -3320,13 +3320,13 @@ class nt extends _ {
|
|
|
3320
3320
|
return this._def.innerType;
|
|
3321
3321
|
}
|
|
3322
3322
|
}
|
|
3323
|
-
|
|
3323
|
+
at.create = (s, e) => new at({
|
|
3324
3324
|
innerType: s,
|
|
3325
3325
|
typeName: g.ZodCatch,
|
|
3326
3326
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
3327
3327
|
...y(e)
|
|
3328
3328
|
});
|
|
3329
|
-
class
|
|
3329
|
+
class kt extends _ {
|
|
3330
3330
|
_parse(e) {
|
|
3331
3331
|
if (this._getType(e) !== p.nan) {
|
|
3332
3332
|
const i = this._getOrReturnCtx(e);
|
|
@@ -3339,12 +3339,12 @@ class At extends _ {
|
|
|
3339
3339
|
return { status: "valid", value: e.data };
|
|
3340
3340
|
}
|
|
3341
3341
|
}
|
|
3342
|
-
|
|
3342
|
+
kt.create = (s) => new kt({
|
|
3343
3343
|
typeName: g.ZodNaN,
|
|
3344
3344
|
...y(s)
|
|
3345
3345
|
});
|
|
3346
|
-
const
|
|
3347
|
-
class
|
|
3346
|
+
const zi = Symbol("zod_brand");
|
|
3347
|
+
class Xt extends _ {
|
|
3348
3348
|
_parse(e) {
|
|
3349
3349
|
const { ctx: t } = this._processInputParams(e), i = t.data;
|
|
3350
3350
|
return this._def.type._parse({
|
|
@@ -3357,7 +3357,7 @@ class Yt extends _ {
|
|
|
3357
3357
|
return this._def.type;
|
|
3358
3358
|
}
|
|
3359
3359
|
}
|
|
3360
|
-
class
|
|
3360
|
+
class ht extends _ {
|
|
3361
3361
|
_parse(e) {
|
|
3362
3362
|
const { status: t, ctx: i } = this._processInputParams(e);
|
|
3363
3363
|
if (i.common.async)
|
|
@@ -3367,7 +3367,7 @@ class ut extends _ {
|
|
|
3367
3367
|
path: i.path,
|
|
3368
3368
|
parent: i
|
|
3369
3369
|
});
|
|
3370
|
-
return n.status === "aborted" ? v : n.status === "dirty" ? (t.dirty(),
|
|
3370
|
+
return n.status === "aborted" ? v : n.status === "dirty" ? (t.dirty(), Re(n.value)) : this._def.out._parseAsync({
|
|
3371
3371
|
data: n.value,
|
|
3372
3372
|
path: i.path,
|
|
3373
3373
|
parent: i
|
|
@@ -3390,201 +3390,201 @@ class ut extends _ {
|
|
|
3390
3390
|
}
|
|
3391
3391
|
}
|
|
3392
3392
|
static create(e, t) {
|
|
3393
|
-
return new
|
|
3393
|
+
return new ht({
|
|
3394
3394
|
in: e,
|
|
3395
3395
|
out: t,
|
|
3396
3396
|
typeName: g.ZodPipeline
|
|
3397
3397
|
});
|
|
3398
3398
|
}
|
|
3399
3399
|
}
|
|
3400
|
-
class
|
|
3400
|
+
class ot extends _ {
|
|
3401
3401
|
_parse(e) {
|
|
3402
|
-
const t = this._def.innerType._parse(e), i = (r) => (
|
|
3402
|
+
const t = this._def.innerType._parse(e), i = (r) => (Ae(r) && (r.value = Object.freeze(r.value)), r);
|
|
3403
3403
|
return Ge(t) ? t.then((r) => i(r)) : i(t);
|
|
3404
3404
|
}
|
|
3405
3405
|
unwrap() {
|
|
3406
3406
|
return this._def.innerType;
|
|
3407
3407
|
}
|
|
3408
3408
|
}
|
|
3409
|
-
|
|
3409
|
+
ot.create = (s, e) => new ot({
|
|
3410
3410
|
innerType: s,
|
|
3411
3411
|
typeName: g.ZodReadonly,
|
|
3412
3412
|
...y(e)
|
|
3413
3413
|
});
|
|
3414
|
-
function
|
|
3414
|
+
function ds(s, e) {
|
|
3415
3415
|
const t = typeof s == "function" ? s(e) : typeof s == "string" ? { message: s } : s;
|
|
3416
3416
|
return typeof t == "string" ? { message: t } : t;
|
|
3417
3417
|
}
|
|
3418
|
-
function
|
|
3419
|
-
return s ?
|
|
3418
|
+
function Os(s, e = {}, t) {
|
|
3419
|
+
return s ? Pe.create().superRefine((i, r) => {
|
|
3420
3420
|
var n, a;
|
|
3421
3421
|
const o = s(i);
|
|
3422
3422
|
if (o instanceof Promise)
|
|
3423
3423
|
return o.then((c) => {
|
|
3424
3424
|
var d, u;
|
|
3425
3425
|
if (!c) {
|
|
3426
|
-
const m =
|
|
3426
|
+
const m = ds(e, i), $ = (u = (d = m.fatal) !== null && d !== void 0 ? d : t) !== null && u !== void 0 ? u : !0;
|
|
3427
3427
|
r.addIssue({ code: "custom", ...m, fatal: $ });
|
|
3428
3428
|
}
|
|
3429
3429
|
});
|
|
3430
3430
|
if (!o) {
|
|
3431
|
-
const c =
|
|
3431
|
+
const c = ds(e, i), d = (a = (n = c.fatal) !== null && n !== void 0 ? n : t) !== null && a !== void 0 ? a : !0;
|
|
3432
3432
|
r.addIssue({ code: "custom", ...c, fatal: d });
|
|
3433
3433
|
}
|
|
3434
|
-
}) :
|
|
3434
|
+
}) : Pe.create();
|
|
3435
3435
|
}
|
|
3436
|
-
const
|
|
3436
|
+
const Vi = {
|
|
3437
3437
|
object: T.lazycreate
|
|
3438
3438
|
};
|
|
3439
3439
|
var g;
|
|
3440
3440
|
(function(s) {
|
|
3441
3441
|
s.ZodString = "ZodString", s.ZodNumber = "ZodNumber", s.ZodNaN = "ZodNaN", s.ZodBigInt = "ZodBigInt", s.ZodBoolean = "ZodBoolean", s.ZodDate = "ZodDate", s.ZodSymbol = "ZodSymbol", s.ZodUndefined = "ZodUndefined", s.ZodNull = "ZodNull", s.ZodAny = "ZodAny", s.ZodUnknown = "ZodUnknown", s.ZodNever = "ZodNever", s.ZodVoid = "ZodVoid", s.ZodArray = "ZodArray", s.ZodObject = "ZodObject", s.ZodUnion = "ZodUnion", s.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", s.ZodIntersection = "ZodIntersection", s.ZodTuple = "ZodTuple", s.ZodRecord = "ZodRecord", s.ZodMap = "ZodMap", s.ZodSet = "ZodSet", s.ZodFunction = "ZodFunction", s.ZodLazy = "ZodLazy", s.ZodLiteral = "ZodLiteral", s.ZodEnum = "ZodEnum", s.ZodEffects = "ZodEffects", s.ZodNativeEnum = "ZodNativeEnum", s.ZodOptional = "ZodOptional", s.ZodNullable = "ZodNullable", s.ZodDefault = "ZodDefault", s.ZodCatch = "ZodCatch", s.ZodPromise = "ZodPromise", s.ZodBranded = "ZodBranded", s.ZodPipeline = "ZodPipeline", s.ZodReadonly = "ZodReadonly";
|
|
3442
3442
|
})(g || (g = {}));
|
|
3443
|
-
const
|
|
3443
|
+
const Bi = (s, e = {
|
|
3444
3444
|
message: `Input not instance of ${s.name}`
|
|
3445
|
-
}) =>
|
|
3446
|
-
string: (s) =>
|
|
3447
|
-
number: (s) =>
|
|
3448
|
-
boolean: (s) =>
|
|
3445
|
+
}) => Os((t) => t instanceof s, e), Rs = B.create, Ns = me.create, Wi = kt.create, Fi = ge.create, Is = Ye.create, Hi = Se.create, Ki = $t.create, qi = Je.create, Gi = Xe.create, Yi = Pe.create, Ji = $e.create, Xi = se.create, Qi = At.create, er = W.create, tr = T.create, sr = T.strictCreate, ir = Qe.create, rr = Ot.create, nr = et.create, ar = J.create, or = tt.create, cr = St.create, dr = ke.create, lr = Ne.create, ur = st.create, hr = it.create, pr = ve.create, fr = rt.create, mr = Me.create, ls = F.create, gr = G.create, vr = ye.create, yr = F.createWithPreprocess, _r = ht.create, br = () => Rs().optional(), wr = () => Ns().optional(), xr = () => Is().optional(), $r = {
|
|
3446
|
+
string: (s) => B.create({ ...s, coerce: !0 }),
|
|
3447
|
+
number: (s) => me.create({ ...s, coerce: !0 }),
|
|
3448
|
+
boolean: (s) => Ye.create({
|
|
3449
3449
|
...s,
|
|
3450
3450
|
coerce: !0
|
|
3451
3451
|
}),
|
|
3452
|
-
bigint: (s) =>
|
|
3453
|
-
date: (s) =>
|
|
3454
|
-
},
|
|
3455
|
-
var
|
|
3452
|
+
bigint: (s) => ge.create({ ...s, coerce: !0 }),
|
|
3453
|
+
date: (s) => Se.create({ ...s, coerce: !0 })
|
|
3454
|
+
}, Ar = v;
|
|
3455
|
+
var Q = /* @__PURE__ */ Object.freeze({
|
|
3456
3456
|
__proto__: null,
|
|
3457
|
-
defaultErrorMap:
|
|
3458
|
-
setErrorMap:
|
|
3459
|
-
getErrorMap:
|
|
3460
|
-
makeIssue:
|
|
3461
|
-
EMPTY_PATH:
|
|
3457
|
+
defaultErrorMap: Ie,
|
|
3458
|
+
setErrorMap: yi,
|
|
3459
|
+
getErrorMap: bt,
|
|
3460
|
+
makeIssue: wt,
|
|
3461
|
+
EMPTY_PATH: _i,
|
|
3462
3462
|
addIssueToContext: h,
|
|
3463
3463
|
ParseStatus: M,
|
|
3464
3464
|
INVALID: v,
|
|
3465
|
-
DIRTY:
|
|
3465
|
+
DIRTY: Re,
|
|
3466
3466
|
OK: Z,
|
|
3467
|
-
isAborted:
|
|
3468
|
-
isDirty:
|
|
3469
|
-
isValid:
|
|
3467
|
+
isAborted: Ht,
|
|
3468
|
+
isDirty: Kt,
|
|
3469
|
+
isValid: Ae,
|
|
3470
3470
|
isAsync: Ge,
|
|
3471
3471
|
get util() {
|
|
3472
3472
|
return w;
|
|
3473
3473
|
},
|
|
3474
3474
|
get objectUtil() {
|
|
3475
|
-
return
|
|
3475
|
+
return Ft;
|
|
3476
3476
|
},
|
|
3477
3477
|
ZodParsedType: p,
|
|
3478
|
-
getParsedType:
|
|
3478
|
+
getParsedType: te,
|
|
3479
3479
|
ZodType: _,
|
|
3480
|
-
datetimeRegex:
|
|
3481
|
-
ZodString:
|
|
3482
|
-
ZodNumber:
|
|
3483
|
-
ZodBigInt:
|
|
3484
|
-
ZodBoolean:
|
|
3485
|
-
ZodDate:
|
|
3486
|
-
ZodSymbol:
|
|
3487
|
-
ZodUndefined:
|
|
3488
|
-
ZodNull:
|
|
3489
|
-
ZodAny:
|
|
3490
|
-
ZodUnknown:
|
|
3491
|
-
ZodNever:
|
|
3492
|
-
ZodVoid:
|
|
3493
|
-
ZodArray:
|
|
3480
|
+
datetimeRegex: Cs,
|
|
3481
|
+
ZodString: B,
|
|
3482
|
+
ZodNumber: me,
|
|
3483
|
+
ZodBigInt: ge,
|
|
3484
|
+
ZodBoolean: Ye,
|
|
3485
|
+
ZodDate: Se,
|
|
3486
|
+
ZodSymbol: $t,
|
|
3487
|
+
ZodUndefined: Je,
|
|
3488
|
+
ZodNull: Xe,
|
|
3489
|
+
ZodAny: Pe,
|
|
3490
|
+
ZodUnknown: $e,
|
|
3491
|
+
ZodNever: se,
|
|
3492
|
+
ZodVoid: At,
|
|
3493
|
+
ZodArray: W,
|
|
3494
3494
|
ZodObject: T,
|
|
3495
|
-
ZodUnion:
|
|
3496
|
-
ZodDiscriminatedUnion:
|
|
3497
|
-
ZodIntersection:
|
|
3498
|
-
ZodTuple:
|
|
3499
|
-
ZodRecord:
|
|
3500
|
-
ZodMap:
|
|
3501
|
-
ZodSet:
|
|
3502
|
-
ZodFunction:
|
|
3503
|
-
ZodLazy:
|
|
3504
|
-
ZodLiteral:
|
|
3505
|
-
ZodEnum:
|
|
3506
|
-
ZodNativeEnum:
|
|
3507
|
-
ZodPromise:
|
|
3495
|
+
ZodUnion: Qe,
|
|
3496
|
+
ZodDiscriminatedUnion: Ot,
|
|
3497
|
+
ZodIntersection: et,
|
|
3498
|
+
ZodTuple: J,
|
|
3499
|
+
ZodRecord: tt,
|
|
3500
|
+
ZodMap: St,
|
|
3501
|
+
ZodSet: ke,
|
|
3502
|
+
ZodFunction: Ne,
|
|
3503
|
+
ZodLazy: st,
|
|
3504
|
+
ZodLiteral: it,
|
|
3505
|
+
ZodEnum: ve,
|
|
3506
|
+
ZodNativeEnum: rt,
|
|
3507
|
+
ZodPromise: Me,
|
|
3508
3508
|
ZodEffects: F,
|
|
3509
3509
|
ZodTransformer: F,
|
|
3510
3510
|
ZodOptional: G,
|
|
3511
|
-
ZodNullable:
|
|
3512
|
-
ZodDefault:
|
|
3513
|
-
ZodCatch:
|
|
3514
|
-
ZodNaN:
|
|
3515
|
-
BRAND:
|
|
3516
|
-
ZodBranded:
|
|
3517
|
-
ZodPipeline:
|
|
3518
|
-
ZodReadonly:
|
|
3519
|
-
custom:
|
|
3511
|
+
ZodNullable: ye,
|
|
3512
|
+
ZodDefault: nt,
|
|
3513
|
+
ZodCatch: at,
|
|
3514
|
+
ZodNaN: kt,
|
|
3515
|
+
BRAND: zi,
|
|
3516
|
+
ZodBranded: Xt,
|
|
3517
|
+
ZodPipeline: ht,
|
|
3518
|
+
ZodReadonly: ot,
|
|
3519
|
+
custom: Os,
|
|
3520
3520
|
Schema: _,
|
|
3521
3521
|
ZodSchema: _,
|
|
3522
|
-
late:
|
|
3522
|
+
late: Vi,
|
|
3523
3523
|
get ZodFirstPartyTypeKind() {
|
|
3524
3524
|
return g;
|
|
3525
3525
|
},
|
|
3526
|
-
coerce:
|
|
3527
|
-
any:
|
|
3528
|
-
array:
|
|
3529
|
-
bigint:
|
|
3530
|
-
boolean:
|
|
3531
|
-
date:
|
|
3532
|
-
discriminatedUnion:
|
|
3533
|
-
effect:
|
|
3534
|
-
enum:
|
|
3535
|
-
function:
|
|
3536
|
-
instanceof:
|
|
3537
|
-
intersection:
|
|
3538
|
-
lazy:
|
|
3539
|
-
literal:
|
|
3540
|
-
map:
|
|
3541
|
-
nan:
|
|
3542
|
-
nativeEnum:
|
|
3543
|
-
never:
|
|
3544
|
-
null:
|
|
3545
|
-
nullable:
|
|
3546
|
-
number:
|
|
3547
|
-
object:
|
|
3548
|
-
oboolean:
|
|
3549
|
-
onumber:
|
|
3550
|
-
optional:
|
|
3551
|
-
ostring:
|
|
3552
|
-
pipeline:
|
|
3553
|
-
preprocess:
|
|
3554
|
-
promise:
|
|
3555
|
-
record:
|
|
3556
|
-
set:
|
|
3557
|
-
strictObject:
|
|
3558
|
-
string:
|
|
3559
|
-
symbol:
|
|
3560
|
-
transformer:
|
|
3561
|
-
tuple:
|
|
3562
|
-
undefined:
|
|
3563
|
-
union:
|
|
3564
|
-
unknown:
|
|
3565
|
-
void:
|
|
3566
|
-
NEVER:
|
|
3526
|
+
coerce: $r,
|
|
3527
|
+
any: Yi,
|
|
3528
|
+
array: er,
|
|
3529
|
+
bigint: Fi,
|
|
3530
|
+
boolean: Is,
|
|
3531
|
+
date: Hi,
|
|
3532
|
+
discriminatedUnion: rr,
|
|
3533
|
+
effect: ls,
|
|
3534
|
+
enum: pr,
|
|
3535
|
+
function: lr,
|
|
3536
|
+
instanceof: Bi,
|
|
3537
|
+
intersection: nr,
|
|
3538
|
+
lazy: ur,
|
|
3539
|
+
literal: hr,
|
|
3540
|
+
map: cr,
|
|
3541
|
+
nan: Wi,
|
|
3542
|
+
nativeEnum: fr,
|
|
3543
|
+
never: Xi,
|
|
3544
|
+
null: Gi,
|
|
3545
|
+
nullable: vr,
|
|
3546
|
+
number: Ns,
|
|
3547
|
+
object: tr,
|
|
3548
|
+
oboolean: xr,
|
|
3549
|
+
onumber: wr,
|
|
3550
|
+
optional: gr,
|
|
3551
|
+
ostring: br,
|
|
3552
|
+
pipeline: _r,
|
|
3553
|
+
preprocess: yr,
|
|
3554
|
+
promise: mr,
|
|
3555
|
+
record: or,
|
|
3556
|
+
set: dr,
|
|
3557
|
+
strictObject: sr,
|
|
3558
|
+
string: Rs,
|
|
3559
|
+
symbol: Ki,
|
|
3560
|
+
transformer: ls,
|
|
3561
|
+
tuple: ar,
|
|
3562
|
+
undefined: qi,
|
|
3563
|
+
union: ir,
|
|
3564
|
+
unknown: Ji,
|
|
3565
|
+
void: Qi,
|
|
3566
|
+
NEVER: Ar,
|
|
3567
3567
|
ZodIssueCode: l,
|
|
3568
|
-
quotelessJson:
|
|
3569
|
-
ZodError:
|
|
3568
|
+
quotelessJson: vi,
|
|
3569
|
+
ZodError: U
|
|
3570
3570
|
});
|
|
3571
|
-
const
|
|
3572
|
-
apiKey:
|
|
3573
|
-
enableVoice:
|
|
3574
|
-
enableScreenCapture:
|
|
3575
|
-
debug:
|
|
3576
|
-
user:
|
|
3577
|
-
id:
|
|
3578
|
-
email:
|
|
3579
|
-
metadata:
|
|
3571
|
+
const Ps = "https://iamobi.ai/api", Sr = Q.object({
|
|
3572
|
+
apiKey: Q.string().optional(),
|
|
3573
|
+
enableVoice: Q.boolean().default(!0),
|
|
3574
|
+
enableScreenCapture: Q.boolean().default(!0),
|
|
3575
|
+
debug: Q.boolean().default(!1),
|
|
3576
|
+
user: Q.object({
|
|
3577
|
+
id: Q.string(),
|
|
3578
|
+
email: Q.string().optional(),
|
|
3579
|
+
metadata: Q.any().optional()
|
|
3580
3580
|
}).optional()
|
|
3581
3581
|
});
|
|
3582
|
-
var
|
|
3583
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
3582
|
+
var he = /* @__PURE__ */ ((s) => (s.READY = "ready", s.ERROR = "error", s.VOICE_START = "voice:start", s.VOICE_STOP = "voice:stop", s.SCREEN_CAPTURE_START = "screen:start", s.SCREEN_CAPTURE_STOP = "screen:stop", s.STATE_CHANGE = "state:change", s))(he || {}), A = /* @__PURE__ */ ((s) => (s.READY = "ready", s.ERROR = "error", s.PAUSED = "paused", s.LOADING = "loading", s.THINKING = "thinking", s.RESEARCHING = "researching", s.AGENT_SPEAKING = "agent_speaking", s.USER_SPEAKING = "user_speaking", s.AWAITING_USER_INPUT = "awaiting_user_input", s))(A || {}), kr = Object.defineProperty, Er = Object.getOwnPropertyDescriptor, Rt = (s, e, t, i) => {
|
|
3583
|
+
for (var r = i > 1 ? void 0 : i ? Er(e, t) : e, n = s.length - 1, a; n >= 0; n--)
|
|
3584
3584
|
(a = s[n]) && (r = (i ? a(e, t, r) : a(r)) || r);
|
|
3585
|
-
return i && r &&
|
|
3585
|
+
return i && r && kr(e, t, r), r;
|
|
3586
3586
|
};
|
|
3587
|
-
class
|
|
3587
|
+
class je extends re {
|
|
3588
3588
|
constructor() {
|
|
3589
3589
|
super(...arguments), this.id = "", this.isActive = !1, this.isSpecial = !1;
|
|
3590
3590
|
}
|
|
@@ -3614,7 +3614,7 @@ class Ze extends ie {
|
|
|
3614
3614
|
`;
|
|
3615
3615
|
}
|
|
3616
3616
|
}
|
|
3617
|
-
|
|
3617
|
+
je.styles = ie`
|
|
3618
3618
|
:host {
|
|
3619
3619
|
display: block;
|
|
3620
3620
|
}
|
|
@@ -3667,20 +3667,20 @@ Ze.styles = se`
|
|
|
3667
3667
|
height: 18px;
|
|
3668
3668
|
}
|
|
3669
3669
|
`;
|
|
3670
|
-
|
|
3670
|
+
Rt([
|
|
3671
3671
|
x({ type: String })
|
|
3672
|
-
],
|
|
3673
|
-
|
|
3672
|
+
], je.prototype, "id", 2);
|
|
3673
|
+
Rt([
|
|
3674
3674
|
x({ type: Boolean })
|
|
3675
|
-
],
|
|
3676
|
-
|
|
3675
|
+
], je.prototype, "isActive", 2);
|
|
3676
|
+
Rt([
|
|
3677
3677
|
x({ type: Boolean })
|
|
3678
|
-
],
|
|
3679
|
-
|
|
3678
|
+
], je.prototype, "isSpecial", 2);
|
|
3679
|
+
Rt([
|
|
3680
3680
|
x({ type: Function })
|
|
3681
|
-
],
|
|
3682
|
-
customElements.get("obi-nav-icon") || customElements.define("obi-nav-icon",
|
|
3683
|
-
const
|
|
3681
|
+
], je.prototype, "onClick", 2);
|
|
3682
|
+
customElements.get("obi-nav-icon") || customElements.define("obi-nav-icon", je);
|
|
3683
|
+
const pt = (s) => E`
|
|
3684
3684
|
<svg
|
|
3685
3685
|
xmlns="http://www.w3.org/2000/svg"
|
|
3686
3686
|
width="24"
|
|
@@ -3696,18 +3696,18 @@ const ht = (s) => E`
|
|
|
3696
3696
|
>
|
|
3697
3697
|
${s}
|
|
3698
3698
|
</svg>
|
|
3699
|
-
`,
|
|
3699
|
+
`, Cr = pt(ut`
|
|
3700
3700
|
<rect x="14" y="4" width="4" height="16" rx="1"/><rect x="6" y="4" width="4" height="16" rx="1"/>
|
|
3701
|
-
`),
|
|
3701
|
+
`), Tr = pt(ut`<polygon points="6 3 20 12 6 21 6 3"/>`), Or = pt(ut`
|
|
3702
3702
|
<path d="M12 2v10"/><path d="M18.4 6.6a9 9 0 1 1-12.77.04"/>
|
|
3703
|
-
`),
|
|
3703
|
+
`), Rr = pt(ut`
|
|
3704
3704
|
<path d="M18 6 6 18"/><path d="m6 6 12 12"/>
|
|
3705
|
-
`),
|
|
3705
|
+
`), Nr = pt(ut`
|
|
3706
3706
|
<path d="M12 7v14" />
|
|
3707
3707
|
<path
|
|
3708
3708
|
d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"
|
|
3709
3709
|
/>
|
|
3710
|
-
`),
|
|
3710
|
+
`), us = E`
|
|
3711
3711
|
<img
|
|
3712
3712
|
class="widget-icon"
|
|
3713
3713
|
src="data:image/svg+xml;base64,${btoa(`<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -3729,12 +3729,12 @@ const ht = (s) => E`
|
|
|
3729
3729
|
alt="Obi Icon"
|
|
3730
3730
|
/>
|
|
3731
3731
|
`;
|
|
3732
|
-
var
|
|
3733
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
3732
|
+
var Ir = Object.defineProperty, Pr = Object.getOwnPropertyDescriptor, De = (s, e, t, i) => {
|
|
3733
|
+
for (var r = i > 1 ? void 0 : i ? Pr(e, t) : e, n = s.length - 1, a; n >= 0; n--)
|
|
3734
3734
|
(a = s[n]) && (r = (i ? a(e, t, r) : a(r)) || r);
|
|
3735
|
-
return i && r &&
|
|
3735
|
+
return i && r && Ir(e, t, r), r;
|
|
3736
3736
|
};
|
|
3737
|
-
class
|
|
3737
|
+
class be extends re {
|
|
3738
3738
|
constructor() {
|
|
3739
3739
|
super(), this.isActive = !1, this.isScreenActive = !1, this.position = { top: 0, left: 0 }, this.currentState = A.READY, this.direction = "up";
|
|
3740
3740
|
}
|
|
@@ -3752,7 +3752,7 @@ class _e extends ie {
|
|
|
3752
3752
|
?isActive=${this.currentState === A.PAUSED}
|
|
3753
3753
|
@click=${() => this.handleIconClick("pause", this.currentState !== A.PAUSED)}
|
|
3754
3754
|
>
|
|
3755
|
-
${this.currentState === A.PAUSED ?
|
|
3755
|
+
${this.currentState === A.PAUSED ? Tr : Cr}
|
|
3756
3756
|
</obi-nav-icon>
|
|
3757
3757
|
<obi-nav-icon
|
|
3758
3758
|
id="activate"
|
|
@@ -3760,20 +3760,20 @@ class _e extends ie {
|
|
|
3760
3760
|
?isSpecial=${!0}
|
|
3761
3761
|
@click=${() => this.handleIconClick("activate", !this.isActive)}
|
|
3762
3762
|
>
|
|
3763
|
-
${this.isActive ?
|
|
3763
|
+
${this.isActive ? Rr : Or}
|
|
3764
3764
|
</obi-nav-icon>
|
|
3765
3765
|
` : E`
|
|
3766
3766
|
<obi-nav-icon
|
|
3767
3767
|
id="experiences"
|
|
3768
3768
|
@click=${() => this.handleIconClick("experiences", !0)}
|
|
3769
3769
|
>
|
|
3770
|
-
${
|
|
3770
|
+
${Nr}
|
|
3771
3771
|
</obi-nav-icon>
|
|
3772
3772
|
`}
|
|
3773
3773
|
`;
|
|
3774
3774
|
}
|
|
3775
3775
|
}
|
|
3776
|
-
|
|
3776
|
+
be.styles = ie`
|
|
3777
3777
|
:host {
|
|
3778
3778
|
display: flex;
|
|
3779
3779
|
position: absolute;
|
|
@@ -3798,31 +3798,31 @@ _e.styles = se`
|
|
|
3798
3798
|
flex-direction: column;
|
|
3799
3799
|
}
|
|
3800
3800
|
`;
|
|
3801
|
-
|
|
3801
|
+
De([
|
|
3802
3802
|
x({ type: Boolean })
|
|
3803
|
-
],
|
|
3804
|
-
|
|
3803
|
+
], be.prototype, "isActive", 2);
|
|
3804
|
+
De([
|
|
3805
3805
|
x({ type: Boolean })
|
|
3806
|
-
],
|
|
3807
|
-
|
|
3806
|
+
], be.prototype, "isScreenActive", 2);
|
|
3807
|
+
De([
|
|
3808
3808
|
x({ type: Object })
|
|
3809
|
-
],
|
|
3810
|
-
|
|
3809
|
+
], be.prototype, "position", 2);
|
|
3810
|
+
De([
|
|
3811
3811
|
x({ type: String })
|
|
3812
|
-
],
|
|
3813
|
-
|
|
3812
|
+
], be.prototype, "currentState", 2);
|
|
3813
|
+
De([
|
|
3814
3814
|
x({ type: String })
|
|
3815
|
-
],
|
|
3816
|
-
|
|
3815
|
+
], be.prototype, "direction", 2);
|
|
3816
|
+
De([
|
|
3817
3817
|
x({ type: Function })
|
|
3818
|
-
],
|
|
3819
|
-
customElements.get("obi-navigation-bar") || customElements.define("obi-navigation-bar",
|
|
3820
|
-
var
|
|
3821
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
3818
|
+
], be.prototype, "onItemSelect", 2);
|
|
3819
|
+
customElements.get("obi-navigation-bar") || customElements.define("obi-navigation-bar", be);
|
|
3820
|
+
var Mr = Object.defineProperty, Zr = Object.getOwnPropertyDescriptor, ne = (s, e, t, i) => {
|
|
3821
|
+
for (var r = i > 1 ? void 0 : i ? Zr(e, t) : e, n = s.length - 1, a; n >= 0; n--)
|
|
3822
3822
|
(a = s[n]) && (r = (i ? a(e, t, r) : a(r)) || r);
|
|
3823
|
-
return i && r &&
|
|
3823
|
+
return i && r && Mr(e, t, r), r;
|
|
3824
3824
|
};
|
|
3825
|
-
class
|
|
3825
|
+
class Ce extends re {
|
|
3826
3826
|
constructor() {
|
|
3827
3827
|
super(...arguments), this.id = "", this.name = "", this.description = "", this.imageSrc = "";
|
|
3828
3828
|
}
|
|
@@ -3845,7 +3845,7 @@ class Ee extends ie {
|
|
|
3845
3845
|
`;
|
|
3846
3846
|
}
|
|
3847
3847
|
}
|
|
3848
|
-
|
|
3848
|
+
Ce.styles = ie`
|
|
3849
3849
|
:host {
|
|
3850
3850
|
display: block;
|
|
3851
3851
|
}
|
|
@@ -3891,22 +3891,22 @@ Ee.styles = se`
|
|
|
3891
3891
|
margin: 0;
|
|
3892
3892
|
}
|
|
3893
3893
|
`;
|
|
3894
|
-
|
|
3894
|
+
ne([
|
|
3895
3895
|
x({ type: String })
|
|
3896
|
-
],
|
|
3897
|
-
|
|
3896
|
+
], Ce.prototype, "id", 2);
|
|
3897
|
+
ne([
|
|
3898
3898
|
x({ type: String })
|
|
3899
|
-
],
|
|
3900
|
-
|
|
3899
|
+
], Ce.prototype, "name", 2);
|
|
3900
|
+
ne([
|
|
3901
3901
|
x({ type: String })
|
|
3902
|
-
],
|
|
3903
|
-
|
|
3902
|
+
], Ce.prototype, "description", 2);
|
|
3903
|
+
ne([
|
|
3904
3904
|
x({ type: String })
|
|
3905
|
-
],
|
|
3906
|
-
|
|
3905
|
+
], Ce.prototype, "imageSrc", 2);
|
|
3906
|
+
ne([
|
|
3907
3907
|
x({ type: Function })
|
|
3908
|
-
],
|
|
3909
|
-
class
|
|
3908
|
+
], Ce.prototype, "onSelect", 2);
|
|
3909
|
+
class Le extends re {
|
|
3910
3910
|
constructor() {
|
|
3911
3911
|
super(...arguments), this.courses = [], this.loading = !1, this.error = "";
|
|
3912
3912
|
}
|
|
@@ -3938,7 +3938,7 @@ class De extends ie {
|
|
|
3938
3938
|
`;
|
|
3939
3939
|
}
|
|
3940
3940
|
}
|
|
3941
|
-
|
|
3941
|
+
Le.styles = ie`
|
|
3942
3942
|
:host {
|
|
3943
3943
|
display: block;
|
|
3944
3944
|
}
|
|
@@ -3974,26 +3974,26 @@ De.styles = se`
|
|
|
3974
3974
|
color: #ef4444;
|
|
3975
3975
|
}
|
|
3976
3976
|
`;
|
|
3977
|
-
|
|
3977
|
+
ne([
|
|
3978
3978
|
x({ type: Array })
|
|
3979
|
-
],
|
|
3980
|
-
|
|
3979
|
+
], Le.prototype, "courses", 2);
|
|
3980
|
+
ne([
|
|
3981
3981
|
x({ type: Boolean })
|
|
3982
|
-
],
|
|
3983
|
-
|
|
3982
|
+
], Le.prototype, "loading", 2);
|
|
3983
|
+
ne([
|
|
3984
3984
|
x({ type: String })
|
|
3985
|
-
],
|
|
3986
|
-
|
|
3985
|
+
], Le.prototype, "error", 2);
|
|
3986
|
+
ne([
|
|
3987
3987
|
x({ type: Function })
|
|
3988
|
-
],
|
|
3989
|
-
customElements.get("obi-course") || customElements.define("obi-course",
|
|
3990
|
-
customElements.get("obi-course-list") || customElements.define("obi-course-list",
|
|
3991
|
-
var
|
|
3992
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
3988
|
+
], Le.prototype, "onCourseSelect", 2);
|
|
3989
|
+
customElements.get("obi-course") || customElements.define("obi-course", Ce);
|
|
3990
|
+
customElements.get("obi-course-list") || customElements.define("obi-course-list", Le);
|
|
3991
|
+
var jr = Object.defineProperty, Dr = Object.getOwnPropertyDescriptor, Te = (s, e, t, i) => {
|
|
3992
|
+
for (var r = i > 1 ? void 0 : i ? Dr(e, t) : e, n = s.length - 1, a; n >= 0; n--)
|
|
3993
3993
|
(a = s[n]) && (r = (i ? a(e, t, r) : a(r)) || r);
|
|
3994
|
-
return i && r &&
|
|
3994
|
+
return i && r && jr(e, t, r), r;
|
|
3995
3995
|
};
|
|
3996
|
-
class
|
|
3996
|
+
class ae extends re {
|
|
3997
3997
|
constructor() {
|
|
3998
3998
|
super(...arguments), this.courses = [], this.loading = !0, this.error = "", this.apiBaseUrl = "", this.apiKey = "";
|
|
3999
3999
|
}
|
|
@@ -4021,7 +4021,7 @@ class ne extends ie {
|
|
|
4021
4021
|
}
|
|
4022
4022
|
connectedCallback() {
|
|
4023
4023
|
var e;
|
|
4024
|
-
super.connectedCallback(), (e = window.obiWidgetConfig) != null && e.apiKey && (this.apiKey = window.obiWidgetConfig.apiKey), this.apiBaseUrl =
|
|
4024
|
+
super.connectedCallback(), (e = window.obiWidgetConfig) != null && e.apiKey && (this.apiKey = window.obiWidgetConfig.apiKey), this.apiBaseUrl = Ps, this.apiBaseUrl && this.apiKey ? this.fetchCourses() : (this.loading = !1, this.error = "API base URL or API key is missing");
|
|
4025
4025
|
}
|
|
4026
4026
|
render() {
|
|
4027
4027
|
return E`
|
|
@@ -4043,7 +4043,7 @@ class ne extends ie {
|
|
|
4043
4043
|
`;
|
|
4044
4044
|
}
|
|
4045
4045
|
}
|
|
4046
|
-
|
|
4046
|
+
ae.styles = ie`
|
|
4047
4047
|
:host {
|
|
4048
4048
|
display: block;
|
|
4049
4049
|
font-family: "Syne", sans-serif;
|
|
@@ -4127,107 +4127,107 @@ ne.styles = se`
|
|
|
4127
4127
|
color: #6b7280;
|
|
4128
4128
|
}
|
|
4129
4129
|
`;
|
|
4130
|
-
|
|
4130
|
+
Te([
|
|
4131
4131
|
x({ type: Array })
|
|
4132
|
-
],
|
|
4133
|
-
|
|
4132
|
+
], ae.prototype, "courses", 2);
|
|
4133
|
+
Te([
|
|
4134
4134
|
x({ type: Boolean })
|
|
4135
|
-
],
|
|
4136
|
-
|
|
4135
|
+
], ae.prototype, "loading", 2);
|
|
4136
|
+
Te([
|
|
4137
4137
|
x({ type: String })
|
|
4138
|
-
],
|
|
4139
|
-
|
|
4138
|
+
], ae.prototype, "error", 2);
|
|
4139
|
+
Te([
|
|
4140
4140
|
x({ type: String })
|
|
4141
|
-
],
|
|
4142
|
-
|
|
4141
|
+
], ae.prototype, "apiBaseUrl", 2);
|
|
4142
|
+
Te([
|
|
4143
4143
|
x({ type: String })
|
|
4144
|
-
],
|
|
4145
|
-
|
|
4144
|
+
], ae.prototype, "apiKey", 2);
|
|
4145
|
+
Te([
|
|
4146
4146
|
x({ type: Function })
|
|
4147
|
-
],
|
|
4148
|
-
|
|
4147
|
+
], ae.prototype, "onCourseSelect", 2);
|
|
4148
|
+
Te([
|
|
4149
4149
|
x({ type: Function })
|
|
4150
|
-
],
|
|
4151
|
-
customElements.get("obi-course-modal") || customElements.define("obi-course-modal",
|
|
4150
|
+
], ae.prototype, "onClose", 2);
|
|
4151
|
+
customElements.get("obi-course-modal") || customElements.define("obi-course-modal", ae);
|
|
4152
4152
|
/**
|
|
4153
4153
|
* @license
|
|
4154
4154
|
* Copyright 2017 Google LLC
|
|
4155
4155
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
4156
4156
|
*/
|
|
4157
|
-
const Fe = globalThis,
|
|
4158
|
-
\f\r]`,
|
|
4159
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
4160
|
-
function
|
|
4161
|
-
if (!
|
|
4157
|
+
const Fe = globalThis, Et = Fe.trustedTypes, hs = Et ? Et.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, Ms = "$lit$", pe = `lit$${Math.random().toFixed(9).slice(2)}$`, Zs = "?" + pe, Lr = `<${Zs}>`, Ee = document, Ct = () => Ee.createComment(""), ct = (s) => s === null || typeof s != "object" && typeof s != "function", Qt = Array.isArray, Ur = (s) => Qt(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", Dt = `[
|
|
4158
|
+
\f\r]`, ze = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ps = /-->/g, fs = />/g, we = RegExp(`>|${Dt}(?:([^\\s"'>=/]+)(${Dt}*=${Dt}*(?:[^
|
|
4159
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ms = /'/g, gs = /"/g, js = /^(?:script|style|textarea|title)$/i, dt = Symbol.for("lit-noChange"), N = Symbol.for("lit-nothing"), vs = /* @__PURE__ */ new WeakMap(), xe = Ee.createTreeWalker(Ee, 129);
|
|
4160
|
+
function Ds(s, e) {
|
|
4161
|
+
if (!Qt(s) || !s.hasOwnProperty("raw"))
|
|
4162
4162
|
throw Error("invalid template strings array");
|
|
4163
|
-
return
|
|
4163
|
+
return hs !== void 0 ? hs.createHTML(e) : e;
|
|
4164
4164
|
}
|
|
4165
|
-
const
|
|
4165
|
+
const zr = (s, e) => {
|
|
4166
4166
|
const t = s.length - 1, i = [];
|
|
4167
|
-
let r, n = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", a =
|
|
4167
|
+
let r, n = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", a = ze;
|
|
4168
4168
|
for (let o = 0; o < t; o++) {
|
|
4169
4169
|
const c = s[o];
|
|
4170
4170
|
let d, u, m = -1, $ = 0;
|
|
4171
4171
|
for (; $ < c.length && (a.lastIndex = $, u = a.exec(c), u !== null); )
|
|
4172
|
-
$ = a.lastIndex, a ===
|
|
4173
|
-
const O = a ===
|
|
4174
|
-
n += a ===
|
|
4172
|
+
$ = a.lastIndex, a === ze ? u[1] === "!--" ? a = ps : u[1] !== void 0 ? a = fs : u[2] !== void 0 ? (js.test(u[2]) && (r = RegExp("</" + u[2], "g")), a = we) : u[3] !== void 0 && (a = we) : a === we ? u[0] === ">" ? (a = r ?? ze, m = -1) : u[1] === void 0 ? m = -2 : (m = a.lastIndex - u[2].length, d = u[1], a = u[3] === void 0 ? we : u[3] === '"' ? gs : ms) : a === gs || a === ms ? a = we : a === ps || a === fs ? a = ze : (a = we, r = void 0);
|
|
4173
|
+
const O = a === we && s[o + 1].startsWith("/>") ? " " : "";
|
|
4174
|
+
n += a === ze ? c + Lr : m >= 0 ? (i.push(d), c.slice(0, m) + Ms + c.slice(m) + pe + O) : c + pe + (m === -2 ? o : O);
|
|
4175
4175
|
}
|
|
4176
|
-
return [
|
|
4176
|
+
return [Ds(s, n + (s[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
|
|
4177
4177
|
};
|
|
4178
|
-
class
|
|
4178
|
+
class lt {
|
|
4179
4179
|
constructor({ strings: e, _$litType$: t }, i) {
|
|
4180
4180
|
let r;
|
|
4181
4181
|
this.parts = [];
|
|
4182
4182
|
let n = 0, a = 0;
|
|
4183
|
-
const o = e.length - 1, c = this.parts, [d, u] =
|
|
4184
|
-
if (this.el =
|
|
4183
|
+
const o = e.length - 1, c = this.parts, [d, u] = zr(e, t);
|
|
4184
|
+
if (this.el = lt.createElement(d, i), xe.currentNode = this.el.content, t === 2 || t === 3) {
|
|
4185
4185
|
const m = this.el.content.firstChild;
|
|
4186
4186
|
m.replaceWith(...m.childNodes);
|
|
4187
4187
|
}
|
|
4188
|
-
for (; (r =
|
|
4188
|
+
for (; (r = xe.nextNode()) !== null && c.length < o; ) {
|
|
4189
4189
|
if (r.nodeType === 1) {
|
|
4190
4190
|
if (r.hasAttributes())
|
|
4191
4191
|
for (const m of r.getAttributeNames())
|
|
4192
|
-
if (m.endsWith(
|
|
4193
|
-
const $ = u[a++], O = r.getAttribute(m).split(
|
|
4194
|
-
c.push({ type: 1, index: n, name: k[2], strings: O, ctor: k[1] === "." ?
|
|
4192
|
+
if (m.endsWith(Ms)) {
|
|
4193
|
+
const $ = u[a++], O = r.getAttribute(m).split(pe), k = /([.?@])?(.*)/.exec($);
|
|
4194
|
+
c.push({ type: 1, index: n, name: k[2], strings: O, ctor: k[1] === "." ? Br : k[1] === "?" ? Wr : k[1] === "@" ? Fr : It }), r.removeAttribute(m);
|
|
4195
4195
|
} else
|
|
4196
|
-
m.startsWith(
|
|
4197
|
-
if (
|
|
4198
|
-
const m = r.textContent.split(
|
|
4196
|
+
m.startsWith(pe) && (c.push({ type: 6, index: n }), r.removeAttribute(m));
|
|
4197
|
+
if (js.test(r.tagName)) {
|
|
4198
|
+
const m = r.textContent.split(pe), $ = m.length - 1;
|
|
4199
4199
|
if ($ > 0) {
|
|
4200
|
-
r.textContent =
|
|
4200
|
+
r.textContent = Et ? Et.emptyScript : "";
|
|
4201
4201
|
for (let O = 0; O < $; O++)
|
|
4202
|
-
r.append(m[O],
|
|
4203
|
-
r.append(m[$],
|
|
4202
|
+
r.append(m[O], Ct()), xe.nextNode(), c.push({ type: 2, index: ++n });
|
|
4203
|
+
r.append(m[$], Ct());
|
|
4204
4204
|
}
|
|
4205
4205
|
}
|
|
4206
4206
|
} else if (r.nodeType === 8)
|
|
4207
|
-
if (r.data ===
|
|
4207
|
+
if (r.data === Zs)
|
|
4208
4208
|
c.push({ type: 2, index: n });
|
|
4209
4209
|
else {
|
|
4210
4210
|
let m = -1;
|
|
4211
|
-
for (; (m = r.data.indexOf(
|
|
4212
|
-
c.push({ type: 7, index: n }), m +=
|
|
4211
|
+
for (; (m = r.data.indexOf(pe, m + 1)) !== -1; )
|
|
4212
|
+
c.push({ type: 7, index: n }), m += pe.length - 1;
|
|
4213
4213
|
}
|
|
4214
4214
|
n++;
|
|
4215
4215
|
}
|
|
4216
4216
|
}
|
|
4217
4217
|
static createElement(e, t) {
|
|
4218
|
-
const i =
|
|
4218
|
+
const i = Ee.createElement("template");
|
|
4219
4219
|
return i.innerHTML = e, i;
|
|
4220
4220
|
}
|
|
4221
4221
|
}
|
|
4222
|
-
function
|
|
4222
|
+
function Ze(s, e, t = s, i) {
|
|
4223
4223
|
var a, o;
|
|
4224
|
-
if (e ===
|
|
4224
|
+
if (e === dt)
|
|
4225
4225
|
return e;
|
|
4226
4226
|
let r = i !== void 0 ? (a = t._$Co) == null ? void 0 : a[i] : t._$Cl;
|
|
4227
|
-
const n =
|
|
4228
|
-
return (r == null ? void 0 : r.constructor) !== n && ((o = r == null ? void 0 : r._$AO) == null || o.call(r, !1), n === void 0 ? r = void 0 : (r = new n(s), r._$AT(s, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = r : t._$Cl = r), r !== void 0 && (e =
|
|
4227
|
+
const n = ct(e) ? void 0 : e._$litDirective$;
|
|
4228
|
+
return (r == null ? void 0 : r.constructor) !== n && ((o = r == null ? void 0 : r._$AO) == null || o.call(r, !1), n === void 0 ? r = void 0 : (r = new n(s), r._$AT(s, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = r : t._$Cl = r), r !== void 0 && (e = Ze(s, r._$AS(s, e.values), r, i)), e;
|
|
4229
4229
|
}
|
|
4230
|
-
class
|
|
4230
|
+
class Vr {
|
|
4231
4231
|
constructor(e, t) {
|
|
4232
4232
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
4233
4233
|
}
|
|
@@ -4238,17 +4238,17 @@ class Ur {
|
|
|
4238
4238
|
return this._$AM._$AU;
|
|
4239
4239
|
}
|
|
4240
4240
|
u(e) {
|
|
4241
|
-
const { el: { content: t }, parts: i } = this._$AD, r = ((e == null ? void 0 : e.creationScope) ??
|
|
4242
|
-
|
|
4243
|
-
let n =
|
|
4241
|
+
const { el: { content: t }, parts: i } = this._$AD, r = ((e == null ? void 0 : e.creationScope) ?? Ee).importNode(t, !0);
|
|
4242
|
+
xe.currentNode = r;
|
|
4243
|
+
let n = xe.nextNode(), a = 0, o = 0, c = i[0];
|
|
4244
4244
|
for (; c !== void 0; ) {
|
|
4245
4245
|
if (a === c.index) {
|
|
4246
4246
|
let d;
|
|
4247
|
-
c.type === 2 ? d = new
|
|
4247
|
+
c.type === 2 ? d = new Nt(n, n.nextSibling, this, e) : c.type === 1 ? d = new c.ctor(n, c.name, c.strings, this, e) : c.type === 6 && (d = new Hr(n, this, e)), this._$AV.push(d), c = i[++o];
|
|
4248
4248
|
}
|
|
4249
|
-
a !== (c == null ? void 0 : c.index) && (n =
|
|
4249
|
+
a !== (c == null ? void 0 : c.index) && (n = xe.nextNode(), a++);
|
|
4250
4250
|
}
|
|
4251
|
-
return
|
|
4251
|
+
return xe.currentNode = Ee, r;
|
|
4252
4252
|
}
|
|
4253
4253
|
p(e) {
|
|
4254
4254
|
let t = 0;
|
|
@@ -4256,7 +4256,7 @@ class Ur {
|
|
|
4256
4256
|
i !== void 0 && (i.strings !== void 0 ? (i._$AI(e, i, t), t += i.strings.length - 2) : i._$AI(e[t])), t++;
|
|
4257
4257
|
}
|
|
4258
4258
|
}
|
|
4259
|
-
class
|
|
4259
|
+
class Nt {
|
|
4260
4260
|
get _$AU() {
|
|
4261
4261
|
var e;
|
|
4262
4262
|
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
@@ -4276,7 +4276,7 @@ class Ot {
|
|
|
4276
4276
|
return this._$AB;
|
|
4277
4277
|
}
|
|
4278
4278
|
_$AI(e, t = this) {
|
|
4279
|
-
e =
|
|
4279
|
+
e = Ze(this, e, t), ct(e) ? e === N || e == null || e === "" ? (this._$AH !== N && this._$AR(), this._$AH = N) : e !== this._$AH && e !== dt && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ur(e) ? this.k(e) : this._(e);
|
|
4280
4280
|
}
|
|
4281
4281
|
O(e) {
|
|
4282
4282
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -4285,28 +4285,28 @@ class Ot {
|
|
|
4285
4285
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
4286
4286
|
}
|
|
4287
4287
|
_(e) {
|
|
4288
|
-
this._$AH !== N &&
|
|
4288
|
+
this._$AH !== N && ct(this._$AH) ? this._$AA.nextSibling.data = e : this.T(Ee.createTextNode(e)), this._$AH = e;
|
|
4289
4289
|
}
|
|
4290
4290
|
$(e) {
|
|
4291
4291
|
var n;
|
|
4292
|
-
const { values: t, _$litType$: i } = e, r = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el =
|
|
4292
|
+
const { values: t, _$litType$: i } = e, r = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = lt.createElement(Ds(i.h, i.h[0]), this.options)), i);
|
|
4293
4293
|
if (((n = this._$AH) == null ? void 0 : n._$AD) === r)
|
|
4294
4294
|
this._$AH.p(t);
|
|
4295
4295
|
else {
|
|
4296
|
-
const a = new
|
|
4296
|
+
const a = new Vr(r, this), o = a.u(this.options);
|
|
4297
4297
|
a.p(t), this.T(o), this._$AH = a;
|
|
4298
4298
|
}
|
|
4299
4299
|
}
|
|
4300
4300
|
_$AC(e) {
|
|
4301
|
-
let t =
|
|
4302
|
-
return t === void 0 &&
|
|
4301
|
+
let t = vs.get(e.strings);
|
|
4302
|
+
return t === void 0 && vs.set(e.strings, t = new lt(e)), t;
|
|
4303
4303
|
}
|
|
4304
4304
|
k(e) {
|
|
4305
|
-
|
|
4305
|
+
Qt(this._$AH) || (this._$AH = [], this._$AR());
|
|
4306
4306
|
const t = this._$AH;
|
|
4307
4307
|
let i, r = 0;
|
|
4308
4308
|
for (const n of e)
|
|
4309
|
-
r === t.length ? t.push(i = new
|
|
4309
|
+
r === t.length ? t.push(i = new Nt(this.O(Ct()), this.O(Ct()), this, this.options)) : i = t[r], i._$AI(n), r++;
|
|
4310
4310
|
r < t.length && (this._$AR(i && i._$AB.nextSibling, r), t.length = r);
|
|
4311
4311
|
}
|
|
4312
4312
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
@@ -4321,7 +4321,7 @@ class Ot {
|
|
|
4321
4321
|
this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
|
|
4322
4322
|
}
|
|
4323
4323
|
}
|
|
4324
|
-
class
|
|
4324
|
+
class It {
|
|
4325
4325
|
get tagName() {
|
|
4326
4326
|
return this.element.tagName;
|
|
4327
4327
|
}
|
|
@@ -4335,12 +4335,12 @@ class Rt {
|
|
|
4335
4335
|
const n = this.strings;
|
|
4336
4336
|
let a = !1;
|
|
4337
4337
|
if (n === void 0)
|
|
4338
|
-
e =
|
|
4338
|
+
e = Ze(this, e, t, 0), a = !ct(e) || e !== this._$AH && e !== dt, a && (this._$AH = e);
|
|
4339
4339
|
else {
|
|
4340
4340
|
const o = e;
|
|
4341
4341
|
let c, d;
|
|
4342
4342
|
for (e = n[0], c = 0; c < n.length - 1; c++)
|
|
4343
|
-
d =
|
|
4343
|
+
d = Ze(this, o[i + c], t, c), d === dt && (d = this._$AH[c]), a || (a = !ct(d) || d !== this._$AH[c]), d === N ? e = N : e !== N && (e += (d ?? "") + n[c + 1]), this._$AH[c] = d;
|
|
4344
4344
|
}
|
|
4345
4345
|
a && !r && this.j(e);
|
|
4346
4346
|
}
|
|
@@ -4348,7 +4348,7 @@ class Rt {
|
|
|
4348
4348
|
e === N ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
4349
4349
|
}
|
|
4350
4350
|
}
|
|
4351
|
-
class
|
|
4351
|
+
class Br extends It {
|
|
4352
4352
|
constructor() {
|
|
4353
4353
|
super(...arguments), this.type = 3;
|
|
4354
4354
|
}
|
|
@@ -4356,7 +4356,7 @@ class Lr extends Rt {
|
|
|
4356
4356
|
this.element[this.name] = e === N ? void 0 : e;
|
|
4357
4357
|
}
|
|
4358
4358
|
}
|
|
4359
|
-
class
|
|
4359
|
+
class Wr extends It {
|
|
4360
4360
|
constructor() {
|
|
4361
4361
|
super(...arguments), this.type = 4;
|
|
4362
4362
|
}
|
|
@@ -4364,12 +4364,12 @@ class zr extends Rt {
|
|
|
4364
4364
|
this.element.toggleAttribute(this.name, !!e && e !== N);
|
|
4365
4365
|
}
|
|
4366
4366
|
}
|
|
4367
|
-
class
|
|
4367
|
+
class Fr extends It {
|
|
4368
4368
|
constructor(e, t, i, r, n) {
|
|
4369
4369
|
super(e, t, i, r, n), this.type = 5;
|
|
4370
4370
|
}
|
|
4371
4371
|
_$AI(e, t = this) {
|
|
4372
|
-
if ((e =
|
|
4372
|
+
if ((e = Ze(this, e, t, 0) ?? N) === dt)
|
|
4373
4373
|
return;
|
|
4374
4374
|
const i = this._$AH, r = e === N && i !== N || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, n = e !== N && (i === N || r);
|
|
4375
4375
|
r && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
@@ -4379,7 +4379,7 @@ class Vr extends Rt {
|
|
|
4379
4379
|
typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
|
|
4380
4380
|
}
|
|
4381
4381
|
}
|
|
4382
|
-
class
|
|
4382
|
+
class Hr {
|
|
4383
4383
|
constructor(e, t, i) {
|
|
4384
4384
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = i;
|
|
4385
4385
|
}
|
|
@@ -4387,24 +4387,24 @@ class Br {
|
|
|
4387
4387
|
return this._$AM._$AU;
|
|
4388
4388
|
}
|
|
4389
4389
|
_$AI(e) {
|
|
4390
|
-
|
|
4390
|
+
Ze(this, e);
|
|
4391
4391
|
}
|
|
4392
4392
|
}
|
|
4393
|
-
const
|
|
4394
|
-
|
|
4393
|
+
const Lt = Fe.litHtmlPolyfillSupport;
|
|
4394
|
+
Lt == null || Lt(lt, Nt), (Fe.litHtmlVersions ?? (Fe.litHtmlVersions = [])).push("3.3.0");
|
|
4395
4395
|
/**
|
|
4396
4396
|
* @license
|
|
4397
4397
|
* Copyright 2020 Google LLC
|
|
4398
4398
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
4399
4399
|
*/
|
|
4400
|
-
const
|
|
4400
|
+
const Kr = (s) => s.strings === void 0;
|
|
4401
4401
|
/**
|
|
4402
4402
|
* @license
|
|
4403
4403
|
* Copyright 2017 Google LLC
|
|
4404
4404
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
4405
4405
|
*/
|
|
4406
|
-
const
|
|
4407
|
-
class
|
|
4406
|
+
const qr = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, Gr = (s) => (...e) => ({ _$litDirective$: s, values: e });
|
|
4407
|
+
class Yr {
|
|
4408
4408
|
constructor(e) {
|
|
4409
4409
|
}
|
|
4410
4410
|
get _$AU() {
|
|
@@ -4433,54 +4433,54 @@ const He = (s, e) => {
|
|
|
4433
4433
|
for (const r of t)
|
|
4434
4434
|
(i = r._$AO) == null || i.call(r, e, !1), He(r, e);
|
|
4435
4435
|
return !0;
|
|
4436
|
-
},
|
|
4436
|
+
}, Tt = (s) => {
|
|
4437
4437
|
let e, t;
|
|
4438
4438
|
do {
|
|
4439
4439
|
if ((e = s._$AM) === void 0)
|
|
4440
4440
|
break;
|
|
4441
4441
|
t = e._$AN, t.delete(s), s = e;
|
|
4442
4442
|
} while ((t == null ? void 0 : t.size) === 0);
|
|
4443
|
-
},
|
|
4443
|
+
}, Ls = (s) => {
|
|
4444
4444
|
for (let e; e = s._$AM; s = e) {
|
|
4445
4445
|
let t = e._$AN;
|
|
4446
4446
|
if (t === void 0)
|
|
4447
4447
|
e._$AN = t = /* @__PURE__ */ new Set();
|
|
4448
4448
|
else if (t.has(s))
|
|
4449
4449
|
break;
|
|
4450
|
-
t.add(s),
|
|
4450
|
+
t.add(s), Qr(e);
|
|
4451
4451
|
}
|
|
4452
4452
|
};
|
|
4453
|
-
function
|
|
4454
|
-
this._$AN !== void 0 ? (
|
|
4453
|
+
function Jr(s) {
|
|
4454
|
+
this._$AN !== void 0 ? (Tt(this), this._$AM = s, Ls(this)) : this._$AM = s;
|
|
4455
4455
|
}
|
|
4456
|
-
function
|
|
4456
|
+
function Xr(s, e = !1, t = 0) {
|
|
4457
4457
|
const i = this._$AH, r = this._$AN;
|
|
4458
4458
|
if (r !== void 0 && r.size !== 0)
|
|
4459
4459
|
if (e)
|
|
4460
4460
|
if (Array.isArray(i))
|
|
4461
4461
|
for (let n = t; n < i.length; n++)
|
|
4462
|
-
He(i[n], !1),
|
|
4462
|
+
He(i[n], !1), Tt(i[n]);
|
|
4463
4463
|
else
|
|
4464
|
-
i != null && (He(i, !1),
|
|
4464
|
+
i != null && (He(i, !1), Tt(i));
|
|
4465
4465
|
else
|
|
4466
4466
|
He(this, s);
|
|
4467
4467
|
}
|
|
4468
|
-
const
|
|
4469
|
-
s.type ==
|
|
4468
|
+
const Qr = (s) => {
|
|
4469
|
+
s.type == qr.CHILD && (s._$AP ?? (s._$AP = Xr), s._$AQ ?? (s._$AQ = Jr));
|
|
4470
4470
|
};
|
|
4471
|
-
class
|
|
4471
|
+
class en extends Yr {
|
|
4472
4472
|
constructor() {
|
|
4473
4473
|
super(...arguments), this._$AN = void 0;
|
|
4474
4474
|
}
|
|
4475
4475
|
_$AT(e, t, i) {
|
|
4476
|
-
super._$AT(e, t, i),
|
|
4476
|
+
super._$AT(e, t, i), Ls(this), this.isConnected = e._$AU;
|
|
4477
4477
|
}
|
|
4478
4478
|
_$AO(e, t = !0) {
|
|
4479
4479
|
var i, r;
|
|
4480
|
-
e !== this.isConnected && (this.isConnected = e, e ? (i = this.reconnected) == null || i.call(this) : (r = this.disconnected) == null || r.call(this)), t && (He(this, e),
|
|
4480
|
+
e !== this.isConnected && (this.isConnected = e, e ? (i = this.reconnected) == null || i.call(this) : (r = this.disconnected) == null || r.call(this)), t && (He(this, e), Tt(this));
|
|
4481
4481
|
}
|
|
4482
4482
|
setValue(e) {
|
|
4483
|
-
if (
|
|
4483
|
+
if (Kr(this._$Ct))
|
|
4484
4484
|
this._$Ct._$AI(e, this);
|
|
4485
4485
|
else {
|
|
4486
4486
|
const t = [...this._$Ct._$AH];
|
|
@@ -4497,10 +4497,10 @@ class Jr extends Kr {
|
|
|
4497
4497
|
* Copyright 2020 Google LLC
|
|
4498
4498
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
4499
4499
|
*/
|
|
4500
|
-
const
|
|
4501
|
-
class
|
|
4500
|
+
const tn = () => new sn();
|
|
4501
|
+
class sn {
|
|
4502
4502
|
}
|
|
4503
|
-
const
|
|
4503
|
+
const Ut = /* @__PURE__ */ new WeakMap(), rn = Gr(class extends en {
|
|
4504
4504
|
render(s) {
|
|
4505
4505
|
return N;
|
|
4506
4506
|
}
|
|
@@ -4512,14 +4512,14 @@ const Dt = /* @__PURE__ */ new WeakMap(), en = Wr(class extends Jr {
|
|
|
4512
4512
|
rt(s) {
|
|
4513
4513
|
if (this.isConnected || (s = void 0), typeof this.G == "function") {
|
|
4514
4514
|
const e = this.ht ?? globalThis;
|
|
4515
|
-
let t =
|
|
4516
|
-
t === void 0 && (t = /* @__PURE__ */ new WeakMap(),
|
|
4515
|
+
let t = Ut.get(e);
|
|
4516
|
+
t === void 0 && (t = /* @__PURE__ */ new WeakMap(), Ut.set(e, t)), t.get(this.G) !== void 0 && this.G.call(this.ht, void 0), t.set(this.G, s), s !== void 0 && this.G.call(this.ht, s);
|
|
4517
4517
|
} else
|
|
4518
4518
|
this.G.value = s;
|
|
4519
4519
|
}
|
|
4520
4520
|
get lt() {
|
|
4521
4521
|
var s, e;
|
|
4522
|
-
return typeof this.G == "function" ? (s =
|
|
4522
|
+
return typeof this.G == "function" ? (s = Ut.get(this.ht ?? globalThis)) == null ? void 0 : s.get(this.G) : (e = this.G) == null ? void 0 : e.value;
|
|
4523
4523
|
}
|
|
4524
4524
|
disconnected() {
|
|
4525
4525
|
this.lt === this.ct && this.rt(void 0);
|
|
@@ -4528,14 +4528,14 @@ const Dt = /* @__PURE__ */ new WeakMap(), en = Wr(class extends Jr {
|
|
|
4528
4528
|
this.rt(this.ct);
|
|
4529
4529
|
}
|
|
4530
4530
|
});
|
|
4531
|
-
var
|
|
4532
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
4531
|
+
var nn = Object.defineProperty, an = Object.getOwnPropertyDescriptor, Us = (s, e, t, i) => {
|
|
4532
|
+
for (var r = i > 1 ? void 0 : i ? an(e, t) : e, n = s.length - 1, a; n >= 0; n--)
|
|
4533
4533
|
(a = s[n]) && (r = (i ? a(e, t, r) : a(r)) || r);
|
|
4534
|
-
return i && r &&
|
|
4534
|
+
return i && r && nn(e, t, r), r;
|
|
4535
4535
|
};
|
|
4536
|
-
class
|
|
4536
|
+
class Pt extends re {
|
|
4537
4537
|
constructor() {
|
|
4538
|
-
super(...arguments), this.volume = { speaker: "ASSISTANT", volume: 0, spectrum: [] }, this.canvasRef =
|
|
4538
|
+
super(...arguments), this.volume = { speaker: "ASSISTANT", volume: 0, spectrum: [] }, this.canvasRef = tn(), this.barCount = 8, this.animationFrame = null;
|
|
4539
4539
|
}
|
|
4540
4540
|
connectedCallback() {
|
|
4541
4541
|
super.connectedCallback(), this.startAnimation();
|
|
@@ -4569,28 +4569,28 @@ class Nt extends ie {
|
|
|
4569
4569
|
const $ = u.length, O = Math.ceil($ / 10);
|
|
4570
4570
|
let k = [];
|
|
4571
4571
|
for (let C = 0; C < 10; C++) {
|
|
4572
|
-
const H = C * O,
|
|
4573
|
-
let
|
|
4574
|
-
for (let
|
|
4575
|
-
|
|
4576
|
-
k.push({ region: C, startIdx: H, endIdx:
|
|
4572
|
+
const H = C * O, oe = Math.min((C + 1) * O, $);
|
|
4573
|
+
let ft = 0;
|
|
4574
|
+
for (let Mt = H; Mt < oe; Mt++)
|
|
4575
|
+
ft += u[Mt] || 0;
|
|
4576
|
+
k.push({ region: C, startIdx: H, endIdx: oe, energy: ft });
|
|
4577
4577
|
}
|
|
4578
4578
|
k.sort((C, H) => H.energy - C.energy);
|
|
4579
|
-
const R = k.slice(0, 3), D = Math.min(...R.map((C) => C.startIdx)),
|
|
4580
|
-
if (
|
|
4579
|
+
const R = k.slice(0, 3), D = Math.min(...R.map((C) => C.startIdx)), ts = Math.max(...R.map((C) => C.endIdx));
|
|
4580
|
+
if (ts > D)
|
|
4581
4581
|
for (let C = 0; C < this.barCount; C++) {
|
|
4582
|
-
const H = D + C / (this.barCount - 1) * (
|
|
4583
|
-
m[C] = u[
|
|
4582
|
+
const H = D + C / (this.barCount - 1) * (ts - D), oe = Math.min($ - 1, Math.floor(H));
|
|
4583
|
+
m[C] = u[oe] || 0;
|
|
4584
4584
|
}
|
|
4585
4585
|
else
|
|
4586
4586
|
for (let C = 0; C < this.barCount; C++) {
|
|
4587
|
-
const H = C / (this.barCount - 1) * ($ / 2),
|
|
4588
|
-
m[C] = u[
|
|
4587
|
+
const H = C / (this.barCount - 1) * ($ / 2), oe = Math.min($ - 1, Math.floor(H));
|
|
4588
|
+
m[C] = u[oe] || 0;
|
|
4589
4589
|
}
|
|
4590
|
-
const
|
|
4590
|
+
const Vs = Math.max(...m, 1), Bs = this.volume.speaker === "USER" ? 0.7 : 0.6;
|
|
4591
4591
|
m = m.map((C, H) => {
|
|
4592
|
-
const
|
|
4593
|
-
return Math.min(1,
|
|
4592
|
+
const oe = C / Vs, ft = Bs + H / (this.barCount - 1) * 0.3;
|
|
4593
|
+
return Math.min(1, oe * ft);
|
|
4594
4594
|
});
|
|
4595
4595
|
} else if (this.volume.speaker !== "USER")
|
|
4596
4596
|
for (let $ = 0; $ < this.barCount; $++) {
|
|
@@ -4625,10 +4625,10 @@ class Nt extends ie {
|
|
|
4625
4625
|
}
|
|
4626
4626
|
}
|
|
4627
4627
|
render() {
|
|
4628
|
-
return E` <canvas ${
|
|
4628
|
+
return E` <canvas ${rn(this.canvasRef)} width="52" height="52"></canvas> `;
|
|
4629
4629
|
}
|
|
4630
4630
|
}
|
|
4631
|
-
|
|
4631
|
+
Pt.styles = ie`
|
|
4632
4632
|
:host {
|
|
4633
4633
|
display: block;
|
|
4634
4634
|
width: 40px;
|
|
@@ -4641,19 +4641,19 @@ Nt.styles = se`
|
|
|
4641
4641
|
height: 100%;
|
|
4642
4642
|
}
|
|
4643
4643
|
`;
|
|
4644
|
-
|
|
4644
|
+
Us([
|
|
4645
4645
|
x({ type: Object })
|
|
4646
|
-
],
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
],
|
|
4650
|
-
customElements.get("obi-audio-equalizer") || customElements.define("obi-audio-equalizer",
|
|
4651
|
-
var
|
|
4652
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
4646
|
+
], Pt.prototype, "volume", 2);
|
|
4647
|
+
Us([
|
|
4648
|
+
_e()
|
|
4649
|
+
], Pt.prototype, "canvasRef", 2);
|
|
4650
|
+
customElements.get("obi-audio-equalizer") || customElements.define("obi-audio-equalizer", Pt);
|
|
4651
|
+
var on = Object.defineProperty, cn = Object.getOwnPropertyDescriptor, dn = (s, e, t, i) => {
|
|
4652
|
+
for (var r = i > 1 ? void 0 : i ? cn(e, t) : e, n = s.length - 1, a; n >= 0; n--)
|
|
4653
4653
|
(a = s[n]) && (r = (i ? a(e, t, r) : a(r)) || r);
|
|
4654
|
-
return i && r &&
|
|
4654
|
+
return i && r && on(e, t, r), r;
|
|
4655
4655
|
};
|
|
4656
|
-
class
|
|
4656
|
+
class es extends re {
|
|
4657
4657
|
constructor() {
|
|
4658
4658
|
super(...arguments), this.activeDots = Array(5).fill(!1), this.numDots = 5, this.containerWidth = 32, this.dotSize = 2, this.bounceHeight = 12, this.animationDuration = 200, this.pauseDuration = 300, this.overlapFactor = 0.7, this.color = "#FFF", this.timeoutIds = [];
|
|
4659
4659
|
}
|
|
@@ -4704,7 +4704,7 @@ class Xt extends ie {
|
|
|
4704
4704
|
`;
|
|
4705
4705
|
}
|
|
4706
4706
|
}
|
|
4707
|
-
|
|
4707
|
+
es.styles = ie`
|
|
4708
4708
|
:host {
|
|
4709
4709
|
display: block;
|
|
4710
4710
|
}
|
|
@@ -4732,11 +4732,11 @@ Xt.styles = se`
|
|
|
4732
4732
|
opacity: 1;
|
|
4733
4733
|
}
|
|
4734
4734
|
`;
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
],
|
|
4738
|
-
customElements.get("obi-dot-loader") || customElements.define("obi-dot-loader",
|
|
4739
|
-
class
|
|
4735
|
+
dn([
|
|
4736
|
+
_e()
|
|
4737
|
+
], es.prototype, "activeDots", 2);
|
|
4738
|
+
customElements.get("obi-dot-loader") || customElements.define("obi-dot-loader", es);
|
|
4739
|
+
class zs extends re {
|
|
4740
4740
|
render() {
|
|
4741
4741
|
return E`
|
|
4742
4742
|
<obi-dot-loader loading style="margin-left: 2px"></obi-dot-loader>
|
|
@@ -4744,7 +4744,7 @@ class Ds extends ie {
|
|
|
4744
4744
|
`;
|
|
4745
4745
|
}
|
|
4746
4746
|
}
|
|
4747
|
-
|
|
4747
|
+
zs.styles = ie`
|
|
4748
4748
|
:host {
|
|
4749
4749
|
display: flex;
|
|
4750
4750
|
align-items: center;
|
|
@@ -4760,15 +4760,15 @@ Ds.styles = se`
|
|
|
4760
4760
|
font-size: 14px;
|
|
4761
4761
|
}
|
|
4762
4762
|
`;
|
|
4763
|
-
customElements.get("obi-searching-loader") || customElements.define("obi-searching-loader",
|
|
4764
|
-
var
|
|
4765
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
4763
|
+
customElements.get("obi-searching-loader") || customElements.define("obi-searching-loader", zs);
|
|
4764
|
+
var ln = Object.defineProperty, un = Object.getOwnPropertyDescriptor, X = (s, e, t, i) => {
|
|
4765
|
+
for (var r = i > 1 ? void 0 : i ? un(e, t) : e, n = s.length - 1, a; n >= 0; n--)
|
|
4766
4766
|
(a = s[n]) && (r = (i ? a(e, t, r) : a(r)) || r);
|
|
4767
|
-
return i && r &&
|
|
4767
|
+
return i && r && ln(e, t, r), r;
|
|
4768
4768
|
};
|
|
4769
|
-
class z extends
|
|
4769
|
+
class z extends re {
|
|
4770
4770
|
constructor() {
|
|
4771
|
-
super(), this.apiBaseUrl =
|
|
4771
|
+
super(), this.apiBaseUrl = Ps, this.apiKey = "", this.position = "bottom-right", this.user = null, this.state = A.READY, this.showCourseModal = !1, this.isHovering = !1, this.navVisible = !1, this.activeSession = null, this.volume = {
|
|
4772
4772
|
speaker: "ASSISTANT",
|
|
4773
4773
|
volume: 0,
|
|
4774
4774
|
spectrum: []
|
|
@@ -4795,7 +4795,7 @@ class z extends ie {
|
|
|
4795
4795
|
this.showCourseModal = !0;
|
|
4796
4796
|
return;
|
|
4797
4797
|
}
|
|
4798
|
-
|
|
4798
|
+
os([e, t]).with(["pause", !0], () => {
|
|
4799
4799
|
var i;
|
|
4800
4800
|
(i = this.activeSession) == null || i.pauseRecording();
|
|
4801
4801
|
}).with(["pause", !1], () => {
|
|
@@ -4810,7 +4810,7 @@ class z extends ie {
|
|
|
4810
4810
|
async handleSessionStart(e) {
|
|
4811
4811
|
this.showCourseModal = !1, this.state = A.LOADING;
|
|
4812
4812
|
try {
|
|
4813
|
-
const { ObiSession: t } = await import("./session-
|
|
4813
|
+
const { ObiSession: t } = await import("./session-c2549ff3.js"), i = new t({ token: e, apiBaseUrl: this.apiBaseUrl });
|
|
4814
4814
|
i.on("stateChanged", (r) => {
|
|
4815
4815
|
this.state = r.newState;
|
|
4816
4816
|
}), i.on("volume", (r) => {
|
|
@@ -4823,10 +4823,10 @@ class z extends ie {
|
|
|
4823
4823
|
}
|
|
4824
4824
|
}
|
|
4825
4825
|
render() {
|
|
4826
|
-
const e =
|
|
4827
|
-
|
|
4826
|
+
const e = os(this.state).with(A.LOADING, () => E`<obi-dot-loader></obi-dot-loader>`).with(A.RESEARCHING, () => E`<obi-searching-loader></obi-searching-loader>`).with(
|
|
4827
|
+
pi.union(A.USER_SPEAKING, A.AGENT_SPEAKING),
|
|
4828
4828
|
() => E`<obi-audio-equalizer .volume=${this.volume}></obi-audio-equalizer>`
|
|
4829
|
-
).with(A.PAUSED, () =>
|
|
4829
|
+
).with(A.PAUSED, () => us).otherwise(() => us);
|
|
4830
4830
|
return E`
|
|
4831
4831
|
<div
|
|
4832
4832
|
class="widget-container ${this.state === A.USER_SPEAKING || this.state === A.AGENT_SPEAKING ? "pulse" : ""} ${this.state !== A.READY || this.navVisible ? "rounded" : ""} ${this.state === A.RESEARCHING ? "researching" : ""} ${this.state === A.USER_SPEAKING ? "user-speaking" : ""}"
|
|
@@ -4842,18 +4842,18 @@ class z extends ie {
|
|
|
4842
4842
|
.currentState=${this.state}
|
|
4843
4843
|
.onItemSelect=${this.handleItemSelect.bind(this)}
|
|
4844
4844
|
></obi-navigation-bar>
|
|
4845
|
-
` :
|
|
4845
|
+
` : ss}
|
|
4846
4846
|
</div>
|
|
4847
4847
|
${this.showCourseModal ? E`<obi-course-modal
|
|
4848
4848
|
.onClose=${() => this.showCourseModal = !1}
|
|
4849
4849
|
.onCourseSelect=${this.handleSessionStart.bind(this)}
|
|
4850
4850
|
.apiBaseUrl=${this.apiBaseUrl}
|
|
4851
4851
|
.apiKey=${this.apiKey}
|
|
4852
|
-
></obi-course-modal>` :
|
|
4852
|
+
></obi-course-modal>` : ss}
|
|
4853
4853
|
`;
|
|
4854
4854
|
}
|
|
4855
4855
|
}
|
|
4856
|
-
z.styles =
|
|
4856
|
+
z.styles = ie`
|
|
4857
4857
|
:host {
|
|
4858
4858
|
display: block;
|
|
4859
4859
|
position: fixed;
|
|
@@ -4953,38 +4953,38 @@ z.styles = se`
|
|
|
4953
4953
|
animation: pulse-shadow 2s ease-in-out infinite;
|
|
4954
4954
|
}
|
|
4955
4955
|
`;
|
|
4956
|
-
|
|
4956
|
+
X([
|
|
4957
4957
|
x({ type: String })
|
|
4958
4958
|
], z.prototype, "apiBaseUrl", 2);
|
|
4959
|
-
|
|
4959
|
+
X([
|
|
4960
4960
|
x({ type: String })
|
|
4961
4961
|
], z.prototype, "apiKey", 2);
|
|
4962
|
-
|
|
4962
|
+
X([
|
|
4963
4963
|
x({ type: String })
|
|
4964
4964
|
], z.prototype, "position", 2);
|
|
4965
|
-
|
|
4965
|
+
X([
|
|
4966
4966
|
x({ type: Object })
|
|
4967
4967
|
], z.prototype, "user", 2);
|
|
4968
|
-
|
|
4969
|
-
|
|
4968
|
+
X([
|
|
4969
|
+
_e()
|
|
4970
4970
|
], z.prototype, "state", 2);
|
|
4971
|
-
|
|
4972
|
-
|
|
4971
|
+
X([
|
|
4972
|
+
_e()
|
|
4973
4973
|
], z.prototype, "showCourseModal", 2);
|
|
4974
|
-
|
|
4975
|
-
|
|
4974
|
+
X([
|
|
4975
|
+
_e()
|
|
4976
4976
|
], z.prototype, "isHovering", 2);
|
|
4977
|
-
|
|
4978
|
-
|
|
4977
|
+
X([
|
|
4978
|
+
_e()
|
|
4979
4979
|
], z.prototype, "navVisible", 2);
|
|
4980
|
-
|
|
4981
|
-
|
|
4980
|
+
X([
|
|
4981
|
+
_e()
|
|
4982
4982
|
], z.prototype, "activeSession", 2);
|
|
4983
|
-
|
|
4984
|
-
|
|
4983
|
+
X([
|
|
4984
|
+
_e()
|
|
4985
4985
|
], z.prototype, "volume", 2);
|
|
4986
4986
|
customElements.get("obi-widget") || customElements.define("obi-widget", z);
|
|
4987
|
-
function
|
|
4987
|
+
function hn(s) {
|
|
4988
4988
|
return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
|
|
4989
4989
|
var i = s.get(e);
|
|
4990
4990
|
i ? i.push(t) : s.set(e, [t]);
|
|
@@ -5000,13 +5000,13 @@ function dn(s) {
|
|
|
5000
5000
|
});
|
|
5001
5001
|
} };
|
|
5002
5002
|
}
|
|
5003
|
-
class
|
|
5003
|
+
class bn {
|
|
5004
5004
|
constructor(e = {}) {
|
|
5005
|
-
this.state = A.READY, this.emitter =
|
|
5005
|
+
this.state = A.READY, this.emitter = hn(), this.voiceEnabled = !1, this.screenCaptureEnabled = !1, this.config = Sr.parse(e), this.config.debug && console.log("ObiSDK initialized with config:", this.config);
|
|
5006
5006
|
}
|
|
5007
5007
|
async init() {
|
|
5008
5008
|
try {
|
|
5009
|
-
this.config.enableVoice && await this.initVoice(), this.config.enableScreenCapture && await this.initScreenCapture(), this.setState(A.READY), this.emitter.emit(
|
|
5009
|
+
this.config.enableVoice && await this.initVoice(), this.config.enableScreenCapture && await this.initScreenCapture(), this.setState(A.READY), this.emitter.emit(he.READY), this.config.debug && console.log("ObiSDK ready");
|
|
5010
5010
|
} catch (e) {
|
|
5011
5011
|
const t = {
|
|
5012
5012
|
code: "init_failed",
|
|
@@ -5034,13 +5034,13 @@ class yn {
|
|
|
5034
5034
|
* Set the SDK state and emit state change event
|
|
5035
5035
|
*/
|
|
5036
5036
|
setState(e) {
|
|
5037
|
-
this.state = e, this.emitter.emit(
|
|
5037
|
+
this.state = e, this.emitter.emit(he.STATE_CHANGE, e);
|
|
5038
5038
|
}
|
|
5039
5039
|
/**
|
|
5040
5040
|
* Handle SDK errors
|
|
5041
5041
|
*/
|
|
5042
5042
|
handleError(e) {
|
|
5043
|
-
this.setState(A.ERROR), this.emitter.emit(
|
|
5043
|
+
this.setState(A.ERROR), this.emitter.emit(he.ERROR, e), this.config.debug && console.error("ObiSDK error:", e);
|
|
5044
5044
|
}
|
|
5045
5045
|
/**
|
|
5046
5046
|
* Start voice recording
|
|
@@ -5054,7 +5054,7 @@ class yn {
|
|
|
5054
5054
|
return;
|
|
5055
5055
|
}
|
|
5056
5056
|
try {
|
|
5057
|
-
this.setState(A.AGENT_SPEAKING), this.emitter.emit(
|
|
5057
|
+
this.setState(A.AGENT_SPEAKING), this.emitter.emit(he.VOICE_START), this.config.debug && console.log("Voice recording started");
|
|
5058
5058
|
} catch (e) {
|
|
5059
5059
|
this.handleError({
|
|
5060
5060
|
code: "voice_start_failed",
|
|
@@ -5071,7 +5071,7 @@ class yn {
|
|
|
5071
5071
|
return { transcript: void 0 };
|
|
5072
5072
|
try {
|
|
5073
5073
|
const e = { transcript: "Sample transcript" };
|
|
5074
|
-
return this.setState(A.READY), this.emitter.emit(
|
|
5074
|
+
return this.setState(A.READY), this.emitter.emit(he.VOICE_STOP, e), this.config.debug && console.log("Voice recording stopped:", e), e;
|
|
5075
5075
|
} catch (e) {
|
|
5076
5076
|
return this.handleError({
|
|
5077
5077
|
code: "voice_stop_failed",
|
|
@@ -5092,7 +5092,7 @@ class yn {
|
|
|
5092
5092
|
return;
|
|
5093
5093
|
}
|
|
5094
5094
|
try {
|
|
5095
|
-
this.setState(A.AGENT_SPEAKING), this.emitter.emit(
|
|
5095
|
+
this.setState(A.AGENT_SPEAKING), this.emitter.emit(he.SCREEN_CAPTURE_START), this.config.debug && console.log("Screen capture started");
|
|
5096
5096
|
} catch (e) {
|
|
5097
5097
|
this.handleError({
|
|
5098
5098
|
code: "screen_capture_start_failed",
|
|
@@ -5109,7 +5109,7 @@ class yn {
|
|
|
5109
5109
|
return { screenshot: void 0 };
|
|
5110
5110
|
try {
|
|
5111
5111
|
const e = { screenshot: "data:image/png;base64,..." };
|
|
5112
|
-
return this.setState(A.READY), this.emitter.emit(
|
|
5112
|
+
return this.setState(A.READY), this.emitter.emit(he.SCREEN_CAPTURE_STOP, e), this.config.debug && console.log("Screen capture stopped"), e;
|
|
5113
5113
|
} catch (e) {
|
|
5114
5114
|
return this.handleError({
|
|
5115
5115
|
code: "screen_capture_stop_failed",
|
|
@@ -5143,81 +5143,123 @@ class yn {
|
|
|
5143
5143
|
this.emitter.all.clear(), this.config.debug && console.log("ObiSDK disposed");
|
|
5144
5144
|
}
|
|
5145
5145
|
}
|
|
5146
|
-
const
|
|
5146
|
+
const pn = () => {
|
|
5147
5147
|
customElements.get("obi-widget") || customElements.define("obi-widget", z);
|
|
5148
5148
|
};
|
|
5149
|
-
class
|
|
5149
|
+
class wn {
|
|
5150
5150
|
/**
|
|
5151
5151
|
* Initialize the Obi Widget with the provided configuration
|
|
5152
5152
|
* This creates and mounts the widget to the page
|
|
5153
5153
|
*/
|
|
5154
5154
|
static init(e) {
|
|
5155
|
-
|
|
5155
|
+
pn();
|
|
5156
5156
|
const t = document.createElement("obi-widget");
|
|
5157
5157
|
return e.apiKey && (t.apiKey = e.apiKey), e.position && (t.position = e.position), e.user && (t.user = e.user), window.obiWidgetConfig = e, document.body.appendChild(t), console.log("Obi Widget initialized and mounted"), t;
|
|
5158
5158
|
}
|
|
5159
5159
|
}
|
|
5160
|
-
const
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
}
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
e({
|
|
5181
|
-
ObiAssistant: window.ObiAssistant,
|
|
5182
|
-
ObiSDK: window.ObiSDK,
|
|
5183
|
-
createSession: (n = window.ObiSDK) == null ? void 0 : n.createSession
|
|
5160
|
+
const fn = "https://registry.npmjs.org/obi-sdk/latest", ys = "https://unpkg.com/obi-sdk", V = window;
|
|
5161
|
+
V.__obiSDKLoading = V.__obiSDKLoading || !1;
|
|
5162
|
+
const xn = async (s) => (V.obiWidgetConfig = s, new Promise((e, t) => {
|
|
5163
|
+
if (V.ObiAssistant)
|
|
5164
|
+
try {
|
|
5165
|
+
const i = mt(s);
|
|
5166
|
+
e(i);
|
|
5167
|
+
return;
|
|
5168
|
+
} catch (i) {
|
|
5169
|
+
t(new Error(`Error creating widget: ${i}`));
|
|
5170
|
+
return;
|
|
5171
|
+
}
|
|
5172
|
+
if (V.__obiSDKLoading) {
|
|
5173
|
+
mn(() => {
|
|
5174
|
+
try {
|
|
5175
|
+
const i = mt(s);
|
|
5176
|
+
e(i);
|
|
5177
|
+
} catch (i) {
|
|
5178
|
+
t(new Error(`Error creating widget after waiting: ${i}`));
|
|
5179
|
+
}
|
|
5184
5180
|
});
|
|
5185
5181
|
return;
|
|
5186
5182
|
}
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5183
|
+
gn().then((i) => {
|
|
5184
|
+
_s(
|
|
5185
|
+
i,
|
|
5186
|
+
() => {
|
|
5187
|
+
V.__obiSDKLoading = !1;
|
|
5188
|
+
try {
|
|
5189
|
+
const r = mt(s);
|
|
5190
|
+
e(r);
|
|
5191
|
+
} catch (r) {
|
|
5192
|
+
t(new Error(`Error creating widget after loading SDK: ${r}`));
|
|
5193
|
+
}
|
|
5194
|
+
},
|
|
5195
|
+
t
|
|
5196
|
+
);
|
|
5197
|
+
}).catch(() => {
|
|
5198
|
+
_s(
|
|
5199
|
+
null,
|
|
5200
|
+
() => {
|
|
5201
|
+
V.__obiSDKLoading = !1;
|
|
5202
|
+
try {
|
|
5203
|
+
const i = mt(s);
|
|
5204
|
+
e(i);
|
|
5205
|
+
} catch (i) {
|
|
5206
|
+
t(new Error(`Error creating widget with latest version: ${i}`));
|
|
5207
|
+
}
|
|
5208
|
+
},
|
|
5209
|
+
t
|
|
5210
|
+
);
|
|
5211
|
+
});
|
|
5212
|
+
}));
|
|
5213
|
+
function mn(s) {
|
|
5214
|
+
const e = setInterval(() => {
|
|
5215
|
+
(typeof V.ObiAssistant == "function" || typeof V.ObiAssistant == "object") && (clearInterval(e), s());
|
|
5216
|
+
}, 100);
|
|
5217
|
+
}
|
|
5218
|
+
async function gn() {
|
|
5219
|
+
return new Promise((s) => {
|
|
5220
|
+
try {
|
|
5221
|
+
const e = new XMLHttpRequest();
|
|
5222
|
+
e.open("GET", fn), e.onload = () => {
|
|
5223
|
+
if (e.status === 200)
|
|
5224
|
+
try {
|
|
5225
|
+
const t = JSON.parse(e.responseText);
|
|
5226
|
+
s(t.version);
|
|
5227
|
+
} catch {
|
|
5228
|
+
s(null);
|
|
5229
|
+
}
|
|
5230
|
+
else
|
|
5231
|
+
s(null);
|
|
5232
|
+
}, e.onerror = () => s(null), e.send();
|
|
5233
|
+
} catch {
|
|
5234
|
+
s(null);
|
|
5235
|
+
}
|
|
5236
|
+
});
|
|
5237
|
+
}
|
|
5238
|
+
function _s(s, e, t) {
|
|
5239
|
+
V.__obiSDKLoading = !0;
|
|
5240
|
+
const i = document.createElement("script");
|
|
5241
|
+
i.type = "text/javascript", i.async = !0;
|
|
5242
|
+
const r = s || "latest";
|
|
5243
|
+
i.src = `${ys}@${r}/dist/obi-sdk.standalone.iife.js`, i.onload = e, i.onerror = () => {
|
|
5244
|
+
r !== "latest" ? (console.warn("Failed to load specific version, falling back to latest"), i.src = `${ys}@latest/dist/obi-sdk.standalone.iife.js`, i.onload = e) : (V.__obiSDKLoading = !1, t(new Error("Failed to load Obi SDK from CDN")));
|
|
5204
5245
|
}, document.head.appendChild(i);
|
|
5205
|
-
}
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
if (!
|
|
5211
|
-
throw new Error("Obi
|
|
5212
|
-
|
|
5213
|
-
|
|
5246
|
+
}
|
|
5247
|
+
function mt(s) {
|
|
5248
|
+
const e = document, t = e.querySelector("obi-widget");
|
|
5249
|
+
if (t)
|
|
5250
|
+
return console.log("Obi Widget already exists on the page"), t;
|
|
5251
|
+
if (!customElements.get("obi-widget"))
|
|
5252
|
+
throw new Error("Obi Widget component not registered - SDK may not have loaded properly");
|
|
5253
|
+
const i = e.createElement("obi-widget");
|
|
5254
|
+
return s.apiKey && i.setAttribute("api-key", s.apiKey), s.position && i.setAttribute("position", s.position), s.user && i.setAttribute("user", JSON.stringify(s.user)), e.body.appendChild(i), console.log("Obi Widget added to page"), i;
|
|
5255
|
+
}
|
|
5214
5256
|
export {
|
|
5215
|
-
|
|
5257
|
+
he as E,
|
|
5216
5258
|
z as O,
|
|
5217
5259
|
A as S,
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5260
|
+
bn as a,
|
|
5261
|
+
wn as b,
|
|
5262
|
+
xn as i,
|
|
5263
|
+
hn as m,
|
|
5264
|
+
os as z
|
|
5223
5265
|
};
|