smoothly 0.3.55 → 0.3.57

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 (30) hide show
  1. package/dist/cjs/{Listenable-0b92b362.js → Listenable-fcea5136.js} +41 -21
  2. package/dist/cjs/getLanguage-7991c46a.js +6041 -0
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/smoothly-accordion_53.cjs.entry.js +309 -19078
  5. package/dist/cjs/smoothly-country.cjs.entry.js +8 -8
  6. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +1 -1
  7. package/dist/cjs/smoothly-trigger-source.cjs.entry.js +1 -1
  8. package/dist/custom-elements/index.js +919 -25750
  9. package/dist/esm/{Listenable-79ce5567.js → Listenable-10f48463.js} +41 -21
  10. package/dist/esm/getLanguage-225b37b0.js +6039 -0
  11. package/dist/esm/index.js +2 -2
  12. package/dist/esm/smoothly-accordion_53.entry.js +309 -19078
  13. package/dist/esm/smoothly-country.entry.js +8 -8
  14. package/dist/esm/smoothly-trigger-sink.entry.js +1 -1
  15. package/dist/esm/smoothly-trigger-source.entry.js +1 -1
  16. package/dist/smoothly/index.esm.js +1 -1
  17. package/dist/smoothly/p-44420b1e.entry.js +1 -0
  18. package/dist/smoothly/p-a14dfd75.js +1 -0
  19. package/dist/smoothly/p-bb57ff51.js +1 -0
  20. package/dist/smoothly/p-cab954af.entry.js +1 -0
  21. package/dist/smoothly/{p-5120e158.entry.js → p-d7f00399.entry.js} +1 -1
  22. package/dist/smoothly/{p-b1147a02.entry.js → p-df8af5a2.entry.js} +1 -1
  23. package/dist/smoothly/smoothly.esm.js +1 -1
  24. package/package.json +7 -7
  25. package/dist/cjs/getLanguage-892e255f.js +0 -12123
  26. package/dist/esm/getLanguage-bff35c81.js +0 -12121
  27. package/dist/smoothly/p-878ee591.entry.js +0 -1
  28. package/dist/smoothly/p-8878611c.js +0 -1
  29. package/dist/smoothly/p-8f1d86ff.js +0 -1
  30. package/dist/smoothly/p-b30c457b.entry.js +0 -1
