@lukso/web-components 1.172.13 → 1.172.14

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 (126) hide show
  1. package/dist/chunks/cn-LM_JlZIN.js +36 -0
  2. package/dist/chunks/cn-zamUNFMe.js +39 -0
  3. package/dist/chunks/directive-CY66atYi.js +22 -0
  4. package/dist/chunks/directive-DUHAbymA.js +15 -0
  5. package/dist/chunks/index-BNt_JinF.js +212 -0
  6. package/dist/chunks/{index-DG4rMUh3.js → index-BOEPqh0N.js} +1 -1
  7. package/dist/chunks/{index-F8ll4iy2.js → index-C5S-_QDF.js} +1 -1
  8. package/dist/chunks/{index-B_H2eYG_.js → index-CA6SrfZ-.js} +9 -8
  9. package/dist/chunks/{index-CZGvLdJ0.js → index-CqZm8OfY.js} +1 -2
  10. package/dist/chunks/index-Cy2_2lFt.js +214 -0
  11. package/dist/chunks/{index-Dn2DJhID.js → index-Ds-r8fCt.js} +77 -74
  12. package/dist/chunks/{index-C5YyB6ug.js → index-DvLZWpq9.js} +2 -3
  13. package/dist/chunks/{index-D_5wz2k1.js → index-UVrFZqIM.js} +79 -76
  14. package/dist/chunks/{index-BHAtoIlu.js → index-cakeic-M.js} +9 -8
  15. package/dist/chunks/{style-map-B7XFhSOK.js → style-map-AEeBQfPb.js} +2 -3
  16. package/dist/chunks/{style-map-BPljJihp.js → style-map-auscxO0L.js} +1 -2
  17. package/dist/components/index.cjs +4 -5
  18. package/dist/components/index.js +4 -5
  19. package/dist/components/lukso-alert/index.cjs +16 -15
  20. package/dist/components/lukso-alert/index.js +16 -15
  21. package/dist/components/lukso-button/index.cjs +42 -40
  22. package/dist/components/lukso-button/index.js +39 -37
  23. package/dist/components/lukso-card/index.cjs +66 -71
  24. package/dist/components/lukso-card/index.js +48 -53
  25. package/dist/components/lukso-checkbox/index.cjs +27 -26
  26. package/dist/components/lukso-checkbox/index.js +27 -26
  27. package/dist/components/lukso-collapse/index.cjs +27 -26
  28. package/dist/components/lukso-collapse/index.js +26 -25
  29. package/dist/components/lukso-color-picker/index.cjs +33 -31
  30. package/dist/components/lukso-color-picker/index.js +32 -30
  31. package/dist/components/lukso-dropdown/index.cjs +20 -19
  32. package/dist/components/lukso-dropdown/index.js +20 -19
  33. package/dist/components/lukso-dropdown-option/index.cjs +12 -11
  34. package/dist/components/lukso-dropdown-option/index.js +12 -11
  35. package/dist/components/lukso-footer/index.cjs +5 -4
  36. package/dist/components/lukso-footer/index.js +5 -4
  37. package/dist/components/lukso-form-description/index.cjs +7 -6
  38. package/dist/components/lukso-form-description/index.js +7 -6
  39. package/dist/components/lukso-form-error/index.cjs +7 -6
  40. package/dist/components/lukso-form-error/index.js +7 -6
  41. package/dist/components/lukso-form-label/index.cjs +8 -7
  42. package/dist/components/lukso-form-label/index.js +8 -7
  43. package/dist/components/lukso-icon/index.cjs +268 -267
  44. package/dist/components/lukso-icon/index.js +268 -267
  45. package/dist/components/lukso-image/index.cjs +12 -12
  46. package/dist/components/lukso-image/index.js +12 -12
  47. package/dist/components/lukso-input/index.cjs +49 -47
  48. package/dist/components/lukso-input/index.js +48 -46
  49. package/dist/components/lukso-markdown/index.cjs +13 -83
  50. package/dist/components/lukso-markdown/index.js +13 -83
  51. package/dist/components/lukso-markdown-editor/index.cjs +68 -67
  52. package/dist/components/lukso-markdown-editor/index.js +67 -66
  53. package/dist/components/lukso-modal/index.cjs +12 -11
  54. package/dist/components/lukso-modal/index.js +11 -10
  55. package/dist/components/lukso-navbar/index.cjs +30 -30
  56. package/dist/components/lukso-navbar/index.js +30 -30
  57. package/dist/components/lukso-pagination/index.cjs +16 -16
  58. package/dist/components/lukso-pagination/index.js +16 -16
  59. package/dist/components/lukso-profile/index.cjs +162 -11
  60. package/dist/components/lukso-profile/index.js +165 -5
  61. package/dist/components/lukso-progress/index.cjs +16 -13
  62. package/dist/components/lukso-progress/index.js +13 -10
  63. package/dist/components/lukso-qr-code/index.cjs +17 -34
  64. package/dist/components/lukso-qr-code/index.js +16 -33
  65. package/dist/components/lukso-radio/index.cjs +27 -25
  66. package/dist/components/lukso-radio/index.js +25 -23
  67. package/dist/components/lukso-radio-group/index.cjs +9 -9
  68. package/dist/components/lukso-radio-group/index.js +9 -9
  69. package/dist/components/lukso-sanitize/index.cjs +5 -4
  70. package/dist/components/lukso-sanitize/index.js +5 -4
  71. package/dist/components/lukso-search/index.cjs +11 -8
  72. package/dist/components/lukso-search/index.js +11 -8
  73. package/dist/components/lukso-select/index.cjs +47 -46
  74. package/dist/components/lukso-select/index.js +46 -45
  75. package/dist/components/lukso-share/index.cjs +7 -6
  76. package/dist/components/lukso-share/index.js +7 -6
  77. package/dist/components/lukso-switch/index.cjs +16 -15
  78. package/dist/components/lukso-switch/index.js +16 -15
  79. package/dist/components/lukso-tag/index.cjs +13 -12
  80. package/dist/components/lukso-tag/index.js +12 -11
  81. package/dist/components/lukso-terms/index.cjs +9 -8
  82. package/dist/components/lukso-terms/index.js +9 -8
  83. package/dist/components/lukso-textarea/index.cjs +36 -34
  84. package/dist/components/lukso-textarea/index.js +35 -33
  85. package/dist/components/lukso-tooltip/index.cjs +27 -3461
  86. package/dist/components/lukso-tooltip/index.js +27 -3461
  87. package/dist/components/lukso-username/index.cjs +11 -7
  88. package/dist/components/lukso-username/index.js +11 -7
  89. package/dist/components/lukso-wizard/index.cjs +13 -12
  90. package/dist/components/lukso-wizard/index.js +11 -10
  91. package/dist/index.cjs +6 -6
  92. package/dist/index.js +5 -5
  93. package/dist/shared/tailwind-element/index.cjs +15 -3
  94. package/dist/shared/tailwind-element/index.js +17 -1
  95. package/dist/vite.full.config.d.ts.map +1 -1
  96. package/package.json +7 -1
  97. package/dist/chunks/_commonjsHelpers-B85MJLTf.js +0 -5
  98. package/dist/chunks/_commonjsHelpers-CFO10eej.js +0 -7
  99. package/dist/chunks/axe-DJKac19y.js +0 -35093
  100. package/dist/chunks/axe-MHuN9KU0.js +0 -35097
  101. package/dist/chunks/base-Bn-zDNuZ.js +0 -93
  102. package/dist/chunks/base-Cl6v8-BZ.js +0 -8
  103. package/dist/chunks/base-KJhhKWYy.js +0 -91
  104. package/dist/chunks/base-NFGX42U4.js +0 -10
  105. package/dist/chunks/chunk-LQIOVPBE-CGhQ79Di.js +0 -370
  106. package/dist/chunks/chunk-LQIOVPBE-kQFZF_OS.js +0 -372
  107. package/dist/chunks/directive-BKuZRRPO.js +0 -8
  108. package/dist/chunks/directive-DT5Y-Nw0.js +0 -12
  109. package/dist/chunks/index-5X9ujrWL.js +0 -41
  110. package/dist/chunks/index-B9iart53.js +0 -2545
  111. package/dist/chunks/index-BAf8Hzhe.js +0 -611
  112. package/dist/chunks/index-BBFSnMaE.js +0 -1345
  113. package/dist/chunks/index-BDyLu6M0.js +0 -609
  114. package/dist/chunks/index-BxQ_0s_1.js +0 -50
  115. package/dist/chunks/index-CaJky2qL.js +0 -2547
  116. package/dist/chunks/index-glHBylgQ.js +0 -1347
  117. package/dist/chunks/isAddress-B1R_6-uN.js +0 -745
  118. package/dist/chunks/isAddress-BUdSrCaY.js +0 -743
  119. package/dist/chunks/property-D6IL6zax.js +0 -11
  120. package/dist/chunks/property-DfumgIL6.js +0 -9
  121. package/dist/chunks/query-CHb9Ft_d.js +0 -9
  122. package/dist/chunks/query-D3HF7Pde.js +0 -11
  123. package/dist/chunks/state-CFjY89m3.js +0 -11
  124. package/dist/chunks/state-CaelFSbE.js +0 -9
  125. package/dist/chunks/unsafe-html-BHBLEMoa.js +0 -10
  126. package/dist/chunks/unsafe-html-DiwkOQlV.js +0 -12
