@picked/client 0.0.1-dev.1787537193674 → 0.0.1-dev.1787788898336
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/api-9gq3GBPF.cjs +1 -0
- package/dist/api-DU4j3Qw0.js +22 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
- package/dist/cjs/plugins/telemetry/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/how-to/fill-and-publish-a-page.md +18 -2
- package/dist/docs/reference/dashboard/content/pages.mdx +25 -0
- package/dist/docs/reference/delivery-api/preview-caching-crawling.md +1 -1
- package/dist/docs/reference/sdk/features.md +7 -0
- package/dist/docs/reference/sdk/fields.md +30 -16
- package/dist/esm/index.js +266 -493
- package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
- package/dist/esm/plugins/responses-browser-storage/index.js +2 -2
- package/dist/esm/plugins/responses-indexeddb/index.js +1 -1
- package/dist/esm/plugins/telemetry/index.js +48 -45
- package/dist/esm/server/index.js +1 -1
- package/dist/{plugin-DTN7fsyp.js → plugin-CYXHEafF.js} +73 -52
- package/dist/plugin-rwzR9hVc.cjs +1 -0
- package/dist/provider-BWDd3oaq.js +94 -0
- package/dist/provider-lgLyP_0N.cjs +1 -0
- package/dist/types/data-source/api.d.ts.map +1 -1
- package/dist/types/data-source/provider.d.ts +3 -0
- package/dist/types/data-source/provider.d.ts.map +1 -1
- package/dist/types/data-source/request-observer.d.ts +24 -12
- package/dist/types/data-source/request-observer.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts +43 -2
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +6 -0
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/plugin/plugin.d.ts +4 -0
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/lifecycle/lifecycle.d.ts.map +1 -1
- package/dist/types/picked.d.ts +14 -6
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
- package/dist/types/plugins/telemetry/emit.d.ts +3 -3
- package/dist/types/plugins/telemetry/emit.d.ts.map +1 -1
- package/dist/types/plugins/telemetry/plugin.d.ts +16 -0
- package/dist/types/plugins/telemetry/plugin.d.ts.map +1 -1
- package/dist/types/utils/user-timing.d.ts +16 -13
- package/dist/types/utils/user-timing.d.ts.map +1 -1
- package/dist/version-BaI_1eQx.cjs +1 -0
- package/dist/version-DXDZM7eT.js +256 -0
- package/package.json +3 -3
- package/dist/api-4YpcWP-x.js +0 -33
- package/dist/api-DRTduQVm.cjs +0 -1
- package/dist/plugin-BPZV7SJg.cjs +0 -1
- package/dist/provider-BxhVIcsp.cjs +0 -1
- package/dist/provider-DLebj-AW.js +0 -69
- package/dist/request-observer-BXDfOU0V.cjs +0 -1
- package/dist/request-observer-DtG0cRfz.js +0 -19
- package/dist/version-BlahSDlG.cjs +0 -1
- package/dist/version-BmBn0dXR.js +0 -4
package/dist/esm/index.js
CHANGED
|
@@ -5,14 +5,14 @@ import { a as i, c as a, d as o, f as s, i as c, l, m as u, n as d, o as f, p, r
|
|
|
5
5
|
import { a as v, i as y, r as ee, s as b, t as x } from "../dom-BqcToNL0.js";
|
|
6
6
|
import { l as S, n as C, r as w, u as T } from "../experience-instance-DGk11d8a.js";
|
|
7
7
|
import { i as te, n as E, r as D, t as O } from "../storage-1MW3-_As.js";
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import { n as
|
|
11
|
-
import { attach as k, combine as A, createApi as j, createDomain as M, createEffect as N, createEvent as P, createStore as F, is as
|
|
8
|
+
import { i as ne, n as re, r as ie, t as ae } from "../version-DXDZM7eT.js";
|
|
9
|
+
import { t as oe } from "../id-Bo4RBeOs.js";
|
|
10
|
+
import { n as se, r as ce, t as le } from "../inert-script-report-B_bMPRzp.js";
|
|
11
|
+
import { attach as k, combine as A, createApi as j, createDomain as M, createEffect as N, createEvent as P, createStore as F, is as ue, sample as I } from "effector";
|
|
12
12
|
import { createFactory as L, invoke as R } from "@withease/factories";
|
|
13
|
-
import { sendPing as
|
|
13
|
+
import { sendPing as de } from "@picked/delivery-api-client";
|
|
14
14
|
//#region src/entities/experience/experience.ts
|
|
15
|
-
var z = M("experience"),
|
|
15
|
+
var z = M("experience"), fe = L(({ client: e, experience: r }) => {
|
|
16
16
|
let i = z.store(r), a = j(i, { merge(e, t) {
|
|
17
17
|
return {
|
|
18
18
|
...e,
|
|
@@ -99,17 +99,17 @@ var z = M("experience"), le = L(({ client: e, experience: r }) => {
|
|
|
99
99
|
prepareExperienceContentFx: m
|
|
100
100
|
}, u;
|
|
101
101
|
});
|
|
102
|
-
function
|
|
103
|
-
return R(
|
|
102
|
+
function pe(e) {
|
|
103
|
+
return R(fe, e);
|
|
104
104
|
}
|
|
105
|
-
var
|
|
105
|
+
var me = L(({ client: e }) => {
|
|
106
106
|
let t = z.store({}), n = j(t, { register(e, t) {
|
|
107
107
|
return {
|
|
108
108
|
...e,
|
|
109
109
|
[t.id]: t
|
|
110
110
|
};
|
|
111
111
|
} }), r = P(), i = N((t) => {
|
|
112
|
-
n.register(
|
|
112
|
+
n.register(pe({
|
|
113
113
|
client: e,
|
|
114
114
|
experience: t
|
|
115
115
|
}));
|
|
@@ -195,38 +195,35 @@ var de = L(({ client: e }) => {
|
|
|
195
195
|
})
|
|
196
196
|
};
|
|
197
197
|
});
|
|
198
|
-
function
|
|
199
|
-
return R(
|
|
198
|
+
function he(e) {
|
|
199
|
+
return R(me, e);
|
|
200
200
|
}
|
|
201
|
-
var
|
|
201
|
+
var ge = async (e) => {
|
|
202
202
|
await e.experiences.initialiseExperiencesFx();
|
|
203
203
|
};
|
|
204
204
|
//#endregion
|
|
205
205
|
//#region src/entities/plugin/plugin.ts
|
|
206
|
-
function
|
|
206
|
+
function _e(e) {
|
|
207
207
|
return N(async () => {
|
|
208
208
|
await e();
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
|
-
var
|
|
212
|
-
let r = t.name, i = t.setup(e);
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}, ge = M("component"), _e = L(({ client: e, component: t, name: n }) => ({
|
|
211
|
+
var ve = (e, t, n) => {
|
|
212
|
+
let r = t.name, i = t.setup(e), a = n[r] ?? {};
|
|
213
|
+
n[r] = Object.freeze({
|
|
214
|
+
...a,
|
|
215
|
+
...i
|
|
216
|
+
});
|
|
217
|
+
}, ye = M("component"), be = L(({ client: e, component: t, name: n }) => ({
|
|
221
218
|
name: n,
|
|
222
219
|
component: t,
|
|
223
220
|
frameworkStore: e.frameworks.getByName(t.frameworkName)
|
|
224
221
|
}));
|
|
225
|
-
function
|
|
226
|
-
return R(
|
|
222
|
+
function xe(e) {
|
|
223
|
+
return R(be, e);
|
|
227
224
|
}
|
|
228
|
-
var
|
|
229
|
-
let t =
|
|
225
|
+
var Se = L(({ client: e }) => {
|
|
226
|
+
let t = ye.store({}), n = j(t, { register(e, t) {
|
|
230
227
|
return {
|
|
231
228
|
...e,
|
|
232
229
|
[t.name]: t
|
|
@@ -239,7 +236,7 @@ var ye = L(({ client: e }) => {
|
|
|
239
236
|
fn: (e, { name: t }) => `Component '${t}' already registered. Registering again will override the previous registration.`
|
|
240
237
|
}).watch((e) => /* @__PURE__ */ r("warn", e)), I({
|
|
241
238
|
clock: i,
|
|
242
|
-
fn: ({ name: t, component: n }) =>
|
|
239
|
+
fn: ({ name: t, component: n }) => xe({
|
|
243
240
|
client: e,
|
|
244
241
|
name: t,
|
|
245
242
|
component: n
|
|
@@ -256,16 +253,16 @@ var ye = L(({ client: e }) => {
|
|
|
256
253
|
listStore: a
|
|
257
254
|
};
|
|
258
255
|
});
|
|
259
|
-
function
|
|
260
|
-
return R(
|
|
256
|
+
function Ce(e) {
|
|
257
|
+
return R(Se, e);
|
|
261
258
|
}
|
|
262
|
-
var
|
|
259
|
+
var we = (e, t, n) => {
|
|
263
260
|
n.register({
|
|
264
261
|
name: e,
|
|
265
262
|
component: t
|
|
266
263
|
});
|
|
267
|
-
},
|
|
268
|
-
let t =
|
|
264
|
+
}, Te = M("framework"), Ee = L((e) => {
|
|
265
|
+
let t = Te.store({}), n = j(t, { register(e, t) {
|
|
269
266
|
return {
|
|
270
267
|
...e,
|
|
271
268
|
[t.name]: t.framework
|
|
@@ -290,15 +287,15 @@ var xe = (e, t, n) => {
|
|
|
290
287
|
listStore: a
|
|
291
288
|
};
|
|
292
289
|
});
|
|
293
|
-
function
|
|
294
|
-
return R(
|
|
290
|
+
function De(e) {
|
|
291
|
+
return R(Ee, e);
|
|
295
292
|
}
|
|
296
|
-
var
|
|
293
|
+
var Oe = (e, t) => {
|
|
297
294
|
t.register({
|
|
298
295
|
name: e.name,
|
|
299
296
|
framework: e
|
|
300
297
|
});
|
|
301
|
-
},
|
|
298
|
+
}, ke = L(({ client: e }) => {
|
|
302
299
|
let t = "window" in globalThis, n = {
|
|
303
300
|
location: t ? globalThis.location : void 0,
|
|
304
301
|
document: t ? globalThis.document : void 0,
|
|
@@ -312,12 +309,12 @@ var Te = (e, t) => {
|
|
|
312
309
|
...n
|
|
313
310
|
}));
|
|
314
311
|
});
|
|
315
|
-
function
|
|
316
|
-
return R(
|
|
312
|
+
function Ae(e) {
|
|
313
|
+
return R(ke, e);
|
|
317
314
|
}
|
|
318
315
|
//#endregion
|
|
319
316
|
//#region src/logic-engine.ts
|
|
320
|
-
function
|
|
317
|
+
function je(e) {
|
|
321
318
|
return typeof e == "number" && !isNaN(e);
|
|
322
319
|
}
|
|
323
320
|
function B(e) {
|
|
@@ -326,21 +323,21 @@ function B(e) {
|
|
|
326
323
|
function V(e) {
|
|
327
324
|
return Array.isArray(e);
|
|
328
325
|
}
|
|
329
|
-
function
|
|
326
|
+
function Me(e) {
|
|
330
327
|
return e instanceof Promise;
|
|
331
328
|
}
|
|
332
|
-
function
|
|
329
|
+
function Ne(e) {
|
|
333
330
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.keys(e).length === 1;
|
|
334
331
|
}
|
|
335
332
|
function H(e) {
|
|
336
|
-
if (
|
|
333
|
+
if (je(e)) return e;
|
|
337
334
|
let t = parseFloat(`${e}`);
|
|
338
335
|
return isNaN(t) ? 0 : t;
|
|
339
336
|
}
|
|
340
337
|
function U(e) {
|
|
341
338
|
return `${e}`;
|
|
342
339
|
}
|
|
343
|
-
var
|
|
340
|
+
var Pe = {
|
|
344
341
|
"==": (e, t) => e == t,
|
|
345
342
|
"===": (e, t) => e === t,
|
|
346
343
|
"!=": (e, t) => e != t,
|
|
@@ -435,10 +432,10 @@ var je = {
|
|
|
435
432
|
};
|
|
436
433
|
async function W(e, t) {
|
|
437
434
|
if (!e) return e;
|
|
438
|
-
if (
|
|
435
|
+
if (Me(e)) return W(await e, t);
|
|
439
436
|
if (V(e)) return Promise.all(e.map((e) => W(e, t)));
|
|
440
|
-
if (!
|
|
441
|
-
let n =
|
|
437
|
+
if (!Ne(e)) return e;
|
|
438
|
+
let n = Fe(e), r = n ? e[n] ?? [] : [];
|
|
442
439
|
switch (V(r) || (r = [r]), n) {
|
|
443
440
|
case "if":
|
|
444
441
|
case "?:":
|
|
@@ -496,32 +493,32 @@ async function W(e, t) {
|
|
|
496
493
|
case "catch": try {
|
|
497
494
|
return await W(r[0], t);
|
|
498
495
|
} catch (e) {
|
|
499
|
-
return
|
|
496
|
+
return Ne(e) ? await W(e, t) : r[1] ? await W(r[1], e) : e instanceof Error ? e.message : e;
|
|
500
497
|
}
|
|
501
498
|
}
|
|
502
|
-
let i = await Promise.all(r.map((e) => W(e, t))), a = n ?
|
|
499
|
+
let i = await Promise.all(r.map((e) => W(e, t))), a = n ? Pe[n] : void 0;
|
|
503
500
|
if (!a) throw Error(`Unrecognized operation ${n}`);
|
|
504
501
|
return a.apply(t, i);
|
|
505
502
|
}
|
|
506
503
|
async function G(e) {
|
|
507
|
-
return
|
|
504
|
+
return Me(e) ? G(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
|
|
508
505
|
}
|
|
509
|
-
function
|
|
506
|
+
function Fe(e) {
|
|
510
507
|
return Object.keys(e)[0];
|
|
511
508
|
}
|
|
512
509
|
//#endregion
|
|
513
510
|
//#region src/lifecycle/rules-logic.ts
|
|
514
|
-
function
|
|
511
|
+
function Ie(e, t, n) {
|
|
515
512
|
return new Proxy(Object.create(null), { get(r, i) {
|
|
516
513
|
if (typeof i != "string") return;
|
|
517
514
|
let a = e.find((e) => e.key === i);
|
|
518
515
|
if (a !== void 0) return async () => !n.has(i) && await W(a.logic, {
|
|
519
516
|
...t,
|
|
520
|
-
conditions:
|
|
517
|
+
conditions: Ie(e, t, new Set(n).add(i))
|
|
521
518
|
}) === !0;
|
|
522
519
|
} });
|
|
523
520
|
}
|
|
524
|
-
var
|
|
521
|
+
var Le = L(({ client: e }) => k({
|
|
525
522
|
source: {
|
|
526
523
|
stateSnapshot: e.stateSnapshotStore,
|
|
527
524
|
predicates: e.predicates.listStore,
|
|
@@ -560,22 +557,22 @@ var Pe = L(({ client: e }) => k({
|
|
|
560
557
|
};
|
|
561
558
|
return await W(o, {
|
|
562
559
|
...d,
|
|
563
|
-
conditions:
|
|
560
|
+
conditions: Ie(a, d, /* @__PURE__ */ new Set())
|
|
564
561
|
});
|
|
565
562
|
}
|
|
566
563
|
}));
|
|
567
|
-
function
|
|
568
|
-
return R(
|
|
564
|
+
function Re(e) {
|
|
565
|
+
return R(Le, e);
|
|
569
566
|
}
|
|
570
567
|
//#endregion
|
|
571
568
|
//#region src/ping.ts
|
|
572
|
-
var
|
|
569
|
+
var ze = 6e3, Be = O("last_ping", "global"), Ve = async (e) => {
|
|
573
570
|
try {
|
|
574
|
-
let t = Date.now(), n = E.get(
|
|
575
|
-
if (n.isSet() && (r = n.json() ?? 0), r && t - r <
|
|
571
|
+
let t = Date.now(), n = E.get(Be), r = 0;
|
|
572
|
+
if (n.isSet() && (r = n.json() ?? 0), r && t - r < ze) return !0;
|
|
576
573
|
let i = {}, a = document.getElementById("picked_script")?.dataset.verceltoken;
|
|
577
574
|
a && (i["x-vercel-protection-bypass"] = a);
|
|
578
|
-
let o = await
|
|
575
|
+
let o = await de(e.apiUrl, {
|
|
579
576
|
projectId: e.projectId,
|
|
580
577
|
path: window.location.pathname
|
|
581
578
|
}, { headers: i });
|
|
@@ -583,27 +580,7 @@ var Ie = 6e3, Le = O("last_ping", "global"), Re = async (e) => {
|
|
|
583
580
|
} catch {
|
|
584
581
|
return !1;
|
|
585
582
|
}
|
|
586
|
-
},
|
|
587
|
-
function Ve() {
|
|
588
|
-
try {
|
|
589
|
-
return s() && !!p.window && "performance" in p;
|
|
590
|
-
} catch {
|
|
591
|
-
return !1;
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
function He() {
|
|
595
|
-
if (Ve()) try {
|
|
596
|
-
performance.mark(ze);
|
|
597
|
-
} catch {}
|
|
598
|
-
}
|
|
599
|
-
function Ue() {
|
|
600
|
-
if (Ve()) try {
|
|
601
|
-
performance.measure(Be, ze);
|
|
602
|
-
} catch {}
|
|
603
|
-
}
|
|
604
|
-
//#endregion
|
|
605
|
-
//#region src/lifecycle/lifecycle.ts
|
|
606
|
-
var K = M("lifecycle"), We = L(({ client: e }) => {
|
|
583
|
+
}, K = M("lifecycle"), He = L(({ client: e }) => {
|
|
607
584
|
let t = K.store(!1), r = F(void 0, {
|
|
608
585
|
skipVoid: !1,
|
|
609
586
|
domain: K
|
|
@@ -619,11 +596,11 @@ var K = M("lifecycle"), We = L(({ client: e }) => {
|
|
|
619
596
|
}), u = P(), d = P(), f = P(), p = P(), m = P(), h = P();
|
|
620
597
|
o.on(p, (e, t) => [...e, t]), s.on(m, (e, t) => t), l.on(h, (e, t) => t), t.on(d, () => !0);
|
|
621
598
|
let g = N(() => {
|
|
622
|
-
|
|
599
|
+
Ve(e);
|
|
623
600
|
}), _ = N(async () => {
|
|
624
601
|
await ee();
|
|
625
602
|
}), v = N(async () => {
|
|
626
|
-
await
|
|
603
|
+
await ge(e);
|
|
627
604
|
}), y = k({ effect: v }), b = k({
|
|
628
605
|
source: o,
|
|
629
606
|
effect: async (e) => {
|
|
@@ -645,7 +622,7 @@ var K = M("lifecycle"), We = L(({ client: e }) => {
|
|
|
645
622
|
clock: C,
|
|
646
623
|
fn: () => "starting",
|
|
647
624
|
target: a
|
|
648
|
-
}), C.watch(
|
|
625
|
+
}), C.watch(e.performance.markBegin), d.watch(e.performance.measure), I({
|
|
649
626
|
clock: C,
|
|
650
627
|
target: g
|
|
651
628
|
}), I({
|
|
@@ -752,13 +729,13 @@ var K = M("lifecycle"), We = L(({ client: e }) => {
|
|
|
752
729
|
setCondition: h
|
|
753
730
|
};
|
|
754
731
|
});
|
|
755
|
-
function
|
|
756
|
-
return R(
|
|
732
|
+
function Ue(e) {
|
|
733
|
+
return R(He, e);
|
|
757
734
|
}
|
|
758
735
|
//#endregion
|
|
759
736
|
//#region src/entities/predicate/predicate.ts
|
|
760
|
-
var
|
|
761
|
-
let t =
|
|
737
|
+
var We = M("predicate"), Ge = L(({ client: e }) => {
|
|
738
|
+
let t = We.store({}), n = j(t, { register(e, t) {
|
|
762
739
|
return {
|
|
763
740
|
...e,
|
|
764
741
|
[t.name]: {
|
|
@@ -816,261 +793,26 @@ var Ke = M("predicate"), qe = L(({ client: e }) => {
|
|
|
816
793
|
getEvokablePredicate: s
|
|
817
794
|
};
|
|
818
795
|
});
|
|
819
|
-
function
|
|
820
|
-
return R(
|
|
796
|
+
function Ke(e) {
|
|
797
|
+
return R(Ge, e);
|
|
821
798
|
}
|
|
822
|
-
var
|
|
799
|
+
var qe = (e, t, n) => {
|
|
823
800
|
n.register({
|
|
824
801
|
name: e,
|
|
825
802
|
predicate: t
|
|
826
803
|
});
|
|
827
|
-
},
|
|
828
|
-
function
|
|
829
|
-
return e?.enabled === !1;
|
|
830
|
-
}
|
|
831
|
-
function Ze(e) {
|
|
832
|
-
return e === "true" || e !== "false" && e;
|
|
833
|
-
}
|
|
834
|
-
var Qe = L(({ client: e }) => {
|
|
835
|
-
let t = Xe.store({}), n = Xe.store([]), i = j(t, { register(e, t) {
|
|
836
|
-
return {
|
|
837
|
-
...e,
|
|
838
|
-
[t.id]: t.feature
|
|
839
|
-
};
|
|
840
|
-
} }), a = P();
|
|
841
|
-
I({
|
|
842
|
-
clock: a,
|
|
843
|
-
source: t,
|
|
844
|
-
filter: (e, { id: t }) => e[t] !== void 0,
|
|
845
|
-
fn: (e, { id: t }) => `Feature '${t}' already registered. Registering again will override the previous registration.`
|
|
846
|
-
}).watch((e) => /* @__PURE__ */ r("warn", e)), I({
|
|
847
|
-
clock: a,
|
|
848
|
-
fn: ({ id: e, feature: t }) => Object.freeze({
|
|
849
|
-
id: e,
|
|
850
|
-
feature: {
|
|
851
|
-
id: e,
|
|
852
|
-
feature: {
|
|
853
|
-
...t,
|
|
854
|
-
id: e
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
}),
|
|
858
|
-
target: i.register
|
|
859
|
-
});
|
|
860
|
-
let o = N(async ({ id: e, key: t, storage: n = "local", enabled: r }) => {
|
|
861
|
-
if (r === !1) return null;
|
|
862
|
-
let i = O(`feature:${e}:${t}`, "global"), a = (n === "session" ? D : E).get(i).text();
|
|
863
|
-
return a ? {
|
|
864
|
-
id: e,
|
|
865
|
-
key: t,
|
|
866
|
-
bucket: Ze(a),
|
|
867
|
-
storage: n
|
|
868
|
-
} : null;
|
|
869
|
-
}), s = N((e) => {
|
|
870
|
-
if (!e) return null;
|
|
871
|
-
let t = O(`feature:${e.id}:${e.key}`, "global");
|
|
872
|
-
(e.storage === "session" ? D : E).set(t, e.bucket);
|
|
873
|
-
}), c = /* @__PURE__ */ new Map(), l = k({
|
|
874
|
-
source: {
|
|
875
|
-
allFeaturesStore: t,
|
|
876
|
-
resolvedFeaturesStore: n
|
|
877
|
-
},
|
|
878
|
-
effect: async ({ allFeaturesStore: e, resolvedFeaturesStore: t }, { id: n, decide: r, key: i }) => {
|
|
879
|
-
let a = t.find((e) => e.id === n && e.key === i);
|
|
880
|
-
if (a) return a;
|
|
881
|
-
let o = e[n];
|
|
882
|
-
if (!o) throw Error(`Feature with id '${n}' not found`);
|
|
883
|
-
if (q(o.feature)) return {
|
|
884
|
-
id: o.id,
|
|
885
|
-
bucket: !1,
|
|
886
|
-
key: i,
|
|
887
|
-
storage: o.feature.storage
|
|
888
|
-
};
|
|
889
|
-
let s = c.get(`${n}:${i}`);
|
|
890
|
-
if (s !== void 0) {
|
|
891
|
-
let e = await s;
|
|
892
|
-
return {
|
|
893
|
-
id: o.id,
|
|
894
|
-
bucket: e,
|
|
895
|
-
key: i,
|
|
896
|
-
storage: o.feature.storage
|
|
897
|
-
};
|
|
898
|
-
}
|
|
899
|
-
let l = r();
|
|
900
|
-
c.set(`${n}:${i}`, l);
|
|
901
|
-
let u = await l;
|
|
902
|
-
return {
|
|
903
|
-
id: o.id,
|
|
904
|
-
bucket: u,
|
|
905
|
-
key: i,
|
|
906
|
-
storage: o.feature.storage
|
|
907
|
-
};
|
|
908
|
-
}
|
|
909
|
-
});
|
|
910
|
-
I({
|
|
911
|
-
clock: i.register,
|
|
912
|
-
fn: (e) => {
|
|
913
|
-
let { id: t, feature: n } = e;
|
|
914
|
-
return {
|
|
915
|
-
id: t,
|
|
916
|
-
key: n.feature.key,
|
|
917
|
-
storage: n.feature.storage,
|
|
918
|
-
enabled: n.feature.enabled
|
|
919
|
-
};
|
|
920
|
-
},
|
|
921
|
-
target: o
|
|
922
|
-
}), I({
|
|
923
|
-
source: t,
|
|
924
|
-
clock: l.doneData,
|
|
925
|
-
filter: (e, t) => !q(e[t.id]?.feature),
|
|
926
|
-
fn: (e, t) => {
|
|
927
|
-
let { id: n, bucket: r, storage: i } = t, a = e[n]?.feature.key;
|
|
928
|
-
return a ? {
|
|
929
|
-
key: a,
|
|
930
|
-
id: n,
|
|
931
|
-
bucket: r,
|
|
932
|
-
storage: i
|
|
933
|
-
} : null;
|
|
934
|
-
},
|
|
935
|
-
target: s
|
|
936
|
-
});
|
|
937
|
-
let u = A({
|
|
938
|
-
allFeaturesStore: t,
|
|
939
|
-
resolvedFeaturesStore: n
|
|
940
|
-
}).map(({ allFeaturesStore: e, resolvedFeaturesStore: t }) => Object.values(e).map((e) => {
|
|
941
|
-
let n = t.find((t) => t.id === e.id && t.key === e.feature.key);
|
|
942
|
-
return n ? {
|
|
943
|
-
id: e.id,
|
|
944
|
-
name: e.feature.name,
|
|
945
|
-
key: e.feature.key,
|
|
946
|
-
enabled: e.feature.enabled,
|
|
947
|
-
weight: e.feature.weight,
|
|
948
|
-
getBucket: () => ({
|
|
949
|
-
id: e.id,
|
|
950
|
-
bucket: n.bucket
|
|
951
|
-
}),
|
|
952
|
-
isResolved: !0
|
|
953
|
-
} : {
|
|
954
|
-
id: e.id,
|
|
955
|
-
name: e.feature.name,
|
|
956
|
-
key: e.feature.key,
|
|
957
|
-
enabled: e.feature.enabled,
|
|
958
|
-
weight: e.feature.weight,
|
|
959
|
-
getBucket: async () => await l(e.feature),
|
|
960
|
-
isResolved: !1
|
|
961
|
-
};
|
|
962
|
-
}));
|
|
963
|
-
I({
|
|
964
|
-
clock: l.doneData,
|
|
965
|
-
source: {
|
|
966
|
-
resolvedFeatures: n,
|
|
967
|
-
allFeatures: t
|
|
968
|
-
},
|
|
969
|
-
filter: ({ resolvedFeatures: e, allFeatures: t }, { id: n, key: r }) => !q(t[n]?.feature) && !e.some((e) => e.id === n && e.key === r),
|
|
970
|
-
fn: (e, t) => t,
|
|
971
|
-
target: e.eventBus.prepend((e) => ({
|
|
972
|
-
type: "feature_decide",
|
|
973
|
-
feature: e
|
|
974
|
-
}))
|
|
975
|
-
}), I({
|
|
976
|
-
clock: [o.doneData, l.doneData],
|
|
977
|
-
source: {
|
|
978
|
-
resolvedFeatures: n,
|
|
979
|
-
allFeatures: t
|
|
980
|
-
},
|
|
981
|
-
fn: ({ resolvedFeatures: e, allFeatures: t }, n) => !n || q(t[n.id]?.feature) || e.some((e) => e.id === n.id && e.key === n.key) ? e : [...e, n],
|
|
982
|
-
target: n
|
|
983
|
-
});
|
|
984
|
-
function d(e) {
|
|
985
|
-
return u.map((t) => t.find((t) => t.id === e));
|
|
986
|
-
}
|
|
987
|
-
let f = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
988
|
-
function h(e) {
|
|
989
|
-
let t = f.get(e);
|
|
990
|
-
if (t) return t;
|
|
991
|
-
let n = d(e);
|
|
992
|
-
return f.set(e, n), n;
|
|
993
|
-
}
|
|
994
|
-
function g(e) {
|
|
995
|
-
return t.map((t) => t[e], { skipVoid: !1 });
|
|
996
|
-
}
|
|
997
|
-
function _(e) {
|
|
998
|
-
let t = F(async () => void 0, { skipVoid: !1 }), n = h(e), r = k({
|
|
999
|
-
source: n,
|
|
1000
|
-
effect: async (e) => {
|
|
1001
|
-
if (e) return async () => (await e.getBucket()).bucket;
|
|
1002
|
-
}
|
|
1003
|
-
});
|
|
1004
|
-
return I({
|
|
1005
|
-
clock: n,
|
|
1006
|
-
target: r
|
|
1007
|
-
}), I({
|
|
1008
|
-
clock: r.doneData,
|
|
1009
|
-
filter: (e) => e !== void 0,
|
|
1010
|
-
target: t
|
|
1011
|
-
}), r(), t;
|
|
1012
|
-
}
|
|
1013
|
-
function v(e) {
|
|
1014
|
-
let t = p.get(e);
|
|
1015
|
-
if (t) return t;
|
|
1016
|
-
let n = _(e);
|
|
1017
|
-
return p.set(e, n), n;
|
|
1018
|
-
}
|
|
1019
|
-
function y(e) {
|
|
1020
|
-
let t = v(e), n = F(void 0, { skipVoid: !1 }), r = k({
|
|
1021
|
-
source: t,
|
|
1022
|
-
mapParams: (e, t) => t,
|
|
1023
|
-
effect: N(async (e) => await e())
|
|
1024
|
-
});
|
|
1025
|
-
return I({
|
|
1026
|
-
clock: r.doneData,
|
|
1027
|
-
fn: (t) => {
|
|
1028
|
-
if (t !== void 0) return {
|
|
1029
|
-
id: e,
|
|
1030
|
-
bucket: t
|
|
1031
|
-
};
|
|
1032
|
-
},
|
|
1033
|
-
target: n
|
|
1034
|
-
}), I({
|
|
1035
|
-
clock: t,
|
|
1036
|
-
target: r
|
|
1037
|
-
}), r(), n;
|
|
1038
|
-
}
|
|
1039
|
-
function ee(e) {
|
|
1040
|
-
let t = m.get(e);
|
|
1041
|
-
if (t) return t;
|
|
1042
|
-
let n = y(e);
|
|
1043
|
-
return m.set(e, n), n;
|
|
1044
|
-
}
|
|
1045
|
-
return {
|
|
1046
|
-
register: a,
|
|
1047
|
-
getById: h,
|
|
1048
|
-
getByName: g,
|
|
1049
|
-
listStore: u,
|
|
1050
|
-
getEvokableFeature: v,
|
|
1051
|
-
getFeatureResult: ee
|
|
1052
|
-
};
|
|
1053
|
-
});
|
|
1054
|
-
function $e(e) {
|
|
1055
|
-
return R(Qe, e);
|
|
1056
|
-
}
|
|
1057
|
-
var et = (e, t, n) => {
|
|
1058
|
-
n.register({
|
|
1059
|
-
id: e,
|
|
1060
|
-
feature: t
|
|
1061
|
-
});
|
|
1062
|
-
}, J = M("history");
|
|
1063
|
-
function tt(e, t) {
|
|
804
|
+
}, q = M("history");
|
|
805
|
+
function Je(e, t) {
|
|
1064
806
|
return {
|
|
1065
|
-
id:
|
|
807
|
+
id: oe(`history-entry-${Date.now()}-${Math.random()}}`),
|
|
1066
808
|
node: t,
|
|
1067
809
|
at: Date.now(),
|
|
1068
810
|
experienceId: e
|
|
1069
811
|
};
|
|
1070
812
|
}
|
|
1071
|
-
var
|
|
1072
|
-
let e =
|
|
1073
|
-
e.on(t, (e, t) => ({ entries: [...e.entries,
|
|
813
|
+
var Ye = L(() => {
|
|
814
|
+
let e = q.store({ entries: [] }), t = q.event(), n = q.event(), r = q.event(), i = q.event();
|
|
815
|
+
e.on(t, (e, t) => ({ entries: [...e.entries, Je(t.experienceId, t.node)] })), e.on(n, (e, t) => ({ entries: [...e.entries.slice(0, -1), Je(t.experienceId, t.node)] })), e.on(i, (e, t) => t);
|
|
1074
816
|
function a(e, t) {
|
|
1075
817
|
let n = {
|
|
1076
818
|
lastStepIndex: -1,
|
|
@@ -1100,20 +842,20 @@ var nt = L(() => {
|
|
|
1100
842
|
entriesStore: e.map((e) => e.entries)
|
|
1101
843
|
};
|
|
1102
844
|
});
|
|
1103
|
-
function
|
|
1104
|
-
return R(
|
|
845
|
+
function Xe() {
|
|
846
|
+
return R(Ye);
|
|
1105
847
|
}
|
|
1106
848
|
//#endregion
|
|
1107
849
|
//#region src/utils/events.ts
|
|
1108
|
-
var
|
|
850
|
+
var Ze = 0, Qe = (e) => {
|
|
1109
851
|
let t = F([]);
|
|
1110
852
|
return t.on(e, (e, t) => [...e, {
|
|
1111
|
-
id:
|
|
853
|
+
id: Ze++,
|
|
1112
854
|
at: /* @__PURE__ */ new Date(),
|
|
1113
855
|
payload: t
|
|
1114
856
|
}]), t;
|
|
1115
|
-
},
|
|
1116
|
-
let e =
|
|
857
|
+
}, $e = M("field"), et = L(() => {
|
|
858
|
+
let e = $e.store({}), t = j(e, {
|
|
1117
859
|
register(e, t) {
|
|
1118
860
|
return {
|
|
1119
861
|
...e,
|
|
@@ -1161,13 +903,13 @@ var it = 0, at = (e) => {
|
|
|
1161
903
|
getByName: c
|
|
1162
904
|
};
|
|
1163
905
|
});
|
|
1164
|
-
function
|
|
1165
|
-
return R(
|
|
906
|
+
function tt() {
|
|
907
|
+
return R(et);
|
|
1166
908
|
}
|
|
1167
909
|
//#endregion
|
|
1168
910
|
//#region src/entities/step/step.ts
|
|
1169
|
-
var
|
|
1170
|
-
let e =
|
|
911
|
+
var nt = M("step"), rt = L(() => {
|
|
912
|
+
let e = nt.store({}), t = j(e, { register(e, t) {
|
|
1171
913
|
return {
|
|
1172
914
|
...e,
|
|
1173
915
|
[t.step.id]: t.step
|
|
@@ -1191,16 +933,16 @@ var lt = M("step"), ut = L(() => {
|
|
|
1191
933
|
indexStore: e
|
|
1192
934
|
};
|
|
1193
935
|
});
|
|
1194
|
-
function
|
|
1195
|
-
return R(
|
|
936
|
+
function it() {
|
|
937
|
+
return R(rt);
|
|
1196
938
|
}
|
|
1197
|
-
function
|
|
939
|
+
function at(e, t) {
|
|
1198
940
|
t.register(e);
|
|
1199
941
|
}
|
|
1200
942
|
//#endregion
|
|
1201
943
|
//#region src/entities/content/content.ts
|
|
1202
|
-
var
|
|
1203
|
-
let e =
|
|
944
|
+
var ot = M("content"), st = L(() => {
|
|
945
|
+
let e = ot.store({}), t = j(e, {
|
|
1204
946
|
register(e, t) {
|
|
1205
947
|
return {
|
|
1206
948
|
...e,
|
|
@@ -1241,16 +983,16 @@ var pt = M("content"), mt = L(() => {
|
|
|
1241
983
|
indexStore: e
|
|
1242
984
|
};
|
|
1243
985
|
});
|
|
1244
|
-
function
|
|
1245
|
-
return R(
|
|
986
|
+
function ct() {
|
|
987
|
+
return R(st);
|
|
1246
988
|
}
|
|
1247
|
-
function
|
|
989
|
+
function lt(e, t) {
|
|
1248
990
|
t.register(e);
|
|
1249
991
|
}
|
|
1250
992
|
//#endregion
|
|
1251
993
|
//#region src/entities/action/action.ts
|
|
1252
|
-
var
|
|
1253
|
-
let t =
|
|
994
|
+
var ut = M("action"), dt = L(({ client: e }) => {
|
|
995
|
+
let t = ut.store({}), n = j(t, { register(e, t) {
|
|
1254
996
|
return {
|
|
1255
997
|
...e,
|
|
1256
998
|
[t.key]: {
|
|
@@ -1308,10 +1050,10 @@ var _t = M("action"), vt = L(({ client: e }) => {
|
|
|
1308
1050
|
getEvokableAction: s
|
|
1309
1051
|
};
|
|
1310
1052
|
});
|
|
1311
|
-
function
|
|
1312
|
-
return R(
|
|
1053
|
+
function ft(e) {
|
|
1054
|
+
return R(dt, e);
|
|
1313
1055
|
}
|
|
1314
|
-
var
|
|
1056
|
+
var pt = (e, t, n) => {
|
|
1315
1057
|
n.register({
|
|
1316
1058
|
key: e,
|
|
1317
1059
|
action: t
|
|
@@ -1319,7 +1061,7 @@ var bt = (e, t, n) => {
|
|
|
1319
1061
|
};
|
|
1320
1062
|
//#endregion
|
|
1321
1063
|
//#region src/entities/response/response-validation.ts
|
|
1322
|
-
function
|
|
1064
|
+
function J(e, t, n, r) {
|
|
1323
1065
|
return {
|
|
1324
1066
|
fieldKey: e.key,
|
|
1325
1067
|
userMessage: n,
|
|
@@ -1327,62 +1069,62 @@ function Y(e, t, n, r) {
|
|
|
1327
1069
|
value: t
|
|
1328
1070
|
};
|
|
1329
1071
|
}
|
|
1330
|
-
function
|
|
1072
|
+
function Y(e) {
|
|
1331
1073
|
return e === null || e === "" || Array.isArray(e) && !e.length;
|
|
1332
1074
|
}
|
|
1333
|
-
function
|
|
1075
|
+
function mt(e) {
|
|
1334
1076
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
|
|
1335
1077
|
}
|
|
1336
|
-
function
|
|
1078
|
+
function ht(e) {
|
|
1337
1079
|
try {
|
|
1338
1080
|
return JSON.stringify(e), !0;
|
|
1339
1081
|
} catch {
|
|
1340
1082
|
return !1;
|
|
1341
1083
|
}
|
|
1342
1084
|
}
|
|
1343
|
-
function
|
|
1085
|
+
function gt(e, t) {
|
|
1344
1086
|
return t.find((t) => t.key === e) ?? null;
|
|
1345
1087
|
}
|
|
1346
|
-
function
|
|
1088
|
+
function _t(e, t) {
|
|
1347
1089
|
return e.multiple && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") ? [t] : t;
|
|
1348
1090
|
}
|
|
1349
|
-
function
|
|
1350
|
-
if (e.type !== "object" ||
|
|
1091
|
+
function vt(e, t) {
|
|
1092
|
+
if (e.type !== "object" || Y(t)) return null;
|
|
1351
1093
|
if (e.multiple) {
|
|
1352
|
-
if (!Array.isArray(t)) return
|
|
1094
|
+
if (!Array.isArray(t)) return J(e, t, "This field expects multiple values", "Field expects an array of objects.");
|
|
1353
1095
|
for (let n of t) {
|
|
1354
|
-
if (typeof n != "object" || !n) return
|
|
1355
|
-
if (!
|
|
1096
|
+
if (typeof n != "object" || !n) return J(e, t, "This field expects object values", "Field expects an array of objects, but received non-object value.");
|
|
1097
|
+
if (!ht(n)) return J(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
|
|
1356
1098
|
}
|
|
1357
1099
|
return null;
|
|
1358
1100
|
}
|
|
1359
|
-
return Array.isArray(t) ?
|
|
1101
|
+
return Array.isArray(t) ? J(e, t, "This field expects a single value", "Field expects a single object, not an array.") : typeof t != "object" || !t ? J(e, t, "This field expects an object value", "Field expects an object value.") : ht(t) ? null : J(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
|
|
1360
1102
|
}
|
|
1361
|
-
function
|
|
1362
|
-
if (
|
|
1103
|
+
function yt(e, t) {
|
|
1104
|
+
if (Y(t) || !Array.isArray(e.options) || e.options.length === 0) return null;
|
|
1363
1105
|
let n = Array.isArray(t) ? t : [t];
|
|
1364
1106
|
if (e.type === "object") {
|
|
1365
1107
|
let r = new Set(e.options.map((e) => JSON.stringify(e.value)));
|
|
1366
|
-
return n.every((e) => r.has(JSON.stringify(e))) ? null :
|
|
1108
|
+
return n.every((e) => r.has(JSON.stringify(e))) ? null : J(e, t, "This field expects a valid option", "Field expects a valid option from the defined choices.");
|
|
1367
1109
|
}
|
|
1368
1110
|
let r = e.options.map((e) => e.value);
|
|
1369
|
-
return n.every((e) => !
|
|
1111
|
+
return n.every((e) => !mt(e) || e === null ? !1 : r.includes(e)) ? null : J(e, t, "This field expects a valid option", `Field expects a valid option. Valid options are: ${r.join(", ")}`);
|
|
1370
1112
|
}
|
|
1371
|
-
async function
|
|
1372
|
-
if (n.validation && !e(n.validation) && !
|
|
1113
|
+
async function bt(t, n, r, i) {
|
|
1114
|
+
if (n.validation && !e(n.validation) && !Y(r)) {
|
|
1373
1115
|
let e = i ? {
|
|
1374
1116
|
$input: r,
|
|
1375
1117
|
responses: i
|
|
1376
1118
|
} : { $input: r }, a = await t(n.validation, e);
|
|
1377
|
-
if (typeof a == "string") return
|
|
1378
|
-
if (a === !1) return
|
|
1119
|
+
if (typeof a == "string") return J(n, r, a, `Field validation resulted in an error: ${a}.`);
|
|
1120
|
+
if (a === !1) return J(n, r, "This field is invalid", "Field validation resulted in an unspecified error.");
|
|
1379
1121
|
}
|
|
1380
|
-
return n.required &&
|
|
1122
|
+
return n.required && Y(r) ? J(n, r, "This field is required", "Field is required.") : !n.multiple && Array.isArray(r) && r.length > 1 ? J(n, r, "This field expects a single response", "Field expects a single response.") : null;
|
|
1381
1123
|
}
|
|
1382
1124
|
//#endregion
|
|
1383
1125
|
//#region src/entities/response/response.ts
|
|
1384
|
-
var
|
|
1385
|
-
let t =
|
|
1126
|
+
var xt = M("response"), St = L(({ client: e }) => {
|
|
1127
|
+
let t = xt.store({}), r = P(), i = P(), a = j(t, {
|
|
1386
1128
|
register(e, t) {
|
|
1387
1129
|
return {
|
|
1388
1130
|
...e,
|
|
@@ -1421,7 +1163,7 @@ var Ot = M("response"), kt = L(({ client: e }) => {
|
|
|
1421
1163
|
...t,
|
|
1422
1164
|
...n
|
|
1423
1165
|
}, o = Object.entries(n), c = await Promise.allSettled(o.map(async ([t, n]) => {
|
|
1424
|
-
let o =
|
|
1166
|
+
let o = gt(t, e);
|
|
1425
1167
|
if (!o) {
|
|
1426
1168
|
r.push({
|
|
1427
1169
|
fieldKey: t,
|
|
@@ -1431,17 +1173,17 @@ var Ot = M("response"), kt = L(({ client: e }) => {
|
|
|
1431
1173
|
});
|
|
1432
1174
|
return;
|
|
1433
1175
|
}
|
|
1434
|
-
let c =
|
|
1176
|
+
let c = _t(o, n), l = await bt(s, o, c, a);
|
|
1435
1177
|
if (l) {
|
|
1436
1178
|
r.push(l);
|
|
1437
1179
|
return;
|
|
1438
1180
|
}
|
|
1439
|
-
let u =
|
|
1181
|
+
let u = vt(o, c);
|
|
1440
1182
|
if (u) {
|
|
1441
1183
|
r.push(u);
|
|
1442
1184
|
return;
|
|
1443
1185
|
}
|
|
1444
|
-
let d =
|
|
1186
|
+
let d = yt(o, c);
|
|
1445
1187
|
if (d) {
|
|
1446
1188
|
r.push(d);
|
|
1447
1189
|
return;
|
|
@@ -1520,13 +1262,13 @@ var Ot = M("response"), kt = L(({ client: e }) => {
|
|
|
1520
1262
|
getByFieldName: _
|
|
1521
1263
|
};
|
|
1522
1264
|
});
|
|
1523
|
-
function
|
|
1524
|
-
return R(
|
|
1265
|
+
function Ct(e) {
|
|
1266
|
+
return R(St, e);
|
|
1525
1267
|
}
|
|
1526
1268
|
//#endregion
|
|
1527
1269
|
//#region src/entities/condition/condition.ts
|
|
1528
|
-
var
|
|
1529
|
-
let e =
|
|
1270
|
+
var wt = M("condition"), Tt = L(() => {
|
|
1271
|
+
let e = wt.store({}), t = j(e, { register(e, t) {
|
|
1530
1272
|
return {
|
|
1531
1273
|
...e,
|
|
1532
1274
|
[t.condition.id]: t.condition
|
|
@@ -1550,12 +1292,12 @@ var jt = M("condition"), Mt = L(() => {
|
|
|
1550
1292
|
indexStore: e
|
|
1551
1293
|
};
|
|
1552
1294
|
});
|
|
1553
|
-
function
|
|
1554
|
-
return R(
|
|
1295
|
+
function Et() {
|
|
1296
|
+
return R(Tt);
|
|
1555
1297
|
}
|
|
1556
1298
|
//#endregion
|
|
1557
1299
|
//#region src/utils/api-url.ts
|
|
1558
|
-
function
|
|
1300
|
+
function Dt() {
|
|
1559
1301
|
if (c()) {
|
|
1560
1302
|
let e = [
|
|
1561
1303
|
document.currentScript,
|
|
@@ -1570,7 +1312,7 @@ function Pt() {
|
|
|
1570
1312
|
}
|
|
1571
1313
|
//#endregion
|
|
1572
1314
|
//#region src/utils/search-params.ts
|
|
1573
|
-
function
|
|
1315
|
+
function Ot() {
|
|
1574
1316
|
if (!s()) return {};
|
|
1575
1317
|
let e = new URLSearchParams(window.location.search), t = {}, n = /* @__PURE__ */ new Set();
|
|
1576
1318
|
for (let [t] of e.entries()) t.startsWith("picked-") && n.add(t);
|
|
@@ -1587,14 +1329,42 @@ function Ft() {
|
|
|
1587
1329
|
return t;
|
|
1588
1330
|
}
|
|
1589
1331
|
//#endregion
|
|
1332
|
+
//#region src/utils/user-timing.ts
|
|
1333
|
+
var kt = "picked:start:begin", At = "picked:start";
|
|
1334
|
+
function jt() {
|
|
1335
|
+
try {
|
|
1336
|
+
return s() && !!p.window && "performance" in p;
|
|
1337
|
+
} catch {
|
|
1338
|
+
return !1;
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
function Mt() {
|
|
1342
|
+
let e = null, t = null;
|
|
1343
|
+
return {
|
|
1344
|
+
markBegin: () => {
|
|
1345
|
+
if (jt()) try {
|
|
1346
|
+
e = performance.mark(kt).startTime;
|
|
1347
|
+
} catch {}
|
|
1348
|
+
},
|
|
1349
|
+
measure: () => {
|
|
1350
|
+
if (!(!jt() || e === null)) try {
|
|
1351
|
+
t = performance.measure(At, { start: e });
|
|
1352
|
+
} catch {}
|
|
1353
|
+
},
|
|
1354
|
+
get startMeasure() {
|
|
1355
|
+
return t;
|
|
1356
|
+
}
|
|
1357
|
+
};
|
|
1358
|
+
}
|
|
1359
|
+
//#endregion
|
|
1590
1360
|
//#region src/entities/session/session.ts
|
|
1591
|
-
var
|
|
1592
|
-
function
|
|
1361
|
+
var Nt = O("session", "global");
|
|
1362
|
+
function Pt() {
|
|
1593
1363
|
return m() ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).substring(2, 15)}-${Math.random().toString(36).substring(2, 15)}-${Math.random().toString(36).substring(2, 15)}`;
|
|
1594
1364
|
}
|
|
1595
|
-
function
|
|
1365
|
+
function Ft() {
|
|
1596
1366
|
if (!h()) return null;
|
|
1597
|
-
let e = E.get(
|
|
1367
|
+
let e = E.get(Nt);
|
|
1598
1368
|
if (!e.isSet()) return null;
|
|
1599
1369
|
try {
|
|
1600
1370
|
return e.json();
|
|
@@ -1602,8 +1372,8 @@ function Rt() {
|
|
|
1602
1372
|
return null;
|
|
1603
1373
|
}
|
|
1604
1374
|
}
|
|
1605
|
-
var
|
|
1606
|
-
let e =
|
|
1375
|
+
var It = L(() => {
|
|
1376
|
+
let e = Ft(), t = { id: e?.id ?? Pt() };
|
|
1607
1377
|
e?.isUser !== void 0 && (t.isUser = e.isUser), e?.identifiers && Object.keys(e.identifiers).length > 0 && (t.identifiers = e.identifiers);
|
|
1608
1378
|
let n = F(t), r = j(n, {
|
|
1609
1379
|
setIsUser: (e, t) => ({
|
|
@@ -1629,7 +1399,7 @@ var zt = L(() => {
|
|
|
1629
1399
|
source: n,
|
|
1630
1400
|
effect: (e) => {
|
|
1631
1401
|
if (h()) try {
|
|
1632
|
-
E.get(
|
|
1402
|
+
E.get(Nt).set(e);
|
|
1633
1403
|
} catch {}
|
|
1634
1404
|
}
|
|
1635
1405
|
});
|
|
@@ -1643,39 +1413,39 @@ var zt = L(() => {
|
|
|
1643
1413
|
removeIdentifier: r.removeIdentifier
|
|
1644
1414
|
};
|
|
1645
1415
|
});
|
|
1646
|
-
function
|
|
1647
|
-
return R(
|
|
1416
|
+
function Lt() {
|
|
1417
|
+
return R(It, void 0);
|
|
1648
1418
|
}
|
|
1649
1419
|
//#endregion
|
|
1650
1420
|
//#region src/utils/picked-config.ts
|
|
1651
|
-
function
|
|
1421
|
+
function Rt() {
|
|
1652
1422
|
if (s()) return globalThis.window.pickedConfig;
|
|
1653
1423
|
}
|
|
1654
|
-
function
|
|
1655
|
-
if (s()) return
|
|
1424
|
+
function zt() {
|
|
1425
|
+
if (s()) return Rt()?.projectId;
|
|
1656
1426
|
}
|
|
1657
|
-
function
|
|
1427
|
+
function Bt() {
|
|
1658
1428
|
if (!c()) return;
|
|
1659
1429
|
let e = document.getElementById("picked_script") || document.querySelector("script#picked") || document.getElementById("cvly");
|
|
1660
1430
|
if (e) return e.dataset.projectid || e.getAttribute("project-id") || void 0;
|
|
1661
1431
|
}
|
|
1662
|
-
function
|
|
1432
|
+
function Vt(e) {
|
|
1663
1433
|
if (e.projectId) return e.projectId;
|
|
1664
|
-
let t =
|
|
1434
|
+
let t = zt();
|
|
1665
1435
|
if (t) return t;
|
|
1666
|
-
let n =
|
|
1436
|
+
let n = Bt();
|
|
1667
1437
|
if (n) return n;
|
|
1668
1438
|
throw Error("projectId is required. You can provide it via one of:\n (1) createClient({ projectId }) options;\n (2) window.pickedConfig = { projectId };\n (3) a <script> tag with id 'picked_script', 'picked', or 'cvly' that includes a data-projectid (or project-id) attribute.");
|
|
1669
1439
|
}
|
|
1670
1440
|
//#endregion
|
|
1671
1441
|
//#region src/utils/render-string.ts
|
|
1672
|
-
function
|
|
1442
|
+
function X(e) {
|
|
1673
1443
|
return e == null || e === "" || Number.isNaN(e);
|
|
1674
1444
|
}
|
|
1675
|
-
var
|
|
1676
|
-
default: (e, t) =>
|
|
1677
|
-
append: (e, t) => t && !
|
|
1678
|
-
prepend: (e, t) => t && !
|
|
1445
|
+
var Ht = {
|
|
1446
|
+
default: (e, t) => X(e) ? String(t ?? "") : String(e),
|
|
1447
|
+
append: (e, t) => t && !X(e) ? `${e} ${t}` : e,
|
|
1448
|
+
prepend: (e, t) => t && !X(e) ? `${t} ${e}` : e,
|
|
1679
1449
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
1680
1450
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e,
|
|
1681
1451
|
capitalize: (e) => typeof e == "string" ? e.charAt(0).toUpperCase() + e.slice(1) : e,
|
|
@@ -1693,24 +1463,24 @@ var Gt = {
|
|
|
1693
1463
|
return e instanceof Set ? t.format(Array.from(e).map(String)) : e;
|
|
1694
1464
|
}
|
|
1695
1465
|
};
|
|
1696
|
-
function
|
|
1466
|
+
function Ut(e) {
|
|
1697
1467
|
return typeof e == "object" && !!e;
|
|
1698
1468
|
}
|
|
1699
|
-
function
|
|
1469
|
+
function Wt(e, t) {
|
|
1700
1470
|
let n = t;
|
|
1701
|
-
for (let t of e.split(".")) if (
|
|
1471
|
+
for (let t of e.split(".")) if (Ut(n) && t in n) n = n[t];
|
|
1702
1472
|
else return;
|
|
1703
1473
|
return typeof n == "function" ? n() : n;
|
|
1704
1474
|
}
|
|
1705
|
-
function
|
|
1706
|
-
let n = e.split("|").map((e) => e.trim()), r =
|
|
1475
|
+
function Gt(e, t) {
|
|
1476
|
+
let n = e.split("|").map((e) => e.trim()), r = Wt(n.shift() ?? "", t);
|
|
1707
1477
|
for (let e of n) {
|
|
1708
|
-
let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o =
|
|
1478
|
+
let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = Ht[i];
|
|
1709
1479
|
o && (r = o(r, a));
|
|
1710
1480
|
}
|
|
1711
|
-
return
|
|
1481
|
+
return X(r) ? "" : typeof r == "object" ? JSON.stringify(r) : String(r);
|
|
1712
1482
|
}
|
|
1713
|
-
function
|
|
1483
|
+
function Kt(e, t) {
|
|
1714
1484
|
let n = "", r = 0;
|
|
1715
1485
|
for (; r < e.length;) if (e[r] === "{" && e[r + 1] === "{") {
|
|
1716
1486
|
r += 2;
|
|
@@ -1722,19 +1492,19 @@ function Yt(e, t) {
|
|
|
1722
1492
|
}
|
|
1723
1493
|
i += e[r++];
|
|
1724
1494
|
}
|
|
1725
|
-
n +=
|
|
1495
|
+
n += Gt(i.trim(), t);
|
|
1726
1496
|
} else n += e[r++];
|
|
1727
1497
|
return n;
|
|
1728
1498
|
}
|
|
1729
1499
|
//#endregion
|
|
1730
1500
|
//#region src/utils/preview-session.ts
|
|
1731
|
-
var
|
|
1732
|
-
function
|
|
1733
|
-
return !s() || !g() ? !1 : !!
|
|
1501
|
+
var qt = "preview-token";
|
|
1502
|
+
function Jt() {
|
|
1503
|
+
return !s() || !g() ? !1 : !!Ot()[qt]?.[0];
|
|
1734
1504
|
}
|
|
1735
1505
|
//#endregion
|
|
1736
1506
|
//#region src/picked.ts
|
|
1737
|
-
var
|
|
1507
|
+
var Yt = class {
|
|
1738
1508
|
static logger = r;
|
|
1739
1509
|
options;
|
|
1740
1510
|
dataSource = null;
|
|
@@ -1743,9 +1513,10 @@ var Qt = class {
|
|
|
1743
1513
|
contentLoader;
|
|
1744
1514
|
previewEmbedderOrigins = null;
|
|
1745
1515
|
plugins = {};
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1516
|
+
deliveryObserver = null;
|
|
1517
|
+
setDeliveryRequestObserver = (e) => {
|
|
1518
|
+
this.deliveryObserver = e;
|
|
1519
|
+
};
|
|
1749
1520
|
dataProviders = /* @__PURE__ */ new Map();
|
|
1750
1521
|
eventBus = P();
|
|
1751
1522
|
events;
|
|
@@ -1753,53 +1524,55 @@ var Qt = class {
|
|
|
1753
1524
|
apiUrl;
|
|
1754
1525
|
dashboardUrl;
|
|
1755
1526
|
documentationSiteUrl;
|
|
1756
|
-
session =
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1527
|
+
session = Lt();
|
|
1528
|
+
performance = Mt();
|
|
1529
|
+
searchParams = Ot();
|
|
1530
|
+
history = Xe();
|
|
1531
|
+
components = Ce({ client: this });
|
|
1760
1532
|
experienceInstances = C({ client: this });
|
|
1761
|
-
experiences =
|
|
1762
|
-
frameworks =
|
|
1763
|
-
predicates =
|
|
1764
|
-
features =
|
|
1765
|
-
conditions =
|
|
1766
|
-
fields =
|
|
1767
|
-
responses =
|
|
1768
|
-
steps =
|
|
1769
|
-
contents =
|
|
1770
|
-
actions =
|
|
1533
|
+
experiences = he({ client: this });
|
|
1534
|
+
frameworks = De({ client: this });
|
|
1535
|
+
predicates = Ke({ client: this });
|
|
1536
|
+
features = re({ client: this });
|
|
1537
|
+
conditions = Et();
|
|
1538
|
+
fields = tt();
|
|
1539
|
+
responses = Ct({ client: this });
|
|
1540
|
+
steps = it();
|
|
1541
|
+
contents = ct();
|
|
1542
|
+
actions = ft({ client: this });
|
|
1771
1543
|
conditionResults = w();
|
|
1772
|
-
stateSnapshotStore =
|
|
1773
|
-
evaluateRuleLogicFx =
|
|
1544
|
+
stateSnapshotStore = Ae({ client: this });
|
|
1545
|
+
evaluateRuleLogicFx = Re({ client: this });
|
|
1774
1546
|
start;
|
|
1775
1547
|
readyStore;
|
|
1776
1548
|
preconditionPassedStore;
|
|
1777
1549
|
conditionPassedStore;
|
|
1778
1550
|
lifecycleStageStore;
|
|
1779
|
-
lifecycle =
|
|
1551
|
+
lifecycle = Ue({ client: this });
|
|
1780
1552
|
renderStringFx = k({
|
|
1781
1553
|
source: this.responses.listStore,
|
|
1782
1554
|
effect: (e, { template: t, context: n }) => {
|
|
1783
1555
|
let r = {};
|
|
1784
1556
|
for (let t of e) r[t.fieldKey] = t.value;
|
|
1785
|
-
return
|
|
1557
|
+
return Kt(t, {
|
|
1786
1558
|
...n,
|
|
1787
1559
|
responses: r
|
|
1788
1560
|
});
|
|
1789
1561
|
}
|
|
1790
1562
|
});
|
|
1791
1563
|
constructor(e) {
|
|
1792
|
-
this.events =
|
|
1564
|
+
this.events = Qe(this.eventBus), this.projectId = Vt(e), this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Dt(), this.dashboardUrl = e.dashboardUrl ?? "https://dashboard.picked.app", this.documentationSiteUrl = e.documentationSiteUrl ?? "https://docs.picked.app", this.start = this.lifecycle.start, this.readyStore = this.lifecycle.readyStore, this.preconditionPassedStore = this.lifecycle.preconditionPassedStore, this.conditionPassedStore = this.lifecycle.conditionPassedStore, this.lifecycleStageStore = this.lifecycle.lifecycleStageStore, this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.setupComponents(), this.lifecycle.setPrecondition(e.precondition), this.lifecycle.setCondition(e.condition), this.eventBus({
|
|
1793
1565
|
type: "load",
|
|
1794
|
-
version:
|
|
1566
|
+
version: ae()
|
|
1795
1567
|
}), this.maybeStartPreviewChannel();
|
|
1796
1568
|
}
|
|
1797
1569
|
dataProviderFor(e) {
|
|
1798
1570
|
let t = e ?? "", n = this.dataProviders.get(t);
|
|
1799
1571
|
if (n) return n;
|
|
1800
|
-
let r = import("../provider-
|
|
1572
|
+
let r = import("../provider-BWDd3oaq.js").then((t) => t.createPickedDataProvider({
|
|
1801
1573
|
apiUrl: this.apiUrl,
|
|
1802
1574
|
projectId: this.projectId,
|
|
1575
|
+
getRequestObserver: () => this.deliveryObserver,
|
|
1803
1576
|
...e !== void 0 && { previewToken: e }
|
|
1804
1577
|
}));
|
|
1805
1578
|
return this.dataProviders.set(t, r), r;
|
|
@@ -1813,24 +1586,24 @@ var Qt = class {
|
|
|
1813
1586
|
return (await this.dataProviderFor(t?.previewToken)).getContent(e, t?.signal === void 0 ? void 0 : { signal: t.signal });
|
|
1814
1587
|
}
|
|
1815
1588
|
maybeStartPreviewChannel() {
|
|
1816
|
-
|
|
1589
|
+
Jt() && import("../preview-channel-CSr96XAo.js").then((e) => e.initPreviewChannel(this)).catch(() => void 0);
|
|
1817
1590
|
}
|
|
1818
1591
|
registerFramework = (e) => {
|
|
1819
|
-
|
|
1592
|
+
Oe(e, this.frameworks);
|
|
1820
1593
|
};
|
|
1821
1594
|
registerComponent = (e, t) => {
|
|
1822
|
-
|
|
1595
|
+
we(e, t, this.components);
|
|
1823
1596
|
};
|
|
1824
1597
|
registerPlugin = (e) => {
|
|
1825
|
-
|
|
1598
|
+
ve(this, e, this.plugins);
|
|
1826
1599
|
let t = this.plugins[e.name];
|
|
1827
1600
|
t?.onStart && this.lifecycle.registerPluginStartHook(t.onStart);
|
|
1828
1601
|
};
|
|
1829
1602
|
registerFeature = (e, t) => {
|
|
1830
|
-
|
|
1603
|
+
ne(e, t, this.features);
|
|
1831
1604
|
};
|
|
1832
1605
|
registerPredicate = (e, t) => {
|
|
1833
|
-
|
|
1606
|
+
qe(e, t, this.predicates);
|
|
1834
1607
|
};
|
|
1835
1608
|
registerCondition = (e) => {
|
|
1836
1609
|
this.conditions.register(e);
|
|
@@ -1839,19 +1612,19 @@ var Qt = class {
|
|
|
1839
1612
|
this.fields.register(e);
|
|
1840
1613
|
};
|
|
1841
1614
|
registerStep = (e) => {
|
|
1842
|
-
|
|
1615
|
+
at(e, this.steps);
|
|
1843
1616
|
};
|
|
1844
1617
|
registerContent = (e) => {
|
|
1845
|
-
|
|
1618
|
+
lt(e, this.contents);
|
|
1846
1619
|
};
|
|
1847
1620
|
patchContent = (e, t) => {
|
|
1848
1621
|
this.contents.patch(e, t);
|
|
1849
1622
|
};
|
|
1850
1623
|
registerAction = (e, t) => {
|
|
1851
|
-
|
|
1624
|
+
pt(e, t, this.actions);
|
|
1852
1625
|
};
|
|
1853
1626
|
registerExperience = (e) => {
|
|
1854
|
-
e.component &&
|
|
1627
|
+
e.component && we(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
|
|
1855
1628
|
};
|
|
1856
1629
|
launchExperienceById = async (e, t) => {
|
|
1857
1630
|
this.experiences.launch({
|
|
@@ -1894,12 +1667,12 @@ var Qt = class {
|
|
|
1894
1667
|
this.registerFeature(e, n);
|
|
1895
1668
|
}), this.searchParams.feature && this.searchParams.feature.forEach((e) => {
|
|
1896
1669
|
try {
|
|
1897
|
-
let
|
|
1898
|
-
if (!t
|
|
1899
|
-
let r =
|
|
1900
|
-
this.registerFeature(
|
|
1670
|
+
let t = ie(e);
|
|
1671
|
+
if (!t) return;
|
|
1672
|
+
let { id: n, bucket: r } = t;
|
|
1673
|
+
this.registerFeature(n, {
|
|
1901
1674
|
key: `${r}`,
|
|
1902
|
-
name:
|
|
1675
|
+
name: n,
|
|
1903
1676
|
decide: () => r,
|
|
1904
1677
|
storage: "session"
|
|
1905
1678
|
});
|
|
@@ -1933,8 +1706,8 @@ var Qt = class {
|
|
|
1933
1706
|
});
|
|
1934
1707
|
}
|
|
1935
1708
|
getPluginConfig = (e) => this.plugins[e] ?? {};
|
|
1936
|
-
},
|
|
1937
|
-
async function
|
|
1709
|
+
}, Xt = "application/picked-javascript", Zt = "application/picked-module", Qt = "data-picked-hydrated";
|
|
1710
|
+
async function $t(e) {
|
|
1938
1711
|
if (!("document" in globalThis)) return;
|
|
1939
1712
|
let t = "application/picked-module", n = "data-picked-hydrated";
|
|
1940
1713
|
function r(e) {
|
|
@@ -1963,42 +1736,42 @@ async function nn(e) {
|
|
|
1963
1736
|
a && await a;
|
|
1964
1737
|
}
|
|
1965
1738
|
}
|
|
1966
|
-
function
|
|
1967
|
-
return `<script>(${
|
|
1739
|
+
function en() {
|
|
1740
|
+
return `<script>(${$t.toString()})(document)<\/script>`;
|
|
1968
1741
|
}
|
|
1969
1742
|
//#endregion
|
|
1970
1743
|
//#region src/utils/html-asset-value.ts
|
|
1971
|
-
function
|
|
1744
|
+
function tn(e) {
|
|
1972
1745
|
return typeof e == "object" && !!e && "id" in e && typeof e.id == "string" && "content" in e && (typeof e.content == "string" || e.content === null);
|
|
1973
1746
|
}
|
|
1974
1747
|
//#endregion
|
|
1975
1748
|
//#region src/entities/component/lazyComponent.ts
|
|
1976
|
-
function
|
|
1749
|
+
function nn(e) {
|
|
1977
1750
|
return {
|
|
1978
1751
|
$$type: "lazy-component",
|
|
1979
1752
|
load: e
|
|
1980
1753
|
};
|
|
1981
1754
|
}
|
|
1982
|
-
function
|
|
1755
|
+
function rn(e) {
|
|
1983
1756
|
return typeof e == "object" && !!e && "$$type" in e && e.$$type === "lazy-component";
|
|
1984
1757
|
}
|
|
1985
1758
|
//#endregion
|
|
1986
1759
|
//#region src/entities/content/reference.ts
|
|
1987
|
-
function
|
|
1760
|
+
function Z(e) {
|
|
1988
1761
|
return typeof e == "object" && !!e && !Array.isArray(e) && "contentEntryId" in e && typeof e.contentEntryId == "string";
|
|
1989
1762
|
}
|
|
1990
|
-
function
|
|
1991
|
-
return
|
|
1763
|
+
function Q(e) {
|
|
1764
|
+
return Z(e) ? e.contentEntryId : null;
|
|
1992
1765
|
}
|
|
1993
|
-
function
|
|
1766
|
+
function $(e) {
|
|
1994
1767
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
1995
|
-
for (let e of t)
|
|
1768
|
+
for (let e of t) Z(e) && n.push(e.contentEntryId);
|
|
1996
1769
|
return n;
|
|
1997
1770
|
}
|
|
1998
|
-
function
|
|
1771
|
+
function an(e, t) {
|
|
1999
1772
|
return t === null ? null : e[t] ?? null;
|
|
2000
1773
|
}
|
|
2001
|
-
function
|
|
1774
|
+
function on(e, t) {
|
|
2002
1775
|
let n = [];
|
|
2003
1776
|
for (let r of t) {
|
|
2004
1777
|
let t = e[r];
|
|
@@ -2006,29 +1779,29 @@ function un(e, t) {
|
|
|
2006
1779
|
}
|
|
2007
1780
|
return n;
|
|
2008
1781
|
}
|
|
2009
|
-
function
|
|
2010
|
-
if (
|
|
2011
|
-
let n =
|
|
2012
|
-
return e.indexStore.map((e) =>
|
|
1782
|
+
function sn(e, t) {
|
|
1783
|
+
if (ue.store(t)) return A(t, e.indexStore, (e, t) => an(t, Q(e)));
|
|
1784
|
+
let n = Q(t);
|
|
1785
|
+
return e.indexStore.map((e) => an(e, n), { skipVoid: !1 });
|
|
2013
1786
|
}
|
|
2014
|
-
function
|
|
2015
|
-
if (
|
|
2016
|
-
let n =
|
|
2017
|
-
return e.indexStore.map((e) =>
|
|
1787
|
+
function cn(e, t) {
|
|
1788
|
+
if (ue.store(t)) return A(t, e.indexStore, (e, t) => on(t, $(e)));
|
|
1789
|
+
let n = $(t);
|
|
1790
|
+
return e.indexStore.map((e) => on(e, n), { skipVoid: !1 });
|
|
2018
1791
|
}
|
|
2019
1792
|
//#endregion
|
|
2020
1793
|
//#region src/exports.ts
|
|
2021
|
-
var
|
|
2022
|
-
let t = new
|
|
1794
|
+
var ln = (e) => {
|
|
1795
|
+
let t = new Yt(e);
|
|
2023
1796
|
return u(t), t;
|
|
2024
1797
|
};
|
|
2025
1798
|
//#endregion
|
|
2026
1799
|
//#region src/typed-content.ts
|
|
2027
|
-
function
|
|
1800
|
+
function un(e) {
|
|
2028
1801
|
return typeof e.data == "object";
|
|
2029
1802
|
}
|
|
2030
|
-
function
|
|
2031
|
-
return e.map((e) => !e || !
|
|
1803
|
+
function dn(e) {
|
|
1804
|
+
return e.map((e) => !e || !un(e) ? null : e, { skipVoid: !1 });
|
|
2032
1805
|
}
|
|
2033
1806
|
//#endregion
|
|
2034
|
-
export {
|
|
1807
|
+
export { Qt as PICKED_HYDRATED_ATTR, Zt as PICKED_MODULE_SCRIPT_TYPE, Xt as PICKED_SCRIPT_TYPE, qt as PREVIEW_TOKEN_PARAM, Yt as Picked, en as buildRehydrateBootstrap, ln as createClient, _e as createPluginEffect, O as createStorageKey, sn as deriveReference, cn as deriveReferences, n as evaluateRuleLogic, Rt as getPickedConfig, Z as isContentReference, tn as isHtmlAssetValue, g as isInsideIframe, rn as isLazyLoader, v as isPickedRoot, Jt as isPreviewSession, nn as lazyComponent, E as localStore, le as onInertScriptSubtrees, Q as readReferenceId, $ as readReferenceIds, $t as rehydrateScripts, se as reportInertScriptSubtrees, ce as resetInertScriptReport, D as sessionStore, te as subscribe, d as supportsCookies, m as supportsCryptoRandomUUID, c as supportsDocument, i as supportsHistory, f as supportsIntersectionObserver, h as supportsLocalStorage, a as supportsLocation, l as supportsSessionStorage, _ as supportsShadowRoot, o as supportsWebComponents, s as supportsWindow, dn as toTypedContentStore };
|