@picked/client 0.0.1-dev.1773804563218 → 0.0.1-dev.1773878362211
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/{api-CQ1Lb-dB.js → api-4YC7Dkcf.js} +1 -1
- package/dist/{api-C90ugp6M.cjs → api-dQTozK5u.cjs} +1 -1
- package/dist/cjs/form/index.js +1 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/history-browser-storage/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/single-page-app/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/form/index.js +393 -0
- package/dist/esm/index.js +684 -770
- package/dist/esm/plugins/create-experience/index.js +284 -359
- package/dist/esm/plugins/dynamic-experiences/index.js +80 -146
- package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
- package/dist/esm/plugins/history-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-indexeddb/index.js +51 -46
- package/dist/esm/plugins/single-page-app/index.js +24 -24
- package/dist/esm/server/index.js +7 -7
- package/dist/experience-instance-Bd4kkjE6.js +559 -0
- package/dist/experience-instance-UAZPiG2b.cjs +1 -0
- package/dist/{object-JwZ58NOH.js → object-CJssU1Pm.js} +1 -1
- package/dist/object-mwaxtjLG.cjs +1 -0
- package/dist/rules-logic-CZfip-Wl.js +265 -0
- package/dist/rules-logic-Cgia6n5p.cjs +1 -0
- package/dist/storage-58NoTSsc.cjs +1 -0
- package/dist/{storage-Co_LbKr_.js → storage-B2d81EOI.js} +35 -30
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +31 -46
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -2
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +12 -17
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/project/project.d.ts.map +1 -1
- package/dist/types/entities/response/response.d.ts +7 -9
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/form/build-responses.d.ts +14 -0
- package/dist/types/form/build-responses.d.ts.map +1 -0
- package/dist/types/form/create-field-evaluator.d.ts +19 -0
- package/dist/types/form/create-field-evaluator.d.ts.map +1 -0
- package/dist/types/form/create-field-validation.d.ts +44 -0
- package/dist/types/form/create-field-validation.d.ts.map +1 -0
- package/dist/types/form/create-form.d.ts +56 -0
- package/dist/types/form/create-form.d.ts.map +1 -0
- package/dist/types/form/create-submit-pipeline.d.ts +58 -0
- package/dist/types/form/create-submit-pipeline.d.ts.map +1 -0
- package/dist/types/form/get-step-fields.d.ts +5 -0
- package/dist/types/form/get-step-fields.d.ts.map +1 -0
- package/dist/types/form/index.d.ts +10 -0
- package/dist/types/form/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +2 -8
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +23 -41
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +41 -70
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/index.d.ts +1 -1
- package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +5 -20
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +0 -46
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +2 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +2 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +2 -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/single-page-app/plugin.d.ts +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +0 -3
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +2 -2
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +0 -1
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/indexed-db.d.ts +2 -1
- package/dist/types/utils/indexed-db.d.ts.map +1 -1
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +3 -3
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +2 -2
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/object.d.ts +0 -8
- package/dist/types/utils/object.d.ts.map +1 -1
- package/dist/types/utils/picked-config.d.ts +1 -1
- package/dist/types/utils/picked-config.d.ts.map +1 -1
- package/dist/types/utils/search-params.d.ts.map +1 -1
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/package.json +27 -3
- package/dist/experience-instance-8P1fJuPC.js +0 -819
- package/dist/experience-instance-Bi3-1tP5.cjs +0 -1
- package/dist/object-BbFTsGh3.cjs +0 -1
- package/dist/storage-Be5xWNPC.cjs +0 -1
- package/dist/types/entities/condition/condition.d.ts +0 -17
- package/dist/types/entities/condition/condition.d.ts.map +0 -1
- package/dist/types/entities/step/step.d.ts +0 -20
- package/dist/types/entities/step/step.d.ts.map +0 -1
- package/dist/types/utils/key.d.ts +0 -12
- package/dist/types/utils/key.d.ts.map +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,246 +1,237 @@
|
|
|
1
|
-
import { createDomain as
|
|
2
|
-
import { createFactory as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { g as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
1
|
+
import { createDomain as F, createApi as j, attach as O, createStore as N, createEffect as B, sample as w, combine as U, createEvent as D } from "effector";
|
|
2
|
+
import { createFactory as I, invoke as x } from "@withease/factories";
|
|
3
|
+
import { i as ee, e as T } from "../rules-logic-CZfip-Wl.js";
|
|
4
|
+
import { l as b } from "../logger-C9a75KZn.js";
|
|
5
|
+
import { g as W, t as te, c as re, i as se, a as ne, d as ie } from "../experience-instance-Bd4kkjE6.js";
|
|
6
|
+
import { b as Bt } from "../experience-instance-Bd4kkjE6.js";
|
|
7
|
+
import { c as P, l as R, s as C } from "../storage-B2d81EOI.js";
|
|
8
|
+
import { a as Rt } from "../storage-B2d81EOI.js";
|
|
9
|
+
import { p as oe, g as ae } from "../api-4YC7Dkcf.js";
|
|
10
|
+
import { g as ce } from "../id-BW-g3y32.js";
|
|
11
|
+
import { i as ue } from "../object-CJssU1Pm.js";
|
|
12
|
+
import { s as L, a as _, b as de, c as le, d as pe } from "../supports-8YT4QKI7.js";
|
|
13
|
+
import { e as Mt, f as Ot, g as Ut, h as Dt, i as Vt, j as Nt, k as Tt } from "../supports-8YT4QKI7.js";
|
|
14
|
+
const Y = F("experience"), fe = I(
|
|
14
15
|
({ client: t, experience: e }) => {
|
|
15
|
-
const r =
|
|
16
|
-
merge(
|
|
16
|
+
const r = Y.store(e), s = j(r, {
|
|
17
|
+
merge(l, h) {
|
|
17
18
|
return {
|
|
18
|
-
...
|
|
19
|
-
...
|
|
19
|
+
...l,
|
|
20
|
+
...h.experience
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
|
-
}), i = r.map((
|
|
23
|
-
name:
|
|
24
|
-
decisionLogic:
|
|
25
|
-
targetSelectors:
|
|
23
|
+
}), i = r.map((l) => ({
|
|
24
|
+
name: l.name,
|
|
25
|
+
decisionLogic: l.condition,
|
|
26
|
+
targetSelectors: l.targets,
|
|
26
27
|
initializeOpenLogic: e.initializeOpen
|
|
27
|
-
})),
|
|
28
|
-
name: `experience:${e.id}
|
|
29
|
-
component: e.component,
|
|
30
|
-
frameworkStore: t.frameworks.getByName(e.component.frameworkName)
|
|
31
|
-
} : void 0, s = t.components.listStore.map(
|
|
32
|
-
(p) => u || (e.componentName ? p.find((f) => f.name === e.componentName) : void 0) || p.find((f) => f.name === `experience:${e.id}`) || p.find((f) => f.name === "experience"),
|
|
28
|
+
})), p = t.components.listStore.map(
|
|
29
|
+
(l) => (e.componentName ? l.find((h) => h.name === e.componentName) : void 0) || l.find((h) => h.name === `experience:${e.id}`) || l.find((h) => h.name === "experience"),
|
|
33
30
|
{ skipVoid: !1 }
|
|
34
|
-
),
|
|
35
|
-
steps:
|
|
36
|
-
nodes:
|
|
37
|
-
edges:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})), l = e.actions ?? [];
|
|
31
|
+
), a = r.map((l) => ({
|
|
32
|
+
steps: l.steps,
|
|
33
|
+
nodes: l.nodes,
|
|
34
|
+
edges: l.edges,
|
|
35
|
+
conditionals: l.conditionals
|
|
36
|
+
})), n = r.map((l) => l.fields), u = e.actions ?? [];
|
|
41
37
|
return {
|
|
42
38
|
id: e.id,
|
|
43
|
-
key: e.key,
|
|
44
|
-
name: e.name,
|
|
45
39
|
configStore: i,
|
|
46
|
-
treeStore:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
treeStore: a,
|
|
41
|
+
fieldsStore: n,
|
|
42
|
+
componentStore: p,
|
|
43
|
+
actions: u,
|
|
44
|
+
merge: s.merge
|
|
50
45
|
};
|
|
51
46
|
}
|
|
52
47
|
);
|
|
53
|
-
function
|
|
54
|
-
return
|
|
48
|
+
function ge(t) {
|
|
49
|
+
return x(fe, t);
|
|
55
50
|
}
|
|
56
|
-
const
|
|
57
|
-
const e =
|
|
58
|
-
register(
|
|
51
|
+
const me = I(({ client: t }) => {
|
|
52
|
+
const e = Y.store({}), r = j(e, {
|
|
53
|
+
register(u, l) {
|
|
59
54
|
return {
|
|
60
|
-
...
|
|
61
|
-
[
|
|
55
|
+
...u,
|
|
56
|
+
[l.id]: l
|
|
62
57
|
};
|
|
63
58
|
}
|
|
64
|
-
}), i = w(r, {
|
|
65
|
-
register(f, { key: h, id: S }) {
|
|
66
|
-
return { ...f, [h]: S };
|
|
67
|
-
}
|
|
68
59
|
});
|
|
69
|
-
function u
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
|
|
60
|
+
function s(u) {
|
|
61
|
+
const l = e.getState()[u.id];
|
|
62
|
+
if (l) {
|
|
63
|
+
l.merge({ experience: u, strategy: "override" });
|
|
73
64
|
return;
|
|
74
65
|
}
|
|
75
|
-
const
|
|
76
|
-
|
|
66
|
+
const h = ge({ client: t, experience: u });
|
|
67
|
+
r.register(h);
|
|
77
68
|
}
|
|
78
|
-
const
|
|
79
|
-
function
|
|
80
|
-
return
|
|
69
|
+
const i = e.map((u) => Object.values(u));
|
|
70
|
+
function p(u) {
|
|
71
|
+
return e.map((l) => l[u], { skipVoid: !1 });
|
|
81
72
|
}
|
|
82
|
-
const
|
|
83
|
-
source:
|
|
84
|
-
effect: async (
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
87
|
-
|
|
73
|
+
const a = O({
|
|
74
|
+
source: e,
|
|
75
|
+
effect: async (u, { id: l, options: h }) => {
|
|
76
|
+
const S = u[l];
|
|
77
|
+
if (!S) {
|
|
78
|
+
b("warn", `Experience with id '${l}' not found.`);
|
|
88
79
|
return;
|
|
89
80
|
}
|
|
90
|
-
if (
|
|
91
|
-
|
|
81
|
+
if (h?.bypassCondition) {
|
|
82
|
+
V(t, S, h);
|
|
92
83
|
return;
|
|
93
84
|
}
|
|
94
|
-
await
|
|
85
|
+
await Q(t, S) && V(t, S, h);
|
|
95
86
|
}
|
|
96
|
-
}),
|
|
97
|
-
source:
|
|
98
|
-
effect: (
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
101
|
-
for (const
|
|
102
|
-
|
|
87
|
+
}), n = O({
|
|
88
|
+
source: t.experienceInstances.listStore,
|
|
89
|
+
effect: (u, { id: l, options: h }) => {
|
|
90
|
+
const S = u.filter((g) => g.experienceId === l);
|
|
91
|
+
if (S.length > 0)
|
|
92
|
+
for (const g of S)
|
|
93
|
+
g.open();
|
|
103
94
|
else
|
|
104
|
-
|
|
95
|
+
a({ id: l, options: { ...h, initialiseOpen: !0 } });
|
|
105
96
|
}
|
|
106
97
|
});
|
|
107
98
|
return {
|
|
108
99
|
/** Registers an experience in the index. If an experience with the same ID already exists, it is merged. */
|
|
109
|
-
register:
|
|
110
|
-
/** Returns a derived store for an experience by its ID
|
|
111
|
-
get:
|
|
100
|
+
register: s,
|
|
101
|
+
/** Returns a derived store for an experience by its ID. The store value is `undefined` when no match exists. */
|
|
102
|
+
get: p,
|
|
112
103
|
/** @deprecated Use `experiences.get(id)` instead. */
|
|
113
|
-
getById:
|
|
114
|
-
/** Effector effect that launches an experience by ID
|
|
115
|
-
launch:
|
|
104
|
+
getById: p,
|
|
105
|
+
/** Effector effect that launches an experience by ID, creating instances for each DOM target. */
|
|
106
|
+
launch: a,
|
|
116
107
|
/** Effector effect that opens an experience's existing instances, or launches it with `initialiseOpen` if none exist. */
|
|
117
|
-
open:
|
|
108
|
+
open: n,
|
|
118
109
|
/** Derived store containing all registered experiences as an array. */
|
|
119
|
-
listStore:
|
|
110
|
+
listStore: i
|
|
120
111
|
};
|
|
121
112
|
});
|
|
122
|
-
function
|
|
123
|
-
return
|
|
113
|
+
function he(t) {
|
|
114
|
+
return x(me, t);
|
|
124
115
|
}
|
|
125
|
-
const
|
|
116
|
+
const ye = (t, e) => {
|
|
126
117
|
e.register(t);
|
|
127
|
-
},
|
|
128
|
-
const { targetSelectors:
|
|
118
|
+
}, V = (t, e, r) => {
|
|
119
|
+
const { targetSelectors: s } = e.configStore.getState(), i = W(s, e.id);
|
|
129
120
|
i.forEach(
|
|
130
|
-
({ elements:
|
|
131
|
-
),
|
|
132
|
-
r ? t.experienceInstances.spawn(e,
|
|
121
|
+
({ elements: a }) => a.forEach((n) => te(n, e.id))
|
|
122
|
+
), re(i, e.id).forEach((a) => {
|
|
123
|
+
r ? t.experienceInstances.spawn(e, a, r) : t.experienceInstances.spawn(e, a);
|
|
133
124
|
});
|
|
134
|
-
},
|
|
125
|
+
}, H = async (t) => {
|
|
135
126
|
await Promise.all(
|
|
136
127
|
t.experiences.listStore.getState().map(async (e) => {
|
|
137
|
-
await
|
|
128
|
+
await Q(t, e) && V(t, e);
|
|
138
129
|
})
|
|
139
130
|
);
|
|
140
|
-
},
|
|
131
|
+
}, Q = async (t, e) => {
|
|
141
132
|
if (!t.preconditionPassed || !t.session?.isUser)
|
|
142
133
|
return !1;
|
|
143
|
-
const { decisionLogic: r, targetSelectors:
|
|
144
|
-
return
|
|
145
|
-
},
|
|
146
|
-
const
|
|
134
|
+
const { decisionLogic: r, targetSelectors: s } = e.configStore.getState();
|
|
135
|
+
return W(s, e.id).length < 1 || s.length === 0 ? !1 : r === void 0 ? !0 : ee(r) ? await T(t, r) === !0 : !0;
|
|
136
|
+
}, Se = (t, e, r) => {
|
|
137
|
+
const s = e.name, i = e.setup(t);
|
|
147
138
|
if (i) {
|
|
148
|
-
const
|
|
149
|
-
r[
|
|
139
|
+
const p = r[s] ?? {};
|
|
140
|
+
r[s] = Object.freeze({ ...p, ...i });
|
|
150
141
|
}
|
|
151
|
-
},
|
|
142
|
+
}, ve = F("component"), ke = I(
|
|
152
143
|
({ client: t, component: e, name: r }) => {
|
|
153
|
-
const
|
|
144
|
+
const s = t.frameworks.getByName(e.frameworkName);
|
|
154
145
|
return {
|
|
155
146
|
name: r,
|
|
156
147
|
component: e,
|
|
157
|
-
frameworkStore:
|
|
148
|
+
frameworkStore: s
|
|
158
149
|
};
|
|
159
150
|
}
|
|
160
151
|
);
|
|
161
|
-
function
|
|
162
|
-
return
|
|
152
|
+
function we(t) {
|
|
153
|
+
return x(ke, t);
|
|
163
154
|
}
|
|
164
|
-
const
|
|
165
|
-
const e =
|
|
166
|
-
register(
|
|
155
|
+
const be = I(({ client: t }) => {
|
|
156
|
+
const e = ve.store({}), r = j(e, {
|
|
157
|
+
register(a, n) {
|
|
167
158
|
return {
|
|
168
|
-
...
|
|
169
|
-
[
|
|
159
|
+
...a,
|
|
160
|
+
[n.name]: n
|
|
170
161
|
};
|
|
171
162
|
}
|
|
172
163
|
});
|
|
173
|
-
function
|
|
174
|
-
e.getState()[
|
|
164
|
+
function s(a, n) {
|
|
165
|
+
e.getState()[a] && b(
|
|
175
166
|
"warn",
|
|
176
|
-
`Component '${
|
|
167
|
+
`Component '${a}' already registered. Registering again will override the previous registration.`
|
|
177
168
|
);
|
|
178
|
-
const
|
|
179
|
-
r.register(
|
|
169
|
+
const l = we({ client: t, name: a, component: n });
|
|
170
|
+
r.register(l);
|
|
180
171
|
}
|
|
181
|
-
const i = e.map((
|
|
182
|
-
function
|
|
183
|
-
return e.map((
|
|
172
|
+
const i = e.map((a) => Object.values(a));
|
|
173
|
+
function p(a) {
|
|
174
|
+
return e.map((n) => n[a], { skipVoid: !1 });
|
|
184
175
|
}
|
|
185
176
|
return {
|
|
186
|
-
register:
|
|
187
|
-
getByName:
|
|
177
|
+
register: s,
|
|
178
|
+
getByName: p,
|
|
188
179
|
listStore: i
|
|
189
180
|
};
|
|
190
181
|
});
|
|
191
|
-
function
|
|
192
|
-
return
|
|
182
|
+
function Ie(t) {
|
|
183
|
+
return x(be, t);
|
|
193
184
|
}
|
|
194
|
-
const
|
|
185
|
+
const G = (t, e, r) => {
|
|
195
186
|
r.register(t, e);
|
|
196
|
-
}, xe =
|
|
197
|
-
const e = xe.store({}), r =
|
|
198
|
-
register(
|
|
187
|
+
}, xe = F("framework"), Fe = I(({ client: t }) => {
|
|
188
|
+
const e = xe.store({}), r = j(e, {
|
|
189
|
+
register(a, n) {
|
|
199
190
|
return {
|
|
200
|
-
...
|
|
201
|
-
[
|
|
191
|
+
...a,
|
|
192
|
+
[n.name]: n.framework
|
|
202
193
|
};
|
|
203
194
|
}
|
|
204
195
|
});
|
|
205
|
-
function
|
|
206
|
-
e.getState()[
|
|
196
|
+
function s(a, n) {
|
|
197
|
+
e.getState()[a] && b(
|
|
207
198
|
"warn",
|
|
208
|
-
`Framework '${
|
|
209
|
-
), r.register({ name:
|
|
199
|
+
`Framework '${a}' already registered. Registering again will override the previous registration.`
|
|
200
|
+
), r.register({ name: a, framework: n });
|
|
210
201
|
}
|
|
211
|
-
const i = e.map((
|
|
212
|
-
function
|
|
213
|
-
return e.map((
|
|
202
|
+
const i = e.map((a) => Object.values(a));
|
|
203
|
+
function p(a) {
|
|
204
|
+
return e.map((n) => n[a], { skipVoid: !1 });
|
|
214
205
|
}
|
|
215
206
|
return {
|
|
216
|
-
register:
|
|
217
|
-
getByName:
|
|
207
|
+
register: s,
|
|
208
|
+
getByName: p,
|
|
218
209
|
listStore: i
|
|
219
210
|
};
|
|
220
211
|
});
|
|
221
|
-
function
|
|
222
|
-
return
|
|
212
|
+
function je(t) {
|
|
213
|
+
return x(Fe, t);
|
|
223
214
|
}
|
|
224
|
-
const
|
|
215
|
+
const Ee = (t, e) => {
|
|
225
216
|
e.register(t.name, t);
|
|
226
|
-
},
|
|
217
|
+
}, Pe = 6e3, Ae = P("last_ping", "global"), $e = async (t) => {
|
|
227
218
|
try {
|
|
228
|
-
const e = Date.now(), r = R.get(
|
|
229
|
-
let
|
|
230
|
-
if (r.isSet() && (
|
|
219
|
+
const e = Date.now(), r = R.get(Ae);
|
|
220
|
+
let s = 0;
|
|
221
|
+
if (r.isSet() && (s = r.json() ?? 0), s && e - s < Pe)
|
|
231
222
|
return !0;
|
|
232
223
|
const i = {
|
|
233
224
|
projectId: t.projectId,
|
|
234
225
|
path: window.location.pathname
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
const
|
|
238
|
-
return
|
|
226
|
+
}, p = {}, n = document.getElementById("picked_script")?.dataset.verceltoken;
|
|
227
|
+
n && (p["x-vercel-protection-bypass"] = n);
|
|
228
|
+
const l = (await oe(t.apiUrl, "ping", i, p)).ok;
|
|
229
|
+
return l && r.set(e), l;
|
|
239
230
|
} catch (e) {
|
|
240
|
-
return
|
|
231
|
+
return b("error", e), !1;
|
|
241
232
|
}
|
|
242
233
|
};
|
|
243
|
-
function
|
|
234
|
+
function X(t) {
|
|
244
235
|
const e = typeof window < "u", r = {
|
|
245
236
|
client: t,
|
|
246
237
|
responses: t.responses.listStore.getState(),
|
|
@@ -252,386 +243,352 @@ function te(t) {
|
|
|
252
243
|
};
|
|
253
244
|
return Object.freeze(r);
|
|
254
245
|
}
|
|
255
|
-
const
|
|
256
|
-
const e =
|
|
257
|
-
register(
|
|
246
|
+
const Be = F("predicate"), ze = I(({ client: t }) => {
|
|
247
|
+
const e = Be.store({}), r = j(e, {
|
|
248
|
+
register(n, u) {
|
|
258
249
|
return {
|
|
259
|
-
...
|
|
260
|
-
[
|
|
261
|
-
name:
|
|
262
|
-
predicate:
|
|
250
|
+
...n,
|
|
251
|
+
[u.name]: {
|
|
252
|
+
name: u.name,
|
|
253
|
+
predicate: u.predicate
|
|
263
254
|
}
|
|
264
255
|
};
|
|
265
256
|
}
|
|
266
257
|
});
|
|
267
|
-
function n
|
|
268
|
-
e.getState()[
|
|
258
|
+
function s(n, u) {
|
|
259
|
+
e.getState()[n] && b(
|
|
269
260
|
"warn",
|
|
270
|
-
`Predicate '${
|
|
271
|
-
), r.register(Object.freeze({ name:
|
|
261
|
+
`Predicate '${n}' already registered. Registering again will override the previous registration.`
|
|
262
|
+
), r.register(Object.freeze({ name: n, predicate: u }));
|
|
272
263
|
}
|
|
273
|
-
const i = e.map((
|
|
274
|
-
function
|
|
275
|
-
return e.map((
|
|
264
|
+
const i = e.map((n) => Object.values(n));
|
|
265
|
+
function p(n) {
|
|
266
|
+
return e.map((u) => u[n]?.predicate, { skipVoid: !1 });
|
|
276
267
|
}
|
|
277
|
-
function
|
|
278
|
-
const
|
|
268
|
+
function a(n) {
|
|
269
|
+
const u = N(() => {
|
|
279
270
|
}, {
|
|
280
271
|
skipVoid: !1
|
|
281
|
-
}),
|
|
282
|
-
const
|
|
283
|
-
if (!
|
|
272
|
+
}), l = B(async () => {
|
|
273
|
+
const h = p(n).getState();
|
|
274
|
+
if (!h)
|
|
284
275
|
return;
|
|
285
|
-
const
|
|
286
|
-
return (...
|
|
276
|
+
const S = X(t);
|
|
277
|
+
return (...g) => h({ ...S, args: g });
|
|
287
278
|
});
|
|
288
|
-
return
|
|
279
|
+
return w({
|
|
289
280
|
source: { responses: t.responses.listStore, fields: t.fields.listStore },
|
|
290
|
-
target: p
|
|
291
|
-
}), v({
|
|
292
|
-
clock: p.doneData,
|
|
293
|
-
filter: (f) => f !== void 0,
|
|
294
281
|
target: l
|
|
295
|
-
}),
|
|
282
|
+
}), w({
|
|
283
|
+
clock: l.doneData,
|
|
284
|
+
filter: (h) => h !== void 0,
|
|
285
|
+
target: u
|
|
286
|
+
}), l(), u;
|
|
296
287
|
}
|
|
297
288
|
return {
|
|
298
|
-
register:
|
|
299
|
-
getByName:
|
|
289
|
+
register: s,
|
|
290
|
+
getByName: p,
|
|
300
291
|
listStore: i,
|
|
301
|
-
getEvokablePredicate:
|
|
292
|
+
getEvokablePredicate: a
|
|
302
293
|
};
|
|
303
294
|
});
|
|
304
|
-
function
|
|
305
|
-
return
|
|
295
|
+
function Re(t) {
|
|
296
|
+
return x(ze, t);
|
|
306
297
|
}
|
|
307
|
-
const
|
|
298
|
+
const Ce = (t, e, r) => {
|
|
308
299
|
r.register(t, e);
|
|
309
|
-
},
|
|
310
|
-
const e =
|
|
311
|
-
register(
|
|
300
|
+
}, J = F("feature"), Me = I(({ client: t }) => {
|
|
301
|
+
const e = J.store({}), r = J.store([]), s = j(e, {
|
|
302
|
+
register(o, c) {
|
|
312
303
|
return {
|
|
313
|
-
...
|
|
314
|
-
[
|
|
304
|
+
...o,
|
|
305
|
+
[c.id]: c.feature
|
|
315
306
|
};
|
|
316
307
|
}
|
|
317
308
|
});
|
|
318
|
-
function i(
|
|
319
|
-
e.getState()[
|
|
309
|
+
function i(o, c) {
|
|
310
|
+
e.getState()[o] && b(
|
|
320
311
|
"warn",
|
|
321
|
-
`Feature '${
|
|
312
|
+
`Feature '${o}' already registered. Registering again will override the previous registration.`
|
|
322
313
|
);
|
|
323
314
|
const d = {
|
|
324
|
-
id:
|
|
315
|
+
id: o,
|
|
325
316
|
feature: {
|
|
326
|
-
...
|
|
327
|
-
id:
|
|
317
|
+
...c,
|
|
318
|
+
id: o
|
|
328
319
|
}
|
|
329
320
|
};
|
|
330
|
-
|
|
321
|
+
s.register(
|
|
331
322
|
Object.freeze({
|
|
332
|
-
id:
|
|
323
|
+
id: o,
|
|
333
324
|
feature: d
|
|
334
325
|
})
|
|
335
326
|
);
|
|
336
327
|
}
|
|
337
|
-
const
|
|
328
|
+
const p = B(
|
|
338
329
|
async ({
|
|
339
|
-
id:
|
|
340
|
-
key:
|
|
341
|
-
storage:
|
|
330
|
+
id: o,
|
|
331
|
+
key: c,
|
|
332
|
+
storage: f = "local"
|
|
342
333
|
}) => {
|
|
343
|
-
const d =
|
|
344
|
-
return y === null ? null : { id:
|
|
334
|
+
const d = P(`feature:${o}:${c}`, "global"), y = (f === "session" ? C : R).get(d).boolean();
|
|
335
|
+
return y === null ? null : { id: o, key: c, bucket: y, storage: f };
|
|
345
336
|
}
|
|
346
|
-
),
|
|
347
|
-
if (!
|
|
337
|
+
), a = B((o) => {
|
|
338
|
+
if (!o)
|
|
348
339
|
return null;
|
|
349
|
-
const
|
|
350
|
-
(
|
|
351
|
-
}),
|
|
340
|
+
const c = P(`feature:${o.id}:${o.key}`, "global");
|
|
341
|
+
(o.storage === "session" ? C : R).set(c, o.bucket);
|
|
342
|
+
}), n = /* @__PURE__ */ new Map(), u = O({
|
|
352
343
|
source: { allFeaturesStore: e, resolvedFeaturesStore: r },
|
|
353
|
-
effect: async ({ allFeaturesStore:
|
|
354
|
-
const y =
|
|
355
|
-
(
|
|
344
|
+
effect: async ({ allFeaturesStore: o, resolvedFeaturesStore: c }, { id: f, decide: d, key: m }) => {
|
|
345
|
+
const y = c.find(
|
|
346
|
+
($) => $.id === f && $.key === m
|
|
356
347
|
);
|
|
357
348
|
if (y)
|
|
358
349
|
return y;
|
|
359
|
-
const
|
|
360
|
-
if (!
|
|
361
|
-
throw new Error(`Feature with id '${
|
|
362
|
-
const
|
|
363
|
-
if (
|
|
364
|
-
const
|
|
365
|
-
return { id:
|
|
350
|
+
const v = o[f];
|
|
351
|
+
if (!v)
|
|
352
|
+
throw new Error(`Feature with id '${f}' not found`);
|
|
353
|
+
const A = n.get(`${f}:${m}`);
|
|
354
|
+
if (A !== void 0) {
|
|
355
|
+
const $ = await A;
|
|
356
|
+
return { id: v.id, bucket: $, key: m, storage: v.feature.storage };
|
|
366
357
|
}
|
|
367
|
-
const
|
|
368
|
-
|
|
369
|
-
const
|
|
370
|
-
return { id:
|
|
358
|
+
const k = d();
|
|
359
|
+
n.set(`${f}:${m}`, k);
|
|
360
|
+
const Z = await k;
|
|
361
|
+
return { id: v.id, bucket: Z, key: m, storage: v.feature.storage };
|
|
371
362
|
}
|
|
372
363
|
});
|
|
373
|
-
|
|
374
|
-
clock:
|
|
375
|
-
fn: (
|
|
376
|
-
const { id:
|
|
377
|
-
return { id:
|
|
364
|
+
w({
|
|
365
|
+
clock: s.register,
|
|
366
|
+
fn: (o) => {
|
|
367
|
+
const { id: c, feature: f } = o;
|
|
368
|
+
return { id: c, key: f.feature.key, storage: f.feature.storage };
|
|
378
369
|
},
|
|
379
|
-
target:
|
|
380
|
-
}),
|
|
370
|
+
target: p
|
|
371
|
+
}), w({
|
|
381
372
|
source: e,
|
|
382
|
-
clock:
|
|
383
|
-
fn: (
|
|
384
|
-
const { id:
|
|
385
|
-
return y ? { key: y, id:
|
|
373
|
+
clock: u.doneData,
|
|
374
|
+
fn: (o, c) => {
|
|
375
|
+
const { id: f, bucket: d, storage: m } = c, y = o[f]?.feature.key;
|
|
376
|
+
return y ? { key: y, id: f, bucket: d, storage: m } : null;
|
|
386
377
|
},
|
|
387
|
-
target:
|
|
378
|
+
target: a
|
|
388
379
|
});
|
|
389
|
-
const
|
|
380
|
+
const l = U({ allFeaturesStore: e, resolvedFeaturesStore: r }).map(
|
|
390
381
|
({
|
|
391
|
-
allFeaturesStore:
|
|
392
|
-
resolvedFeaturesStore:
|
|
393
|
-
}) => Object.values(
|
|
394
|
-
const d =
|
|
395
|
-
(m) => m.id ===
|
|
382
|
+
allFeaturesStore: o,
|
|
383
|
+
resolvedFeaturesStore: c
|
|
384
|
+
}) => Object.values(o).map((f) => {
|
|
385
|
+
const d = c.find(
|
|
386
|
+
(m) => m.id === f.id && m.key === f.feature.key
|
|
396
387
|
);
|
|
397
388
|
return d ? {
|
|
398
|
-
id:
|
|
399
|
-
name:
|
|
400
|
-
key:
|
|
401
|
-
getBucket: () => ({ id:
|
|
389
|
+
id: f.id,
|
|
390
|
+
name: f.feature.name,
|
|
391
|
+
key: f.feature.key,
|
|
392
|
+
getBucket: () => ({ id: f.id, bucket: d.bucket }),
|
|
402
393
|
isResolved: !0
|
|
403
394
|
} : {
|
|
404
|
-
id:
|
|
405
|
-
name:
|
|
406
|
-
key:
|
|
407
|
-
getBucket: async () => await
|
|
395
|
+
id: f.id,
|
|
396
|
+
name: f.feature.name,
|
|
397
|
+
key: f.feature.key,
|
|
398
|
+
getBucket: async () => await u(f.feature),
|
|
408
399
|
isResolved: !1
|
|
409
400
|
};
|
|
410
401
|
})
|
|
411
402
|
);
|
|
412
|
-
|
|
413
|
-
clock:
|
|
403
|
+
w({
|
|
404
|
+
clock: u.doneData,
|
|
414
405
|
source: { resolvedFeatures: r },
|
|
415
|
-
filter: ({ resolvedFeatures:
|
|
416
|
-
(m) => m.id ===
|
|
406
|
+
filter: ({ resolvedFeatures: o }, { id: c, key: f }) => !o.some(
|
|
407
|
+
(m) => m.id === c && m.key === f
|
|
417
408
|
),
|
|
418
|
-
fn: (
|
|
419
|
-
target: t.eventBus.prepend((
|
|
409
|
+
fn: (o, c) => c,
|
|
410
|
+
target: t.eventBus.prepend((o) => ({
|
|
420
411
|
type: "feature_decide",
|
|
421
|
-
feature:
|
|
412
|
+
feature: o
|
|
422
413
|
}))
|
|
423
|
-
}),
|
|
424
|
-
clock: [
|
|
414
|
+
}), w({
|
|
415
|
+
clock: [p.doneData, u.doneData],
|
|
425
416
|
source: r,
|
|
426
|
-
fn: (
|
|
427
|
-
(d) => d.id ===
|
|
428
|
-
) ?
|
|
417
|
+
fn: (o, c) => !c || o.some(
|
|
418
|
+
(d) => d.id === c.id && d.key === c.key
|
|
419
|
+
) ? o : [...o, c],
|
|
429
420
|
target: r
|
|
430
421
|
});
|
|
431
|
-
function
|
|
432
|
-
return
|
|
422
|
+
function h(o) {
|
|
423
|
+
return l.map((c) => c.find((f) => f.id === o));
|
|
433
424
|
}
|
|
434
|
-
function
|
|
435
|
-
return e.map((
|
|
425
|
+
function S(o) {
|
|
426
|
+
return e.map((c) => c[o], { skipVoid: !1 });
|
|
436
427
|
}
|
|
437
|
-
function
|
|
438
|
-
const
|
|
428
|
+
function g(o) {
|
|
429
|
+
const c = N(
|
|
439
430
|
async () => {
|
|
440
431
|
},
|
|
441
432
|
{ skipVoid: !1 }
|
|
442
|
-
),
|
|
443
|
-
const d =
|
|
433
|
+
), f = B(async () => {
|
|
434
|
+
const d = h(o).getState();
|
|
444
435
|
if (d)
|
|
445
436
|
return async () => (await d.getBucket()).bucket;
|
|
446
437
|
});
|
|
447
|
-
return
|
|
438
|
+
return w({
|
|
448
439
|
source: r,
|
|
449
|
-
filter: (d) => d.some((m) => m.id ===
|
|
450
|
-
target:
|
|
451
|
-
}),
|
|
452
|
-
clock:
|
|
440
|
+
filter: (d) => d.some((m) => m.id === o),
|
|
441
|
+
target: f
|
|
442
|
+
}), w({
|
|
443
|
+
clock: f.doneData,
|
|
453
444
|
filter: (d) => d !== void 0,
|
|
454
|
-
target:
|
|
455
|
-
}),
|
|
445
|
+
target: c
|
|
446
|
+
}), f(), c;
|
|
456
447
|
}
|
|
457
448
|
return {
|
|
458
449
|
register: i,
|
|
459
|
-
getById:
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
450
|
+
getById: h,
|
|
451
|
+
// eslint-disable-next-line sonarjs/deprecation -- kept for backwards compatibility; use getById instead
|
|
452
|
+
getByName: S,
|
|
453
|
+
listStore: l,
|
|
454
|
+
getEvokableFeature: g
|
|
463
455
|
};
|
|
464
456
|
});
|
|
465
|
-
function
|
|
466
|
-
return
|
|
457
|
+
function Oe(t) {
|
|
458
|
+
return x(Me, t);
|
|
467
459
|
}
|
|
468
|
-
const
|
|
460
|
+
const Ue = (t, e, r) => {
|
|
469
461
|
r.register(t, e);
|
|
470
|
-
},
|
|
471
|
-
function
|
|
462
|
+
}, E = F("history");
|
|
463
|
+
function q(t, e) {
|
|
472
464
|
return {
|
|
473
465
|
// eslint-disable-next-line sonarjs/pseudo-random
|
|
474
|
-
id:
|
|
466
|
+
id: ce(`history-entry-${Date.now()}-${Math.random()}}`),
|
|
475
467
|
node: e,
|
|
476
468
|
at: Date.now(),
|
|
477
469
|
experienceId: t
|
|
478
470
|
};
|
|
479
471
|
}
|
|
480
|
-
const
|
|
481
|
-
const t =
|
|
482
|
-
t.on(e, (
|
|
483
|
-
entries: [...
|
|
484
|
-
})), t.on(r, (
|
|
472
|
+
const De = I(() => {
|
|
473
|
+
const t = E.store({ entries: [] }), e = E.event(), r = E.event(), s = E.event(), i = E.event();
|
|
474
|
+
t.on(e, (a, n) => ({
|
|
475
|
+
entries: [...a.entries, q(n.experienceId, n.node)]
|
|
476
|
+
})), t.on(r, (a, n) => ({
|
|
485
477
|
entries: [
|
|
486
|
-
...
|
|
487
|
-
|
|
478
|
+
...a.entries.slice(0, -1),
|
|
479
|
+
q(n.experienceId, n.node)
|
|
488
480
|
]
|
|
489
|
-
})), t.on(i, (
|
|
490
|
-
function
|
|
491
|
-
const
|
|
492
|
-
for (let
|
|
493
|
-
const
|
|
494
|
-
if (!(!
|
|
495
|
-
if (
|
|
496
|
-
|
|
481
|
+
})), t.on(i, (a, n) => n);
|
|
482
|
+
function p(a, n) {
|
|
483
|
+
const u = { lastStepIndex: -1, secondLastStepIndex: -1 };
|
|
484
|
+
for (let l = a.length - 1; l >= 0; l--) {
|
|
485
|
+
const h = a[l], S = h?.node;
|
|
486
|
+
if (!(!S || !se(S)) && !(n && h.experienceId !== n))
|
|
487
|
+
if (u.lastStepIndex === -1)
|
|
488
|
+
u.lastStepIndex = l;
|
|
497
489
|
else {
|
|
498
|
-
|
|
490
|
+
u.secondLastStepIndex = l;
|
|
499
491
|
break;
|
|
500
492
|
}
|
|
501
493
|
}
|
|
502
|
-
return
|
|
494
|
+
return u;
|
|
503
495
|
}
|
|
504
|
-
return t.on(
|
|
505
|
-
const { secondLastStepIndex:
|
|
496
|
+
return t.on(s, (a, n) => {
|
|
497
|
+
const { secondLastStepIndex: u } = p(a.entries, n.experienceId), l = u !== -1 ? a.entries.slice(0, u + 1) : a.entries;
|
|
506
498
|
return {
|
|
507
|
-
...
|
|
508
|
-
entries:
|
|
499
|
+
...a,
|
|
500
|
+
entries: l
|
|
509
501
|
};
|
|
510
502
|
}), {
|
|
511
503
|
push: e,
|
|
512
504
|
replace: r,
|
|
513
|
-
back:
|
|
505
|
+
back: s,
|
|
514
506
|
restore: i,
|
|
515
|
-
entriesStore: t.map((
|
|
507
|
+
entriesStore: t.map((a) => a.entries)
|
|
516
508
|
};
|
|
517
509
|
});
|
|
518
|
-
function
|
|
519
|
-
return
|
|
510
|
+
function Ve() {
|
|
511
|
+
return x(De);
|
|
520
512
|
}
|
|
521
|
-
let
|
|
522
|
-
const
|
|
523
|
-
const e =
|
|
524
|
-
return
|
|
513
|
+
let Ne = 0;
|
|
514
|
+
const Te = (t) => {
|
|
515
|
+
const e = N([]);
|
|
516
|
+
return w({
|
|
525
517
|
clock: t,
|
|
526
518
|
source: e,
|
|
527
|
-
fn: (r,
|
|
519
|
+
fn: (r, s) => [
|
|
528
520
|
...r,
|
|
529
521
|
{
|
|
530
|
-
id:
|
|
522
|
+
id: Ne++,
|
|
531
523
|
at: /* @__PURE__ */ new Date(),
|
|
532
|
-
payload:
|
|
524
|
+
payload: s
|
|
533
525
|
}
|
|
534
526
|
],
|
|
535
527
|
target: e
|
|
536
528
|
}), e;
|
|
537
|
-
},
|
|
538
|
-
const t =
|
|
539
|
-
register(
|
|
529
|
+
}, Le = F("field"), _e = I(() => {
|
|
530
|
+
const t = Le.store({}), e = j(t, {
|
|
531
|
+
register(n, u) {
|
|
540
532
|
return {
|
|
541
|
-
...
|
|
542
|
-
[
|
|
533
|
+
...n,
|
|
534
|
+
[u.field.id]: u.field
|
|
543
535
|
};
|
|
536
|
+
},
|
|
537
|
+
updateById(n, u) {
|
|
538
|
+
const l = n[u.fieldId];
|
|
539
|
+
return l ? { ...n, [u.fieldId]: Object.assign({}, l, u.updates) } : n;
|
|
544
540
|
}
|
|
545
541
|
});
|
|
546
|
-
function r(
|
|
547
|
-
e.register({ field:
|
|
542
|
+
function r(n) {
|
|
543
|
+
e.register({ field: n });
|
|
548
544
|
}
|
|
549
|
-
function n
|
|
550
|
-
|
|
551
|
-
if (!f)
|
|
552
|
-
return;
|
|
553
|
-
const h = Object.assign({}, f, {
|
|
554
|
-
...p
|
|
555
|
-
});
|
|
556
|
-
e.register({ field: { ...h } });
|
|
557
|
-
}
|
|
558
|
-
const i = t.map((l) => Object.values(l));
|
|
559
|
-
function u(l) {
|
|
560
|
-
return t.map((p) => p[l] ?? null);
|
|
545
|
+
function s(n, u) {
|
|
546
|
+
e.updateById({ fieldId: n, updates: u });
|
|
561
547
|
}
|
|
562
|
-
|
|
563
|
-
|
|
548
|
+
const i = t.map((n) => Object.values(n));
|
|
549
|
+
function p(n) {
|
|
550
|
+
return t.map((u) => u[n] || null);
|
|
564
551
|
}
|
|
565
|
-
function
|
|
566
|
-
return t.map((
|
|
552
|
+
function a(n) {
|
|
553
|
+
return t.map((u) => Object.values(u).find((l) => l.name === n) || null);
|
|
567
554
|
}
|
|
568
555
|
return {
|
|
569
556
|
register: r,
|
|
570
|
-
update:
|
|
571
|
-
|
|
572
|
-
getById: u,
|
|
573
|
-
getByKey: s,
|
|
557
|
+
update: s,
|
|
558
|
+
getById: p,
|
|
574
559
|
listStore: i,
|
|
575
|
-
getByName:
|
|
560
|
+
getByName: a
|
|
576
561
|
};
|
|
577
562
|
});
|
|
578
|
-
function
|
|
579
|
-
return
|
|
563
|
+
function He() {
|
|
564
|
+
return x(_e);
|
|
580
565
|
}
|
|
581
|
-
const
|
|
566
|
+
const Ge = (t, e) => {
|
|
582
567
|
e.register(t);
|
|
583
|
-
},
|
|
584
|
-
const t =
|
|
585
|
-
register(
|
|
568
|
+
}, Je = F("action"), qe = I(() => {
|
|
569
|
+
const t = Je.store({}), e = j(t, {
|
|
570
|
+
register(a, n) {
|
|
586
571
|
return {
|
|
587
|
-
...
|
|
588
|
-
[
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
});
|
|
592
|
-
function r(u) {
|
|
593
|
-
e.register({ step: u });
|
|
594
|
-
}
|
|
595
|
-
const n = t.map((u) => Object.values(u));
|
|
596
|
-
function i(u) {
|
|
597
|
-
return t.map((s) => s[u] ?? null);
|
|
598
|
-
}
|
|
599
|
-
return {
|
|
600
|
-
register: r,
|
|
601
|
-
getById: i,
|
|
602
|
-
listStore: n
|
|
603
|
-
};
|
|
604
|
-
});
|
|
605
|
-
function Qe() {
|
|
606
|
-
return b(Ye);
|
|
607
|
-
}
|
|
608
|
-
function Xe(t, e) {
|
|
609
|
-
e.register(t);
|
|
610
|
-
}
|
|
611
|
-
const Ze = j("action"), et = k(() => {
|
|
612
|
-
const t = Ze.store({}), e = w(t, {
|
|
613
|
-
register(s, o) {
|
|
614
|
-
return {
|
|
615
|
-
...s,
|
|
616
|
-
[o.name]: {
|
|
617
|
-
name: o.name,
|
|
618
|
-
action: o.action
|
|
572
|
+
...a,
|
|
573
|
+
[n.name]: {
|
|
574
|
+
name: n.name,
|
|
575
|
+
action: n.action
|
|
619
576
|
}
|
|
620
577
|
};
|
|
621
578
|
}
|
|
622
579
|
});
|
|
623
|
-
function r(
|
|
624
|
-
e.register({ name:
|
|
580
|
+
function r(a, n) {
|
|
581
|
+
e.register({ name: a, action: n });
|
|
625
582
|
}
|
|
626
|
-
const
|
|
627
|
-
function i(
|
|
628
|
-
return t.map((
|
|
583
|
+
const s = t.map((a) => Object.values(a));
|
|
584
|
+
function i(a) {
|
|
585
|
+
return t.map((n) => n[a], { skipVoid: !1 });
|
|
629
586
|
}
|
|
630
|
-
function
|
|
587
|
+
function p(a) {
|
|
631
588
|
return t.map(
|
|
632
|
-
(
|
|
633
|
-
const
|
|
634
|
-
return
|
|
589
|
+
(n) => {
|
|
590
|
+
const u = n[a];
|
|
591
|
+
return u ? u.action : void 0;
|
|
635
592
|
},
|
|
636
593
|
{ skipVoid: !1 }
|
|
637
594
|
);
|
|
@@ -639,277 +596,242 @@ const Ze = j("action"), et = k(() => {
|
|
|
639
596
|
return {
|
|
640
597
|
register: r,
|
|
641
598
|
getByName: i,
|
|
642
|
-
listStore:
|
|
643
|
-
getEvokableAction:
|
|
599
|
+
listStore: s,
|
|
600
|
+
getEvokableAction: p
|
|
644
601
|
};
|
|
645
602
|
});
|
|
646
|
-
function
|
|
647
|
-
return
|
|
603
|
+
function Ke() {
|
|
604
|
+
return x(qe);
|
|
648
605
|
}
|
|
649
|
-
const
|
|
606
|
+
const We = (t, e, r) => {
|
|
650
607
|
r.register(t, e);
|
|
651
608
|
};
|
|
652
|
-
function
|
|
609
|
+
function M(t) {
|
|
653
610
|
return typeof t > "u" || t === null || t === "" || Array.isArray(t) && !t.length;
|
|
654
611
|
}
|
|
655
|
-
function
|
|
612
|
+
function Ye(t) {
|
|
656
613
|
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null;
|
|
657
614
|
}
|
|
658
|
-
function
|
|
615
|
+
function K(t) {
|
|
659
616
|
try {
|
|
660
617
|
return JSON.stringify(t), !0;
|
|
661
618
|
} catch {
|
|
662
619
|
return !1;
|
|
663
620
|
}
|
|
664
621
|
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
function it(t, e) {
|
|
669
|
-
return t.multiple && (typeof e == "string" || typeof e == "number" || typeof e == "boolean") ? [e] : e;
|
|
670
|
-
}
|
|
671
|
-
function ot(t, e, r) {
|
|
672
|
-
if (t.type !== "object" || T(r)) return null;
|
|
673
|
-
if (t.multiple) {
|
|
674
|
-
if (!Array.isArray(r))
|
|
675
|
-
return {
|
|
676
|
-
fieldId: e,
|
|
677
|
-
userMessage: "This field expects multiple values",
|
|
678
|
-
systemMessage: "Field expects an array of objects.",
|
|
679
|
-
value: r
|
|
680
|
-
};
|
|
681
|
-
for (const n of r) {
|
|
682
|
-
if (typeof n != "object" || n === null)
|
|
683
|
-
return {
|
|
684
|
-
fieldId: e,
|
|
685
|
-
userMessage: "This field expects object values",
|
|
686
|
-
systemMessage: "Field expects an array of objects, but received non-object value.",
|
|
687
|
-
value: r
|
|
688
|
-
};
|
|
689
|
-
if (!X(n))
|
|
690
|
-
return {
|
|
691
|
-
fieldId: e,
|
|
692
|
-
userMessage: "This field contains non-serializable data",
|
|
693
|
-
systemMessage: "Field value contains non-JSON-serializable data (functions, circular references, etc.).",
|
|
694
|
-
value: r
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
return null;
|
|
698
|
-
}
|
|
699
|
-
return Array.isArray(r) ? {
|
|
700
|
-
fieldId: e,
|
|
701
|
-
userMessage: "This field expects a single value",
|
|
702
|
-
systemMessage: "Field expects a single object, not an array.",
|
|
703
|
-
value: r
|
|
704
|
-
} : typeof r != "object" || r === null ? {
|
|
705
|
-
fieldId: e,
|
|
706
|
-
userMessage: "This field expects an object value",
|
|
707
|
-
systemMessage: "Field expects an object value.",
|
|
708
|
-
value: r
|
|
709
|
-
} : X(r) ? null : {
|
|
710
|
-
fieldId: e,
|
|
711
|
-
userMessage: "This field contains non-serializable data",
|
|
712
|
-
systemMessage: "Field value contains non-JSON-serializable data (functions, circular references, etc.).",
|
|
713
|
-
value: r
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
function at(t, e, r) {
|
|
717
|
-
if (!Array.isArray(t.options) || t.options.length === 0) return null;
|
|
718
|
-
const n = Array.isArray(r) ? r : [r];
|
|
719
|
-
if (t.type === "object") {
|
|
720
|
-
const s = t.options.map((l) => JSON.stringify(l.value));
|
|
721
|
-
return n.every((l) => s.includes(JSON.stringify(l))) ? null : {
|
|
722
|
-
fieldId: e,
|
|
723
|
-
userMessage: "This field expects a valid option",
|
|
724
|
-
systemMessage: "Field expects a valid option from the defined choices.",
|
|
725
|
-
value: r
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
const i = t.options.map((s) => s.value);
|
|
729
|
-
return n.every((s) => !nt(s) || s === null ? !1 : i.includes(s)) ? null : {
|
|
730
|
-
fieldId: e,
|
|
731
|
-
userMessage: "This field expects a valid option",
|
|
732
|
-
systemMessage: `Field expects a valid option. Valid options are: ${i.join(", ")}`,
|
|
733
|
-
value: r
|
|
734
|
-
};
|
|
735
|
-
}
|
|
736
|
-
const ct = j("response"), ut = k(({ client: t }) => {
|
|
737
|
-
const e = ct.store({}), r = D(), n = D(), i = w(e, {
|
|
738
|
-
register(a, c) {
|
|
622
|
+
const Qe = F("response"), Xe = I(({ client: t }) => {
|
|
623
|
+
const e = Qe.store({}), r = D(), s = D(), i = j(e, {
|
|
624
|
+
register(g, o) {
|
|
739
625
|
return {
|
|
740
|
-
...
|
|
741
|
-
[
|
|
626
|
+
...g,
|
|
627
|
+
[o.fieldId]: o.response
|
|
742
628
|
};
|
|
743
629
|
},
|
|
744
|
-
registerBatch(
|
|
630
|
+
registerBatch(g, o) {
|
|
745
631
|
return {
|
|
746
|
-
...
|
|
747
|
-
...
|
|
632
|
+
...g,
|
|
633
|
+
...o
|
|
748
634
|
};
|
|
749
635
|
},
|
|
750
|
-
clear(
|
|
751
|
-
|
|
636
|
+
clear(g, o) {
|
|
637
|
+
const { [o]: c, ...f } = g;
|
|
638
|
+
return f;
|
|
752
639
|
},
|
|
753
640
|
clearAll() {
|
|
754
641
|
return {};
|
|
755
642
|
}
|
|
756
643
|
});
|
|
757
|
-
function
|
|
758
|
-
if (typeof
|
|
759
|
-
if (
|
|
644
|
+
function p(g, o) {
|
|
645
|
+
if (typeof g == "string") {
|
|
646
|
+
if (o === void 0)
|
|
760
647
|
throw new Error("Response is required when registering a single field");
|
|
761
|
-
i.register({ fieldId:
|
|
648
|
+
i.register({ fieldId: g, response: o });
|
|
762
649
|
} else
|
|
763
|
-
i.registerBatch(
|
|
764
|
-
}
|
|
765
|
-
async function s(a, c, d) {
|
|
766
|
-
if (a.validation && !fe(a.validation) && !T(d)) {
|
|
767
|
-
const m = await _(t, a.validation, { $input: d });
|
|
768
|
-
if (typeof m == "string")
|
|
769
|
-
return {
|
|
770
|
-
fieldId: c,
|
|
771
|
-
userMessage: m,
|
|
772
|
-
systemMessage: `Field validation resulted in an error: ${m}.`,
|
|
773
|
-
value: d
|
|
774
|
-
};
|
|
775
|
-
if (m === !1)
|
|
776
|
-
return {
|
|
777
|
-
fieldId: c,
|
|
778
|
-
userMessage: "This field is invalid",
|
|
779
|
-
systemMessage: "Field validation resulted in an unspecified error.",
|
|
780
|
-
value: d
|
|
781
|
-
};
|
|
782
|
-
}
|
|
783
|
-
return a.required && T(d) ? {
|
|
784
|
-
fieldId: c,
|
|
785
|
-
userMessage: "This field is required",
|
|
786
|
-
systemMessage: "Field is required.",
|
|
787
|
-
value: d
|
|
788
|
-
} : !a.multiple && Array.isArray(d) && d.length > 1 ? {
|
|
789
|
-
fieldId: c,
|
|
790
|
-
userMessage: "This field expects a single response",
|
|
791
|
-
systemMessage: "Field expects a single response.",
|
|
792
|
-
value: d
|
|
793
|
-
} : null;
|
|
650
|
+
i.registerBatch(g);
|
|
794
651
|
}
|
|
795
|
-
async function
|
|
796
|
-
const
|
|
652
|
+
async function a(g) {
|
|
653
|
+
const o = [];
|
|
797
654
|
return await Promise.allSettled(
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
655
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity -- comprehensive validation logic; refactoring would harm readability
|
|
656
|
+
Object.entries(g).map(async ([c, f]) => {
|
|
657
|
+
let d = f;
|
|
658
|
+
const m = t.fields.getById(c).getState();
|
|
659
|
+
if (!m) {
|
|
660
|
+
o.push({
|
|
661
|
+
fieldId: c,
|
|
662
|
+
userMessage: `Field '${c}' not found`,
|
|
663
|
+
systemMessage: `No field with ID '${c}' exists. Available field IDs are: ${Object.keys(t.fields.listStore.getState()).join(",")}.`,
|
|
664
|
+
value: d
|
|
806
665
|
});
|
|
807
666
|
return;
|
|
808
667
|
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
668
|
+
if (m.multiple && (typeof d == "string" || typeof d == "number" || typeof d == "boolean") && (d = [d]), m.validation && !ue(m.validation) && !M(d)) {
|
|
669
|
+
const y = { ...e.getState(), ...g }, v = await T(t, m.validation, {
|
|
670
|
+
$input: d,
|
|
671
|
+
responses: y
|
|
672
|
+
});
|
|
673
|
+
if (typeof v == "string") {
|
|
674
|
+
o.push({
|
|
675
|
+
fieldId: c,
|
|
676
|
+
userMessage: v,
|
|
677
|
+
systemMessage: `Field validation resulted in an error: ${v}.`,
|
|
678
|
+
value: d
|
|
679
|
+
});
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
if (v === !1) {
|
|
683
|
+
o.push({
|
|
684
|
+
fieldId: c,
|
|
685
|
+
userMessage: "This field is invalid",
|
|
686
|
+
systemMessage: "Field validation resulted in an unspecified error.",
|
|
687
|
+
value: d
|
|
688
|
+
});
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
if (m.required && M(d)) {
|
|
693
|
+
o.push({
|
|
694
|
+
fieldId: c,
|
|
695
|
+
userMessage: "This field is required",
|
|
696
|
+
systemMessage: "Field is required.",
|
|
697
|
+
value: d
|
|
698
|
+
});
|
|
812
699
|
return;
|
|
813
700
|
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
701
|
+
if (!m.multiple && Array.isArray(d) && d.length > 1) {
|
|
702
|
+
o.push({
|
|
703
|
+
fieldId: c,
|
|
704
|
+
userMessage: "This field expects a single response",
|
|
705
|
+
systemMessage: "Field expects a single response.",
|
|
706
|
+
value: d
|
|
707
|
+
});
|
|
817
708
|
return;
|
|
818
709
|
}
|
|
819
|
-
|
|
820
|
-
|
|
710
|
+
if (m.type === "object" && !M(d))
|
|
711
|
+
if (m.multiple) {
|
|
712
|
+
if (!Array.isArray(d)) {
|
|
713
|
+
o.push({
|
|
714
|
+
fieldId: c,
|
|
715
|
+
userMessage: "This field expects multiple values",
|
|
716
|
+
systemMessage: "Field expects an array of objects.",
|
|
717
|
+
value: d
|
|
718
|
+
});
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
for (const y of d) {
|
|
722
|
+
if (typeof y != "object" || y === null) {
|
|
723
|
+
o.push({
|
|
724
|
+
fieldId: c,
|
|
725
|
+
userMessage: "This field expects object values",
|
|
726
|
+
systemMessage: "Field expects an array of objects, but received non-object value.",
|
|
727
|
+
value: d
|
|
728
|
+
});
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
if (!K(y)) {
|
|
732
|
+
o.push({
|
|
733
|
+
fieldId: c,
|
|
734
|
+
userMessage: "This field contains non-serializable data",
|
|
735
|
+
systemMessage: "Field value contains non-JSON-serializable data (functions, circular references, etc.).",
|
|
736
|
+
value: d
|
|
737
|
+
});
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
} else {
|
|
742
|
+
if (Array.isArray(d)) {
|
|
743
|
+
o.push({
|
|
744
|
+
fieldId: c,
|
|
745
|
+
userMessage: "This field expects a single value",
|
|
746
|
+
systemMessage: "Field expects a single object, not an array.",
|
|
747
|
+
value: d
|
|
748
|
+
});
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
751
|
+
if (typeof d != "object" || d === null) {
|
|
752
|
+
o.push({
|
|
753
|
+
fieldId: c,
|
|
754
|
+
userMessage: "This field expects an object value",
|
|
755
|
+
systemMessage: "Field expects an object value.",
|
|
756
|
+
value: d
|
|
757
|
+
});
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
if (!K(d)) {
|
|
761
|
+
o.push({
|
|
762
|
+
fieldId: c,
|
|
763
|
+
userMessage: "This field contains non-serializable data",
|
|
764
|
+
systemMessage: "Field value contains non-JSON-serializable data (functions, circular references, etc.).",
|
|
765
|
+
value: d
|
|
766
|
+
});
|
|
767
|
+
return;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
if (Array.isArray(m.options) && m.options.length > 0) {
|
|
771
|
+
const y = Array.isArray(d) ? d : [d];
|
|
772
|
+
if (m.type === "object") {
|
|
773
|
+
const v = m.options.map((k) => JSON.stringify(k.value));
|
|
774
|
+
y.every((k) => v.includes(JSON.stringify(k))) || o.push({
|
|
775
|
+
fieldId: c,
|
|
776
|
+
userMessage: "This field expects a valid option",
|
|
777
|
+
systemMessage: "Field expects a valid option from the defined choices.",
|
|
778
|
+
value: d
|
|
779
|
+
});
|
|
780
|
+
} else {
|
|
781
|
+
const v = m.options.map((k) => k.value);
|
|
782
|
+
y.every((k) => !Ye(k) || k === null ? !1 : v.includes(k)) || o.push({
|
|
783
|
+
fieldId: c,
|
|
784
|
+
userMessage: "This field expects a valid option",
|
|
785
|
+
systemMessage: `Field expects a valid option. Valid options are: ${v.join(", ")}`,
|
|
786
|
+
value: d
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
}
|
|
821
790
|
})
|
|
822
|
-
), { responsesToCommit:
|
|
791
|
+
), { responsesToCommit: g, validationErrors: o };
|
|
823
792
|
}
|
|
824
|
-
async function
|
|
825
|
-
const { responsesToCommit:
|
|
826
|
-
return
|
|
793
|
+
async function n(g) {
|
|
794
|
+
const { responsesToCommit: o, validationErrors: c } = await a(g);
|
|
795
|
+
return c.length ? { errors: c } : (i.registerBatch(o), { errors: [] });
|
|
827
796
|
}
|
|
828
|
-
const
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
value: m
|
|
836
|
-
};
|
|
837
|
-
})
|
|
838
|
-
);
|
|
839
|
-
function h(a) {
|
|
840
|
-
const c = t.fields.listStore.map(
|
|
841
|
-
(m) => m.find((y) => y.id === a) ?? null
|
|
842
|
-
), d = e.map((m) => m[a] ?? null);
|
|
843
|
-
return A({ f: c, r: d }, ({ f: m, r: y }) => y !== null ? y : m?.defaultValue ? m.defaultValue : null);
|
|
844
|
-
}
|
|
845
|
-
function S(a) {
|
|
846
|
-
const c = t.fields.getByKey(a);
|
|
847
|
-
return A({ f: c, s: e }, ({ f: d, s: m }) => {
|
|
848
|
-
const y = d ? m[d.id] ?? null : null;
|
|
849
|
-
return y || (d?.defaultValue ? d.defaultValue : null);
|
|
850
|
-
});
|
|
797
|
+
const u = e.map((g) => g), l = e.map((g) => Object.keys(g).map((c) => ({
|
|
798
|
+
fieldId: c,
|
|
799
|
+
value: g[c]
|
|
800
|
+
})));
|
|
801
|
+
function h(g) {
|
|
802
|
+
const o = t.fields.getById(g), c = e.map((f) => f[g] || null);
|
|
803
|
+
return U({ f: o, r: c }, ({ f, r: d }) => d || (f?.defaultValue ? f.defaultValue : null));
|
|
851
804
|
}
|
|
852
|
-
function g
|
|
853
|
-
const
|
|
854
|
-
return
|
|
855
|
-
const
|
|
856
|
-
return
|
|
805
|
+
function S(g) {
|
|
806
|
+
const o = t.fields.getByName(g);
|
|
807
|
+
return U({ f: o, s: e }, ({ f: c, s: f }) => {
|
|
808
|
+
const d = c && f[c.id] || null;
|
|
809
|
+
return d || (c?.defaultValue ? c.defaultValue : null);
|
|
857
810
|
});
|
|
858
811
|
}
|
|
859
|
-
return
|
|
812
|
+
return w({
|
|
860
813
|
clock: r,
|
|
861
814
|
target: i.clearAll
|
|
862
|
-
}),
|
|
863
|
-
clock:
|
|
815
|
+
}), w({
|
|
816
|
+
clock: s,
|
|
864
817
|
target: i.clear
|
|
865
818
|
}), {
|
|
866
|
-
register:
|
|
819
|
+
register: p,
|
|
867
820
|
clearAll: r,
|
|
868
|
-
clear:
|
|
869
|
-
commit:
|
|
870
|
-
getResponsesToCommit:
|
|
871
|
-
listStore:
|
|
872
|
-
getAllStore:
|
|
873
|
-
// eslint-disable-next-line sonarjs/deprecation -- returned for backwards compatibility; callers should use getByFieldKey
|
|
821
|
+
clear: s,
|
|
822
|
+
commit: n,
|
|
823
|
+
getResponsesToCommit: a,
|
|
824
|
+
listStore: l,
|
|
825
|
+
getAllStore: u,
|
|
874
826
|
getByFieldId: h,
|
|
875
|
-
|
|
876
|
-
getByFieldName: g
|
|
827
|
+
getByFieldName: S
|
|
877
828
|
};
|
|
878
829
|
});
|
|
879
|
-
function
|
|
880
|
-
return
|
|
830
|
+
function Ze(t) {
|
|
831
|
+
return x(Xe, t);
|
|
881
832
|
}
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
register(s, o) {
|
|
885
|
-
return {
|
|
886
|
-
...s,
|
|
887
|
-
[o.condition.id]: o.condition
|
|
888
|
-
};
|
|
889
|
-
}
|
|
890
|
-
});
|
|
891
|
-
function r(s) {
|
|
892
|
-
e.register({ condition: s });
|
|
893
|
-
}
|
|
894
|
-
const n = t.map((s) => Object.values(s));
|
|
895
|
-
function i(s) {
|
|
896
|
-
return t.map((o) => o[s] ?? null);
|
|
897
|
-
}
|
|
898
|
-
function u(s) {
|
|
899
|
-
return t.map((o) => Object.values(o).find((l) => l.key === s) ?? null);
|
|
900
|
-
}
|
|
901
|
-
return {
|
|
902
|
-
register: r,
|
|
903
|
-
getById: i,
|
|
904
|
-
getByKey: u,
|
|
905
|
-
listStore: n
|
|
906
|
-
};
|
|
907
|
-
});
|
|
908
|
-
function pt() {
|
|
909
|
-
return b(ft);
|
|
910
|
-
}
|
|
911
|
-
function gt() {
|
|
912
|
-
if (H()) {
|
|
833
|
+
function et() {
|
|
834
|
+
if (L()) {
|
|
913
835
|
const t = [
|
|
914
836
|
document.currentScript,
|
|
915
837
|
document.getElementById("picked_script"),
|
|
@@ -923,70 +845,70 @@ function gt() {
|
|
|
923
845
|
}
|
|
924
846
|
return "https://api.picked.app";
|
|
925
847
|
}
|
|
926
|
-
function
|
|
927
|
-
if (!
|
|
848
|
+
function tt() {
|
|
849
|
+
if (!_())
|
|
928
850
|
return {};
|
|
929
851
|
const t = new URLSearchParams(window.location.search), e = {}, r = /* @__PURE__ */ new Set();
|
|
930
852
|
for (const [i] of t.entries())
|
|
931
853
|
i.startsWith("picked-") && r.add(i);
|
|
932
854
|
for (const i of r) {
|
|
933
|
-
const
|
|
934
|
-
e[
|
|
855
|
+
const p = i.replace("picked-", "");
|
|
856
|
+
e[p] = t.getAll(i);
|
|
935
857
|
}
|
|
936
|
-
const
|
|
858
|
+
const s = P("s");
|
|
937
859
|
if (r.size > 0)
|
|
938
|
-
|
|
860
|
+
C.set(s, e);
|
|
939
861
|
else {
|
|
940
|
-
const i =
|
|
862
|
+
const i = C.get(s);
|
|
941
863
|
if (i)
|
|
942
864
|
return i.json() || {};
|
|
943
865
|
}
|
|
944
866
|
return e;
|
|
945
867
|
}
|
|
946
|
-
function
|
|
947
|
-
if (
|
|
868
|
+
function rt() {
|
|
869
|
+
if (le())
|
|
948
870
|
return crypto.randomUUID();
|
|
949
|
-
const t = Date.now().toString(36), e = Math.random().toString(36).substring(2, 15), r = Math.random().toString(36).substring(2, 15),
|
|
950
|
-
return `${t}-${e}-${r}-${
|
|
871
|
+
const t = Date.now().toString(36), e = Math.random().toString(36).substring(2, 15), r = Math.random().toString(36).substring(2, 15), s = Math.random().toString(36).substring(2, 15);
|
|
872
|
+
return `${t}-${e}-${r}-${s}`;
|
|
951
873
|
}
|
|
952
|
-
const
|
|
953
|
-
const t = R.get(
|
|
874
|
+
const st = P("session", "global"), nt = () => {
|
|
875
|
+
const t = R.get(st);
|
|
954
876
|
let e;
|
|
955
877
|
t.isSet() && (e = t.json());
|
|
956
878
|
const r = (i) => t.set({
|
|
957
879
|
id: i.id,
|
|
958
880
|
isUser: i.isUser,
|
|
959
881
|
identifiers: i.identifiers
|
|
960
|
-
}),
|
|
961
|
-
id: e?.id ??
|
|
882
|
+
}), s = {
|
|
883
|
+
id: e?.id ?? rt(),
|
|
962
884
|
isUser: e?.isUser ?? void 0,
|
|
963
885
|
identifiers: e?.identifiers ?? void 0,
|
|
964
886
|
setIsUser(i) {
|
|
965
887
|
this.isUser = i, r(this);
|
|
966
888
|
},
|
|
967
|
-
setIdentifier(i,
|
|
968
|
-
this.identifiers = { ...this.identifiers, [i]:
|
|
889
|
+
setIdentifier(i, p) {
|
|
890
|
+
this.identifiers = { ...this.identifiers, [i]: p }, r(this);
|
|
969
891
|
},
|
|
970
892
|
removeIdentifier(i) {
|
|
971
893
|
this.identifiers && (this.identifiers = Object.fromEntries(
|
|
972
|
-
Object.entries(this.identifiers).filter(([
|
|
894
|
+
Object.entries(this.identifiers).filter(([p]) => p !== i)
|
|
973
895
|
), this.identifiers = Object.keys(this.identifiers).length ? this.identifiers : void 0, r(this));
|
|
974
896
|
}
|
|
975
897
|
};
|
|
976
|
-
return r(
|
|
977
|
-
},
|
|
978
|
-
function
|
|
979
|
-
if (
|
|
898
|
+
return r(s), s;
|
|
899
|
+
}, it = () => de() ? nt() : null;
|
|
900
|
+
function ot() {
|
|
901
|
+
if (_())
|
|
980
902
|
return globalThis.window.pickedConfig;
|
|
981
903
|
}
|
|
982
|
-
function
|
|
983
|
-
if (!
|
|
904
|
+
function at() {
|
|
905
|
+
if (!_())
|
|
984
906
|
return;
|
|
985
|
-
const t =
|
|
907
|
+
const t = ot(), e = t?.organizationId, r = t?.projectId;
|
|
986
908
|
return e && r ? { organizationId: e, projectId: r } : void 0;
|
|
987
909
|
}
|
|
988
|
-
function
|
|
989
|
-
if (!
|
|
910
|
+
function ct() {
|
|
911
|
+
if (!L())
|
|
990
912
|
return;
|
|
991
913
|
const t = document.getElementById("picked_script") || document.querySelector("script#picked") || // legacy support for 'cvly' script tag
|
|
992
914
|
document.getElementById("cvly");
|
|
@@ -995,14 +917,14 @@ function It() {
|
|
|
995
917
|
const e = t.dataset.organizationid || t.getAttribute("organization-id"), r = t.dataset.projectid || t.getAttribute("project-id");
|
|
996
918
|
return e && r ? { organizationId: e, projectId: r } : void 0;
|
|
997
919
|
}
|
|
998
|
-
function
|
|
920
|
+
function ut(t) {
|
|
999
921
|
const { organizationId: e, projectId: r } = t;
|
|
1000
922
|
if (e && r)
|
|
1001
923
|
return { organizationId: e, projectId: r };
|
|
1002
|
-
const
|
|
1003
|
-
if (
|
|
1004
|
-
return
|
|
1005
|
-
const i =
|
|
924
|
+
const s = at();
|
|
925
|
+
if (s)
|
|
926
|
+
return s;
|
|
927
|
+
const i = ct();
|
|
1006
928
|
if (i)
|
|
1007
929
|
return i;
|
|
1008
930
|
throw new Error(
|
|
@@ -1012,13 +934,13 @@ function vt(t) {
|
|
|
1012
934
|
(3) a <script> tag with id 'picked_script', 'picked', or 'cvly' that includes data-organizationid/data-projectid (or organization-id/project-id) attributes.`
|
|
1013
935
|
);
|
|
1014
936
|
}
|
|
1015
|
-
function
|
|
937
|
+
function z(t) {
|
|
1016
938
|
return t == null || t === "" || Number.isNaN(t);
|
|
1017
939
|
}
|
|
1018
|
-
const
|
|
1019
|
-
default: (t, e) =>
|
|
1020
|
-
append: (t, e) => e && !
|
|
1021
|
-
prepend: (t, e) => e && !
|
|
940
|
+
const dt = {
|
|
941
|
+
default: (t, e) => z(t) ? String(e ?? "") : String(t),
|
|
942
|
+
append: (t, e) => e && !z(t) ? `${t} ${e}` : t,
|
|
943
|
+
prepend: (t, e) => e && !z(t) ? `${e} ${t}` : t,
|
|
1022
944
|
upper: (t) => typeof t == "string" ? t.toUpperCase() : t,
|
|
1023
945
|
lower: (t) => typeof t == "string" ? t.toLowerCase() : t,
|
|
1024
946
|
capitalize: (t) => typeof t == "string" ? t.charAt(0).toUpperCase() + t.slice(1) : t,
|
|
@@ -1029,53 +951,53 @@ const Ft = {
|
|
|
1029
951
|
if (Array.isArray(t))
|
|
1030
952
|
return e.format(t.map(String));
|
|
1031
953
|
if (t instanceof Map) {
|
|
1032
|
-
const r = Array.from(t.entries()).map(([
|
|
954
|
+
const r = Array.from(t.entries()).map(([s, i]) => `${s}: ${i}`);
|
|
1033
955
|
return e.format(r);
|
|
1034
956
|
}
|
|
1035
957
|
return t instanceof Set ? e.format(Array.from(t).map(String)) : t;
|
|
1036
958
|
}
|
|
1037
959
|
};
|
|
1038
|
-
function
|
|
960
|
+
function lt(t) {
|
|
1039
961
|
return typeof t == "object" && t !== null;
|
|
1040
962
|
}
|
|
1041
|
-
function
|
|
963
|
+
function pt(t, e) {
|
|
1042
964
|
let r = e;
|
|
1043
|
-
for (const
|
|
1044
|
-
if (
|
|
1045
|
-
r = r[
|
|
965
|
+
for (const s of t.split("."))
|
|
966
|
+
if (lt(r) && s in r)
|
|
967
|
+
r = r[s];
|
|
1046
968
|
else
|
|
1047
969
|
return;
|
|
1048
970
|
return typeof r == "function" ? r() : r;
|
|
1049
971
|
}
|
|
1050
|
-
function
|
|
1051
|
-
const r = t.split("|").map((
|
|
1052
|
-
let i =
|
|
1053
|
-
for (const
|
|
1054
|
-
const [
|
|
1055
|
-
|
|
972
|
+
function ft(t, e) {
|
|
973
|
+
const r = t.split("|").map((p) => p.trim()), s = r.shift() ?? "";
|
|
974
|
+
let i = pt(s, e);
|
|
975
|
+
for (const p of r) {
|
|
976
|
+
const [a, ...n] = p.split(":"), u = a?.trim() ?? "", l = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), h = dt[u];
|
|
977
|
+
h && (i = h(i, l));
|
|
1056
978
|
}
|
|
1057
|
-
return
|
|
979
|
+
return z(i) ? "" : typeof i == "object" ? JSON.stringify(i) : String(i);
|
|
1058
980
|
}
|
|
1059
|
-
function
|
|
1060
|
-
let r = "",
|
|
1061
|
-
for (;
|
|
1062
|
-
if (t[
|
|
1063
|
-
|
|
981
|
+
function gt(t, e) {
|
|
982
|
+
let r = "", s = 0;
|
|
983
|
+
for (; s < t.length; )
|
|
984
|
+
if (t[s] === "{" && t[s + 1] === "{") {
|
|
985
|
+
s += 2;
|
|
1064
986
|
let i = "";
|
|
1065
|
-
for (;
|
|
1066
|
-
if (t[
|
|
1067
|
-
|
|
987
|
+
for (; s < t.length; ) {
|
|
988
|
+
if (t[s] === "}" && t[s + 1] === "}") {
|
|
989
|
+
s += 2;
|
|
1068
990
|
break;
|
|
1069
991
|
}
|
|
1070
|
-
i += t[
|
|
992
|
+
i += t[s++];
|
|
1071
993
|
}
|
|
1072
|
-
r +=
|
|
994
|
+
r += ft(i.trim(), e);
|
|
1073
995
|
} else
|
|
1074
|
-
r += t[
|
|
996
|
+
r += t[s++];
|
|
1075
997
|
return r;
|
|
1076
998
|
}
|
|
1077
|
-
class
|
|
1078
|
-
static logger =
|
|
999
|
+
class mt {
|
|
1000
|
+
static logger = b;
|
|
1079
1001
|
options;
|
|
1080
1002
|
isReady = !1;
|
|
1081
1003
|
project;
|
|
@@ -1092,77 +1014,69 @@ class At {
|
|
|
1092
1014
|
precondition;
|
|
1093
1015
|
condition;
|
|
1094
1016
|
preconditionPassed;
|
|
1095
|
-
searchParams =
|
|
1096
|
-
history =
|
|
1097
|
-
components =
|
|
1098
|
-
experienceInstances =
|
|
1099
|
-
experiences =
|
|
1100
|
-
frameworks =
|
|
1101
|
-
predicates =
|
|
1102
|
-
features =
|
|
1103
|
-
|
|
1104
|
-
fields =
|
|
1105
|
-
|
|
1106
|
-
steps = Qe();
|
|
1107
|
-
actions = tt();
|
|
1017
|
+
searchParams = tt();
|
|
1018
|
+
history = Ve();
|
|
1019
|
+
components = Ie({ client: this });
|
|
1020
|
+
experienceInstances = ne({ client: this });
|
|
1021
|
+
experiences = he({ client: this });
|
|
1022
|
+
frameworks = je({ client: this });
|
|
1023
|
+
predicates = Re({ client: this });
|
|
1024
|
+
features = Oe({ client: this });
|
|
1025
|
+
responses = Ze({ client: this });
|
|
1026
|
+
fields = He();
|
|
1027
|
+
actions = Ke();
|
|
1108
1028
|
constructor(e) {
|
|
1109
|
-
|
|
1110
|
-
const { organizationId: r, projectId:
|
|
1111
|
-
this.organizationId = r, this.projectId =
|
|
1029
|
+
b("info", "Picked client initializing."), this.events = Te(this.eventBus);
|
|
1030
|
+
const { organizationId: r, projectId: s } = ut(e);
|
|
1031
|
+
this.organizationId = r, this.projectId = s, this.options = Object.freeze(e), this.apiUrl = e.apiUrl || et(), this.dashboardUrl = e.dashboardUrl ?? "https://dashboard.picked.app", this.documentationSiteUrl = e.documentationSiteUrl ?? "https://docs.picked.app", this.session = it(), this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.setupComponents(), this.precondition = e.precondition, this.condition = e.condition, this.eventBus({ type: "load", version: ae() }), b("info", "Picked client initialized.");
|
|
1112
1032
|
}
|
|
1113
1033
|
start = () => {
|
|
1114
|
-
|
|
1115
|
-
if (!
|
|
1034
|
+
$e(this), (async () => {
|
|
1035
|
+
if (!L())
|
|
1116
1036
|
return;
|
|
1117
1037
|
await this.runPluginStartHooks();
|
|
1118
1038
|
const r = await this.evaluateGate(this.precondition);
|
|
1119
1039
|
this.preconditionPassed = r;
|
|
1120
|
-
let
|
|
1121
|
-
r && (
|
|
1122
|
-
const i = r &&
|
|
1123
|
-
if (typeof
|
|
1124
|
-
const
|
|
1125
|
-
this.session.setIsUser(
|
|
1040
|
+
let s;
|
|
1041
|
+
r && (s = await this.evaluateGate(this.condition));
|
|
1042
|
+
const i = r && s === !0;
|
|
1043
|
+
if (typeof s == "boolean" && this.session) {
|
|
1044
|
+
const p = s;
|
|
1045
|
+
this.session.setIsUser(p), this.eventBus({ type: "user_decide", value: p });
|
|
1126
1046
|
}
|
|
1127
|
-
if (this.eventBus({ type: "initialize" }), i &&
|
|
1128
|
-
const { id:
|
|
1129
|
-
this.eventBus({ type: "session", id:
|
|
1047
|
+
if (this.eventBus({ type: "initialize" }), i && H(this), await ie(), i && H(this), this.eventBus({ type: "ready" }), this.isReady = !0, this.session) {
|
|
1048
|
+
const { id: p, isUser: a, identifiers: n } = this.session;
|
|
1049
|
+
this.eventBus({ type: "session", id: p, isUser: a, identifiers: n });
|
|
1130
1050
|
}
|
|
1131
1051
|
})();
|
|
1132
1052
|
};
|
|
1133
1053
|
registerFramework = (e) => {
|
|
1134
|
-
|
|
1054
|
+
Ee(e, this.frameworks);
|
|
1135
1055
|
};
|
|
1136
1056
|
registerComponent = (e, r) => {
|
|
1137
|
-
|
|
1057
|
+
G(e, r, this.components);
|
|
1138
1058
|
};
|
|
1139
1059
|
registerPlugin = (e) => {
|
|
1140
|
-
|
|
1060
|
+
Se(this, e, this.plugins);
|
|
1141
1061
|
const r = this.plugins[e.name];
|
|
1142
1062
|
r?.onStart && this.pluginStartHooks.push(r.onStart);
|
|
1143
1063
|
};
|
|
1144
1064
|
registerFeature = (e, r) => {
|
|
1145
|
-
|
|
1065
|
+
Ue(e, r, this.features);
|
|
1146
1066
|
};
|
|
1147
1067
|
registerPredicate = (e, r) => {
|
|
1148
|
-
|
|
1149
|
-
};
|
|
1150
|
-
registerCondition = (e) => {
|
|
1151
|
-
this.conditions.register(e);
|
|
1068
|
+
Ce(e, r, this.predicates);
|
|
1152
1069
|
};
|
|
1153
1070
|
registerField = (e) => {
|
|
1154
|
-
|
|
1155
|
-
};
|
|
1156
|
-
registerStep = (e) => {
|
|
1157
|
-
Xe(e, this.steps);
|
|
1071
|
+
Ge(e, this.fields);
|
|
1158
1072
|
};
|
|
1159
1073
|
registerAction = (e, r) => {
|
|
1160
|
-
|
|
1074
|
+
We(e, r, this.actions);
|
|
1161
1075
|
};
|
|
1162
1076
|
registerExperience = (e) => {
|
|
1163
|
-
e.component &&
|
|
1077
|
+
e.component && G(`experience:${e.id}`, e.component, this.components), ye(e, this.experiences);
|
|
1164
1078
|
};
|
|
1165
|
-
getStateSnapshot = () =>
|
|
1079
|
+
getStateSnapshot = () => X(this);
|
|
1166
1080
|
/** @deprecated Use `client.experiences.launch({ id: experienceId })` instead. */
|
|
1167
1081
|
launchExperienceById = async (e, r) => {
|
|
1168
1082
|
this.experiences.launch({ id: e, options: r });
|
|
@@ -1176,19 +1090,19 @@ class At {
|
|
|
1176
1090
|
await e();
|
|
1177
1091
|
}
|
|
1178
1092
|
async evaluateGate(e) {
|
|
1179
|
-
return e === void 0 ? !0 : typeof e == "boolean" ? e : await
|
|
1093
|
+
return e === void 0 ? !0 : typeof e == "boolean" ? e : await T(this, e) === !0;
|
|
1180
1094
|
}
|
|
1181
1095
|
setupPlugins() {
|
|
1182
1096
|
this.options.plugins?.forEach((e) => {
|
|
1183
1097
|
if (Array.isArray(e)) {
|
|
1184
|
-
e.forEach((
|
|
1185
|
-
this.registerPlugin(
|
|
1098
|
+
e.forEach((s) => {
|
|
1099
|
+
this.registerPlugin(s);
|
|
1186
1100
|
});
|
|
1187
1101
|
return;
|
|
1188
1102
|
}
|
|
1189
1103
|
const r = typeof e == "function" ? e() : e;
|
|
1190
1104
|
if (Array.isArray(r)) {
|
|
1191
|
-
r.forEach((
|
|
1105
|
+
r.forEach((s) => this.registerPlugin(s));
|
|
1192
1106
|
return;
|
|
1193
1107
|
}
|
|
1194
1108
|
this.registerPlugin(r);
|
|
@@ -1196,21 +1110,21 @@ class At {
|
|
|
1196
1110
|
}
|
|
1197
1111
|
setupFeatures() {
|
|
1198
1112
|
const e = this.options.features;
|
|
1199
|
-
e && (Object.entries(e).forEach(([r,
|
|
1200
|
-
const i = typeof
|
|
1113
|
+
e && (Object.entries(e).forEach(([r, s]) => {
|
|
1114
|
+
const i = typeof s == "function" ? s() : s;
|
|
1201
1115
|
this.registerFeature(r, i);
|
|
1202
1116
|
}), this.searchParams.feature && this.searchParams.feature.forEach((r) => {
|
|
1203
1117
|
try {
|
|
1204
|
-
const [
|
|
1205
|
-
if (!
|
|
1118
|
+
const [s, i] = r.split(":");
|
|
1119
|
+
if (!s || !i)
|
|
1206
1120
|
return;
|
|
1207
|
-
let
|
|
1208
|
-
|
|
1209
|
-
key: `${
|
|
1121
|
+
let p = i;
|
|
1122
|
+
p === "true" && (p = !0), p === "false" && (p = !1), this.registerFeature(s, {
|
|
1123
|
+
key: `${p}`,
|
|
1210
1124
|
// use the assigned bucket value as the key
|
|
1211
|
-
name:
|
|
1212
|
-
// eslint-disable-next-line sonarjs/function-return-type --
|
|
1213
|
-
decide: () =>
|
|
1125
|
+
name: s,
|
|
1126
|
+
// eslint-disable-next-line sonarjs/function-return-type -- bucket can be either string or boolean
|
|
1127
|
+
decide: () => p,
|
|
1214
1128
|
storage: "session"
|
|
1215
1129
|
});
|
|
1216
1130
|
} catch {
|
|
@@ -1219,28 +1133,28 @@ class At {
|
|
|
1219
1133
|
}
|
|
1220
1134
|
setupPredicates() {
|
|
1221
1135
|
const e = this.options.predicates;
|
|
1222
|
-
e && Object.entries(e).forEach(([r,
|
|
1223
|
-
if (typeof
|
|
1224
|
-
|
|
1136
|
+
e && Object.entries(e).forEach(([r, s]) => {
|
|
1137
|
+
if (typeof s != "function") {
|
|
1138
|
+
b("warn", `Predicate "${r}" is not a function.`);
|
|
1225
1139
|
return;
|
|
1226
1140
|
}
|
|
1227
|
-
this.registerPredicate(r,
|
|
1141
|
+
this.registerPredicate(r, s);
|
|
1228
1142
|
});
|
|
1229
1143
|
}
|
|
1230
1144
|
setupActions() {
|
|
1231
1145
|
const e = this.options.actions;
|
|
1232
|
-
e && Object.entries(e).forEach(([r,
|
|
1233
|
-
if (typeof
|
|
1234
|
-
|
|
1146
|
+
e && Object.entries(e).forEach(([r, s]) => {
|
|
1147
|
+
if (typeof s != "function") {
|
|
1148
|
+
b("warn", `Action "${r}" is not a function.`);
|
|
1235
1149
|
return;
|
|
1236
1150
|
}
|
|
1237
|
-
this.registerAction(r,
|
|
1151
|
+
this.registerAction(r, s);
|
|
1238
1152
|
});
|
|
1239
1153
|
}
|
|
1240
1154
|
setupComponents() {
|
|
1241
1155
|
const e = this.options.components;
|
|
1242
|
-
e && Object.entries(e).forEach(([r,
|
|
1243
|
-
this.registerComponent(r,
|
|
1156
|
+
e && Object.entries(e).forEach(([r, s]) => {
|
|
1157
|
+
this.registerComponent(r, s);
|
|
1244
1158
|
});
|
|
1245
1159
|
}
|
|
1246
1160
|
getPluginConfig = (e) => this.plugins[e] ?? {};
|
|
@@ -1287,47 +1201,47 @@ class At {
|
|
|
1287
1201
|
* // => "Fruits: apple, banana, and cherry"
|
|
1288
1202
|
*/
|
|
1289
1203
|
renderString = (e, r) => {
|
|
1290
|
-
const
|
|
1291
|
-
return
|
|
1204
|
+
const s = this.responses.listStore.getState().reduce((i, p) => (i[p.fieldId] = p.value, i), {});
|
|
1205
|
+
return gt(e, {
|
|
1292
1206
|
...r,
|
|
1293
|
-
responses:
|
|
1207
|
+
responses: s
|
|
1294
1208
|
});
|
|
1295
1209
|
};
|
|
1296
1210
|
}
|
|
1297
|
-
function
|
|
1211
|
+
function jt(t) {
|
|
1298
1212
|
return {
|
|
1299
1213
|
$$type: "lazy-component",
|
|
1300
1214
|
load: t
|
|
1301
1215
|
};
|
|
1302
1216
|
}
|
|
1303
|
-
function
|
|
1217
|
+
function Et(t) {
|
|
1304
1218
|
return typeof t == "object" && t !== null && "$$type" in t && t.$$type === "lazy-component";
|
|
1305
1219
|
}
|
|
1306
|
-
const
|
|
1307
|
-
const e = new
|
|
1308
|
-
return
|
|
1220
|
+
const Pt = (t) => {
|
|
1221
|
+
const e = new mt(t);
|
|
1222
|
+
return pe(e), e;
|
|
1309
1223
|
};
|
|
1310
1224
|
export {
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1225
|
+
mt as Picked,
|
|
1226
|
+
Pt as createClient,
|
|
1227
|
+
P as createStorageKey,
|
|
1228
|
+
T as evaluateRuleLogic,
|
|
1229
|
+
ot as getPickedConfig,
|
|
1230
|
+
Et as isLazyLoader,
|
|
1231
|
+
Bt as isPickedRoot,
|
|
1232
|
+
jt as lazyComponent,
|
|
1319
1233
|
R as localStore,
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1234
|
+
C as sessionStore,
|
|
1235
|
+
Rt as subscribe,
|
|
1236
|
+
Mt as supportsCookies,
|
|
1237
|
+
le as supportsCryptoRandomUUID,
|
|
1238
|
+
L as supportsDocument,
|
|
1239
|
+
Ot as supportsHistory,
|
|
1240
|
+
Ut as supportsIntersectionObserver,
|
|
1241
|
+
de as supportsLocalStorage,
|
|
1242
|
+
Dt as supportsLocation,
|
|
1243
|
+
Vt as supportsSessionStorage,
|
|
1244
|
+
Nt as supportsShadowRoot,
|
|
1245
|
+
Tt as supportsWebComponents,
|
|
1246
|
+
_ as supportsWindow
|
|
1333
1247
|
};
|