@revenuecat/purchases-ui-js 2.0.2 → 2.0.4

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 (144) hide show
  1. package/dist/components/button/ButtonNode.stories.svelte +66 -102
  2. package/dist/components/button/ButtonNode.svelte +18 -26
  3. package/dist/components/carousel/Carousel.stories.svelte +1039 -0
  4. package/dist/components/carousel/Carousel.stories.svelte.d.ts +19 -0
  5. package/dist/components/carousel/Carousel.svelte +298 -0
  6. package/dist/components/carousel/Carousel.svelte.d.ts +4 -0
  7. package/dist/components/carousel/CarouselPage.svelte +39 -0
  8. package/dist/components/carousel/CarouselPage.svelte.d.ts +11 -0
  9. package/dist/components/carousel/PageControl.svelte +93 -0
  10. package/dist/components/carousel/PageControl.svelte.d.ts +4 -0
  11. package/dist/components/carousel/carousel-utils.d.ts +4 -0
  12. package/dist/components/carousel/carousel-utils.js +21 -0
  13. package/dist/components/footer/Footer.stories.svelte +112 -102
  14. package/dist/components/footer/Footer.svelte +8 -4
  15. package/dist/components/icon/Icon.stories.svelte +100 -0
  16. package/dist/components/icon/Icon.stories.svelte.d.ts +19 -0
  17. package/dist/components/icon/Icon.svelte +73 -0
  18. package/dist/components/icon/Icon.svelte.d.ts +4 -0
  19. package/dist/components/image/ClipPath.svelte +49 -0
  20. package/dist/components/image/ClipPath.svelte.d.ts +9 -0
  21. package/dist/components/image/Image.stories.svelte +83 -188
  22. package/dist/components/image/Image.svelte +152 -136
  23. package/dist/components/image/Image.svelte.d.ts +1 -1
  24. package/dist/components/image/Overlay.svelte +36 -0
  25. package/dist/components/image/Overlay.svelte.d.ts +8 -0
  26. package/dist/components/package/Package.stories.svelte +10 -21
  27. package/dist/components/package/Package.svelte +8 -35
  28. package/dist/components/paywall/Node.svelte +25 -32
  29. package/dist/components/paywall/Node.svelte.d.ts +4 -6
  30. package/dist/components/paywall/Paywall.stories.svelte +36 -140
  31. package/dist/components/paywall/Paywall.svelte +23 -7
  32. package/dist/components/paywall/Paywall.svelte.d.ts +4 -2
  33. package/dist/components/paywall/fixtures/override-paywall.d.ts +2 -0
  34. package/dist/components/paywall/fixtures/override-paywall.js +1310 -0
  35. package/dist/components/paywall/fixtures/stack-paywall.d.ts +2 -0
  36. package/dist/components/paywall/fixtures/stack-paywall.js +5223 -0
  37. package/dist/components/paywall/fixtures/variables.d.ts +261 -0
  38. package/dist/components/paywall/fixtures/variables.js +262 -0
  39. package/dist/components/paywall/paywall-utils.d.ts +1 -1
  40. package/dist/components/purchase-button/PurchaseButton.stories.svelte +10 -21
  41. package/dist/components/purchase-button/PurchaseButton.svelte +2 -27
  42. package/dist/components/stack/Stack.stories.svelte +2354 -978
  43. package/dist/components/stack/Stack.svelte +116 -134
  44. package/dist/components/stack/Stack.svelte.d.ts +8 -2
  45. package/dist/components/stack/stack-utils.d.ts +10 -30
  46. package/dist/components/stack/stack-utils.js +77 -255
  47. package/dist/components/text/Text.svelte +3 -37
  48. package/dist/components/text/Text.svelte.d.ts +1 -2
  49. package/dist/components/text/TextNode.stories.svelte +10 -36
  50. package/dist/components/text/TextNode.svelte +25 -28
  51. package/dist/components/text/TextNode.svelte.d.ts +1 -1
  52. package/dist/components/text/text-utils.d.ts +4 -9
  53. package/dist/components/text/text-utils.js +32 -117
  54. package/dist/components/timeline/Timeline.stories.svelte +640 -251
  55. package/dist/components/timeline/Timeline.svelte +42 -28
  56. package/dist/components/timeline/Timeline.svelte.d.ts +1 -1
  57. package/dist/components/timeline/TimelineItem.svelte +80 -112
  58. package/dist/components/timeline/TimelineItem.svelte.d.ts +6 -2
  59. package/dist/components/timeline/timeline-utils.d.ts +24 -6
  60. package/dist/components/timeline/timeline-utils.js +21 -113
  61. package/dist/index.d.ts +3 -2
  62. package/dist/index.js +3 -2
  63. package/dist/stores/color-mode.d.ts +1 -1
  64. package/dist/stores/paywall.d.ts +5 -2
  65. package/dist/stores/selected.d.ts +5 -0
  66. package/dist/stores/selected.js +12 -0
  67. package/dist/stores/variables.d.ts +1 -1
  68. package/dist/stores/variables.js +0 -1
  69. package/dist/stories/component-decorator.d.ts +2 -0
  70. package/dist/stories/component-decorator.js +12 -0
  71. package/dist/stories/fixtures.d.ts +6 -3
  72. package/dist/stories/fixtures.js +5214 -4422
  73. package/dist/stories/paywall-decorator.js +6 -0
  74. package/dist/stories/variables-decorator.d.ts +1 -1
  75. package/dist/stories/viewport-decorator.d.ts +2 -0
  76. package/dist/stories/viewport-decorator.js +8 -0
  77. package/dist/stories/viewport-wrapper.svelte +55 -0
  78. package/dist/stories/viewport-wrapper.svelte.d.ts +10 -0
  79. package/dist/stories/with-layout.d.ts +2 -10
  80. package/dist/stories/with-layout.js +3 -5
  81. package/dist/types/alignment.d.ts +5 -3
  82. package/dist/types/background.d.ts +6 -5
  83. package/dist/types/base.d.ts +7 -0
  84. package/dist/types/colors.d.ts +4 -4
  85. package/dist/types/component.d.ts +7 -2
  86. package/dist/types/components/button.d.ts +6 -1
  87. package/dist/types/components/carousel.d.ts +51 -0
  88. package/dist/types/components/carousel.js +1 -0
  89. package/dist/types/components/footer.d.ts +2 -1
  90. package/dist/types/components/icon.d.ts +28 -0
  91. package/dist/types/components/icon.js +1 -0
  92. package/dist/types/components/image.d.ts +20 -0
  93. package/dist/types/components/image.js +1 -0
  94. package/dist/types/components/package.d.ts +2 -1
  95. package/dist/types/components/purchase-button.d.ts +2 -1
  96. package/dist/types/components/stack.d.ts +32 -0
  97. package/dist/types/components/stack.js +1 -0
  98. package/dist/types/components/text.d.ts +20 -0
  99. package/dist/types/components/text.js +1 -0
  100. package/dist/types/components/timeline.d.ts +35 -0
  101. package/dist/types/components/timeline.js +1 -0
  102. package/dist/types/localization.d.ts +2 -1
  103. package/dist/types/media.d.ts +4 -3
  104. package/dist/types/overrides.d.ts +48 -0
  105. package/dist/types/overrides.js +1 -0
  106. package/dist/types/paywall.d.ts +27 -0
  107. package/dist/types/paywall.js +1 -0
  108. package/dist/types/ui-config.d.ts +20 -0
  109. package/dist/types/ui-config.js +1 -0
  110. package/dist/types/variables.d.ts +13 -0
  111. package/dist/types/variables.js +10 -0
  112. package/dist/types.d.ts +17 -9
  113. package/dist/ui/atoms/typography.stories.svelte +1 -27
  114. package/dist/ui/molecules/button.stories.svelte +3 -8
  115. package/dist/ui/theme/colors.d.ts +0 -6
  116. package/dist/ui/theme/colors.js +1 -1
  117. package/dist/ui/theme/text.d.ts +3 -4
  118. package/dist/ui/theme/utils.d.ts +0 -10
  119. package/dist/ui/theme/utils.js +5 -5
  120. package/dist/utils/background-utils.d.ts +4 -0
  121. package/dist/utils/background-utils.js +39 -0
  122. package/dist/utils/base-utils.d.ts +18 -0
  123. package/dist/utils/base-utils.js +124 -0
  124. package/dist/utils/constants.d.ts +2 -2
  125. package/dist/utils/constants.js +6 -1
  126. package/dist/utils/font-utils.d.ts +4 -0
  127. package/dist/utils/font-utils.js +47 -0
  128. package/dist/utils/style-utils.d.ts +7 -120
  129. package/dist/utils/style-utils.js +29 -304
  130. package/dist/utils/variable-utils.d.ts +1 -22
  131. package/dist/utils/variable-utils.js +28 -24
  132. package/dist/web-components/index.css +1 -1
  133. package/dist/web-components/index.js +1435 -980
  134. package/package.json +36 -26
  135. package/dist/components/button/button-utils.d.ts +0 -2
  136. package/dist/components/button/button-utils.js +0 -19
  137. package/dist/components/image/image-utils.d.ts +0 -19
  138. package/dist/components/image/image-utils.js +0 -33
  139. package/dist/components/purchase-button/purchase-button-utils.d.ts +0 -2
  140. package/dist/components/purchase-button/purchase-button-utils.js +0 -20
  141. package/dist/data/entities.d.ts +0 -162
  142. package/dist/stories/meta-templates.d.ts +0 -12
  143. package/dist/stories/meta-templates.js +0 -155
  144. /package/dist/{data/entities.js → types/base.js} +0 -0
