@socotra/ec-react-utils 2.3.0-next.2 → 2.3.0-next.4

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/index.es.js CHANGED
@@ -1,592 +1,548 @@
1
- const q = (t) => {
2
- const { data: e, scope: i, dataTypes: o, rootDisplayName: v, account: d, quote: D, element: p } = t, x = [];
3
- let E = {};
1
+ const q = (e) => {
2
+ const { data: t, scope: u, dataTypes: m, rootDisplayName: x, account: h, quote: g, element: y } = e, L = [];
3
+ let k = {};
4
4
  const B = Object.fromEntries(
5
- Object.entries(e ?? {}).filter(([, h]) => {
6
- var O;
7
- const r = (O = h.scope) == null ? void 0 : O.split(",").map((j) => j.trim());
8
- return !!(!r || i === "P" && (r != null && r.includes("P")) || r != null && r.includes("Q") || i === "Q" && (r != null && r.includes("Q")));
9
- }).map(([h, r]) => {
10
- var V, z, c, a, n, u, s, l, f, $, b, w, M, S, N, I, A;
11
- let O = !1, j = !1, W = !1;
12
- const Z = r.displayName ?? h, U = (V = r.type) == null ? void 0 : V.slice(-1), C = r.maxLength, H = r.minLength, _ = r.max, L = r.min, F = r.regex;
13
- let m = r.type ?? "", Y;
5
+ Object.entries(t ?? {}).filter(([, d]) => {
6
+ var M;
7
+ const s = (M = d.scope) == null ? void 0 : M.split(",").map((Y) => Y.trim());
8
+ return !!(!s || u === "P" && (s != null && s.includes("P")) || s != null && s.includes("Q") || u === "Q" && (s != null && s.includes("Q")));
9
+ }).map(([d, s]) => {
10
+ var H, G, c, i, n, r, a, l, f, $, b, D, T, S, C, N, A;
11
+ let M = !1, Y = !1, z = !1;
12
+ const J = s.displayName ?? d, U = (H = s.type) == null ? void 0 : H.slice(-1), V = s.maxLength, Q = s.minLength, j = s.max, E = s.min, F = s.regex;
13
+ let o = s.type ?? "", _;
14
14
  switch (U) {
15
15
  case "*":
16
- j = !0, O = !0, m = m == null ? void 0 : m.split("*")[0];
16
+ Y = !0, M = !0, o = o == null ? void 0 : o.split("*")[0];
17
17
  break;
18
18
  case "?":
19
- m = m == null ? void 0 : m.split("?")[0], O = !0;
19
+ o = o == null ? void 0 : o.split("?")[0], M = !0;
20
20
  break;
21
21
  case "+":
22
- j = !0, m = m == null ? void 0 : m.split("+")[0];
22
+ Y = !0, o = o == null ? void 0 : o.split("+")[0];
23
23
  break;
24
24
  case "!":
25
- m = m == null ? void 0 : m.split("!")[0];
25
+ o = o == null ? void 0 : o.split("!")[0];
26
26
  break;
27
27
  }
28
- switch (m) {
28
+ switch (o) {
29
29
  case "string":
30
- m = "string";
30
+ o = "string";
31
31
  break;
32
32
  case "int":
33
33
  case "long":
34
- m = "integer";
34
+ o = "integer";
35
35
  break;
36
36
  case "decimal":
37
- m = "number";
37
+ o = "number";
38
38
  break;
39
39
  case "dateTime":
40
40
  case "datetime":
41
- m = "string", Y = "date-time";
41
+ o = "string", _ = "date-time";
42
42
  break;
43
43
  case "date":
44
- m = "string", Y = "date";
44
+ o = "string", _ = "date";
45
45
  break;
46
46
  case "boolean":
47
47
  case "bool":
48
- m = "boolean";
48
+ o = "boolean";
49
49
  break;
50
50
  default:
51
- W = !0;
51
+ z = !0;
52
52
  break;
53
53
  }
54
- if (!O && !W && !j && x.push(h), W) {
55
- const k = o == null ? void 0 : o[m];
56
- if (k) {
57
- let T = j ? [] : {};
58
- const Q = q({
59
- data: k.data ?? {},
60
- scope: i,
61
- dataTypes: o,
62
- rootDisplayName: k.displayName ?? h
54
+ if (!M && !z && !Y && L.push(d), z) {
55
+ const O = m == null ? void 0 : m[o];
56
+ if (O) {
57
+ let w = Y ? [] : {};
58
+ const I = q({
59
+ data: O.data ?? {},
60
+ scope: u,
61
+ dataTypes: m,
62
+ rootDisplayName: O.displayName ?? d
63
63
  });
64
- return D && (c = (z = D.element) == null ? void 0 : z.data) != null && c[h] && (T = (n = (a = D.element) == null ? void 0 : a.data) == null ? void 0 : n[h]), p && (u = p == null ? void 0 : p.data) != null && u[h] && (T = (s = p == null ? void 0 : p.data) == null ? void 0 : s[h]), d && (l = d == null ? void 0 : d.data) != null && l[h] && (T = (f = d == null ? void 0 : d.data) == null ? void 0 : f[h]), E = {
65
- ...E,
66
- [`${m}`]: Q
67
- }, j ? [
68
- h,
64
+ return g && (c = (G = g.element) == null ? void 0 : G.data) != null && c[d] && (w = (n = (i = g.element) == null ? void 0 : i.data) == null ? void 0 : n[d]), y && (r = y == null ? void 0 : y.data) != null && r[d] && (w = (a = y == null ? void 0 : y.data) == null ? void 0 : a[d]), h && (l = h == null ? void 0 : h.data) != null && l[d] && (w = (f = h == null ? void 0 : h.data) == null ? void 0 : f[d]), k = {
65
+ ...k,
66
+ [`${o}`]: I
67
+ }, Y ? [
68
+ d,
69
69
  {
70
- title: k.displayName ?? h,
70
+ title: O.displayName ?? d,
71
71
  type: "array",
72
- default: T,
72
+ default: w,
73
73
  items: {
74
- $ref: `#/definitions/${m}`
74
+ $ref: `#/definitions/${o}`
75
75
  },
76
- ...!O && { minItems: 1 }
76
+ ...!M && { minItems: 1 }
77
77
  }
78
78
  ] : [
79
- h,
79
+ d,
80
80
  {
81
- title: k.displayName ?? h,
82
- default: T,
83
- $ref: `#/definitions/${m}`
81
+ title: O.displayName ?? d,
82
+ default: w,
83
+ $ref: `#/definitions/${o}`
84
84
  }
85
85
  ];
86
86
  }
87
87
  }
88
- let y = "";
89
- if (d) {
90
- const k = (d == null ? void 0 : d.state) === "validated" ? h.charAt(0).toLowerCase() + h.slice(1) : h;
91
- y = ($ = d == null ? void 0 : d.data) != null && $[k] ? (b = d == null ? void 0 : d.data) == null ? void 0 : b[k] : m === "boolean" ? !!r.defaultValue : r.defaultValue;
88
+ let v = "";
89
+ if (h) {
90
+ const O = (h == null ? void 0 : h.state) === "validated" ? d.charAt(0).toLowerCase() + d.slice(1) : d;
91
+ v = ($ = h == null ? void 0 : h.data) != null && $[O] ? (b = h == null ? void 0 : h.data) == null ? void 0 : b[O] : o === "boolean" ? !!s.defaultValue : s.defaultValue;
92
92
  }
93
- return D && (y = (M = (w = D.element) == null ? void 0 : w.data) != null && M[h] ? (N = (S = D.element) == null ? void 0 : S.data) == null ? void 0 : N[h] : m === "boolean" ? !!r.defaultValue : r.defaultValue), p && (y = (I = p == null ? void 0 : p.data) != null && I[h] ? (A = p == null ? void 0 : p.data) == null ? void 0 : A[h] : m === "boolean" ? !!r.defaultValue : r.defaultValue), j ? [
94
- h,
93
+ return g && (v = (T = (D = g.element) == null ? void 0 : D.data) != null && T[d] ? (C = (S = g.element) == null ? void 0 : S.data) == null ? void 0 : C[d] : o === "boolean" ? !!s.defaultValue : s.defaultValue), y && (v = (N = y == null ? void 0 : y.data) != null && N[d] ? (A = y == null ? void 0 : y.data) == null ? void 0 : A[d] : o === "boolean" ? !!s.defaultValue : s.defaultValue), Y ? [
94
+ d,
95
95
  {
96
- title: Z,
96
+ title: J,
97
97
  type: "array",
98
- default: y,
98
+ default: v,
99
99
  items: {
100
- type: m,
101
- ...C && { maxLength: C },
102
- ...H && { minLength: H },
103
- ...L && { min: L },
104
- ..._ && { max: _ },
105
- ...Y && { format: Y },
106
- ...F && { pattern: r.regex }
100
+ type: o,
101
+ ...V && { maxLength: V },
102
+ ...Q && { minLength: Q },
103
+ ...E && { min: E },
104
+ ...j && { max: j },
105
+ ..._ && { format: _ },
106
+ ...F && { pattern: s.regex }
107
107
  },
108
- ...!O && { minItems: 1 }
108
+ ...!M && { minItems: 1 }
109
109
  }
110
110
  ] : [
111
- h,
111
+ d,
112
112
  {
113
- title: Z,
114
- type: m,
115
- ...y && { default: y },
116
- ...H && { minLength: H },
117
- ...C && { maxLength: C },
118
- ...L && { minimum: parseInt(L) },
119
- ..._ && { maximum: parseInt(_) },
120
- ...Y && { format: Y },
121
- ...r.options && { enum: r.options },
122
- ...F && { pattern: r.regex }
113
+ title: J,
114
+ type: o,
115
+ ...v && { default: v },
116
+ ...Q && { minLength: Q },
117
+ ...V && { maxLength: V },
118
+ ...E && { minimum: parseInt(E) },
119
+ ...j && { maximum: parseInt(j) },
120
+ ..._ && { format: _ },
121
+ ...s.options && { enum: s.options },
122
+ ...F && { pattern: s.regex }
123
123
  }
124
124
  ];
125
125
  })
126
126
  );
127
127
  return {
128
- title: v,
128
+ title: x,
129
129
  type: "object",
130
- definitions: E,
131
- required: x,
130
+ definitions: k,
131
+ required: L,
132
132
  properties: B
133
133
  };
134
- }, le = ({
135
- formData: t,
136
- locator: e
137
- }) => ({
138
- elements: [{
139
- locator: e,
140
- setData: t
141
- }]
142
- });
134
+ };
143
135
  var ee = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
144
- function te(t) {
145
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
136
+ function te(e) {
137
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
146
138
  }
147
139
  var K = { exports: {} };
148
- (function(t, e) {
149
- (function(i, o) {
150
- t.exports = o();
140
+ (function(e, t) {
141
+ (function(u, m) {
142
+ e.exports = m();
151
143
  })(ee, function() {
152
- var i = 1e3, o = 6e4, v = 36e5, d = "millisecond", D = "second", p = "minute", x = "hour", E = "day", B = "week", P = "month", h = "quarter", r = "year", O = "date", j = "Invalid Date", W = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, Z = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, U = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(c) {
153
- var a = ["th", "st", "nd", "rd"], n = c % 100;
154
- return "[" + c + (a[(n - 20) % 10] || a[n] || a[0]) + "]";
155
- } }, C = function(c, a, n) {
156
- var u = String(c);
157
- return !u || u.length >= a ? c : "" + Array(a + 1 - u.length).join(n) + c;
158
- }, H = { s: C, z: function(c) {
159
- var a = -c.utcOffset(), n = Math.abs(a), u = Math.floor(n / 60), s = n % 60;
160
- return (a <= 0 ? "+" : "-") + C(u, 2, "0") + ":" + C(s, 2, "0");
161
- }, m: function c(a, n) {
162
- if (a.date() < n.date()) return -c(n, a);
163
- var u = 12 * (n.year() - a.year()) + (n.month() - a.month()), s = a.clone().add(u, P), l = n - s < 0, f = a.clone().add(u + (l ? -1 : 1), P);
164
- return +(-(u + (n - s) / (l ? s - f : f - s)) || 0);
144
+ var u = 1e3, m = 6e4, x = 36e5, h = "millisecond", g = "second", y = "minute", L = "hour", k = "day", B = "week", P = "month", d = "quarter", s = "year", M = "date", Y = "Invalid Date", z = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, J = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, U = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(c) {
145
+ var i = ["th", "st", "nd", "rd"], n = c % 100;
146
+ return "[" + c + (i[(n - 20) % 10] || i[n] || i[0]) + "]";
147
+ } }, V = function(c, i, n) {
148
+ var r = String(c);
149
+ return !r || r.length >= i ? c : "" + Array(i + 1 - r.length).join(n) + c;
150
+ }, Q = { s: V, z: function(c) {
151
+ var i = -c.utcOffset(), n = Math.abs(i), r = Math.floor(n / 60), a = n % 60;
152
+ return (i <= 0 ? "+" : "-") + V(r, 2, "0") + ":" + V(a, 2, "0");
153
+ }, m: function c(i, n) {
154
+ if (i.date() < n.date()) return -c(n, i);
155
+ var r = 12 * (n.year() - i.year()) + (n.month() - i.month()), a = i.clone().add(r, P), l = n - a < 0, f = i.clone().add(r + (l ? -1 : 1), P);
156
+ return +(-(r + (n - a) / (l ? a - f : f - a)) || 0);
165
157
  }, a: function(c) {
166
158
  return c < 0 ? Math.ceil(c) || 0 : Math.floor(c);
167
159
  }, p: function(c) {
168
- return { M: P, y: r, w: B, d: E, D: O, h: x, m: p, s: D, ms: d, Q: h }[c] || String(c || "").toLowerCase().replace(/s$/, "");
160
+ return { M: P, y: s, w: B, d: k, D: M, h: L, m: y, s: g, ms: h, Q: d }[c] || String(c || "").toLowerCase().replace(/s$/, "");
169
161
  }, u: function(c) {
170
162
  return c === void 0;
171
- } }, _ = "en", L = {};
172
- L[_] = U;
173
- var F = "$isDayjsObject", m = function(c) {
174
- return c instanceof V || !(!c || !c[F]);
175
- }, Y = function c(a, n, u) {
176
- var s;
177
- if (!a) return _;
178
- if (typeof a == "string") {
179
- var l = a.toLowerCase();
180
- L[l] && (s = l), n && (L[l] = n, s = l);
181
- var f = a.split("-");
182
- if (!s && f.length > 1) return c(f[0]);
163
+ } }, j = "en", E = {};
164
+ E[j] = U;
165
+ var F = "$isDayjsObject", o = function(c) {
166
+ return c instanceof H || !(!c || !c[F]);
167
+ }, _ = function c(i, n, r) {
168
+ var a;
169
+ if (!i) return j;
170
+ if (typeof i == "string") {
171
+ var l = i.toLowerCase();
172
+ E[l] && (a = l), n && (E[l] = n, a = l);
173
+ var f = i.split("-");
174
+ if (!a && f.length > 1) return c(f[0]);
183
175
  } else {
184
- var $ = a.name;
185
- L[$] = a, s = $;
176
+ var $ = i.name;
177
+ E[$] = i, a = $;
186
178
  }
187
- return !u && s && (_ = s), s || !u && _;
188
- }, y = function(c, a) {
189
- if (m(c)) return c.clone();
190
- var n = typeof a == "object" ? a : {};
191
- return n.date = c, n.args = arguments, new V(n);
192
- }, g = H;
193
- g.l = Y, g.i = m, g.w = function(c, a) {
194
- return y(c, { locale: a.$L, utc: a.$u, x: a.$x, $offset: a.$offset });
179
+ return !r && a && (j = a), a || !r && j;
180
+ }, v = function(c, i) {
181
+ if (o(c)) return c.clone();
182
+ var n = typeof i == "object" ? i : {};
183
+ return n.date = c, n.args = arguments, new H(n);
184
+ }, p = Q;
185
+ p.l = _, p.i = o, p.w = function(c, i) {
186
+ return v(c, { locale: i.$L, utc: i.$u, x: i.$x, $offset: i.$offset });
195
187
  };
196
- var V = function() {
188
+ var H = function() {
197
189
  function c(n) {
198
- this.$L = Y(n.locale, null, !0), this.parse(n), this.$x = this.$x || n.x || {}, this[F] = !0;
190
+ this.$L = _(n.locale, null, !0), this.parse(n), this.$x = this.$x || n.x || {}, this[F] = !0;
199
191
  }
200
- var a = c.prototype;
201
- return a.parse = function(n) {
202
- this.$d = function(u) {
203
- var s = u.date, l = u.utc;
204
- if (s === null) return /* @__PURE__ */ new Date(NaN);
205
- if (g.u(s)) return /* @__PURE__ */ new Date();
206
- if (s instanceof Date) return new Date(s);
207
- if (typeof s == "string" && !/Z$/i.test(s)) {
208
- var f = s.match(W);
192
+ var i = c.prototype;
193
+ return i.parse = function(n) {
194
+ this.$d = function(r) {
195
+ var a = r.date, l = r.utc;
196
+ if (a === null) return /* @__PURE__ */ new Date(NaN);
197
+ if (p.u(a)) return /* @__PURE__ */ new Date();
198
+ if (a instanceof Date) return new Date(a);
199
+ if (typeof a == "string" && !/Z$/i.test(a)) {
200
+ var f = a.match(z);
209
201
  if (f) {
210
202
  var $ = f[2] - 1 || 0, b = (f[7] || "0").substring(0, 3);
211
203
  return l ? new Date(Date.UTC(f[1], $, f[3] || 1, f[4] || 0, f[5] || 0, f[6] || 0, b)) : new Date(f[1], $, f[3] || 1, f[4] || 0, f[5] || 0, f[6] || 0, b);
212
204
  }
213
205
  }
214
- return new Date(s);
206
+ return new Date(a);
215
207
  }(n), this.init();
216
- }, a.init = function() {
208
+ }, i.init = function() {
217
209
  var n = this.$d;
218
210
  this.$y = n.getFullYear(), this.$M = n.getMonth(), this.$D = n.getDate(), this.$W = n.getDay(), this.$H = n.getHours(), this.$m = n.getMinutes(), this.$s = n.getSeconds(), this.$ms = n.getMilliseconds();
219
- }, a.$utils = function() {
220
- return g;
221
- }, a.isValid = function() {
222
- return this.$d.toString() !== j;
223
- }, a.isSame = function(n, u) {
224
- var s = y(n);
225
- return this.startOf(u) <= s && s <= this.endOf(u);
226
- }, a.isAfter = function(n, u) {
227
- return y(n) < this.startOf(u);
228
- }, a.isBefore = function(n, u) {
229
- return this.endOf(u) < y(n);
230
- }, a.$g = function(n, u, s) {
231
- return g.u(n) ? this[u] : this.set(s, n);
232
- }, a.unix = function() {
211
+ }, i.$utils = function() {
212
+ return p;
213
+ }, i.isValid = function() {
214
+ return this.$d.toString() !== Y;
215
+ }, i.isSame = function(n, r) {
216
+ var a = v(n);
217
+ return this.startOf(r) <= a && a <= this.endOf(r);
218
+ }, i.isAfter = function(n, r) {
219
+ return v(n) < this.startOf(r);
220
+ }, i.isBefore = function(n, r) {
221
+ return this.endOf(r) < v(n);
222
+ }, i.$g = function(n, r, a) {
223
+ return p.u(n) ? this[r] : this.set(a, n);
224
+ }, i.unix = function() {
233
225
  return Math.floor(this.valueOf() / 1e3);
234
- }, a.valueOf = function() {
226
+ }, i.valueOf = function() {
235
227
  return this.$d.getTime();
236
- }, a.startOf = function(n, u) {
237
- var s = this, l = !!g.u(u) || u, f = g.p(n), $ = function(k, T) {
238
- var Q = g.w(s.$u ? Date.UTC(s.$y, T, k) : new Date(s.$y, T, k), s);
239
- return l ? Q : Q.endOf(E);
240
- }, b = function(k, T) {
241
- return g.w(s.toDate()[k].apply(s.toDate("s"), (l ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(T)), s);
242
- }, w = this.$W, M = this.$M, S = this.$D, N = "set" + (this.$u ? "UTC" : "");
228
+ }, i.startOf = function(n, r) {
229
+ var a = this, l = !!p.u(r) || r, f = p.p(n), $ = function(O, w) {
230
+ var I = p.w(a.$u ? Date.UTC(a.$y, w, O) : new Date(a.$y, w, O), a);
231
+ return l ? I : I.endOf(k);
232
+ }, b = function(O, w) {
233
+ return p.w(a.toDate()[O].apply(a.toDate("s"), (l ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(w)), a);
234
+ }, D = this.$W, T = this.$M, S = this.$D, C = "set" + (this.$u ? "UTC" : "");
243
235
  switch (f) {
244
- case r:
236
+ case s:
245
237
  return l ? $(1, 0) : $(31, 11);
246
238
  case P:
247
- return l ? $(1, M) : $(0, M + 1);
239
+ return l ? $(1, T) : $(0, T + 1);
248
240
  case B:
249
- var I = this.$locale().weekStart || 0, A = (w < I ? w + 7 : w) - I;
250
- return $(l ? S - A : S + (6 - A), M);
251
- case E:
252
- case O:
253
- return b(N + "Hours", 0);
254
- case x:
255
- return b(N + "Minutes", 1);
256
- case p:
257
- return b(N + "Seconds", 2);
258
- case D:
259
- return b(N + "Milliseconds", 3);
241
+ var N = this.$locale().weekStart || 0, A = (D < N ? D + 7 : D) - N;
242
+ return $(l ? S - A : S + (6 - A), T);
243
+ case k:
244
+ case M:
245
+ return b(C + "Hours", 0);
246
+ case L:
247
+ return b(C + "Minutes", 1);
248
+ case y:
249
+ return b(C + "Seconds", 2);
250
+ case g:
251
+ return b(C + "Milliseconds", 3);
260
252
  default:
261
253
  return this.clone();
262
254
  }
263
- }, a.endOf = function(n) {
255
+ }, i.endOf = function(n) {
264
256
  return this.startOf(n, !1);
265
- }, a.$set = function(n, u) {
266
- var s, l = g.p(n), f = "set" + (this.$u ? "UTC" : ""), $ = (s = {}, s[E] = f + "Date", s[O] = f + "Date", s[P] = f + "Month", s[r] = f + "FullYear", s[x] = f + "Hours", s[p] = f + "Minutes", s[D] = f + "Seconds", s[d] = f + "Milliseconds", s)[l], b = l === E ? this.$D + (u - this.$W) : u;
267
- if (l === P || l === r) {
268
- var w = this.clone().set(O, 1);
269
- w.$d[$](b), w.init(), this.$d = w.set(O, Math.min(this.$D, w.daysInMonth())).$d;
257
+ }, i.$set = function(n, r) {
258
+ var a, l = p.p(n), f = "set" + (this.$u ? "UTC" : ""), $ = (a = {}, a[k] = f + "Date", a[M] = f + "Date", a[P] = f + "Month", a[s] = f + "FullYear", a[L] = f + "Hours", a[y] = f + "Minutes", a[g] = f + "Seconds", a[h] = f + "Milliseconds", a)[l], b = l === k ? this.$D + (r - this.$W) : r;
259
+ if (l === P || l === s) {
260
+ var D = this.clone().set(M, 1);
261
+ D.$d[$](b), D.init(), this.$d = D.set(M, Math.min(this.$D, D.daysInMonth())).$d;
270
262
  } else $ && this.$d[$](b);
271
263
  return this.init(), this;
272
- }, a.set = function(n, u) {
273
- return this.clone().$set(n, u);
274
- }, a.get = function(n) {
275
- return this[g.p(n)]();
276
- }, a.add = function(n, u) {
277
- var s, l = this;
264
+ }, i.set = function(n, r) {
265
+ return this.clone().$set(n, r);
266
+ }, i.get = function(n) {
267
+ return this[p.p(n)]();
268
+ }, i.add = function(n, r) {
269
+ var a, l = this;
278
270
  n = Number(n);
279
- var f = g.p(u), $ = function(M) {
280
- var S = y(l);
281
- return g.w(S.date(S.date() + Math.round(M * n)), l);
271
+ var f = p.p(r), $ = function(T) {
272
+ var S = v(l);
273
+ return p.w(S.date(S.date() + Math.round(T * n)), l);
282
274
  };
283
275
  if (f === P) return this.set(P, this.$M + n);
284
- if (f === r) return this.set(r, this.$y + n);
285
- if (f === E) return $(1);
276
+ if (f === s) return this.set(s, this.$y + n);
277
+ if (f === k) return $(1);
286
278
  if (f === B) return $(7);
287
- var b = (s = {}, s[p] = o, s[x] = v, s[D] = i, s)[f] || 1, w = this.$d.getTime() + n * b;
288
- return g.w(w, this);
289
- }, a.subtract = function(n, u) {
290
- return this.add(-1 * n, u);
291
- }, a.format = function(n) {
292
- var u = this, s = this.$locale();
293
- if (!this.isValid()) return s.invalidDate || j;
294
- var l = n || "YYYY-MM-DDTHH:mm:ssZ", f = g.z(this), $ = this.$H, b = this.$m, w = this.$M, M = s.weekdays, S = s.months, N = s.meridiem, I = function(T, Q, R, J) {
295
- return T && (T[Q] || T(u, l)) || R[Q].slice(0, J);
296
- }, A = function(T) {
297
- return g.s($ % 12 || 12, T, "0");
298
- }, k = N || function(T, Q, R) {
299
- var J = T < 12 ? "AM" : "PM";
300
- return R ? J.toLowerCase() : J;
279
+ var b = (a = {}, a[y] = m, a[L] = x, a[g] = u, a)[f] || 1, D = this.$d.getTime() + n * b;
280
+ return p.w(D, this);
281
+ }, i.subtract = function(n, r) {
282
+ return this.add(-1 * n, r);
283
+ }, i.format = function(n) {
284
+ var r = this, a = this.$locale();
285
+ if (!this.isValid()) return a.invalidDate || Y;
286
+ var l = n || "YYYY-MM-DDTHH:mm:ssZ", f = p.z(this), $ = this.$H, b = this.$m, D = this.$M, T = a.weekdays, S = a.months, C = a.meridiem, N = function(w, I, Z, R) {
287
+ return w && (w[I] || w(r, l)) || Z[I].slice(0, R);
288
+ }, A = function(w) {
289
+ return p.s($ % 12 || 12, w, "0");
290
+ }, O = C || function(w, I, Z) {
291
+ var R = w < 12 ? "AM" : "PM";
292
+ return Z ? R.toLowerCase() : R;
301
293
  };
302
- return l.replace(Z, function(T, Q) {
303
- return Q || function(R) {
304
- switch (R) {
294
+ return l.replace(J, function(w, I) {
295
+ return I || function(Z) {
296
+ switch (Z) {
305
297
  case "YY":
306
- return String(u.$y).slice(-2);
298
+ return String(r.$y).slice(-2);
307
299
  case "YYYY":
308
- return g.s(u.$y, 4, "0");
300
+ return p.s(r.$y, 4, "0");
309
301
  case "M":
310
- return w + 1;
302
+ return D + 1;
311
303
  case "MM":
312
- return g.s(w + 1, 2, "0");
304
+ return p.s(D + 1, 2, "0");
313
305
  case "MMM":
314
- return I(s.monthsShort, w, S, 3);
306
+ return N(a.monthsShort, D, S, 3);
315
307
  case "MMMM":
316
- return I(S, w);
308
+ return N(S, D);
317
309
  case "D":
318
- return u.$D;
310
+ return r.$D;
319
311
  case "DD":
320
- return g.s(u.$D, 2, "0");
312
+ return p.s(r.$D, 2, "0");
321
313
  case "d":
322
- return String(u.$W);
314
+ return String(r.$W);
323
315
  case "dd":
324
- return I(s.weekdaysMin, u.$W, M, 2);
316
+ return N(a.weekdaysMin, r.$W, T, 2);
325
317
  case "ddd":
326
- return I(s.weekdaysShort, u.$W, M, 3);
318
+ return N(a.weekdaysShort, r.$W, T, 3);
327
319
  case "dddd":
328
- return M[u.$W];
320
+ return T[r.$W];
329
321
  case "H":
330
322
  return String($);
331
323
  case "HH":
332
- return g.s($, 2, "0");
324
+ return p.s($, 2, "0");
333
325
  case "h":
334
326
  return A(1);
335
327
  case "hh":
336
328
  return A(2);
337
329
  case "a":
338
- return k($, b, !0);
330
+ return O($, b, !0);
339
331
  case "A":
340
- return k($, b, !1);
332
+ return O($, b, !1);
341
333
  case "m":
342
334
  return String(b);
343
335
  case "mm":
344
- return g.s(b, 2, "0");
336
+ return p.s(b, 2, "0");
345
337
  case "s":
346
- return String(u.$s);
338
+ return String(r.$s);
347
339
  case "ss":
348
- return g.s(u.$s, 2, "0");
340
+ return p.s(r.$s, 2, "0");
349
341
  case "SSS":
350
- return g.s(u.$ms, 3, "0");
342
+ return p.s(r.$ms, 3, "0");
351
343
  case "Z":
352
344
  return f;
353
345
  }
354
346
  return null;
355
- }(T) || f.replace(":", "");
347
+ }(w) || f.replace(":", "");
356
348
  });
357
- }, a.utcOffset = function() {
349
+ }, i.utcOffset = function() {
358
350
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
359
- }, a.diff = function(n, u, s) {
360
- var l, f = this, $ = g.p(u), b = y(n), w = (b.utcOffset() - this.utcOffset()) * o, M = this - b, S = function() {
361
- return g.m(f, b);
351
+ }, i.diff = function(n, r, a) {
352
+ var l, f = this, $ = p.p(r), b = v(n), D = (b.utcOffset() - this.utcOffset()) * m, T = this - b, S = function() {
353
+ return p.m(f, b);
362
354
  };
363
355
  switch ($) {
364
- case r:
356
+ case s:
365
357
  l = S() / 12;
366
358
  break;
367
359
  case P:
368
360
  l = S();
369
361
  break;
370
- case h:
362
+ case d:
371
363
  l = S() / 3;
372
364
  break;
373
365
  case B:
374
- l = (M - w) / 6048e5;
366
+ l = (T - D) / 6048e5;
375
367
  break;
376
- case E:
377
- l = (M - w) / 864e5;
368
+ case k:
369
+ l = (T - D) / 864e5;
378
370
  break;
379
- case x:
380
- l = M / v;
371
+ case L:
372
+ l = T / x;
381
373
  break;
382
- case p:
383
- l = M / o;
374
+ case y:
375
+ l = T / m;
384
376
  break;
385
- case D:
386
- l = M / i;
377
+ case g:
378
+ l = T / u;
387
379
  break;
388
380
  default:
389
- l = M;
381
+ l = T;
390
382
  }
391
- return s ? l : g.a(l);
392
- }, a.daysInMonth = function() {
383
+ return a ? l : p.a(l);
384
+ }, i.daysInMonth = function() {
393
385
  return this.endOf(P).$D;
394
- }, a.$locale = function() {
395
- return L[this.$L];
396
- }, a.locale = function(n, u) {
386
+ }, i.$locale = function() {
387
+ return E[this.$L];
388
+ }, i.locale = function(n, r) {
397
389
  if (!n) return this.$L;
398
- var s = this.clone(), l = Y(n, u, !0);
399
- return l && (s.$L = l), s;
400
- }, a.clone = function() {
401
- return g.w(this.$d, this);
402
- }, a.toDate = function() {
390
+ var a = this.clone(), l = _(n, r, !0);
391
+ return l && (a.$L = l), a;
392
+ }, i.clone = function() {
393
+ return p.w(this.$d, this);
394
+ }, i.toDate = function() {
403
395
  return new Date(this.valueOf());
404
- }, a.toJSON = function() {
396
+ }, i.toJSON = function() {
405
397
  return this.isValid() ? this.toISOString() : null;
406
- }, a.toISOString = function() {
398
+ }, i.toISOString = function() {
407
399
  return this.$d.toISOString();
408
- }, a.toString = function() {
400
+ }, i.toString = function() {
409
401
  return this.$d.toUTCString();
410
402
  }, c;
411
- }(), z = V.prototype;
412
- return y.prototype = z, [["$ms", d], ["$s", D], ["$m", p], ["$H", x], ["$W", E], ["$M", P], ["$y", r], ["$D", O]].forEach(function(c) {
413
- z[c[1]] = function(a) {
414
- return this.$g(a, c[0], c[1]);
403
+ }(), G = H.prototype;
404
+ return v.prototype = G, [["$ms", h], ["$s", g], ["$m", y], ["$H", L], ["$W", k], ["$M", P], ["$y", s], ["$D", M]].forEach(function(c) {
405
+ G[c[1]] = function(i) {
406
+ return this.$g(i, c[0], c[1]);
415
407
  };
416
- }), y.extend = function(c, a) {
417
- return c.$i || (c(a, V, y), c.$i = !0), y;
418
- }, y.locale = Y, y.isDayjs = m, y.unix = function(c) {
419
- return y(1e3 * c);
420
- }, y.en = L[_], y.Ls = L, y.p = {}, y;
408
+ }), v.extend = function(c, i) {
409
+ return c.$i || (c(i, H, v), c.$i = !0), v;
410
+ }, v.locale = _, v.isDayjs = o, v.unix = function(c) {
411
+ return v(1e3 * c);
412
+ }, v.en = E[j], v.Ls = E, v.p = {}, v;
421
413
  });
422
414
  })(K);
423
415
  var ne = K.exports;
424
- const G = /* @__PURE__ */ te(ne), fe = ({ data: t }) => {
425
- const e = {}, i = { ...t };
426
- return i.default && (i.default.startTime && (e.startTime = G(i.default.startTime).format()), i.default.endTime && (e.endTime = G(i.default.endTime).format()), i.default.expirationTime && (e.expirationTime = G(i.default.expirationTime).format())), i.advanced && (i.advanced.currency && (e.currency = i.advanced.currency), i.advanced.timezone && (e.timezone = i.advanced.timezone), i.advanced.billingPlan && (e.billingPlan = i.advanced.billingPlan), i.advanced.defaultTermDuration && (e.defaultTermDuration = i.advanced.defaultTermDuration), i.advanced.installmentPlan && (e.installmentPlan = i.advanced.installmentPlan), i.advanced.durationBasis && (e.durationBasis = i.advanced.durationBasis), i.advanced.delinquencyPlanName && (e.delinquencyPlanName = i.advanced.delinquencyPlanName)), delete i.default, delete i.advanced, e.setData = i, e;
427
- }, se = (t) => {
428
- const e = /^(.*?)(Quote|QuickQuote|Policy)$/, i = t.match(e);
429
- return i && (i[2] === "Quote" || i[2] === "QuickQuote" || i[2] === "Policy") ? [i[1], i[2]] : [t, null];
416
+ const W = /* @__PURE__ */ te(ne), se = ({ data: e }) => {
417
+ const t = {}, u = { ...e };
418
+ return u.default && (u.default.startTime && (t.startTime = W(u.default.startTime).format()), u.default.endTime && (t.endTime = W(u.default.endTime).format()), u.default.expirationTime && (t.expirationTime = W(u.default.expirationTime).format())), u.advanced && (u.advanced.currency && (t.currency = u.advanced.currency), u.advanced.timezone && (t.timezone = u.advanced.timezone), u.advanced.billingPlan && (t.billingPlan = u.advanced.billingPlan), u.advanced.defaultTermDuration && (t.defaultTermDuration = u.advanced.defaultTermDuration), u.advanced.installmentPlan && (t.installmentPlan = u.advanced.installmentPlan), u.advanced.durationBasis && (t.durationBasis = u.advanced.durationBasis), u.advanced.delinquencyPlanName && (t.delinquencyPlanName = u.advanced.delinquencyPlanName)), delete u.default, delete u.advanced, t.setData = u, t;
430
419
  };
431
- function ie(t, e) {
432
- if (t.locator === e)
433
- return t;
434
- if (t.elements)
435
- for (const i of t.elements) {
436
- const o = ie(i, e);
437
- if (o)
438
- return o;
439
- }
440
- }
441
- function oe(t, e) {
442
- const [i] = se(
443
- t.type ?? ""
444
- );
445
- let o = {};
446
- return e.exposures && Object.keys(e.exposures).forEach((v) => {
447
- v === i && e.exposures && (o = e.exposures[v]);
448
- }), e.coverages && Object.keys(e.coverages).forEach((v) => {
449
- v === i && e.coverages && (o = e.coverages[v]);
450
- }), e.policyLines && Object.keys(e.policyLines).forEach((v) => {
451
- v === i && e.policyLines && (o = e.policyLines[v]);
452
- }), e.exposureGroups && Object.keys(e.exposureGroups).forEach((v) => {
453
- v === i && e.exposureGroups && (o = e.exposureGroups[v]);
454
- }), o;
455
- }
456
- function me(t) {
457
- return t == null ? void 0 : t.map((e) => (e.keyword === "pattern" && (e.message = `Invalid format, must match pattern ${e.params.pattern}`), e.keyword === "format" && (e.message = "Invalid format"), e.keyword === "required" && (e.message = "Required"), e.keyword === "minItems" && (e.message = `Must have at least ${e.params.limit} item${e.params.limit !== 1 ? "s" : ""}`), e.keyword === "maxItems" && (e.message = `Must have at most ${e.params.limit} item${e.params.limit !== 1 ? "s" : ""}`), e.keyword === "type" && (e.message = "Invalid format"), e.keyword === "maxLength" && (e.message = `Must be at most ${e.params.limit} character${e.params.limit !== 1 ? "s" : ""}`), e.keyword === "minLength" && (e.message = `Must be at least ${e.params.limit} character${e.params.limit !== 1 ? "s" : ""}`), e.keyword === "minimum" && (e.message = `Must be greater than or equal to ${e.params.limit}`), e.keyword === "maximum" && (e.message = `Must be less than or equal to ${e.params.limit}`), e.keyword === "enum" && (e.message = "Invalid value"), e));
420
+ function re(e) {
421
+ return e == null ? void 0 : e.map((t) => (t.keyword === "pattern" && (t.message = `Invalid format, must match pattern ${t.params.pattern}`), t.keyword === "format" && (t.message = "Invalid format"), t.keyword === "required" && (t.message = "Required"), t.keyword === "minItems" && (t.message = `Must have at least ${t.params.limit} item${t.params.limit !== 1 ? "s" : ""}`), t.keyword === "maxItems" && (t.message = `Must have at most ${t.params.limit} item${t.params.limit !== 1 ? "s" : ""}`), t.keyword === "type" && (t.message = "Invalid format"), t.keyword === "maxLength" && (t.message = `Must be at most ${t.params.limit} character${t.params.limit !== 1 ? "s" : ""}`), t.keyword === "minLength" && (t.message = `Must be at least ${t.params.limit} character${t.params.limit !== 1 ? "s" : ""}`), t.keyword === "minimum" && (t.message = `Must be greater than or equal to ${t.params.limit}`), t.keyword === "maximum" && (t.message = `Must be less than or equal to ${t.params.limit}`), t.keyword === "enum" && (t.message = "Invalid value"), t));
458
422
  }
459
- const de = (t, e, i) => {
460
- var o, v;
423
+ const ue = (e, t, u) => {
424
+ var m, x;
461
425
  return {
462
- ...((o = t == null ? void 0 : t.element) == null ? void 0 : o.data) && {
463
- ...(v = t == null ? void 0 : t.element) == null ? void 0 : v.data
426
+ ...((m = e == null ? void 0 : e.element) == null ? void 0 : m.data) && {
427
+ ...(x = e == null ? void 0 : e.element) == null ? void 0 : x.data
464
428
  },
465
429
  default: {
466
430
  // set date to yyyy-MM-dd format if it exists
467
- ...(t == null ? void 0 : t.startTime) && {
468
- startTime: G(t.startTime).format("YYYY-MM-DD")
431
+ ...(e == null ? void 0 : e.startTime) && {
432
+ startTime: W(e.startTime).format("YYYY-MM-DD")
469
433
  },
470
- ...(t == null ? void 0 : t.endTime) && {
471
- endTime: G(t.endTime).format("YYYY-MM-DD")
434
+ ...(e == null ? void 0 : e.endTime) && {
435
+ endTime: W(e.endTime).format("YYYY-MM-DD")
472
436
  },
473
- ...(t == null ? void 0 : t.expirationTime) && {
474
- expirationTime: G(t.expirationTime).format("YYYY-MM-DD")
437
+ ...(e == null ? void 0 : e.expirationTime) && {
438
+ expirationTime: W(e.expirationTime).format("YYYY-MM-DD")
475
439
  }
476
440
  },
477
441
  advanced: {
478
- currency: (t == null ? void 0 : t.currency) ?? e.defaultCurrency ?? i.defaultCurrency ?? void 0,
479
- timezone: (t == null ? void 0 : t.timezone) ?? e.defaultTimeZone ?? i.defaultTimeZone ?? void 0,
480
- billingLevel: (t == null ? void 0 : t.billingLevel) ?? e.defaultBillingLevel ?? i.defaultBillingLevel ?? void 0,
481
- billingTrigger: (t == null ? void 0 : t.billingTrigger) ?? e.defaultBillingTrigger,
482
- durationBasis: (t == null ? void 0 : t.durationBasis) ?? e.defaultDurationBasis ?? void 0,
483
- delinquencyPlanName: (t == null ? void 0 : t.delinquencyPlanName) ?? (e == null ? void 0 : e.defaultDelinquencyPlan) ?? void 0,
484
- autoRenewalPlanName: (t == null ? void 0 : t.autoRenewalPlanName) ?? (e == null ? void 0 : e.defaultAutoRenewalPlan) ?? void 0
442
+ currency: (e == null ? void 0 : e.currency) ?? t.defaultCurrency ?? u.defaultCurrency ?? void 0,
443
+ timezone: (e == null ? void 0 : e.timezone) ?? t.defaultTimeZone ?? u.defaultTimeZone ?? void 0,
444
+ billingLevel: (e == null ? void 0 : e.billingLevel) ?? t.defaultBillingLevel ?? u.defaultBillingLevel ?? void 0,
445
+ billingTrigger: (e == null ? void 0 : e.billingTrigger) ?? t.defaultBillingTrigger,
446
+ durationBasis: (e == null ? void 0 : e.durationBasis) ?? t.defaultDurationBasis ?? void 0,
447
+ delinquencyPlanName: (e == null ? void 0 : e.delinquencyPlanName) ?? (t == null ? void 0 : t.defaultDelinquencyPlan) ?? void 0,
448
+ autoRenewalPlanName: (e == null ? void 0 : e.autoRenewalPlanName) ?? (t == null ? void 0 : t.defaultAutoRenewalPlan) ?? void 0
485
449
  }
486
450
  };
487
- }, he = (t) => ({
488
- ...t.data,
489
- coverageTerms: t.coverageTerms ?? {}
490
- }), X = (t, e) => {
491
- for (const i of t) {
492
- if (i.locator === e)
493
- return i;
494
- const o = X(
495
- i.elements ?? [],
496
- e
451
+ }, ce = (e) => ({
452
+ ...e.data,
453
+ coverageTerms: e.coverageTerms ?? {}
454
+ }), X = (e, t) => {
455
+ for (const u of e) {
456
+ if (u.locator === t)
457
+ return u;
458
+ const m = X(
459
+ u.elements ?? [],
460
+ t
497
461
  );
498
- if (o)
499
- return o;
462
+ if (m)
463
+ return m;
500
464
  }
501
465
  return !1;
502
- }, ae = (t, e) => {
503
- var i, o;
504
- return ((i = t.element) == null ? void 0 : i.locator) === e ? t.element : X(
505
- ((o = t.element) == null ? void 0 : o.elements) ?? [],
506
- e
466
+ }, ae = (e, t) => {
467
+ var u, m;
468
+ return ((u = e.element) == null ? void 0 : u.locator) === t ? e.element : X(
469
+ ((m = e.element) == null ? void 0 : m.elements) ?? [],
470
+ t
507
471
  );
508
- }, re = ({
509
- dataModel: t,
510
- element: { productName: e }
511
- }) => t.products[e] ?? {}, ue = (t) => {
512
- var o;
513
- t = t ?? "";
514
- const e = t.replace(/\?|\*|!|\+/g, ""), i = (o = t.match(/\?|\*|!|\+/g)) == null ? void 0 : o.pop();
472
+ }, le = ({
473
+ dataModel: e,
474
+ quote: t,
475
+ elementLocator: u
476
+ }) => {
477
+ const m = ae(t, u);
478
+ if (!m)
479
+ return {};
480
+ let x = !1;
481
+ const h = m.type.split("Quote")[0];
482
+ return Object.keys(e.exposures ?? {}).forEach((g) => {
483
+ g === h && (x = e.exposures ? e.exposures[g] : {});
484
+ }), x || Object.keys(e.coverages ?? {}).forEach((g) => {
485
+ g === h && (x = e.coverages ? e.coverages[g] : {});
486
+ }), x || Object.keys(e.policyLines ?? {}).forEach((g) => {
487
+ g === h && (x = e.policyLines ? e.policyLines[g] : {});
488
+ }), x || Object.keys(e.exposureGroups ?? {}).forEach((g) => {
489
+ g === h && (x = e.exposureGroups ? e.exposureGroups[g] : {});
490
+ }), x;
491
+ }, fe = (e, t) => e.filter(
492
+ (m) => m.type === `${t}Quote`
493
+ ), oe = ({
494
+ dataModel: e,
495
+ element: { productName: t }
496
+ }) => e.products[t] ?? {}, ie = (e) => {
497
+ var m;
498
+ e = e ?? "";
499
+ const t = e.replace(/\?|\*|!|\+/g, ""), u = (m = e.match(/\?|\*|!|\+/g)) == null ? void 0 : m.pop();
515
500
  return {
516
- name: e,
517
- quantifier: i ?? ""
501
+ name: t,
502
+ quantifier: u ?? ""
518
503
  };
519
- }, ce = ({
520
- dataModel: t,
521
- productDataModel: e
504
+ }, de = ({
505
+ dataModel: e,
506
+ contents: t
522
507
  }) => {
523
- const i = t.exposures ?? {}, o = t.coverages ?? {}, v = t.policyLines ?? {}, d = t.exposureGroups ?? {}, p = (e.contents ?? []).map((r) => {
524
- const { name: O } = ue(r);
525
- return O;
526
- }), x = Object.keys(i).filter(
527
- (r) => p.includes(r)
528
- ), E = Object.keys(o).filter(
529
- (r) => p.includes(r)
530
- ), B = Object.keys(v).filter(
531
- (r) => p.includes(r)
508
+ const u = e.exposures ?? {}, m = e.coverages ?? {}, x = e.policyLines ?? {}, h = e.exposureGroups ?? {}, y = (t ?? []).map((s) => {
509
+ const { name: M } = ie(s);
510
+ return M;
511
+ }), L = Object.keys(u).filter(
512
+ (s) => y.includes(s)
513
+ ), k = Object.keys(m).filter(
514
+ (s) => y.includes(s)
515
+ ), B = Object.keys(x).filter(
516
+ (s) => y.includes(s)
532
517
  ), P = Object.keys(
533
- d
534
- ).filter((r) => p.includes(r)), h = {
518
+ h
519
+ ).filter((s) => y.includes(s)), d = {
535
520
  coverages: {},
536
521
  exposures: {},
537
522
  policyLines: {},
538
523
  exposureGroups: {}
539
524
  };
540
- for (const r of x)
541
- h.exposures[r] = i[r];
542
- for (const r of E)
543
- h.coverages[r] = o[r];
544
- for (const r of B)
545
- h.policyLines[r] = v[r];
546
- for (const r of P)
547
- h.exposureGroups[r] = d[r];
548
- return h;
549
- }, pe = ({
550
- dataModel: t,
551
- quote: e,
552
- elementLocator: i
553
- }) => {
554
- const o = ae(e, i);
555
- if (!o)
556
- return {};
557
- const v = re({
558
- element: e,
559
- dataModel: t
560
- }), d = ce({
561
- dataModel: t,
562
- productDataModel: v
563
- });
564
- let D = !1;
565
- const p = o.type.split("Quote")[0];
566
- return Object.keys(d.exposures).forEach((x) => {
567
- x === p && (D = d.exposures[x]);
568
- }), D || Object.keys(d.coverages).forEach((x) => {
569
- x === p && (D = d.coverages[x]);
570
- }), D || Object.keys(d.policyLines).forEach((x) => {
571
- x === p && (D = d.policyLines[x]);
572
- }), D || Object.keys(d.exposureGroups).forEach((x) => {
573
- x === p && (D = d.exposureGroups[x]);
574
- }), D;
525
+ for (const s of L)
526
+ d.exposures[s] = u[s];
527
+ for (const s of k)
528
+ d.coverages[s] = m[s];
529
+ for (const s of B)
530
+ d.policyLines[s] = x[s];
531
+ for (const s of P)
532
+ d.exposureGroups[s] = h[s];
533
+ return d;
575
534
  };
576
535
  export {
577
536
  q as dataModelToJSONSchema,
578
- pe as extractElementDataModel,
537
+ le as extractElementDataModel,
579
538
  ae as extractElementFromQuote,
580
- re as extractProductDataModel,
581
- ce as extractProductElements,
582
- he as getDefaultElementValues,
583
- de as getDefaultQuoteValues,
584
- le as getQuoteElementRequest,
585
- fe as getQuoteRequest,
586
- se as parseElementTypeAndScopeByElementType,
587
- oe as retrieveDataModelFromElement,
588
- ie as retrieveElementFromQuoteByLocator,
589
- ue as splitInputAndQuantifier,
590
- me as transformErrors
539
+ fe as extractElementsFromQuote,
540
+ oe as extractProductDataModel,
541
+ de as extractProductElements,
542
+ ce as getDefaultElementValues,
543
+ ue as getDefaultQuoteValues,
544
+ se as getQuoteRequest,
545
+ ie as splitInputAndQuantifier,
546
+ re as transformErrors
591
547
  };
592
548
  //# sourceMappingURL=index.es.js.map