@@ -1,611 +0,0 @@
1
- 'use strict';
2
-
3
- const shared_tailwindElement_index = require('./index-BxQ_0s_1.js');
4
- const property = require('./property-D6IL6zax.js');
5
- const _commonjsHelpers = require('./_commonjsHelpers-CFO10eej.js');
6
- const index = require('./index-CaJky2qL.js');
7
- const safeCustomElement = require('./safe-custom-element-tQ-epw6h.js');
8
- require('../components/lukso-image/index.cjs');
9
-
10
- var main$1 = {exports: {}};
11
-
12
- var main = main$1.exports;
13
-
14
- var hasRequiredMain;
15
-
16
- function requireMain () {
17
- if (hasRequiredMain) return main$1.exports;
18
- hasRequiredMain = 1;
19
- (function (module, exports) {
20
- (function webpackUniversalModuleDefinition(root, factory) {
21
- module.exports = factory();
22
- })(main, function() {
23
- return /******/ (function(modules) { // webpackBootstrap
24
- /******/ // The module cache
25
- /******/ var installedModules = {};
26
-
27
- /******/ // The require function
28
- /******/ function __webpack_require__(moduleId) {
29
-
30
- /******/ // Check if module is in cache
31
- /******/ if(installedModules[moduleId])
32
- /******/ return installedModules[moduleId].exports;
33
-
34
- /******/ // Create a new module (and put it into the cache)
35
- /******/ var module = installedModules[moduleId] = {
36
- /******/ exports: {},
37
- /******/ id: moduleId,
38
- /******/ loaded: false
39
- /******/ };
40
-
41
- /******/ // Execute the module function
42
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
43
-
44
- /******/ // Flag the module as loaded
45
- /******/ module.loaded = true;
46
-
47
- /******/ // Return the exports of the module
48
- /******/ return module.exports;
49
- /******/ }
50
-
51
-
52
- /******/ // expose the modules object (__webpack_modules__)
53
- /******/ __webpack_require__.m = modules;
54
-
55
- /******/ // expose the module cache
56
- /******/ __webpack_require__.c = installedModules;
57
-
58
- /******/ // __webpack_public_path__
59
- /******/ __webpack_require__.p = "";
60
-
61
- /******/ // Load entry module and return exports
62
- /******/ return __webpack_require__(0);
63
- /******/ })
64
- /************************************************************************/
65
- /******/ ([
66
- /* 0 */
67
- /***/ function(module, exports, __webpack_require__) {
68
-
69
- const pnglib = __webpack_require__(1);
70
- const hsl2rgb = __webpack_require__(2);
71
-
72
- // The random number is a js implementation of the Xorshift PRNG
73
- const randseed = new Array(4); // Xorshift: [x, y, z, w] 32 bit values
74
-
75
- function seedrand(seed) {
76
- for (let i = 0; i < randseed.length; i++) {
77
- randseed[i] = 0;
78
- }
79
- for (let i = 0; i < seed.length; i++) {
80
- randseed[i % 4] = (randseed[i % 4] << 5) - randseed[i % 4] + seed.charCodeAt(i);
81
- }
82
- }
83
-
84
- function rand() {
85
- // based on Java's String.hashCode(), expanded to 4 32bit values
86
- const t = randseed[0] ^ (randseed[0] << 11);
87
-
88
- randseed[0] = randseed[1];
89
- randseed[1] = randseed[2];
90
- randseed[2] = randseed[3];
91
- randseed[3] = randseed[3] ^ (randseed[3] >> 19) ^ t ^ (t >> 8);
92
-
93
- return (randseed[3] >>> 0) / (1 << 31 >>> 0);
94
- }
95
-
96
- function createColor() {
97
- //saturation is the whole color spectrum
98
- const h = Math.floor(rand() * 360);
99
- //saturation goes from 40 to 100, it avoids greyish colors
100
- const s = rand() * 60 + 40;
101
- //lightness can be anything from 0 to 100, but probabilities are a bell curve around 50%
102
- const l = (rand() + rand() + rand() + rand()) * 25 ;
103
-
104
- return [h / 360, s / 100, l / 100];
105
- }
106
-
107
- function createImageData(size) {
108
- const width = size; // Only support square icons for now
109
- const height = size;
110
-
111
- const dataWidth = Math.ceil(width / 2);
112
- const mirrorWidth = width - dataWidth;
113
-
114
- const data = [];
115
- for (let y = 0; y < height; y++) {
116
- let row = [];
117
- for (let x = 0; x < dataWidth; x++) {
118
- // this makes foreground and background color to have a 43% (1/2.3) probability
119
- // spot color has 13% chance
120
- row[x] = Math.floor(rand() * 2.3);
121
- }
122
- const r = row.slice(0, mirrorWidth).reverse();
123
- row = row.concat(r);
124
-
125
- for (let i = 0; i < row.length; i++) {
126
- data.push(row[i]);
127
- }
128
- }
129
-
130
- return data;
131
- }
132
-
133
- // Modifies the passed PNG to fill in a specified rectangle
134
- function fillRect(png, x, y, w, h, color) {
135
- for(let i = 0; i < w; i++) {
136
- for (let j = 0; j < h; j++) {
137
- png.buffer[png.index(x + i, y + j)] = color;
138
- }
139
- }
140
- }
141
-
142
- function buildOpts(opts) {
143
- if (!opts.seed) {
144
- throw new Error('No seed provided');
145
- }
146
-
147
- seedrand(opts.seed);
148
-
149
- return Object.assign({
150
- size: 8,
151
- scale: 16,
152
- color: createColor(),
153
- bgcolor: createColor(),
154
- spotcolor: createColor(),
155
- }, opts)
156
- }
157
-
158
- function makeBlockie(address) {
159
- const opts = buildOpts({ seed: address.toLowerCase() });
160
-
161
- const imageData = createImageData(opts.size);
162
- const width = Math.sqrt(imageData.length);
163
-
164
- const p = new pnglib(opts.size * opts.scale, opts.size * opts.scale, 3);
165
- p.color(...hsl2rgb(...opts.bgcolor));
166
- const color = p.color(...hsl2rgb(...opts.color));
167
- const spotcolor = p.color(...hsl2rgb(...opts.spotcolor));
168
-
169
- for (let i = 0; i < imageData.length; i++) {
170
- const row = Math.floor(i / width);
171
- const col = i % width;
172
- // if data is 0, leave the background
173
- if (imageData[i]) {
174
- // if data is 2, choose spot color, if 1 choose foreground
175
- const pngColor = imageData[i] == 1 ? color : spotcolor;
176
- fillRect(p, col * opts.scale, row * opts.scale, opts.scale, opts.scale, pngColor);
177
- }
178
- }
179
- return `data:image/png;base64,${p.getBase64()}`;
180
- }
181
-
182
- module.exports = makeBlockie;
183
-
184
-
185
- /***/ },
186
- /* 1 */
187
- /***/ function(module, exports) {
188
-
189
- /**
190
- * A handy class to calculate color values.
191
- *
192
- * @version 1.0
193
- * @author Robert Eisele <robert@xarg.org>
194
- * @copyright Copyright (c) 2010, Robert Eisele
195
- * @link http://www.xarg.org/2010/03/generate-client-side-png-files-using-javascript/
196
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
197
- *
198
- */
199
-
200
- // Modified by George Chan <gchan@21cn.com>
201
-
202
- // Further modified by Will O'B <@wbobeirne> to make it
203
- // UglifyJS and "use strict"; friendly
204
-
205
- module.exports = function(width,height,depth) {
206
-
207
-
208
- // helper functions for that ctx
209
- function write(buffer, offs) {
210
- for (var i = 2; i < arguments.length; i++) {
211
- for (var j = 0; j < arguments[i].length; j++) {
212
- buffer[offs++] = arguments[i].charAt(j);
213
- }
214
- }
215
- }
216
-
217
- function byte2(w) {
218
- return String.fromCharCode((w >> 8) & 255, w & 255);
219
- }
220
-
221
- function byte4(w) {
222
- return String.fromCharCode((w >> 24) & 255, (w >> 16) & 255, (w >> 8) & 255, w & 255);
223
- }
224
-
225
- function byte2lsb(w) {
226
- return String.fromCharCode(w & 255, (w >> 8) & 255);
227
- }
228
-
229
- this.width = width;
230
- this.height = height;
231
- this.depth = depth;
232
-
233
- // pixel data and row filter identifier size
234
- this.pix_size = height * (width + 1);
235
-
236
- // deflate header, pix_size, block headers, adler32 checksum
237
- this.data_size = 2 + this.pix_size + 5 * Math.floor((0xfffe + this.pix_size) / 0xffff) + 4;
238
-
239
- // offsets and sizes of Png chunks
240
- this.ihdr_offs = 0; // IHDR offset and size
241
- this.ihdr_size = 4 + 4 + 13 + 4;
242
- this.plte_offs = this.ihdr_offs + this.ihdr_size; // PLTE offset and size
243
- this.plte_size = 4 + 4 + 3 * depth + 4;
244
- this.trns_offs = this.plte_offs + this.plte_size; // tRNS offset and size
245
- this.trns_size = 4 + 4 + depth + 4;
246
- this.idat_offs = this.trns_offs + this.trns_size; // IDAT offset and size
247
- this.idat_size = 4 + 4 + this.data_size + 4;
248
- this.iend_offs = this.idat_offs + this.idat_size; // IEND offset and size
249
- this.iend_size = 4 + 4 + 4;
250
- this.buffer_size = this.iend_offs + this.iend_size; // total PNG size
251
-
252
- this.buffer = new Array();
253
- this.palette = new Object();
254
- this.pindex = 0;
255
-
256
- var _crc32 = new Array();
257
-
258
- // initialize buffer with zero bytes
259
- for (var i = 0; i < this.buffer_size; i++) {
260
- this.buffer[i] = "\x00";
261
- }
262
-
263
- // initialize non-zero elements
264
- write(this.buffer, this.ihdr_offs, byte4(this.ihdr_size - 12), 'IHDR', byte4(width), byte4(height), "\x08\x03");
265
- write(this.buffer, this.plte_offs, byte4(this.plte_size - 12), 'PLTE');
266
- write(this.buffer, this.trns_offs, byte4(this.trns_size - 12), 'tRNS');
267
- write(this.buffer, this.idat_offs, byte4(this.idat_size - 12), 'IDAT');
268
- write(this.buffer, this.iend_offs, byte4(this.iend_size - 12), 'IEND');
269
-
270
- // initialize deflate header
271
- var header = ((8 + (7 << 4)) << 8) | (3 << 6);
272
- header+= 31 - (header % 31);
273
-
274
- write(this.buffer, this.idat_offs + 8, byte2(header));
275
-
276
- // initialize deflate block headers
277
- for (var i = 0; (i << 16) - 1 < this.pix_size; i++) {
278
- var size, bits;
279
- if (i + 0xffff < this.pix_size) {
280
- size = 0xffff;
281
- bits = "\x00";
282
- } else {
283
- size = this.pix_size - (i << 16) - i;
284
- bits = "\x01";
285
- }
286
- write(this.buffer, this.idat_offs + 8 + 2 + (i << 16) + (i << 2), bits, byte2lsb(size), byte2lsb(~size));
287
- }
288
-
289
- /* Create crc32 lookup table */
290
- for (var i = 0; i < 256; i++) {
291
- var c = i;
292
- for (var j = 0; j < 8; j++) {
293
- if (c & 1) {
294
- c = -306674912 ^ ((c >> 1) & 0x7fffffff);
295
- } else {
296
- c = (c >> 1) & 0x7fffffff;
297
- }
298
- }
299
- _crc32[i] = c;
300
- }
301
-
302
- // compute the index into a png for a given pixel
303
- this.index = function(x,y) {
304
- var i = y * (this.width + 1) + x + 1;
305
- var j = this.idat_offs + 8 + 2 + 5 * Math.floor((i / 0xffff) + 1) + i;
306
- return j;
307
- };
308
-
309
- // convert a color and build up the palette
310
- this.color = function(red, green, blue, alpha) {
311
-
312
- alpha = alpha >= 0 ? alpha : 255;
313
- var color = (((((alpha << 8) | red) << 8) | green) << 8) | blue;
314
-
315
- if (typeof this.palette[color] == "undefined") {
316
- if (this.pindex == this.depth) return "\x00";
317
-
318
- var ndx = this.plte_offs + 8 + 3 * this.pindex;
319
-
320
- this.buffer[ndx + 0] = String.fromCharCode(red);
321
- this.buffer[ndx + 1] = String.fromCharCode(green);
322
- this.buffer[ndx + 2] = String.fromCharCode(blue);
323
- this.buffer[this.trns_offs+8+this.pindex] = String.fromCharCode(alpha);
324
-
325
- this.palette[color] = String.fromCharCode(this.pindex++);
326
- }
327
- return this.palette[color];
328
- };
329
-
330
- // output a PNG string, Base64 encoded
331
- this.getBase64 = function() {
332
-
333
- var s = this.getDump();
334
-
335
- var ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
336
- var c1, c2, c3, e1, e2, e3, e4;
337
- var l = s.length;
338
- var i = 0;
339
- var r = "";
340
-
341
- do {
342
- c1 = s.charCodeAt(i);
343
- e1 = c1 >> 2;
344
- c2 = s.charCodeAt(i+1);
345
- e2 = ((c1 & 3) << 4) | (c2 >> 4);
346
- c3 = s.charCodeAt(i+2);
347
- if (l < i+2) { e3 = 64; } else { e3 = ((c2 & 0xf) << 2) | (c3 >> 6); }
348
- if (l < i+3) { e4 = 64; } else { e4 = c3 & 0x3f; }
349
- r+= ch.charAt(e1) + ch.charAt(e2) + ch.charAt(e3) + ch.charAt(e4);
350
- } while ((i+= 3) < l);
351
- return r;
352
- };
353
-
354
- // output a PNG string
355
- this.getDump = function() {
356
- // compute adler32 of output pixels + row filter bytes
357
- var BASE = 65521; /* largest prime smaller than 65536 */
358
- var NMAX = 5552; /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
359
- var s1 = 1;
360
- var s2 = 0;
361
- var n = NMAX;
362
-
363
- for (var y = 0; y < this.height; y++) {
364
- for (var x = -1; x < this.width; x++) {
365
- s1+= this.buffer[this.index(x, y)].charCodeAt(0);
366
- s2+= s1;
367
- if ((n-= 1) == 0) {
368
- s1%= BASE;
369
- s2%= BASE;
370
- n = NMAX;
371
- }
372
- }
373
- }
374
- s1%= BASE;
375
- s2%= BASE;
376
- write(this.buffer, this.idat_offs + this.idat_size - 8, byte4((s2 << 16) | s1));
377
-
378
- // compute crc32 of the PNG chunks
379
- function crc32(png, offs, size) {
380
- var crc = -1;
381
- for (var i = 4; i < size-4; i += 1) {
382
- crc = _crc32[(crc ^ png[offs+i].charCodeAt(0)) & 0xff] ^ ((crc >> 8) & 0x00ffffff);
383
- }
384
- write(png, offs+size-4, byte4(crc ^ -1));
385
- }
386
-
387
- crc32(this.buffer, this.ihdr_offs, this.ihdr_size);
388
- crc32(this.buffer, this.plte_offs, this.plte_size);
389
- crc32(this.buffer, this.trns_offs, this.trns_size);
390
- crc32(this.buffer, this.idat_offs, this.idat_size);
391
- crc32(this.buffer, this.iend_offs, this.iend_size);
392
-
393
- // convert PNG to string
394
- return "\x89PNG\r\n\x1a\n" + this.buffer.join('');
395
- };
396
- };
397
-
398
-
399
- /***/ },
400
- /* 2 */
401
- /***/ function(module, exports) {
402
-
403
- // https://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion
404
- /**
405
- * Converts an HSL color value to RGB. Conversion formula
406
- * adapted from http://en.wikipedia.org/wiki/HSL_color_space.
407
- * Assumes h, s, and l are contained in the set [0, 1] and
408
- * returns r, g, and b in the set [0, 255].
409
- *
410
- * @param {number} h The hue
411
- * @param {number} s The saturation
412
- * @param {number} l The lightness
413
- * @return {Array} The RGB representation
414
- */
415
-
416
- function hue2rgb(p, q, t) {
417
- if(t < 0) t += 1;
418
- if(t > 1) t -= 1;
419
- if(t < 1/6) return p + (q - p) * 6 * t;
420
- if(t < 1/2) return q;
421
- if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
422
- return p;
423
- }
424
-
425
- function hsl2rgb(h, s, l){
426
- let r, g, b;
427
-
428
- if (s == 0) {
429
- r = g = b = l; // achromatic
430
- } else {
431
- const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
432
- const p = 2 * l - q;
433
- r = hue2rgb(p, q, h + 1/3);
434
- g = hue2rgb(p, q, h);
435
- b = hue2rgb(p, q, h - 1/3);
436
- }
437
-
438
- return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), 255];
439
- }
440
-
441
- module.exports = hsl2rgb;
442
-
443
-
444
- /***/ }
445
- /******/ ])
446
- });
447
- } (main$1));
448
- return main$1.exports;
449
- }
450
-
451
- var mainExports = requireMain();
452
- const makeBlockie = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(mainExports);
453
-
454
- var __defProp = Object.defineProperty;
455
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
456
- var __decorateClass = (decorators, target, key, kind) => {
457
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
458
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
459
- if (decorator = decorators[i])
460
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
461
- if (kind && result) __defProp(target, key, result);
462
- return result;
463
- };
464
- exports.LuksoProfile = class LuksoProfile extends shared_tailwindElement_index.TailwindElement {
465
- constructor() {
466
- super(...arguments);
467
- this.profileUrl = "";
468
- this.profileAddress = "";
469
- this.hasIdenticon = false;
470
- this.size = "large";
471
- this.isSquare = false;
472
- this.placeholder = "/assets/images/profile-default.svg";
473
- this.profileStyles = index.ce({
474
- slots: {
475
- wrapper: "outline outline-2 outline-neutral-100 relative",
476
- profile: "overflow-hidden",
477
- identicon: "absolute shadow-shadow-1xl rounded-full outline outline-neutral-100 right-0 bottom-0"
478
- },
479
- variants: {
480
- isSquare: {
481
- false: {
482
- wrapper: "rounded-full",
483
- profile: "rounded-full"
484
- }
485
- },
486
- size: {
487
- "2x-small": {
488
- wrapper: "w-4 h-4",
489
- profile: "w-4 h-4",
490
- identicon: "w-2 h-2 outline-1"
491
- },
492
- "x-small": {
493
- wrapper: "w-6 h-6",
494
- profile: "w-6 h-6",
495
- identicon: "w-3 h-3 outline-1"
496
- },
497
- small: {
498
- wrapper: "w-10 h-10",
499
- profile: "w-10 h-10",
500
- identicon: "w-4 h-4 outline-2"
501
- },
502
- medium: {
503
- wrapper: "w-14 h-14",
504
- profile: "w-14 h-14",
505
- identicon: "w-5 h-5 outline-2"
506
- },
507
- large: {
508
- wrapper: "w-20 h-20",
509
- profile: "w-20 h-20",
510
- identicon: "w-6 h-6 outline-2"
511
- },
512
- "x-large": {
513
- wrapper: "w-24 h-24",
514
- profile: "w-24 h-24",
515
- identicon: "w-7 h-7 outline-2"
516
- },
517
- "2x-large": {
518
- wrapper: "w-30 h-30",
519
- profile: "w-30 h-30",
520
- identicon: "w-9 h-9 outline-[2.5px]"
521
- }
522
- }
523
- },
524
- compoundVariants: [
525
- {
526
- isSquare: true,
527
- size: ["2x-small", "x-small"],
528
- class: {
529
- wrapper: "rounded-[2px]",
530
- profile: "rounded-[2px]"
531
- }
532
- },
533
- {
534
- isSquare: true,
535
- size: "small",
536
- class: {
537
- wrapper: "rounded-4",
538
- profile: "rounded-4"
539
- }
540
- },
541
- {
542
- isSquare: true,
543
- size: "medium",
544
- class: {
545
- wrapper: "rounded-8",
546
- profile: "rounded-8"
547
- }
548
- },
549
- {
550
- isSquare: true,
551
- size: "large",
552
- class: {
553
- wrapper: "rounded-[10px]",
554
- profile: "rounded-[10px]"
555
- }
556
- },
557
- {
558
- isSquare: true,
559
- size: ["2x-large", "x-large"],
560
- class: {
561
- wrapper: "rounded-12",
562
- profile: "rounded-12"
563
- }
564
- }
565
- ]
566
- });
567
- }
568
- identicon() {
569
- return this.hasIdenticon && this.profileAddress ? makeBlockie(this.profileAddress) : "";
570
- }
571
- render() {
572
- const { wrapper, profile, identicon } = this.profileStyles({
573
- size: this.size,
574
- isSquare: this.isSquare
575
- });
576
- return shared_tailwindElement_index.x`
577
- <div data-testid="profile" class=${wrapper()}>
578
- <div class=${profile()}>
579
- <lukso-image
580
- src=${this.profileUrl}
581
- placeholder=${this.placeholder}
582
- ></lukso-image>
583
- </div>
584
- ${this.identicon() ? shared_tailwindElement_index.x`<img src=${this.identicon()} class=${identicon()} alt="" />` : ""}
585
- </div>
586
- `;
587
- }
588
- };
589
- __decorateClass([
590
- property.n({ type: String, attribute: "profile-url", reflect: true })
591
- ], exports.LuksoProfile.prototype, "profileUrl", 2);
592
- __decorateClass([
593
- property.n({ type: String, attribute: "profile-address", reflect: true })
594
- ], exports.LuksoProfile.prototype, "profileAddress", 2);
595
- __decorateClass([
596
- property.n({ type: Boolean, attribute: "has-identicon", reflect: true })
597
- ], exports.LuksoProfile.prototype, "hasIdenticon", 2);
598
- __decorateClass([
599
- property.n({ type: String, reflect: true })
600
- ], exports.LuksoProfile.prototype, "size", 2);
601
- __decorateClass([
602
- property.n({ type: Boolean, attribute: "is-square" })
603
- ], exports.LuksoProfile.prototype, "isSquare", 2);
604
- __decorateClass([
605
- property.n({ type: String })
606
- ], exports.LuksoProfile.prototype, "placeholder", 2);
607
- exports.LuksoProfile = __decorateClass([
608
- safeCustomElement.safeCustomElement("lukso-profile")
609
- ], exports.LuksoProfile);
610
-
611
- exports.makeBlockie = makeBlockie;