@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,93 +0,0 @@
1
- 'use strict';
2
-
3
- const version = '2.37.8';
4
-
5
- let errorConfig = {
6
- getDocsUrl: ({ docsBaseUrl, docsPath = '', docsSlug, }) => docsPath
7
- ? `${docsBaseUrl ?? 'https://viem.sh'}${docsPath}${docsSlug ? `#${docsSlug}` : ''}`
8
- : undefined,
9
- version: `viem@${version}`,
10
- };
11
- class BaseError extends Error {
12
- constructor(shortMessage, args = {}) {
13
- const details = (() => {
14
- if (args.cause instanceof BaseError)
15
- return args.cause.details;
16
- if (args.cause?.message)
17
- return args.cause.message;
18
- return args.details;
19
- })();
20
- const docsPath = (() => {
21
- if (args.cause instanceof BaseError)
22
- return args.cause.docsPath || args.docsPath;
23
- return args.docsPath;
24
- })();
25
- const docsUrl = errorConfig.getDocsUrl?.({ ...args, docsPath });
26
- const message = [
27
- shortMessage || 'An error occurred.',
28
- '',
29
- ...(args.metaMessages ? [...args.metaMessages, ''] : []),
30
- ...(docsUrl ? [`Docs: ${docsUrl}`] : []),
31
- ...(details ? [`Details: ${details}`] : []),
32
- ...(errorConfig.version ? [`Version: ${errorConfig.version}`] : []),
33
- ].join('\n');
34
- super(message, args.cause ? { cause: args.cause } : undefined);
35
- Object.defineProperty(this, "details", {
36
- enumerable: true,
37
- configurable: true,
38
- writable: true,
39
- value: void 0
40
- });
41
- Object.defineProperty(this, "docsPath", {
42
- enumerable: true,
43
- configurable: true,
44
- writable: true,
45
- value: void 0
46
- });
47
- Object.defineProperty(this, "metaMessages", {
48
- enumerable: true,
49
- configurable: true,
50
- writable: true,
51
- value: void 0
52
- });
53
- Object.defineProperty(this, "shortMessage", {
54
- enumerable: true,
55
- configurable: true,
56
- writable: true,
57
- value: void 0
58
- });
59
- Object.defineProperty(this, "version", {
60
- enumerable: true,
61
- configurable: true,
62
- writable: true,
63
- value: void 0
64
- });
65
- Object.defineProperty(this, "name", {
66
- enumerable: true,
67
- configurable: true,
68
- writable: true,
69
- value: 'BaseError'
70
- });
71
- this.details = details;
72
- this.docsPath = docsPath;
73
- this.metaMessages = args.metaMessages;
74
- this.name = args.name ?? this.name;
75
- this.shortMessage = shortMessage;
76
- this.version = version;
77
- }
78
- walk(fn) {
79
- return walk(this, fn);
80
- }
81
- }
82
- function walk(err, fn) {
83
- if (fn?.(err))
84
- return err;
85
- if (err &&
86
- typeof err === 'object' &&
87
- 'cause' in err &&
88
- err.cause !== undefined)
89
- return walk(err.cause, fn);
90
- return fn ? null : err;
91
- }
92
-
93
- exports.BaseError = BaseError;
@@ -1,8 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- const e=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
7
-
8
- export { e };
@@ -1,91 +0,0 @@
1
- const version = '2.37.8';
2
-
3
- let errorConfig = {
4
- getDocsUrl: ({ docsBaseUrl, docsPath = '', docsSlug, }) => docsPath
5
- ? `${docsBaseUrl ?? 'https://viem.sh'}${docsPath}${docsSlug ? `#${docsSlug}` : ''}`
6
- : undefined,
7
- version: `viem@${version}`,
8
- };
9
- class BaseError extends Error {
10
- constructor(shortMessage, args = {}) {
11
- const details = (() => {
12
- if (args.cause instanceof BaseError)
13
- return args.cause.details;
14
- if (args.cause?.message)
15
- return args.cause.message;
16
- return args.details;
17
- })();
18
- const docsPath = (() => {
19
- if (args.cause instanceof BaseError)
20
- return args.cause.docsPath || args.docsPath;
21
- return args.docsPath;
22
- })();
23
- const docsUrl = errorConfig.getDocsUrl?.({ ...args, docsPath });
24
- const message = [
25
- shortMessage || 'An error occurred.',
26
- '',
27
- ...(args.metaMessages ? [...args.metaMessages, ''] : []),
28
- ...(docsUrl ? [`Docs: ${docsUrl}`] : []),
29
- ...(details ? [`Details: ${details}`] : []),
30
- ...(errorConfig.version ? [`Version: ${errorConfig.version}`] : []),
31
- ].join('\n');
32
- super(message, args.cause ? { cause: args.cause } : undefined);
33
- Object.defineProperty(this, "details", {
34
- enumerable: true,
35
- configurable: true,
36
- writable: true,
37
- value: void 0
38
- });
39
- Object.defineProperty(this, "docsPath", {
40
- enumerable: true,
41
- configurable: true,
42
- writable: true,
43
- value: void 0
44
- });
45
- Object.defineProperty(this, "metaMessages", {
46
- enumerable: true,
47
- configurable: true,
48
- writable: true,
49
- value: void 0
50
- });
51
- Object.defineProperty(this, "shortMessage", {
52
- enumerable: true,
53
- configurable: true,
54
- writable: true,
55
- value: void 0
56
- });
57
- Object.defineProperty(this, "version", {
58
- enumerable: true,
59
- configurable: true,
60
- writable: true,
61
- value: void 0
62
- });
63
- Object.defineProperty(this, "name", {
64
- enumerable: true,
65
- configurable: true,
66
- writable: true,
67
- value: 'BaseError'
68
- });
69
- this.details = details;
70
- this.docsPath = docsPath;
71
- this.metaMessages = args.metaMessages;
72
- this.name = args.name ?? this.name;
73
- this.shortMessage = shortMessage;
74
- this.version = version;
75
- }
76
- walk(fn) {
77
- return walk(this, fn);
78
- }
79
- }
80
- function walk(err, fn) {
81
- if (fn?.(err))
82
- return err;
83
- if (err &&
84
- typeof err === 'object' &&
85
- 'cause' in err &&
86
- err.cause !== undefined)
87
- return walk(err.cause, fn);
88
- return fn ? null : err;
89
- }
90
-
91
- export { BaseError as B };
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * @license
5
- * Copyright 2017 Google LLC
6
- * SPDX-License-Identifier: BSD-3-Clause
7
- */
8
- const e=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
9
-
10
- exports.e = e;
@@ -1,370 +0,0 @@
1
- import { B as BaseError } from './base-KJhhKWYy.js';
2
- import { n } from './property-DfumgIL6.js';
3
- import { r } from './state-CaelFSbE.js';
4
-
5
- function defineChain(chain) {
6
- return {
7
- formatters: undefined,
8
- fees: undefined,
9
- serializers: undefined,
10
- ...chain,
11
- };
12
- }
13
-
14
- class InvalidDecimalNumberError extends BaseError {
15
- constructor({ value }) {
16
- super(`Number \`${value}\` is not a valid decimal number.`, {
17
- name: 'InvalidDecimalNumberError',
18
- });
19
- }
20
- }
21
-
22
- /**
23
- * Multiplies a string representation of a number by a given exponent of base 10 (10exponent).
24
- *
25
- * - Docs: https://viem.sh/docs/utilities/parseUnits
26
- *
27
- * @example
28
- * import { parseUnits } from 'viem'
29
- *
30
- * parseUnits('420', 9)
31
- * // 420000000000n
32
- */
33
- function parseUnits(value, decimals) {
34
- if (!/^(-?)([0-9]*)\.?([0-9]*)$/.test(value))
35
- throw new InvalidDecimalNumberError({ value });
36
- let [integer, fraction = '0'] = value.split('.');
37
- const negative = integer.startsWith('-');
38
- if (negative)
39
- integer = integer.slice(1);
40
- // trim trailing zeros.
41
- fraction = fraction.replace(/(0+)$/, '');
42
- // round off if the fraction is larger than the number of decimals.
43
- if (fraction.length > decimals) {
44
- const [left, unit, right] = [
45
- fraction.slice(0, decimals - 1),
46
- fraction.slice(decimals - 1, decimals),
47
- fraction.slice(decimals),
48
- ];
49
- const rounded = Math.round(Number(`${unit}.${right}`));
50
- if (rounded > 9)
51
- fraction = `${BigInt(left) + BigInt(1)}0`.padStart(left.length + 1, '0');
52
- else
53
- fraction = `${left}${rounded}`;
54
- if (fraction.length > decimals) {
55
- fraction = fraction.slice(1);
56
- integer = `${BigInt(integer) + 1n}`;
57
- }
58
- fraction = fraction.slice(0, decimals);
59
- }
60
- else {
61
- fraction = fraction.padEnd(decimals, '0');
62
- }
63
- return BigInt(`${negative ? '-' : ''}${integer}${fraction}`);
64
- }
65
-
66
- const lukso = /*#__PURE__*/ defineChain({
67
- id: 42,
68
- network: 'lukso',
69
- name: 'LUKSO',
70
- nativeCurrency: {
71
- name: 'LUKSO',
72
- symbol: 'LYX',
73
- decimals: 18,
74
- },
75
- rpcUrls: {
76
- default: {
77
- http: ['https://rpc.mainnet.lukso.network'],
78
- webSocket: ['wss://ws-rpc.mainnet.lukso.network'],
79
- },
80
- },
81
- blockExplorers: {
82
- default: {
83
- name: 'LUKSO Mainnet Explorer',
84
- url: 'https://explorer.execution.mainnet.lukso.network',
85
- apiUrl: 'https://api.explorer.execution.mainnet.lukso.network/api',
86
- },
87
- },
88
- contracts: {
89
- multicall3: {
90
- address: '0xcA11bde05977b3631167028862bE2a173976CA11',
91
- blockCreated: 468183,
92
- },
93
- },
94
- });
95
-
96
- const luksoTestnet = /*#__PURE__*/ defineChain({
97
- id: 4201,
98
- name: 'LUKSO Testnet',
99
- nativeCurrency: {
100
- decimals: 18,
101
- name: 'LUKSO Testnet',
102
- symbol: 'LYXt',
103
- },
104
- rpcUrls: {
105
- default: {
106
- http: ['https://rpc.testnet.lukso.network'],
107
- webSocket: ['wss://ws-rpc.testnet.lukso.network'],
108
- },
109
- },
110
- blockExplorers: {
111
- default: {
112
- name: 'LUKSO Testnet Explorer',
113
- url: 'https://explorer.execution.testnet.lukso.network',
114
- apiUrl: 'https://api.explorer.execution.testnet.lukso.network/api',
115
- },
116
- },
117
- contracts: {
118
- multicall3: {
119
- address: '0xcA11bde05977b3631167028862bE2a173976CA11',
120
- blockCreated: 605348,
121
- },
122
- },
123
- testnet: true,
124
- });
125
-
126
- ({
127
- nativeCurrency: {
128
- ...lukso.nativeCurrency,
129
- supply: parseUnits("42000000", 18).toString()
130
- },
131
- contracts: {
132
- ...lukso.contracts}});
133
- ({
134
- nativeCurrency: {
135
- ...luksoTestnet.nativeCurrency,
136
- supply: parseUnits("42000000", 18).toString()},
137
- contracts: {
138
- ...luksoTestnet.contracts}});
139
-
140
- // Generated ESM version of ua-parser-js
141
- // DO NOT EDIT THIS FILE!
142
- // Source: /src/main/ua-parser.js
143
-
144
- /////////////////////////////////////////////////////////////////////////////////
145
- /* UAParser.js v2.0.7
146
- Copyright © 2012-2025 Faisal Salman <f@faisalman.com>
147
- AGPLv3 License *//*
148
- Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
149
- Supports browser & node.js environment.
150
- Demo : https://uaparser.dev
151
- Source : https://github.com/faisalman/ua-parser-js */
152
- /////////////////////////////////////////////////////////////////////////////////
153
-
154
- /* jshint esversion: 6 */
155
- /* globals window */
156
-
157
-
158
-
159
- //////////////
160
- // Constants
161
- /////////////
162
-
163
- var TYPEOF = {
164
- OBJECT : 'object',
165
- UNDEFINED : 'undefined'
166
- },
167
-
168
- // properties
169
- BROWSER = 'browser',
170
- CPU = 'cpu',
171
- DEVICE = 'device',
172
- ENGINE = 'engine',
173
- OS = 'os',
174
- NAME = 'name',
175
- TYPE = 'type',
176
- VENDOR = 'vendor',
177
- VERSION = 'version',
178
- ARCHITECTURE= 'architecture',
179
- MAJOR = 'major',
180
- MODEL = 'model',
181
-
182
- // device types
183
- CONSOLE = 'console',
184
- MOBILE = 'mobile',
185
- TABLET = 'tablet',
186
- SMARTTV = 'smarttv',
187
- WEARABLE = 'wearable',
188
- EMBEDDED = 'embedded';
189
-
190
- var isWindow = typeof window !== TYPEOF.UNDEFINED,
191
- NAVIGATOR = (isWindow && window.navigator) ?
192
- window.navigator :
193
- undefined;
194
- (NAVIGATOR && NAVIGATOR.userAgentData) ?
195
- NAVIGATOR.userAgentData :
196
- undefined;
197
-
198
- ///////////
199
- // Helper
200
- //////////
201
-
202
- var enumerize = function (arr) {
203
- var enums = {};
204
- for (var i=0; i<arr.length; i++) {
205
- enums[arr[i].toUpperCase()] = arr[i];
206
- }
207
- return enums;
208
- },
209
- setProps = function (arr) {
210
- for (var i in arr) {
211
- if (!arr.hasOwnProperty(i)) continue;
212
-
213
- var propName = arr[i];
214
- if (typeof propName == TYPEOF.OBJECT && propName.length == 2) {
215
- this[propName[0]] = propName[1];
216
- } else {
217
- this[propName] = undefined;
218
- }
219
- }
220
- return this;
221
- };
222
-
223
- /////////////////
224
- // Factories
225
- ////////////////
226
-
227
- ((function () {
228
- var props = { init : {}, isIgnore : {}, isIgnoreRgx : {}, toString : {}};
229
- setProps.call(props.init, [
230
- [BROWSER, [NAME, VERSION, MAJOR, TYPE]],
231
- [CPU, [ARCHITECTURE]],
232
- [DEVICE, [TYPE, MODEL, VENDOR]],
233
- [ENGINE, [NAME, VERSION]],
234
- [OS, [NAME, VERSION]]
235
- ]);
236
- setProps.call(props.isIgnore, [
237
- [BROWSER, [VERSION, MAJOR]],
238
- [ENGINE, [VERSION]],
239
- [OS, [VERSION]]
240
- ]);
241
- setProps.call(props.isIgnoreRgx, [
242
- [BROWSER, / ?browser$/i],
243
- [OS, / ?os$/i]
244
- ]);
245
- setProps.call(props.toString, [
246
- [BROWSER, [NAME, VERSION]],
247
- [CPU, [ARCHITECTURE]],
248
- [DEVICE, [VENDOR, MODEL]],
249
- [ENGINE, [NAME, VERSION]],
250
- [OS, [NAME, VERSION]]
251
- ]);
252
- return props;
253
- }))();
254
- enumerize([NAME, VERSION, MAJOR, TYPE]);
255
- enumerize([ARCHITECTURE]);
256
- enumerize([MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]);
257
- enumerize([NAME, VERSION]);
258
-
259
- var __defProp = Object.defineProperty;
260
- var __decorateClass = (decorators, target, key, kind) => {
261
- var result = void 0 ;
262
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
263
- if (decorator = decorators[i])
264
- result = (decorator(target, key, result) ) || result;
265
- if (result) __defProp(target, key, result);
266
- return result;
267
- };
268
-
269
- function withTheme(Base) {
270
- class Mixin extends Base {
271
- constructor() {
272
- super(...arguments);
273
- this.theme = "light";
274
- this.isDark = false;
275
- this.mediaQueryList = null;
276
- /**
277
- * Handle system theme changes
278
- *
279
- * @param event - Media query list event
280
- */
281
- this.handleMediaQueryChange = (event) => {
282
- this.isDark = event.matches;
283
- };
284
- }
285
- connectedCallback() {
286
- super.connectedCallback();
287
- this.updateTheme();
288
- this.updateHostClass();
289
- if (this.theme === "auto") {
290
- this.mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)");
291
- this.mediaQueryList.addEventListener(
292
- "change",
293
- this.handleMediaQueryChange
294
- );
295
- }
296
- }
297
- disconnectedCallback() {
298
- super.disconnectedCallback();
299
- if (this.mediaQueryList) {
300
- this.mediaQueryList.removeEventListener(
301
- "change",
302
- this.handleMediaQueryChange
303
- );
304
- }
305
- }
306
- updated(changedProperties) {
307
- super.updated(changedProperties);
308
- if (changedProperties.has("theme")) {
309
- this.updateTheme();
310
- if (this.theme === "auto" && !this.mediaQueryList) {
311
- this.mediaQueryList = window.matchMedia(
312
- "(prefers-color-scheme: dark)"
313
- );
314
- this.mediaQueryList.addEventListener(
315
- "change",
316
- this.handleMediaQueryChange
317
- );
318
- } else if (this.theme !== "auto" && this.mediaQueryList) {
319
- this.mediaQueryList.removeEventListener(
320
- "change",
321
- this.handleMediaQueryChange
322
- );
323
- this.mediaQueryList = null;
324
- }
325
- }
326
- if (changedProperties.has("isDark")) {
327
- this.updateHostClass();
328
- }
329
- }
330
- /**
331
- * Update isDark state based on theme property
332
- */
333
- updateTheme() {
334
- if (this.theme === "auto") {
335
- this.isDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
336
- } else {
337
- this.isDark = this.theme === "dark";
338
- }
339
- }
340
- /**
341
- * Create the render root with a themed wrapper div
342
- */
343
- createRenderRoot() {
344
- const root = super.createRenderRoot();
345
- this.themeRoot = document.createElement("div");
346
- this.themeRoot.setAttribute("data-theme-root", "");
347
- root.appendChild(this.themeRoot);
348
- return this.themeRoot;
349
- }
350
- /**
351
- * Update the host element's class based on isDark state
352
- */
353
- updateHostClass() {
354
- if (this.isDark) {
355
- this.themeRoot.classList.add("dark");
356
- } else {
357
- this.themeRoot.classList.remove("dark");
358
- }
359
- }
360
- }
361
- __decorateClass([
362
- n({ type: String, reflect: true })
363
- ], Mixin.prototype, "theme");
364
- __decorateClass([
365
- r()
366
- ], Mixin.prototype, "isDark");
367
- return Mixin;
368
- }
369
-
370
- export { withTheme as w };