@epigraph/epigraph-std-lib 4.0.2-alpha → 4.1.0

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.
Files changed (38) hide show
  1. package/dist/Epigraph/epigraph.cjs +1 -0
  2. package/dist/Epigraph/epigraph.d.ts +2 -3
  3. package/dist/Epigraph/epigraph.js +18 -21
  4. package/dist/Epigraph/epigraphBaseSolutions.cjs +1 -0
  5. package/dist/Epigraph/{epigraphBaseSolution.d.ts → epigraphBaseSolutions.d.ts} +1 -1
  6. package/dist/{lib/Epigraph/epigraphBaseSolution.js → Epigraph/epigraphBaseSolutions.js} +1 -1
  7. package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs +16 -0
  8. package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +354 -27
  9. package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.cjs +1 -0
  10. package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs +1 -0
  11. package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs +29 -0
  12. package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js +359 -19
  13. package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs +1 -0
  14. package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.cjs +1 -0
  15. package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js +51 -30
  16. package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs +1 -0
  17. package/dist/epigraph-std-lib.cjs +1 -0
  18. package/dist/epigraph-std-lib.d.ts +9 -1
  19. package/dist/epigraph-std-lib.js +40 -1
  20. package/package.json +4 -35
  21. package/dist/EpigraphLibs/EpigraphAnalytics/types/index.d.ts +0 -7
  22. package/dist/lib/Epigraph/constants/enums.js +0 -4
  23. package/dist/lib/EpigraphLibs/EpigraphAnalytics/consent-plugins/consent-plugin-names.js +0 -4
  24. package/dist/lib/EpigraphLibs/EpigraphAnalytics/consent-plugins/one-trust-consent-plugin.js +0 -29
  25. package/dist/lib/EpigraphLibs/EpigraphAnalytics/generics/node.js +0 -22
  26. package/dist/lib/EpigraphLibs/EpigraphAnalytics/generics/queue.js +0 -23
  27. package/dist/lib/EpigraphLibs/EpigraphAnalytics/generics/single-linked-list.js +0 -30
  28. package/dist/lib/EpigraphLibs/EpigraphAnalytics/plugins/ga3-analytics-plugin.js +0 -87
  29. package/dist/lib/EpigraphLibs/EpigraphAnalytics/plugins/ga4-analytics-plugin.js +0 -121
  30. package/dist/lib/EpigraphLibs/EpigraphAnalytics/plugins/nexus-analytics-plugin.js +0 -45
  31. package/dist/lib/EpigraphLibs/EpigraphUnitsConverter/conversions.js +0 -26
  32. package/dist/lib/EpigraphLibs/EpigraphUnitsConverter/enums.js +0 -5
  33. package/dist/node_modules/lit-html/async-directive.js +0 -67
  34. package/dist/node_modules/lit-html/directive-helpers.js +0 -10
  35. package/dist/node_modules/lit-html/directive.js +0 -27
  36. package/dist/node_modules/lit-html/directives/ref.js +0 -40
  37. package/dist/node_modules/lit-html/lit-html.js +0 -225
  38. package/dist/vite-env.d.ts +0 -1