@@ -1,974 +1,1430 @@
1
- var Le = Object.defineProperty;
2
- var Ae = (t, e, n) => e in t ? Le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var qt = (t, e, n) => Ae(t, typeof e != "symbol" ? e + "" : e, n);
4
- typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add("5");
5
- const Ne = 1, Re = 2, Be = 4, Pe = 8, Me = 16, E = Symbol(), ze = !1;
6
- var Ce = Array.isArray, st = Object.getOwnPropertyDescriptor, je = Object.getOwnPropertyDescriptors, $e = Object.prototype, He = Array.prototype, ne = Object.getPrototypeOf;
7
- const Ot = () => {
8
- }, N = 2, re = 4, Dt = 8, Lt = 16, R = 32, pt = 64, kt = 128, K = 256, ct = 512, F = 1024, V = 2048, bt = 4096, Y = 8192, Z = 16384, Ve = 32768, mt = 65536, Ue = 1 << 17, qe = 1 << 19, ie = 1 << 20, ot = Symbol("$state"), We = Symbol("legacy props"), Xe = Symbol("");
9
- function le(t) {
10
- return t === this.v;
11
- }
12
- function Ye(t, e) {
13
- return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function";
14
- }
15
- function At(t) {
16
- return !Ye(t, this.v);
17
- }
18
- function Ge() {
1
+ typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
2
+ const en = 1, tn = 2, nn = 4, rn = 8, an = 16, y = Symbol(), sn = "http://www.w3.org/1999/xhtml", pt = !1;
3
+ var ln = Array.isArray, on = Array.prototype.indexOf, tt = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, vt = Object.getOwnPropertyDescriptors, fn = Object.prototype, un = Array.prototype, We = Object.getPrototypeOf;
4
+ const Oe = () => {
5
+ };
6
+ function cn(e) {
7
+ for (var t = 0; t < e.length; t++)
8
+ e[t]();
9
+ }
10
+ function gt() {
11
+ var e, t, n = new Promise((r, i) => {
12
+ e = r, t = i;
13
+ });
14
+ return { promise: n, resolve: e, reject: t };
15
+ }
16
+ const T = 2, ht = 4, bt = 8, ne = 16, G = 32, ue = 64, mt = 128, R = 256, xe = 512, E = 1024, I = 2048, K = 4096, X = 8192, re = 16384, yt = 32768, Le = 65536, nt = 1 << 17, dn = 1 << 18, De = 1 << 19, _n = 1 << 20, Be = 1 << 21, Ne = 1 << 22, Q = 1 << 23, le = Symbol("$state"), pn = Symbol("legacy props"), vn = Symbol(""), pe = new class extends Error {
17
+ name = "StaleReactionError";
18
+ message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
19
+ }();
20
+ function gn() {
21
+ throw new Error("https://svelte.dev/e/async_derived_orphan");
22
+ }
23
+ function hn() {
19
24
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
20
25
  }
21
- function Ke(t) {
26
+ function bn(e) {
22
27
  throw new Error("https://svelte.dev/e/props_invalid_value");
23
28
  }
24
- function Ze() {
29
+ function mn() {
25
30
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
26
31
  }
27
- function Je() {
32
+ function yn() {
28
33
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
29
34
  }
30
- function Qe() {
31
- throw new Error("https://svelte.dev/e/state_unsafe_local_read");
32
- }
33
- function tn() {
35
+ function Sn() {
34
36
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
35
37
  }
36
- let it = !1;
37
- function en() {
38
- it = !0;
38
+ function St(e) {
39
+ return e === this.v;
40
+ }
41
+ function wn(e, t) {
42
+ return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
43
+ }
44
+ function En(e) {
45
+ return !wn(e, this.v);
46
+ }
47
+ let Re = !1, xn = !1;
48
+ function kn() {
49
+ Re = !0;
50
+ }
51
+ let C = null;
52
+ function ke(e) {
53
+ C = e;
54
+ }
55
+ function Tn(e, t = !1, n) {
56
+ C = {
57
+ p: C,
58
+ c: null,
59
+ e: null,
60
+ s: e,
61
+ x: null,
62
+ l: Re && !t ? { s: null, u: null, $: [] } : null
63
+ };
64
+ }
65
+ function An(e) {
66
+ var t = (
67
+ /** @type {ComponentContext} */
68
+ C
69
+ ), n = t.e;
70
+ if (n !== null) {
71
+ t.e = null;
72
+ for (var r of n)
73
+ Vn(r);
74
+ }
75
+ return C = t.p, /** @type {T} */
76
+ {};
77
+ }
78
+ function me() {
79
+ return !Re || C !== null && C.l === null;
80
+ }
81
+ let ae = [];
82
+ function Fn() {
83
+ var e = ae;
84
+ ae = [], cn(e);
85
+ }
86
+ function In(e) {
87
+ if (ae.length === 0) {
88
+ var t = ae;
89
+ queueMicrotask(() => {
90
+ t === ae && Fn();
91
+ });
92
+ }
93
+ ae.push(e);
94
+ }
95
+ const On = /* @__PURE__ */ new WeakMap();
96
+ function Ln(e) {
97
+ var t = g;
98
+ if (t === null)
99
+ return v.f |= Q, e;
100
+ if ((t.f & yt) === 0) {
101
+ if ((t.f & mt) === 0)
102
+ throw !t.parent && e instanceof Error && wt(e), e;
103
+ t.b.error(e);
104
+ } else
105
+ Te(e, t);
106
+ }
107
+ function Te(e, t) {
108
+ for (; t !== null; ) {
109
+ if ((t.f & mt) !== 0)
110
+ try {
111
+ t.b.error(e);
112
+ return;
113
+ } catch (n) {
114
+ e = n;
115
+ }
116
+ t = t.parent;
117
+ }
118
+ throw e instanceof Error && wt(e), e;
119
+ }
120
+ function wt(e) {
121
+ const t = On.get(e);
122
+ t && (tt(e, "message", {
123
+ value: t.message
124
+ }), tt(e, "stack", {
125
+ value: t.stack
126
+ }));
127
+ }
128
+ const Se = /* @__PURE__ */ new Set();
129
+ let S = null, rt = /* @__PURE__ */ new Set(), V = [], qe = null, ze = !1;
130
+ class J {
131
+ /**
132
+ * The current values of any sources that are updated in this batch
133
+ * They keys of this map are identical to `this.#previous`
134
+ * @type {Map<Source, any>}
135
+ */
136
+ current = /* @__PURE__ */ new Map();
137
+ /**
138
+ * The values of any sources that are updated in this batch _before_ those updates took place.
139
+ * They keys of this map are identical to `this.#current`
140
+ * @type {Map<Source, any>}
141
+ */
142
+ #n = /* @__PURE__ */ new Map();
143
+ /**
144
+ * When the batch is committed (and the DOM is updated), we need to remove old branches
145
+ * and append new ones by calling the functions added inside (if/each/key/etc) blocks
146
+ * @type {Set<() => void>}
147
+ */
148
+ #r = /* @__PURE__ */ new Set();
149
+ /**
150
+ * The number of async effects that are currently in flight
151
+ */
152
+ #e = 0;
153
+ /**
154
+ * A deferred that resolves when the batch is committed, used with `settled()`
155
+ * TODO replace with Promise.withResolvers once supported widely enough
156
+ * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
157
+ */
158
+ #o = null;
159
+ /**
160
+ * Async effects inside a newly-created `<svelte:boundary>`
161
+ * — these do not prevent the batch from committing
162
+ * @type {Effect[]}
163
+ */
164
+ #i = [];
165
+ /**
166
+ * Template effects and `$effect.pre` effects, which run when
167
+ * a batch is committed
168
+ * @type {Effect[]}
169
+ */
170
+ #a = [];
171
+ /**
172
+ * The same as `#render_effects`, but for `$effect` (which runs after)
173
+ * @type {Effect[]}
174
+ */
175
+ #t = [];
176
+ /**
177
+ * Block effects, which may need to re-run on subsequent flushes
178
+ * in order to update internal sources (e.g. each block items)
179
+ * @type {Effect[]}
180
+ */
181
+ #s = [];
182
+ /**
183
+ * Deferred effects (which run after async work has completed) that are DIRTY
184
+ * @type {Effect[]}
185
+ */
186
+ #f = [];
187
+ /**
188
+ * Deferred effects that are MAYBE_DIRTY
189
+ * @type {Effect[]}
190
+ */
191
+ #u = [];
192
+ /**
193
+ * A set of branches that still exist, but will be destroyed when this batch
194
+ * is committed — we skip over these during `process`
195
+ * @type {Set<Effect>}
196
+ */
197
+ skipped_effects = /* @__PURE__ */ new Set();
198
+ /**
199
+ *
200
+ * @param {Effect[]} root_effects
201
+ */
202
+ process(t) {
203
+ V = [];
204
+ var n = J.apply(this);
205
+ for (const a of t)
206
+ this.#c(a);
207
+ if (this.#e === 0) {
208
+ this.#d();
209
+ var r = this.#a, i = this.#t;
210
+ this.#a = [], this.#t = [], this.#s = [], S = null, it(r), it(i), this.#o?.resolve();
211
+ } else
212
+ this.#l(this.#a), this.#l(this.#t), this.#l(this.#s);
213
+ n();
214
+ for (const a of this.#i)
215
+ he(a);
216
+ this.#i = [];
217
+ }
218
+ /**
219
+ * Traverse the effect tree, executing effects or stashing
220
+ * them for later execution as appropriate
221
+ * @param {Effect} root
222
+ */
223
+ #c(t) {
224
+ t.f ^= E;
225
+ for (var n = t.first; n !== null; ) {
226
+ var r = n.f, i = (r & (G | ue)) !== 0, a = i && (r & E) !== 0, s = a || (r & X) !== 0 || this.skipped_effects.has(n);
227
+ if (!s && n.fn !== null) {
228
+ i ? n.f ^= E : (r & ht) !== 0 ? this.#t.push(n) : (r & E) === 0 && ((r & Ne) !== 0 && n.b?.is_pending() ? this.#i.push(n) : Pe(n) && ((n.f & ne) !== 0 && this.#s.push(n), he(n)));
229
+ var o = n.first;
230
+ if (o !== null) {
231
+ n = o;
232
+ continue;
233
+ }
234
+ }
235
+ var l = n.parent;
236
+ for (n = n.next; n === null && l !== null; )
237
+ n = l.next, l = l.parent;
238
+ }
239
+ }
240
+ /**
241
+ * @param {Effect[]} effects
242
+ */
243
+ #l(t) {
244
+ for (const n of t)
245
+ ((n.f & I) !== 0 ? this.#f : this.#u).push(n), k(n, E);
246
+ t.length = 0;
247
+ }
248
+ /**
249
+ * Associate a change to a given source with the current
250
+ * batch, noting its previous and current values
251
+ * @param {Source} source
252
+ * @param {any} value
253
+ */
254
+ capture(t, n) {
255
+ this.#n.has(t) || this.#n.set(t, n), this.current.set(t, t.v);
256
+ }
257
+ activate() {
258
+ S = this;
259
+ }
260
+ deactivate() {
261
+ S = null;
262
+ for (const t of rt)
263
+ if (rt.delete(t), t(), S !== null)
264
+ break;
265
+ }
266
+ flush() {
267
+ if (V.length > 0) {
268
+ if (this.activate(), Dn(), S !== null && S !== this)
269
+ return;
270
+ } else this.#e === 0 && this.#d();
271
+ this.deactivate();
272
+ }
273
+ /**
274
+ * Append and remove branches to/from the DOM
275
+ */
276
+ #d() {
277
+ for (const t of this.#r)
278
+ t();
279
+ if (this.#r.clear(), Se.size > 1) {
280
+ this.#n.clear();
281
+ let t = !0;
282
+ for (const n of Se) {
283
+ if (n === this) {
284
+ t = !1;
285
+ continue;
286
+ }
287
+ for (const [r, i] of this.current) {
288
+ if (n.current.has(r))
289
+ if (t)
290
+ n.current.set(r, i);
291
+ else
292
+ continue;
293
+ Et(r);
294
+ }
295
+ if (V.length > 0) {
296
+ S = n;
297
+ const r = J.apply(n);
298
+ for (const i of V)
299
+ n.#c(i);
300
+ V = [], r();
301
+ }
302
+ }
303
+ S = null;
304
+ }
305
+ Se.delete(this);
306
+ }
307
+ increment() {
308
+ this.#e += 1;
309
+ }
310
+ decrement() {
311
+ if (this.#e -= 1, this.#e === 0) {
312
+ for (const t of this.#f)
313
+ k(t, I), te(t);
314
+ for (const t of this.#u)
315
+ k(t, K), te(t);
316
+ this.flush();
317
+ } else
318
+ this.deactivate();
319
+ }
320
+ /** @param {() => void} fn */
321
+ add_callback(t) {
322
+ this.#r.add(t);
323
+ }
324
+ settled() {
325
+ return (this.#o ??= gt()).promise;
326
+ }
327
+ static ensure() {
328
+ if (S === null) {
329
+ const t = S = new J();
330
+ Se.add(S), J.enqueue(() => {
331
+ S === t && t.flush();
332
+ });
333
+ }
334
+ return S;
335
+ }
336
+ /** @param {() => void} task */
337
+ static enqueue(t) {
338
+ In(t);
339
+ }
340
+ /**
341
+ * @param {Batch} current_batch
342
+ */
343
+ static apply(t) {
344
+ return Oe;
345
+ }
346
+ }
347
+ function Dn() {
348
+ var e = oe;
349
+ ze = !0;
350
+ try {
351
+ var t = 0;
352
+ for (at(!0); V.length > 0; ) {
353
+ var n = J.ensure();
354
+ if (t++ > 1e3) {
355
+ var r, i;
356
+ Nn();
357
+ }
358
+ n.process(V), q.clear();
359
+ }
360
+ } finally {
361
+ ze = !1, at(e), qe = null;
362
+ }
363
+ }
364
+ function Nn() {
365
+ try {
366
+ hn();
367
+ } catch (e) {
368
+ Te(e, qe);
369
+ }
370
+ }
371
+ let Z = null;
372
+ function it(e) {
373
+ var t = e.length;
374
+ if (t !== 0) {
375
+ for (var n = 0; n < t; ) {
376
+ var r = e[n++];
377
+ if ((r.f & (re | X)) === 0 && Pe(r) && (Z = [], he(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null && r.ac === null ? Mt(r) : r.fn = null), Z?.length > 0)) {
378
+ q.clear();
379
+ for (const i of Z)
380
+ he(i);
381
+ Z = [];
382
+ }
383
+ }
384
+ Z = null;
385
+ }
386
+ }
387
+ function Et(e) {
388
+ if (e.reactions !== null)
389
+ for (const t of e.reactions) {
390
+ const n = t.f;
391
+ (n & T) !== 0 ? Et(
392
+ /** @type {Derived} */
393
+ t
394
+ ) : (n & (Ne | ne)) !== 0 && (k(t, I), te(
395
+ /** @type {Effect} */
396
+ t
397
+ ));
398
+ }
399
+ }
400
+ function te(e) {
401
+ for (var t = qe = e; t.parent !== null; ) {
402
+ t = t.parent;
403
+ var n = t.f;
404
+ if (ze && t === g && (n & ne) !== 0)
405
+ return;
406
+ if ((n & (ue | G)) !== 0) {
407
+ if ((n & E) === 0) return;
408
+ t.f ^= E;
409
+ }
410
+ }
411
+ V.push(t);
412
+ }
413
+ function Rn(e, t, n) {
414
+ const r = me() ? Ce : kt;
415
+ if (t.length === 0) {
416
+ n(e.map(r));
417
+ return;
418
+ }
419
+ var i = S, a = (
420
+ /** @type {Effect} */
421
+ g
422
+ ), s = Cn();
423
+ Promise.all(t.map((o) => /* @__PURE__ */ Pn(o))).then((o) => {
424
+ i?.activate(), s();
425
+ try {
426
+ n([...e.map(r), ...o]);
427
+ } catch (l) {
428
+ (a.f & re) === 0 && Te(l, a);
429
+ }
430
+ i?.deactivate(), xt();
431
+ }).catch((o) => {
432
+ Te(o, a);
433
+ });
434
+ }
435
+ function Cn() {
436
+ var e = g, t = v, n = C, r = S;
437
+ return function() {
438
+ fe(e), Y(t), ke(n), r?.activate();
439
+ };
440
+ }
441
+ function xt() {
442
+ fe(null), Y(null), ke(null);
443
+ }
444
+ // @__NO_SIDE_EFFECTS__
445
+ function Ce(e) {
446
+ var t = T | I, n = v !== null && (v.f & T) !== 0 ? (
447
+ /** @type {Derived} */
448
+ v
449
+ ) : null;
450
+ return g === null || n !== null && (n.f & R) !== 0 ? t |= R : g.f |= De, {
451
+ ctx: C,
452
+ deps: null,
453
+ effects: null,
454
+ equals: St,
455
+ f: t,
456
+ fn: e,
457
+ reactions: null,
458
+ rv: 0,
459
+ v: (
460
+ /** @type {V} */
461
+ y
462
+ ),
463
+ wv: 0,
464
+ parent: n ?? g,
465
+ ac: null
466
+ };
467
+ }
468
+ // @__NO_SIDE_EFFECTS__
469
+ function Pn(e, t) {
470
+ let n = (
471
+ /** @type {Effect | null} */
472
+ g
473
+ );
474
+ n === null && gn();
475
+ var r = (
476
+ /** @type {Boundary} */
477
+ n.b
478
+ ), i = (
479
+ /** @type {Promise<V>} */
480
+ /** @type {unknown} */
481
+ void 0
482
+ ), a = Ft(
483
+ /** @type {V} */
484
+ y
485
+ ), s = !v, o = /* @__PURE__ */ new Map();
486
+ return Wn(() => {
487
+ var l = gt();
488
+ i = l.promise;
489
+ try {
490
+ Promise.resolve(e()).then(l.resolve, l.reject);
491
+ } catch (p) {
492
+ l.reject(p);
493
+ }
494
+ var f = (
495
+ /** @type {Batch} */
496
+ S
497
+ ), u = r.is_pending();
498
+ s && (r.update_pending_count(1), u || (f.increment(), o.get(f)?.reject(pe), o.set(f, l)));
499
+ const c = (p, _ = void 0) => {
500
+ u || f.activate(), _ ? _ !== pe && (a.f |= Q, $e(a, _)) : ((a.f & Q) !== 0 && (a.f ^= Q), $e(a, p)), s && (r.update_pending_count(-1), u || f.decrement()), xt();
501
+ };
502
+ l.promise.then(c, (p) => c(null, p || "unknown"));
503
+ }), Un(() => {
504
+ for (const l of o.values())
505
+ l.reject(pe);
506
+ }), new Promise((l) => {
507
+ function f(u) {
508
+ function c() {
509
+ u === i ? l(a) : f(i);
510
+ }
511
+ u.then(c, c);
512
+ }
513
+ f(i);
514
+ });
515
+ }
516
+ // @__NO_SIDE_EFFECTS__
517
+ function ie(e) {
518
+ const t = /* @__PURE__ */ Ce(e);
519
+ return zt(t), t;
520
+ }
521
+ // @__NO_SIDE_EFFECTS__
522
+ function kt(e) {
523
+ const t = /* @__PURE__ */ Ce(e);
524
+ return t.equals = En, t;
525
+ }
526
+ function Tt(e) {
527
+ var t = e.effects;
528
+ if (t !== null) {
529
+ e.effects = null;
530
+ for (var n = 0; n < t.length; n += 1)
531
+ de(
532
+ /** @type {Effect} */
533
+ t[n]
534
+ );
535
+ }
536
+ }
537
+ function Mn(e) {
538
+ for (var t = e.parent; t !== null; ) {
539
+ if ((t.f & T) === 0)
540
+ return (
541
+ /** @type {Effect} */
542
+ t
543
+ );
544
+ t = t.parent;
545
+ }
546
+ return null;
547
+ }
548
+ function Xe(e) {
549
+ var t, n = g;
550
+ fe(Mn(e));
551
+ try {
552
+ Tt(e), t = Vt(e);
553
+ } finally {
554
+ fe(n);
555
+ }
556
+ return t;
557
+ }
558
+ function At(e) {
559
+ var t = Xe(e);
560
+ if (e.equals(t) || (e.v = t, e.wv = Ht()), !_e) {
561
+ var n = (W || (e.f & R) !== 0) && e.deps !== null ? K : E;
562
+ k(e, n);
563
+ }
39
564
  }
40
- function A(t, e) {
565
+ const q = /* @__PURE__ */ new Map();
566
+ function Ft(e, t) {
41
567
  var n = {
42
568
  f: 0,
43
569
  // TODO ideally we could skip this altogether, but it causes type errors
44
- v: t,
570
+ v: e,
45
571
  reactions: null,
46
- equals: le,
47
- version: 0
572
+ equals: St,
573
+ rv: 0,
574
+ wv: 0
48
575
  };
49
576
  return n;
50
577
  }
51
578
  // @__NO_SIDE_EFFECTS__
52
- function nn(t, e = !1) {
53
- var r;
54
- const n = A(t);
55
- return e || (n.equals = At), it && x !== null && x.l !== null && ((r = x.l).s ?? (r.s = [])).push(n), n;
56
- }
57
- function B(t, e) {
58
- return h !== null && zt() && (h.f & (N | Lt)) !== 0 && // If the source was created locally within the current derived, then
59
- // we allow the mutation.
60
- (H === null || !H.includes(t)) && tn(), rn(t, e);
579
+ function H(e, t) {
580
+ const n = Ft(e);
581
+ return zt(n), n;
582
+ }
583
+ function U(e, t, n = !1) {
584
+ v !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
585
+ // to ensure we error if state is set inside an inspect effect
586
+ (!z || (v.f & nt) !== 0) && me() && (v.f & (T | ne | Ne | nt)) !== 0 && !$?.includes(e) && Sn();
587
+ let r = n ? se(t) : t;
588
+ return $e(e, r);
589
+ }
590
+ function $e(e, t) {
591
+ if (!e.equals(t)) {
592
+ var n = e.v;
593
+ _e ? q.set(e, t) : q.set(e, n), e.v = t;
594
+ var r = J.ensure();
595
+ r.capture(e, n), (e.f & T) !== 0 && ((e.f & I) !== 0 && Xe(
596
+ /** @type {Derived} */
597
+ e
598
+ ), k(e, (e.f & R) === 0 ? E : K)), e.wv = Ht(), It(e, I), me() && g !== null && (g.f & E) !== 0 && (g.f & (G | ue)) === 0 && (L === null ? Zn([e]) : L.push(e));
599
+ }
600
+ return t;
61
601
  }
62
- function rn(t, e) {
63
- return t.equals(e) || (t.v = e, t.version = me(), ae(t, V), zt() && v !== null && (v.f & F) !== 0 && (v.f & R) === 0 && (S !== null && S.includes(t) ? (M(v, V), xt(v)) : j === null ? hn([t]) : j.push(t))), e;
602
+ function Me(e) {
603
+ U(e, e.v + 1);
64
604
  }
65
- function ae(t, e) {
66
- var n = t.reactions;
605
+ function It(e, t) {
606
+ var n = e.reactions;
67
607
  if (n !== null)
68
- for (var r = zt(), i = n.length, l = 0; l < i; l++) {
69
- var a = n[l], _ = a.f;
70
- (_ & V) === 0 && (!r && a === v || (M(a, e), (_ & (F | K)) !== 0 && ((_ & N) !== 0 ? ae(
71
- /** @type {Derived} */
72
- a,
73
- bt
74
- ) : xt(
75
- /** @type {Effect} */
76
- a
77
- ))));
608
+ for (var r = me(), i = n.length, a = 0; a < i; a++) {
609
+ var s = n[a], o = s.f;
610
+ if (!(!r && s === g)) {
611
+ var l = (o & I) === 0;
612
+ l && k(s, t), (o & T) !== 0 ? It(
613
+ /** @type {Derived} */
614
+ s,
615
+ K
616
+ ) : l && ((o & ne) !== 0 && Z !== null && Z.push(
617
+ /** @type {Effect} */
618
+ s
619
+ ), te(
620
+ /** @type {Effect} */
621
+ s
622
+ ));
623
+ }
78
624
  }
79
625
  }
80
- let ln = !1;
81
- function W(t, e = null, n) {
82
- if (typeof t != "object" || t === null || ot in t)
83
- return t;
84
- const r = ne(t);
85
- if (r !== $e && r !== He)
86
- return t;
87
- var i = /* @__PURE__ */ new Map(), l = Ce(t), a = A(0);
88
- l && i.set("length", A(
626
+ function se(e) {
627
+ if (typeof e != "object" || e === null || le in e)
628
+ return e;
629
+ const t = We(e);
630
+ if (t !== fn && t !== un)
631
+ return e;
632
+ var n = /* @__PURE__ */ new Map(), r = ln(e), i = /* @__PURE__ */ H(0), a = ee, s = (o) => {
633
+ if (ee === a)
634
+ return o();
635
+ var l = v, f = ee;
636
+ Y(null), lt(a);
637
+ var u = o();
638
+ return Y(l), lt(f), u;
639
+ };
640
+ return r && n.set("length", /* @__PURE__ */ H(
89
641
  /** @type {any[]} */
90
- t.length
91
- ));
92
- var _;
93
- return new Proxy(
642
+ e.length
643
+ )), new Proxy(
94
644
  /** @type {any} */
95
- t,
645
+ e,
96
646
  {
97
- defineProperty(f, s, u) {
98
- (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Ze();
99
- var o = i.get(s);
100
- return o === void 0 ? (o = A(u.value), i.set(s, o)) : B(o, W(u.value, _)), !0;
647
+ defineProperty(o, l, f) {
648
+ (!("value" in f) || f.configurable === !1 || f.enumerable === !1 || f.writable === !1) && mn();
649
+ var u = n.get(l);
650
+ return u === void 0 ? u = s(() => {
651
+ var c = /* @__PURE__ */ H(f.value);
652
+ return n.set(l, c), c;
653
+ }) : U(u, f.value, !0), !0;
101
654
  },
102
- deleteProperty(f, s) {
103
- var u = i.get(s);
104
- if (u === void 0)
105
- s in f && i.set(s, A(E));
106
- else {
107
- if (l && typeof s == "string") {
108
- var o = (
109
- /** @type {Source<number>} */
110
- i.get("length")
111
- ), c = Number(s);
112
- Number.isInteger(c) && c < o.v && B(o, c);
655
+ deleteProperty(o, l) {
656
+ var f = n.get(l);
657
+ if (f === void 0) {
658
+ if (l in o) {
659
+ const u = s(() => /* @__PURE__ */ H(y));
660
+ n.set(l, u), Me(i);
113
661
  }
114
- B(u, E), Wt(a);
115
- }
662
+ } else
663
+ U(f, y), Me(i);
116
664
  return !0;
117
665
  },
118
- get(f, s, u) {
119
- var w;
120
- if (s === ot)
121
- return t;
122
- var o = i.get(s), c = s in f;
123
- if (o === void 0 && (!c || (w = st(f, s)) != null && w.writable) && (o = A(W(c ? f[s] : E, _)), i.set(s, o)), o !== void 0) {
124
- var g = p(o);
125
- return g === E ? void 0 : g;
666
+ get(o, l, f) {
667
+ if (l === le)
668
+ return e;
669
+ var u = n.get(l), c = l in o;
670
+ if (u === void 0 && (!c || Ee(o, l)?.writable) && (u = s(() => {
671
+ var _ = se(c ? o[l] : y), d = /* @__PURE__ */ H(_);
672
+ return d;
673
+ }), n.set(l, u)), u !== void 0) {
674
+ var p = w(u);
675
+ return p === y ? void 0 : p;
126
676
  }
127
- return Reflect.get(f, s, u);
677
+ return Reflect.get(o, l, f);
128
678
  },
129
- getOwnPropertyDescriptor(f, s) {
130
- var u = Reflect.getOwnPropertyDescriptor(f, s);
131
- if (u && "value" in u) {
132
- var o = i.get(s);
133
- o && (u.value = p(o));
134
- } else if (u === void 0) {
135
- var c = i.get(s), g = c == null ? void 0 : c.v;
136
- if (c !== void 0 && g !== E)
679
+ getOwnPropertyDescriptor(o, l) {
680
+ var f = Reflect.getOwnPropertyDescriptor(o, l);
681
+ if (f && "value" in f) {
682
+ var u = n.get(l);
683
+ u && (f.value = w(u));
684
+ } else if (f === void 0) {
685
+ var c = n.get(l), p = c?.v;
686
+ if (c !== void 0 && p !== y)
137
687
  return {
138
688
  enumerable: !0,
139
689
  configurable: !0,
140
- value: g,
690
+ value: p,
141
691
  writable: !0
142
692
  };
143
693
  }
144
- return u;
694
+ return f;
145
695
  },
146
- has(f, s) {
147
- var g;
148
- if (s === ot)
696
+ has(o, l) {
697
+ if (l === le)
149
698
  return !0;
150
- var u = i.get(s), o = u !== void 0 && u.v !== E || Reflect.has(f, s);
151
- if (u !== void 0 || v !== null && (!o || (g = st(f, s)) != null && g.writable)) {
152
- u === void 0 && (u = A(o ? W(f[s], _) : E), i.set(s, u));
153
- var c = p(u);
154
- if (c === E)
699
+ var f = n.get(l), u = f !== void 0 && f.v !== y || Reflect.has(o, l);
700
+ if (f !== void 0 || g !== null && (!u || Ee(o, l)?.writable)) {
701
+ f === void 0 && (f = s(() => {
702
+ var p = u ? se(o[l]) : y, _ = /* @__PURE__ */ H(p);
703
+ return _;
704
+ }), n.set(l, f));
705
+ var c = w(f);
706
+ if (c === y)
155
707
  return !1;
156
708
  }
157
- return o;
709
+ return u;
158
710
  },
159
- set(f, s, u, o) {
160
- var C;
161
- var c = i.get(s), g = s in f;
162
- if (l && s === "length")
163
- for (var w = u; w < /** @type {Source<number>} */
164
- c.v; w += 1) {
165
- var m = i.get(w + "");
166
- m !== void 0 ? B(m, E) : w in f && (m = A(E), i.set(w + "", m));
711
+ set(o, l, f, u) {
712
+ var c = n.get(l), p = l in o;
713
+ if (r && l === "length")
714
+ for (var _ = f; _ < /** @type {Source<number>} */
715
+ c.v; _ += 1) {
716
+ var d = n.get(_ + "");
717
+ d !== void 0 ? U(d, y) : _ in o && (d = s(() => /* @__PURE__ */ H(y)), n.set(_ + "", d));
167
718
  }
168
- c === void 0 ? (!g || (C = st(f, s)) != null && C.writable) && (c = A(void 0), B(c, W(u, _)), i.set(s, c)) : (g = c.v !== E, B(c, W(u, _)));
169
- var y = Reflect.getOwnPropertyDescriptor(f, s);
170
- if (y != null && y.set && y.set.call(o, u), !g) {
171
- if (l && typeof s == "string") {
172
- var U = (
719
+ if (c === void 0)
720
+ (!p || Ee(o, l)?.writable) && (c = s(() => /* @__PURE__ */ H(void 0)), U(c, se(f)), n.set(l, c));
721
+ else {
722
+ p = c.v !== y;
723
+ var m = s(() => se(f));
724
+ U(c, m);
725
+ }
726
+ var O = Reflect.getOwnPropertyDescriptor(o, l);
727
+ if (O?.set && O.set.call(u, f), !p) {
728
+ if (r && typeof l == "string") {
729
+ var A = (
173
730
  /** @type {Source<number>} */
174
- i.get("length")
175
- ), z = Number(s);
176
- Number.isInteger(z) && z >= U.v && B(U, z + 1);
731
+ n.get("length")
732
+ ), N = Number(l);
733
+ Number.isInteger(N) && N >= A.v && U(A, N + 1);
177
734
  }
178
- Wt(a);
735
+ Me(i);
179
736
  }
180
737
  return !0;
181
738
  },
182
- ownKeys(f) {
183
- p(a);
184
- var s = Reflect.ownKeys(f).filter((c) => {
185
- var g = i.get(c);
186
- return g === void 0 || g.v !== E;
739
+ ownKeys(o) {
740
+ w(i);
741
+ var l = Reflect.ownKeys(o).filter((c) => {
742
+ var p = n.get(c);
743
+ return p === void 0 || p.v !== y;
187
744
  });
188
- for (var [u, o] of i)
189
- o.v !== E && !(u in f) && s.push(u);
190
- return s;
745
+ for (var [f, u] of n)
746
+ u.v !== y && !(f in o) && l.push(f);
747
+ return l;
191
748
  },
192
749
  setPrototypeOf() {
193
- Je();
750
+ yn();
194
751
  }
195
752
  }
196
753
  );
197
754
  }
198
- function Wt(t, e = 1) {
199
- B(t, t.v + e);
200
- }
201
- var an, sn;
202
- function on(t = "") {
203
- return document.createTextNode(t);
755
+ var jn, Bn;
756
+ function Ot(e = "") {
757
+ return document.createTextNode(e);
204
758
  }
205
759
  // @__NO_SIDE_EFFECTS__
206
- function Nt(t) {
207
- return an.call(t);
760
+ function Ye(e) {
761
+ return jn.call(e);
208
762
  }
209
763
  // @__NO_SIDE_EFFECTS__
210
- function se(t) {
211
- return sn.call(t);
764
+ function Lt(e) {
765
+ return Bn.call(e);
212
766
  }
213
- function oe(t, e) {
214
- return /* @__PURE__ */ Nt(t);
767
+ function Dt(e, t) {
768
+ return /* @__PURE__ */ Ye(e);
215
769
  }
216
- function un(t, e) {
770
+ function zn(e, t = !1) {
217
771
  {
218
772
  var n = (
219
773
  /** @type {DocumentFragment} */
220
- /* @__PURE__ */ Nt(
774
+ /* @__PURE__ */ Ye(
221
775
  /** @type {Node} */
222
- t
776
+ e
223
777
  )
224
778
  );
225
- return n instanceof Comment && n.data === "" ? /* @__PURE__ */ se(n) : n;
779
+ return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Lt(n) : n;
226
780
  }
227
781
  }
228
- // @__NO_SIDE_EFFECTS__
229
- function P(t) {
230
- var e = N | V;
231
- v === null ? e |= K : v.f |= ie;
232
- var n = h !== null && (h.f & N) !== 0 ? (
233
- /** @type {Derived} */
234
- h
235
- ) : null;
236
- const r = {
237
- children: null,
238
- ctx: x,
239
- deps: null,
240
- equals: le,
241
- f: e,
242
- fn: t,
243
- reactions: null,
244
- v: (
245
- /** @type {V} */
246
- null
247
- ),
248
- version: 0,
249
- parent: n ?? v
250
- };
251
- return n !== null && (n.children ?? (n.children = [])).push(r), r;
252
- }
253
- // @__NO_SIDE_EFFECTS__
254
- function fn(t) {
255
- const e = /* @__PURE__ */ P(t);
256
- return e.equals = At, e;
257
- }
258
- function ue(t) {
259
- var e = t.children;
260
- if (e !== null) {
261
- t.children = null;
262
- for (var n = 0; n < e.length; n += 1) {
263
- var r = e[n];
264
- (r.f & N) !== 0 ? Rt(
265
- /** @type {Derived} */
266
- r
267
- ) : J(
268
- /** @type {Effect} */
269
- r
270
- );
271
- }
272
- }
273
- }
274
- function cn(t) {
275
- for (var e = t.parent; e !== null; ) {
276
- if ((e.f & N) === 0)
277
- return (
278
- /** @type {Effect} */
279
- e
280
- );
281
- e = e.parent;
282
- }
283
- return null;
782
+ function $n() {
783
+ return !1;
284
784
  }
285
- function fe(t) {
286
- var e, n = v;
287
- G(cn(t));
785
+ function Nt(e) {
786
+ var t = v, n = g;
787
+ Y(null), fe(null);
288
788
  try {
289
- ue(t), e = ye(t);
789
+ return e();
290
790
  } finally {
291
- G(n);
791
+ Y(t), fe(n);
292
792
  }
293
- return e;
294
- }
295
- function ce(t) {
296
- var e = fe(t), n = ($ || (t.f & K) !== 0) && t.deps !== null ? bt : F;
297
- M(t, n), t.equals(e) || (t.v = e, t.version = me());
298
793
  }
299
- function Rt(t) {
300
- ue(t), nt(t, 0), M(t, Z), t.v = t.children = t.deps = t.ctx = t.reactions = null;
794
+ function Hn(e, t) {
795
+ var n = t.last;
796
+ n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
301
797
  }
302
- function _n(t, e) {
303
- var n = e.last;
304
- n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t);
305
- }
306
- function Bt(t, e, n, r = !0) {
307
- var i = (t & pt) !== 0, l = v, a = {
308
- ctx: x,
798
+ function ce(e, t, n, r = !0) {
799
+ var i = g;
800
+ i !== null && (i.f & X) !== 0 && (e |= X);
801
+ var a = {
802
+ ctx: C,
309
803
  deps: null,
310
- deriveds: null,
311
804
  nodes_start: null,
312
805
  nodes_end: null,
313
- f: t | V,
806
+ f: e | I,
314
807
  first: null,
315
- fn: e,
808
+ fn: t,
316
809
  last: null,
317
810
  next: null,
318
- parent: i ? null : l,
811
+ parent: i,
812
+ b: i && i.b,
319
813
  prev: null,
320
814
  teardown: null,
321
815
  transitions: null,
322
- version: 0
816
+ wv: 0,
817
+ ac: null
323
818
  };
324
- if (n) {
325
- var _ = X;
819
+ if (n)
326
820
  try {
327
- Gt(!0), St(a), a.f |= Ve;
328
- } catch (u) {
329
- throw J(a), u;
330
- } finally {
331
- Gt(_);
821
+ he(a), a.f |= yt;
822
+ } catch (l) {
823
+ throw de(a), l;
824
+ }
825
+ else t !== null && te(a);
826
+ if (r) {
827
+ var s = a;
828
+ if (n && s.deps === null && s.teardown === null && s.nodes_start === null && s.first === s.last && // either `null`, or a singular child
829
+ (s.f & De) === 0 && (s = s.first), s !== null && (s.parent = i, i !== null && Hn(s, i), v !== null && (v.f & T) !== 0 && (e & ue) === 0)) {
830
+ var o = (
831
+ /** @type {Derived} */
832
+ v
833
+ );
834
+ (o.effects ??= []).push(s);
332
835
  }
333
- } else e !== null && xt(a);
334
- var f = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & ie) === 0;
335
- if (!f && !i && r && (l !== null && _n(a, l), h !== null && (h.f & N) !== 0)) {
336
- var s = (
337
- /** @type {Derived} */
338
- h
339
- );
340
- (s.children ?? (s.children = [])).push(a);
341
836
  }
342
837
  return a;
343
838
  }
344
- function vn(t) {
345
- return Bt(re, t, !1);
839
+ function Un(e) {
840
+ const t = ce(bt, null, !1);
841
+ return k(t, E), t.teardown = e, t;
346
842
  }
347
- function Pt(t) {
348
- return Mt(t);
843
+ function Vn(e) {
844
+ return ce(ht | _n, e, !1);
349
845
  }
350
- function Mt(t, e = 0) {
351
- return Bt(Dt | Lt | e, t, !0);
846
+ function Wn(e) {
847
+ return ce(Ne | De, e, !0);
352
848
  }
353
- function Ft(t, e = !0) {
354
- return Bt(Dt | R, t, !0, e);
849
+ function Ge(e, t = [], n = []) {
850
+ Rn(t, n, (r) => {
851
+ ce(bt, () => e(...r.map(w)), !0);
852
+ });
853
+ }
854
+ function Rt(e, t = 0) {
855
+ var n = ce(ne | t, e, !0);
856
+ return n;
355
857
  }
356
- function _e(t) {
357
- var e = t.teardown;
358
- if (e !== null) {
359
- const n = h;
360
- gt(null);
858
+ function He(e, t = !0) {
859
+ return ce(G | De, e, !0, t);
860
+ }
861
+ function Ct(e) {
862
+ var t = e.teardown;
863
+ if (t !== null) {
864
+ const n = _e, r = v;
865
+ st(!0), Y(null);
361
866
  try {
362
- e.call(null);
867
+ t.call(null);
363
868
  } finally {
364
- gt(n);
869
+ st(n), Y(r);
365
870
  }
366
871
  }
367
872
  }
368
- function ve(t) {
369
- var e = t.deriveds;
370
- if (e !== null) {
371
- t.deriveds = null;
372
- for (var n = 0; n < e.length; n += 1)
373
- Rt(e[n]);
374
- }
375
- }
376
- function ge(t, e = !1) {
377
- var n = t.first;
378
- for (t.first = t.last = null; n !== null; ) {
873
+ function Pt(e, t = !1) {
874
+ var n = e.first;
875
+ for (e.first = e.last = null; n !== null; ) {
876
+ const i = n.ac;
877
+ i !== null && Nt(() => {
878
+ i.abort(pe);
879
+ });
379
880
  var r = n.next;
380
- J(n, e), n = r;
881
+ (n.f & ue) !== 0 ? n.parent = null : de(n, t), n = r;
381
882
  }
382
883
  }
383
- function gn(t) {
384
- for (var e = t.first; e !== null; ) {
385
- var n = e.next;
386
- (e.f & R) === 0 && J(e), e = n;
884
+ function qn(e) {
885
+ for (var t = e.first; t !== null; ) {
886
+ var n = t.next;
887
+ (t.f & G) === 0 && de(t), t = n;
387
888
  }
388
889
  }
389
- function J(t, e = !0) {
890
+ function de(e, t = !0) {
390
891
  var n = !1;
391
- if ((e || (t.f & qe) !== 0) && t.nodes_start !== null) {
392
- for (var r = t.nodes_start, i = t.nodes_end; r !== null; ) {
393
- var l = r === i ? null : (
394
- /** @type {TemplateNode} */
395
- /* @__PURE__ */ se(r)
396
- );
397
- r.remove(), r = l;
398
- }
399
- n = !0;
400
- }
401
- ge(t, e && !n), ve(t), nt(t, 0), M(t, Z);
402
- var a = t.transitions;
403
- if (a !== null)
404
- for (const f of a)
405
- f.stop();
406
- _e(t);
407
- var _ = t.parent;
408
- _ !== null && _.first !== null && de(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = null;
409
- }
410
- function de(t) {
411
- var e = t.parent, n = t.prev, r = t.next;
412
- n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n));
413
- }
414
- function Xt(t, e) {
892
+ (t || (e.f & dn) !== 0) && e.nodes_start !== null && e.nodes_end !== null && (Xn(
893
+ e.nodes_start,
894
+ /** @type {TemplateNode} */
895
+ e.nodes_end
896
+ ), n = !0), Pt(e, t && !n), Ae(e, 0), k(e, re);
897
+ var r = e.transitions;
898
+ if (r !== null)
899
+ for (const a of r)
900
+ a.stop();
901
+ Ct(e);
902
+ var i = e.parent;
903
+ i !== null && i.first !== null && Mt(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes_start = e.nodes_end = e.ac = null;
904
+ }
905
+ function Xn(e, t) {
906
+ for (; e !== null; ) {
907
+ var n = e === t ? null : (
908
+ /** @type {TemplateNode} */
909
+ /* @__PURE__ */ Lt(e)
910
+ );
911
+ e.remove(), e = n;
912
+ }
913
+ }
914
+ function Mt(e) {
915
+ var t = e.parent, n = e.prev, r = e.next;
916
+ n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
917
+ }
918
+ function Yn(e, t) {
415
919
  var n = [];
416
- he(t, n, !0), dn(n, () => {
417
- J(t), e && e();
920
+ jt(e, n, !0), Gn(n, () => {
921
+ de(e), t && t();
418
922
  });
419
923
  }
420
- function dn(t, e) {
421
- var n = t.length;
924
+ function Gn(e, t) {
925
+ var n = e.length;
422
926
  if (n > 0) {
423
- var r = () => --n || e();
424
- for (var i of t)
927
+ var r = () => --n || t();
928
+ for (var i of e)
425
929
  i.out(r);
426
930
  } else
427
- e();
428
- }
429
- function he(t, e, n) {
430
- if ((t.f & Y) === 0) {
431
- if (t.f ^= Y, t.transitions !== null)
432
- for (const a of t.transitions)
433
- (a.is_global || n) && e.push(a);
434
- for (var r = t.first; r !== null; ) {
435
- var i = r.next, l = (r.f & mt) !== 0 || (r.f & R) !== 0;
436
- he(r, e, l ? n : !1), r = i;
931
+ t();
932
+ }
933
+ function jt(e, t, n) {
934
+ if ((e.f & X) === 0) {
935
+ if (e.f ^= X, e.transitions !== null)
936
+ for (const s of e.transitions)
937
+ (s.is_global || n) && t.push(s);
938
+ for (var r = e.first; r !== null; ) {
939
+ var i = r.next, a = (r.f & Le) !== 0 || (r.f & G) !== 0;
940
+ jt(r, t, a ? n : !1), r = i;
437
941
  }
438
942
  }
439
943
  }
440
- function Yt(t) {
441
- pe(t, !0);
944
+ function Kn(e) {
945
+ Bt(e, !0);
442
946
  }
443
- function pe(t, e) {
444
- if ((t.f & Y) !== 0) {
445
- lt(t) && St(t), t.f ^= Y;
446
- for (var n = t.first; n !== null; ) {
447
- var r = n.next, i = (n.f & mt) !== 0 || (n.f & R) !== 0;
448
- pe(n, i ? e : !1), n = r;
947
+ function Bt(e, t) {
948
+ if ((e.f & X) !== 0) {
949
+ e.f ^= X, (e.f & E) === 0 && (k(e, I), te(e));
950
+ for (var n = e.first; n !== null; ) {
951
+ var r = n.next, i = (n.f & Le) !== 0 || (n.f & G) !== 0;
952
+ Bt(n, i ? t : !1), n = r;
449
953
  }
450
- if (t.transitions !== null)
451
- for (const l of t.transitions)
452
- (l.is_global || e) && l.in();
954
+ if (e.transitions !== null)
955
+ for (const a of e.transitions)
956
+ (a.is_global || t) && a.in();
453
957
  }
454
958
  }
455
- let ut = !1, _t = !1, vt = null, X = !1;
456
- function Gt(t) {
457
- X = t;
959
+ let oe = !1;
960
+ function at(e) {
961
+ oe = e;
458
962
  }
459
- let It = [], tt = 0;
460
- let h = null;
461
- function gt(t) {
462
- h = t;
963
+ let _e = !1;
964
+ function st(e) {
965
+ _e = e;
463
966
  }
464
- let v = null;
465
- function G(t) {
466
- v = t;
967
+ let v = null, z = !1;
968
+ function Y(e) {
969
+ v = e;
467
970
  }
468
- let H = null, S = null, T = 0, j = null;
469
- function hn(t) {
470
- j = t;
971
+ let g = null;
972
+ function fe(e) {
973
+ g = e;
471
974
  }
472
- let be = 1, $ = !1, x = null;
473
- function me() {
474
- return ++be;
975
+ let $ = null;
976
+ function zt(e) {
977
+ v !== null && ($ === null ? $ = [e] : $.push(e));
978
+ }
979
+ let x = null, F = 0, L = null;
980
+ function Zn(e) {
981
+ L = e;
475
982
  }
476
- function zt() {
477
- return !it || x !== null && x.l === null;
983
+ let $t = 1, ge = 0, ee = ge;
984
+ function lt(e) {
985
+ ee = e;
478
986
  }
479
- function lt(t) {
480
- var a, _;
481
- var e = t.f;
482
- if ((e & V) !== 0)
987
+ let W = !1;
988
+ function Ht() {
989
+ return ++$t;
990
+ }
991
+ function Pe(e) {
992
+ var t = e.f;
993
+ if ((t & I) !== 0)
483
994
  return !0;
484
- if ((e & bt) !== 0) {
485
- var n = t.deps, r = (e & K) !== 0;
995
+ if ((t & K) !== 0) {
996
+ var n = e.deps, r = (t & R) !== 0;
486
997
  if (n !== null) {
487
- var i;
488
- if ((e & ct) !== 0) {
489
- for (i = 0; i < n.length; i++)
490
- ((a = n[i]).reactions ?? (a.reactions = [])).push(t);
491
- t.f ^= ct;
998
+ var i, a, s = (t & xe) !== 0, o = r && g !== null && !W, l = n.length;
999
+ if ((s || o) && (g === null || (g.f & re) === 0)) {
1000
+ var f = (
1001
+ /** @type {Derived} */
1002
+ e
1003
+ ), u = f.parent;
1004
+ for (i = 0; i < l; i++)
1005
+ a = n[i], (s || !a?.reactions?.includes(f)) && (a.reactions ??= []).push(f);
1006
+ s && (f.f ^= xe), o && u !== null && (u.f & R) === 0 && (f.f ^= R);
492
1007
  }
493
- for (i = 0; i < n.length; i++) {
494
- var l = n[i];
495
- if (lt(
1008
+ for (i = 0; i < l; i++)
1009
+ if (a = n[i], Pe(
496
1010
  /** @type {Derived} */
497
- l
498
- ) && ce(
1011
+ a
1012
+ ) && At(
499
1013
  /** @type {Derived} */
500
- l
501
- ), r && v !== null && !$ && !((_ = l == null ? void 0 : l.reactions) != null && _.includes(t)) && (l.reactions ?? (l.reactions = [])).push(t), l.version > t.version)
1014
+ a
1015
+ ), a.wv > e.wv)
502
1016
  return !0;
503
- }
504
1017
  }
505
- (!r || v !== null && !$) && M(t, F);
1018
+ (!r || g !== null && !W) && k(e, E);
506
1019
  }
507
1020
  return !1;
508
1021
  }
509
- function pn(t, e) {
510
- for (var n = e; n !== null; ) {
511
- if ((n.f & kt) !== 0)
512
- try {
513
- n.fn(t);
514
- return;
515
- } catch {
516
- n.f ^= kt;
517
- }
518
- n = n.parent;
519
- }
520
- throw ut = !1, t;
521
- }
522
- function bn(t) {
523
- return (t.f & Z) === 0 && (t.parent === null || (t.parent.f & kt) === 0);
524
- }
525
- function yt(t, e, n, r) {
526
- if (ut) {
527
- if (n === null && (ut = !1), bn(e))
528
- throw t;
529
- return;
530
- }
531
- n !== null && (ut = !0);
532
- {
533
- pn(t, e);
534
- return;
535
- }
1022
+ function Ut(e, t, n = !0) {
1023
+ var r = e.reactions;
1024
+ if (r !== null && !$?.includes(e))
1025
+ for (var i = 0; i < r.length; i++) {
1026
+ var a = r[i];
1027
+ (a.f & T) !== 0 ? Ut(
1028
+ /** @type {Derived} */
1029
+ a,
1030
+ t,
1031
+ !1
1032
+ ) : t === a && (n ? k(a, I) : (a.f & E) !== 0 && k(a, K), te(
1033
+ /** @type {Effect} */
1034
+ a
1035
+ ));
1036
+ }
536
1037
  }
537
- function ye(t) {
538
- var c;
539
- var e = S, n = T, r = j, i = h, l = $, a = H, _ = x, f = t.f;
540
- S = /** @type {null | Value[]} */
541
- null, T = 0, j = null, h = (f & (R | pt)) === 0 ? t : null, $ = !X && (f & K) !== 0, H = null, x = t.ctx;
1038
+ function Vt(e) {
1039
+ var t = x, n = F, r = L, i = v, a = W, s = $, o = C, l = z, f = ee, u = e.f;
1040
+ x = /** @type {null | Value[]} */
1041
+ null, F = 0, L = null, W = (u & R) !== 0 && (z || !oe || v === null), v = (u & (G | ue)) === 0 ? e : null, $ = null, ke(e.ctx), z = !1, ee = ++ge, e.ac !== null && (Nt(() => {
1042
+ e.ac.abort(pe);
1043
+ }), e.ac = null);
542
1044
  try {
543
- var s = (
1045
+ e.f |= Be;
1046
+ var c = (
544
1047
  /** @type {Function} */
545
- (0, t.fn)()
546
- ), u = t.deps;
547
- if (S !== null) {
548
- var o;
549
- if (nt(t, T), u !== null && T > 0)
550
- for (u.length = T + S.length, o = 0; o < S.length; o++)
551
- u[T + o] = S[o];
1048
+ e.fn
1049
+ ), p = c(), _ = e.deps;
1050
+ if (x !== null) {
1051
+ var d;
1052
+ if (Ae(e, F), _ !== null && F > 0)
1053
+ for (_.length = F + x.length, d = 0; d < x.length; d++)
1054
+ _[F + d] = x[d];
552
1055
  else
553
- t.deps = u = S;
554
- if (!$)
555
- for (o = T; o < u.length; o++)
556
- ((c = u[o]).reactions ?? (c.reactions = [])).push(t);
557
- } else u !== null && T < u.length && (nt(t, T), u.length = T);
558
- return s;
1056
+ e.deps = _ = x;
1057
+ if (!W || // Deriveds that already have reactions can cleanup, so we still add them as reactions
1058
+ (u & T) !== 0 && /** @type {import('#client').Derived} */
1059
+ e.reactions !== null)
1060
+ for (d = F; d < _.length; d++)
1061
+ (_[d].reactions ??= []).push(e);
1062
+ } else _ !== null && F < _.length && (Ae(e, F), _.length = F);
1063
+ if (me() && L !== null && !z && _ !== null && (e.f & (T | K | I)) === 0)
1064
+ for (d = 0; d < /** @type {Source[]} */
1065
+ L.length; d++)
1066
+ Ut(
1067
+ L[d],
1068
+ /** @type {Effect} */
1069
+ e
1070
+ );
1071
+ return i !== null && i !== e && (ge++, L !== null && (r === null ? r = L : r.push(.../** @type {Source[]} */
1072
+ L))), (e.f & Q) !== 0 && (e.f ^= Q), p;
1073
+ } catch (m) {
1074
+ return Ln(m);
559
1075
  } finally {
560
- S = e, T = n, j = r, h = i, $ = l, H = a, x = _;
1076
+ e.f ^= Be, x = t, F = n, L = r, v = i, W = a, $ = s, ke(o), z = l, ee = f;
561
1077
  }
562
1078
  }
563
- function mn(t, e) {
564
- let n = e.reactions;
1079
+ function Jn(e, t) {
1080
+ let n = t.reactions;
565
1081
  if (n !== null) {
566
- var r = n.indexOf(t);
1082
+ var r = on.call(n, e);
567
1083
  if (r !== -1) {
568
1084
  var i = n.length - 1;
569
- i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop());
1085
+ i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop());
570
1086
  }
571
1087
  }
572
- n === null && (e.f & N) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1088
+ n === null && (t.f & T) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
573
1089
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
574
1090
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
575
- (S === null || !S.includes(e)) && (M(e, bt), (e.f & (K | ct)) === 0 && (e.f ^= ct), nt(
1091
+ (x === null || !x.includes(t)) && (k(t, K), (t.f & (R | xe)) === 0 && (t.f ^= xe), Tt(
576
1092
  /** @type {Derived} **/
577
- e,
1093
+ t
1094
+ ), Ae(
1095
+ /** @type {Derived} **/
1096
+ t,
578
1097
  0
579
1098
  ));
580
1099
  }
581
- function nt(t, e) {
582
- var n = t.deps;
1100
+ function Ae(e, t) {
1101
+ var n = e.deps;
583
1102
  if (n !== null)
584
- for (var r = e; r < n.length; r++)
585
- mn(t, n[r]);
586
- }
587
- function St(t) {
588
- var e = t.f;
589
- if ((e & Z) === 0) {
590
- M(t, F);
591
- var n = v, r = x;
592
- v = t;
1103
+ for (var r = t; r < n.length; r++)
1104
+ Jn(e, n[r]);
1105
+ }
1106
+ function he(e) {
1107
+ var t = e.f;
1108
+ if ((t & re) === 0) {
1109
+ k(e, E);
1110
+ var n = g, r = oe;
1111
+ g = e, oe = !0;
593
1112
  try {
594
- (e & Lt) !== 0 ? gn(t) : ge(t), ve(t), _e(t);
595
- var i = ye(t);
596
- t.teardown = typeof i == "function" ? i : null, t.version = be;
597
- } catch (l) {
598
- yt(l, t, n, r || t.ctx);
1113
+ (t & ne) !== 0 ? qn(e) : Pt(e), Ct(e);
1114
+ var i = Vt(e);
1115
+ e.teardown = typeof i == "function" ? i : null, e.wv = $t;
1116
+ var a;
1117
+ pt && xn && (e.f & I) !== 0 && e.deps;
599
1118
  } finally {
600
- v = n;
1119
+ oe = r, g = n;
601
1120
  }
602
1121
  }
603
1122
  }
604
- function yn() {
605
- if (tt > 1e3) {
606
- tt = 0;
607
- try {
608
- Ge();
609
- } catch (t) {
610
- if (vt !== null)
611
- yt(t, vt, null);
612
- else
613
- throw t;
614
- }
615
- }
616
- tt++;
617
- }
618
- function Sn(t) {
619
- var e = t.length;
620
- if (e !== 0) {
621
- yn();
622
- var n = X;
623
- X = !0;
624
- try {
625
- for (var r = 0; r < e; r++) {
626
- var i = t[r];
627
- (i.f & F) === 0 && (i.f ^= F);
628
- var l = [];
629
- Se(i, l), xn(l);
1123
+ function w(e) {
1124
+ var t = e.f, n = (t & T) !== 0;
1125
+ if (v !== null && !z) {
1126
+ var r = g !== null && (g.f & re) !== 0;
1127
+ if (!r && !$?.includes(e)) {
1128
+ var i = v.deps;
1129
+ if ((v.f & Be) !== 0)
1130
+ e.rv < ge && (e.rv = ge, x === null && i !== null && i[F] === e ? F++ : x === null ? x = [e] : (!W || !x.includes(e)) && x.push(e));
1131
+ else {
1132
+ (v.deps ??= []).push(e);
1133
+ var a = e.reactions;
1134
+ a === null ? e.reactions = [v] : a.includes(v) || a.push(v);
630
1135
  }
631
- } finally {
632
- X = n;
633
1136
  }
634
- }
635
- }
636
- function xn(t) {
637
- var e = t.length;
638
- if (e !== 0)
639
- for (var n = 0; n < e; n++) {
640
- var r = t[n];
641
- if ((r.f & (Z | Y)) === 0)
642
- try {
643
- lt(r) && (St(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? de(r) : r.fn = null));
644
- } catch (i) {
645
- yt(i, r, null, r.ctx);
646
- }
647
- }
648
- }
649
- function wn() {
650
- if (_t = !1, tt > 1001)
651
- return;
652
- const t = It;
653
- It = [], Sn(t), _t || (tt = 0, vt = null);
654
- }
655
- function xt(t) {
656
- _t || (_t = !0, queueMicrotask(wn)), vt = t;
657
- for (var e = t; e.parent !== null; ) {
658
- e = e.parent;
659
- var n = e.f;
660
- if ((n & (pt | R)) !== 0) {
661
- if ((n & F) === 0) return;
662
- e.f ^= F;
663
- }
664
- }
665
- It.push(e);
666
- }
667
- function Se(t, e) {
668
- var n = t.first, r = [];
669
- t: for (; n !== null; ) {
670
- var i = n.f, l = (i & R) !== 0, a = l && (i & F) !== 0, _ = n.next;
671
- if (!a && (i & Y) === 0)
672
- if ((i & Dt) !== 0) {
673
- if (l)
674
- n.f ^= F;
675
- else
676
- try {
677
- lt(n) && St(n);
678
- } catch (o) {
679
- yt(o, n, null, n.ctx);
680
- }
681
- var f = n.first;
682
- if (f !== null) {
683
- n = f;
684
- continue;
685
- }
686
- } else (i & re) !== 0 && r.push(n);
687
- if (_ === null) {
688
- let o = n.parent;
689
- for (; o !== null; ) {
690
- if (t === o)
691
- break t;
692
- var s = o.next;
693
- if (s !== null) {
694
- n = s;
695
- continue t;
696
- }
697
- o = o.parent;
698
- }
699
- }
700
- n = _;
701
- }
702
- for (var u = 0; u < r.length; u++)
703
- f = r[u], e.push(f), Se(f, e);
704
- }
705
- function p(t) {
706
- var u;
707
- var e = t.f, n = (e & N) !== 0;
708
- if (n && (e & Z) !== 0) {
709
- var r = fe(
710
- /** @type {Derived} */
711
- t
712
- );
713
- return Rt(
1137
+ } else if (n && /** @type {Derived} */
1138
+ e.deps === null && /** @type {Derived} */
1139
+ e.effects === null) {
1140
+ var s = (
714
1141
  /** @type {Derived} */
715
- t
716
- ), r;
1142
+ e
1143
+ ), o = s.parent;
1144
+ o !== null && (o.f & R) === 0 && (s.f ^= R);
717
1145
  }
718
- if (h !== null) {
719
- H !== null && H.includes(t) && Qe();
720
- var i = h.deps;
721
- S === null && i !== null && i[T] === t ? T++ : S === null ? S = [t] : S.push(t), j !== null && v !== null && (v.f & F) !== 0 && (v.f & R) === 0 && j.includes(t) && (M(v, V), xt(v));
722
- } else if (n && /** @type {Derived} */
723
- t.deps === null)
724
- for (var l = (
1146
+ if (_e) {
1147
+ if (q.has(e))
1148
+ return q.get(e);
1149
+ if (n) {
1150
+ s = /** @type {Derived} */
1151
+ e;
1152
+ var l = s.v;
1153
+ return ((s.f & E) === 0 && s.reactions !== null || Wt(s)) && (l = Xe(s)), q.set(s, l), l;
1154
+ }
1155
+ } else n && (s = /** @type {Derived} */
1156
+ e, Pe(s) && At(s));
1157
+ if ((e.f & Q) !== 0)
1158
+ throw e.v;
1159
+ return e.v;
1160
+ }
1161
+ function Wt(e) {
1162
+ if (e.v === y) return !0;
1163
+ if (e.deps === null) return !1;
1164
+ for (const t of e.deps)
1165
+ if (q.has(t) || (t.f & T) !== 0 && Wt(
725
1166
  /** @type {Derived} */
726
1167
  t
727
- ), a = l.parent, _ = l; a !== null; )
728
- if ((a.f & N) !== 0) {
729
- var f = (
730
- /** @type {Derived} */
731
- a
732
- );
733
- _ = f, a = f.parent;
734
- } else {
735
- var s = (
736
- /** @type {Effect} */
737
- a
738
- );
739
- (u = s.deriveds) != null && u.includes(_) || (s.deriveds ?? (s.deriveds = [])).push(_);
740
- break;
741
- }
742
- return n && (l = /** @type {Derived} */
743
- t, lt(l) && ce(l)), t.v;
1168
+ ))
1169
+ return !0;
1170
+ return !1;
744
1171
  }
745
- function Kt(t) {
746
- const e = h;
1172
+ function Ue(e) {
1173
+ var t = z;
747
1174
  try {
748
- return h = null, t();
1175
+ return z = !0, e();
749
1176
  } finally {
750
- h = e;
1177
+ z = t;
751
1178
  }
752
1179
  }
753
- const En = -7169;
754
- function M(t, e) {
755
- t.f = t.f & En | e;
756
- }
757
- function xe(t, e = !1, n) {
758
- x = {
759
- p: x,
760
- c: null,
761
- e: null,
762
- m: !1,
763
- s: t,
764
- x: null,
765
- l: null
766
- }, it && !e && (x.l = {
767
- s: null,
768
- u: null,
769
- r1: [],
770
- r2: A(!1)
771
- });
1180
+ const Qn = -7169;
1181
+ function k(e, t) {
1182
+ e.f = e.f & Qn | t;
1183
+ }
1184
+ function ot(e) {
1185
+ if (!(typeof e != "object" || !e || e instanceof EventTarget)) {
1186
+ if (le in e)
1187
+ Ve(e);
1188
+ else if (!Array.isArray(e))
1189
+ for (let t in e) {
1190
+ const n = e[t];
1191
+ typeof n == "object" && n && le in n && Ve(n);
1192
+ }
1193
+ }
772
1194
  }
773
- function we(t) {
774
- const e = x;
775
- if (e !== null) {
776
- const a = e.e;
777
- if (a !== null) {
778
- var n = v, r = h;
779
- e.e = null;
1195
+ function Ve(e, t = /* @__PURE__ */ new Set()) {
1196
+ if (typeof e == "object" && e !== null && // We don't want to traverse DOM elements
1197
+ !(e instanceof EventTarget) && !t.has(e)) {
1198
+ t.add(e), e instanceof Date && e.getTime();
1199
+ for (let r in e)
780
1200
  try {
781
- for (var i = 0; i < a.length; i++) {
782
- var l = a[i];
783
- G(l.effect), gt(l.reaction), vn(l.fn);
784
- }
785
- } finally {
786
- G(n), gt(r);
1201
+ Ve(e[r], t);
1202
+ } catch {
1203
+ }
1204
+ const n = We(e);
1205
+ if (n !== Object.prototype && n !== Array.prototype && n !== Map.prototype && n !== Set.prototype && n !== Date.prototype) {
1206
+ const r = vt(n);
1207
+ for (let i in r) {
1208
+ const a = r[i].get;
1209
+ if (a)
1210
+ try {
1211
+ a.call(e);
1212
+ } catch {
1213
+ }
787
1214
  }
788
1215
  }
789
- x = e.p, e.m = !0;
790
1216
  }
791
- return (
792
- /** @type {T} */
793
- {}
794
- );
795
1217
  }
796
- const Tn = /* @__PURE__ */ new Set(), kn = /* @__PURE__ */ new Set();
797
- function Fn(t) {
798
- for (var e = 0; e < t.length; e++)
799
- Tn.add(t[e]);
800
- for (var n of kn)
801
- n(t);
1218
+ const er = /* @__PURE__ */ new Set(), tr = /* @__PURE__ */ new Set();
1219
+ function nr(e) {
1220
+ for (var t = 0; t < e.length; t++)
1221
+ er.add(e[t]);
1222
+ for (var n of tr)
1223
+ n(e);
802
1224
  }
803
- function In(t) {
804
- var e = document.createElement("template");
805
- return e.innerHTML = t, e.content;
1225
+ function rr(e) {
1226
+ var t = document.createElement("template");
1227
+ return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
806
1228
  }
807
- function Ee(t, e) {
1229
+ function qt(e, t) {
808
1230
  var n = (
809
1231
  /** @type {Effect} */
810
- v
1232
+ g
811
1233
  );
812
- n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e);
1234
+ n.nodes_start === null && (n.nodes_start = e, n.nodes_end = t);
813
1235
  }
814
1236
  // @__NO_SIDE_EFFECTS__
815
- function Ct(t, e) {
816
- var n, r = !t.startsWith("<!>");
1237
+ function Ke(e, t) {
1238
+ var n, r = !e.startsWith("<!>");
817
1239
  return () => {
818
- n === void 0 && (n = In(r ? t : "<!>" + t), n = /** @type {Node} */
819
- /* @__PURE__ */ Nt(n));
1240
+ n === void 0 && (n = rr(r ? e : "<!>" + e), n = /** @type {Node} */
1241
+ /* @__PURE__ */ Ye(n));
820
1242
  var i = (
821
1243
  /** @type {TemplateNode} */
822
1244
  n.cloneNode(!0)
823
1245
  );
824
- return Ee(i, i), i;
1246
+ return qt(i, i), i;
825
1247
  };
826
1248
  }
827
- function On() {
828
- var t = document.createDocumentFragment(), e = document.createComment(""), n = on();
829
- return t.append(e, n), Ee(e, n), t;
1249
+ function ir() {
1250
+ var e = document.createDocumentFragment(), t = document.createComment(""), n = Ot();
1251
+ return e.append(t, n), qt(t, n), e;
830
1252
  }
831
- function dt(t, e) {
832
- t !== null && t.before(
1253
+ function Fe(e, t) {
1254
+ e !== null && e.before(
833
1255
  /** @type {Node} */
834
- e
1256
+ t
835
1257
  );
836
1258
  }
837
- function Dn(t, e, n = !1) {
838
- var r = t, i = null, l = null, a = E, _ = n ? mt : 0, f = !1;
839
- const s = (o, c = !0) => {
840
- f = !0, u(c, o);
841
- }, u = (o, c) => {
842
- a !== (a = o) && (a ? (i ? Yt(i) : c && (i = Ft(() => c(r))), l && Xt(l, () => {
843
- l = null;
844
- })) : (l ? Yt(l) : c && (l = Ft(() => c(r))), i && Xt(i, () => {
845
- i = null;
846
- })));
847
- };
848
- Mt(() => {
849
- f = !1, e(s), f || u(null, null);
850
- }, _);
851
- }
852
- function Te(t, e, ...n) {
853
- var r = t, i = Ot, l;
854
- Mt(() => {
855
- i !== (i = e()) && (l && (J(l), l = null), l = Ft(() => (
1259
+ function Xt(e, t, ...n) {
1260
+ var r = e, i = Oe, a;
1261
+ Rt(() => {
1262
+ i !== (i = t()) && (a && (de(a), a = null), a = He(() => (
856
1263
  /** @type {SnippetFn} */
857
1264
  i(r, ...n)
858
1265
  )));
859
- }, mt);
860
- }
861
- function ft(t, e, n, r) {
862
- var i = t.__attributes ?? (t.__attributes = {});
863
- i[e] !== (i[e] = n) && (e === "style" && "__styles" in t && (t.__styles = {}), e === "loading" && (t[Xe] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && Ln(t).includes(e) ? t[e] = n : t.setAttribute(e, n));
864
- }
865
- var Zt = /* @__PURE__ */ new Map();
866
- function Ln(t) {
867
- var e = Zt.get(t.nodeName);
868
- if (e) return e;
869
- Zt.set(t.nodeName, e = []);
870
- for (var n, r = t, i = Element.prototype; i !== r; ) {
871
- n = je(r);
872
- for (var l in n)
873
- n[l].set && e.push(l);
874
- r = ne(r);
875
- }
876
- return e;
877
- }
878
- function ke(t, e) {
879
- var n = t.__className, r = An(e);
880
- (n !== r || ln) && (e == null ? t.removeAttribute("class") : t.className = r, t.__className = r);
881
- }
882
- function An(t) {
883
- return t ?? "";
884
- }
885
- let at = !1;
886
- function Nn(t) {
887
- var e = at;
888
- try {
889
- return at = !1, [t(), at];
890
- } finally {
891
- at = e;
1266
+ }, Le);
1267
+ }
1268
+ function ar(e, t, n = !1) {
1269
+ var r = e, i = null, a = null, s = y, o = n ? Le : 0, l = !1;
1270
+ const f = (_, d = !0) => {
1271
+ l = !0, p(d, _);
1272
+ };
1273
+ var u = null;
1274
+ function c() {
1275
+ u !== null && (u.lastChild.remove(), r.before(u), u = null);
1276
+ var _ = s ? i : a, d = s ? a : i;
1277
+ _ && Kn(_), d && Yn(d, () => {
1278
+ s ? a = null : i = null;
1279
+ });
1280
+ }
1281
+ const p = (_, d) => {
1282
+ if (s !== (s = _)) {
1283
+ var m = $n(), O = r;
1284
+ if (m && (u = document.createDocumentFragment(), u.append(O = Ot())), s ? i ??= d && He(() => d(O)) : a ??= d && He(() => d(O)), m) {
1285
+ var A = (
1286
+ /** @type {Batch} */
1287
+ S
1288
+ ), N = s ? i : a, h = s ? a : i;
1289
+ N && A.skipped_effects.delete(N), h && A.skipped_effects.add(h), A.add_callback(c);
1290
+ } else
1291
+ c();
1292
+ }
1293
+ };
1294
+ Rt(() => {
1295
+ l = !1, t(f), l || p(null, null);
1296
+ }, o);
1297
+ }
1298
+ function sr(e, t, n) {
1299
+ var r = e == null ? "" : "" + e;
1300
+ return t && (r = r ? r + " " + t : t), r === "" ? null : r;
1301
+ }
1302
+ function lr(e, t) {
1303
+ return e == null ? null : String(e);
1304
+ }
1305
+ function Yt(e, t, n, r, i, a) {
1306
+ var s = e.__className;
1307
+ if (s !== n || s === void 0) {
1308
+ var o = sr(n, r);
1309
+ o == null ? e.removeAttribute("class") : e.className = o, e.__className = n;
1310
+ }
1311
+ return a;
1312
+ }
1313
+ function Gt(e, t, n, r) {
1314
+ var i = e.__style;
1315
+ if (i !== t) {
1316
+ var a = lr(t);
1317
+ a == null ? e.removeAttribute("style") : e.style.cssText = a, e.__style = t;
1318
+ }
1319
+ return r;
1320
+ }
1321
+ const or = Symbol("is custom element"), fr = Symbol("is html");
1322
+ function ft(e, t, n, r) {
1323
+ var i = ur(e);
1324
+ i[t] !== (i[t] = n) && (t === "loading" && (e[vn] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && cr(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
1325
+ }
1326
+ function ur(e) {
1327
+ return (
1328
+ /** @type {Record<string | symbol, unknown>} **/
1329
+ // @ts-expect-error
1330
+ e.__attributes ??= {
1331
+ [or]: e.nodeName.includes("-"),
1332
+ [fr]: e.namespaceURI === sn
1333
+ }
1334
+ );
1335
+ }
1336
+ var ut = /* @__PURE__ */ new Map();
1337
+ function cr(e) {
1338
+ var t = e.getAttribute("is") || e.nodeName, n = ut.get(t);
1339
+ if (n) return n;
1340
+ ut.set(t, n = []);
1341
+ for (var r, i = e, a = Element.prototype; a !== i; ) {
1342
+ r = vt(i);
1343
+ for (var s in r)
1344
+ r[s].set && n.push(s);
1345
+ i = We(i);
892
1346
  }
1347
+ return n;
893
1348
  }
894
- function Jt(t) {
895
- for (var e = v, n = v; e !== null && (e.f & (R | pt)) === 0; )
896
- e = e.parent;
1349
+ let we = !1;
1350
+ function dr(e) {
1351
+ var t = we;
897
1352
  try {
898
- return G(e), t();
1353
+ return we = !1, [e(), we];
899
1354
  } finally {
900
- G(n);
1355
+ we = t;
901
1356
  }
902
1357
  }
903
- function et(t, e, n, r) {
904
- var Ut;
905
- var i = (n & Ne) !== 0, l = !it || (n & Re) !== 0, a = (n & Pe) !== 0, _ = (n & Me) !== 0, f = !1, s;
906
- a ? [s, f] = Nn(() => (
907
- /** @type {V} */
908
- t[e]
909
- )) : s = /** @type {V} */
910
- t[e];
911
- var u = ot in t || We in t, o = ((Ut = st(t, e)) == null ? void 0 : Ut.set) ?? (u && a && e in t ? (b) => t[e] = b : void 0), c = (
1358
+ function ve(e, t, n, r) {
1359
+ var i = !Re || (n & tn) !== 0, a = (n & rn) !== 0, s = (n & an) !== 0, o = (
912
1360
  /** @type {V} */
913
1361
  r
914
- ), g = !0, w = !1, m = () => (w = !0, g && (g = !1, _ ? c = Kt(
1362
+ ), l = !0, f = () => (l && (l = !1, o = s ? Ue(
915
1363
  /** @type {() => V} */
916
1364
  r
917
- ) : c = /** @type {V} */
918
- r), c);
919
- s === void 0 && r !== void 0 && (o && l && Ke(), s = m(), o && o(s));
920
- var y;
921
- if (l)
922
- y = () => {
923
- var b = (
924
- /** @type {V} */
925
- t[e]
926
- );
927
- return b === void 0 ? m() : (g = !0, w = !1, b);
928
- };
929
- else {
930
- var U = Jt(
931
- () => (i ? P : fn)(() => (
932
- /** @type {V} */
933
- t[e]
934
- ))
935
- );
936
- U.f |= Ue, y = () => {
937
- var b = p(U);
938
- return b !== void 0 && (c = /** @type {V} */
939
- void 0), b === void 0 ? c : b;
940
- };
1365
+ ) : (
1366
+ /** @type {V} */
1367
+ r
1368
+ )), o), u;
1369
+ if (a) {
1370
+ var c = le in e || pn in e;
1371
+ u = Ee(e, t)?.set ?? (c && t in e ? (h) => e[t] = h : void 0);
941
1372
  }
942
- if ((n & Be) === 0)
943
- return y;
944
- if (o) {
945
- var z = t.$$legacy;
946
- return function(b, q) {
947
- return arguments.length > 0 ? ((!l || !q || z || f) && o(q ? y() : b), b) : y();
948
- };
1373
+ var p, _ = !1;
1374
+ a ? [p, _] = dr(() => (
1375
+ /** @type {V} */
1376
+ e[t]
1377
+ )) : p = /** @type {V} */
1378
+ e[t], p === void 0 && r !== void 0 && (p = f(), u && (i && bn(), u(p)));
1379
+ var d;
1380
+ if (i ? d = () => {
1381
+ var h = (
1382
+ /** @type {V} */
1383
+ e[t]
1384
+ );
1385
+ return h === void 0 ? f() : (l = !0, h);
1386
+ } : d = () => {
1387
+ var h = (
1388
+ /** @type {V} */
1389
+ e[t]
1390
+ );
1391
+ return h !== void 0 && (o = /** @type {V} */
1392
+ void 0), h === void 0 ? o : h;
1393
+ }, i && (n & nn) === 0)
1394
+ return d;
1395
+ if (u) {
1396
+ var m = e.$$legacy;
1397
+ return (
1398
+ /** @type {() => V} */
1399
+ (function(h, ye) {
1400
+ return arguments.length > 0 ? ((!i || !ye || m || _) && u(ye ? d() : h), h) : d();
1401
+ })
1402
+ );
949
1403
  }
950
- var C = !1, Vt = !1, wt = /* @__PURE__ */ nn(s), Q = Jt(
951
- () => /* @__PURE__ */ P(() => {
952
- var b = y(), q = p(wt);
953
- return C ? (C = !1, Vt = !0, q) : (Vt = !1, wt.v = b);
1404
+ var O = !1, A = ((n & en) !== 0 ? Ce : kt)(() => (O = !1, d()));
1405
+ a && w(A);
1406
+ var N = (
1407
+ /** @type {Effect} */
1408
+ g
1409
+ );
1410
+ return (
1411
+ /** @type {() => V} */
1412
+ (function(h, ye) {
1413
+ if (arguments.length > 0) {
1414
+ const et = ye ? w(A) : i && a ? se(h) : h;
1415
+ return U(A, et), O = !0, o !== void 0 && (o = et), h;
1416
+ }
1417
+ return _e && O || (N.f & re) !== 0 ? A.v : w(A);
954
1418
  })
955
1419
  );
956
- return i || (Q.equals = At), function(b, q) {
957
- if (arguments.length > 0) {
958
- const Et = q ? p(Q) : l && a ? W(b) : b;
959
- return Q.equals(Et) || (C = !0, B(wt, Et), w && c !== void 0 && (c = Et), Kt(() => p(Q))), b;
960
- }
961
- return p(Q);
962
- };
963
1420
  }
964
- var Rn = /* @__PURE__ */ Ct("<span><!></span>");
965
- function Bn(t, e) {
966
- xe(e, !0);
967
- const n = et(e, "size", 3, "body-base");
968
- var r = Rn(), i = oe(r);
969
- Te(i, () => e.children ?? Ot), Pt(() => ke(r, `rcb-typography rcb-typography-${n() ?? ""} svelte-byrjto`)), dt(t, r), we();
1421
+ var _r = /* @__PURE__ */ Ke("<span><!></span>");
1422
+ function pr(e, t) {
1423
+ const n = ve(t, "size", 3, "body-base");
1424
+ var r = _r(), i = Dt(r);
1425
+ Xt(i, () => t.children ?? Oe), Ge(() => Yt(r, 1, `rcb-typography rcb-typography-${n() ?? ""}`, "svelte-jt3g5k")), Fe(e, r);
970
1426
  }
971
- const Pn = {
1427
+ const vr = {
972
1428
  outerPadding: {
973
1429
  mobile: "clamp(1.3125rem, 5.6vw, 1.5rem)",
974
1430
  desktop: "clamp(1.5rem, 9.44vw, 5rem)"
@@ -1009,11 +1465,11 @@ const Pn = {
1009
1465
  mobile: "0.70rem",
1010
1466
  desktop: "1rem"
1011
1467
  }
1012
- }, Qt = "-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif", I = {
1468
+ }, ct = "-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif", P = {
1013
1469
  regular: "400",
1014
1470
  medium: "500",
1015
1471
  semibold: "600"
1016
- }, k = {
1472
+ }, D = {
1017
1473
  12: "12px",
1018
1474
  14: "14px",
1019
1475
  16: "16px",
@@ -1022,151 +1478,151 @@ const Pn = {
1022
1478
  28: "28px",
1023
1479
  32: "32px",
1024
1480
  36: "36px"
1025
- }, O = {
1481
+ }, M = {
1026
1482
  120: "120%",
1027
1483
  130: "130%",
1028
1484
  140: "140%"
1029
- }, D = {
1485
+ }, j = {
1030
1486
  tight: "0.20%",
1031
1487
  regular: "0"
1032
- }, d = {
1488
+ }, b = {
1033
1489
  heading2xl: {
1034
- fontSize: k[28],
1035
- lineHeight: O[120],
1036
- fontWeight: I.semibold,
1037
- letterSpacing: D.tight
1490
+ fontSize: D[28],
1491
+ lineHeight: M[120],
1492
+ fontWeight: P.semibold,
1493
+ letterSpacing: j.tight
1038
1494
  },
1039
1495
  headingXl: {
1040
- fontSize: k[24],
1041
- lineHeight: O[130],
1042
- fontWeight: I.semibold,
1043
- letterSpacing: D.regular
1496
+ fontSize: D[24],
1497
+ lineHeight: M[130],
1498
+ fontWeight: P.semibold,
1499
+ letterSpacing: j.regular
1044
1500
  },
1045
1501
  headingLg: {
1046
1502
  fontSize: "20px",
1047
- lineHeight: O[130],
1048
- fontWeight: I.semibold,
1049
- letterSpacing: D.regular
1503
+ lineHeight: M[130],
1504
+ fontWeight: P.semibold,
1505
+ letterSpacing: j.regular
1050
1506
  },
1051
1507
  headingMd: {
1052
1508
  fontSize: "16px",
1053
- lineHeight: O[140],
1054
- fontWeight: I.medium,
1055
- letterSpacing: D.regular
1509
+ lineHeight: M[140],
1510
+ fontWeight: P.medium,
1511
+ letterSpacing: j.regular
1056
1512
  },
1057
1513
  bodyBase: {
1058
- fontSize: k[16],
1059
- lineHeight: O[140],
1060
- fontWeight: I.regular,
1061
- letterSpacing: D.regular
1514
+ fontSize: D[16],
1515
+ lineHeight: M[140],
1516
+ fontWeight: P.regular,
1517
+ letterSpacing: j.regular
1062
1518
  },
1063
1519
  bodySmall: {
1064
- fontSize: k[14],
1065
- lineHeight: O[140],
1066
- fontWeight: I.regular,
1067
- letterSpacing: D.regular
1520
+ fontSize: D[14],
1521
+ lineHeight: M[140],
1522
+ fontWeight: P.regular,
1523
+ letterSpacing: j.regular
1068
1524
  },
1069
1525
  labelButton: {
1070
- fontSize: k[16],
1071
- lineHeight: O[140],
1072
- fontWeight: I.regular,
1073
- letterSpacing: D.tight
1526
+ fontSize: D[16],
1527
+ lineHeight: M[140],
1528
+ fontWeight: P.regular,
1529
+ letterSpacing: j.tight
1074
1530
  },
1075
1531
  labelDefault: {
1076
- fontSize: k[14],
1077
- lineHeight: O[140],
1078
- fontWeight: I.regular,
1079
- letterSpacing: D.tight
1532
+ fontSize: D[14],
1533
+ lineHeight: M[140],
1534
+ fontWeight: P.regular,
1535
+ letterSpacing: j.tight
1080
1536
  },
1081
1537
  captionDefault: {
1082
- fontSize: k[12],
1083
- lineHeight: O[140],
1084
- fontWeight: I.regular,
1085
- letterSpacing: D.regular
1538
+ fontSize: D[12],
1539
+ lineHeight: M[140],
1540
+ fontWeight: P.regular,
1541
+ letterSpacing: j.regular
1086
1542
  },
1087
1543
  captionLink: {
1088
- fontSize: k[12],
1089
- lineHeight: O[140],
1090
- fontWeight: I.regular,
1091
- letterSpacing: D.regular
1544
+ fontSize: D[12],
1545
+ lineHeight: M[140],
1546
+ fontWeight: P.regular,
1547
+ letterSpacing: j.regular
1092
1548
  }
1093
- }, L = {
1549
+ }, B = {
1094
1550
  heading2xl: {
1095
- ...d.heading2xl,
1096
- fontSize: k[36]
1551
+ ...b.heading2xl,
1552
+ fontSize: D[36]
1097
1553
  },
1098
1554
  headingXl: {
1099
- ...d.headingXl,
1100
- fontSize: k[32]
1555
+ ...b.headingXl,
1556
+ fontSize: D[32]
1101
1557
  },
1102
1558
  headingLg: {
1103
- ...d.headingLg,
1104
- fontSize: k[24]
1559
+ ...b.headingLg,
1560
+ fontSize: D[24]
1105
1561
  },
1106
1562
  headingMd: {
1107
- ...d.headingMd,
1108
- fontSize: k[18]
1563
+ ...b.headingMd,
1564
+ fontSize: D[18]
1109
1565
  },
1110
1566
  bodyBase: {
1111
- ...d.bodyBase
1567
+ ...b.bodyBase
1112
1568
  },
1113
1569
  bodySmall: {
1114
- ...d.bodySmall
1570
+ ...b.bodySmall
1115
1571
  },
1116
1572
  labelButton: {
1117
- ...d.labelButton
1573
+ ...b.labelButton
1118
1574
  },
1119
1575
  labelDefault: {
1120
- ...d.labelDefault
1576
+ ...b.labelDefault
1121
1577
  },
1122
1578
  captionDefault: {
1123
- ...d.captionDefault
1579
+ ...b.captionDefault
1124
1580
  },
1125
1581
  captionLink: {
1126
- ...d.captionLink
1582
+ ...b.captionLink
1127
1583
  }
1128
- }, Mn = {
1584
+ }, gr = {
1129
1585
  heading2xl: {
1130
- mobile: d.heading2xl,
1131
- desktop: L.heading2xl
1586
+ mobile: b.heading2xl,
1587
+ desktop: B.heading2xl
1132
1588
  },
1133
1589
  headingXl: {
1134
- desktop: L.headingXl,
1135
- mobile: d.headingXl
1590
+ desktop: B.headingXl,
1591
+ mobile: b.headingXl
1136
1592
  },
1137
1593
  headingLg: {
1138
- desktop: L.headingLg,
1139
- mobile: d.headingLg
1594
+ desktop: B.headingLg,
1595
+ mobile: b.headingLg
1140
1596
  },
1141
1597
  headingMd: {
1142
- desktop: L.headingMd,
1143
- mobile: d.headingMd
1598
+ desktop: B.headingMd,
1599
+ mobile: b.headingMd
1144
1600
  },
1145
1601
  bodyBase: {
1146
- desktop: L.bodyBase,
1147
- mobile: d.bodyBase
1602
+ desktop: B.bodyBase,
1603
+ mobile: b.bodyBase
1148
1604
  },
1149
1605
  bodySmall: {
1150
- desktop: L.bodySmall,
1151
- mobile: d.bodySmall
1606
+ desktop: B.bodySmall,
1607
+ mobile: b.bodySmall
1152
1608
  },
1153
1609
  labelButton: {
1154
- desktop: L.labelButton,
1155
- mobile: d.labelButton
1610
+ desktop: B.labelButton,
1611
+ mobile: b.labelButton
1156
1612
  },
1157
1613
  labelDefault: {
1158
- desktop: L.labelDefault,
1159
- mobile: d.labelDefault
1614
+ desktop: B.labelDefault,
1615
+ mobile: b.labelDefault
1160
1616
  },
1161
1617
  captionDefault: {
1162
- desktop: L.captionDefault,
1163
- mobile: d.captionDefault
1618
+ desktop: B.captionDefault,
1619
+ mobile: b.captionDefault
1164
1620
  },
1165
1621
  captionLink: {
1166
- desktop: L.captionLink,
1167
- mobile: d.captionLink
1622
+ desktop: B.captionLink,
1623
+ mobile: b.captionLink
1168
1624
  }
1169
- }, zn = {
1625
+ }, hr = {
1170
1626
  error: "#B0171F",
1171
1627
  warning: "#f4e971",
1172
1628
  focus: "#1148B8",
@@ -1182,7 +1638,7 @@ const Pn = {
1182
1638
  "grey-ui-light": "rgba(0,0,0,0.1)",
1183
1639
  "input-background": "white",
1184
1640
  background: "white"
1185
- }, Cn = {
1641
+ }, br = {
1186
1642
  error: "#B0171F",
1187
1643
  warning: "#f4e971",
1188
1644
  focus: "#1148B8",
@@ -1198,46 +1654,46 @@ const Pn = {
1198
1654
  "grey-ui-light": "rgba(0,0,0,0.1)",
1199
1655
  "input-background": "white",
1200
1656
  background: "#EFF3FA"
1201
- }, Fe = {
1657
+ }, Kt = {
1202
1658
  error: "color_error",
1203
1659
  focus: "color_accent",
1204
1660
  accent: "color_accent",
1205
1661
  primary: "color_buttons_primary"
1206
- }, jn = {
1207
- ...Fe,
1662
+ }, mr = {
1663
+ ...Kt,
1208
1664
  "input-background": "color_form_bg",
1209
1665
  background: "color_form_bg"
1210
- }, $n = {
1211
- ...Fe,
1666
+ }, yr = {
1667
+ ...Kt,
1212
1668
  "input-background": "color_product_info_bg",
1213
1669
  background: "color_product_info_bg"
1214
- }, Ie = {
1670
+ }, Zt = {
1215
1671
  "input-border-radius": "4px",
1216
1672
  "input-button-border-radius": "8px"
1217
- }, Hn = {
1673
+ }, Sr = {
1218
1674
  "input-border-radius": "0px",
1219
1675
  "input-button-border-radius": "0px"
1220
- }, Vn = {
1676
+ }, wr = {
1221
1677
  "input-border-radius": "12px",
1222
1678
  "input-button-border-radius": "9999px"
1223
- }, te = Ie, rt = (t) => t.length == 7 ? {
1224
- r: parseInt(t.slice(1, 3), 16),
1225
- g: parseInt(t.slice(3, 5), 16),
1226
- b: parseInt(t.slice(5, 7), 16)
1227
- } : t.length == 4 ? {
1228
- r: parseInt(t[1], 16),
1229
- g: parseInt(t[2], 16),
1230
- b: parseInt(t[3], 16)
1231
- } : null, jt = ({
1232
- r: t,
1233
- g: e,
1679
+ }, dt = Zt, be = (e) => e.length == 7 ? {
1680
+ r: parseInt(e.slice(1, 3), 16),
1681
+ g: parseInt(e.slice(3, 5), 16),
1682
+ b: parseInt(e.slice(5, 7), 16)
1683
+ } : e.length == 4 ? {
1684
+ r: parseInt(e[1], 16),
1685
+ g: parseInt(e[2], 16),
1686
+ b: parseInt(e[3], 16)
1687
+ } : null, Ze = ({
1688
+ r: e,
1689
+ g: t,
1234
1690
  b: n,
1235
1691
  luminanceThreshold: r
1236
1692
  }) => {
1237
- const i = (a) => (a = a / 255, a <= 0.03928 ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4));
1238
- return 0.2126 * i(t) + 0.7152 * i(e) + 0.0722 * i(n) > r;
1239
- }, $t = 0.37, Un = (t, e = $t) => {
1240
- const n = jt({ ...t, luminanceThreshold: e }) ? "0,0,0" : "255,255,255";
1693
+ const i = (s) => (s = s / 255, s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4));
1694
+ return 0.2126 * i(e) + 0.7152 * i(t) + 0.0722 * i(n) > r;
1695
+ }, Je = 0.37, Er = (e, t = Je) => {
1696
+ const n = Ze({ ...e, luminanceThreshold: t }) ? "0,0,0" : "255,255,255";
1241
1697
  return {
1242
1698
  "grey-text-dark": `rgb(${n})`,
1243
1699
  "grey-text-light": `rgba(${n},0.70)`,
@@ -1245,24 +1701,24 @@ const Pn = {
1245
1701
  "grey-ui-light": `rgba(${n},0.1)`
1246
1702
  };
1247
1703
  };
1248
- function qn(t, e, n) {
1249
- const r = rt(t) || { r: 0, g: 0, b: 0 }, i = rt(e) || { r: 255, g: 255, b: 255 }, l = Math.round(i.r * n + r.r * (1 - n)), a = Math.round(i.g * n + r.g * (1 - n)), _ = Math.round(i.b * n + r.b * (1 - n));
1250
- return `#${Tt(l)}${Tt(a)}${Tt(_)}`;
1251
- }
1252
- function ee(t, e) {
1253
- const n = { r: 255, g: 255, b: 255 }, r = Math.max(0, Math.min(1, e));
1254
- let i = t, l = rt(t) || n;
1255
- (isNaN(l.r) || isNaN(l.g) || isNaN(l.b)) && (l = n, i = "#FFFFFF");
1256
- const _ = jt({
1257
- ...l,
1258
- luminanceThreshold: $t
1704
+ function xr(e, t, n) {
1705
+ const r = be(e) || { r: 0, g: 0, b: 0 }, i = be(t) || { r: 255, g: 255, b: 255 }, a = Math.round(i.r * n + r.r * (1 - n)), s = Math.round(i.g * n + r.g * (1 - n)), o = Math.round(i.b * n + r.b * (1 - n));
1706
+ return `#${je(a)}${je(s)}${je(o)}`;
1707
+ }
1708
+ function _t(e, t) {
1709
+ const n = { r: 255, g: 255, b: 255 }, r = Math.max(0, Math.min(1, t));
1710
+ let i = e, a = be(e) || n;
1711
+ (isNaN(a.r) || isNaN(a.g) || isNaN(a.b)) && (a = n, i = "#FFFFFF");
1712
+ const o = Ze({
1713
+ ...a,
1714
+ luminanceThreshold: Je
1259
1715
  }) ? "#000000" : "#FFFFFF";
1260
- return qn(i, _, r);
1716
+ return xr(i, o, r);
1261
1717
  }
1262
- function Tt(t) {
1263
- return t.toString(16).padStart(2, "0").toUpperCase();
1718
+ function je(e) {
1719
+ return e.toString(16).padStart(2, "0").toUpperCase();
1264
1720
  }
1265
- const Wn = (t, e, n, r = $t) => {
1721
+ const kr = (e, t, n, r = Je) => {
1266
1722
  const i = {
1267
1723
  "grey-text-dark": n["grey-text-dark"],
1268
1724
  "grey-text-light": n["grey-text-light"],
@@ -1270,170 +1726,169 @@ const Wn = (t, e, n, r = $t) => {
1270
1726
  "grey-ui-light": n["grey-ui-light"],
1271
1727
  "primary-text": n["primary-text"]
1272
1728
  };
1273
- if (t != null && t.startsWith("#")) {
1274
- const l = rt(t);
1275
- l !== null && Object.assign(i, Un(l));
1729
+ if (e?.startsWith("#")) {
1730
+ const a = be(e);
1731
+ a !== null && Object.assign(i, Er(a));
1276
1732
  }
1277
- if (e != null && e.startsWith("#")) {
1278
- const l = rt(e);
1279
- l !== null && (i["primary-text"] = jt({ ...l, luminanceThreshold: r }) ? "black" : "white");
1733
+ if (t?.startsWith("#")) {
1734
+ const a = be(t);
1735
+ a !== null && (i["primary-text"] = Ze({ ...a, luminanceThreshold: r }) ? "black" : "white");
1280
1736
  }
1281
1737
  return i;
1282
- }, Xn = (t) => ({
1283
- "primary-hover": ee(t, 0.1),
1284
- "primary-pressed": ee(t, 0.15)
1285
- }), Yn = (t, e) => t || e, Gn = (t, e, n) => {
1286
- const r = Object.entries(t).map(([i, l]) => [
1738
+ }, Tr = (e) => ({
1739
+ "primary-hover": _t(e, 0.1),
1740
+ "primary-pressed": _t(e, 0.15)
1741
+ }), Ar = (e, t) => e || t, Fr = (e, t, n) => {
1742
+ const r = Object.entries(e).map(([i, a]) => [
1287
1743
  i,
1288
- Yn(
1289
- n ? n[l] : null,
1290
- e[i]
1744
+ Ar(
1745
+ n ? n[a] : null,
1746
+ t[i]
1291
1747
  )
1292
1748
  ]);
1293
1749
  return Object.fromEntries(r);
1294
- }, Oe = (t, e, n) => {
1295
- const r = Gn(
1296
- t,
1750
+ }, Jt = (e, t, n) => {
1751
+ const r = Fr(
1297
1752
  e,
1753
+ t,
1298
1754
  n
1299
1755
  );
1300
1756
  return n ? {
1301
- ...e,
1757
+ ...t,
1302
1758
  ...r,
1303
- ...Wn(
1759
+ ...kr(
1304
1760
  r.background,
1305
1761
  r.primary,
1306
- e
1762
+ t
1307
1763
  ),
1308
- ...Xn(r.primary)
1309
- } : { ...e };
1310
- }, Kn = (t) => Oe(
1311
- $n,
1312
- Cn,
1313
- t
1314
- ), De = (t) => Oe(
1315
- jn,
1316
- zn,
1317
- t
1318
- ), Ht = (t) => {
1319
- if (!t)
1320
- return te;
1321
- switch (t.shapes) {
1764
+ ...Tr(r.primary)
1765
+ } : { ...t };
1766
+ }, Ir = (e) => Jt(
1767
+ yr,
1768
+ br,
1769
+ e
1770
+ ), Qt = (e) => Jt(
1771
+ mr,
1772
+ hr,
1773
+ e
1774
+ ), Qe = (e) => {
1775
+ if (!e)
1776
+ return dt;
1777
+ switch (e.shapes) {
1322
1778
  case "rounded":
1323
- return Ie;
1779
+ return Zt;
1324
1780
  case "rectangle":
1325
- return Hn;
1781
+ return Sr;
1326
1782
  case "pill":
1327
- return Vn;
1783
+ return wr;
1328
1784
  default:
1329
- return te;
1785
+ return dt;
1330
1786
  }
1331
- }, ht = (t = "", e) => e.map(([n, r]) => `--rc-${t}-${n}: ${r}`).join("; "), Zn = (t) => {
1332
- const e = ht(
1787
+ }, Ie = (e = "", t) => t.map(([n, r]) => `--rc-${e}-${n}: ${r}`).join("; "), Or = (e) => {
1788
+ const t = Ie(
1333
1789
  "color",
1334
- Object.entries(Kn(t))
1335
- ), n = ht(
1790
+ Object.entries(Ir(e))
1791
+ ), n = Ie(
1336
1792
  "shape",
1337
- Object.entries(Ht(t))
1793
+ Object.entries(Qe(e))
1338
1794
  );
1339
- return [e, n].join("; ");
1340
- }, Jn = (t) => {
1341
- const e = ht(
1795
+ return [t, n].join("; ");
1796
+ }, Lr = (e) => {
1797
+ const t = Ie(
1342
1798
  "color",
1343
- Object.entries(De(t))
1344
- ), n = ht(
1799
+ Object.entries(Qt(e))
1800
+ ), n = Ie(
1345
1801
  "shape",
1346
- Object.entries(Ht(t))
1802
+ Object.entries(Qe(e))
1347
1803
  );
1348
- return [e, n].join("; ");
1349
- }, Qn = (t = "", e) => Object.entries(e).flatMap(([n, { desktop: r, mobile: i }]) => [
1350
- `--rc-${t}-${n}-desktop: normal normal ${r.fontWeight} ${r.fontSize}/${r.lineHeight} ${Qt}`,
1351
- `--rc-${t}-${n}-mobile: normal normal ${i.fontWeight} ${i.fontSize}/${i.lineHeight} ${Qt}`,
1352
- `--rc-${t}-${n}-desktop-font-size: ${r.fontSize}`,
1353
- `--rc-${t}-${n}-mobile-font-size: ${i.fontSize}`
1354
- ]).join("; "), tr = (t = "", e) => Object.entries(e).map(
1355
- ([n, { mobile: r, desktop: i }]) => `--rc-${t}-${n}-mobile: ${r}; --rc-${t}-${n}-desktop: ${i};`
1804
+ return [t, n].join("; ");
1805
+ }, Dr = (e = "", t) => Object.entries(t).flatMap(([n, { desktop: r, mobile: i }]) => [
1806
+ `--rc-${e}-${n}-desktop: normal normal ${r.fontWeight} ${r.fontSize}/${r.lineHeight} ${ct}`,
1807
+ `--rc-${e}-${n}-mobile: normal normal ${i.fontWeight} ${i.fontSize}/${i.lineHeight} ${ct}`,
1808
+ `--rc-${e}-${n}-desktop-font-size: ${r.fontSize}`,
1809
+ `--rc-${e}-${n}-mobile-font-size: ${i.fontSize}`
1810
+ ]).join("; "), Nr = (e = "", t) => Object.entries(t).map(
1811
+ ([n, { mobile: r, desktop: i }]) => `--rc-${e}-${n}-mobile: ${r}; --rc-${e}-${n}-desktop: ${i};`
1356
1812
  ).join(" ");
1357
- class er {
1358
- constructor(e) {
1359
- qt(this, "brandingAppearance");
1360
- e ? this.brandingAppearance = e : this.brandingAppearance = void 0;
1813
+ class Rr {
1814
+ brandingAppearance;
1815
+ constructor(t) {
1816
+ t ? this.brandingAppearance = t : this.brandingAppearance = void 0;
1361
1817
  }
1362
1818
  get shape() {
1363
- return Ht(this.brandingAppearance);
1819
+ return Qe(this.brandingAppearance);
1364
1820
  }
1365
1821
  get formColors() {
1366
- return De(this.brandingAppearance);
1822
+ return Qt(this.brandingAppearance);
1367
1823
  }
1368
1824
  get formStyleVars() {
1369
- return Jn(this.brandingAppearance);
1825
+ return Lr(this.brandingAppearance);
1370
1826
  }
1371
1827
  get productInfoStyleVars() {
1372
- return Zn(this.brandingAppearance);
1828
+ return Or(this.brandingAppearance);
1373
1829
  }
1374
1830
  get spacing() {
1375
- return Pn;
1831
+ return vr;
1376
1832
  }
1377
1833
  get textStyles() {
1378
- return Mn;
1834
+ return gr;
1379
1835
  }
1380
1836
  get textStyleVars() {
1381
- return Qn("text", this.textStyles);
1837
+ return Dr("text", this.textStyles);
1382
1838
  }
1383
1839
  get spacingStyleVars() {
1384
- return tr("spacing", this.spacing);
1840
+ return Nr("spacing", this.spacing);
1385
1841
  }
1386
1842
  }
1387
- en();
1388
- var nr = /* @__PURE__ */ Ct('<div class="rcb-processing svelte-2j2b59"></div>');
1389
- function rr(t, e) {
1390
- let n = et(e, "size", 8, "medium");
1843
+ kn();
1844
+ var Cr = /* @__PURE__ */ Ke('<div class="rcb-processing svelte-1i80tfc"></div>');
1845
+ function Pr(e, t) {
1846
+ let n = ve(t, "size", 8, "medium");
1391
1847
  const r = {
1392
1848
  small: { width: "8px", offset: "10px" },
1393
1849
  medium: { width: "12px", offset: "20px" },
1394
1850
  large: { width: "16px", offset: "30px" }
1395
1851
  };
1396
- var i = nr();
1397
- Pt(() => ft(i, "style", `--shadow-offset: ${r[n()].offset ?? ""}; --width: ${r[n()].width ?? ""};`)), dt(t, i);
1398
- }
1399
- var ir = /* @__PURE__ */ Ct("<button><!></button>");
1400
- function ar(t, e) {
1401
- xe(e, !0);
1402
- const n = et(e, "intent", 3, "primary"), r = et(e, "disabled", 3, !1), i = et(e, "loading", 3, !1), l = /* @__PURE__ */ P(() => new er(e.brandingAppearance)), a = /* @__PURE__ */ P(() => p(l).textStyleVars), _ = /* @__PURE__ */ P(() => p(l).spacingStyleVars), f = /* @__PURE__ */ P(() => p(l).productInfoStyleVars), s = /* @__PURE__ */ P(() => p(l).formStyleVars), u = /* @__PURE__ */ P(() => [
1403
- e.styleOverrides,
1404
- p(a),
1405
- p(_),
1406
- p(f),
1407
- p(s)
1852
+ var i = Cr();
1853
+ Ge(() => Gt(i, `--shadow-offset: ${ot(n()), Ue(() => r[n()].offset) ?? ""}; --width: ${ot(n()), Ue(() => r[n()].width) ?? ""};`)), Fe(e, i);
1854
+ }
1855
+ var Mr = /* @__PURE__ */ Ke("<button><!></button>");
1856
+ function Br(e, t) {
1857
+ Tn(t, !0);
1858
+ const n = ve(t, "intent", 3, "primary"), r = ve(t, "disabled", 3, !1), i = ve(t, "loading", 3, !1), a = /* @__PURE__ */ ie(() => new Rr(t.brandingAppearance)), s = /* @__PURE__ */ ie(() => w(a).textStyleVars), o = /* @__PURE__ */ ie(() => w(a).spacingStyleVars), l = /* @__PURE__ */ ie(() => w(a).productInfoStyleVars), f = /* @__PURE__ */ ie(() => w(a).formStyleVars), u = /* @__PURE__ */ ie(() => [
1859
+ t.styleOverrides,
1860
+ w(s),
1861
+ w(o),
1862
+ w(l),
1863
+ w(f)
1408
1864
  ].join("; "));
1409
- var o = ir();
1410
- o.__click = function(...m) {
1411
- var y;
1412
- (y = e.onclick) == null || y.apply(this, m);
1865
+ var c = Mr();
1866
+ c.__click = function(...m) {
1867
+ t.onclick?.apply(this, m);
1413
1868
  };
1414
- var c = oe(o);
1869
+ var p = Dt(c);
1415
1870
  {
1416
- var g = (m) => {
1417
- rr(m, { size: "small" });
1418
- }, w = (m) => {
1419
- Bn(m, {
1871
+ var _ = (m) => {
1872
+ Pr(m, { size: "small" });
1873
+ }, d = (m) => {
1874
+ pr(m, {
1420
1875
  size: "body-base",
1421
- children: (y, U) => {
1422
- var z = On(), C = un(z);
1423
- Te(C, () => e.children ?? Ot), dt(y, z);
1876
+ children: (O, A) => {
1877
+ var N = ir(), h = zn(N);
1878
+ Xt(h, () => t.children ?? Oe), Fe(O, N);
1424
1879
  },
1425
1880
  $$slots: { default: !0 }
1426
1881
  });
1427
1882
  };
1428
- Dn(c, (m) => {
1429
- i() ? m(g) : m(w, !1);
1883
+ ar(p, (m) => {
1884
+ i() ? m(_) : m(d, !1);
1430
1885
  });
1431
1886
  }
1432
- Pt(() => {
1433
- ke(o, `${`intent-${n()}` ?? ""} svelte-td7xvm`), o.disabled = r(), ft(o, "data-testid", e.testId), ft(o, "type", e.type), ft(o, "style", p(u));
1434
- }), dt(t, o), we();
1887
+ Ge(() => {
1888
+ Yt(c, 1, `intent-${n()}`, "svelte-hnboq0"), c.disabled = r(), ft(c, "data-testid", t.testId), ft(c, "type", t.type), Gt(c, w(u));
1889
+ }), Fe(e, c), An();
1435
1890
  }
1436
- Fn(["click"]);
1891
+ nr(["click"]);
1437
1892
  export {
1438
- ar as Button
1893
+ Br as Button
1439
1894
  };