@picked/client 0.0.12-next.5 → 0.0.12-next.6

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.
@@ -10,13 +10,13 @@ const a = {
10
10
  name: "create-experience",
11
11
  setup: (d) => {
12
12
  i.experiences.forEach((l) => {
13
- const s = l.serialize(), n = a.deserialize(s);
14
- n.component = l.component, d.registerExperience(n), n.fields.forEach((f) => {
13
+ const s = l.serialize(), o = a.deserialize(s);
14
+ o.component = l.component, d.registerExperience(o), o.fields.forEach((f) => {
15
15
  d.registerField(f);
16
16
  });
17
17
  });
18
18
  }
19
- }), y = (i, d) => ({
19
+ }), m = (i, d) => ({
20
20
  id: p("node"),
21
21
  position: [0, 0],
22
22
  experience: d,
@@ -24,27 +24,27 @@ const a = {
24
24
  action: i.action,
25
25
  addNext(s) {
26
26
  if (!s.node) throw new Error("Cannot connect to node");
27
- const n = c(
27
+ const o = c(
28
28
  { sourceNode: this, destinationNode: s.node, sourceNodeHandle: null },
29
29
  d
30
30
  );
31
- d.edges.push(n);
31
+ d.edges.push(o);
32
32
  },
33
33
  onSuccess(s) {
34
34
  if (!s.node) throw new Error("Cannot connect to node");
35
- const n = c(
35
+ const o = c(
36
36
  { sourceNode: this, destinationNode: s.node, sourceNodeHandle: "true" },
37
37
  d
38
38
  );
39
- d.edges.push(n);
39
+ d.edges.push(o);
40
40
  },
41
41
  onFail(s) {
42
42
  if (!s.node) throw new Error("Cannot connect to node");
43
- const n = c(
43
+ const o = c(
44
44
  { sourceNode: this, destinationNode: s.node, sourceNodeHandle: "false" },
45
45
  d
46
46
  );
47
- d.edges.push(n);
47
+ d.edges.push(o);
48
48
  },
49
49
  serialize() {
50
50
  return a.serialize({
@@ -59,11 +59,11 @@ const a = {
59
59
  label: i.label,
60
60
  fields: i.fields ?? [],
61
61
  addField(d) {
62
- var s, n;
62
+ var s, o;
63
63
  const l = "serialize" in d ? d : N(d);
64
- return (s = this.fields) != null && s.includes(l) || (n = this.fields) == null || n.push(l), l;
64
+ return (s = this.fields) != null && s.includes(l) || (o = this.fields) == null || o.push(l), l;
65
65
  }
66
- }), m = (i, d) => {
66
+ }), g = (i, d) => {
67
67
  const l = {
68
68
  id: i.id ?? p("step"),
69
69
  label: i.label,
@@ -91,14 +91,14 @@ const a = {
91
91
  }
92
92
  };
93
93
  return h({ step: l, type: "step" }, d), l;
94
- }, g = () => [0, 0], h = (i, d) => {
94
+ }, y = () => [0, 0], h = (i, d) => {
95
95
  const l = {
96
96
  id: p("node"),
97
- position: g(),
97
+ position: y(),
98
98
  experience: d
99
99
  };
100
100
  if (i.type === "step") {
101
- const n = {
101
+ const o = {
102
102
  ...l,
103
103
  type: "step",
104
104
  connectedStep: i.step,
@@ -112,10 +112,10 @@ const a = {
112
112
  });
113
113
  }
114
114
  };
115
- return n.connectedStep.node = n, n;
115
+ return o.connectedStep.node = o, o;
116
116
  }
117
117
  if (i.type === "conditional") {
118
- const n = {
118
+ const o = {
119
119
  ...l,
120
120
  type: "conditional",
121
121
  connectedConditional: i.conditional,
@@ -128,7 +128,7 @@ const a = {
128
128
  });
129
129
  }
130
130
  };
131
- return n.connectedConditional.node = n, n;
131
+ return o.connectedConditional.node = o, o;
132
132
  }
133
133
  return i.type === "experience" ? {
134
134
  ...l,
@@ -176,20 +176,20 @@ const a = {
176
176
  addTrue(s) {
177
177
  if (!this.node || !s.node)
178
178
  throw new Error("todo no node");
179
- const n = c(
179
+ const o = c(
180
180
  { sourceNode: this.node, destinationNode: s.node, sourceNodeHandle: "true" },
181
181
  this.experience
182
182
  );
183
- this.experience.edges.push(n);
183
+ this.experience.edges.push(o);
184
184
  },
185
185
  addFalse(s) {
186
186
  if (!this.node || !s.node)
187
187
  throw new Error("todo no node");
188
- const n = c(
188
+ const o = c(
189
189
  { sourceNode: this.node, destinationNode: s.node, sourceNodeHandle: "false" },
190
190
  this.experience
191
191
  );
192
- this.experience.edges.push(n);
192
+ this.experience.edges.push(o);
193
193
  },
194
194
  serialize() {
195
195
  return a.serialize({
@@ -230,7 +230,7 @@ const a = {
230
230
  validation: this.validation,
231
231
  condition: this.condition,
232
232
  policies: this.policies
233
- }, n = typeof this.defaultValue == "string" ? this.defaultValue : void 0, f = typeof this.defaultValue == "number" ? this.defaultValue : void 0, o = typeof this.defaultValue == "boolean" ? this.defaultValue : void 0;
233
+ }, o = typeof this.defaultValue == "string" ? this.defaultValue : void 0, f = typeof this.defaultValue == "number" ? this.defaultValue : void 0, n = typeof this.defaultValue == "boolean" ? this.defaultValue : void 0;
234
234
  switch (this.type) {
235
235
  case "text":
236
236
  if (this.multiple) {
@@ -258,7 +258,7 @@ const a = {
258
258
  ...s,
259
259
  type: "text",
260
260
  multiple: !1,
261
- defaultValue: n,
261
+ defaultValue: o,
262
262
  options: this.options ? this.options.map((e) => ({
263
263
  id: e.id,
264
264
  label: e.label,
@@ -326,7 +326,7 @@ const a = {
326
326
  ...s,
327
327
  type: "boolean",
328
328
  multiple: !1,
329
- defaultValue: o,
329
+ defaultValue: n,
330
330
  options: this.options ? this.options.map((e) => ({
331
331
  id: e.id,
332
332
  label: e.label,
@@ -358,23 +358,23 @@ const a = {
358
358
  }
359
359
  };
360
360
  }, E = (i) => {
361
- const d = [], l = [], s = [], n = [], f = [];
361
+ const d = [], l = [], s = [], o = [], f = [];
362
362
  return {
363
363
  id: i.id,
364
364
  component: i.component,
365
- type: i.type,
366
365
  name: i.name,
366
+ initializeOpen: i.initializeOpen,
367
367
  decide: i.decide,
368
368
  targets: i.targets,
369
369
  steps: d,
370
370
  nodes: l,
371
371
  edges: s,
372
372
  fields: f,
373
- conditionals: n,
374
- addStep(o, e) {
373
+ conditionals: o,
374
+ addStep(n, e) {
375
375
  let t = e == null ? void 0 : e.node;
376
376
  this.nodes.length === 0 && (t = h({ type: "origin" }, this), this.nodes.push(t));
377
- const r = "serialize" in o ? o : m(o, this);
377
+ const r = "serialize" in n ? n : g(n, this);
378
378
  if (t) {
379
379
  if (!r.node)
380
380
  throw new Error("todo no node");
@@ -388,10 +388,10 @@ const a = {
388
388
  this.fields.includes(u) || this.fields.push(u);
389
389
  }), this.steps.includes(r) || (this.steps.push(r), r.node && this.nodes.push(r.node)), r;
390
390
  },
391
- addAction(o, e) {
391
+ addAction(n, e) {
392
392
  let t = e == null ? void 0 : e.node;
393
393
  this.nodes.length === 0 && (t = h({ type: "origin" }, this), this.nodes.push(t));
394
- const r = "serialize" in o ? o : y(o, this);
394
+ const r = "serialize" in n ? n : m(n, this);
395
395
  if (t) {
396
396
  const u = c(
397
397
  { sourceNode: t, destinationNode: r, sourceNodeHandle: null },
@@ -401,10 +401,10 @@ const a = {
401
401
  }
402
402
  return this.nodes.push(r), r;
403
403
  },
404
- addConditional(o, e) {
404
+ addConditional(n, e) {
405
405
  let t = e == null ? void 0 : e.node;
406
406
  this.nodes.length === 0 && (t = h({ type: "origin" }, this), this.nodes.push(t));
407
- const r = "serialize" in o ? o : z(o, this);
407
+ const r = "serialize" in n ? n : z(n, this);
408
408
  if (t) {
409
409
  if (!r.node)
410
410
  throw new Error("todo no node");
@@ -416,11 +416,11 @@ const a = {
416
416
  }
417
417
  return this.conditionals.includes(r) || (this.conditionals.push(r), r.node && this.nodes.push(r.node)), r;
418
418
  },
419
- addExperience(o, e) {
419
+ addExperience(n, e) {
420
420
  let t = e == null ? void 0 : e.node;
421
421
  this.nodes.length === 0 && (t = h({ type: "origin" }, this), this.nodes.push(t));
422
422
  const r = h(
423
- { type: "experience", experience: o },
423
+ { type: "experience", experience: n },
424
424
  this
425
425
  );
426
426
  if (this.nodes.push(r), t) {
@@ -430,27 +430,27 @@ const a = {
430
430
  );
431
431
  this.edges.push(u);
432
432
  }
433
- return o;
433
+ return n;
434
434
  },
435
- addField(o, e) {
436
- const t = "serialize" in o ? o : N(o);
435
+ addField(n, e) {
436
+ const t = "serialize" in n ? n : N(n);
437
437
  return e && e.fields.push(t), this.fields.includes(t) || this.fields.push(t), t;
438
438
  },
439
439
  serialize() {
440
440
  return a.serialize({
441
441
  id: this.id,
442
- type: this.type,
443
442
  component: this.component,
444
443
  name: this.name,
444
+ initializeOpen: this.initializeOpen,
445
445
  decide: this.decide,
446
446
  targets: this.targets,
447
- steps: this.steps.map((o) => a.deserialize(o.serialize())),
448
- nodes: this.nodes.map((o) => a.deserialize(o.serialize())),
449
- edges: this.edges.map((o) => a.deserialize(o.serialize())),
447
+ steps: this.steps.map((n) => a.deserialize(n.serialize())),
448
+ nodes: this.nodes.map((n) => a.deserialize(n.serialize())),
449
+ edges: this.edges.map((n) => a.deserialize(n.serialize())),
450
450
  conditionals: this.conditionals.map(
451
- (o) => a.deserialize(o.serialize())
451
+ (n) => a.deserialize(n.serialize())
452
452
  ),
453
- fields: this.fields.map((o) => a.deserialize(o.serialize()))
453
+ fields: this.fields.map((n) => a.deserialize(n.serialize()))
454
454
  });
455
455
  }
456
456
  };
@@ -1,5 +1,5 @@
1
1
  import { createEvent as i, createStore as v, createEffect as C, sample as n, attach as S } from "effector";
2
- import { h as F } from "../../experience-instance-BBz99AXU.js";
2
+ import { h as F } from "../../experience-instance-Bs9t-zff.js";
3
3
  function R() {
4
4
  let c, p;
5
5
  return {