@@ -1,15 +1,354 @@
1
- import { LitElement as s, css as i, html as l } from "lit";
2
- import { createRef as c, ref as m } from "../../node_modules/lit-html/directives/ref.js";
3
- import d from "qr-creator";
4
- class a extends s {
1
+ import { LitElement as Q, css as Z, html as F } from "lit";
2
+ import J from "qr-creator";
3
+ /**
4
+ * @license
5
+ * Copyright 2017 Google LLC
6
+ * SPDX-License-Identifier: BSD-3-Clause
7
+ */
8
+ const S = globalThis, N = S.trustedTypes, L = N ? N.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, j = "$lit$", u = `lit$${Math.random().toFixed(9).slice(2)}$`, q = "?" + u, K = `<${q}>`, g = document, w = () => g.createComment(""), C = (i) => i === null || typeof i != "object" && typeof i != "function", R = Array.isArray, X = (i) => R(i) || typeof i?.[Symbol.iterator] == "function", G = `[
9
+ \f\r]`, m = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, k = /-->/g, B = />/g, p = RegExp(`>|${G}(?:([^\\s"'>=/]+)(${G}*=${G}*(?:[^
10
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), O = /'/g, D = /"/g, P = /^(?:script|style|textarea|title)$/i, H = Symbol.for("lit-noChange"), a = Symbol.for("lit-nothing"), W = /* @__PURE__ */ new WeakMap(), f = g.createTreeWalker(g, 129);
11
+ function z(i, t) {
12
+ if (!R(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
13
+ return L !== void 0 ? L.createHTML(t) : t;
14
+ }
15
+ const Y = (i, t) => {
16
+ const e = i.length - 1, s = [];
17
+ let n, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", r = m;
18
+ for (let d = 0; d < e; d++) {
19
+ const h = i[d];
20
+ let c, $, l = -1, A = 0;
21
+ for (; A < h.length && (r.lastIndex = A, $ = r.exec(h), $ !== null); ) A = r.lastIndex, r === m ? $[1] === "!--" ? r = k : $[1] !== void 0 ? r = B : $[2] !== void 0 ? (P.test($[2]) && (n = RegExp("</" + $[2], "g")), r = p) : $[3] !== void 0 && (r = p) : r === p ? $[0] === ">" ? (r = n ?? m, l = -1) : $[1] === void 0 ? l = -2 : (l = r.lastIndex - $[2].length, c = $[1], r = $[3] === void 0 ? p : $[3] === '"' ? D : O) : r === D || r === O ? r = p : r === k || r === B ? r = m : (r = p, n = void 0);
22
+ const _ = r === p && i[d + 1].startsWith("/>") ? " " : "";
23
+ o += r === m ? h + K : l >= 0 ? (s.push(c), h.slice(0, l) + j + h.slice(l) + u + _) : h + u + (l === -2 ? d : _);
24
+ }
25
+ return [z(i, o + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
26
+ };
27
+ class x {
28
+ constructor({ strings: t, _$litType$: e }, s) {
29
+ let n;
30
+ this.parts = [];
31
+ let o = 0, r = 0;
32
+ const d = t.length - 1, h = this.parts, [c, $] = Y(t, e);
33
+ if (this.el = x.createElement(c, s), f.currentNode = this.el.content, e === 2 || e === 3) {
34
+ const l = this.el.content.firstChild;
35
+ l.replaceWith(...l.childNodes);
36
+ }
37
+ for (; (n = f.nextNode()) !== null && h.length < d; ) {
38
+ if (n.nodeType === 1) {
39
+ if (n.hasAttributes()) for (const l of n.getAttributeNames()) if (l.endsWith(j)) {
40
+ const A = $[r++], _ = n.getAttribute(l).split(u), b = /([.?@])?(.*)/.exec(A);
41
+ h.push({ type: 1, index: o, name: b[2], strings: _, ctor: b[1] === "." ? et : b[1] === "?" ? st : b[1] === "@" ? it : U }), n.removeAttribute(l);
42
+ } else l.startsWith(u) && (h.push({ type: 6, index: o }), n.removeAttribute(l));
43
+ if (P.test(n.tagName)) {
44
+ const l = n.textContent.split(u), A = l.length - 1;
45
+ if (A > 0) {
46
+ n.textContent = N ? N.emptyScript : "";
47
+ for (let _ = 0; _ < A; _++) n.append(l[_], w()), f.nextNode(), h.push({ type: 2, index: ++o });
48
+ n.append(l[A], w());
49
+ }
50
+ }
51
+ } else if (n.nodeType === 8) if (n.data === q) h.push({ type: 2, index: o });
52
+ else {
53
+ let l = -1;
54
+ for (; (l = n.data.indexOf(u, l + 1)) !== -1; ) h.push({ type: 7, index: o }), l += u.length - 1;
55
+ }
56
+ o++;
57
+ }
58
+ }
59
+ static createElement(t, e) {
60
+ const s = g.createElement("template");
61
+ return s.innerHTML = t, s;
62
+ }
63
+ }
64
+ function v(i, t, e = i, s) {
65
+ if (t === H) return t;
66
+ let n = s !== void 0 ? e._$Co?.[s] : e._$Cl;
67
+ const o = C(t) ? void 0 : t._$litDirective$;
68
+ return n?.constructor !== o && (n?._$AO?.(!1), o === void 0 ? n = void 0 : (n = new o(i), n._$AT(i, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = n : e._$Cl = n), n !== void 0 && (t = v(i, n._$AS(i, t.values), n, s)), t;
69
+ }
70
+ class tt {
71
+ constructor(t, e) {
72
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
73
+ }
74
+ get parentNode() {
75
+ return this._$AM.parentNode;
76
+ }
77
+ get _$AU() {
78
+ return this._$AM._$AU;
79
+ }
80
+ u(t) {
81
+ const { el: { content: e }, parts: s } = this._$AD, n = (t?.creationScope ?? g).importNode(e, !0);
82
+ f.currentNode = n;
83
+ let o = f.nextNode(), r = 0, d = 0, h = s[0];
84
+ for (; h !== void 0; ) {
85
+ if (r === h.index) {
86
+ let c;
87
+ h.type === 2 ? c = new T(o, o.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(o, h.name, h.strings, this, t) : h.type === 6 && (c = new nt(o, this, t)), this._$AV.push(c), h = s[++d];
88
+ }
89
+ r !== h?.index && (o = f.nextNode(), r++);
90
+ }
91
+ return f.currentNode = g, n;
92
+ }
93
+ p(t) {
94
+ let e = 0;
95
+ for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
96
+ }
97
+ }
98
+ class T {
99
+ get _$AU() {
100
+ return this._$AM?._$AU ?? this._$Cv;
101
+ }
102
+ constructor(t, e, s, n) {
103
+ this.type = 2, this._$AH = a, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = n, this._$Cv = n?.isConnected ?? !0;
104
+ }
105
+ get parentNode() {
106
+ let t = this._$AA.parentNode;
107
+ const e = this._$AM;
108
+ return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
109
+ }
110
+ get startNode() {
111
+ return this._$AA;
112
+ }
113
+ get endNode() {
114
+ return this._$AB;
115
+ }
116
+ _$AI(t, e = this) {
117
+ t = v(this, t, e), C(t) ? t === a || t == null || t === "" ? (this._$AH !== a && this._$AR(), this._$AH = a) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : X(t) ? this.k(t) : this._(t);
118
+ }
119
+ O(t) {
120
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
121
+ }
122
+ T(t) {
123
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
124
+ }
125
+ _(t) {
126
+ this._$AH !== a && C(this._$AH) ? this._$AA.nextSibling.data = t : this.T(g.createTextNode(t)), this._$AH = t;
127
+ }
128
+ $(t) {
129
+ const { values: e, _$litType$: s } = t, n = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = x.createElement(z(s.h, s.h[0]), this.options)), s);
130
+ if (this._$AH?._$AD === n) this._$AH.p(e);
131
+ else {
132
+ const o = new tt(n, this), r = o.u(this.options);
133
+ o.p(e), this.T(r), this._$AH = o;
134
+ }
135
+ }
136
+ _$AC(t) {
137
+ let e = W.get(t.strings);
138
+ return e === void 0 && W.set(t.strings, e = new x(t)), e;
139
+ }
140
+ k(t) {
141
+ R(this._$AH) || (this._$AH = [], this._$AR());
142
+ const e = this._$AH;
143
+ let s, n = 0;
144
+ for (const o of t) n === e.length ? e.push(s = new T(this.O(w()), this.O(w()), this, this.options)) : s = e[n], s._$AI(o), n++;
145
+ n < e.length && (this._$AR(s && s._$AB.nextSibling, n), e.length = n);
146
+ }
147
+ _$AR(t = this._$AA.nextSibling, e) {
148
+ for (this._$AP?.(!1, !0, e); t && t !== this._$AB; ) {
149
+ const s = t.nextSibling;
150
+ t.remove(), t = s;
151
+ }
152
+ }
153
+ setConnected(t) {
154
+ this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
155
+ }
156
+ }
157
+ class U {
158
+ get tagName() {
159
+ return this.element.tagName;
160
+ }
161
+ get _$AU() {
162
+ return this._$AM._$AU;
163
+ }
164
+ constructor(t, e, s, n, o) {
165
+ this.type = 1, this._$AH = a, this._$AN = void 0, this.element = t, this.name = e, this._$AM = n, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = a;
166
+ }
167
+ _$AI(t, e = this, s, n) {
168
+ const o = this.strings;
169
+ let r = !1;
170
+ if (o === void 0) t = v(this, t, e, 0), r = !C(t) || t !== this._$AH && t !== H, r && (this._$AH = t);
171
+ else {
172
+ const d = t;
173
+ let h, c;
174
+ for (t = o[0], h = 0; h < o.length - 1; h++) c = v(this, d[s + h], e, h), c === H && (c = this._$AH[h]), r ||= !C(c) || c !== this._$AH[h], c === a ? t = a : t !== a && (t += (c ?? "") + o[h + 1]), this._$AH[h] = c;
175
+ }
176
+ r && !n && this.j(t);
177
+ }
178
+ j(t) {
179
+ t === a ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
180
+ }
181
+ }
182
+ class et extends U {
183
+ constructor() {
184
+ super(...arguments), this.type = 3;
185
+ }
186
+ j(t) {
187
+ this.element[this.name] = t === a ? void 0 : t;
188
+ }
189
+ }
190
+ class st extends U {
191
+ constructor() {
192
+ super(...arguments), this.type = 4;
193
+ }
194
+ j(t) {
195
+ this.element.toggleAttribute(this.name, !!t && t !== a);
196
+ }
197
+ }
198
+ class it extends U {
199
+ constructor(t, e, s, n, o) {
200
+ super(t, e, s, n, o), this.type = 5;
201
+ }
202
+ _$AI(t, e = this) {
203
+ if ((t = v(this, t, e, 0) ?? a) === H) return;
204
+ const s = this._$AH, n = t === a && s !== a || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== a && (s === a || n);
205
+ n && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
206
+ }
207
+ handleEvent(t) {
208
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
209
+ }
210
+ }
211
+ class nt {
212
+ constructor(t, e, s) {
213
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
214
+ }
215
+ get _$AU() {
216
+ return this._$AM._$AU;
217
+ }
218
+ _$AI(t) {
219
+ v(this, t);
220
+ }
221
+ }
222
+ const ot = S.litHtmlPolyfillSupport;
223
+ ot?.(x, T), (S.litHtmlVersions ??= []).push("3.3.0");
224
+ /**
225
+ * @license
226
+ * Copyright 2020 Google LLC
227
+ * SPDX-License-Identifier: BSD-3-Clause
228
+ */
229
+ const rt = (i) => i.strings === void 0;
230
+ /**
231
+ * @license
232
+ * Copyright 2017 Google LLC
233
+ * SPDX-License-Identifier: BSD-3-Clause
234
+ */
235
+ const ht = { CHILD: 2 }, lt = (i) => (...t) => ({ _$litDirective$: i, values: t });
236
+ class at {
237
+ constructor(t) {
238
+ }
239
+ get _$AU() {
240
+ return this._$AM._$AU;
241
+ }
242
+ _$AT(t, e, s) {
243
+ this._$Ct = t, this._$AM = e, this._$Ci = s;
244
+ }
245
+ _$AS(t, e) {
246
+ return this.update(t, e);
247
+ }
248
+ update(t, e) {
249
+ return this.render(...e);
250
+ }
251
+ }
252
+ /**
253
+ * @license
254
+ * Copyright 2017 Google LLC
255
+ * SPDX-License-Identifier: BSD-3-Clause
256
+ */
257
+ const y = (i, t) => {
258
+ const e = i._$AN;
259
+ if (e === void 0) return !1;
260
+ for (const s of e) s._$AO?.(t, !1), y(s, t);
261
+ return !0;
262
+ }, M = (i) => {
263
+ let t, e;
264
+ do {
265
+ if ((t = i._$AM) === void 0) break;
266
+ e = t._$AN, e.delete(i), i = t;
267
+ } while (e?.size === 0);
268
+ }, V = (i) => {
269
+ for (let t; t = i._$AM; i = t) {
270
+ let e = t._$AN;
271
+ if (e === void 0) t._$AN = e = /* @__PURE__ */ new Set();
272
+ else if (e.has(i)) break;
273
+ e.add(i), dt(t);
274
+ }
275
+ };
276
+ function ct(i) {
277
+ this._$AN !== void 0 ? (M(this), this._$AM = i, V(this)) : this._$AM = i;
278
+ }
279
+ function $t(i, t = !1, e = 0) {
280
+ const s = this._$AH, n = this._$AN;
281
+ if (n !== void 0 && n.size !== 0) if (t) if (Array.isArray(s)) for (let o = e; o < s.length; o++) y(s[o], !1), M(s[o]);
282
+ else s != null && (y(s, !1), M(s));
283
+ else y(this, i);
284
+ }
285
+ const dt = (i) => {
286
+ i.type == ht.CHILD && (i._$AP ??= $t, i._$AQ ??= ct);
287
+ };
288
+ class At extends at {
289
+ constructor() {
290
+ super(...arguments), this._$AN = void 0;
291
+ }
292
+ _$AT(t, e, s) {
293
+ super._$AT(t, e, s), V(this), this.isConnected = t._$AU;
294
+ }
295
+ _$AO(t, e = !0) {
296
+ t !== this.isConnected && (this.isConnected = t, t ? this.reconnected?.() : this.disconnected?.()), e && (y(this, t), M(this));
297
+ }
298
+ setValue(t) {
299
+ if (rt(this._$Ct)) this._$Ct._$AI(t, this);
300
+ else {
301
+ const e = [...this._$Ct._$AH];
302
+ e[this._$Ci] = t, this._$Ct._$AI(e, this, 0);
303
+ }
304
+ }
305
+ disconnected() {
306
+ }
307
+ reconnected() {
308
+ }
309
+ }
310
+ /**
311
+ * @license
312
+ * Copyright 2020 Google LLC
313
+ * SPDX-License-Identifier: BSD-3-Clause
314
+ */
315
+ const _t = () => new ut();
316
+ class ut {
317
+ }
318
+ const E = /* @__PURE__ */ new WeakMap(), pt = lt(class extends At {
319
+ render(i) {
320
+ return a;
321
+ }
322
+ update(i, [t]) {
323
+ const e = t !== this.G;
324
+ return e && this.G !== void 0 && this.rt(void 0), (e || this.lt !== this.ct) && (this.G = t, this.ht = i.options?.host, this.rt(this.ct = i.element)), a;
325
+ }
326
+ rt(i) {
327
+ if (this.isConnected || (i = void 0), typeof this.G == "function") {
328
+ const t = this.ht ?? globalThis;
329
+ let e = E.get(t);
330
+ e === void 0 && (e = /* @__PURE__ */ new WeakMap(), E.set(t, e)), e.get(this.G) !== void 0 && this.G.call(this.ht, void 0), e.set(this.G, i), i !== void 0 && this.G.call(this.ht, i);
331
+ } else this.G.value = i;
332
+ }
333
+ get lt() {
334
+ return typeof this.G == "function" ? E.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
335
+ }
336
+ disconnected() {
337
+ this.lt === this.ct && this.rt(void 0);
338
+ }
339
+ reconnected() {
340
+ this.rt(this.ct);
341
+ }
342
+ });
343
+ class I extends Q {
5
344
  constructor() {
6
- super(...arguments), this._qrCodeGenCanvasRef = c();
345
+ super(...arguments), this._qrCodeGenCanvasRef = _t();
7
346
  }
8
347
  static {
9
348
  this.webComponentName = "epigraph-qr-code-generator";
10
349
  }
11
350
  static {
12
- this.styles = i`
351
+ this.styles = Z`
13
352
  :host {
14
353
  display: none;
15
354
  }
@@ -21,11 +360,12 @@ class a extends s {
21
360
  * @param {string} dataUri Raw data URI, either fetched from an HTML Canvas or any other valid source.
22
361
  * @returns {Blob} The generate blob.
23
362
  */
24
- dataUritoBlob(e) {
25
- const t = atob(e.split(",")[1]), r = e.split(",")[0].split(":")[1].split(";")[0], o = [];
26
- for (let n = 0; n < t.length; n++)
27
- o.push(t.charCodeAt(n));
28
- return new Blob([new Uint8Array(o)], { type: r });
363
+ dataUritoBlob(t) {
364
+ const e = t.split(",");
365
+ if (e.length !== 2)
366
+ throw new Error("Invalid data URI format");
367
+ const s = e[0].split(":")[1].split(";")[0], n = atob(e[1]), o = new Uint8Array(Array.from(n, (r) => r.charCodeAt(0)));
368
+ return new Blob([o], { type: s });
29
369
  }
30
370
  /**
31
371
  * Generates a QR code as image data url for the qrCodeContent provided.
@@ -33,7 +373,7 @@ class a extends s {
33
373
  * @param {string} qrCodeContent The content to be embedded in the QR code.
34
374
  * @returns {string} Session data URL for the generated QR code.
35
375
  */
36
- generateQrCode(e = {
376
+ generateQrCode(t = {
37
377
  text: "www.epigraph.us",
38
378
  radius: 0.5,
39
379
  // 0.0 to 0.5
@@ -48,9 +388,9 @@ class a extends s {
48
388
  }) {
49
389
  if (!this._qrCodeGenCanvasRef.value)
50
390
  return "";
51
- d.render(e, this._qrCodeGenCanvasRef.value);
52
- const t = this._qrCodeGenCanvasRef.value.toDataURL(), r = this.dataUritoBlob(t);
53
- return URL.createObjectURL(r);
391
+ J.render(t, this._qrCodeGenCanvasRef.value);
392
+ const e = this._qrCodeGenCanvasRef.value.toDataURL(), s = this.dataUritoBlob(e);
393
+ return URL.createObjectURL(s);
54
394
  }
55
395
  /**
56
396
  * Override for the LitElement's render method.
@@ -58,12 +398,12 @@ class a extends s {
58
398
  * @returns {html} HTML to be rendered by this component.
59
399
  */
60
400
  render() {
61
- return l`
62
- <canvas id="qrCode" ${m(this._qrCodeGenCanvasRef)}></canvas>
401
+ return F`
402
+ <canvas id="qrCode" ${pt(this._qrCodeGenCanvasRef)}></canvas>
63
403
  `;
64
404
  }
65
405
  }
