@lmvz-ds/components 0.12.5 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/assets-CJzJZPzV.js +26 -0
- package/dist/{esm/Effect-BhQLGXPs.js → cjs/icons-FIfJEo6G.js} +1708 -5205
- package/dist/cjs/{index-CVw4GUo6.js → index-Bp6Dd2i1.js} +4 -2
- package/dist/cjs/{index-9ZJx0550.js → index-D3BMpL5w.js} +0 -3
- package/dist/cjs/index.cjs.js +4 -6
- package/dist/cjs/lmvz-action.cjs.entry.js +1 -1
- package/dist/cjs/lmvz-button.cjs.entry.js +7 -10
- package/dist/cjs/lmvz-card.cjs.entry.js +4 -5
- package/dist/cjs/lmvz-chip.cjs.entry.js +1 -1
- package/dist/cjs/lmvz-components.cjs.js +1 -1
- package/dist/cjs/lmvz-header.cjs.entry.js +13 -12
- package/dist/cjs/lmvz-icon.cjs.entry.js +8 -10
- package/dist/cjs/lmvz-input.cjs.entry.js +8 -11
- package/dist/cjs/lmvz-menuitem.cjs.entry.js +5 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/reactive-controller-host-BMDEj1kX.js +168 -0
- package/dist/collection/components/lmvz-button/lmvz-button.js +3 -3
- package/dist/collection/components/lmvz-card/lmvz-card.js +3 -4
- package/dist/collection/components/lmvz-header/lmvz-header.js +11 -8
- package/dist/collection/components/lmvz-icon/icons.js +2 -2
- package/dist/collection/components/lmvz-icon/lmvz-icon.js +2 -2
- package/dist/collection/components/lmvz-icon/test/icons.unit.js +21 -12
- package/dist/collection/components/lmvz-input/lmvz-input.css +5 -2
- package/dist/collection/components/lmvz-input/lmvz-input.js +3 -3
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js +3 -3
- package/dist/collection/integration/header-integration.js +3 -1
- package/dist/collection/utils/{validation → aria}/aria-validation-controller.js +15 -34
- package/dist/collection/utils/{list-keyboard-controller.js → aria/list-keyboard-controller.js} +1 -1
- package/dist/collection/utils/assets.js +9 -6
- package/dist/collection/utils/http.js +2 -2
- package/dist/collection/utils/{http.test.js → http.unit.js} +8 -7
- package/dist/collection/utils/validation/svg.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/lmvz-action.js +1 -1
- package/dist/components/lmvz-button.js +1 -1
- package/dist/components/lmvz-card.js +1 -1
- package/dist/components/lmvz-chip.js +1 -1
- package/dist/components/lmvz-header.js +1 -1
- package/dist/components/lmvz-icon.js +1 -1
- package/dist/components/lmvz-input.js +1 -1
- package/dist/components/lmvz-menuitem.js +1 -1
- package/dist/components/{p-DMLRPGid.js → p-BfTCfPZ1.js} +1 -1
- package/dist/components/p-BsS3QvWn.js +1 -0
- package/dist/components/p-CMteT-Yo.js +1 -0
- package/dist/components/p-CdYWDK7m.js +1 -0
- package/dist/components/p-vi4YzJmv.js +1 -0
- package/dist/esm/assets-BelZNJ1W.js +23 -0
- package/dist/{cjs/Effect-CNhHt4Xb.js → esm/icons-CM7lsnuO.js} +1751 -5457
- package/dist/esm/{index-Bt32KzDW.js → index-BfTCfPZ1.js} +3 -1
- package/dist/esm/{index-smGPjoDX.js → index-T5ljELGS.js} +1 -3
- package/dist/esm/index.js +4 -5
- package/dist/esm/lmvz-action.entry.js +1 -1
- package/dist/esm/lmvz-button.entry.js +5 -8
- package/dist/esm/lmvz-card.entry.js +4 -5
- package/dist/esm/lmvz-chip.entry.js +1 -1
- package/dist/esm/lmvz-components.js +2 -2
- package/dist/esm/lmvz-header.entry.js +11 -10
- package/dist/esm/lmvz-icon.entry.js +5 -7
- package/dist/esm/lmvz-input.entry.js +6 -9
- package/dist/esm/lmvz-menuitem.entry.js +3 -5
- package/dist/esm/loader.js +2 -2
- package/dist/esm/reactive-controller-host-CZ3dGAjR.js +165 -0
- package/dist/lmvz-components/index.esm.js +1 -1
- package/dist/lmvz-components/lmvz-components.esm.js +1 -1
- package/dist/lmvz-components/p-16878d4c.entry.js +1 -0
- package/dist/lmvz-components/p-6e3314ab.entry.js +1 -0
- package/dist/lmvz-components/p-8ea1a349.entry.js +1 -0
- package/dist/lmvz-components/{p-d4b68381.entry.js → p-980688a0.entry.js} +1 -1
- package/dist/lmvz-components/{p-DMLRPGid.js → p-BfTCfPZ1.js} +1 -1
- package/dist/lmvz-components/p-BoR31cjC.js +1 -0
- package/dist/lmvz-components/p-CVf2C8dL.js +1 -0
- package/dist/lmvz-components/p-CZ3dGAjR.js +1 -0
- package/dist/lmvz-components/p-T5ljELGS.js +2 -0
- package/dist/lmvz-components/p-a34542fa.entry.js +1 -0
- package/dist/lmvz-components/p-d2bf6a3f.entry.js +1 -0
- package/dist/lmvz-components/p-d9dc29a1.entry.js +1 -0
- package/dist/lmvz-components/{p-9faac8f3.entry.js → p-feda2ec5.entry.js} +1 -1
- package/dist/manifest.json +1 -1
- package/dist/types/components/lmvz-button/lmvz-button.d.ts +2 -2
- package/dist/types/components/lmvz-header/lmvz-header.d.ts +5 -4
- package/dist/types/components/lmvz-icon/lmvz-icon.d.ts +1 -1
- package/dist/types/components/lmvz-input/lmvz-input.d.ts +1 -1
- package/dist/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +2 -2
- package/dist/types/utils/{validation → aria}/aria-validation-controller.d.ts +1 -5
- package/dist/types/utils/{element-activation-controller.d.ts → aria/element-activation-controller.d.ts} +2 -2
- package/dist/types/utils/{list-keyboard-controller.d.ts → aria/list-keyboard-controller.d.ts} +1 -1
- package/dist/types/utils/assets.d.ts +1 -8
- package/dist/types/utils/http.d.ts +3 -3
- package/dist/types/utils/validation/svg.d.ts +2 -2
- package/hydrate/index.js +3608 -54447
- package/hydrate/index.mjs +3608 -54447
- package/package.json +17 -18
- package/readme.md +18 -0
- package/dist/cjs/MutableQueue-Bk9tBfaK.js +0 -462
- package/dist/cjs/_commonjsHelpers-CFO10eej.js +0 -7
- package/dist/cjs/aria-validation-controller-B3hMkau3.js +0 -2930
- package/dist/cjs/assets-BguFB3wV.js +0 -71
- package/dist/cjs/axe-BNqwbBGU.js +0 -32834
- package/dist/cjs/icons-7wUEcWEo.js +0 -607
- package/dist/components/p-3I3wZmp8.js +0 -1
- package/dist/components/p-B85MJLTf.js +0 -1
- package/dist/components/p-BaPwpeMs.js +0 -1
- package/dist/components/p-CAi33KTt.js +0 -1
- package/dist/components/p-CdofjRtQ.js +0 -1
- package/dist/components/p-D1HbKFuh.js +0 -12
- package/dist/components/p-UwhTS2ue.js +0 -1
- package/dist/esm/MutableQueue-CNlEFklh.js +0 -431
- package/dist/esm/_commonjsHelpers-B85MJLTf.js +0 -5
- package/dist/esm/aria-validation-controller-iA4YWFG-.js +0 -2927
- package/dist/esm/assets-Iu8neKuE.js +0 -67
- package/dist/esm/axe-cRQ9Ux1I.js +0 -32832
- package/dist/esm/icons-Bx1wWPM2.js +0 -603
- package/dist/lmvz-components/p-1a10fcbd.entry.js +0 -1
- package/dist/lmvz-components/p-274c36df.entry.js +0 -1
- package/dist/lmvz-components/p-2ba68483.entry.js +0 -1
- package/dist/lmvz-components/p-4XIjw3k8.js +0 -1
- package/dist/lmvz-components/p-51Fb_qqD.js +0 -1
- package/dist/lmvz-components/p-77e26e71.entry.js +0 -1
- package/dist/lmvz-components/p-B85MJLTf.js +0 -1
- package/dist/lmvz-components/p-BhQLGXPs.js +0 -1
- package/dist/lmvz-components/p-CXWyvf0D.js +0 -1
- package/dist/lmvz-components/p-D1HbKFuh.js +0 -12
- package/dist/lmvz-components/p-D7I-Bc5i.js +0 -1
- package/dist/lmvz-components/p-a5fe62b6.entry.js +0 -1
- package/dist/lmvz-components/p-c8b78793.entry.js +0 -1
- package/dist/lmvz-components/p-smGPjoDX.js +0 -2
- /package/dist/collection/utils/{element-activation-controller.js → aria/element-activation-controller.js} +0 -0
- /package/dist/types/utils/{http.test.d.ts → http.unit.d.ts} +0 -0
|
@@ -1,603 +0,0 @@
|
|
|
1
|
-
import { g as getOrThrowWith, b as right, d as left, i as identity, e as isRight, f as getRight, m as match, h as decode, j as map, k as all, n as context, o as fiberId, p as merge, q as sync, u as size, v as suspend, w as get, x as succeed, y as none, z as has, A as isSome, B as some, C as getOrUndefined, D as set, E as struct, F as flatMap, G as remove, H as empty, I as clockWith, J as compareAndSet, K as set$1, L as make$2, M as symbol, N as pipe, O as cached, P as combine, Q as hash, R as symbol$1, S as hasProperty, T as equals, U as asVoid, V as when, W as toMillis, X as onInterrupt, Y as zipRight, Z as exit, _ as provideContext, $ as gen, a0 as tryPromise, a1 as try_, a2 as logWarning, a3 as infinity } from './Effect-BhQLGXPs.js';
|
|
2
|
-
import { u as unsafeMake, o as offer, p as poll, E as EmptyMutableQueue, a as unbounded, _ as _await, s as succeed$1, i as interrupt, d as done } from './MutableQueue-CNlEFklh.js';
|
|
3
|
-
import { T as TaggedError, s as syncCreateAssetUrlSafely } from './assets-Iu8neKuE.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* This module provides types and utility functions to create and work with branded types,
|
|
7
|
-
* which are TypeScript types with an added type tag to prevent accidental usage of a value in the wrong context.
|
|
8
|
-
*
|
|
9
|
-
* The `refined` and `nominal` functions are both used to create branded types in TypeScript.
|
|
10
|
-
* The main difference between them is that `refined` allows for validation of the data, while `nominal` does not.
|
|
11
|
-
*
|
|
12
|
-
* The `nominal` function is used to create a new branded type that has the same underlying type as the input, but with a different name.
|
|
13
|
-
* This is useful when you want to distinguish between two values of the same type that have different meanings.
|
|
14
|
-
* The `nominal` function does not perform any validation of the input data.
|
|
15
|
-
*
|
|
16
|
-
* On the other hand, the `refined` function is used to create a new branded type that has the same underlying type as the input,
|
|
17
|
-
* but with a different name, and it also allows for validation of the input data.
|
|
18
|
-
* The `refined` function takes a predicate that is used to validate the input data.
|
|
19
|
-
* If the input data fails the validation, a `BrandErrors` is returned, which provides information about the specific validation failure.
|
|
20
|
-
*
|
|
21
|
-
* @since 2.0.0
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* @since 2.0.0
|
|
25
|
-
* @category symbols
|
|
26
|
-
*/
|
|
27
|
-
const RefinedConstructorsTypeId = /*#__PURE__*/Symbol.for("effect/Brand/Refined");
|
|
28
|
-
/**
|
|
29
|
-
* Returns a `BrandErrors` that contains a single `RefinementError`.
|
|
30
|
-
*
|
|
31
|
-
* @since 2.0.0
|
|
32
|
-
* @category constructors
|
|
33
|
-
*/
|
|
34
|
-
const error = (message, meta) => [{
|
|
35
|
-
message,
|
|
36
|
-
meta
|
|
37
|
-
}];
|
|
38
|
-
function refined(...args) {
|
|
39
|
-
const either = args.length === 2 ? unbranded => args[0](unbranded) ? right(unbranded) : left(args[1](unbranded)) : unbranded => {
|
|
40
|
-
return match(args[0](unbranded), {
|
|
41
|
-
onNone: () => right(unbranded),
|
|
42
|
-
onSome: left
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
return Object.assign(unbranded => getOrThrowWith(either(unbranded), identity), {
|
|
46
|
-
[RefinedConstructorsTypeId]: RefinedConstructorsTypeId,
|
|
47
|
-
option: args => getRight(either(args)),
|
|
48
|
-
either,
|
|
49
|
-
is: args => isRight(either(args))
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/** @internal */
|
|
54
|
-
const complete = (key, exit, entryStats, timeToLiveMillis) => struct({
|
|
55
|
-
_tag: "Complete",
|
|
56
|
-
key,
|
|
57
|
-
exit,
|
|
58
|
-
entryStats,
|
|
59
|
-
timeToLiveMillis
|
|
60
|
-
});
|
|
61
|
-
/** @internal */
|
|
62
|
-
const pending = (key, deferred) => struct({
|
|
63
|
-
_tag: "Pending",
|
|
64
|
-
key,
|
|
65
|
-
deferred
|
|
66
|
-
});
|
|
67
|
-
/** @internal */
|
|
68
|
-
const refreshing = (deferred, complete) => struct({
|
|
69
|
-
_tag: "Refreshing",
|
|
70
|
-
deferred,
|
|
71
|
-
complete
|
|
72
|
-
});
|
|
73
|
-
/** @internal */
|
|
74
|
-
const MapKeyTypeId = /*#__PURE__*/Symbol.for("effect/Cache/MapKey");
|
|
75
|
-
class MapKeyImpl {
|
|
76
|
-
current;
|
|
77
|
-
[MapKeyTypeId] = MapKeyTypeId;
|
|
78
|
-
previous = undefined;
|
|
79
|
-
next = undefined;
|
|
80
|
-
constructor(current) {
|
|
81
|
-
this.current = current;
|
|
82
|
-
}
|
|
83
|
-
[symbol]() {
|
|
84
|
-
return pipe(hash(this.current), combine(hash(this.previous)), combine(hash(this.next)), cached(this));
|
|
85
|
-
}
|
|
86
|
-
[symbol$1](that) {
|
|
87
|
-
if (this === that) {
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
return isMapKey(that) && equals(this.current, that.current) && equals(this.previous, that.previous) && equals(this.next, that.next);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
/** @internal */
|
|
94
|
-
const makeMapKey = current => new MapKeyImpl(current);
|
|
95
|
-
/** @internal */
|
|
96
|
-
const isMapKey = u => hasProperty(u, MapKeyTypeId);
|
|
97
|
-
class KeySetImpl {
|
|
98
|
-
head = undefined;
|
|
99
|
-
tail = undefined;
|
|
100
|
-
add(key) {
|
|
101
|
-
if (key !== this.tail) {
|
|
102
|
-
if (this.tail === undefined) {
|
|
103
|
-
this.head = key;
|
|
104
|
-
this.tail = key;
|
|
105
|
-
} else {
|
|
106
|
-
const previous = key.previous;
|
|
107
|
-
const next = key.next;
|
|
108
|
-
if (next !== undefined) {
|
|
109
|
-
key.next = undefined;
|
|
110
|
-
if (previous !== undefined) {
|
|
111
|
-
previous.next = next;
|
|
112
|
-
next.previous = previous;
|
|
113
|
-
} else {
|
|
114
|
-
this.head = next;
|
|
115
|
-
this.head.previous = undefined;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
this.tail.next = key;
|
|
119
|
-
key.previous = this.tail;
|
|
120
|
-
this.tail = key;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
remove() {
|
|
125
|
-
const key = this.head;
|
|
126
|
-
if (key !== undefined) {
|
|
127
|
-
const next = key.next;
|
|
128
|
-
if (next !== undefined) {
|
|
129
|
-
key.next = undefined;
|
|
130
|
-
this.head = next;
|
|
131
|
-
this.head.previous = undefined;
|
|
132
|
-
} else {
|
|
133
|
-
this.head = undefined;
|
|
134
|
-
this.tail = undefined;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return key;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
/** @internal */
|
|
141
|
-
const makeKeySet = () => new KeySetImpl();
|
|
142
|
-
/**
|
|
143
|
-
* Constructs a new `CacheState` from the specified values.
|
|
144
|
-
*
|
|
145
|
-
* @internal
|
|
146
|
-
*/
|
|
147
|
-
const makeCacheState = (map, keys, accesses, updating, hits, misses) => ({
|
|
148
|
-
map,
|
|
149
|
-
keys,
|
|
150
|
-
accesses,
|
|
151
|
-
updating,
|
|
152
|
-
hits,
|
|
153
|
-
misses
|
|
154
|
-
});
|
|
155
|
-
/**
|
|
156
|
-
* Constructs an initial cache state.
|
|
157
|
-
*
|
|
158
|
-
* @internal
|
|
159
|
-
*/
|
|
160
|
-
const initialCacheState = () => makeCacheState(empty(), makeKeySet(), unbounded(), make$2(false), 0, 0);
|
|
161
|
-
/** @internal */
|
|
162
|
-
const CacheSymbolKey = "effect/Cache";
|
|
163
|
-
/** @internal */
|
|
164
|
-
const CacheTypeId = /*#__PURE__*/Symbol.for(CacheSymbolKey);
|
|
165
|
-
const cacheVariance = {
|
|
166
|
-
/* c8 ignore next */
|
|
167
|
-
_Key: _ => _,
|
|
168
|
-
/* c8 ignore next */
|
|
169
|
-
_Error: _ => _,
|
|
170
|
-
/* c8 ignore next */
|
|
171
|
-
_Value: _ => _
|
|
172
|
-
};
|
|
173
|
-
/** @internal */
|
|
174
|
-
const ConsumerCacheSymbolKey = "effect/ConsumerCache";
|
|
175
|
-
/** @internal */
|
|
176
|
-
const ConsumerCacheTypeId = /*#__PURE__*/Symbol.for(ConsumerCacheSymbolKey);
|
|
177
|
-
const consumerCacheVariance = {
|
|
178
|
-
/* c8 ignore next */
|
|
179
|
-
_Key: _ => _,
|
|
180
|
-
/* c8 ignore next */
|
|
181
|
-
_Error: _ => _,
|
|
182
|
-
/* c8 ignore next */
|
|
183
|
-
_Value: _ => _
|
|
184
|
-
};
|
|
185
|
-
/** @internal */
|
|
186
|
-
const makeCacheStats = options => options;
|
|
187
|
-
/** @internal */
|
|
188
|
-
const makeEntryStats = loadedMillis => ({
|
|
189
|
-
loadedMillis
|
|
190
|
-
});
|
|
191
|
-
class CacheImpl {
|
|
192
|
-
capacity;
|
|
193
|
-
context;
|
|
194
|
-
fiberId;
|
|
195
|
-
lookup;
|
|
196
|
-
timeToLive;
|
|
197
|
-
[CacheTypeId] = cacheVariance;
|
|
198
|
-
[ConsumerCacheTypeId] = consumerCacheVariance;
|
|
199
|
-
cacheState;
|
|
200
|
-
constructor(capacity, context, fiberId, lookup, timeToLive) {
|
|
201
|
-
this.capacity = capacity;
|
|
202
|
-
this.context = context;
|
|
203
|
-
this.fiberId = fiberId;
|
|
204
|
-
this.lookup = lookup;
|
|
205
|
-
this.timeToLive = timeToLive;
|
|
206
|
-
this.cacheState = initialCacheState();
|
|
207
|
-
}
|
|
208
|
-
get(key) {
|
|
209
|
-
return map(this.getEither(key), merge);
|
|
210
|
-
}
|
|
211
|
-
get cacheStats() {
|
|
212
|
-
return sync(() => makeCacheStats({
|
|
213
|
-
hits: this.cacheState.hits,
|
|
214
|
-
misses: this.cacheState.misses,
|
|
215
|
-
size: size(this.cacheState.map)
|
|
216
|
-
}));
|
|
217
|
-
}
|
|
218
|
-
getOption(key) {
|
|
219
|
-
return suspend(() => match(get(this.cacheState.map, key), {
|
|
220
|
-
onNone: () => {
|
|
221
|
-
const mapKey = makeMapKey(key);
|
|
222
|
-
this.trackAccess(mapKey);
|
|
223
|
-
this.trackMiss();
|
|
224
|
-
return succeed(none());
|
|
225
|
-
},
|
|
226
|
-
onSome: value => this.resolveMapValue(value)
|
|
227
|
-
}));
|
|
228
|
-
}
|
|
229
|
-
getOptionComplete(key) {
|
|
230
|
-
return suspend(() => match(get(this.cacheState.map, key), {
|
|
231
|
-
onNone: () => {
|
|
232
|
-
const mapKey = makeMapKey(key);
|
|
233
|
-
this.trackAccess(mapKey);
|
|
234
|
-
this.trackMiss();
|
|
235
|
-
return succeed(none());
|
|
236
|
-
},
|
|
237
|
-
onSome: value => this.resolveMapValue(value, true)
|
|
238
|
-
}));
|
|
239
|
-
}
|
|
240
|
-
contains(key) {
|
|
241
|
-
return sync(() => has(this.cacheState.map, key));
|
|
242
|
-
}
|
|
243
|
-
entryStats(key) {
|
|
244
|
-
return sync(() => {
|
|
245
|
-
const option = get(this.cacheState.map, key);
|
|
246
|
-
if (isSome(option)) {
|
|
247
|
-
switch (option.value._tag) {
|
|
248
|
-
case "Complete":
|
|
249
|
-
{
|
|
250
|
-
const loaded = option.value.entryStats.loadedMillis;
|
|
251
|
-
return some(makeEntryStats(loaded));
|
|
252
|
-
}
|
|
253
|
-
case "Pending":
|
|
254
|
-
{
|
|
255
|
-
return none();
|
|
256
|
-
}
|
|
257
|
-
case "Refreshing":
|
|
258
|
-
{
|
|
259
|
-
const loaded = option.value.complete.entryStats.loadedMillis;
|
|
260
|
-
return some(makeEntryStats(loaded));
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
return none();
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
getEither(key) {
|
|
268
|
-
return suspend(() => {
|
|
269
|
-
const k = key;
|
|
270
|
-
let mapKey = undefined;
|
|
271
|
-
let deferred = undefined;
|
|
272
|
-
let value = getOrUndefined(get(this.cacheState.map, k));
|
|
273
|
-
if (value === undefined) {
|
|
274
|
-
deferred = unsafeMake(this.fiberId);
|
|
275
|
-
mapKey = makeMapKey(k);
|
|
276
|
-
if (has(this.cacheState.map, k)) {
|
|
277
|
-
value = getOrUndefined(get(this.cacheState.map, k));
|
|
278
|
-
} else {
|
|
279
|
-
set(this.cacheState.map, k, pending(mapKey, deferred));
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
if (value === undefined) {
|
|
283
|
-
this.trackAccess(mapKey);
|
|
284
|
-
this.trackMiss();
|
|
285
|
-
return map(this.lookupValueOf(key, deferred), right);
|
|
286
|
-
} else {
|
|
287
|
-
return flatMap(this.resolveMapValue(value), match({
|
|
288
|
-
onNone: () => this.getEither(key),
|
|
289
|
-
onSome: value => succeed(left(value))
|
|
290
|
-
}));
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
invalidate(key) {
|
|
295
|
-
return sync(() => {
|
|
296
|
-
remove(this.cacheState.map, key);
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
invalidateWhen(key, when) {
|
|
300
|
-
return sync(() => {
|
|
301
|
-
const value = get(this.cacheState.map, key);
|
|
302
|
-
if (isSome(value) && value.value._tag === "Complete") {
|
|
303
|
-
if (value.value.exit._tag === "Success") {
|
|
304
|
-
if (when(value.value.exit.value)) {
|
|
305
|
-
remove(this.cacheState.map, key);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
get invalidateAll() {
|
|
312
|
-
return sync(() => {
|
|
313
|
-
this.cacheState.map = empty();
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
refresh(key) {
|
|
317
|
-
return clockWith(clock => suspend(() => {
|
|
318
|
-
const k = key;
|
|
319
|
-
const deferred = unsafeMake(this.fiberId);
|
|
320
|
-
let value = getOrUndefined(get(this.cacheState.map, k));
|
|
321
|
-
if (value === undefined) {
|
|
322
|
-
if (has(this.cacheState.map, k)) {
|
|
323
|
-
value = getOrUndefined(get(this.cacheState.map, k));
|
|
324
|
-
} else {
|
|
325
|
-
set(this.cacheState.map, k, pending(makeMapKey(k), deferred));
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
if (value === undefined) {
|
|
329
|
-
return asVoid(this.lookupValueOf(key, deferred));
|
|
330
|
-
} else {
|
|
331
|
-
switch (value._tag) {
|
|
332
|
-
case "Complete":
|
|
333
|
-
{
|
|
334
|
-
if (this.hasExpired(clock, value.timeToLiveMillis)) {
|
|
335
|
-
const found = getOrUndefined(get(this.cacheState.map, k));
|
|
336
|
-
if (equals(found, value)) {
|
|
337
|
-
remove(this.cacheState.map, k);
|
|
338
|
-
}
|
|
339
|
-
return asVoid(this.get(key));
|
|
340
|
-
}
|
|
341
|
-
// Only trigger the lookup if we're still the current value, `completedResult`
|
|
342
|
-
return pipe(this.lookupValueOf(key, deferred), when(() => {
|
|
343
|
-
const current = getOrUndefined(get(this.cacheState.map, k));
|
|
344
|
-
if (equals(current, value)) {
|
|
345
|
-
const mapValue = refreshing(deferred, value);
|
|
346
|
-
set(this.cacheState.map, k, mapValue);
|
|
347
|
-
return true;
|
|
348
|
-
}
|
|
349
|
-
return false;
|
|
350
|
-
}), asVoid);
|
|
351
|
-
}
|
|
352
|
-
case "Pending":
|
|
353
|
-
{
|
|
354
|
-
return _await(value.deferred);
|
|
355
|
-
}
|
|
356
|
-
case "Refreshing":
|
|
357
|
-
{
|
|
358
|
-
return _await(value.deferred);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}));
|
|
363
|
-
}
|
|
364
|
-
set(key, value) {
|
|
365
|
-
return clockWith(clock => sync(() => {
|
|
366
|
-
const now = clock.unsafeCurrentTimeMillis();
|
|
367
|
-
const k = key;
|
|
368
|
-
const lookupResult = succeed$1(value);
|
|
369
|
-
const mapValue = complete(makeMapKey(k), lookupResult, makeEntryStats(now), now + toMillis(decode(this.timeToLive(lookupResult))));
|
|
370
|
-
set(this.cacheState.map, k, mapValue);
|
|
371
|
-
}));
|
|
372
|
-
}
|
|
373
|
-
get size() {
|
|
374
|
-
return sync(() => {
|
|
375
|
-
return size(this.cacheState.map);
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
get values() {
|
|
379
|
-
return sync(() => {
|
|
380
|
-
const values = [];
|
|
381
|
-
for (const entry of this.cacheState.map) {
|
|
382
|
-
if (entry[1]._tag === "Complete" && entry[1].exit._tag === "Success") {
|
|
383
|
-
values.push(entry[1].exit.value);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
return values;
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
get entries() {
|
|
390
|
-
return sync(() => {
|
|
391
|
-
const values = [];
|
|
392
|
-
for (const entry of this.cacheState.map) {
|
|
393
|
-
if (entry[1]._tag === "Complete" && entry[1].exit._tag === "Success") {
|
|
394
|
-
values.push([entry[0], entry[1].exit.value]);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
return values;
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
get keys() {
|
|
401
|
-
return sync(() => {
|
|
402
|
-
const keys = [];
|
|
403
|
-
for (const entry of this.cacheState.map) {
|
|
404
|
-
if (entry[1]._tag === "Complete" && entry[1].exit._tag === "Success") {
|
|
405
|
-
keys.push(entry[0]);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
return keys;
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
resolveMapValue(value, ignorePending = false) {
|
|
412
|
-
return clockWith(clock => {
|
|
413
|
-
switch (value._tag) {
|
|
414
|
-
case "Complete":
|
|
415
|
-
{
|
|
416
|
-
this.trackAccess(value.key);
|
|
417
|
-
if (this.hasExpired(clock, value.timeToLiveMillis)) {
|
|
418
|
-
remove(this.cacheState.map, value.key.current);
|
|
419
|
-
return succeed(none());
|
|
420
|
-
}
|
|
421
|
-
this.trackHit();
|
|
422
|
-
return map(value.exit, some);
|
|
423
|
-
}
|
|
424
|
-
case "Pending":
|
|
425
|
-
{
|
|
426
|
-
this.trackAccess(value.key);
|
|
427
|
-
this.trackHit();
|
|
428
|
-
if (ignorePending) {
|
|
429
|
-
return succeed(none());
|
|
430
|
-
}
|
|
431
|
-
return map(_await(value.deferred), some);
|
|
432
|
-
}
|
|
433
|
-
case "Refreshing":
|
|
434
|
-
{
|
|
435
|
-
this.trackAccess(value.complete.key);
|
|
436
|
-
this.trackHit();
|
|
437
|
-
if (this.hasExpired(clock, value.complete.timeToLiveMillis)) {
|
|
438
|
-
if (ignorePending) {
|
|
439
|
-
return succeed(none());
|
|
440
|
-
}
|
|
441
|
-
return map(_await(value.deferred), some);
|
|
442
|
-
}
|
|
443
|
-
return map(value.complete.exit, some);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
trackHit() {
|
|
449
|
-
this.cacheState.hits = this.cacheState.hits + 1;
|
|
450
|
-
}
|
|
451
|
-
trackMiss() {
|
|
452
|
-
this.cacheState.misses = this.cacheState.misses + 1;
|
|
453
|
-
}
|
|
454
|
-
trackAccess(key) {
|
|
455
|
-
offer(this.cacheState.accesses, key);
|
|
456
|
-
if (compareAndSet(this.cacheState.updating, false, true)) {
|
|
457
|
-
let loop = true;
|
|
458
|
-
while (loop) {
|
|
459
|
-
const key = poll(this.cacheState.accesses, EmptyMutableQueue);
|
|
460
|
-
if (key === EmptyMutableQueue) {
|
|
461
|
-
loop = false;
|
|
462
|
-
} else {
|
|
463
|
-
this.cacheState.keys.add(key);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
let size$1 = size(this.cacheState.map);
|
|
467
|
-
loop = size$1 > this.capacity;
|
|
468
|
-
while (loop) {
|
|
469
|
-
const key = this.cacheState.keys.remove();
|
|
470
|
-
if (key !== undefined) {
|
|
471
|
-
if (has(this.cacheState.map, key.current)) {
|
|
472
|
-
remove(this.cacheState.map, key.current);
|
|
473
|
-
size$1 = size$1 - 1;
|
|
474
|
-
loop = size$1 > this.capacity;
|
|
475
|
-
}
|
|
476
|
-
} else {
|
|
477
|
-
loop = false;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
set$1(this.cacheState.updating, false);
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
hasExpired(clock, timeToLiveMillis) {
|
|
484
|
-
return clock.unsafeCurrentTimeMillis() > timeToLiveMillis;
|
|
485
|
-
}
|
|
486
|
-
lookupValueOf(input, deferred) {
|
|
487
|
-
return clockWith(clock => suspend(() => {
|
|
488
|
-
const key = input;
|
|
489
|
-
return pipe(this.lookup(input), provideContext(this.context), exit, flatMap(exit => {
|
|
490
|
-
const now = clock.unsafeCurrentTimeMillis();
|
|
491
|
-
const stats = makeEntryStats(now);
|
|
492
|
-
const value = complete(makeMapKey(key), exit, stats, now + toMillis(decode(this.timeToLive(exit))));
|
|
493
|
-
set(this.cacheState.map, key, value);
|
|
494
|
-
return zipRight(done(deferred, exit), exit);
|
|
495
|
-
}), onInterrupt(() => zipRight(interrupt(deferred), sync(() => {
|
|
496
|
-
remove(this.cacheState.map, key);
|
|
497
|
-
}))));
|
|
498
|
-
}));
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
/** @internal */
|
|
502
|
-
const make$1 = options => {
|
|
503
|
-
const timeToLive = decode(options.timeToLive);
|
|
504
|
-
return makeWith({
|
|
505
|
-
capacity: options.capacity,
|
|
506
|
-
lookup: options.lookup,
|
|
507
|
-
timeToLive: () => timeToLive
|
|
508
|
-
});
|
|
509
|
-
};
|
|
510
|
-
/** @internal */
|
|
511
|
-
const makeWith = options => map(all([context(), fiberId]), ([context, fiberId]) => new CacheImpl(options.capacity, context, fiberId, options.lookup, exit => decode(options.timeToLive(exit))));
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* Constructs a new cache with the specified capacity, time to live, and
|
|
515
|
-
* lookup function.
|
|
516
|
-
*
|
|
517
|
-
* @since 2.0.0
|
|
518
|
-
* @category constructors
|
|
519
|
-
*/
|
|
520
|
-
const make = make$1;
|
|
521
|
-
|
|
522
|
-
class FetchError extends TaggedError('FetchError') {
|
|
523
|
-
}
|
|
524
|
-
class NotFoundError extends TaggedError('NotFoundError') {
|
|
525
|
-
}
|
|
526
|
-
const httpClient = (input, init) => gen(function* () {
|
|
527
|
-
const response = yield* tryPromise({
|
|
528
|
-
try: () => fetch(input, init),
|
|
529
|
-
catch: error => new FetchError({ cause: error }),
|
|
530
|
-
});
|
|
531
|
-
if (response.status === 404) {
|
|
532
|
-
return yield* new NotFoundError({ url: response.url });
|
|
533
|
-
}
|
|
534
|
-
return response;
|
|
535
|
-
});
|
|
536
|
-
class ResponseTextError extends TaggedError('ResponseTextError') {
|
|
537
|
-
constructor(error) {
|
|
538
|
-
super(new Error(`Failed to read response text`, { cause: error }));
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
const responseAsText = (res) => tryPromise({
|
|
542
|
-
try: () => res.text(),
|
|
543
|
-
catch: error => new ResponseTextError(error),
|
|
544
|
-
});
|
|
545
|
-
|
|
546
|
-
const SVGString = refined(isValidSVG, () => error('SVG data is malformed'));
|
|
547
|
-
class BrandValidationError extends TaggedError('BrandValidationError') {
|
|
548
|
-
constructor(error, type) {
|
|
549
|
-
super(new Error(`Brand validation failed for type ${type}.`, { cause: error }));
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
const createValidSVGString = (svg) => try_({
|
|
553
|
-
try: () => SVGString(svg),
|
|
554
|
-
catch: error => new BrandValidationError(error, 'SVGString'),
|
|
555
|
-
});
|
|
556
|
-
function isValidSVG(svg) {
|
|
557
|
-
if (typeof svg !== 'string') {
|
|
558
|
-
return false;
|
|
559
|
-
}
|
|
560
|
-
try {
|
|
561
|
-
const parser = new DOMParser();
|
|
562
|
-
const doc = parser.parseFromString(svg, 'image/svg+xml');
|
|
563
|
-
return doc.documentElement.nodeName === 'svg';
|
|
564
|
-
}
|
|
565
|
-
catch {
|
|
566
|
-
return false;
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
const emptyDefaultSvg = () => SVGString(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>`);
|
|
571
|
-
const createIconCache = () => make({
|
|
572
|
-
capacity: 200,
|
|
573
|
-
timeToLive: infinity,
|
|
574
|
-
lookup: (key) => gen(function* () {
|
|
575
|
-
const name = key;
|
|
576
|
-
const assetPath = yield* syncCreateAssetUrlSafely(`${name}.svg`, 'icons');
|
|
577
|
-
const res = yield* httpClient(assetPath);
|
|
578
|
-
const responseString = yield* responseAsText(res);
|
|
579
|
-
return yield* createValidSVGString(responseString);
|
|
580
|
-
}),
|
|
581
|
-
});
|
|
582
|
-
let cacheInstance = null;
|
|
583
|
-
function fetchIconSvg(name) {
|
|
584
|
-
const key = name;
|
|
585
|
-
return gen(function* () {
|
|
586
|
-
if (!cacheInstance) {
|
|
587
|
-
cacheInstance = yield* createIconCache();
|
|
588
|
-
}
|
|
589
|
-
return yield* cacheInstance.get(key);
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
function clearIconCache() {
|
|
593
|
-
return gen(function* () {
|
|
594
|
-
if (cacheInstance) {
|
|
595
|
-
yield* cacheInstance.invalidateAll;
|
|
596
|
-
}
|
|
597
|
-
else {
|
|
598
|
-
logWarning('Attempted to clear icon cache before it was initialized');
|
|
599
|
-
}
|
|
600
|
-
});
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
export { clearIconCache as c, emptyDefaultSvg as e, fetchIconSvg as f };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as r,h as t,H as a}from"./p-smGPjoDX.js";import{a as o}from"./p-BhQLGXPs.js";import{s as m}from"./p-4XIjw3k8.js";const n=class{constructor(t){e(this,t),this.primaryAction=r(this,"primaryAction")}cardTitle;imageUrl;description;primaryActionLabel="";primaryAction;get fallbackImage(){return o(m("card-placeholder.svg"))}_onPrimaryClick(){this.primaryAction.emit()}_onOverflowClick(e){console.log(e)}render(){return t(a,{key:"1438354a53604954320d01652aa1d84f8712e875",role:"article"},t("div",{key:"dcffae2c48ebf8f8769cf07c2e78806f12df6888",class:"top"},t("div",{key:"e41e1d0aafbfc5879b86022e91958ef3373b48b2",class:"image-wrapper",style:{backgroundImage:`url(${this.imageUrl??this.fallbackImage})`}},t("div",{key:"f6a1fc9706012f39aca9dd0b995290e6042e3407",class:"chip-slot"},t("slot",{key:"4e014519c147705cc30b3268d652ea6c76c749ec",name:"chip"})))),t("div",{key:"e7baf78b660e9a97edd0b6a0aa1bdb1afa593fed",class:"bottom"},t("header",{key:"a8dad9f91df60f535725328a4901833d47652678"},t("h2",{key:"1cdbca46469750187856a46fa155128f1f8a677f",class:"title"},this.cardTitle)),t("p",{key:"f33c2c0af86d7be31fcbd676833b27c7d06e2dd9",class:"description"},this.description),t("div",{key:"a12595d514167fb957aac71fe3d144810b442f9d",class:"actions"},t("button",{key:"9730cedbf83599c09eedaaae43331147691486d6",class:"primary",onClick:this._onPrimaryClick.bind(this),"data-testid":"primary"},this.primaryActionLabel),t("button",{key:"48e9c511c406beb75334452769beade3dec9a3f5",class:"tertiary","aria-label":"More actions",onClick:this._onOverflowClick},t("span",{key:"81cc1af42a15dddb9dbd4f373a6a047c2e2cd563",class:"icon-placeholder"},"...")))))}static get assetsDirs(){return["../../assets"]}};n.style="@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } @layer lmvz-ds.reset { h1, h2, h3, h4, h5, h6 { margin: 0; } } .sc-lmvz-card-h { button { --lmvz-button-color: var(--lmvz-component-color, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-padding-inline: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-padding-block: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); --lmvz-button-radius: var(--lmvz-component-input-radius-default, 999px); --lmvz-button-border-width: 0; --lmvz-button-border-color: transparent; --lmvz-button-background: var(--lmvz-semantic-color-int-primary, #000000); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-button-gap); padding-block: var(--lmvz-button-padding-block); padding-inline: var(--lmvz-button-padding-inline); border-radius: var(--lmvz-button-radius); border: var(--lmvz-button-border-width) solid var(--lmvz-button-border-color); background-color: var(--lmvz-button-background); color: var(--lmvz-button-color); cursor: pointer; font: var(--lmvz-button-font); text-align: center; text-decoration: none; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; } button > * { font: inherit; color: inherit; } button:focus-visible { outline: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-selected, #f1f9fe); outline-offset: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); } button:is([disabled], .disabled) { cursor: not-allowed; pointer-events: none; opacity: var(--lmvz-component-input-disabled-opacity, 40%); } button:not([disabled]):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-hover, #2e2e2e); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-active, #545454); } button.secondary { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-button-border-width: var(--lmvz-semantic-border-width-default, 1px); --lmvz-button-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --lmvz-button-border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active, #d4d4d4); --lmvz-button-border-color: var(--lmvz-semantic-color-border-active, #d4d4d4); } button.tertiary { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); --lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary, #545454); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); } button.small { --lmvz-button-padding-inline: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-padding-block: var(--lmvz-component-input-sm-padding-y, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-gap: var(--lmvz-component-input-sm-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } button.large { --lmvz-button-padding-inline: var(--lmvz-component-input-lg-padding-x, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-padding-block: var(--lmvz-component-input-lg-padding-y, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-gap: var(--lmvz-component-input-lg-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); } display: flex; min-width: var(--lmvz-other-component-card-minwidth, 20.4375rem); max-width: var(--lmvz-other-component-card-maxwidth, 21.6875rem); flex-direction: column; align-items: flex-start; border-radius: var(--lmvz-semantic-border-radius-lg, 14px); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0); background: var(--lmvz-semantic-color-surface-primary, #ffffff); } *.sc-lmvz-card { color: var(--lmvz-semantic-color-on-surface-primary, #000000); font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } .top.sc-lmvz-card { display: flex; padding: var(--lmvz-dimension-8-12, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); flex-direction: column; justify-content: center; align-items: center; align-self: stretch; } .bottom.sc-lmvz-card { display: flex; min-width: 150px; padding: var(--lmvz-dimension-4-6, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)); flex-direction: column; align-items: flex-start; align-self: stretch; } .title.sc-lmvz-card { margin: 0; display: flex; justify-content: center; align-items: center; align-self: stretch; padding-bottom: var(--lmvz-global-s4, 4px); overflow-wrap: break-word; font: var(--lmvz-typography-heading-2xl, 500 clamp(2rem, 1.94rem + 0.26vw, 2.25rem) / 1.2 Router); } .description.sc-lmvz-card { display: flex; margin: 0; padding-bottom: var(--lmvz-component-body-sm-padding-bottom, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); align-items: flex-start; align-self: stretch; white-space: pre-line; font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } .image-wrapper.sc-lmvz-card { aspect-ratio: 4 / 3; width: 100%; background-size: cover; background-position: center; flex: 1 0 0; align-self: stretch; border-radius: var(--lmvz-semantic-border-radius-md, 6px); } .actions.sc-lmvz-card { margin-top: var(--lmvz-component-form-wrapper-gap-y, clamp(1.13rem, 0.97rem + 0.65vw, 1.75rem)); display: flex; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); align-self: stretch; } button.primary.sc-lmvz-card, lmvz-button.primary.sc-lmvz-card { display: flex; justify-content: center; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); flex: 1 0 0; }";export{n as lmvz_card}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e,r as a,h as t,H as r}from"./p-smGPjoDX.js";import{g as n,c as s}from"./p-B3JVFwO1.js";import{R as i,A as l}from"./p-CXWyvf0D.js";import"./p-BhQLGXPs.js";import"./p-D7I-Bc5i.js";class o{host;elements=[];constructor(e){this.host=e}hostDidRender(){this.host.el.addEventListener("keydown",this.handleKeydown)}updateElements(e){this.elements=e}handleKeydown=e=>{const{key:a}=e;if(!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft"].includes(a))return;const t=n(document),r=this.getNextFocusableElement(t,["ArrowDown","ArrowRight"].includes(a)?"down":"up");r&&(e.preventDefault(),r.focus?.())};getNextFocusableElement(e,a){const{elements:t}=this,r=t.indexOf(e);if(-1===r)return null;let n=null;if("down"===a?n=(r+1)%t.length:"up"===a&&(n=(r-1+t.length)%t.length),null==n)return null;const i=t[n];return s(i)?i:this.getNextFocusableElement(i,a)}}const c=class extends i{get el(){return e(this)}primarySlot;secondarySlot;secondaryNav;keyboardNavigationController=new o(this);get primaryMenuitems(){return this.primarySlot.assignedElements({flatten:!1})}get secondaryMenuitems(){return this.secondarySlot.assignedElements({flatten:!0})}get role(){return"banner"}lmvzActiveNav;get secondarySlotName(){return`connect-nav-${this.lmvzActiveNav}`}constructor(e){super(),a(this,e),this.addController(new l(this,{reValidateOnPropChanges:!0})),this.addController(this.keyboardNavigationController)}handleActiveNavChange(){this.updateElementsActive()}componentDidLoad(){this.primarySlot.addEventListener("slotchange",this.handlePrimaryNavChange.bind(this)),this.handlePrimaryNavChange(),this.secondarySlot.addEventListener("slotchange",this.handleSecondaryNavChange.bind(this))}handlePrimaryNavChange(){const e=this.primaryMenuitems;e.length?(e.forEach((e=>{e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-controls","nav-secondary")})),this.updateElementsActive()):console.warn("Primary slot has no assigned elements. Please add navigation items to the primary slot.")}handleSecondaryNavChange(){this.secondaryMenuitems.length&&this.keyboardNavigationController.updateElements([...this.primaryMenuitems,...this.secondaryMenuitems])}updateElementsActive(){let e;this.primaryMenuitems.forEach((a=>{const t=a.id===this.lmvzActiveNav;t&&(e=a.textContent||a.id),a.setAttribute("aria-expanded",t?"true":"false")})),this.secondaryNav.setAttribute("aria-label",`Untermenü für ${e}`)}delegateFocus(){const e=this.primaryMenuitems[0];e&&e.focus()}render(){return t(r,{key:"58934683ff442801eb34f025ac809631f93a27e8",onFocus:this.delegateFocus.bind(this)},t("div",{key:"35d3eadfabb70f83b313f946c8d31f9c223e8344",class:"brand"},t("slot",{key:"5ce98314d980d63e1c87f508d96119aca2e702a9",name:"brand"},t("lmvz-icon",{key:"b24e61a9071d81948d506a8c545e012d3f0e5dd2",id:"fallback-logo-lmvz",icon:"Logo",size:"inherit","aria-label":"Lehrmittelverlag Zürich"}))),t("nav",{key:"1d5cc9010ef90e6cebc8a7b054db595f35f9e040","aria-label":"Hauptnavigation"},t("div",{key:"488a1b1544242562b57d76169f1988d84c611de4",role:"menubar",class:"primary-menubar"},t("slot",{key:"59c6dd1442290931ed9a55f7bacc65ea4bb9ff6d",name:"nav-primary",ref:e=>this.primarySlot=e}),t("separator",{key:"2729f0e8b115614c50c4a16b6684a3bdb21856b8"}),t("div",{key:"6b5bed5951bad9173fefdc78039e71c4ccc120b2",role:"menu",id:"nav-secondary",class:"secondary-menubar",hidden:!this.lmvzActiveNav,ref:e=>this.secondaryNav=e},t("slot",{key:"02f5a13e8851372c1698e3f786a8757a0a09c32f",name:this.secondarySlotName,ref:e=>this.secondarySlot=e})))),t("div",{key:"53aafe8139bcea27d3039f64a48974cdb5aac5f9",class:"actions"},t("slot",{key:"f12ee19831073253e6ba8e251ba31ec403c21035",name:"actions"})))}static get watchers(){return{lmvzActiveNav:[{handleActiveNavChange:0}]}}};c.style=":host{display:flex;width:100vw;flex-direction:row;align-items:center;box-sizing:border-box;background-color:var(--lmvz-semantic-color-surface-primary, #ffffff);--lmvz-header-x-spacing-level-1:var(--lmvz-dimension-8-28, clamp(0.5rem, 0.2rem + 1.29vw, 1.75rem));--lmvz-header-x-spacing-level-2:var(--lmvz-component-buttongroup-wrapper-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));padding:var(--lmvz-dimension-8-16, clamp(0.5rem, 0.38rem + 0.52vw, 1rem)) var(--lmvz-header-x-spacing-level-1);gap:var(--lmvz-header-x-spacing-level-1);.brand{display:inline-flex;justify-content:center;align-items:center}#fallback-logo-lmvz{height:34px;width:auto}nav{flex-grow:1}.primary-menubar{display:flex;flex-direction:row;align-items:center}.secondary-menubar{display:flex;flex-direction:row;align-items:center;margin-left:var(--lmvz-header-x-spacing-level-2);padding-left:var(--lmvz-header-x-spacing-level-2);border-left:1px solid var(--lmvz-semantic-color-border-default, #e0e0e0)}}";export{c as lmvz_header}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t,r as o,c as r,h as e,H as n}from"./p-smGPjoDX.js";import{c as a}from"./p-DMLRPGid.js";import{i as l,f as m}from"./p-B3JVFwO1.js";import{E as i}from"./p-CN0JX9-m.js";import{R as s,A as d}from"./p-CXWyvf0D.js";import"./p-B85MJLTf.js";import"./p-BhQLGXPs.js";import"./p-D7I-Bc5i.js";const c=class extends s{get el(){return t(this)}inheritedAttributes={};formEl=null;formButtonEl=null;lmvzActivation;get ti(){return 0}scale="default";variant="secondary";disabled=!1;type="button";form;constructor(t){super(),o(this,t),this.lmvzActivation=r(this,"lmvzActivation"),this.addController(new d(this)),this.addController(new i(this,{localHandler:this.handleClick.bind(this),keys:["Enter"]}))}connectedCallback(){this.inheritedAttributes=l(this.el)}renderHiddenButton(){const t=this.formEl=m(this.form,this.el);if(!t)return;const{formButtonEl:o}=this;if(null!==o&&t.contains(o))return;const r=this.formButtonEl=document.createElement("button");r.type="submit",r.style.display="none",r.disabled=this.disabled,t.appendChild(r)}submitForm(t){this.formEl&&this.formButtonEl&&(t.preventDefault(),this.formButtonEl.click())}handleClick=t=>{"submit"===this.type&&this.submitForm(t)};render(){return this.renderHiddenButton(),e(n,{key:"578b9f70209fba3a23bd20c3d8b3832cb3005311","aria-disabled":this.disabled?"true":null},e("button",{key:"6b25bee333bec8a36eb1bf77b8e11cd9691a998f",disabled:this.disabled,class:a(this.variant,{[this.scale??""]:!!this.scale,disabled:this.disabled}),...this.inheritedAttributes},e("slot",{key:"5e63d9c069ffa7c10585e1fda980d8087cb43cc9"})))}static get delegatesFocus(){return!0}};c.style=" @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } @layer lmvz-ds.reset { h1, h2, h3, h4, h5, h6 { margin: 0; } } :host { button { --lmvz-button-color: var(--lmvz-component-color, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-padding-inline: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-padding-block: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); --lmvz-button-radius: var(--lmvz-component-input-radius-default, 999px); --lmvz-button-border-width: 0; --lmvz-button-border-color: transparent; --lmvz-button-background: var(--lmvz-semantic-color-int-primary, #000000); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-button-gap); padding-block: var(--lmvz-button-padding-block); padding-inline: var(--lmvz-button-padding-inline); border-radius: var(--lmvz-button-radius); border: var(--lmvz-button-border-width) solid var(--lmvz-button-border-color); background-color: var(--lmvz-button-background); color: var(--lmvz-button-color); cursor: pointer; font: var(--lmvz-button-font); text-align: center; text-decoration: none; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; } button > * { font: inherit; color: inherit; } button:focus-visible { outline: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-selected, #f1f9fe); outline-offset: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); } button:is([disabled], .disabled) { cursor: not-allowed; pointer-events: none; opacity: var(--lmvz-component-input-disabled-opacity, 40%); } button:not([disabled]):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-hover, #2e2e2e); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-active, #545454); } button.secondary { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-button-border-width: var(--lmvz-semantic-border-width-default, 1px); --lmvz-button-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --lmvz-button-border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active, #d4d4d4); --lmvz-button-border-color: var(--lmvz-semantic-color-border-active, #d4d4d4); } button.tertiary { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); --lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary, #545454); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); } button.small { --lmvz-button-padding-inline: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-padding-block: var(--lmvz-component-input-sm-padding-y, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-gap: var(--lmvz-component-input-sm-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } button.large { --lmvz-button-padding-inline: var(--lmvz-component-input-lg-padding-x, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-padding-block: var(--lmvz-component-input-lg-padding-y, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-gap: var(--lmvz-component-input-lg-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); } display: contents; } ::slotted(*) { --lmvz-component-color: var(--lmvz-button-color); } ";export{c as lmvz_button}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./p-smGPjoDX.js";import{a4 as s,a1 as e,t as a,a2 as r,a5 as o}from"./p-BhQLGXPs.js";const n=function(){const t=Symbol.for("effect/Data/Error/plainArgs");return class extends s{constructor(s){super(s?.message,s?.cause?{cause:s.cause}:void 0),s&&(Object.assign(this,s),Object.defineProperty(this,t,{value:s,enumerable:!1}))}toJSON(){return{...this[t],...this}}}}(),i=t=>{const s={BaseEffectError:class extends n{_tag=t}};return s.BaseEffectError.prototype.name=t,s.BaseEffectError};i("URLCreationError");const c=(s,n)=>{const i=function(...t){return t.filter(Boolean).join("/").replace("//","/").replace("/./","/")}("../../assets",n,s);return e((()=>t(i))).pipe(a((()=>r(`Failed to create URL for asset "${s}" in path "${n}".\n Please provide an absolute URL in your app's 'setAssetPath(...)' configuration! Falling back to a relative URL, which may work in some environments but is not guaranteed to be correct.`))),o((()=>new URL(i,import.meta?.url??window?.location?.origin??""))))};export{i as T,c as s}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t,b as s,d as e,i,e as r,f as n,m as o,h as a,j as h,k as c,n as u,o as d,p as l,q as f,u as p,v,w as m,x as g,y,z as w,A as S,B as x,C,D as k,E,F as _,G as b,H as V,I as B,J as M,K as P,L as R,M as T,N as j,O as L,P as N,Q as O,R as z,S as A,T as F,U as G,V as I,W as K,X as D,Y as X,Z as $,_ as H,$ as Q,a0 as W,a1 as q,a2 as J,a3 as U}from"./p-BhQLGXPs.js";import{u as Y,o as Z,p as tt,E as st,a as et,_ as it,s as rt,i as nt,d as ot}from"./p-D7I-Bc5i.js";import{T as at,s as ht}from"./p-4XIjw3k8.js";const ct=Symbol.for("effect/Brand/Refined"),ut=(t,s,e,i)=>E({_tag:"Complete",key:t,exit:s,entryStats:e,timeToLiveMillis:i}),dt=(t,s)=>E({_tag:"Pending",key:t,deferred:s}),lt=Symbol.for("effect/Cache/MapKey");class ft{current;[lt]=lt;previous=void 0;next=void 0;constructor(t){this.current=t}[T](){return j(O(this.current),N(O(this.previous)),N(O(this.next)),L(this))}[z](t){return this===t||vt(t)&&F(this.current,t.current)&&F(this.previous,t.previous)&&F(this.next,t.next)}}const pt=t=>new ft(t),vt=t=>A(t,lt);class mt{head=void 0;tail=void 0;add(t){if(t!==this.tail)if(void 0===this.tail)this.head=t,this.tail=t;else{const s=t.previous,e=t.next;void 0!==e&&(t.next=void 0,void 0!==s?(s.next=e,e.previous=s):(this.head=e,this.head.previous=void 0)),this.tail.next=t,t.previous=this.tail,this.tail=t}}remove(){const t=this.head;if(void 0!==t){const s=t.next;void 0!==s?(t.next=void 0,this.head=s,this.head.previous=void 0):(this.head=void 0,this.tail=void 0)}return t}}const gt=Symbol.for("effect/Cache"),yt={_Key:t=>t,_Error:t=>t,_Value:t=>t},wt=Symbol.for("effect/ConsumerCache"),St={_Key:t=>t,_Error:t=>t,_Value:t=>t},xt=t=>({loadedMillis:t});class Ct{capacity;context;fiberId;lookup;timeToLive;[gt]=yt;[wt]=St;cacheState;constructor(t,s,e,i,r){this.capacity=t,this.context=s,this.fiberId=e,this.lookup=i,this.timeToLive=r,this.cacheState={map:V(),keys:new mt,accesses:et(),updating:R(!1),hits:0,misses:0}}get(t){return h(this.getEither(t),l)}get cacheStats(){return f((()=>({hits:this.cacheState.hits,misses:this.cacheState.misses,size:p(this.cacheState.map)})))}getOption(t){return v((()=>o(m(this.cacheState.map,t),{onNone:()=>{const s=pt(t);return this.trackAccess(s),this.trackMiss(),g(y())},onSome:t=>this.resolveMapValue(t)})))}getOptionComplete(t){return v((()=>o(m(this.cacheState.map,t),{onNone:()=>{const s=pt(t);return this.trackAccess(s),this.trackMiss(),g(y())},onSome:t=>this.resolveMapValue(t,!0)})))}contains(t){return f((()=>w(this.cacheState.map,t)))}entryStats(t){return f((()=>{const s=m(this.cacheState.map,t);if(S(s))switch(s.value._tag){case"Complete":return x(xt(s.value.entryStats.loadedMillis));case"Pending":return y();case"Refreshing":return x(xt(s.value.complete.entryStats.loadedMillis))}return y()}))}getEither(t){return v((()=>{const i=t;let r,n,a=C(m(this.cacheState.map,i));return void 0===a&&(n=Y(this.fiberId),r=pt(i),w(this.cacheState.map,i)?a=C(m(this.cacheState.map,i)):k(this.cacheState.map,i,dt(r,n))),void 0===a?(this.trackAccess(r),this.trackMiss(),h(this.lookupValueOf(t,n),s)):_(this.resolveMapValue(a),o({onNone:()=>this.getEither(t),onSome:t=>g(e(t))}))}))}invalidate(t){return f((()=>{b(this.cacheState.map,t)}))}invalidateWhen(t,s){return f((()=>{const e=m(this.cacheState.map,t);S(e)&&"Complete"===e.value._tag&&"Success"===e.value.exit._tag&&s(e.value.exit.value)&&b(this.cacheState.map,t)}))}get invalidateAll(){return f((()=>{this.cacheState.map=V()}))}refresh(t){return B((s=>v((()=>{const e=t,i=Y(this.fiberId);let r=C(m(this.cacheState.map,e));if(void 0===r&&(w(this.cacheState.map,e)?r=C(m(this.cacheState.map,e)):k(this.cacheState.map,e,dt(pt(e),i))),void 0===r)return G(this.lookupValueOf(t,i));switch(r._tag){case"Complete":if(this.hasExpired(s,r.timeToLiveMillis)){const s=C(m(this.cacheState.map,e));return F(s,r)&&b(this.cacheState.map,e),G(this.get(t))}return j(this.lookupValueOf(t,i),I((()=>{const t=C(m(this.cacheState.map,e));if(F(t,r)){const t=((t,s)=>E({_tag:"Refreshing",deferred:t,complete:s}))(i,r);return k(this.cacheState.map,e,t),!0}return!1})),G);case"Pending":case"Refreshing":return it(r.deferred)}}))))}set(t,s){return B((e=>f((()=>{const i=e.unsafeCurrentTimeMillis(),r=t,n=rt(s),o=ut(pt(r),n,xt(i),i+K(a(this.timeToLive(n))));k(this.cacheState.map,r,o)}))))}get size(){return f((()=>p(this.cacheState.map)))}get values(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[1].exit.value);return t}))}get entries(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push([s[0],s[1].exit.value]);return t}))}get keys(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[0]);return t}))}resolveMapValue(t,s=!1){return B((e=>{switch(t._tag){case"Complete":return this.trackAccess(t.key),this.hasExpired(e,t.timeToLiveMillis)?(b(this.cacheState.map,t.key.current),g(y())):(this.trackHit(),h(t.exit,x));case"Pending":return this.trackAccess(t.key),this.trackHit(),s?g(y()):h(it(t.deferred),x);case"Refreshing":return this.trackAccess(t.complete.key),this.trackHit(),this.hasExpired(e,t.complete.timeToLiveMillis)?s?g(y()):h(it(t.deferred),x):h(t.complete.exit,x)}}))}trackHit(){this.cacheState.hits=this.cacheState.hits+1}trackMiss(){this.cacheState.misses=this.cacheState.misses+1}trackAccess(t){if(Z(this.cacheState.accesses,t),M(this.cacheState.updating,!1,!0)){let t=!0;for(;t;){const s=tt(this.cacheState.accesses,st);s===st?t=!1:this.cacheState.keys.add(s)}let s=p(this.cacheState.map);for(t=s>this.capacity;t;){const e=this.cacheState.keys.remove();void 0!==e?w(this.cacheState.map,e.current)&&(b(this.cacheState.map,e.current),s-=1,t=s>this.capacity):t=!1}P(this.cacheState.updating,!1)}}hasExpired(t,s){return t.unsafeCurrentTimeMillis()>s}lookupValueOf(t,s){return B((e=>v((()=>{const i=t;return j(this.lookup(t),H(this.context),$,_((t=>{const r=e.unsafeCurrentTimeMillis(),n=xt(r),o=ut(pt(i),t,n,r+K(a(this.timeToLive(t))));return k(this.cacheState.map,i,o),X(ot(s,t),t)})),D((()=>X(nt(s),f((()=>{b(this.cacheState.map,i)}))))))}))))}}const kt=t=>{const s=a(t.timeToLive);return(t=>h(c([u(),d]),(([s,e])=>new Ct(t.capacity,s,e,t.lookup,(s=>a(t.timeToLive(s)))))))({capacity:t.capacity,lookup:t.lookup,timeToLive:()=>s})};class Et extends(at("FetchError")){}class _t extends(at("NotFoundError")){}class bt extends(at("ResponseTextError")){constructor(t){super(new Error("Failed to read response text",{cause:t}))}}const Vt=function(...a){const h=2===a.length?t=>a[0](t)?s(t):e(a[1](t)):t=>o(a[0](t),{onNone:()=>s(t),onSome:e});return Object.assign((s=>t(h(s),i)),{[ct]:ct,option:t=>n(h(t)),either:h,is:t=>r(h(t))})}((function(t){if("string"!=typeof t)return!1;try{return"svg"===(new DOMParser).parseFromString(t,"image/svg+xml").documentElement.nodeName}catch{return!1}}),(()=>[{message:"SVG data is malformed",meta:undefined}]));class Bt extends(at("BrandValidationError")){constructor(t,s){super(new Error(`Brand validation failed for type ${s}.`,{cause:t}))}}const Mt=()=>Vt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>');let Pt=null;function Rt(t){const s=t;return Q((function*(){return Pt||(Pt=yield*kt({capacity:200,timeToLive:U,lookup:t=>Q((function*(){const s=t,e=yield*ht(`${s}.svg`,"icons"),i=yield*(r=e,Q((function*(){const t=yield*W({try:()=>fetch(r,void 0),catch:t=>new Et({cause:t})});return 404===t.status?yield*new _t({url:t.url}):t})));var r;const n=yield*(t=>W({try:()=>t.text(),catch:t=>new bt(t)}))(i);return yield*(o=n,q({try:()=>Vt(o),catch:t=>new Bt(t,"SVGString")}));var o}))})),yield*Pt.get(s)}))}function Tt(){return Q((function*(){Pt?yield*Pt.invalidateAll:J("Attempted to clear icon cache before it was initialized")}))}export{Tt as c,Mt as e,Rt as f}
|