@@ -10,29 +10,45 @@ class TextEncoder {
10
10
  const tables = {
11
11
  standard: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
12
12
  url: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
13
+ ordered: "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",
14
+ reversed: "zyxwvutsrqponmlkjihgfedcba_ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210-",
13
15
  };
14
16
  function encode(value, standard = "standard", padding = "") {
15
- if (typeof value == "string")
16
- value = new TextEncoder().encode(value);
17
+ let data;
18
+ const reverse = (array) => (standard == "ordered" || standard == "reversed" ? array.reverse() : array);
19
+ switch (typeof value) {
20
+ case "string":
21
+ data = new TextEncoder().encode(value);
22
+ break;
23
+ case "number":
24
+ data = reverse(new Uint8Array(new BigUint64Array([BigInt(value)]).buffer));
25
+ break;
26
+ case "bigint":
27
+ data = reverse(new Uint8Array(new BigUint64Array([value]).buffer));
28
+ break;
29
+ default:
30
+ data = value instanceof Uint8Array ? value : new Uint8Array(value);
31
+ break;
32
+ }
17
33
  const table = tables[standard];
18
34
  const result = [];
19
- for (let c = 0; c < value.length; c += 3) {
20
- const c0 = value[c];
21
- const c1 = c + 1 < value.length ? value[c + 1] : 0;
22
- const c2 = c + 2 < value.length ? value[c + 2] : 0;
35
+ for (let c = 0; c < data.length; c += 3) {
36
+ const c0 = data[c];
37
+ const c1 = c + 1 < data.length ? data[c + 1] : 0;
38
+ const c2 = c + 2 < data.length ? data[c + 2] : 0;
23
39
  result.push(table[c0 >>> 2]);
24
40
  result.push(table[((c0 & 3) << 4) | (c1 >>> 4)]);
25
41
  result.push(table[((c1 & 15) << 2) | (c2 >>> 6)]);
26
42
  result.push(table[c2 & 63]);
27
43
  }
28
- const length = Math.ceil((value.length / 3) * 4);
29
- return result.join("").substr(0, length) + padding.repeat(result.length - length);
44
+ const length = Math.ceil((data.length / 3) * 4);
45
+ return result.join("").substring(0, length) + padding.repeat(result.length - length);
30
46
  }
31
47
  function decode(value, standard = "standard") {
32
48
  while (value.endsWith("=") && value.length > 0)
33
- value = value.substr(0, value.length - 1);
49
+ value = value.substring(0, value.length - 1);
34
50
  const table = tables[standard];
35
- const data = value.split("").map(c => table.indexOf(c));
51
+ const data = [...value].map(c => table.indexOf(c));
36
52
  const result = new Uint8Array(Math.floor((data.length / 4) * 3));
37
53
  for (let c = 0; c < result.length; c += 3) {
38
54
  const d0 = data.shift() || 0;
@@ -43,7 +59,7 @@ function decode(value, standard = "standard") {
43
59
  result[c + 1] = ((d1 & 15) << 4) | (d2 >>> 2);
44
60
  result[c + 2] = ((d2 & 3) << 6) | d3;
45
61
  }
46
- return result;
62
+ return standard == "ordered" || standard == "reversed" ? result.reverse() : result;
47
63
  }
48
64
  function next(value, increment = 1, standard = "standard") {
49
65
  const table = tables[standard];
@@ -129,16 +145,20 @@ var Identifier;
129
145
  return Number.parseInt(toHexadecimal(identifier, 12), 16);
130
146
  }
131
147
  Identifier.toUint48 = toUint48;
132
- function fromBinary(identifier) {
133
- return encode(identifier, "url");
148
+ function fromBinary(identifier, standard = "url") {
149
+ return encode(identifier, standard);
134
150
  }
135
151
  Identifier.fromBinary = fromBinary;
136
152
  function toBinary(identifier) {
137
153
  return decode(identifier, "url");
138
154
  }
139
155
  Identifier.toBinary = toBinary;
140
- function generate(length) {
141
- return fromBinary(crypto.getRandomValues(new Uint8Array((length / 4) * 3)));
156
+ function generate(length, ordering, value) {
157
+ let result = undefined;
158
+ if (value || value == 0 || value == "")
159
+ result = encode(value, ordering).substring(0, length);
160
+ return ((result !== null && result !== void 0 ? result : "") +
161
+ fromBinary(crypto.getRandomValues(new Uint8Array((length / 4) * 3)), ordering).substring(0, length - (result ? result.length : 0)));
142
162
  }
143
163
  Identifier.generate = generate;
144
164
  function fromHexadecimal(identifier) {
@@ -161,15 +181,15 @@ var Identifier;
161
181
  }
162
182
  Identifier.toHexadecimal = toHexadecimal;
163
183
  function min(length) {
164
- return "".padStart(length, "A");
184
+ return "".padStart(length, "-");
165
185
  }
166
186
  Identifier.min = min;
167
187
  function max(length) {
168
- return "".padStart(length, "_");
188
+ return "".padStart(length, "z");
169
189
  }
170
190
  Identifier.max = max;
171
191
  function next$1(identifier, increment = 1) {
172
- const result = next(identifier, increment, "url");
192
+ const result = next(identifier, increment, "ordered");
173
193
  return result.length == identifier.length ? result : result.substring(result.length - identifier.length);
174
194
  }
175
195
  Identifier.next = next$1;
@@ -305,15 +325,15 @@ class None extends Symmetric$1 {
305
325
  }
306
326
 
307
327
  class Rsa extends Base {
328
+ get parameters() {
329
+ return getParameters(this.variant);
330
+ }
308
331
  constructor(variant, publicKey, privateKey) {
309
332
  super();
310
333
  this.variant = variant;
311
334
  this.publicKey = publicKey;
312
335
  this.privateKey = privateKey;
313
336
  }
314
- get parameters() {
315
- return getParameters(this.variant);
316
- }
317
337
  async signBinary(data) {
318
338
  return this.privateKey
319
339
  ? new Uint8Array(await crypto.subtle.sign(this.parameters, await this.privateKey, data))