66
- window.customElements.get(a.webComponentName) === void 0 && window.customElements.define(a.webComponentName, a);
406
+ window.customElements.get(I.webComponentName) === void 0 && window.customElements.define(I.webComponentName, I);
67
407
  export {
68
- a as EpigraphQrCodeGenerator
408
+ I as EpigraphQrCodeGenerator
69
409
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(s,t,r,a=""){this._success=s,this._payload=t,this._status=r,this._message=a}get success(){return this._success}get payload(){return this._payload}get status(){return this._status}get message(){return this._message}}function c(e,s,t=""){return new u(!0,e,s,t)}function l(e,s,t=""){return new u(!1,e,s,t)}exports.Result=u;exports.failureResult=l;exports.successResult=c;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=(r=>(r.RAW="raw",r.DISTANCE="distance",r.WEIGHT="weight",r))(n||{}),e=(r=>(r.millimeter="mm",r.centimeter="cm",r.decimeter="dm",r.meter="m",r.decameter="dam",r.hectometer="hm",r.kilometer="km",r.inch="in",r.foot="ft",r.yard="yd",r.mile="mi",r))(e||{});let t={};t[`${e.millimeter}-${e.meter}`]=.001;t[`${e.meter}-${e.millimeter}`]=1e3;t[`${e.centimeter}-${e.meter}`]=.01;t[`${e.meter}-${e.centimeter}`]=100;t[`${e.decimeter}-${e.meter}`]=.1;t[`${e.meter}-${e.decimeter}`]=10;t[`${e.meter}-${e.meter}`]=1;t[`${e.decameter}-${e.meter}`]=10;t[`${e.meter}-${e.decameter}`]=.1;t[`${e.hectometer}-${e.meter}`]=100;t[`${e.meter}-${e.hectometer}`]=.01;t[`${e.kilometer}-${e.meter}`]=1e3;t[`${e.meter}-${e.kilometer}`]=.001;t[`${e.inch}-${e.meter}`]=.0254;t[`${e.meter}-${e.inch}`]=39.3701;t[`${e.foot}-${e.meter}`]=.3048;t[`${e.meter}-${e.foot}`]=3.28084;t[`${e.yard}-${e.meter}`]=.9144;t[`${e.meter}-${e.yard}`]=1.09361;t[`${e.mile}-${e.meter}`]=1609.34;t[`${e.meter}-${e.mile}`]=621371e-9;class m{constructor(l,i){if(this._type=n.DISTANCE,this._rawValue=l,this._rawValueUnit=i,i!==e.meter){const u=m.convert(this._rawValue,i,e.meter);this._rawValue=u.value,this._rawValueUnit=u.valueUnit}}get type(){return this._type}static buildConvertedUnitResult(l,i){return{value:l,valueUnit:i,valueWithUnit:`${l.toFixed(2)}${i}`}}static convert(l,i,u){let a=l,o=u;if(i===u)return m.buildConvertedUnitResult(a,o);const $=t[`${i}-${u}`];return a=l*$,m.buildConvertedUnitResult(a,o)}get inMillimeters(){return m.convert(this._rawValue,this._rawValueUnit,e.millimeter)}get inCentimeters(){return m.convert(this._rawValue,this._rawValueUnit,e.centimeter)}get inDecimeters(){return m.convert(this._rawValue,this._rawValueUnit,e.decimeter)}get inMeters(){return m.convert(this._rawValue,this._rawValueUnit,e.meter)}get inDecameters(){return m.convert(this._rawValue,this._rawValueUnit,e.decameter)}get inHectometers(){return m.convert(this._rawValue,this._rawValueUnit,e.hectometer)}get inKilometers(){return m.convert(this._rawValue,this._rawValueUnit,e.kilometer)}get inInches(){return m.convert(this._rawValue,this._rawValueUnit,e.inch)}get inFeet(){return m.convert(this._rawValue,this._rawValueUnit,e.foot)}get inYard(){return m.convert(this._rawValue,this._rawValueUnit,e.yard)}get inMiles(){return m.convert(this._rawValue,this._rawValueUnit,e.mile)}}exports.Distance=m;exports.DistanceUnits=e;exports.UnitTypes=n;
@@ -1,67 +1,88 @@
1
- import { ConversionFactors as s } from "../../lib/EpigraphLibs/EpigraphUnitsConverter/conversions.js";
2
- import { UnitTypes as o, DistanceUnits as t } from "../../lib/EpigraphLibs/EpigraphUnitsConverter/enums.js";
3
- class e {
4
- constructor(i, r) {
5
- if (this._type = o.DISTANCE, this._rawValue = i, this._rawValueUnit = r, r !== t.meter) {
6
- const n = e.convert(this._rawValue, r, t.meter);
7
- this._rawValue = n.value, this._rawValueUnit = n.valueUnit;
1
+ var o = /* @__PURE__ */ ((t) => (t.RAW = "raw", t.DISTANCE = "distance", t.WEIGHT = "weight", t))(o || {}), e = /* @__PURE__ */ ((t) => (t.millimeter = "mm", t.centimeter = "cm", t.decimeter = "dm", t.meter = "m", t.decameter = "dam", t.hectometer = "hm", t.kilometer = "km", t.inch = "in", t.foot = "ft", t.yard = "yd", t.mile = "mi", t))(e || {});
2
+ let r = {};
3
+ r[`${e.millimeter}-${e.meter}`] = 1e-3;
4
+ r[`${e.meter}-${e.millimeter}`] = 1e3;
5
+ r[`${e.centimeter}-${e.meter}`] = 0.01;
6
+ r[`${e.meter}-${e.centimeter}`] = 100;
7
+ r[`${e.decimeter}-${e.meter}`] = 0.1;
8
+ r[`${e.meter}-${e.decimeter}`] = 10;
9
+ r[`${e.meter}-${e.meter}`] = 1;
10
+ r[`${e.decameter}-${e.meter}`] = 10;
11
+ r[`${e.meter}-${e.decameter}`] = 0.1;
12
+ r[`${e.hectometer}-${e.meter}`] = 100;
13
+ r[`${e.meter}-${e.hectometer}`] = 0.01;
14
+ r[`${e.kilometer}-${e.meter}`] = 1e3;
15
+ r[`${e.meter}-${e.kilometer}`] = 1e-3;
16
+ r[`${e.inch}-${e.meter}`] = 0.0254;
17
+ r[`${e.meter}-${e.inch}`] = 39.3701;
18
+ r[`${e.foot}-${e.meter}`] = 0.3048;
19
+ r[`${e.meter}-${e.foot}`] = 3.28084;
20
+ r[`${e.yard}-${e.meter}`] = 0.9144;
21
+ r[`${e.meter}-${e.yard}`] = 1.09361;
22
+ r[`${e.mile}-${e.meter}`] = 1609.34;
23
+ r[`${e.meter}-${e.mile}`] = 621371e-9;
24
+ class m {
25
+ constructor(l, i) {
26
+ if (this._type = o.DISTANCE, this._rawValue = l, this._rawValueUnit = i, i !== e.meter) {
27
+ const u = m.convert(this._rawValue, i, e.meter);
28
+ this._rawValue = u.value, this._rawValueUnit = u.valueUnit;
8
29
  }
9
30
  }
10
31
  get type() {
11
32
  return this._type;
12
33
  }
13
- static buildConvertedUnitResult(i, r) {
34
+ static buildConvertedUnitResult(l, i) {
14
35
  return {
15
- value: i,
16
- valueUnit: r,
17
- valueWithUnit: `${i.toFixed(2)}${r}`
36
+ value: l,
37
+ valueUnit: i,
38
+ valueWithUnit: `${l.toFixed(2)}${i}`
18
39
  };
19
40
  }
20
- static convert(i, r, n) {
21
- let a = i, u = n;
22
- if (r === n)
23
- return e.buildConvertedUnitResult(a, u);
24
- const l = s[`${r}-${n}`];
25
- return a = i * l, e.buildConvertedUnitResult(a, u);
41
+ static convert(l, i, u) {
42
+ let a = l, $ = u;
43
+ if (i === u)
44
+ return m.buildConvertedUnitResult(a, $);
45
+ const n = r[`${i}-${u}`];
46
+ return a = l * n, m.buildConvertedUnitResult(a, $);
26
47
  }
27
48
  /** ----------------- METRIC UNITS ----------------- */
28
49
  get inMillimeters() {
29
- return e.convert(this._rawValue, this._rawValueUnit, t.millimeter);
50
+ return m.convert(this._rawValue, this._rawValueUnit, e.millimeter);
30
51
  }
31
52
  get inCentimeters() {
32
- return e.convert(this._rawValue, this._rawValueUnit, t.centimeter);
53
+ return m.convert(this._rawValue, this._rawValueUnit, e.centimeter);
33
54
  }
34
55
  get inDecimeters() {
35
- return e.convert(this._rawValue, this._rawValueUnit, t.decimeter);
56
+ return m.convert(this._rawValue, this._rawValueUnit, e.decimeter);
36
57
  }
37
58
  get inMeters() {
38
- return e.convert(this._rawValue, this._rawValueUnit, t.meter);
59
+ return m.convert(this._rawValue, this._rawValueUnit, e.meter);
39
60
  }
40
61
  get inDecameters() {
41
- return e.convert(this._rawValue, this._rawValueUnit, t.decameter);
62
+ return m.convert(this._rawValue, this._rawValueUnit, e.decameter);
42
63
  }
43
64
  get inHectometers() {
44
- return e.convert(this._rawValue, this._rawValueUnit, t.hectometer);
65
+ return m.convert(this._rawValue, this._rawValueUnit, e.hectometer);
45
66
  }
46
67
  get inKilometers() {
47
- return e.convert(this._rawValue, this._rawValueUnit, t.kilometer);
68
+ return m.convert(this._rawValue, this._rawValueUnit, e.kilometer);
48
69
  }
49
70
  /** ----------------- METRIC UNITS ----------------- */
50
71
  get inInches() {
51
- return e.convert(this._rawValue, this._rawValueUnit, t.inch);
72
+ return m.convert(this._rawValue, this._rawValueUnit, e.inch);
52
73
  }
53
74
  get inFeet() {
54
- return e.convert(this._rawValue, this._rawValueUnit, t.foot);
75
+ return m.convert(this._rawValue, this._rawValueUnit, e.foot);
55
76
  }
56
77
  get inYard() {
57
- return e.convert(this._rawValue, this._rawValueUnit, t.yard);
78
+ return m.convert(this._rawValue, this._rawValueUnit, e.yard);
58
79
  }
59
80
  get inMiles() {
60
- return e.convert(this._rawValue, this._rawValueUnit, t.mile);
81
+ return m.convert(this._rawValue, this._rawValueUnit, e.mile);
61
82
  }
62
83
  }
63
84
  export {
64
- e as Distance,
65
- t as DistanceUnits,
85
+ m as Distance,
86
+ e as DistanceUnits,
66
87
  o as UnitTypes
67
88
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=(r=>(r.AR="ar",r))(n||{}),i=(r=>(r.type="t",r.identifierType="idt",r.identifier="id",r.epigraphSessionId="eid",r.action="a",r))(i||{});class l{constructor(e=window.location.href){this._baseUrl=e}get baseUrl(){return this._baseUrl}set baseUrl(e){this._baseUrl=e}getParameterInUrl(e){const a=new URL(this._baseUrl);let t=a.searchParams.get(e);return t||(t=this.decryptQueryParametersInUrl(a).searchParams.get(e)),t}hasParameterInUrl(e){return!!this.getParameterInUrl(e)}generateQrCodeUrl(e={},a=!0){const t=new URL(this._baseUrl);for(const[s,c]of Object.entries(e))t.searchParams.set(s,c);return a&&this.encryptQueryParametersInUrl(t),t}encryptQueryParametersInUrl(e){return e.search=btoa(e.search),e}decryptQueryParametersInUrl(e){let a=e;try{e.search=atob(e.search.slice(1)),a=e}catch(t){window.epigraph.logger.info({title:`Couldn't decode URL: ${e}`,details:t})}return a}}exports.EpigraphUrlProcessor=l;exports.QUERY_PARAMETER_ACTION_NAMES=n;exports.QUERY_PARAMETER_NAMES=i;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./Epigraph/epigraph.cjs"),n=require("./Epigraph/epigraphBaseSolutions.cjs"),e=require("./EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs"),r=require("./EpigraphLibs/EpigraphLogger/epigraphLogger.cjs"),i=require("./EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs"),g=require("./EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs"),s=require("./EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs"),p=require("./EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.cjs"),t=require("./EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs");exports.ENVIRONMENT_TYPE=a.ENVIRONMENT_TYPE;exports.Epigraph=a.Epigraph;exports.EpigraphBaseSolutionHtmlElement=n.EpigraphBaseSolutionHtmlElement;exports.EpigraphBaseSolutionLitElement=n.EpigraphBaseSolutionLitElement;exports.ConsentPluginNames=e.ConsentPluginNames;exports.EpigraphAnalytics=e.EpigraphAnalytics;exports.GA3AnalyticsPlugin=e.GA3AnalyticsPlugin;exports.GA4AnalyticsPlugin=e.GA4AnalyticsPlugin;exports.NexusAnalyticsPlugin=e.NexusAnalyticsPlugin;exports.OneTrustConsentPlugin=e.OneTrustConsentPlugin;exports.EpigraphLogger=r.EpigraphLogger;exports.LogTypes=r.LogTypes;exports.LoggerModeNames=r.LoggerModeNames;exports.EpigraphNexusAPI=i.EpigraphNexusAPI;exports.HTTPMethod=i.HTTPMethod;exports.NexusAPIResourceIdentifier=i.NexusAPIResourceIdentifier;exports.NexusAPIRoutes=i.NexusAPIRoutes;exports.NexusAPIVersions=i.NexusAPIVersions;exports.NexusEndpoints=i.NexusEndpoints;exports.EpigraphQrCodeGenerator=g.EpigraphQrCodeGenerator;exports.Result=s.Result;exports.failureResult=s.failureResult;exports.successResult=s.successResult;exports.Distance=p.Distance;exports.DistanceUnits=p.DistanceUnits;exports.UnitTypes=p.UnitTypes;exports.EpigraphUrlProcessor=t.EpigraphUrlProcessor;exports.QUERY_PARAMETER_ACTION_NAMES=t.QUERY_PARAMETER_ACTION_NAMES;exports.QUERY_PARAMETER_NAMES=t.QUERY_PARAMETER_NAMES;
@@ -1 +1,9 @@
1
- export {};
1
+ export * from './Epigraph/epigraph';
2
+ export * from './Epigraph/epigraphBaseSolutions';
3
+ export * from './EpigraphLibs/EpigraphAnalytics/epigraphAnalytics';
4
+ export * from './EpigraphLibs/EpigraphLogger/epigraphLogger';
5
+ export * from './EpigraphLibs/EpigraphNexusApi/epigraphNexusApi';
6
+ export * from './EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator';
7
+ export * from './EpigraphLibs/EpigraphResultFactory/epigraphResultFactory';
8
+ export * from './EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter';
9
+ export * from './EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor';
@@ -1 +1,40 @@
1
-
1
+ import { ENVIRONMENT_TYPE as o, Epigraph as s } from "./Epigraph/epigraph.js";
2
+ import { EpigraphBaseSolutionHtmlElement as i, EpigraphBaseSolutionLitElement as p } from "./Epigraph/epigraphBaseSolutions.js";
3
+ import { ConsentPluginNames as E, EpigraphAnalytics as u, GA3AnalyticsPlugin as a, GA4AnalyticsPlugin as l, NexusAnalyticsPlugin as g, OneTrustConsentPlugin as A } from "./EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js";
4
+ import { EpigraphLogger as m, LogTypes as N, LoggerModeNames as P } from "./EpigraphLibs/EpigraphLogger/epigraphLogger.js";
5
+ import { EpigraphNexusAPI as f, HTTPMethod as c, NexusAPIResourceIdentifier as T, NexusAPIRoutes as h, NexusAPIVersions as I, NexusEndpoints as M } from "./EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js";
6
+ import { EpigraphQrCodeGenerator as _ } from "./EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js";
7
+ import { Result as U, failureResult as C, successResult as L } from "./EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js";
8
+ import { Distance as G, DistanceUnits as O, UnitTypes as Q } from "./EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js";
9
+ import { EpigraphUrlProcessor as B, QUERY_PARAMETER_ACTION_NAMES as D, QUERY_PARAMETER_NAMES as H } from "./EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js";
10
+ export {
11
+ E as ConsentPluginNames,
12
+ G as Distance,
13
+ O as DistanceUnits,
14
+ o as ENVIRONMENT_TYPE,
15
+ s as Epigraph,
16
+ u as EpigraphAnalytics,
17
+ i as EpigraphBaseSolutionHtmlElement,
18
+ p as EpigraphBaseSolutionLitElement,
19
+ m as EpigraphLogger,
20
+ f as EpigraphNexusAPI,
21
+ _ as EpigraphQrCodeGenerator,
22
+ B as EpigraphUrlProcessor,
23
+ a as GA3AnalyticsPlugin,
24
+ l as GA4AnalyticsPlugin,
25
+ c as HTTPMethod,
26
+ N as LogTypes,
27
+ P as LoggerModeNames,
28
+ T as NexusAPIResourceIdentifier,
29
+ h as NexusAPIRoutes,
30
+ I as NexusAPIVersions,
31
+ g as NexusAnalyticsPlugin,
32
+ M as NexusEndpoints,
33
+ A as OneTrustConsentPlugin,
34
+ D as QUERY_PARAMETER_ACTION_NAMES,
35
+ H as QUERY_PARAMETER_NAMES,
36
+ U as Result,
37
+ Q as UnitTypes,
38
+ C as failureResult,
39
+ L as successResult
40
+ };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@epigraph/epigraph-std-lib",
3
- "version": "4.0.2-alpha",
3
+ "version": "4.1.0",
4
4
  "type": "module",
5
- "main": "./dist/epigraph-std-lib.js",
5
+ "main": "./dist/epigraph-std-lib.cjs",
6
6
  "module": "./dist/epigraph-std-lib.js",
7
7
  "files": [
8
8
  "dist",
@@ -11,40 +11,9 @@
11
11
  "types": "./dist/epigraph-std-lib.d.ts",
12
12
  "exports": {
13
13
  ".": {
14
+ "types": "./dist/epigraph-std-lib.d.ts",
14
15
  "import": "./dist/epigraph-std-lib.js",
15
- "types": "./dist/epigraph-std-lib.d.ts"
16
- },
17
- "./epigraph": {
18
- "import": "./dist/Epigraph/epigraph.js",
19
- "types": "./dist/Epigraph/epigraph.d.ts"
20
- },
21
- "./epigraphAnalytics": {
22
- "import": "./dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js",
23
- "types": "./dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.d.ts"
24
- },
25
- "./epigraphLogger": {
26
- "import": "./dist/EpigraphLibs/EpigraphLogger/epigraphLogger.js",
27
- "types": "./dist/EpigraphLibs/EpigraphLogger/epigraphLogger.d.ts"
28
- },
29
- "./epigraphNexusApi": {
30
- "import": "./dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js",
31
- "types": "./dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.d.ts"
32
- },
33
- "./epigraphQrCodeGenerator": {
34
- "import": "./dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js",
35
- "types": "./dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.d.ts"
36
- },
37
- "./epigraphResultFactory": {
38
- "import": "./dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js",
39
- "types": "./dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.d.ts"
40
- },
41
- "./epigraphUnitsConverter": {
42
- "import": "./dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js",
43
- "types": "./dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.d.ts"
44
- },
45
- "./epigraphUrlProcessor": {
46
- "import": "./dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js",
47
- "types": "./dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.d.ts"
16
+ "require": "./dist/epigraph-std-lib.cjs"
48
17
  }
49
18
  },
50
19
  "scripts": {