@getvitops/core 7.0.0 → 8.0.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,110 @@
1
1
  # @getvitops/core
2
2
 
3
+ ## 8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Rebuild the lightbox on one dialog + the existing carousel, fixing the flicker on
8
+ prev/next and the stutter on open.
9
+
10
+ **Breaking (`css`/`bricks` and `tailwind` formats — `.lightbox-dialog`'s markup
11
+ contract changed):**
12
+
13
+ - `<Gallery />` now emits ONE `<dialog class="lightbox-dialog">` per gallery,
14
+ wrapping a `<Carousel />`, instead of one dialog per image. A `.gallery__trigger`
15
+ is now a plain `<a href="#slide-id">`, not a `command="show-modal"` button.
16
+ - `.lightbox-dialog__content` / `__image` / `__nav` / `__nav-button` /
17
+ `__caption` are gone. The dialog's child is `.lightbox-dialog__track` (a
18
+ `.carousel`) — prev/next, dots, arrow keys and swipe are the carousel's,
19
+ reused rather than reimplemented. `.lightbox-dialog__close` is unchanged.
20
+ - `<wc-gallery>` no longer builds nav buttons or steps between images — the
21
+ nested `<wc-carousel>` does. It fires `gallery-open` (unchanged shape) and
22
+ re-emits the carousel's own stepping as `gallery-change`.
23
+ - `packages/core/src/web-components/utils/gallery.ts` dropped `keyToAction` and
24
+ `swipeAction` (the carousel's own key/swipe handling covers both now).
25
+ `stepIndex`/`preloadTargets` are unchanged.
26
+
27
+ **Why:** stepping used to close one `<dialog>` and open another, which made
28
+ `animation.css`'s top-layer driver play a full exit-then-entry transition on
29
+ every step — visible as a flicker on prev/next, by construction, not a bug to
30
+ tune away. Opening also awaited the full image's `decode()` before starting the
31
+ view-transition morph, so the dialog visibly stalled on a slow network. One
32
+ dialog containing one carousel makes the first failure mode unrepresentable
33
+ (stepping is a scroll, not a close/open pair) and removes the wait for the
34
+ second (the morph starts immediately, painting the thumbnail as a CSS
35
+ background placeholder until the full image arrives).
36
+
37
+ **Also improved, not just fixed:** the no-JS fallback is no longer a _stripped_
38
+ lightbox — it's a genuine one. Each trigger is ordinary fragment navigation
39
+ (`:has(:target)` in `lightbox.css` reveals the dialog), which needs no Invoker
40
+ Commands polyfill in any engine, and it now has working prev/next with no
41
+ JavaScript at all — the previous per-dialog fallback had no way to express that.
42
+
43
+ **Migration:** a consumer using `<Gallery />` needs no changes — the component's
44
+ props are unchanged. Anyone who hand-authored `.lightbox-dialog` markup (per
45
+ `docs/concepts/patterns.md` / `docs/css/classes.md`) must move to the new single-
46
+ dialog-wrapping-a-carousel shape; see `patterns.astro`'s "Gallery, hand-authored"
47
+ demo for the reference markup. `<wc-gallery>` consumers listening for
48
+ `gallery-change` keep the same event shape (`{ index, total }`).
49
+
50
+ ### Minor Changes
51
+
52
+ - Add Google Business Profile reviews: fetch, cache, render.
53
+
54
+ - **`vitops reviews`** (new CLI command) fetches a client's GBP reviews (legacy v4 API — the only
55
+ one that has them) and writes them to `.vitops/reviews.json`, meant to be committed so a build
56
+ never needs a live Google credential. `--dry` prints the plan; `--check` diffs against the cache
57
+ without writing. Requires the same `VITOPS_GOOGLE_CLIENT_ID`/`_CLIENT_SECRET`/`_REFRESH_TOKEN` (or
58
+ ADC login) `search setup` uses, scoped to `business.manage` — **and the calling GCP project must
59
+ be allowlisted by Google first**, a separate one-time approval from every other Google API here.
60
+ - **`site.reviews`** (config): which `organization.locations` to fetch, and per-location
61
+ `featured`/`minRating`/`sort`/`limit` selection. `schema` (JSON-LD) and `avatars` both default to
62
+ **off** — see the migration notes below.
63
+ - **`@getvitops/utils/reviews`** (new subpath): the pure plan/select/merge functions plus the GBP
64
+ fetcher and cache reader/writer, mirroring `./indexing`'s pure/IO split.
65
+ - **`<ReviewCard>`** (new Astro component, `@getvitops/astro`): one review card from a cache entry.
66
+ No web component — nothing here needs progressive enhancement. Composes the existing
67
+ `schemas/Review.astro` for JSON-LD only when both `schema` and `itemReviewed` are passed.
68
+ - **`<Marquee>`** (new Astro component): the tier-3 wrapper `wc-marquee`/`marquee.css` was missing.
69
+ - **`.review` pattern** (`css`/`bricks` and `tailwind` formats): a new config-generated
70
+ `patterns.items.review` entry plus `packages/core/css/patterns/review.css` for the structural
71
+ parts (rating, identity, body, reply, source link). Two new semantic icon names, `star` and
72
+ `star-half`, across every icon set.
73
+
74
+ **Migration:** no breaking change. A site adding `site.reviews` should read the "Google reviews"
75
+ section in AGENTS.md before enabling `schema` — Google's structured-data policy treats a business
76
+ marking up reviews of itself as ineligible for review rich results and risks a manual action, which
77
+ is why it defaults off.
78
+
79
+ - Repo-wide simplification pass: de-boilerplate the CLI, dedupe shared cache/plan
80
+ primitives in `@getvitops/utils`, drop dead code, and tighten dependency hygiene.
81
+
82
+ No breaking changes. (`vitops icons`'s `--site` flag was briefly going to be renamed to
83
+ `--input` for consistency with the other `Config`-anchored commands — deferred rather than
84
+ spending a major bump on a rename with no other breaking change riding along; it stays
85
+ `--site` for now.)
86
+
87
+ **Fixed:**
88
+
89
+ - `@getvitops/core`'s 12 runtime deps (`lit`, both `@oddbird` polyfills, both
90
+ `@webcomponents` packages, `colorjs.io`, etc.) were listed as `dependencies` despite
91
+ being bundled into `dist/elements.js`/`dist/polyfills.js`/`dist/deferred.js` — a
92
+ consumer installed them twice for nothing. Moved to `devDependencies`; no change to
93
+ what ships.
94
+ - Deleted `old-css-lib/` (59 files), superseded by `packages/core/css/` since the
95
+ in-memory bundling change — no consumer-facing effect, it was not part of any
96
+ published output.
97
+ - Deleted a dead Astro module (`packages/astro/src/scripts/deferred.ts`) that had
98
+ silently diverged from `packages/core/src/js/deferred.ts` and had zero importers.
99
+
100
+ **No consumer-facing change in `@getvitops/vite`** beyond the fixed-group version bump —
101
+ task-graph and caching fixes internal to this repo's own build.
102
+
103
+ Everything else (the `cli.ts` file split into `commands/{search,ads}.ts`, shared
104
+ `json-store.ts`/`plan-format.ts` helpers in `@getvitops/utils`, a `.github/actions/setup`
105
+ composite action, restatement-comment cleanup) is internal refactoring with no change to
106
+ any published API, CLI flag, or generated output.
107
+
3
108
  ## 7.0.0
4
109
 
5
110
  ### Major Changes
@@ -715,28 +820,20 @@ hidden` would pull it out of the accessible-name computation along with the visu
715
820
  {
716
821
  "designSystem": {
717
822
  "themes": {
718
- "default": {
719
- /* … */
720
- },
823
+ "default": {/* … */},
721
824
  },
722
825
  },
723
826
  "organization": {
724
827
  "name": "Acme",
725
828
  "contact": "hq",
726
829
  "locations": {
727
- "hq": {
728
- /* … */
729
- },
830
+ "hq": {/* … */},
730
831
  },
731
832
  },
732
833
  "site": {
733
834
  "defaultLocale": "en",
734
- "domains": {
735
- /* … */
736
- },
737
- "analytics": {
738
- /* … */
739
- },
835
+ "domains": {/* … */},
836
+ "analytics": {/* … */},
740
837
  },
741
838
  }
742
839
  ```
@@ -974,8 +1071,8 @@ open-fade-in"` composes slide and fade. Applied at zero specificity with identit
974
1071
 
975
1072
  ```js
976
1073
  vitops({
977
- analytics: { googleAnalytics: 'G-XXXXXXXXXX', plausible: 'acme.com' },
978
- consent: { policyUrl: '/legal/cookies' },
1074
+ analytics: { googleAnalytics: "G-XXXXXXXXXX", plausible: "acme.com" },
1075
+ consent: { policyUrl: "/legal/cookies" },
979
1076
  });
980
1077
  ```
981
1078
 
@@ -1599,7 +1696,7 @@ inset(0 100% 0 0)`, and `clip-path` clips **hit-testing** as well as painting
1599
1696
  ```js
1600
1697
  // astro.config.mjs
1601
1698
  getvitops({
1602
- css: { input: 'design-system.json', format: 'css', out: 'src/styles' },
1699
+ css: { input: "design-system.json", format: "css", out: "src/styles" },
1603
1700
  editor: true,
1604
1701
  });
1605
1702
  ```
package/css/global.css CHANGED
@@ -75,3 +75,31 @@ body {
75
75
  scroll-padding-block-start: var(--top-offset, 0);
76
76
  }
77
77
  }
78
+
79
+ /* The focus ring must survive Windows High Contrast Mode, and as generated it
80
+ does not. Every pattern's `ring: true` state (`generate.ts`) emits `outline:
81
+ none; box-shadow: 0 0 0 3px <color>;` — a deliberate choice the rest of the
82
+ time, since a box-shadow ring can follow a border-radius where a native
83
+ outline cannot. But `forced-colors: active` forces `box-shadow` to `none`
84
+ unconditionally (CSS Color Adjust Module), and this framework already asked
85
+ for no native outline either — so a keyboard user in forced-colors mode gets
86
+ NO focus indicator at all, on every `:focus-visible` element in every
87
+ format. This is the single most severe instance of the class of bug
88
+ `forced-colors`/`prefers-contrast` coverage exists to catch (AGENTS.md's
89
+ design-system-gaps notes on `--surface-glass`/`--overlay`/role solids are
90
+ the same class, decorative rather than safety-critical).
91
+
92
+ `!important`, deliberately, for the same reason `:root`'s `font-size` above
93
+ gets it: this must win regardless of which pattern's `vitops.components`
94
+ rule set `outline: none`, and `!important` outranks a normal-priority
95
+ declaration regardless of cascade layer. The colour is the token every
96
+ other ring already uses (`--color-border-focus`, from `ui-primary`,
97
+ contrast-checked as a non-text boundary) — forced-colors mode remaps
98
+ `outline-color` to a system colour automatically, so this is really only
99
+ asserting THAT an outline renders, not which colour it renders in. */
100
+ @media (forced-colors: active) {
101
+ :focus-visible {
102
+ outline: 2px solid var(--color-border-focus) !important;
103
+ outline-offset: 2px !important;
104
+ }
105
+ }
package/css/index.css CHANGED
@@ -6,6 +6,7 @@
6
6
  @import './generated/type-tokens.css';
7
7
  @import './generated/tokens.css';
8
8
  @import './generated/typography.css';
9
+ @import './generated/typography-headings.css';
9
10
  @import './layout.css';
10
11
  /* Must precede utilities.css: both are `vitops.utilities`, and utilities.css
11
12
  re-emits `.<bp>-flex` AFTER its own `.hidden` so `class="hidden md-flex"`
@@ -53,6 +54,7 @@
53
54
  @import './patterns/table.css';
54
55
  @import './patterns/details.css';
55
56
  @import './patterns/comment.css';
57
+ @import './patterns/review.css';
56
58
  @import './patterns/banner.css';
57
59
  @import './patterns/consent.css';
58
60
  @import './patterns/list.css';
@@ -6,10 +6,13 @@
6
6
  * concerns — "a grid of images" and "view one full-screen" — and only the dialog
7
7
  * half needs the `lightbox` name; the grid never was one.
8
8
  *
9
- * `<wc-gallery>` wraps this and augments the per-image `.lightbox-dialog`s it finds
10
- * with prev/next, arrow keys, swipe and a counter. With no JS each `.gallery__trigger`
11
- * is a real `command="show-modal" commandfor="…"` invoker for its own dialog, so the
12
- * grid + dialogs already form a working modal lightbox before any script runs.
9
+ * `<wc-gallery>` wraps this and the single `.lightbox-dialog` it opens, running the
10
+ * thumbnail → full-image view-transition morph; stepping between images is a
11
+ * `<wc-carousel>` scroll inside that dialog, not a second dialog. With no JS each
12
+ * `.gallery__trigger` is a real `<a href="#slide-id">` into the carousel's own
13
+ * `<li id="slide-id">`, and `:has(:target)` in lightbox.css is what reveals the
14
+ * dialog — so the grid + dialog already form a working modal lightbox, with
15
+ * prev/next, before any script runs.
13
16
  */
14
17
 
15
18
  wc-gallery {
@@ -40,6 +43,7 @@ wc-gallery {
40
43
  padding: 0;
41
44
  background: none;
42
45
  border: none;
46
+ text-decoration: none;
43
47
  cursor: pointer;
44
48
 
45
49
  &:focus-visible {
@@ -2,10 +2,17 @@
2
2
  * Lightbox — the full-screen `<dialog>` a gallery trigger opens.
3
3
  * Consumes the generated token cascade (src/css/generated/tokens.css).
4
4
  *
5
- * The thumbnail grid that drives this moved to `patterns/gallery.css`
5
+ * The thumbnail grid that drives this lives in `patterns/gallery.css`
6
6
  * (`.gallery` / `.gallery__item` / `.gallery__trigger` / `.gallery__thumb`) — this
7
7
  * partial owns only the dialog a trigger opens. `<Gallery />` emits both; this
8
8
  * file has no opinion on what triggers it.
9
+ *
10
+ * **One dialog, one carousel** — not one dialog per image. Stepping between
11
+ * images is a scroll inside an already-open dialog (`.carousel`, patterns/
12
+ * carousel.css), so there is no close-one/open-another sequence for the top-layer
13
+ * driver in animation.css to double-animate. `<wc-gallery>` only opens/closes;
14
+ * `<wc-carousel>` (nested inside, `<Gallery />` emits both tags) owns prev/next,
15
+ * dots, arrow keys and swipe — reused rather than re-implemented.
9
16
  */
10
17
 
11
18
  /* ── Lightbox dialog — full-screen, w/ view transitions ─────────────────────── */
@@ -22,7 +29,7 @@ dialog.lightbox-dialog {
22
29
  background: var(--lightbox-dialog-bg, oklch(0 0 0 / 0.92));
23
30
  color: #fff;
24
31
  display: grid;
25
- place-items: center;
32
+ place-items: stretch;
26
33
 
27
34
  /* No scrim. Stated through popover.css's token rather than overriding its
28
35
  ::backdrop rule, so it keeps the shared fade timing. */
@@ -31,7 +38,8 @@ dialog.lightbox-dialog {
31
38
  /* The entry, as effect vars rather than a keyframe — same approach as
32
39
  dialog.css, and for the same reason: the top-layer driver in animation.css
33
40
  then animates this OUT too, which an `animation:` on `[open]` never does
34
- (it only ever plays once, on open). */
41
+ (it only ever plays once, on open). Runs on real open/close ONLY — stepping
42
+ between slides never opens or closes this dialog, so it can never fire here. */
35
43
  --opacity-from: 0;
36
44
  --scale-x-from: 0.95;
37
45
  --scale-y-from: 0.95;
@@ -40,26 +48,79 @@ dialog.lightbox-dialog {
40
48
  display: grid;
41
49
  }
42
50
 
43
- .lightbox-dialog__content {
44
- position: relative;
45
- max-inline-size: 90vw;
46
- max-block-size: 90vh;
47
- display: flex;
48
- align-items: center;
49
- justify-content: center;
51
+ /* ── No-JS fallback: `:target` + `:has()` ──────────────────────────────────
52
+ A `.gallery__trigger` is a real `<a href="#slide-id">`. Following it makes
53
+ that slide's `<li>` match `:target`, which this rule alone is what reveals
54
+ the dialog — no Invoker Commands, no polyfill, in every engine that has
55
+ `:has()` (Safari 15.4+, Chromium 105+, Firefox 121+). The browser's own
56
+ fragment-navigation scroll then lands the carousel on the right slide,
57
+ because the target lives inside `.carousel__track`.
58
+
59
+ `:not([open])` is load-bearing: once `<wc-gallery>` opens this for real via
60
+ `showModal()`, `[open]` is present and this rule must yield to it — a stale
61
+ `:target` from a previous no-JS visit must not fight the real modal, and
62
+ must not keep the dialog "open" by this rule alone once JS is stepping
63
+ between slides (which never changes the URL fragment). */
64
+ &:not([open]):has(:target) {
65
+ display: grid;
66
+ position: fixed;
67
+ inset: 0;
68
+ z-index: var(--lightbox-z, 100);
50
69
  }
51
70
 
52
- .lightbox-dialog__image {
71
+ .lightbox-dialog__track {
53
72
  max-inline-size: 100%;
54
- max-block-size: 90vh;
55
- object-fit: contain;
56
-
57
- /* `<wc-gallery>` assigns `view-transition-name: lightbox-active` to this and
58
- the originating thumbnail at the moment it opens, then clears it on close —
59
- that shared, runtime-assigned name is what morphs one into the other.
60
- `match-element` (the auto-generated per-element name) does NOT do this: it
61
- names each element uniquely, so it can never morph a thumbnail into a
62
- different `<img>`. Do not put a `view-transition-name` here statically. */
73
+ max-block-size: 100%;
74
+
75
+ /* `.carousel__media`'s own rule reads this for its `object-fit` (default
76
+ `cover`, right for a thumbnail strip, wrong for a full image — nothing
77
+ here should be cropped). Nesting under `dialog.lightbox-dialog` gives
78
+ this whole block higher specificity than carousel.css's bare
79
+ `.carousel__media` rule regardless of import order, so it always wins. */
80
+ --carousel-media-fit: contain;
81
+
82
+ .carousel__track {
83
+ max-block-size: 100%;
84
+ }
85
+
86
+ /* Breathing room against the edge-to-edge dialog, on the SLIDE rather than
87
+ the media box — a slide is the grid item `align-items: stretch` fills to
88
+ the track's full height, so padding here is what keeps the image off the
89
+ glass instead of the media box's aspect-ratio doing it. */
90
+ .carousel__slide {
91
+ box-sizing: border-box;
92
+ padding: 5vh 5vw;
93
+ }
94
+
95
+ .carousel__media {
96
+ /* Full images vary wildly in ratio; let each fill its slide instead of
97
+ carousel.css's fixed 16/9 box (right for a thumbnail strip, wrong
98
+ here). */
99
+ aspect-ratio: unset;
100
+ block-size: 100%;
101
+
102
+ /* Painted the instant a slide is visible, whether or not the full image
103
+ has loaded yet — the morph target is never an empty box. Set per-slide
104
+ by `<Gallery />` from the thumbnail URL; declared as a var rather than
105
+ a bare property so a slide that omits a thumb (no placeholder) simply
106
+ paints nothing extra. */
107
+ background-image: var(--lightbox-placeholder, none);
108
+ background-size: contain;
109
+ background-position: center;
110
+ background-repeat: no-repeat;
111
+
112
+ /* `<wc-gallery>` assigns `view-transition-name: lightbox-active` to the
113
+ slide's `<img>` and the originating thumbnail at the moment it opens,
114
+ then clears it on close — that shared, runtime-assigned name is what
115
+ morphs one into the other. `match-element` (the auto-generated
116
+ per-element name) does NOT do this: it names each element uniquely,
117
+ so it can never morph a thumbnail into a different `<img>`. Do not put
118
+ a `view-transition-name` on the image here statically. */
119
+ }
120
+
121
+ .carousel__caption {
122
+ color: inherit;
123
+ }
63
124
  }
64
125
 
65
126
  .lightbox-dialog__close {
@@ -77,6 +138,9 @@ dialog.lightbox-dialog {
77
138
  display: flex;
78
139
  align-items: center;
79
140
  justify-content: center;
141
+ text-decoration: none;
142
+ font-size: 1.5rem;
143
+ line-height: 1;
80
144
  transition: background-color 0.15s ease;
81
145
  z-index: 10;
82
146
 
@@ -88,50 +152,4 @@ dialog.lightbox-dialog {
88
152
  outline-offset: 2px;
89
153
  }
90
154
  }
91
-
92
- .lightbox-dialog__nav {
93
- position: absolute;
94
- inset-block: 0;
95
- display: flex;
96
- align-items: center;
97
- padding: 1rem;
98
-
99
- &[data-direction='prev'] {
100
- inset-inline-start: 0;
101
- }
102
- &[data-direction='next'] {
103
- inset-inline-end: 0;
104
- }
105
- }
106
-
107
- .lightbox-dialog__nav-button {
108
- inline-size: 3rem;
109
- block-size: 3rem;
110
- padding: 0;
111
- background: var(--lightbox-nav-bg, transparent);
112
- border: none;
113
- border-radius: 50%;
114
- color: inherit;
115
- cursor: pointer;
116
- display: flex;
117
- align-items: center;
118
- justify-content: center;
119
- transition: background-color 0.15s ease;
120
-
121
- &:hover {
122
- background: var(--lightbox-nav-hover-bg, oklch(1 0 0 / 0.15));
123
- }
124
- &:disabled {
125
- opacity: 0.3;
126
- cursor: not-allowed;
127
- }
128
- }
129
-
130
- .lightbox-dialog__caption {
131
- position: absolute;
132
- inset-block-end: 0;
133
- inset-inline: 0;
134
- padding: 1rem 2rem;
135
- text-align: center;
136
- }
137
155
  }
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Review — the `.review` card's structure only.
3
+ *
4
+ * Box chrome (border/padding/background/shadow) is CONFIG-GENERATED
5
+ * (`patterns.items.review` in design-system.json), the same split `card.css`
6
+ * documents. This partial holds what the framework owns: the internal layout —
7
+ * rating, identity, body, reply, source link.
8
+ */
9
+
10
+ .review {
11
+ .review__header {
12
+ display: flex;
13
+ flex-wrap: wrap;
14
+ align-items: center;
15
+ gap: 0.75rem;
16
+ }
17
+
18
+ .review__avatar {
19
+ inline-size: 2.5rem;
20
+ block-size: 2.5rem;
21
+ border-radius: 50%;
22
+ object-fit: cover;
23
+ }
24
+
25
+ /* Shown instead of `.review__avatar` when `avatars` is off (the default) — see
26
+ the config-generated pattern's rationale in AGENTS.md's Reviews section. */
27
+ .review__initials {
28
+ display: inline-flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ inline-size: 2.5rem;
32
+ block-size: 2.5rem;
33
+ border-radius: 50%;
34
+ background: var(--color-bg-neutral-muted);
35
+ color: var(--color-text-neutral);
36
+ font-weight: 600;
37
+ font-size: 0.875em;
38
+ }
39
+
40
+ .review__identity {
41
+ display: flex;
42
+ flex-direction: column;
43
+ gap: 0.125rem;
44
+ }
45
+
46
+ .review__author {
47
+ font-weight: 600;
48
+ }
49
+
50
+ .review__date {
51
+ font-size: 0.875em;
52
+ opacity: 0.7;
53
+ }
54
+
55
+ .review__stars {
56
+ display: inline-flex;
57
+ align-items: center;
58
+ gap: 0.125rem;
59
+ margin-inline-start: auto;
60
+ }
61
+
62
+ .review__star--empty {
63
+ opacity: 0.35;
64
+ }
65
+
66
+ .review__body {
67
+ margin: 0;
68
+ }
69
+
70
+ .review__reply {
71
+ margin-inline-start: 1.5rem;
72
+ padding-inline-start: 1rem;
73
+ border-inline-start: 2px solid var(--color-bg-surface-muted);
74
+ }
75
+
76
+ .review__reply-author {
77
+ font-weight: 600;
78
+ font-size: 0.875em;
79
+ }
80
+
81
+ .review__source {
82
+ font-size: 0.875em;
83
+ align-self: start;
84
+ }
85
+ }
86
+
87
+ .review-list {
88
+ display: flex;
89
+ flex-direction: column;
90
+ gap: 1.5rem;
91
+ }
package/dist/elements.js CHANGED
@@ -41,10 +41,10 @@
41
41
  * Copyright 2020 Google LLC
42
42
  * SPDX-License-Identifier: BSD-3-Clause
43
43
  */
44
- const e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;var i=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,n=this.t;if(t&&e===void 0){let t=n!==void 0&&n.length===1;t&&(e=r.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}};const a=e=>new i(typeof e==`string`?e:e+``,void 0,n),o=(e,...t)=>new i(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,n),s=(n,r)=>{if(t)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let t of r){let r=document.createElement(`style`),i=e.litNonce;i!==void 0&&r.setAttribute(`nonce`,i),r.textContent=t.cssText,n.appendChild(r)}},c=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return a(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:d,getOwnPropertyNames:ee,getOwnPropertySymbols:te,getPrototypeOf:ne}=Object,f=globalThis,re=f.trustedTypes,ie=re?re.emptyScript:``,ae=f.reactiveElementPolyfillSupport,p=(e,t)=>e,oe={toAttribute(e,t){switch(t){case Boolean:e=e?ie:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},se=(e,t)=>!l(e,t),ce={attribute:!0,type:String,converter:oe,reflect:!1,useDefault:!1,hasChanged:se};Symbol.metadata??=Symbol(`metadata`),f.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ce){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ce}static _$Ei(){if(this.hasOwnProperty(p(`elementProperties`)))return;let e=ne(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(p(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(p(`properties`))){let e=this.properties,t=[...ee(e),...te(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(c(e))}else e!==void 0&&t.push(c(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?oe:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?oe:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??se)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};m.elementStyles=[],m.shadowRootOptions={mode:`open`},m[p(`elementProperties`)]=new Map,m[p(`finalized`)]=new Map,ae?.({ReactiveElement:m}),(f.reactiveElementVersions??=[]).push(`2.1.2`);const h=globalThis,le=e=>e,g=h.trustedTypes,ue=g?g.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,de=`$lit$`,_=`lit$${Math.random().toFixed(9).slice(2)}$`,fe=`?`+_,pe=`<${fe}>`,v=document,y=()=>v.createComment(``),b=e=>e===null||typeof e!=`object`&&typeof e!=`function`,me=Array.isArray,he=e=>me(e)||typeof e?.[Symbol.iterator]==`function`,x=`[
45
- \f\r]`,S=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ge=/-->/g,_e=/>/g,C=RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ve=/'/g,ye=/"/g,be=/^(?:script|style|textarea|title)$/i,xe=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),w=Symbol.for(`lit-noChange`),T=Symbol.for(`lit-nothing`),Se=new WeakMap,E=v.createTreeWalker(v,129);function Ce(e,t){if(!me(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return ue===void 0?t:ue.createHTML(t)}const we=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=S;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===S?c[1]===`!--`?o=ge:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=C):(be.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=C):o=_e:o===C?c[0]===`>`?(o=i??S,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?C:c[3]===`"`?ye:ve):o===ye||o===ve?o=C:o===ge||o===_e?o=S:(o=C,i=void 0);let d=o===C&&e[t+1].startsWith(`/>`)?` `:``;a+=o===S?n+pe:l>=0?(r.push(s),n.slice(0,l)+de+n.slice(l)+_+d):n+_+(l===-2?t:d)}return[Ce(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]};var D=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=we(t,n);if(this.el=e.createElement(l,r),E.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=E.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(de)){let t=u[o++],n=i.getAttribute(e).split(_),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Ee:r[1]===`?`?De:r[1]===`@`?Oe:A}),i.removeAttribute(e)}else e.startsWith(_)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(be.test(i.tagName)){let e=i.textContent.split(_),t=e.length-1;if(t>0){i.textContent=g?g.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],y()),E.nextNode(),c.push({type:2,index:++a});i.append(e[t],y())}}}else if(i.nodeType===8)if(i.data===fe)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(_,e+1))!==-1;)c.push({type:7,index:a}),e+=_.length-1}a++}}static createElement(e,t){let n=v.createElement(`template`);return n.innerHTML=e,n}};function O(e,t,n=e,r){if(t===w)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=b(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=O(e,i._$AS(e,t.values),i,r)),t}var Te=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??v).importNode(t,!0);E.currentNode=r;let i=E.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new k(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new ke(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=E.nextNode(),a++)}return E.currentNode=v,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},k=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=O(this,e,t),b(e)?e===T||e==null||e===``?(this._$AH!==T&&this._$AR(),this._$AH=T):e!==this._$AH&&e!==w&&this._(e):e._$litType$===void 0?e.nodeType===void 0?he(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==T&&b(this._$AH)?this._$AA.nextSibling.data=e:this.T(v.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=D.createElement(Ce(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Te(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=Se.get(e.strings);return t===void 0&&Se.set(e.strings,t=new D(e)),t}k(t){me(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(y()),this.O(y()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=le(e).nextSibling;le(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},A=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=T,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=T}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=O(this,e,t,0),a=!b(e)||e!==this._$AH&&e!==w,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=O(this,r[n+o],t,o),s===w&&(s=this._$AH[o]),a||=!b(s)||s!==this._$AH[o],s===T?e=T:e!==T&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Ee=class extends A{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===T?void 0:e}},De=class extends A{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==T)}},Oe=class extends A{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=O(this,e,t,0)??T)===w)return;let n=this._$AH,r=e===T&&n!==T||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==T&&(n===T||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ke=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){O(this,e)}};const Ae={M:de,P:_,A:fe,C:1,L:we,R:Te,D:he,V:O,I:k,H:A,N:De,U:Oe,B:Ee,F:ke},je=h.litHtmlPolyfillSupport;je?.(D,k),(h.litHtmlVersions??=[]).push(`3.3.3`);const Me=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new k(t.insertBefore(y(),e),e,void 0,n??{})}return i._$AI(e),i},Ne=globalThis;var j=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Me(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return w}};j._$litElement$=!0,j.finalized=!0,Ne.litElementHydrateSupport?.({LitElement:j});const Pe=Ne.litElementPolyfillSupport;Pe?.({LitElement:j}),(Ne.litElementVersions??=[]).push(`4.2.2`);var Fe=Object.defineProperty,Ie=(e,t,n)=>t in e?Fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Le=(e,t,n)=>(Ie(e,typeof t==`symbol`?t:t+``,n),n),Re=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},ze=(e,t)=>{if(Object(t)!==t)throw TypeError(`Cannot use the "in" operator on this value`);return e.has(t)},M=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Be=(e,t,n)=>(Re(e,t,`access private method`),n);function Ve(e,t){return Object.is(e,t)}let N=null,P=!1,F=1;const I=Symbol(`SIGNAL`);function L(e){let t=N;return N=e,t}function He(){return N}function Ue(){return P}const We={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function R(e){if(P)throw Error(typeof ngDevMode<`u`&&ngDevMode?`Assertion error: signal read during notification phase`:``);if(N===null)return;N.consumerOnSignalRead(e);let t=N.nextProducerIndex++;if(V(N),t<N.producerNode.length&&N.producerNode[t]!==e&&B(N)){let e=N.producerNode[t];z(e,N.producerIndexOfThis[t])}N.producerNode[t]!==e&&(N.producerNode[t]=e,N.producerIndexOfThis[t]=B(N)?$e(e,N,t):0),N.producerLastReadVersion[t]=e.version}function Ge(){F++}function Ke(e){if(!(!e.dirty&&e.lastCleanEpoch===F)){if(!e.producerMustRecompute(e)&&!Qe(e)){e.dirty=!1,e.lastCleanEpoch=F;return}e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=F}}function qe(e){if(e.liveConsumerNode===void 0)return;let t=P;P=!0;try{for(let t of e.liveConsumerNode)t.dirty||Ye(t)}finally{P=t}}function Je(){return N?.consumerAllowSignalWrites!==!1}function Ye(e){var t;e.dirty=!0,qe(e),(t=e.consumerMarkedDirty)==null||t.call(e.wrapper??e)}function Xe(e){return e&&(e.nextProducerIndex=0),L(e)}function Ze(e,t){if(L(t),!(!e||e.producerNode===void 0||e.producerIndexOfThis===void 0||e.producerLastReadVersion===void 0)){if(B(e))for(let t=e.nextProducerIndex;t<e.producerNode.length;t++)z(e.producerNode[t],e.producerIndexOfThis[t]);for(;e.producerNode.length>e.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function Qe(e){V(e);for(let t=0;t<e.producerNode.length;t++){let n=e.producerNode[t],r=e.producerLastReadVersion[t];if(r!==n.version||(Ke(n),r!==n.version))return!0}return!1}function $e(e,t,n){var r;if(H(e),V(e),e.liveConsumerNode.length===0){(r=e.watched)==null||r.call(e.wrapper);for(let t=0;t<e.producerNode.length;t++)e.producerIndexOfThis[t]=$e(e.producerNode[t],e,t)}return e.liveConsumerIndexOfThis.push(n),e.liveConsumerNode.push(t)-1}function z(e,t){var n;if(H(e),V(e),typeof ngDevMode<`u`&&ngDevMode&&t>=e.liveConsumerNode.length)throw Error(`Assertion error: active consumer index ${t} is out of bounds of ${e.liveConsumerNode.length} consumers)`);if(e.liveConsumerNode.length===1){(n=e.unwatched)==null||n.call(e.wrapper);for(let t=0;t<e.producerNode.length;t++)z(e.producerNode[t],e.producerIndexOfThis[t])}let r=e.liveConsumerNode.length-1;if(e.liveConsumerNode[t]=e.liveConsumerNode[r],e.liveConsumerIndexOfThis[t]=e.liveConsumerIndexOfThis[r],e.liveConsumerNode.length--,e.liveConsumerIndexOfThis.length--,t<e.liveConsumerNode.length){let n=e.liveConsumerIndexOfThis[t],r=e.liveConsumerNode[t];V(r),r.producerIndexOfThis[n]=t}}function B(e){return e.consumerIsAlwaysLive||(e?.liveConsumerNode?.length??0)>0}function V(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function H(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function et(e){if(Ke(e),R(e),e.value===nt)throw e.error;return e.value}function tt(e){let t=Object.create(rt);t.computation=e;let n=()=>et(t);return n[I]=t,n}const U=Symbol(`UNSET`),W=Symbol(`COMPUTING`),nt=Symbol(`ERRORED`),rt={...We,value:U,dirty:!0,error:null,equal:Ve,producerMustRecompute(e){return e.value===U||e.value===W},producerRecomputeValue(e){if(e.value===W)throw Error(`Detected cycle in computations.`);let t=e.value;e.value=W;let n=Xe(e),r,i=!1;try{r=e.computation.call(e.wrapper),i=t!==U&&t!==nt&&e.equal.call(e.wrapper,t,r)}catch(t){r=nt,e.error=t}finally{Ze(e,n)}if(i){e.value=t;return}e.value=r,e.version++}};function it(){throw Error()}let at=it;function ot(){at()}function st(e){let t=Object.create(ut);t.value=e;let n=()=>(R(t),t.value);return n[I]=t,n}function ct(){return R(this),this.value}function lt(e,t){Je()||ot(),e.equal.call(e.wrapper,e.value,t)||(e.value=t,dt(e))}const ut={...We,equal:Ve,value:void 0};function dt(e){e.version++,Ge(),qe(e)}const G=Symbol(`node`);var K;(e=>{var t,n,r,i;class a{constructor(r,i={}){M(this,n),Le(this,t);let a=st(r)[I];if(this[G]=a,a.wrapper=this,i){let t=i.equals;t&&(a.equal=t),a.watched=i[e.subtle.watched],a.unwatched=i[e.subtle.unwatched]}}get(){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.get`);return ct.call(this[G])}set(t){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.set`);if(Ue())throw Error(`Writes to signals not permitted during Watcher callback`);let n=this[G];lt(n,t)}}t=G,n=new WeakSet,e.isState=e=>typeof e==`object`&&ze(n,e),e.State=a;class o{constructor(t,n){M(this,i),Le(this,r);let a=tt(t)[I];if(a.consumerAllowSignalWrites=!0,this[G]=a,a.wrapper=this,n){let t=n.equals;t&&(a.equal=t),a.watched=n[e.subtle.watched],a.unwatched=n[e.subtle.unwatched]}}get(){if(!(0,e.isComputed)(this))throw TypeError(`Wrong receiver type for Signal.Computed.prototype.get`);return et(this[G])}}r=G,i=new WeakSet,e.isComputed=e=>typeof e==`object`&&ze(i,e),e.Computed=o,(t=>{var n,r,i,a;function o(e){let t,n=null;try{n=L(null),t=e()}finally{L(n)}return t}t.untrack=o;function s(t){if(!(0,e.isComputed)(t)&&!(0,e.isWatcher)(t))throw TypeError(`Called introspectSources without a Computed or Watcher argument`);return t[G].producerNode?.map(e=>e.wrapper)??[]}t.introspectSources=s;function c(t){if(!(0,e.isComputed)(t)&&!(0,e.isState)(t))throw TypeError(`Called introspectSinks without a Signal argument`);return t[G].liveConsumerNode?.map(e=>e.wrapper)??[]}t.introspectSinks=c;function l(t){if(!(0,e.isComputed)(t)&&!(0,e.isState)(t))throw TypeError(`Called hasSinks without a Signal argument`);let n=t[G].liveConsumerNode;return n?n.length>0:!1}t.hasSinks=l;function u(t){if(!(0,e.isComputed)(t)&&!(0,e.isWatcher)(t))throw TypeError(`Called hasSources without a Computed or Watcher argument`);let n=t[G].producerNode;return n?n.length>0:!1}t.hasSources=u;class d{constructor(e){M(this,r),M(this,i),Le(this,n);let t=Object.create(We);t.wrapper=this,t.consumerMarkedDirty=e,t.consumerIsAlwaysLive=!0,t.consumerAllowSignalWrites=!1,t.producerNode=[],this[G]=t}watch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);Be(this,i,a).call(this,t);let n=this[G];n.dirty=!1;let r=L(n);for(let e of t)R(e[G]);L(r)}unwatch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);Be(this,i,a).call(this,t);let n=this[G];V(n);for(let e=n.producerNode.length-1;e>=0;e--)if(t.includes(n.producerNode[e].wrapper)){z(n.producerNode[e],n.producerIndexOfThis[e]);let t=n.producerNode.length-1;if(n.producerNode[e]=n.producerNode[t],n.producerIndexOfThis[e]=n.producerIndexOfThis[t],n.producerNode.length--,n.producerIndexOfThis.length--,n.nextProducerIndex--,e<n.producerNode.length){let t=n.producerIndexOfThis[e],r=n.producerNode[e];H(r),r.liveConsumerIndexOfThis[t]=e}}}getPending(){if(!(0,e.isWatcher)(this))throw TypeError(`Called getPending without Watcher receiver`);return this[G].producerNode.filter(e=>e.dirty).map(e=>e.wrapper)}}n=G,r=new WeakSet,i=new WeakSet,a=function(t){for(let n of t)if(!(0,e.isComputed)(n)&&!(0,e.isState)(n))throw TypeError(`Called watch/unwatch without a Computed or State argument`)},e.isWatcher=e=>ze(r,e),t.Watcher=d;function ee(){return He()?.wrapper}t.currentComputed=ee,t.watched=Symbol(`watched`),t.unwatched=Symbol(`unwatched`)})(e.subtle||={})})(K||={});let ft=!1;const pt=new K.subtle.Watcher(()=>{ft||(ft=!0,queueMicrotask(()=>{ft=!1;for(let e of pt.getPending())e.get();pt.watch()}))}),mt=Symbol(`SignalWatcherBrand`),ht=new FinalizationRegistry(e=>{e.unwatch(...K.subtle.introspectSources(e))}),gt=new WeakMap;function _t(e){return!0===e[mt]?(console.warn(`SignalWatcher should not be applied to the same class more than once.`),e):class extends e{constructor(){super(...arguments),this._$St=new Map,this._$So=new K.State(0),this._$Si=!1}_$Sl(){var e;let t=[],n=[];this._$St.forEach((e,r)=>{(e?.beforeUpdate?t:n).push(r)});let r=this.h?.getPending().filter(e=>e!==this._$Su&&!this._$St.has(e));t.forEach(e=>e.get()),(e=this._$Su)==null||e.get(),r.forEach(e=>e.get()),n.forEach(e=>e.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(this.h!==void 0)return;this._$Su=new K.Computed(()=>{this._$So.get(),super.performUpdate()});let e=this.h=new K.subtle.Watcher(function(){let e=gt.get(this);e!==void 0&&(!1===e._$Si&&(new Set(this.getPending()).has(e._$Su)?e.requestUpdate():e._$Sv()),this.watch())});gt.set(e,this),ht.register(this,e),e.watch(this._$Su),e.watch(...Array.from(this._$St).map(([e])=>e))}_$Sp(){if(this.h===void 0)return;let e=!1;this.h.unwatch(...K.subtle.introspectSources(this.h).filter(t=>{let n=!0!==this._$St.get(t)?.manualDispose;return n&&this._$St.delete(t),e||=!n,n})),e||(this._$Su=void 0,this.h=void 0,this._$St.clear())}updateEffect(e,t){var n;this._$S_();let r=new K.Computed(()=>{e()});return this.h.watch(r),this._$St.set(r,t),(n=t?.beforeUpdate)!=null&&n?K.subtle.untrack(()=>r.get()):this.updateComplete.then(()=>K.subtle.untrack(()=>r.get())),()=>{this._$St.delete(r),this.h.unwatch(r),!1===this.isConnected&&this._$Sp()}}performUpdate(){this.isUpdatePending&&(this._$S_(),this._$Si=!0,this._$So.set(this._$So.get()+1),this._$Si=!1,this._$Sl())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{!1===this.isConnected&&this._$Sp()})}}}const vt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},yt=e=>(...t)=>({_$litDirective$:e,values:t});var bt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};const{I:xt}=Ae,St=e=>e.strings===void 0,q=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),q(e,t);return!0},J=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},Ct=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Et(t)}};function wt(e){this._$AN===void 0?this._$AM=e:(J(this),this._$AM=e,Ct(this))}function Tt(e,t=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let e=n;e<r.length;e++)q(r[e],!1),J(r[e]);else r!=null&&(q(r,!1),J(r));else q(this,e)}const Et=e=>{e.type==vt.CHILD&&(e._$AP??=Tt,e._$AQ??=wt)};var Dt=class extends bt{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Ct(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(q(this,e),J(this))}setValue(e){if(St(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};let Ot=!1;const kt=new K.subtle.Watcher(async()=>{Ot||(Ot=!0,queueMicrotask(()=>{Ot=!1;for(let e of kt.getPending())e.get();kt.watch()}))}),At=yt(class extends Dt{_$S_(){this._$Sm===void 0&&(this._$Sj=new K.Computed(()=>{let e=this._$SW?.get();return this.setValue(e),e}),this._$Sm=this._$Sk?.h??kt,this._$Sm.watch(this._$Sj),K.subtle.untrack(()=>this._$Sj?.get()))}_$Sp(){this._$Sm!==void 0&&(this._$Sm.unwatch(this._$SW),this._$Sm=void 0)}render(e){return K.subtle.untrack(()=>e.get())}update(e,[t]){return this._$Sk??=e.options?.host,t!==this._$SW&&this._$SW!==void 0&&this._$Sp(),this._$SW=t,this._$S_(),K.subtle.untrack(()=>this._$SW.get())}disconnected(){this._$Sp()}reconnected(){this._$S_()}}),Y=(e=>(t,...n)=>e(t,...n.map(e=>e instanceof K.State||e instanceof K.Computed?At(e):e)))(xe);K.State,K.Computed;const jt=_t(j);var X=class extends jt{static{this.styles=[]}getSlottedNodes(e=[]){let t=this.shadowRoot?.querySelector(`slot`);if(!t)return[];let n=t.assignedNodes({flatten:!0});return e.length===0?n:n.filter(t=>e.includes(t.tagName.toLowerCase()))}},Mt=class{constructor(e,t){this.handleEl=null,this.isDragging=!1,this.rafId=null,this.pendingPosition=null,this.containerRect=null,this.currentPosition=.5,this.prefersReducedMotion=!1,this.onPointerDown=e=>{if(e.button!==0)return;e.preventDefault(),this.isDragging=!0,this.handleEl?.setPointerCapture(e.pointerId);let t=this.handleEl?.parentElement;this.containerRect=t?.getBoundingClientRect()??null,document.addEventListener(`pointermove`,this.onPointerMove),document.addEventListener(`pointerup`,this.onPointerUp),document.addEventListener(`pointercancel`,this.onPointerUp),this.handleEl?.classList.add(`dragging`),this.options.onDragStart(),this.processPointerEvent(e)},this.onPointerMove=e=>{this.isDragging&&this.processPointerEvent(e)},this.flushPosition=()=>{this.rafId=null,this.pendingPosition!==null&&this.isDragging&&(this.currentPosition=this.pendingPosition,this.updateAriaValue(this.currentPosition),this.options.onDrag(this.currentPosition))},this.onPointerUp=e=>{if(!this.isDragging)return;this.isDragging=!1,this.handleEl?.releasePointerCapture(e.pointerId),this.containerRect=null,this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null);let t=this.pendingPosition??this.currentPosition;this.currentPosition=t,this.pendingPosition=null,this.updateAriaValue(t),this.options.onDragEnd(t),document.removeEventListener(`pointermove`,this.onPointerMove),document.removeEventListener(`pointerup`,this.onPointerUp),document.removeEventListener(`pointercancel`,this.onPointerUp),this.handleEl?.classList.remove(`dragging`)},this.onKeyDown=e=>{let{orientation:t,keyboardStep:n,keyboardLargeStep:r}=this.options,i=e.shiftKey?r:n,a=0;if(t===`horizontal`?e.key===`ArrowLeft`?a=-i:e.key===`ArrowRight`&&(a=i):e.key===`ArrowUp`?a=-i:e.key===`ArrowDown`&&(a=i),e.key===`Home`){e.preventDefault(),this.currentPosition=0,this.updateAriaValue(0),this.options.onDrag(0),this.options.onDragEnd(0);return}if(e.key===`End`){e.preventDefault(),this.currentPosition=1,this.updateAriaValue(1),this.options.onDrag(1),this.options.onDragEnd(1);return}if(a!==0){e.preventDefault();let t=Math.max(0,Math.min(1,this.currentPosition+a));this.currentPosition=t,this.updateAriaValue(t),this.options.onDrag(t),this.options.onDragEnd(t)}},this.host=e,this.options={handleSelector:t.handleSelector,orientation:t.orientation??`horizontal`,smooth:t.smooth??!0,onDrag:t.onDrag??(()=>{}),onDragStart:t.onDragStart??(()=>{}),onDragEnd:t.onDragEnd??(()=>{}),keyboardStep:t.keyboardStep??.01,keyboardLargeStep:t.keyboardLargeStep??.1},e.addController(this)}hostConnected(){this.prefersReducedMotion=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}hostUpdated(){this.setupHandle()}hostDisconnected(){this.cleanup()}get shouldSmooth(){return this.options.smooth&&!this.prefersReducedMotion}setupHandle(){let e=this.host.renderRoot.querySelector(this.options.handleSelector);e!==this.handleEl&&(this.handleEl&&(this.handleEl.removeEventListener(`pointerdown`,this.onPointerDown),this.handleEl.removeEventListener(`keydown`,this.onKeyDown)),this.handleEl=e,this.handleEl&&(this.handleEl.addEventListener(`pointerdown`,this.onPointerDown),this.handleEl.addEventListener(`keydown`,this.onKeyDown),this.handleEl.hasAttribute(`tabindex`)||this.handleEl.setAttribute(`tabindex`,`0`),this.handleEl.hasAttribute(`role`)||this.handleEl.setAttribute(`role`,`separator`),this.handleEl.setAttribute(`aria-valuemin`,`0`),this.handleEl.setAttribute(`aria-valuemax`,`100`),this.updateAriaValue(this.currentPosition)))}processPointerEvent(e){if(!this.containerRect)return;let{orientation:t}=this.options,n=this.containerRect,r;if(t===`horizontal`){let t=e.clientX-n.left;r=Math.max(0,Math.min(1,t/n.width))}else{let t=e.clientY-n.top;r=Math.max(0,Math.min(1,t/n.height))}this.pendingPosition=r,this.shouldSmooth&&this.rafId===null&&(this.rafId=requestAnimationFrame(this.flushPosition))}updateAriaValue(e){let t=Math.round(e*100);this.handleEl?.setAttribute(`aria-valuenow`,String(t))}cleanup(){this.handleEl&&(this.handleEl.removeEventListener(`pointerdown`,this.onPointerDown),this.handleEl.removeEventListener(`keydown`,this.onKeyDown)),document.removeEventListener(`pointermove`,this.onPointerMove),document.removeEventListener(`pointerup`,this.onPointerUp),document.removeEventListener(`pointercancel`,this.onPointerUp),this.rafId!==null&&cancelAnimationFrame(this.rafId)}setPosition(e){this.currentPosition=Math.max(0,Math.min(1,e)),this.updateAriaValue(this.currentPosition)}getPosition(){return this.currentPosition}updateOptions(e){Object.assign(this.options,e)}},Nt=class extends X{static{this.styles=[X.styles,o`
46
- :host{--_offset:var(--offset, 0.5);--_handle-size:var(--handle-size, 8px);--_handle-color:var(--handle-color, oklch(0.85 0 0));--_handle-hover:var(--handle-hover-color, oklch(0.7 0 0));--_min-size:var(--min-panel-size, 100px);display:block}.splitter{display:grid;block-size:100%;inline-size:100%}:host(:not([vertical])) .splitter{grid-template-columns:calc(var(--_offset)*(100% - var(--_handle-size))) var(--_handle-size) calc((1 - var(--_offset))*(100% - var(--_handle-size)));grid-template-rows:1fr}:host([vertical]) .splitter{grid-template-rows:calc(var(--_offset)*(100% - var(--_handle-size))) var(--_handle-size) calc((1 - var(--_offset))*(100% - var(--_handle-size)));grid-template-columns:1fr}.panel{overflow:auto;min-inline-size:0;min-block-size:0}.panel--start{grid-area:1/1}:host(:not([vertical])) .panel--end{grid-area:1/3}:host([vertical]) .panel--end{grid-area:3/1}.handle{flex-shrink:0;background:var(--_handle-color);transition:background-color .15s ease;position:relative;display:flex;align-items:center;justify-content:center}.handle:focus-visible,.handle:hover{background:var(--_handle-hover)}.handle:focus-visible{outline:2px solid oklch(.6 .2 250);outline-offset:-2px}:host(:not([vertical])) .handle{cursor:col-resize;grid-area:1/2}:host([vertical]) .handle{cursor:row-resize;grid-area:2/1}.handle:after{content:"";background:currentColor;opacity:.3;border-radius:1px}:host(:not([vertical])) .handle:after{inline-size:2px;block-size:24px}:host([vertical]) .handle:after{inline-size:24px;block-size:2px}.handle.dragging{background:var(--_handle-hover)}.handle.dragging:after{opacity:.5}@media (any-pointer:coarse){:host(:not([vertical])) .handle{min-inline-size:44px}:host([vertical]) .handle{min-block-size:44px}}@media (prefers-reduced-motion:reduce){.handle{transition:none}}`]}static{this.properties={position:{type:Number},vertical:{type:Boolean,reflect:!0},discrete:{type:Boolean,reflect:!0},minSize:{type:Number,attribute:`min-size`},maxSize:{type:Number,attribute:`max-size`},keyboardStep:{type:Number,attribute:`keyboard-step`},collapseThreshold:{type:Number,attribute:`collapse-threshold`},snapPoints:{type:String,attribute:`snap-points`},snapDistance:{type:Number,attribute:`snap-distance`},_offset:{state:!0}}}constructor(){super(),this.containerSize=0,this.position=50,this.vertical=!1,this.discrete=!1,this.minSize=100,this.maxSize=0,this.keyboardStep=1,this.collapseThreshold=0,this.snapPoints=``,this.snapDistance=10,this._offset=.5,this.initDragController()}initDragController(){this.dragController=new Mt(this,{handleSelector:`[part="handle"]`,orientation:this.vertical?`vertical`:`horizontal`,smooth:!this.discrete,onDragStart:()=>this.handleDragStart(),onDrag:e=>this.handleDrag(e),onDragEnd:e=>this.handleDragEnd(e),keyboardStep:this.keyboardStep/100,keyboardLargeStep:this.keyboardStep/10})}willUpdate(e){e.has(`position`)&&!e.has(`_offset`)&&(this._offset=this.position/100,this.dragController.setPosition(this._offset)),(e.has(`vertical`)||e.has(`discrete`)||e.has(`keyboardStep`))&&this.dragController.updateOptions({orientation:this.vertical?`vertical`:`horizontal`,smooth:!this.discrete,keyboardStep:this.keyboardStep/100,keyboardLargeStep:this.keyboardStep/10})}handleDragStart(){let e=this.renderRoot.querySelector(`.splitter`);if(e){let t=e.getBoundingClientRect();this.containerSize=this.vertical?t.height:t.width}}applyConstraints(e){let t=e;if(this.containerSize>0){let e=this.minSize/this.containerSize,n=this.maxSize>0?this.maxSize/this.containerSize:1-e;t=Math.max(e,Math.min(1-e,t)),t=Math.min(n,t)}if(this.snapPoints&&this.containerSize>0){let e=this.snapPoints.split(`,`).map(e=>parseFloat(e.trim())/100),n=this.snapDistance/this.containerSize;for(let r of e)if(Math.abs(t-r)<n){t=r;break}}if(this.collapseThreshold>0){let e=this.collapseThreshold/100;t<e?t=0:t>1-e&&(t=1)}return t}handleDrag(e){let t=this.applyConstraints(e);this._offset=t,this.style.setProperty(`--_offset`,String(this._offset))}handleDragEnd(e){let t=this.applyConstraints(e);this._offset=t,this.style.setProperty(`--_offset`,String(this._offset)),this.dispatchEvent(new CustomEvent(`split-change`,{detail:{position:this._offset*100},bubbles:!0,composed:!0}))}render(){return xe` <div class="splitter" part="container" style="--_offset:${this._offset}"> <div class="panel panel--start" part="panel-start"> <slot name="start"></slot> </div> <div class="handle" part="handle" role="separator" aria-label="Panel resize handle" aria-orientation="${this.vertical?`vertical`:`horizontal`}"></div> <div class="panel panel--end" part="panel-end"> <slot name="end"></slot> </div> </div> `}};customElements.get(`wc-split-panel`)||customElements.define(`wc-split-panel`,Nt);var Pt=class extends X{static{this.styles=[X.styles,o`
47
- :host{--_offset:var(--offset, 0.5);--_handle-size:var(--handle-size, 40px);--_handle-color:var(--handle-color, #fff);--_line-color:var(--line-color, #fff);--_line-width:var(--line-width, 2px);display:block;position:relative;overflow:hidden;touch-action:pan-y;user-select:none}:host([vertical]){touch-action:pan-x}.container{position:relative;display:grid}.after,.before{grid-area:1/1}.after ::slotted(img),.before ::slotted(img){display:block;inline-size:100%;block-size:auto}.before{clip-path:inset(0 calc((1 - var(--_offset))*100%) 0 0)}:host([vertical]) .before{clip-path:inset(0 0 calc((1 - var(--_offset))*100%) 0)}.handle{position:absolute;inset-block:0;inset-inline-start:calc(var(--_offset)*100%);translate:-50% 0;inline-size:var(--_handle-size);display:flex;flex-direction:column;align-items:center;cursor:ew-resize;z-index:1}:host([vertical]) .handle{inset-block:auto;inset-block-start:calc(var(--_offset)*100%);inset-inline:0;translate:0 -50%;flex-direction:row;cursor:ns-resize;block-size:var(--_handle-size);inline-size:100%}.handle:before{content:"";position:absolute;inset-block:0;inset-inline-start:50%;translate:-50% 0;inline-size:var(--_line-width);background:var(--_line-color);box-shadow:0 0 4px oklch(0 0 0/.3);pointer-events:none}:host([vertical]) .handle:before{inset-inline:0;inset-block:auto;inset-block-start:50%;translate:0 -50%;inline-size:100%;block-size:var(--_line-width)}.grip{position:absolute;inset-block-start:50%;inset-inline-start:50%;translate:-50% -50%;inline-size:var(--_handle-size);block-size:var(--_handle-size);background:var(--_handle-color);border-radius:50%;box-shadow:0 2px 8px oklch(0 0 0/.2);display:flex;align-items:center;justify-content:center;transition:scale .15s ease,box-shadow .15s ease}.grip:after,.grip:before{content:"";position:absolute;border:5px solid transparent}.grip:before{border-inline-end-color:oklch(.3 0 0);inset-inline-start:6px}.grip:after{border-inline-start-color:oklch(.3 0 0);inset-inline-end:6px}:host([vertical]) .grip:before{border-inline-end-color:transparent;border-block-end-color:oklch(.3 0 0);inset-inline-start:auto;inset-block-start:6px}:host([vertical]) .grip:after{border-inline-start-color:transparent;border-block-start-color:oklch(.3 0 0);inset-inline-end:auto;inset-block-end:6px}.handle:focus-visible .grip,.handle:hover .grip{scale:1.1;box-shadow:0 4px 12px oklch(0 0 0/.3)}.handle:focus-visible{outline:none}.handle:focus-visible .grip{outline:2px solid oklch(.6 .2 250);outline-offset:2px}.handle.dragging .grip{scale:1.15;box-shadow:0 6px 16px oklch(0 0 0/.35)}@media (prefers-reduced-motion:reduce){.grip{transition:none}}@media (any-pointer:coarse){.handle{min-inline-size:44px}:host([vertical]) .handle{min-block-size:44px}}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}`]}static{this.properties={position:{type:Number},vertical:{type:Boolean,reflect:!0},discrete:{type:Boolean,reflect:!0},keyboardStep:{type:Number,attribute:`keyboard-step`},beforeLabel:{type:String,attribute:`before-label`},afterLabel:{type:String,attribute:`after-label`},_offset:{type:Number,state:!0}}}constructor(){super(),this.init(),this.initDragController()}init(){this.position=50,this.vertical=!1,this.discrete=!1,this.keyboardStep=1,this.beforeLabel=`Before`,this.afterLabel=`After`,this._offset=.5}initDragController(){this.dragController=new Mt(this,{handleSelector:`[part="handle"]`,orientation:this.vertical?`vertical`:`horizontal`,smooth:!this.discrete,onDrag:e=>this.handleDrag(e),onDragEnd:e=>this.handleDragEnd(e),keyboardStep:this.keyboardStep/100,keyboardLargeStep:this.keyboardStep/10})}willUpdate(e){e.has(`position`)&&!e.has(`_offset`)&&(this._offset=this.position/100,this.dragController.setPosition(this._offset)),(e.has(`vertical`)||e.has(`discrete`)||e.has(`keyboardStep`))&&this.dragController.updateOptions({orientation:this.vertical?`vertical`:`horizontal`,smooth:!this.discrete,keyboardStep:this.keyboardStep/100,keyboardLargeStep:this.keyboardStep/10})}handleDrag(e){this._offset=e,this.style.setProperty(`--_offset`,String(this._offset))}handleDragEnd(e){this._offset=e,this.style.setProperty(`--_offset`,String(this._offset)),this.dispatchEvent(new CustomEvent(`compare-change`,{detail:{position:this._offset*100},bubbles:!0,composed:!0}))}render(){return xe` <div class="container" part="container" style="--_offset:${this._offset}"> <div class="after" part="after" aria-label="${this.afterLabel}"> <slot name="after"></slot> </div> <div class="before" part="before" aria-label="${this.beforeLabel}"> <slot name="before"></slot> </div> <div class="handle" part="handle" role="separator" aria-label="Image comparison handle" aria-orientation="${this.vertical?`vertical`:`horizontal`}"> <div class="grip" part="grip"> <span class="visually-hidden">Drag to compare</span> </div> </div> </div> `}};customElements.get(`wc-image-compare`)||customElements.define(`wc-image-compare`,Pt);var Ft=class extends X{static{this.properties={duration:{type:Number,reflect:!0},exit:{type:Number}}}createRenderRoot(){return this}render(){return w}#e;constructor(){super(),this.duration=0,this.exit=200}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this.#t),this.duration>0&&(this.#e=setTimeout(()=>this.dismiss(),this.duration))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`click`,this.#t),this.#e&&clearTimeout(this.#e)}#t=e=>{e.target?.closest(`[data-dismiss]`)&&(e.preventDefault(),this.dismiss())};dismiss(){this.#e&&=(clearTimeout(this.#e),void 0);let e=new CustomEvent(`dismiss`,{bubbles:!0,cancelable:!0});if(!this.dispatchEvent(e))return;let t=matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(this.exit<=0||t){this.remove();return}this.style.transition=`opacity ${this.exit}ms ease, scale ${this.exit}ms ease`,this.style.opacity=`0`,this.style.scale=`0.97`;let n=!1,r=()=>{n||(n=!0,this.remove())};this.addEventListener(`transitionend`,r,{once:!0}),setTimeout(r,this.exit+50)}};customElements.get(`wc-dismissable`)||customElements.define(`wc-dismissable`,Ft);var It=class extends X{static{this.styles=[X.styles,o`
48
- :host{display:inline-flex;align-items:center;gap:.5rem}.copy__button{display:none;align-items:center;justify-content:center;min-inline-size:var(--copy-size,2.5rem);min-block-size:var(--copy-size,2.5rem);padding:var(--copy-padding,.5rem);background:var(--copy-bg,transparent);border:var(--copy-border,none);border-radius:var(--copy-radius,.375rem);cursor:pointer;transition:background-color .15s ease,transform .1s ease}:host(wc-copy:defined) .copy__button{display:inline-flex}.copy__button:hover{background:var(--copy-hover-bg,oklch(.9 0 0))}.copy__button:active{transform:scale(.95)}.copy__button:focus-visible{outline:2px solid var(--copy-focus-color,oklch(.6 .2 250));outline-offset:2px}.copy__icon{inline-size:1.25em;block-size:1.25em;background-color:currentColor;mask-size:contain;mask-repeat:no-repeat;mask-position:center}.copy__icon--copy{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20448%20512%22%3E%3Cpath%20d%3D%22M208%200h124.1C344.8%200%20357%205.1%20366%2014.1L433.9%2082c9%209%2014.1%2021.2%2014.1%2033.9V336c0%2026.5-21.5%2048-48%2048H208c-26.5%200-48-21.5-48-48V48c0-26.5%2021.5-48%2048-48M48%20128h80v64H64v256h192v-32h64v48c0%2026.5-21.5%2048-48%2048H48c-26.5%200-48-21.5-48-48V176c0-26.5%2021.5-48%2048-48%22%2F%3E%3C%2Fsvg%3E")}.copy__icon--success{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20448%20512%22%3E%3Cpath%20d%3D%22M438.6%20105.4c12.5%2012.5%2012.5%2032.8%200%2045.3l-256%20256c-12.5%2012.5-32.8%2012.5-45.3%200l-128-128c-12.5-12.5-12.5-32.8%200-45.3s32.8-12.5%2045.3%200L160%20338.7l233.4-233.3c12.5-12.5%2032.8-12.5%2045.3%200z%22%2F%3E%3C%2Fsvg%3E");color:var(--copy-success-color,oklch(.6 .2 145))}`]}static{this.properties={value:{type:String},label:{type:String},_copied:{type:Boolean,state:!0}}}constructor(){super(),this._handleCopy=async()=>{let e=this.value??this.getSlottedNodes().map(e=>e.textContent).join(``).trim();if(!(e==null||e===``)){console.log(`copying value:`,e);try{await navigator.clipboard.writeText(e),this._copied=!0,this._timeoutId=setTimeout(()=>{this._copied=!1},2e3),this.dispatchEvent(new CustomEvent(`copy`,{detail:{value:this.value},bubbles:!0,composed:!0}))}catch(e){console.error(`Failed to copy:`,e),this.dispatchEvent(new CustomEvent(`copy-error`,{detail:{error:e},bubbles:!0,composed:!0}))}}},this.init()}init(){this.value=void 0,this.label=`Copy to clipboard`,this._copied=!1}disconnectedCallback(){super.disconnectedCallback(),this._timeoutId&&clearTimeout(this._timeoutId)}render(){let e=this._copied?`copy__icon copy__icon--success`:`copy__icon copy__icon--copy`;return Y` <slot></slot> <button class="copy__button" part="button" type="button" aria-label="${this._copied?`Copied!`:this.label}" @click="${this._handleCopy}"> <span class="${e}" part="icon" aria-hidden="true"></span> </button> `}};customElements.get(`wc-copy`)||customElements.define(`wc-copy`,It);function Lt(e){let t=t=>e(t).trim()===`1`;return{nativeNav:t(`--carousel-native-nav`),scrollTimeline:t(`--carousel-scroll-timeline`)}}function Rt(e,t){let n=e.slides>=2;return{clone:n&&!e.paged&&(e.loop||e.autoplay>0),play:e.autoplay>0&&!e.reducedMotion,buildButtons:n&&e.wantsButtons&&!t.nativeNav,buildMarkers:n&&e.wantsMarkers&&!t.nativeNav,trackScrolled:!t.scrollTimeline}}function zt(e){return Math.abs(e)>4}function Bt(e,t,n=`Slide`){return`${n} ${e+1} of ${t}`}const Vt=Object.freeze({loading:`lazy`,fetchpriority:`low`,decoding:`async`});function Z(e,t){t()||queueMicrotask(()=>{e.isConnected&&t()})}function Q(e){let{index:t,total:n,delta:r,loop:i}=e;if(n<=0)return t;let a=t+r;return i?(a%n+n)%n:Math.min(Math.max(a,0),n-1)}function Ht(e,t){let{orientation:n,rtl:r=!1}=t,i=n===`horizontal`||n===`both`,a=n===`vertical`||n===`both`;if(i){if(e===`ArrowLeft`)return{type:`step`,delta:r?1:-1};if(e===`ArrowRight`)return{type:`step`,delta:r?-1:1}}if(a){if(e===`ArrowUp`)return{type:`step`,delta:-1};if(e===`ArrowDown`)return{type:`step`,delta:1}}return e===`Home`?{type:`first`}:e===`End`?{type:`last`}:null}function Ut(e,t,n,r=1e3){let i=!e||n-e.lastTime>r?t:e.buffer+t;return{buffer:i,query:i.length>1&&Array.from(i).every(e=>e===i[0])?i[0]:i,lastTime:n}}function Wt(e,t,n,r){let i=t.toLowerCase();if(!i)return null;let a=e.length;if(!a)return null;let o=Math.max(0,e.findIndex(e=>e.key===n));for(let t=1;t<=a;t++){let n=e[(o+t)%a];if(!r?.(n.key)&&n.text.toLowerCase().startsWith(i))return n.key}return null}const Gt=e=>!e.hidden&&!e.closest(`[hidden]`);var Kt=class{#e;#t=null;#n=null;#r=null;constructor(e,t){this.#e=t,e.addController(this)}get active(){return this.#n}#i=e=>(this.#e.isFocusable??Gt)(e);attach(e){this.#t!==e&&(this.detach(),this.#t=e,e.addEventListener(`keydown`,this.#o),e.addEventListener(`focusin`,this.#a),this.sync())}detach(){this.#t&&=(this.#t.removeEventListener(`keydown`,this.#o),this.#t.removeEventListener(`focusin`,this.#a),null)}sync(){let e=this.#e.items(),t=e.filter(this.#i),n=this.#n,r=n!==null&&document.activeElement===n,i=n!==null&&t.includes(n),a=i?n:t[0]??null;for(let t of e)t.tabIndex=t===a?0:-1;this.#n=a,r&&!i&&a&&(a.focus({preventScroll:!0}),this.#e.onMove?.(a,n,`sync`))}setActive(e,t={}){let{focus:n=!0,cause:r=`api`,silent:i=!1}=t,a=this.#n;this.#n=e;for(let t of this.#e.items())t.tabIndex=t===e?0:-1;e&&(n&&e.focus({preventScroll:!0}),i||this.#e.onMove?.(e,a,r))}#a=e=>{let t=e.target;t instanceof HTMLElement&&t!==this.#n&&this.#e.items().includes(t)&&this.setActive(t,{focus:!1,cause:`pointer`})};#o=e=>{let{ignoreWithin:t,textFor:n}=this.#e,r=e.target;if(t&&r instanceof Element&&r.closest(t))return;if(n&&e.key.length===1&&e.key!==` `&&!e.ctrlKey&&!e.metaKey&&!e.altKey){this.#s(e,n);return}let i=this.#t;if(!i)return;let a=this.#e.items(),o={items:a,active:this.#n,index:this.#n?a.indexOf(this.#n):-1,rtl:getComputedStyle(i).direction===`rtl`},s=this.#e.keyToMove?this.#e.keyToMove(e,o):this.#c(e,o);s&&(e.preventDefault(),this.#l(s,o))};#s=(e,t)=>{this.#r=Ut(this.#r,e.key,performance.now());let n=Wt(this.#e.items().filter(this.#i).map(e=>({key:e,text:t(e)})),this.#r.query,this.#n);n&&(e.preventDefault(),this.setActive(n,{focus:!0,cause:`key`}))};#c=(e,t)=>{let{orientation:n}=this.#e;return n?Ht(e.key,{orientation:n,rtl:t.rtl}):null};#l(e,t){if(e.type===`handled`)return;let n=t.items.filter(this.#i);if(!n.length)return;if(e.type===`to`){this.setActive(e.item,{focus:!0,cause:`key`});return}if(e.type===`first`){this.setActive(n[0],{focus:!0,cause:`key`});return}if(e.type===`last`){this.setActive(n[n.length-1],{focus:!0,cause:`key`});return}let r=t.active?n.indexOf(t.active):-1,i=Q({index:r<0?0:r,total:n.length,delta:e.delta,loop:this.#e.loop??!1});this.setActive(n[i],{focus:!0,cause:`key`})}hostConnected(){}hostDisconnected(){this.detach()}},qt=class extends X{static{this.properties={autoplay:{type:Number,reflect:!0},loop:{type:Boolean,reflect:!0}}}createRenderRoot(){return this}render(){return w}#e=!1;#t=null;#n=[];#r=[];#i=null;#a=[];#o=null;#s=[];#c=null;#l=!1;#u;#d=null;#f=null;#p=null;#m=!1;#h=!1;#g=!1;constructor(){super(),this.autoplay=0,this.loop=!1,this.#u=new Kt(this,{items:()=>this.#s,orientation:`both`,loop:!0,onMove:(e,t,n)=>{n===`key`&&e.click()}})}connectedCallback(){super.connectedCallback(),Z(this,()=>this.#_())}#_(){if(this.parentElement?.closest(`wc-carousel`)||this.#e)return!0;let e=this.#v();if(!e||(this.#t=e,this.#n=[...e.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(`slot`)),this.#n.length<2))return!1;!this.autoplay&&this.hasAttribute(`autoplay`)&&(this.autoplay=Number(this.getAttribute(`autoplay`))||0),!this.loop&&this.hasAttribute(`loop`)&&(this.loop=!0),this.#h=matchMedia(`(prefers-reduced-motion: reduce)`).matches;let t=Lt(e=>getComputedStyle(this).getPropertyValue(e)),n=Rt({loop:this.loop,autoplay:this.autoplay,paged:this.classList.contains(`carousel--auto-pages`),wantsButtons:this.classList.contains(`carousel--scroll-buttons`),wantsMarkers:this.classList.contains(`carousel--scroll-markers`),slides:this.#n.length,reducedMotion:this.#h},t);return this.#i=n,this.#y(e),n.clone&&this.#b(),n.buildButtons&&this.#k(),n.buildMarkers&&this.#A(),(n.trackScrolled||n.clone||this.#a.length||this.#s.length)&&(e.addEventListener(`scroll`,this.#E,{passive:!0}),e.addEventListener(`scrollsnapchange`,this.#D),e.addEventListener(`scrollend`,this.#D)),n.clone&&this.#T(),this.autoplay>0&&this.#M(n),this.#d=new ResizeObserver(this.#j),this.#d.observe(e),this.#j(),this.#e=!0,!0}#v(){let e=this.querySelector(`:scope > .carousel__track`);if(e)return e;if(!this.classList.contains(`carousel`)||!this.children.length)return null;let t=document.createElement(`div`);return t.className=`carousel__track`,t.append(...this.childNodes),this.append(t),t}#y(e){this.hasAttribute(`role`)||this.setAttribute(`role`,`group`),this.hasAttribute(`aria-roledescription`)||this.setAttribute(`aria-roledescription`,`carousel`),e.hasAttribute(`tabindex`)||(e.tabIndex=0)}disconnectedCallback(){super.disconnectedCallback();let e=this.#t;this.#d?.disconnect(),this.#d=null,e&&(e.removeEventListener(`scroll`,this.#E),e.removeEventListener(`scrollsnapchange`,this.#D),e.removeEventListener(`scrollend`,this.#D)),this.#p&&clearTimeout(this.#p),this.#p=null,this.#I(),this.removeEventListener(`pointerenter`,this.#L),this.removeEventListener(`pointerleave`,this.#R),this.removeEventListener(`focusin`,this.#L),this.removeEventListener(`focusout`,this.#R),this.#c&&(this.#c.removeEventListener(`click`,this.#z),this.#l&&this.#c.remove(),this.#c=null,this.#l=!1);for(let e of this.#a)e.remove();this.#a=[],this.#u.detach(),this.#o?.remove(),this.#o=null,this.#s=[];for(let e of this.#r)e.remove();this.#r=[],this.removeAttribute(`data-scrolled`),this.removeAttribute(`aria-live`),this.#n=[],this.#i=null,this.#e=!1}#b(){let e=this.#n.map((e,t)=>this.#x(e,t)),t=this.#n.map((e,t)=>this.#x(e,t));for(let t=e.length-1;t>=0;t--)this.#t?.prepend(e[t]);for(let e of t)this.#t?.append(e);this.#r=[...e,...t]}#x(e,t){let n=e.cloneNode(!0);n.setAttribute(`data-carousel-clone`,String(t)),n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`inert`,``),n.removeAttribute(`id`);for(let e of n.querySelectorAll(`[id]`))e.removeAttribute(`id`);for(let e of n.querySelectorAll(`img`))for(let[t,n]of Object.entries(Vt))e.setAttribute(t,n);return n}#S(){return this.#t?[...this.#t.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(`slot`)):[]}#C(){let e=this.#t,t=this.#S();if(!e||!t.length)return 0;let n=e.getBoundingClientRect(),r=n.left+n.width/2,i=0,a=1/0;return t.forEach((e,t)=>{let n=e.getBoundingClientRect(),o=Math.abs(n.left+n.width/2-r);o<a&&(a=o,i=t)}),i}#w(e){let t=this.#S();if(!t.length)return;let n=this.#C()+e;t[Math.max(0,Math.min(t.length-1,n))]?.scrollIntoView({inline:`center`,block:`nearest`,behavior:`smooth`})}#T(){requestAnimationFrame(()=>{let e=this.#n[0];e&&(this.#g=!0,e.scrollIntoView({inline:`center`,block:`nearest`,behavior:`instant`}),requestAnimationFrame(()=>{this.#g=!1,this.#O()}))})}#E=()=>{this.#i?.trackScrolled&&!this.hasAttribute(`data-scrolled`)&&zt(this.#t?.scrollLeft??0)&&this.setAttribute(`data-scrolled`,``),this.#O(),this.#p&&clearTimeout(this.#p),this.#p=setTimeout(this.#D,150)};#D=()=>{this.#p&&clearTimeout(this.#p),this.#p=null,this.#O();let e=this.#t;if(!e||!this.#i?.clone||this.#g)return;let t=this.#S()[this.#C()],n=t?.getAttribute(`data-carousel-clone`);if(!t||n==null)return;let r=this.#n[Number(n)];if(!r)return;let i=r.getBoundingClientRect().left-t.getBoundingClientRect().left;if(!i)return;this.#g=!0;let a=e.style.scrollBehavior;e.style.scrollBehavior=`auto`,e.scrollLeft+=i,requestAnimationFrame(()=>{e.style.scrollBehavior=a,this.#g=!1,this.#O()})};#O(){let e=this.#S();if(!e.length)return;let t=this.#C(),n=this.#i?.clone?t%this.#n.length:t;this.#s.forEach((e,t)=>e.setAttribute(`aria-selected`,String(t===n)));let r=this.#s[n];if(r&&this.#u.setActive(r,{focus:!1,silent:!0}),this.#a.length&&!this.#i?.clone){let[n,r]=this.#a;n&&(n.disabled=t<=0),r&&(r.disabled=t>=e.length-1)}}#k(){let e=(e,t,n,r)=>{let i=document.createElement(`button`);return i.type=`button`,i.className=`carousel__button carousel__button--${e}`,i.setAttribute(`aria-label`,t),i.textContent=n,i.addEventListener(`click`,()=>this.#w(r)),i},t=getComputedStyle(this).direction===`rtl`;this.#a=[e(`prev`,`Previous`,t?`›`:`‹`,-1),e(`next`,`Next`,t?`‹`:`›`,1)],this.append(...this.#a)}#A(){let e=document.createElement(`div`);e.className=`carousel__markers`,e.setAttribute(`role`,`tablist`),e.setAttribute(`aria-label`,this.getAttribute(`aria-label`)??`Slides`),this.#s=this.#n.map((e,t)=>{let n=document.createElement(`button`);return n.type=`button`,n.className=`carousel__marker`,n.setAttribute(`role`,`tab`),n.setAttribute(`aria-label`,Bt(t,this.#n.length)),n.setAttribute(`aria-selected`,String(t===0)),e.id&&n.setAttribute(`aria-controls`,e.id),n.addEventListener(`click`,()=>{e.scrollIntoView({inline:`center`,block:`nearest`,behavior:`smooth`})}),n}),e.append(...this.#s),this.append(e),this.#o=e,this.#u.attach(e)}#j=()=>{let e=this.#t;if(!e)return;let t=this.querySelector(`:scope > .carousel__hint`);t&&(t.hidden=e.scrollWidth<=e.clientWidth+1)};#M(e){this.#N(),e.play?this.#F():(this.#m=!0,this.setAttribute(`aria-live`,`polite`),this.#P()),this.addEventListener(`pointerenter`,this.#L),this.addEventListener(`pointerleave`,this.#R),this.addEventListener(`focusin`,this.#L),this.addEventListener(`focusout`,this.#R)}#N(){let e=this.querySelector(`[slot="autoplay"]`);if(e)this.#c=e,this.#l=!1;else{let e=document.createElement(`button`);e.type=`button`,e.className=`carousel__autoplay`,this.append(e),this.#c=e,this.#l=!0}this.#c.addEventListener(`click`,this.#z),this.#P()}#P(){let e=this.#c;e&&(e.setAttribute(`aria-label`,this.#m?`Play`:`Pause`),e.setAttribute(`aria-pressed`,String(!this.#m)),this.#l&&(e.textContent=this.#m?`▶`:`⏸`))}#F(){this.#f||this.autoplay<=0||(this.#m=!1,this.#f=setInterval(()=>this.#w(1),this.autoplay),this.setAttribute(`aria-live`,`off`),this.#P())}#I(){this.#f&&clearInterval(this.#f),this.#f=null}#L=()=>{!this.#f&&this.#m||(this.#I(),this.#m=!0,this.setAttribute(`aria-live`,`polite`),this.#P())};#R=()=>{this.#h||this.#F()};#z=()=>{this.#m?(this.#h=!1,this.#F()):this.#L()}};customElements.get(`wc-carousel`)||customElements.define(`wc-carousel`,qt);var Jt=class extends X{static{this.properties={breakpoint:{type:String,reflect:!0},projection:{type:Boolean,reflect:!0},singular:{type:Boolean,reflect:!0}}}createRenderRoot(){return this}#e=[];#t=[];#n=[];#r=null;#i=null;#a=null;#o=[];#s=[];#c=0;#l=!1;#u=null;#d=0;init(){this.breakpoint=`40rem`,this.projection=!1,this.singular=!1}constructor(){super(),this.init()}connectedCallback(){super.connectedCallback(),Z(this,()=>this.#f())}#f(){return this.#r?!0:(this.#p(),this.#e.length===0?!1:(this.#h(),this.projection&&(this.#m(),this.#g(),this.#_(),this.singular&&(this.classList.add(`entries--singular`),this.#y(0))),this.#d=this.#x(),this.#S(),!0))}disconnectedCallback(){super.disconnectedCallback(),this.#u?.disconnect(),this.#u=null,this.#a?.remove(),this.#a=null,this.#o=[],this.#i?this.#i.remove():this.#r?.remove(),this.#r=null,this.#i=null,this.#s=[],this.classList.remove(`entries--wide`,`entries--projection`,`entries--singular`)}#p(){this.#e=[];let e=new Set,t=new Map,n=null;for(let r of this.children){let i=r.tagName.toLowerCase();if(/^h[1-6]$/.test(i))n=r;else if(i===`dl`&&n){let i=new Map,a=r.querySelectorAll(`dt`),o=r.querySelectorAll(`dd`);for(let n=0;n<a.length;n++){let r=a[n],s=r.textContent?.trim()??``,c=o[n]?.innerHTML??``;if(s){i.set(s,c),e.add(s);let n=r.getAttribute(`data-label`);n&&!t.has(s)&&t.set(s,n)}}this.#e.push({title:n.innerHTML,heading:n,dl:r,properties:i}),n=null}}this.#t=[...e],this.#n=this.#t.map(e=>t.get(e)??e)}#m(){this.classList.add(`entries--projection`)}#h(){let e=document.createElement(`table`);e.classList.add(`entries__table`),e.setAttribute(`aria-hidden`,`true`);let t=document.createElement(`thead`),n=document.createElement(`tr`),r=document.createElement(`th`);r.textContent=``,n.appendChild(r),this.#s=[];for(let e of this.#t){let t=document.createElement(`th`);t.textContent=e,n.appendChild(t),this.#s.push(t)}t.appendChild(n),e.appendChild(t);let i=document.createElement(`tbody`);for(let e of this.#e){let t=document.createElement(`tr`),n=document.createElement(`td`);n.innerHTML=e.title,n.style.fontWeight=`600`,t.appendChild(n);for(let n of this.#t){let r=document.createElement(`td`);r.innerHTML=e.properties.get(n)??``,t.appendChild(r)}i.appendChild(t)}e.appendChild(i),this.appendChild(e),this.#r=e}#g(){if(!this.#r)return;let e=document.createElement(`div`);e.classList.add(`entries__scroll`),this.#r.replaceWith(e),e.appendChild(this.#r),this.#i=e}#_(){let e=document.createElement(`nav`);e.classList.add(`entries__nav`),e.setAttribute(`aria-label`,`Column selector`),e.setAttribute(`aria-hidden`,`true`),this.#o=this.#t.map((t,n)=>{let r=document.createElement(`button`);return r.type=`button`,r.classList.add(`entries__nav-btn`),r.textContent=this.#n[n]??t,r.setAttribute(`aria-pressed`,String(n===0)),r.addEventListener(`click`,()=>this.#v(n)),e.appendChild(r),r}),this.#i.before(e),this.#a=e}#v(e){this.#c=e;for(let t=0;t<this.#o.length;t++)this.#o[t]?.setAttribute(`aria-pressed`,String(t===e));if(this.singular)this.#y(e);else{let t=this.#s[e];t&&this.#i&&t.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`start`})}this.dispatchEvent(new CustomEvent(`entries-column-change`,{detail:{column:e,header:this.#t[e]},bubbles:!0,composed:!0}))}#y(e){if(!this.#r)return;let t=e+1;for(let e of this.#r.rows)for(let n=1;n<e.cells.length;n++){let r=e.cells[n];r&&(r.hidden=n!==t)}}#b(){if(this.#r)for(let e of this.#r.rows)for(let t=1;t<e.cells.length;t++){let n=e.cells[t];n&&(n.hidden=!1)}}#x(){let e=this.breakpoint||`40rem`,t=document.createElement(`div`);t.style.width=e,t.style.position=`absolute`,t.style.visibility=`hidden`,this.appendChild(t);let n=t.offsetWidth;return t.remove(),n}#S(){this.#u=new ResizeObserver(this.#C),this.#u.observe(this)}#C=e=>{let t=e[0];if(!t)return;let n=t.contentBoxSize?.[0]?.inlineSize??t.contentRect.width;this.#l=n>=this.#d,this.#l?(this.classList.add(`entries--wide`),this.singular&&this.projection&&this.#b()):(this.classList.remove(`entries--wide`),this.singular&&this.projection&&this.#y(this.#c))}};customElements.get(`wc-entries`)||customElements.define(`wc-entries`,Jt);const Yt=`vitops:consent`;var Xt=class e extends X{static{this.styles=[X.styles,o`
49
- :host{display:none}:host(:defined){display:inline-flex}.toggle__group{display:inline-flex;border-radius:var(--color-scheme-toggle-radius,.5rem);overflow:hidden;border:var(--color-scheme-toggle-border,1px solid oklch(.5 0 0/.2))}.toggle__segment{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:var(--color-scheme-toggle-padding,.5rem .75rem);border:none;background:var(--color-scheme-toggle-bg,oklch(.95 0 0));color:var(--color-scheme-toggle-color,oklch(.3 0 0));font-size:var(--color-scheme-toggle-font-size,.875rem);font-family:inherit;cursor:pointer;transition:background-color .15s ease,color .15s ease}.toggle__segment:not(:last-child){border-inline-end:1px solid oklch(.5 0 0/.15)}.toggle__segment:hover{background:var(--color-scheme-toggle-hover-bg,oklch(.9 0 0))}.toggle__segment[aria-pressed=true]{background:var(--color-scheme-toggle-active-bg,oklch(.25 .02 260));color:var(--color-scheme-toggle-active-color,oklch(.95 0 0))}.toggle__segment:focus-visible{outline:2px solid var(--color-scheme-toggle-focus-color,oklch(.6 .2 250));outline-offset:2px;z-index:1;position:relative}.toggle__icon{inline-size:1em;block-size:1em;flex-shrink:0}.toggle__icon--light{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20viewBox%3D%220%200%2024%2024%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%225%22%2F%3E%3Cpath%20d%3D%22M12%201v2M12%2021v2M4.22%204.22l1.42%201.42M18.36%2018.36l1.42%201.42M1%2012h2M21%2012h2M4.22%2019.78l1.42-1.42M18.36%205.64l1.42-1.42%22%2F%3E%3C%2Fsvg%3E")}.toggle__icon--dark,.toggle__icon--light{background:currentColor;mask-size:contain;mask-repeat:no-repeat}.toggle__icon--dark{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M21%2012.79A9%209%200%201%201%2011.21%203%207%207%200%200%200%2021%2012.79%22%2F%3E%3C%2Fsvg%3E")}.toggle__icon--system{background:currentColor;mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20viewBox%3D%220%200%2024%2024%22%3E%3Crect%20width%3D%2220%22%20height%3D%2214%22%20x%3D%222%22%20y%3D%223%22%20rx%3D%222%22%20ry%3D%222%22%2F%3E%3Cpath%20d%3D%22M8%2021h8M12%2017v4%22%2F%3E%3C%2Fsvg%3E");mask-size:contain;mask-repeat:no-repeat}.toggle__label{display:none}@container (min-width: 400px){.toggle__label{display:inline}}@media (prefers-reduced-motion:reduce){.toggle__segment{transition:none}}`]}static{this.properties={scheme:{type:String,reflect:!0}}}constructor(){super(),this._mediaQuery=null,this._boundMediaHandler=null,this._onConsent=()=>{window.vitopsConsent?.granted(`preferences`)&&this._write()},this.init()}init(){this.scheme=e.readStored()??`system`}static{this.STORAGE_KEY=`vitops-color-scheme`}static readStored(){try{let t=localStorage.getItem(e.STORAGE_KEY);return t===`light`||t===`dark`||t===`system`?t:null}catch{return null}}_persist(){let e=window.vitopsConsent;(!e||e.require(`preferences`))&&this._write()}_write(){try{this.scheme===`system`?localStorage.removeItem(e.STORAGE_KEY):localStorage.setItem(e.STORAGE_KEY,this.scheme)}catch{}}connectedCallback(){super.connectedCallback(),this._mediaQuery=window.matchMedia(`(prefers-color-scheme: dark)`),this._boundMediaHandler=this._handleMediaChange.bind(this),this._mediaQuery.addEventListener(`change`,this._boundMediaHandler),document.addEventListener(Yt,this._onConsent),this._applyColorScheme()}disconnectedCallback(){super.disconnectedCallback(),this._mediaQuery&&this._boundMediaHandler&&this._mediaQuery.removeEventListener(`change`,this._boundMediaHandler),document.removeEventListener(Yt,this._onConsent)}_handleMediaChange(e){this.scheme===`system`&&this.requestUpdate()}_applyColorScheme(){let e=document.documentElement;this.scheme===`system`?(e.style.removeProperty(`color-scheme`),delete e.dataset.theme):(e.style.colorScheme=`${this.scheme} only`,e.dataset.theme=this.scheme)}_handleSegmentClick(e){this.scheme!==e&&(this.scheme=e,this._applyColorScheme(),this._persist(),this.dispatchEvent(new CustomEvent(`scheme-change`,{detail:{scheme:this.scheme},bubbles:!0,composed:!0})))}updated(e){e.has(`scheme`)&&this._applyColorScheme()}render(){return Y` <div class="toggle__group" role="group" aria-label="Color scheme" part="group"> <button class="toggle__segment" part="system" type="button" aria-pressed="${this.scheme===`system`}" @click="${()=>this._handleSegmentClick(`system`)}"> <span class="toggle__icon toggle__icon--system" aria-hidden="true"></span> <span class="toggle__label">System</span> </button> <button class="toggle__segment" part="light" type="button" aria-pressed="${this.scheme===`light`}" @click="${()=>this._handleSegmentClick(`light`)}"> <span class="toggle__icon toggle__icon--light" aria-hidden="true"></span> <span class="toggle__label">Light</span> </button> <button class="toggle__segment" part="dark" type="button" aria-pressed="${this.scheme===`dark`}" @click="${()=>this._handleSegmentClick(`dark`)}"> <span class="toggle__icon toggle__icon--dark" aria-hidden="true"></span> <span class="toggle__label">Dark</span> </button> </div> `}};customElements.get(`wc-color-scheme-toggle`)||customElements.define(`wc-color-scheme-toggle`,Xt);var Zt=class extends X{static{this.styles=[X.styles,o`
50
- :host{--_gap:var(--multi-field-gap, 0.5rem);--_input-padding:var(--multi-field-input-padding, 0.5rem 0.75rem);--_radius:var(--multi-field-border-radius, 0.375rem);--_border-color:var(--multi-field-border-color, oklch(0.8 0 0));--_focus-color:var(--multi-field-focus-color, oklch(0.6 0.2 250));--_button-bg:var(--multi-field-button-bg, oklch(0.95 0 0));--_button-hover-bg:var(--multi-field-button-hover-bg, oklch(0.9 0 0));--_delete-color:var(--multi-field-delete-color, oklch(0.6 0.2 25));--_delete-hover-bg:var(--multi-field-delete-hover-bg, oklch(0.95 0.05 25));display:block}.container,.entries{flex-direction:column}.container,.entries,.entry{display:flex;gap:var(--_gap)}.entry{align-items:center}.entry__input{flex:1;padding:var(--_input-padding);border:1px solid var(--_border-color);border-radius:var(--_radius);font:inherit;background:transparent}.entry__input:focus-visible{outline:2px solid var(--_focus-color);outline-offset:2px}.entry__input:disabled{opacity:.6;cursor:not-allowed}.entry__delete{display:inline-flex;align-items:center;justify-content:center;min-inline-size:2rem;min-block-size:2rem;padding:.25rem;background:transparent;border:1px solid transparent;border-radius:var(--_radius);color:var(--_delete-color);cursor:pointer;transition:background-color .15s ease}.entry__delete:hover:not(:disabled){background:var(--_delete-hover-bg)}.entry__delete:focus-visible{outline:2px solid var(--_focus-color);outline-offset:2px}.entry__delete:disabled{opacity:.3;cursor:not-allowed}.entry__delete-icon{inline-size:1rem;block-size:1rem;background-color:currentColor;mask-size:contain;mask-repeat:no-repeat;mask-position:center;mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20448%20512%22%3E%3Cpath%20d%3D%22M135.2%2017.7%20128%2032H32C14.3%2032%200%2046.3%200%2064s14.3%2032%2032%2032h384c17.7%200%2032-14.3%2032-32s-14.3-32-32-32h-96l-7.2-14.3C307.4%206.8%20296.3%200%20284.2%200H163.8c-12.1%200-23.2%206.8-28.6%2017.7M416%20128H32l21.2%20339c1.6%2025.3%2022.6%2045%2047.9%2045h245.8c25.3%200%2046.3-19.7%2047.9-45z%22%2F%3E%3C%2Fsvg%3E")}.actions{display:flex;gap:var(--_gap);flex-wrap:wrap}.action-button{display:inline-flex;align-items:center;gap:.375rem;padding:.5rem .75rem;background:var(--_button-bg);border:1px solid var(--_border-color);border-radius:var(--_radius);font:inherit;font-size:.875em;cursor:pointer;transition:background-color .15s ease}.action-button:hover:not(:disabled){background:var(--_button-hover-bg)}.action-button:focus-visible{outline:2px solid var(--_focus-color);outline-offset:2px}.action-button:disabled{opacity:.5;cursor:not-allowed}.action-button__icon{inline-size:.875rem;block-size:.875rem;background-color:currentColor;mask-size:contain;mask-repeat:no-repeat;mask-position:center}.action-button__icon--add{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20448%20512%22%3E%3Cpath%20d%3D%22M256%2080c0-17.7-14.3-32-32-32s-32%2014.3-32%2032v144H48c-17.7%200-32%2014.3-32%2032s14.3%2032%2032%2032h144v144c0%2017.7%2014.3%2032%2032%2032s32-14.3%2032-32V288h144c17.7%200%2032-14.3%2032-32s-14.3-32-32-32H256z%22%2F%3E%3C%2Fsvg%3E")}.action-button__icon--clear{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20576%20512%22%3E%3Cpath%20d%3D%22M290.7%2057.4%2057.4%20290.7c-25%2025-25%2065.5%200%2090.5l80%2080c12%2012%2028.3%2018.7%2045.3%2018.7H512c17.7%200%2032-14.3%2032-32s-14.3-32-32-32H387.9l130.7-130.6c25-25%2025-65.5%200-90.5L381.3%2057.4c-25-25-65.5-25-90.5%200zm6.7%20358.6H182.6l-80-80%20124.7-124.7%20137.4%20137.4z%22%2F%3E%3C%2Fsvg%3E")}.initial-slot{display:none}@media (prefers-reduced-motion:reduce){.action-button,.entry__delete{transition:none}}`]}static{this.properties={name:{type:String},type:{type:String},placeholder:{type:String},protectDefaults:{type:Boolean,attribute:`protect-defaults`},min:{type:Number},max:{type:Number},addLabel:{type:String,attribute:`add-label`},clearLabel:{type:String,attribute:`clear-label`},deleteLabel:{type:String,attribute:`delete-label`},_entries:{type:Array,state:!0},_initialized:{type:Boolean,state:!0}}}constructor(){super(),this._handleAdd=()=>{if(this.max>0&&this._entries.length>=this.max)return;let e={id:this._generateId(),value:``,isDefault:!1};this._entries=[...this._entries,e],this.dispatchEvent(new CustomEvent(`multi-field-add`,{bubbles:!0,composed:!0})),this._dispatchChange(),this.updateComplete.then(()=>{let e=this.renderRoot.querySelectorAll(`.entry__input`);e[e.length-1]?.focus()})},this._handleClear=()=>{let e;for(e=this.protectDefaults?this._entries.filter(e=>e.isDefault):[];e.length<this.min;)e.push({id:this._generateId(),value:``,isDefault:!1});this._entries=e,this.dispatchEvent(new CustomEvent(`multi-field-clear`,{bubbles:!0,composed:!0})),this._dispatchChange()},this.init()}init(){this.name=void 0,this.type=`text`,this.placeholder=``,this.protectDefaults=!1,this.min=1,this.max=0,this.addLabel=`Add`,this.clearLabel=`Clear`,this.deleteLabel=`Delete`,this._entries=[],this._initialized=!1,this._idCounter=0}_generateId(){return`entry-${++this._idCounter}`}_initializeFromSlot(){if(this._initialized)return;let e=this.getSlottedNodes([`input`]),t=[];for(let n of e){let e=n,r=e.value||e.getAttribute(`value`)||``;t.push({id:this._generateId(),value:r,isDefault:!0})}for(;t.length<this.min;)t.push({id:this._generateId(),value:``,isDefault:!1});t.length===0&&t.push({id:this._generateId(),value:``,isDefault:!1}),this._entries=t,this._initialized=!0}firstUpdated(){this._initializeFromSlot()}willUpdate(e){if(e.has(`min`)&&this._initialized)for(;this._entries.length<this.min;)this._entries=[...this._entries,{id:this._generateId(),value:``,isDefault:!1}]}_getValues(){return this._entries.map(e=>e.value)}_dispatchChange(){this.dispatchEvent(new CustomEvent(`multi-field-change`,{detail:{values:this._getValues()},bubbles:!0,composed:!0}))}_handleInput(e,t){let n=t.target;this._entries=this._entries.map(t=>t.id===e?{...t,value:n.value}:t),this._dispatchChange()}_handleDelete(e){let t=this._entries.find(t=>t.id===e);if(!t||this.protectDefaults&&t.isDefault||this._entries.length<=this.min)return;let n=t.value;this._entries=this._entries.filter(t=>t.id!==e),this.dispatchEvent(new CustomEvent(`multi-field-delete`,{detail:{value:n},bubbles:!0,composed:!0})),this._dispatchChange()}_canDelete(e){return!(this._entries.length<=this.min||this.protectDefaults&&e.isDefault)}_canAdd(){return!(this.max>0&&this._entries.length>=this.max)}_canClear(){return this.protectDefaults?this._entries.some(e=>!e.isDefault):this._entries.length>this.min}render(){return Y` <div class="container" part="container"> <div class="initial-slot"> <slot @slotchange="${this._initializeFromSlot}"></slot> </div> <div class="entries" part="entries" role="list"> ${this._entries.map(e=>Y` <div class="entry" part="entry" role="listitem"> <input class="entry__input" part="input" type="${this.type}" name="${this.name?`${this.name}[]`:``}" placeholder="${this.placeholder}" .value="${e.value}" @input="${t=>this._handleInput(e.id,t)}" ?data-default="${e.isDefault}"> <button type="button" class="entry__delete" part="delete-button" aria-label="${this.deleteLabel}" ?disabled="${!this._canDelete(e)}" @click="${()=>this._handleDelete(e.id)}"> <span class="entry__delete-icon" aria-hidden="true"></span> </button> </div> `)} </div> <div class="actions" part="actions"> <button type="button" class="action-button" part="add-button" ?disabled="${!this._canAdd()}" @click="${this._handleAdd}"> <span class="action-button__icon action-button__icon--add" aria-hidden="true"></span> <slot name="add-label">${this.addLabel}</slot> </button> <button type="button" class="action-button" part="clear-button" ?disabled="${!this._canClear()}" @click="${this._handleClear}"> <span class="action-button__icon action-button__icon--clear" aria-hidden="true"></span> <slot name="clear-label">${this.clearLabel}</slot> </button> </div> </div> `}};customElements.get(`wc-multi-field`)||customElements.define(`wc-multi-field`,Zt);var Qt=class extends X{createRenderRoot(){return this}#e=null;#t;connectedCallback(){super.connectedCallback(),Z(this,()=>this.#n())}#n(){if(this.#e)return!0;let e=this.querySelector(`.marquee__content`);return e?(this.#e=e,this.style.setProperty(`--_marquee-min`,`auto`),this.#r(),this.#t=new ResizeObserver(()=>this.#r()),this.#t.observe(this),!0):!1}disconnectedCallback(){this.#t?.disconnect(),super.disconnectedCallback()}#r(){let e=this.#e;if(!e)return;for(let e of this.querySelectorAll(`[data-marquee-clone]`))e.remove();let t=Number.parseFloat(getComputedStyle(this).columnGap)||0,n=e.getBoundingClientRect().width;if(n<=0)return;this.style.setProperty(`--_marquee-distance`,`${n+t}px`);let r=Math.ceil(this.getBoundingClientRect().width/(n+t))+1;for(let t=0;t<r;t++){let t=e.cloneNode(!0);t.dataset.marqueeClone=``,t.setAttribute(`aria-hidden`,`true`),this.append(t)}}};customElements.get(`wc-marquee`)||customElements.define(`wc-marquee`,Qt);function $t(e,t){let n=t.trim().toLowerCase();if(!n)return{keep:new Set,hits:0};let r=new Map,i=new Map;for(let t of e){r.set(t.key,t);let e=i.get(t.parent);e?e.push(t):i.set(t.parent,[t])}let a=new Set,o=0,s=e=>{for(let t of i.get(e)??[])a.has(t.key)||(a.add(t.key),s(t.key))};for(let t of e){if(!t.own.includes(n))continue;o++,a.add(t.key),s(t.key);let e=new Set([t.key]),i=r.get(t.parent);for(;i&&!e.has(i.key);)a.add(i.key),e.add(i.key),i=r.get(i.parent)}return{keep:a,hits:o}}function en(e){let t=new Map;for(let n of e)t.set(n.key,n);return e.filter(e=>{if(e.hidden)return!1;let n=new Set([e.key]),r=e.parent===null||e.parent===void 0?void 0:t.get(e.parent);for(;r;){if(r.hidden||r.expanded===!1)return!1;if(n.has(r.key))break;n.add(r.key),r=r.parent===null||r.parent===void 0?void 0:t.get(r.parent)}return!0})}function tn(e,t,n){let r=en(e);if(!r.length)return null;let i=r.findIndex(e=>e.key===t),a=i>=0?r[i]:void 0;switch(n){case`first`:return{type:`to`,key:r[0].key};case`last`:return{type:`to`,key:r[r.length-1].key};case`next`:return i<0?{type:`to`,key:r[0].key}:i<r.length-1?{type:`to`,key:r[i+1].key}:null;case`prev`:return i<0?{type:`to`,key:r[0].key}:i>0?{type:`to`,key:r[i-1].key}:null;case`in`:{if(!a||a.expanded===null)return null;if(a.expanded===!1)return{type:`expand`,key:a.key};let e=r[i+1];return e&&e.parent===a.key?{type:`to`,key:e.key}:null}case`out`:return a?a.expanded===!0?{type:`collapse`,key:a.key}:a.parent===null||a.parent===void 0?null:{type:`to`,key:a.parent}:null}}function nn(e,t){let n=e.find(e=>e.key===t);return n?e.filter(e=>e.parent===n.parent&&e.expanded!==null).map(e=>e.key):[]}function rn(e,t,n){let r=e;typeof r.moveBefore==`function`?r.moveBefore(t,n):e.insertBefore(t,n)}function $(e,t,n){for(;e.firstChild;)rn(t,e.firstChild,n)}var an=class extends X{static{this.properties={label:{type:String,reflect:!0},nofilter:{type:Boolean,reflect:!0}}}createRenderRoot(){return this}render(){return w}#e=null;#t=[];#n=[];#r=null;#i=null;#a=null;#o=new WeakMap;#s=!1;#c;constructor(){super(),this.label=`Filter`,this.nofilter=!1,this.#c=new Kt(this,{items:()=>this.#t.map(e=>e.key),keyToMove:this.#w,textFor:e=>this.#t.find(t=>t.key===e)?.label??``,ignoreWithin:`a, button, input, select, textarea, [contenteditable]`,onMove:(e,t,n)=>{n===`key`&&this.#e?.setAttribute(`data-tree-keyboard`,``),e.querySelector(`:scope > .tree__summary, :scope > .tree__content`)?.scrollIntoView({block:`nearest`})}})}connectedCallback(){super.connectedCallback(),Z(this,()=>this.#l())}#l(){if(this.#e)return!0;if(!this.isConnected)return!1;if(this.parentElement?.closest(`wc-tree`))return!0;let e=this.querySelector(`.tree`);return!e||!e.querySelector(`.tree__item`)?!1:(this.#u(e),this.#e=e,this.#p(),this.#b(),this.#c.attach(e),e.addEventListener(`click`,this.#S),e.addEventListener(`beforematch`,this.#k),e.addEventListener(`pointerdown`,this.#C),window.addEventListener(`hashchange`,this.#D),requestAnimationFrame(()=>this.#O()),!0)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`hashchange`,this.#D),this.#e?.removeEventListener(`click`,this.#S),this.#e?.removeEventListener(`beforematch`,this.#k),this.#e?.removeEventListener(`pointerdown`,this.#C),this.#c.detach(),this.#r?.remove(),this.#r=null,this.#i=null,this.#a=null,this.#t=[],this.#n=[],this.#e=null}#u(e){for(let t of e.querySelectorAll(`details`))try{t.classList.contains(`tree__item`)?this.#f(t):t.parentElement&&this.#d(t.parentElement,t)}catch{}for(let t of e.querySelectorAll(`.tree__item`))t.setAttribute(`role`,`treeitem`);for(let t of e.querySelectorAll(`.tree`))t.setAttribute(`role`,`group`);e.setAttribute(`role`,`tree`),!e.hasAttribute(`aria-label`)&&!e.hasAttribute(`aria-labelledby`)&&e.setAttribute(`aria-label`,this.label)}#d(e,t){let n=t.open,r=t.querySelector(`:scope > summary`),i=document.createElement(`span`);i.className=`tree__summary`,e.insertBefore(i,t),r&&($(r,i,null),r.remove()),$(t,e,t),t.remove(),this.#v(e,n)}#f(e){let t=e.open,n=e.parentElement;if(!n)return;let r=n.tagName===`UL`||n.tagName===`OL`?`li`:`div`,i=document.createElement(r);i.id=e.id,i.className=e.className,n.insertBefore(i,e);let a=e.querySelector(`:scope > summary`),o=document.createElement(`span`);o.className=`tree__summary`,i.appendChild(o),a&&($(a,o,null),a.remove()),$(e,i,null),e.remove(),this.#v(i,t)}#p(){let e=this.#e?.querySelectorAll(`.tree__item`)??[];this.#t=[...e].map(e=>({key:e,parent:e.parentElement?.closest(`.tree__item`)??null,own:this.#h(e),label:this.#m(e)})),this.#n=this.#t.filter(e=>this.#g(e.key)!==null)}#m(e){return(e.querySelector(`:scope > .tree__summary, :scope > .tree__content`)?.textContent??``).trim().toLowerCase()}#h(e){let t=[],n=e.querySelector(`:scope > .tree__summary, :scope > .tree__content`);n?.textContent&&t.push(n.textContent);let r=e.querySelector(`:scope > .tree__desc, :scope > p`);return r?.textContent&&t.push(r.textContent),t.join(` `).toLowerCase()}#g(e){return e.querySelector(`:scope > .tree`)}#_(){return this.#t.map(e=>({...e,hidden:e.key.hidden===!0,expanded:this.#g(e.key)?e.key.getAttribute(`aria-expanded`)===`true`:null}))}#v(e,t){let n=this.#g(e);n&&(e.setAttribute(`aria-expanded`,String(t)),t?n.removeAttribute(`hidden`):n.setAttribute(`hidden`,`until-found`))}#y(e,t){e.hidden=t}#b(){let e=document.createElement(`div`);if(e.className=`tree__toolbar cluster`,!this.nofilter){let t=document.createElement(`input`);t.type=`search`,t.className=`tree__filter`,t.placeholder=this.label,t.setAttribute(`aria-label`,this.label),t.addEventListener(`input`,()=>this.filter(t.value));let n=document.createElement(`div`);n.className=`input-group tree__filter-group`,n.appendChild(t),e.appendChild(n),this.#i=t}for(let[t,n]of[[`Expand all`,!0],[`Collapse all`,!1]]){let r=document.createElement(`button`);r.type=`button`,r.className=`btn`,r.textContent=t,r.addEventListener(`click`,()=>this.toggleAll(n)),e.appendChild(r)}let t=document.createElement(`span`);t.className=`tree__count font-footnote`,t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),e.appendChild(t),this.#a=t,this.#e?.before(e),this.#r=e}toggleAll(e){for(let t of this.#n)this.#v(t.key,e);this.#c.sync()}filter(e){let t=e.trim().toLowerCase();if(!t){for(let{key:e}of this.#t)this.#y(e,!1);if(this.#s){for(let e of this.#n)this.#v(e.key,this.#o.get(e.key)??!1);this.#s=!1}this.#x(``),this.#c.sync();return}if(!this.#s){for(let e of this.#n)this.#o.set(e.key,e.key.getAttribute(`aria-expanded`)===`true`);this.#s=!0}let{keep:n,hits:r}=$t(this.#t,t);for(let{key:e}of this.#t)this.#y(e,!n.has(e));for(let e of n){let t=e;this.#g(t)&&this.#v(t,!0)}this.#x(r===1?`1 match`:`${r} matches`),this.#c.sync(),this.dispatchEvent(new CustomEvent(`tree-filter`,{detail:{query:t,matches:r},bubbles:!0}))}#x(e){this.#a&&(this.#a.textContent=e)}#S=e=>{let t=e.target;if(!t||t.closest(`.tree__actions`))return;let n=t.closest(`.tree__summary`);if(!n)return;let r=n.parentElement;!(r instanceof HTMLElement)||!r.classList.contains(`tree__item`)||this.#g(r)&&(this.#v(r,r.getAttribute(`aria-expanded`)!==`true`),this.#c.sync())};#C=()=>{this.#e?.removeAttribute(`data-tree-keyboard`)};#w=(e,t)=>{let n=t.active;if(!n)return null;let r=this.#T(e.key,t.rtl);if(r)return this.#E(n,r);if(e.key===`Enter`||e.key===` `)return this.#g(n)?(this.#v(n,n.getAttribute(`aria-expanded`)!==`true`),this.#c.sync()):n.querySelector(`:scope > .tree__summary a, :scope > .tree__content a`)?.click(),{type:`handled`};if(e.key===`*`){for(let e of nn(this.#_(),n))this.#v(e,!0);return this.#c.sync(),{type:`handled`}}return null};#T(e,t){switch(e){case`ArrowDown`:return`next`;case`ArrowUp`:return`prev`;case`ArrowRight`:return t?`out`:`in`;case`ArrowLeft`:return t?`in`:`out`;case`Home`:return`first`;case`End`:return`last`;default:return null}}#E(e,t){let n=tn(this.#_(),e,t);return n?n.type===`to`?{type:`to`,item:n.key}:(this.#v(n.key,n.type===`expand`),this.#c.sync(),{type:`handled`}):null}#D=()=>this.#O();#O(){let e=decodeURIComponent(location.hash.slice(1));if(!e)return;let t=this.#e?.ownerDocument.getElementById(e);if(!(!t||!this.contains(t))){this.#g(t)&&this.#v(t,!0);for(let e=t.parentElement;e&&(e.classList.contains(`tree__item`)&&this.#v(e,!0),e!==this);e=e.parentElement);this.#i?.value&&this.filter(this.#i.value=``),this.#c.setActive(t,{focus:!1,cause:`api`}),(t.querySelector(`:scope > .tree__summary, :scope > .tree__content`)??t).scrollIntoView({block:`start`,behavior:`smooth`})}}#k=e=>{let t=e.target;if(!(t instanceof HTMLElement))return;let n=t.parentElement;n instanceof HTMLElement&&n.classList.contains(`tree__item`)&&n.setAttribute(`aria-expanded`,`true`)}};customElements.get(`wc-tree`)||customElements.define(`wc-tree`,an);function on(e){return!e.hasLink||e.onInteractive||e.platformHandled?!1:e.moved<=6}const sn=[`a[href]`,`button`,`input`,`select`,`textarea`,`label`,`summary`,`details`,`audio[controls]`,`video[controls]`,`[contenteditable]`,`[role="button"]`,`[role="link"]`,`[onclick]`,`[data-no-card-link]`].join(`,`);function cn(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}var ln=class extends X{static{this.properties={item:{type:String,reflect:!0}}}createRenderRoot(){return this}render(){return w}#e=[];#t;constructor(){super(),this.item=`.card`}connectedCallback(){super.connectedCallback(),Z(this,()=>this.#n())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerdown`,this.#i),this.removeEventListener(`click`,this.#a);for(let e of this.#e)e.removeAttribute(`data-card-link`);this.#e=[]}#n(){if(this.parentElement?.closest(`wc-cards`)||this.#e.length)return!0;let e=[...this.querySelectorAll(this.item)];if(!e.length)return!1;if(this.#e=e.filter(e=>this.#r(e)),!this.#e.length)return!0;for(let e of this.#e)e.setAttribute(`data-card-link`,``);return this.addEventListener(`pointerdown`,this.#i),this.addEventListener(`click`,this.#a),!0}#r(e){return e.querySelector(`a[href][data-card-link-target]`)??e.querySelector(`a[href]`)}#i=e=>{this.#t={x:e.clientX,y:e.clientY}};#a=e=>{let t=e.target,n=t?.closest(`[data-card-link]`);if(!n||!this.contains(n))return;let r=this.#r(n);if(r&&t?.closest(`a[href]`)===r)return;let i=on({moved:this.#t?cn(this.#t,{x:e.clientX,y:e.clientY}):0,onInteractive:!!t?.closest(sn),platformHandled:e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0,hasLink:!!r});this.#t=void 0,!(!i||!r)&&r.click()}};customElements.get(`wc-cards`)||customElements.define(`wc-cards`,ln);function un(e,t){switch(e){case`ArrowLeft`:return{delta:t?1:-1};case`ArrowRight`:return{delta:t?-1:1};case`Home`:return`first`;case`End`:return`last`;default:return null}}function dn(e,t,n){if(t<=1)return[];let r=[Q({index:e,total:t,delta:-1,loop:n}),Q({index:e,total:t,delta:1,loop:n})];return[...new Set(r)].filter(t=>t!==e)}function fn(e,t,n){let r=Math.abs(e),i=Math.abs(t);return r<n&&i<n?null:r>=i?{type:`step`,delta:e<0?1:-1}:{type:`dismiss`}}var pn=class extends X{static{this.properties={loop:{type:Boolean,reflect:!0}}}createRenderRoot(){return this}render(){return w}#e=!1;#t=[];#n=null;#r=!1;#i=null;constructor(){super(),this.loop=!1}connectedCallback(){super.connectedCallback(),Z(this,()=>this.#a())}disconnectedCallback(){super.disconnectedCallback();for(let e of this.#t){e.dialog.removeEventListener(`command`,this.#p),e.dialog.removeEventListener(`keydown`,this.#m),e.dialog.removeEventListener(`close`,this.#h),e.dialog.removeEventListener(`pointerdown`,this.#g),e.dialog.removeEventListener(`pointerup`,this.#_);for(let t of e.nav??[])t.remove();e.originalLabel===null?e.dialog.removeAttribute(`aria-label`):e.dialog.setAttribute(`aria-label`,e.originalLabel)}this.#t=[],this.#n=null,this.#e=!1}#a(){if(this.parentElement?.closest(`wc-gallery`)||this.#e)return!0;let e=[...this.querySelectorAll(`.gallery__trigger[commandfor]`)];if(!e.length)return!1;!this.loop&&this.hasAttribute(`loop`)&&(this.loop=!0);let t=[];for(let n of e){let e=n.getAttribute(`commandfor`),r=e?this.querySelector(`#${CSS.escape(e)}`):null;if(!r)return!1;t.push({trigger:n,dialog:r,index:t.length,originalLabel:null})}this.#t=t,this.#r=matchMedia(`(prefers-reduced-motion: reduce)`).matches;for(let e of t)this.#o(e);return this.#e=!0,!0}#o(e){let t=this.#t.length;if(t>1&&this.#s(e),e.originalLabel=e.dialog.getAttribute(`aria-label`),t>1){let n=Bt(e.index,t,`Image`);e.dialog.setAttribute(`aria-label`,e.originalLabel?`${e.originalLabel} — ${n}`:n)}e.dialog.addEventListener(`command`,this.#p),e.dialog.addEventListener(`keydown`,this.#m),e.dialog.addEventListener(`close`,this.#h),e.dialog.addEventListener(`pointerdown`,this.#g),e.dialog.addEventListener(`pointerup`,this.#_)}#s(e){let t=this.#t.length,n=getComputedStyle(e.dialog).direction===`rtl`,r=(e,t,n,r,i)=>{let a=document.createElement(`div`);a.className=`lightbox-dialog__nav`,a.dataset.direction=e;let o=document.createElement(`button`);return o.type=`button`,o.className=`lightbox-dialog__nav-button`,o.setAttribute(`aria-label`,t),o.disabled=i,o.textContent=n,o.addEventListener(`click`,()=>this.#c(r)),a.append(o),a},i=!this.loop&&e.index===0,a=!this.loop&&e.index===t-1,o=[r(`prev`,`Previous image`,n?`›`:`‹`,-1,i),r(`next`,`Next image`,n?`‹`:`›`,1,a)];e.dialog.append(...o),e.nav=o}#c(e){this.#n!==null&&this.#l(Q({index:this.#n,total:this.#t.length,delta:e,loop:this.loop}))}#l(e){if(e===this.#n)return;let t=this.#n===null?void 0:this.#t[this.#n],n=this.#t[e];n&&(t?.dialog.close(),n.dialog.showModal(),this.#u(e),this.dispatchEvent(new CustomEvent(`gallery-change`,{bubbles:!0,composed:!0,detail:{index:e,total:this.#t.length}})))}#u(e){this.#n=e,this.#d(dn(e,this.#t.length,this.loop))}#d(e){for(let t of e){let e=this.#t[t]?.dialog.querySelector(`.lightbox-dialog__image`),n=e?.currentSrc||e?.src;n&&(new Image().src=n)}}#f(e){let t=this.#t.length,n=()=>{e.dialog.showModal(),this.#u(e.index),this.dispatchEvent(new CustomEvent(`gallery-open`,{bubbles:!0,composed:!0,detail:{index:e.index,total:t}}))},r=e.trigger.querySelector(`.gallery__thumb`),i=e.dialog.querySelector(`.lightbox-dialog__image`);if(this.#r||!(`startViewTransition`in document)||!r||!i){n();return}i.loading=`eager`,i.decode().catch(()=>{}).then(()=>{r.style.viewTransitionName=`lightbox-active`,document.startViewTransition(()=>{r.style.viewTransitionName=``,i.style.viewTransitionName=`lightbox-active`,n()}).finished.finally(()=>{i.style.viewTransitionName=``})})}#p=e=>{if(e.command!==`show-modal`)return;e.preventDefault();let t=e.currentTarget,n=this.#t.find(e=>e.dialog===t);n&&this.#f(n)};#m=e=>{if(this.#n===null)return;let t=getComputedStyle(e.currentTarget).direction===`rtl`,n=un(e.key,t);n&&(e.preventDefault(),n===`first`?this.#l(0):n===`last`?this.#l(this.#t.length-1):this.#c(n.delta))};#h=e=>{let t=e.currentTarget,n=this.#t.find(e=>e.dialog===t);n&&this.#n===n.index&&(this.#n=null)};#g=e=>{e.target?.closest(`button`)||(this.#i={x:e.clientX,y:e.clientY})};#_=e=>{let t=this.#i;if(this.#i=null,!t)return;let n=fn(e.clientX-t.x,e.clientY-t.y,40);n&&(n.type===`dismiss`?e.currentTarget.close():this.#c(n.delta))}};customElements.get(`wc-gallery`)||customElements.define(`wc-gallery`,pn);const mn=/^([^0-9-]*)(-?[0-9,]*\.?[0-9]*)([^0-9]*)$/;function hn(e,t){let n=mn.exec(e.trim()),r=n?.[2]||`0`,i=r.split(`.`)[1];return{prefix:(n?.[1]??``).trim(),suffix:(n?.[3]??``).trim(),value:Number.parseFloat(r.replace(/,/g,``))||0,decimals:t??i?.length??0,grouping:r.includes(`,`)}}function gn(e){return new Intl.NumberFormat(void 0,{minimumFractionDigits:e.decimals,maximumFractionDigits:e.decimals,useGrouping:e.grouping})}const _n={linear:`linear`,"ease-in":`var(--custom-ease-in)`,"ease-out":`var(--custom-ease-out)`,"float-sine":`var(--ease-float-sine)`,"float-bounce":`var(--ease-float-bounce)`};function vn(e){return e?_n[e]:void 0}const yn=new WeakMap;let bn;function xn(){return bn??=new IntersectionObserver((e,t)=>{for(let n of e)n.isIntersecting&&(t.unobserve(n.target),yn.get(n.target)?.())})}var Sn=class extends X{createRenderRoot(){return this}render(){return w}#e=!1;#t=null;#n=null;#r=null;#i=``;#a=``;#o=0;#s=0;#c=0;#l=!1;connectedCallback(){super.connectedCallback(),Z(this,()=>this.#u())}disconnectedCallback(){super.disconnectedCallback(),xn().unobserve(this),yn.delete(this),this.#h(),this.#n?.remove(),this.#n=null,this.#t?.classList.remove(`sr-only`),this.#t=null,this.#e=!1}#u(){if(this.parentElement?.closest(`wc-counter`)||this.#e)return!0;let e=this.querySelector(`.counter__value`);if(!e)return!1;this.#t=e;let t=this.getAttribute(`data-decimals`),n=hn(e.textContent??``,t?Number(t):void 0);if(this.#i=n.prefix,this.#a=n.suffix,this.#o=n.value,this.#r=gn(n),this.#e=!0,matchMedia(`(prefers-reduced-motion: reduce)`).matches)return!0;let r=document.createElement(`span`);r.className=`counter__presentation`,r.setAttribute(`aria-hidden`,`true`),r.textContent=e.textContent,e.insertAdjacentElement(`afterend`,r),this.#n=r,this.setAttribute(`aria-live`,`off`);let i=this.getAttribute(`data-from`)??`0`,a=Number(this.getAttribute(`data-duration`)??`1200`);this.style.setProperty(`--counter-from`,i),this.style.setProperty(`--counter-to`,String(this.#o)),this.style.setProperty(`--counter-duration`,`${a}ms`);let o=vn(this.getAttribute(`data-easing`));return o&&this.style.setProperty(`--counter-easing`,o),yn.set(this,()=>this.#d(a)),xn().observe(this),!0}#d(e){this.#n&&(this.#l=!1,this.setAttribute(`running`,``),this.#t?.classList.add(`sr-only`),this.#n.addEventListener(`animationend`,this.#m,{once:!0}),this.#c=window.setTimeout(this.#m,e+100),this.#s=requestAnimationFrame(this.#f))}#f=()=>{if(!this.#n||!this.#r)return;let e=Number.parseFloat(getComputedStyle(this.#n).getPropertyValue(`--_n`));this.#p(Number.isFinite(e)?e:this.#o),this.#s=requestAnimationFrame(this.#f)};#p(e){!this.#n||!this.#r||(this.#n.textContent=`${this.#i}${this.#r.format(e)}${this.#a}`)}#m=()=>{this.#l||(this.#l=!0,this.#p(this.#o),this.#h(),this.#t?.classList.remove(`sr-only`),this.removeAttribute(`running`))};#h(){this.#s&&cancelAnimationFrame(this.#s),this.#s=0,this.#c&&clearTimeout(this.#c),this.#c=0,this.#n?.removeEventListener(`animationend`,this.#m)}};customElements.get(`wc-counter`)||customElements.define(`wc-counter`,Sn);
44
+ const e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;var i=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,n=this.t;if(t&&e===void 0){let t=n!==void 0&&n.length===1;t&&(e=r.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}};const a=e=>new i(typeof e==`string`?e:e+``,void 0,n),o=(e,...t)=>new i(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,n),s=(n,r)=>{if(t)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let t of r){let r=document.createElement(`style`),i=e.litNonce;i!==void 0&&r.setAttribute(`nonce`,i),r.textContent=t.cssText,n.appendChild(r)}},c=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return a(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:d,getOwnPropertyNames:ee,getOwnPropertySymbols:te,getPrototypeOf:ne}=Object,f=globalThis,re=f.trustedTypes,ie=re?re.emptyScript:``,ae=f.reactiveElementPolyfillSupport,p=(e,t)=>e,oe={toAttribute(e,t){switch(t){case Boolean:e=e?ie:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},se=(e,t)=>!l(e,t),ce={attribute:!0,type:String,converter:oe,reflect:!1,useDefault:!1,hasChanged:se};Symbol.metadata??=Symbol(`metadata`),f.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ce){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ce}static _$Ei(){if(this.hasOwnProperty(p(`elementProperties`)))return;let e=ne(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(p(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(p(`properties`))){let e=this.properties,t=[...ee(e),...te(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(c(e))}else e!==void 0&&t.push(c(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?oe:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?oe:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??se)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};m.elementStyles=[],m.shadowRootOptions={mode:`open`},m[p(`elementProperties`)]=new Map,m[p(`finalized`)]=new Map,ae?.({ReactiveElement:m}),(f.reactiveElementVersions??=[]).push(`2.1.2`);const le=globalThis,ue=e=>e,h=le.trustedTypes,de=h?h.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,fe=`$lit$`,g=`lit$${Math.random().toFixed(9).slice(2)}$`,_=`?`+g,pe=`<${_}>`,v=document,y=()=>v.createComment(``),b=e=>e===null||typeof e!=`object`&&typeof e!=`function`,x=Array.isArray,me=e=>x(e)||typeof e?.[Symbol.iterator]==`function`,S=`[
45
+ \f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,he=/-->/g,ge=/>/g,w=RegExp(`>|${S}(?:([^\\s"'>=/]+)(${S}*=${S}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),_e=/'/g,ve=/"/g,ye=/^(?:script|style|textarea|title)$/i,be=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),T=Symbol.for(`lit-noChange`),E=Symbol.for(`lit-nothing`),xe=new WeakMap,D=v.createTreeWalker(v,129);function Se(e,t){if(!x(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return de===void 0?t:de.createHTML(t)}const Ce=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=C;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===C?c[1]===`!--`?o=he:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=w):(ye.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=w):o=ge:o===w?c[0]===`>`?(o=i??C,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?w:c[3]===`"`?ve:_e):o===ve||o===_e?o=w:o===he||o===ge?o=C:(o=w,i=void 0);let d=o===w&&e[t+1].startsWith(`/>`)?` `:``;a+=o===C?n+pe:l>=0?(r.push(s),n.slice(0,l)+fe+n.slice(l)+g+d):n+g+(l===-2?t:d)}return[Se(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]};var we=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=Ce(t,n);if(this.el=e.createElement(l,r),D.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=D.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(fe)){let t=u[o++],n=i.getAttribute(e).split(g),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Ee:r[1]===`?`?De:r[1]===`@`?Oe:A}),i.removeAttribute(e)}else e.startsWith(g)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(ye.test(i.tagName)){let e=i.textContent.split(g),t=e.length-1;if(t>0){i.textContent=h?h.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],y()),D.nextNode(),c.push({type:2,index:++a});i.append(e[t],y())}}}else if(i.nodeType===8)if(i.data===_)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(g,e+1))!==-1;)c.push({type:7,index:a}),e+=g.length-1}a++}}static createElement(e,t){let n=v.createElement(`template`);return n.innerHTML=e,n}};function O(e,t,n=e,r){if(t===T)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=b(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=O(e,i._$AS(e,t.values),i,r)),t}var Te=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??v).importNode(t,!0);D.currentNode=r;let i=D.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new k(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new ke(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=D.nextNode(),a++)}return D.currentNode=v,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},k=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=O(this,e,t),b(e)?e===E||e==null||e===``?(this._$AH!==E&&this._$AR(),this._$AH=E):e!==this._$AH&&e!==T&&this._(e):e._$litType$===void 0?e.nodeType===void 0?me(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==E&&b(this._$AH)?this._$AA.nextSibling.data=e:this.T(v.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=we.createElement(Se(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Te(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=xe.get(e.strings);return t===void 0&&xe.set(e.strings,t=new we(e)),t}k(t){x(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(y()),this.O(y()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=ue(e).nextSibling;ue(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},A=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=E,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=E}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=O(this,e,t,0),a=!b(e)||e!==this._$AH&&e!==T,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=O(this,r[n+o],t,o),s===T&&(s=this._$AH[o]),a||=!b(s)||s!==this._$AH[o],s===E?e=E:e!==E&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Ee=class extends A{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===E?void 0:e}},De=class extends A{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==E)}},Oe=class extends A{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=O(this,e,t,0)??E)===T)return;let n=this._$AH,r=e===E&&n!==E||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==E&&(n===E||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ke=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){O(this,e)}};const Ae={M:fe,P:g,A:_,C:1,L:Ce,R:Te,D:me,V:O,I:k,H:A,N:De,U:Oe,B:Ee,F:ke},je=le.litHtmlPolyfillSupport;je?.(we,k),(le.litHtmlVersions??=[]).push(`3.3.3`);const Me=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new k(t.insertBefore(y(),e),e,void 0,n??{})}return i._$AI(e),i},j=globalThis;var M=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Me(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return T}};M._$litElement$=!0,M.finalized=!0,j.litElementHydrateSupport?.({LitElement:M});const Ne=j.litElementPolyfillSupport;Ne?.({LitElement:M}),(j.litElementVersions??=[]).push(`4.2.2`);var Pe=Object.defineProperty,Fe=(e,t,n)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,N=(e,t,n)=>(Fe(e,typeof t==`symbol`?t:t+``,n),n),Ie=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},P=(e,t)=>{if(Object(t)!==t)throw TypeError(`Cannot use the "in" operator on this value`);return e.has(t)},F=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Le=(e,t,n)=>(Ie(e,t,`access private method`),n);function Re(e,t){return Object.is(e,t)}let I=null,L=!1,R=1;const z=Symbol(`SIGNAL`);function B(e){let t=I;return I=e,t}function ze(){return I}function Be(){return L}const Ve={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function V(e){if(L)throw Error(typeof ngDevMode<`u`&&ngDevMode?`Assertion error: signal read during notification phase`:``);if(I===null)return;I.consumerOnSignalRead(e);let t=I.nextProducerIndex++;if(U(I),t<I.producerNode.length&&I.producerNode[t]!==e&&Ze(I)){let e=I.producerNode[t];H(e,I.producerIndexOfThis[t])}I.producerNode[t]!==e&&(I.producerNode[t]=e,I.producerIndexOfThis[t]=Ze(I)?Xe(e,I,t):0),I.producerLastReadVersion[t]=e.version}function He(){R++}function Ue(e){if(!(!e.dirty&&e.lastCleanEpoch===R)){if(!e.producerMustRecompute(e)&&!Ye(e)){e.dirty=!1,e.lastCleanEpoch=R;return}e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=R}}function We(e){if(e.liveConsumerNode===void 0)return;let t=L;L=!0;try{for(let t of e.liveConsumerNode)t.dirty||Ke(t)}finally{L=t}}function Ge(){return I?.consumerAllowSignalWrites!==!1}function Ke(e){var t;e.dirty=!0,We(e),(t=e.consumerMarkedDirty)==null||t.call(e.wrapper??e)}function qe(e){return e&&(e.nextProducerIndex=0),B(e)}function Je(e,t){if(B(t),!(!e||e.producerNode===void 0||e.producerIndexOfThis===void 0||e.producerLastReadVersion===void 0)){if(Ze(e))for(let t=e.nextProducerIndex;t<e.producerNode.length;t++)H(e.producerNode[t],e.producerIndexOfThis[t]);for(;e.producerNode.length>e.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function Ye(e){U(e);for(let t=0;t<e.producerNode.length;t++){let n=e.producerNode[t],r=e.producerLastReadVersion[t];if(r!==n.version||(Ue(n),r!==n.version))return!0}return!1}function Xe(e,t,n){var r;if(Qe(e),U(e),e.liveConsumerNode.length===0){(r=e.watched)==null||r.call(e.wrapper);for(let t=0;t<e.producerNode.length;t++)e.producerIndexOfThis[t]=Xe(e.producerNode[t],e,t)}return e.liveConsumerIndexOfThis.push(n),e.liveConsumerNode.push(t)-1}function H(e,t){var n;if(Qe(e),U(e),typeof ngDevMode<`u`&&ngDevMode&&t>=e.liveConsumerNode.length)throw Error(`Assertion error: active consumer index ${t} is out of bounds of ${e.liveConsumerNode.length} consumers)`);if(e.liveConsumerNode.length===1){(n=e.unwatched)==null||n.call(e.wrapper);for(let t=0;t<e.producerNode.length;t++)H(e.producerNode[t],e.producerIndexOfThis[t])}let r=e.liveConsumerNode.length-1;if(e.liveConsumerNode[t]=e.liveConsumerNode[r],e.liveConsumerIndexOfThis[t]=e.liveConsumerIndexOfThis[r],e.liveConsumerNode.length--,e.liveConsumerIndexOfThis.length--,t<e.liveConsumerNode.length){let n=e.liveConsumerIndexOfThis[t],r=e.liveConsumerNode[t];U(r),r.producerIndexOfThis[n]=t}}function Ze(e){return e.consumerIsAlwaysLive||(e?.liveConsumerNode?.length??0)>0}function U(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function Qe(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function $e(e){if(Ue(e),V(e),e.value===rt)throw e.error;return e.value}function et(e){let t=Object.create(it);t.computation=e;let n=()=>$e(t);return n[z]=t,n}const tt=Symbol(`UNSET`),nt=Symbol(`COMPUTING`),rt=Symbol(`ERRORED`),it={...Ve,value:tt,dirty:!0,error:null,equal:Re,producerMustRecompute(e){return e.value===tt||e.value===nt},producerRecomputeValue(e){if(e.value===nt)throw Error(`Detected cycle in computations.`);let t=e.value;e.value=nt;let n=qe(e),r,i=!1;try{r=e.computation.call(e.wrapper),i=t!==tt&&t!==rt&&e.equal.call(e.wrapper,t,r)}catch(t){r=rt,e.error=t}finally{Je(e,n)}if(i){e.value=t;return}e.value=r,e.version++}};function at(){throw Error()}let ot=at;function st(){ot()}function ct(e){let t=Object.create(dt);t.value=e;let n=()=>(V(t),t.value);return n[z]=t,n}function lt(){return V(this),this.value}function ut(e,t){Ge()||st(),e.equal.call(e.wrapper,e.value,t)||(e.value=t,ft(e))}const dt={...Ve,equal:Re,value:void 0};function ft(e){e.version++,He(),We(e)}const W=Symbol(`node`);var G;(e=>{var t,n,r,i;class a{constructor(r,i={}){F(this,n),N(this,t);let a=ct(r)[z];if(this[W]=a,a.wrapper=this,i){let t=i.equals;t&&(a.equal=t),a.watched=i[e.subtle.watched],a.unwatched=i[e.subtle.unwatched]}}get(){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.get`);return lt.call(this[W])}set(t){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.set`);if(Be())throw Error(`Writes to signals not permitted during Watcher callback`);let n=this[W];ut(n,t)}}t=W,n=new WeakSet,e.isState=e=>typeof e==`object`&&P(n,e),e.State=a;class o{constructor(t,n){F(this,i),N(this,r);let a=et(t)[z];if(a.consumerAllowSignalWrites=!0,this[W]=a,a.wrapper=this,n){let t=n.equals;t&&(a.equal=t),a.watched=n[e.subtle.watched],a.unwatched=n[e.subtle.unwatched]}}get(){if(!(0,e.isComputed)(this))throw TypeError(`Wrong receiver type for Signal.Computed.prototype.get`);return $e(this[W])}}r=W,i=new WeakSet,e.isComputed=e=>typeof e==`object`&&P(i,e),e.Computed=o,(t=>{var n,r,i,a;function o(e){let t,n=null;try{n=B(null),t=e()}finally{B(n)}return t}t.untrack=o;function s(t){if(!(0,e.isComputed)(t)&&!(0,e.isWatcher)(t))throw TypeError(`Called introspectSources without a Computed or Watcher argument`);return t[W].producerNode?.map(e=>e.wrapper)??[]}t.introspectSources=s;function c(t){if(!(0,e.isComputed)(t)&&!(0,e.isState)(t))throw TypeError(`Called introspectSinks without a Signal argument`);return t[W].liveConsumerNode?.map(e=>e.wrapper)??[]}t.introspectSinks=c;function l(t){if(!(0,e.isComputed)(t)&&!(0,e.isState)(t))throw TypeError(`Called hasSinks without a Signal argument`);let n=t[W].liveConsumerNode;return n?n.length>0:!1}t.hasSinks=l;function u(t){if(!(0,e.isComputed)(t)&&!(0,e.isWatcher)(t))throw TypeError(`Called hasSources without a Computed or Watcher argument`);let n=t[W].producerNode;return n?n.length>0:!1}t.hasSources=u;class d{constructor(e){F(this,r),F(this,i),N(this,n);let t=Object.create(Ve);t.wrapper=this,t.consumerMarkedDirty=e,t.consumerIsAlwaysLive=!0,t.consumerAllowSignalWrites=!1,t.producerNode=[],this[W]=t}watch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);Le(this,i,a).call(this,t);let n=this[W];n.dirty=!1;let r=B(n);for(let e of t)V(e[W]);B(r)}unwatch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);Le(this,i,a).call(this,t);let n=this[W];U(n);for(let e=n.producerNode.length-1;e>=0;e--)if(t.includes(n.producerNode[e].wrapper)){H(n.producerNode[e],n.producerIndexOfThis[e]);let t=n.producerNode.length-1;if(n.producerNode[e]=n.producerNode[t],n.producerIndexOfThis[e]=n.producerIndexOfThis[t],n.producerNode.length--,n.producerIndexOfThis.length--,n.nextProducerIndex--,e<n.producerNode.length){let t=n.producerIndexOfThis[e],r=n.producerNode[e];Qe(r),r.liveConsumerIndexOfThis[t]=e}}}getPending(){if(!(0,e.isWatcher)(this))throw TypeError(`Called getPending without Watcher receiver`);return this[W].producerNode.filter(e=>e.dirty).map(e=>e.wrapper)}}n=W,r=new WeakSet,i=new WeakSet,a=function(t){for(let n of t)if(!(0,e.isComputed)(n)&&!(0,e.isState)(n))throw TypeError(`Called watch/unwatch without a Computed or State argument`)},e.isWatcher=e=>P(r,e),t.Watcher=d;function ee(){return ze()?.wrapper}t.currentComputed=ee,t.watched=Symbol(`watched`),t.unwatched=Symbol(`unwatched`)})(e.subtle||={})})(G||={});let pt=!1;const mt=new G.subtle.Watcher(()=>{pt||(pt=!0,queueMicrotask(()=>{pt=!1;for(let e of mt.getPending())e.get();mt.watch()}))}),ht=Symbol(`SignalWatcherBrand`),gt=new FinalizationRegistry(e=>{e.unwatch(...G.subtle.introspectSources(e))}),_t=new WeakMap;function vt(e){return!0===e[ht]?(console.warn(`SignalWatcher should not be applied to the same class more than once.`),e):class extends e{constructor(){super(...arguments),this._$St=new Map,this._$So=new G.State(0),this._$Si=!1}_$Sl(){var e;let t=[],n=[];this._$St.forEach((e,r)=>{(e?.beforeUpdate?t:n).push(r)});let r=this.h?.getPending().filter(e=>e!==this._$Su&&!this._$St.has(e));t.forEach(e=>e.get()),(e=this._$Su)==null||e.get(),r.forEach(e=>e.get()),n.forEach(e=>e.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(this.h!==void 0)return;this._$Su=new G.Computed(()=>{this._$So.get(),super.performUpdate()});let e=this.h=new G.subtle.Watcher(function(){let e=_t.get(this);e!==void 0&&(!1===e._$Si&&(new Set(this.getPending()).has(e._$Su)?e.requestUpdate():e._$Sv()),this.watch())});_t.set(e,this),gt.register(this,e),e.watch(this._$Su),e.watch(...Array.from(this._$St).map(([e])=>e))}_$Sp(){if(this.h===void 0)return;let e=!1;this.h.unwatch(...G.subtle.introspectSources(this.h).filter(t=>{let n=!0!==this._$St.get(t)?.manualDispose;return n&&this._$St.delete(t),e||=!n,n})),e||(this._$Su=void 0,this.h=void 0,this._$St.clear())}updateEffect(e,t){var n;this._$S_();let r=new G.Computed(()=>{e()});return this.h.watch(r),this._$St.set(r,t),(n=t?.beforeUpdate)!=null&&n?G.subtle.untrack(()=>r.get()):this.updateComplete.then(()=>G.subtle.untrack(()=>r.get())),()=>{this._$St.delete(r),this.h.unwatch(r),!1===this.isConnected&&this._$Sp()}}performUpdate(){this.isUpdatePending&&(this._$S_(),this._$Si=!0,this._$So.set(this._$So.get()+1),this._$Si=!1,this._$Sl())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{!1===this.isConnected&&this._$Sp()})}}}const yt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},bt=e=>(...t)=>({_$litDirective$:e,values:t});var xt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};const{I:St}=Ae,Ct=e=>e.strings===void 0,K=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),K(e,t);return!0},q=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},wt=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Dt(t)}};function Tt(e){this._$AN===void 0?this._$AM=e:(q(this),this._$AM=e,wt(this))}function Et(e,t=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let e=n;e<r.length;e++)K(r[e],!1),q(r[e]);else r!=null&&(K(r,!1),q(r));else K(this,e)}const Dt=e=>{e.type==yt.CHILD&&(e._$AP??=Et,e._$AQ??=Tt)};var Ot=class extends xt{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),wt(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(K(this,e),q(this))}setValue(e){if(Ct(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};let J=!1;const kt=new G.subtle.Watcher(async()=>{J||(J=!0,queueMicrotask(()=>{J=!1;for(let e of kt.getPending())e.get();kt.watch()}))}),At=bt(class extends Ot{_$S_(){this._$Sm===void 0&&(this._$Sj=new G.Computed(()=>{let e=this._$SW?.get();return this.setValue(e),e}),this._$Sm=this._$Sk?.h??kt,this._$Sm.watch(this._$Sj),G.subtle.untrack(()=>this._$Sj?.get()))}_$Sp(){this._$Sm!==void 0&&(this._$Sm.unwatch(this._$SW),this._$Sm=void 0)}render(e){return G.subtle.untrack(()=>e.get())}update(e,[t]){return this._$Sk??=e.options?.host,t!==this._$SW&&this._$SW!==void 0&&this._$Sp(),this._$SW=t,this._$S_(),G.subtle.untrack(()=>this._$SW.get())}disconnected(){this._$Sp()}reconnected(){this._$S_()}}),Y=(e=>(t,...n)=>e(t,...n.map(e=>e instanceof G.State||e instanceof G.Computed?At(e):e)))(be);G.State,G.Computed;const jt=vt(M);var X=class extends jt{static{this.styles=[]}getSlottedNodes(e=[]){let t=this.shadowRoot?.querySelector(`slot`);if(!t)return[];let n=t.assignedNodes({flatten:!0});return e.length===0?n:n.filter(t=>e.includes(t.tagName.toLowerCase()))}},Mt=class{constructor(e,t){this.handleEl=null,this.isDragging=!1,this.rafId=null,this.pendingPosition=null,this.containerRect=null,this.currentPosition=.5,this.prefersReducedMotion=!1,this.onPointerDown=e=>{if(e.button!==0)return;e.preventDefault(),this.isDragging=!0,this.handleEl?.setPointerCapture(e.pointerId);let t=this.handleEl?.parentElement;this.containerRect=t?.getBoundingClientRect()??null,document.addEventListener(`pointermove`,this.onPointerMove),document.addEventListener(`pointerup`,this.onPointerUp),document.addEventListener(`pointercancel`,this.onPointerUp),this.handleEl?.classList.add(`dragging`),this.options.onDragStart(),this.processPointerEvent(e)},this.onPointerMove=e=>{this.isDragging&&this.processPointerEvent(e)},this.flushPosition=()=>{this.rafId=null,this.pendingPosition!==null&&this.isDragging&&(this.currentPosition=this.pendingPosition,this.updateAriaValue(this.currentPosition),this.options.onDrag(this.currentPosition))},this.onPointerUp=e=>{if(!this.isDragging)return;this.isDragging=!1,this.handleEl?.releasePointerCapture(e.pointerId),this.containerRect=null,this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null);let t=this.pendingPosition??this.currentPosition;this.currentPosition=t,this.pendingPosition=null,this.updateAriaValue(t),this.options.onDragEnd(t),document.removeEventListener(`pointermove`,this.onPointerMove),document.removeEventListener(`pointerup`,this.onPointerUp),document.removeEventListener(`pointercancel`,this.onPointerUp),this.handleEl?.classList.remove(`dragging`)},this.onKeyDown=e=>{let{orientation:t,keyboardStep:n,keyboardLargeStep:r}=this.options,i=e.shiftKey?r:n,a=0;if(t===`horizontal`?e.key===`ArrowLeft`?a=-i:e.key===`ArrowRight`&&(a=i):e.key===`ArrowUp`?a=-i:e.key===`ArrowDown`&&(a=i),e.key===`Home`){e.preventDefault(),this.currentPosition=0,this.updateAriaValue(0),this.options.onDrag(0),this.options.onDragEnd(0);return}if(e.key===`End`){e.preventDefault(),this.currentPosition=1,this.updateAriaValue(1),this.options.onDrag(1),this.options.onDragEnd(1);return}if(a!==0){e.preventDefault();let t=Math.max(0,Math.min(1,this.currentPosition+a));this.currentPosition=t,this.updateAriaValue(t),this.options.onDrag(t),this.options.onDragEnd(t)}},this.host=e,this.options={handleSelector:t.handleSelector,orientation:t.orientation??`horizontal`,smooth:t.smooth??!0,onDrag:t.onDrag??(()=>{}),onDragStart:t.onDragStart??(()=>{}),onDragEnd:t.onDragEnd??(()=>{}),keyboardStep:t.keyboardStep??.01,keyboardLargeStep:t.keyboardLargeStep??.1},e.addController(this)}hostConnected(){this.prefersReducedMotion=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}hostUpdated(){this.setupHandle()}hostDisconnected(){this.cleanup()}get shouldSmooth(){return this.options.smooth&&!this.prefersReducedMotion}setupHandle(){let e=this.host.renderRoot.querySelector(this.options.handleSelector);e!==this.handleEl&&(this.handleEl&&(this.handleEl.removeEventListener(`pointerdown`,this.onPointerDown),this.handleEl.removeEventListener(`keydown`,this.onKeyDown)),this.handleEl=e,this.handleEl&&(this.handleEl.addEventListener(`pointerdown`,this.onPointerDown),this.handleEl.addEventListener(`keydown`,this.onKeyDown),this.handleEl.hasAttribute(`tabindex`)||this.handleEl.setAttribute(`tabindex`,`0`),this.handleEl.hasAttribute(`role`)||this.handleEl.setAttribute(`role`,`separator`),this.handleEl.setAttribute(`aria-valuemin`,`0`),this.handleEl.setAttribute(`aria-valuemax`,`100`),this.updateAriaValue(this.currentPosition)))}processPointerEvent(e){if(!this.containerRect)return;let{orientation:t}=this.options,n=this.containerRect,r;if(t===`horizontal`){let t=e.clientX-n.left;r=Math.max(0,Math.min(1,t/n.width))}else{let t=e.clientY-n.top;r=Math.max(0,Math.min(1,t/n.height))}this.pendingPosition=r,this.shouldSmooth&&this.rafId===null&&(this.rafId=requestAnimationFrame(this.flushPosition))}updateAriaValue(e){let t=Math.round(e*100);this.handleEl?.setAttribute(`aria-valuenow`,String(t))}cleanup(){this.handleEl&&(this.handleEl.removeEventListener(`pointerdown`,this.onPointerDown),this.handleEl.removeEventListener(`keydown`,this.onKeyDown)),document.removeEventListener(`pointermove`,this.onPointerMove),document.removeEventListener(`pointerup`,this.onPointerUp),document.removeEventListener(`pointercancel`,this.onPointerUp),this.rafId!==null&&cancelAnimationFrame(this.rafId)}setPosition(e){this.currentPosition=Math.max(0,Math.min(1,e)),this.updateAriaValue(this.currentPosition)}getPosition(){return this.currentPosition}updateOptions(e){Object.assign(this.options,e)}},Nt=class extends X{static{this.styles=[X.styles,o`
46
+ :host{--_offset:var(--offset, 0.5);--_handle-size:var(--handle-size, 8px);--_handle-color:var(--handle-color, oklch(0.85 0 0));--_handle-hover:var(--handle-hover-color, oklch(0.7 0 0));--_min-size:var(--min-panel-size, 100px);display:block}.splitter{display:grid;block-size:100%;inline-size:100%}:host(:not([vertical])) .splitter{grid-template-columns:calc(var(--_offset)*(100% - var(--_handle-size))) var(--_handle-size) calc((1 - var(--_offset))*(100% - var(--_handle-size)));grid-template-rows:1fr}:host([vertical]) .splitter{grid-template-rows:calc(var(--_offset)*(100% - var(--_handle-size))) var(--_handle-size) calc((1 - var(--_offset))*(100% - var(--_handle-size)));grid-template-columns:1fr}.panel{overflow:auto;min-inline-size:0;min-block-size:0}.panel--start{grid-area:1/1}:host(:not([vertical])) .panel--end{grid-area:1/3}:host([vertical]) .panel--end{grid-area:3/1}.handle{flex-shrink:0;background:var(--_handle-color);transition:background-color .15s ease;position:relative;display:flex;align-items:center;justify-content:center}.handle:focus-visible,.handle:hover{background:var(--_handle-hover)}.handle:focus-visible{outline:2px solid oklch(.6 .2 250);outline-offset:-2px}:host(:not([vertical])) .handle{cursor:col-resize;grid-area:1/2}:host([vertical]) .handle{cursor:row-resize;grid-area:2/1}.handle:after{content:"";background:currentColor;opacity:.3;border-radius:1px}:host(:not([vertical])) .handle:after{inline-size:2px;block-size:24px}:host([vertical]) .handle:after{inline-size:24px;block-size:2px}.handle.dragging{background:var(--_handle-hover)}.handle.dragging:after{opacity:.5}@media (any-pointer:coarse){:host(:not([vertical])) .handle{min-inline-size:44px}:host([vertical]) .handle{min-block-size:44px}}@media (prefers-reduced-motion:reduce){.handle{transition:none}}`]}static{this.properties={position:{type:Number},vertical:{type:Boolean,reflect:!0},discrete:{type:Boolean,reflect:!0},minSize:{type:Number,attribute:`min-size`},maxSize:{type:Number,attribute:`max-size`},keyboardStep:{type:Number,attribute:`keyboard-step`},collapseThreshold:{type:Number,attribute:`collapse-threshold`},snapPoints:{type:String,attribute:`snap-points`},snapDistance:{type:Number,attribute:`snap-distance`},_offset:{state:!0}}}constructor(){super(),this.containerSize=0,this.position=50,this.vertical=!1,this.discrete=!1,this.minSize=100,this.maxSize=0,this.keyboardStep=1,this.collapseThreshold=0,this.snapPoints=``,this.snapDistance=10,this._offset=.5,this.initDragController()}initDragController(){this.dragController=new Mt(this,{handleSelector:`[part="handle"]`,orientation:this.vertical?`vertical`:`horizontal`,smooth:!this.discrete,onDragStart:()=>this.handleDragStart(),onDrag:e=>this.handleDrag(e),onDragEnd:e=>this.handleDragEnd(e),keyboardStep:this.keyboardStep/100,keyboardLargeStep:this.keyboardStep/10})}willUpdate(e){e.has(`position`)&&!e.has(`_offset`)&&(this._offset=this.position/100,this.dragController.setPosition(this._offset)),(e.has(`vertical`)||e.has(`discrete`)||e.has(`keyboardStep`))&&this.dragController.updateOptions({orientation:this.vertical?`vertical`:`horizontal`,smooth:!this.discrete,keyboardStep:this.keyboardStep/100,keyboardLargeStep:this.keyboardStep/10})}handleDragStart(){let e=this.renderRoot.querySelector(`.splitter`);if(e){let t=e.getBoundingClientRect();this.containerSize=this.vertical?t.height:t.width}}applyConstraints(e){let t=e;if(this.containerSize>0){let e=this.minSize/this.containerSize,n=this.maxSize>0?this.maxSize/this.containerSize:1-e;t=Math.max(e,Math.min(1-e,t)),t=Math.min(n,t)}if(this.snapPoints&&this.containerSize>0){let e=this.snapPoints.split(`,`).map(e=>parseFloat(e.trim())/100),n=this.snapDistance/this.containerSize;for(let r of e)if(Math.abs(t-r)<n){t=r;break}}if(this.collapseThreshold>0){let e=this.collapseThreshold/100;t<e?t=0:t>1-e&&(t=1)}return t}handleDrag(e){let t=this.applyConstraints(e);this._offset=t,this.style.setProperty(`--_offset`,String(this._offset))}handleDragEnd(e){let t=this.applyConstraints(e);this._offset=t,this.style.setProperty(`--_offset`,String(this._offset)),this.dispatchEvent(new CustomEvent(`split-change`,{detail:{position:this._offset*100},bubbles:!0,composed:!0}))}render(){return be` <div class="splitter" part="container" style="--_offset:${this._offset}"> <div class="panel panel--start" part="panel-start"> <slot name="start"></slot> </div> <div class="handle" part="handle" role="separator" aria-label="Panel resize handle" aria-orientation="${this.vertical?`vertical`:`horizontal`}"></div> <div class="panel panel--end" part="panel-end"> <slot name="end"></slot> </div> </div> `}};customElements.get(`wc-split-panel`)||customElements.define(`wc-split-panel`,Nt);var Pt=class extends X{static{this.styles=[X.styles,o`
47
+ :host{--_offset:var(--offset, 0.5);--_handle-size:var(--handle-size, 40px);--_handle-color:var(--handle-color, #fff);--_line-color:var(--line-color, #fff);--_line-width:var(--line-width, 2px);display:block;position:relative;overflow:hidden;touch-action:pan-y;user-select:none}:host([vertical]){touch-action:pan-x}.container{position:relative;display:grid}.after,.before{grid-area:1/1}.after ::slotted(img),.before ::slotted(img){display:block;inline-size:100%;block-size:auto}.before{clip-path:inset(0 calc((1 - var(--_offset))*100%) 0 0)}:host([vertical]) .before{clip-path:inset(0 0 calc((1 - var(--_offset))*100%) 0)}.handle{position:absolute;inset-block:0;inset-inline-start:calc(var(--_offset)*100%);translate:-50% 0;inline-size:var(--_handle-size);display:flex;flex-direction:column;align-items:center;cursor:ew-resize;z-index:1}:host([vertical]) .handle{inset-block:auto;inset-block-start:calc(var(--_offset)*100%);inset-inline:0;translate:0 -50%;flex-direction:row;cursor:ns-resize;block-size:var(--_handle-size);inline-size:100%}.handle:before{content:"";position:absolute;inset-block:0;inset-inline-start:50%;translate:-50% 0;inline-size:var(--_line-width);background:var(--_line-color);box-shadow:0 0 4px oklch(0 0 0/.3);pointer-events:none}:host([vertical]) .handle:before{inset-inline:0;inset-block:auto;inset-block-start:50%;translate:0 -50%;inline-size:100%;block-size:var(--_line-width)}.grip{position:absolute;inset-block-start:50%;inset-inline-start:50%;translate:-50% -50%;inline-size:var(--_handle-size);block-size:var(--_handle-size);background:var(--_handle-color);border-radius:50%;box-shadow:0 2px 8px oklch(0 0 0/.2);display:flex;align-items:center;justify-content:center;transition:scale .15s ease,box-shadow .15s ease}.grip:after,.grip:before{content:"";position:absolute;border:5px solid transparent}.grip:before{border-inline-end-color:oklch(.3 0 0);inset-inline-start:6px}.grip:after{border-inline-start-color:oklch(.3 0 0);inset-inline-end:6px}:host([vertical]) .grip:before{border-inline-end-color:transparent;border-block-end-color:oklch(.3 0 0);inset-inline-start:auto;inset-block-start:6px}:host([vertical]) .grip:after{border-inline-start-color:transparent;border-block-start-color:oklch(.3 0 0);inset-inline-end:auto;inset-block-end:6px}.handle:focus-visible .grip,.handle:hover .grip{scale:1.1;box-shadow:0 4px 12px oklch(0 0 0/.3)}.handle:focus-visible{outline:none}.handle:focus-visible .grip{outline:2px solid oklch(.6 .2 250);outline-offset:2px}.handle.dragging .grip{scale:1.15;box-shadow:0 6px 16px oklch(0 0 0/.35)}@media (prefers-reduced-motion:reduce){.grip{transition:none}}@media (any-pointer:coarse){.handle{min-inline-size:44px}:host([vertical]) .handle{min-block-size:44px}}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}`]}static{this.properties={position:{type:Number},vertical:{type:Boolean,reflect:!0},discrete:{type:Boolean,reflect:!0},keyboardStep:{type:Number,attribute:`keyboard-step`},beforeLabel:{type:String,attribute:`before-label`},afterLabel:{type:String,attribute:`after-label`},_offset:{type:Number,state:!0}}}constructor(){super(),this.init(),this.initDragController()}init(){this.position=50,this.vertical=!1,this.discrete=!1,this.keyboardStep=1,this.beforeLabel=`Before`,this.afterLabel=`After`,this._offset=.5}initDragController(){this.dragController=new Mt(this,{handleSelector:`[part="handle"]`,orientation:this.vertical?`vertical`:`horizontal`,smooth:!this.discrete,onDrag:e=>this.handleDrag(e),onDragEnd:e=>this.handleDragEnd(e),keyboardStep:this.keyboardStep/100,keyboardLargeStep:this.keyboardStep/10})}willUpdate(e){e.has(`position`)&&!e.has(`_offset`)&&(this._offset=this.position/100,this.dragController.setPosition(this._offset)),(e.has(`vertical`)||e.has(`discrete`)||e.has(`keyboardStep`))&&this.dragController.updateOptions({orientation:this.vertical?`vertical`:`horizontal`,smooth:!this.discrete,keyboardStep:this.keyboardStep/100,keyboardLargeStep:this.keyboardStep/10})}handleDrag(e){this._offset=e,this.style.setProperty(`--_offset`,String(this._offset))}handleDragEnd(e){this._offset=e,this.style.setProperty(`--_offset`,String(this._offset)),this.dispatchEvent(new CustomEvent(`compare-change`,{detail:{position:this._offset*100},bubbles:!0,composed:!0}))}render(){return be` <div class="container" part="container" style="--_offset:${this._offset}"> <div class="after" part="after" aria-label="${this.afterLabel}"> <slot name="after"></slot> </div> <div class="before" part="before" aria-label="${this.beforeLabel}"> <slot name="before"></slot> </div> <div class="handle" part="handle" role="separator" aria-label="Image comparison handle" aria-orientation="${this.vertical?`vertical`:`horizontal`}"> <div class="grip" part="grip"> <span class="visually-hidden">Drag to compare</span> </div> </div> </div> `}};customElements.get(`wc-image-compare`)||customElements.define(`wc-image-compare`,Pt);var Ft=class extends X{static{this.properties={duration:{type:Number,reflect:!0},exit:{type:Number}}}createRenderRoot(){return this}render(){return T}#e;constructor(){super(),this.duration=0,this.exit=200}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this.#t),this.duration>0&&(this.#e=setTimeout(()=>this.dismiss(),this.duration))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`click`,this.#t),this.#e&&clearTimeout(this.#e)}#t=e=>{e.target?.closest(`[data-dismiss]`)&&(e.preventDefault(),this.dismiss())};dismiss(){this.#e&&=(clearTimeout(this.#e),void 0);let e=new CustomEvent(`dismiss`,{bubbles:!0,cancelable:!0});if(!this.dispatchEvent(e))return;let t=matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(this.exit<=0||t){this.remove();return}this.style.transition=`opacity ${this.exit}ms ease, scale ${this.exit}ms ease`,this.style.opacity=`0`,this.style.scale=`0.97`;let n=!1,r=()=>{n||(n=!0,this.remove())};this.addEventListener(`transitionend`,r,{once:!0}),setTimeout(r,this.exit+50)}};customElements.get(`wc-dismissable`)||customElements.define(`wc-dismissable`,Ft);var It=class extends X{static{this.styles=[X.styles,o`
48
+ :host{display:inline-flex;align-items:center;gap:.5rem}.copy__button{display:none;align-items:center;justify-content:center;min-inline-size:var(--copy-size,2.5rem);min-block-size:var(--copy-size,2.5rem);padding:var(--copy-padding,.5rem);background:var(--copy-bg,transparent);border:var(--copy-border,none);border-radius:var(--copy-radius,.375rem);cursor:pointer;transition:background-color .15s ease,transform .1s ease}:host(wc-copy:defined) .copy__button{display:inline-flex}.copy__button:hover{background:var(--copy-hover-bg,oklch(.9 0 0))}.copy__button:active{transform:scale(.95)}.copy__button:focus-visible{outline:2px solid var(--copy-focus-color,oklch(.6 .2 250));outline-offset:2px}.copy__icon{inline-size:1.25em;block-size:1.25em;background-color:currentColor;mask-size:contain;mask-repeat:no-repeat;mask-position:center}.copy__icon--copy{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20448%20512%22%3E%3Cpath%20d%3D%22M208%200h124.1C344.8%200%20357%205.1%20366%2014.1L433.9%2082c9%209%2014.1%2021.2%2014.1%2033.9V336c0%2026.5-21.5%2048-48%2048H208c-26.5%200-48-21.5-48-48V48c0-26.5%2021.5-48%2048-48M48%20128h80v64H64v256h192v-32h64v48c0%2026.5-21.5%2048-48%2048H48c-26.5%200-48-21.5-48-48V176c0-26.5%2021.5-48%2048-48%22%2F%3E%3C%2Fsvg%3E")}.copy__icon--success{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20448%20512%22%3E%3Cpath%20d%3D%22M438.6%20105.4c12.5%2012.5%2012.5%2032.8%200%2045.3l-256%20256c-12.5%2012.5-32.8%2012.5-45.3%200l-128-128c-12.5-12.5-12.5-32.8%200-45.3s32.8-12.5%2045.3%200L160%20338.7l233.4-233.3c12.5-12.5%2032.8-12.5%2045.3%200z%22%2F%3E%3C%2Fsvg%3E");color:var(--copy-success-color,oklch(.6 .2 145))}`]}static{this.properties={value:{type:String},label:{type:String},_copied:{type:Boolean,state:!0}}}constructor(){super(),this._handleCopy=async()=>{let e=this.value??this.getSlottedNodes().map(e=>e.textContent).join(``).trim();if(!(e==null||e===``)){console.log(`copying value:`,e);try{await navigator.clipboard.writeText(e),this._copied=!0,this._timeoutId=setTimeout(()=>{this._copied=!1},2e3),this.dispatchEvent(new CustomEvent(`copy`,{detail:{value:this.value},bubbles:!0,composed:!0}))}catch(e){console.error(`Failed to copy:`,e),this.dispatchEvent(new CustomEvent(`copy-error`,{detail:{error:e},bubbles:!0,composed:!0}))}}},this.init()}init(){this.value=void 0,this.label=`Copy to clipboard`,this._copied=!1}disconnectedCallback(){super.disconnectedCallback(),this._timeoutId&&clearTimeout(this._timeoutId)}render(){let e=this._copied?`copy__icon copy__icon--success`:`copy__icon copy__icon--copy`;return Y` <slot></slot> <button class="copy__button" part="button" type="button" aria-label="${this._copied?`Copied!`:this.label}" @click="${this._handleCopy}"> <span class="${e}" part="icon" aria-hidden="true"></span> </button> `}};customElements.get(`wc-copy`)||customElements.define(`wc-copy`,It);function Lt(e){let t=t=>e(t).trim()===`1`;return{nativeNav:t(`--carousel-native-nav`),scrollTimeline:t(`--carousel-scroll-timeline`)}}function Rt(e,t){let n=e.slides>=2;return{clone:n&&!e.paged&&(e.loop||e.autoplay>0),play:e.autoplay>0&&!e.reducedMotion,buildButtons:n&&e.wantsButtons&&!t.nativeNav,buildMarkers:n&&e.wantsMarkers&&!t.nativeNav,trackScrolled:!t.scrollTimeline}}function zt(e){return Math.abs(e)>4}function Bt(e,t,n=`Slide`){return`${n} ${e+1} of ${t}`}const Vt=Object.freeze({loading:`lazy`,fetchpriority:`low`,decoding:`async`});function Z(e,t){t()||queueMicrotask(()=>{e.isConnected&&t()})}function Ht(e){let{index:t,total:n,delta:r,loop:i}=e;if(n<=0)return t;let a=t+r;return i?(a%n+n)%n:Math.min(Math.max(a,0),n-1)}function Ut(e,t){let{orientation:n,rtl:r=!1}=t,i=n===`horizontal`||n===`both`,a=n===`vertical`||n===`both`;if(i){if(e===`ArrowLeft`)return{type:`step`,delta:r?1:-1};if(e===`ArrowRight`)return{type:`step`,delta:r?-1:1}}if(a){if(e===`ArrowUp`)return{type:`step`,delta:-1};if(e===`ArrowDown`)return{type:`step`,delta:1}}return e===`Home`?{type:`first`}:e===`End`?{type:`last`}:null}function Wt(e,t,n,r=1e3){let i=!e||n-e.lastTime>r?t:e.buffer+t;return{buffer:i,query:i.length>1&&Array.from(i).every(e=>e===i[0])?i[0]:i,lastTime:n}}function Gt(e,t,n,r){let i=t.toLowerCase();if(!i)return null;let a=e.length;if(!a)return null;let o=Math.max(0,e.findIndex(e=>e.key===n));for(let t=1;t<=a;t++){let n=e[(o+t)%a];if(!r?.(n.key)&&n.text.toLowerCase().startsWith(i))return n.key}return null}const Kt=e=>!e.hidden&&!e.closest(`[hidden]`);var qt=class{#e;#t=null;#n=null;#r=null;constructor(e,t){this.#e=t,e.addController(this)}get active(){return this.#n}#i=e=>(this.#e.isFocusable??Kt)(e);attach(e){this.#t!==e&&(this.detach(),this.#t=e,e.addEventListener(`keydown`,this.#o),e.addEventListener(`focusin`,this.#a),this.sync())}detach(){this.#t&&=(this.#t.removeEventListener(`keydown`,this.#o),this.#t.removeEventListener(`focusin`,this.#a),null)}sync(){let e=this.#e.items(),t=e.filter(this.#i),n=this.#n,r=n!==null&&document.activeElement===n,i=n!==null&&t.includes(n),a=i?n:t[0]??null;for(let t of e)t.tabIndex=t===a?0:-1;this.#n=a,r&&!i&&a&&(a.focus({preventScroll:!0}),this.#e.onMove?.(a,n,`sync`))}setActive(e,t={}){let{focus:n=!0,cause:r=`api`,silent:i=!1}=t,a=this.#n;this.#n=e;for(let t of this.#e.items())t.tabIndex=t===e?0:-1;e&&(n&&e.focus({preventScroll:!0}),i||this.#e.onMove?.(e,a,r))}#a=e=>{let t=e.target;t instanceof HTMLElement&&t!==this.#n&&this.#e.items().includes(t)&&this.setActive(t,{focus:!1,cause:`pointer`})};#o=e=>{let{ignoreWithin:t,textFor:n}=this.#e,r=e.target;if(t&&r instanceof Element&&r.closest(t))return;if(n&&e.key.length===1&&e.key!==` `&&!e.ctrlKey&&!e.metaKey&&!e.altKey){this.#s(e,n);return}let i=this.#t;if(!i)return;let a=this.#e.items(),o={items:a,active:this.#n,index:this.#n?a.indexOf(this.#n):-1,rtl:getComputedStyle(i).direction===`rtl`},s=this.#e.keyToMove?this.#e.keyToMove(e,o):this.#c(e,o);s&&(e.preventDefault(),this.#l(s,o))};#s=(e,t)=>{this.#r=Wt(this.#r,e.key,performance.now());let n=Gt(this.#e.items().filter(this.#i).map(e=>({key:e,text:t(e)})),this.#r.query,this.#n);n&&(e.preventDefault(),this.setActive(n,{focus:!0,cause:`key`}))};#c=(e,t)=>{let{orientation:n}=this.#e;return n?Ut(e.key,{orientation:n,rtl:t.rtl}):null};#l(e,t){if(e.type===`handled`)return;let n=t.items.filter(this.#i);if(!n.length)return;if(e.type===`to`){this.setActive(e.item,{focus:!0,cause:`key`});return}if(e.type===`first`){this.setActive(n[0],{focus:!0,cause:`key`});return}if(e.type===`last`){this.setActive(n[n.length-1],{focus:!0,cause:`key`});return}let r=t.active?n.indexOf(t.active):-1,i=Ht({index:r<0?0:r,total:n.length,delta:e.delta,loop:this.#e.loop??!1});this.setActive(n[i],{focus:!0,cause:`key`})}hostConnected(){}hostDisconnected(){this.detach()}},Jt=class extends X{static{this.properties={autoplay:{type:Number,reflect:!0},loop:{type:Boolean,reflect:!0}}}createRenderRoot(){return this}render(){return T}#e=!1;#t=null;#n=[];#r=[];#i=null;#a=[];#o=null;#s=[];#c=null;#l=!1;#u;#d=null;#f=null;#p=null;#m=!1;#h=!1;#g=!1;#_=null;constructor(){super(),this.autoplay=0,this.loop=!1,this.#u=new qt(this,{items:()=>this.#s,orientation:`both`,loop:!0,onMove:(e,t,n)=>{n===`key`&&e.click()}})}connectedCallback(){super.connectedCallback(),Z(this,()=>this.#v())}#v(){if(this.parentElement?.closest(`wc-carousel`)||this.#e)return!0;let e=this.#y();if(!e||(this.#t=e,this.#n=[...e.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(`slot`)),this.#n.length<2))return!1;!this.autoplay&&this.hasAttribute(`autoplay`)&&(this.autoplay=Number(this.getAttribute(`autoplay`))||0),!this.loop&&this.hasAttribute(`loop`)&&(this.loop=!0),this.#h=matchMedia(`(prefers-reduced-motion: reduce)`).matches;let t=Lt(e=>getComputedStyle(this).getPropertyValue(e)),n=Rt({loop:this.loop,autoplay:this.autoplay,paged:this.classList.contains(`carousel--auto-pages`),wantsButtons:this.classList.contains(`carousel--scroll-buttons`),wantsMarkers:this.classList.contains(`carousel--scroll-markers`),slides:this.#n.length,reducedMotion:this.#h},t);return this.#i=n,this.#b(e),n.clone&&this.#x(),n.buildButtons&&this.#A(),n.buildMarkers&&this.#j(),(n.trackScrolled||n.clone||this.#a.length||this.#s.length)&&(e.addEventListener(`scroll`,this.#D,{passive:!0}),e.addEventListener(`scrollsnapchange`,this.#O),e.addEventListener(`scrollend`,this.#O)),n.clone&&this.#E(),this.autoplay>0&&this.#N(n),this.#d=new ResizeObserver(this.#M),this.#d.observe(e),this.#M(),this.#e=!0,!0}#y(){let e=this.querySelector(`:scope > .carousel__track`);if(e)return e;if(!this.classList.contains(`carousel`)||!this.children.length)return null;let t=document.createElement(`div`);return t.className=`carousel__track`,t.append(...this.childNodes),this.append(t),t}#b(e){this.hasAttribute(`role`)||this.setAttribute(`role`,`group`),this.hasAttribute(`aria-roledescription`)||this.setAttribute(`aria-roledescription`,`carousel`),e.hasAttribute(`tabindex`)||(e.tabIndex=0)}disconnectedCallback(){super.disconnectedCallback();let e=this.#t;this.#d?.disconnect(),this.#d=null,e&&(e.removeEventListener(`scroll`,this.#D),e.removeEventListener(`scrollsnapchange`,this.#O),e.removeEventListener(`scrollend`,this.#O)),this.#p&&clearTimeout(this.#p),this.#p=null,this.#L(),this.removeEventListener(`pointerenter`,this.#R),this.removeEventListener(`pointerleave`,this.#z),this.removeEventListener(`focusin`,this.#R),this.removeEventListener(`focusout`,this.#z),this.#c&&(this.#c.removeEventListener(`click`,this.#B),this.#l&&this.#c.remove(),this.#c=null,this.#l=!1);for(let e of this.#a)e.remove();this.#a=[],this.#u.detach(),this.#o?.remove(),this.#o=null,this.#s=[];for(let e of this.#r)e.remove();this.#r=[],this.removeAttribute(`data-scrolled`),this.removeAttribute(`aria-live`),this.#n=[],this.#i=null,this.#e=!1,this.#_=null}#x(){let e=this.#n.map((e,t)=>this.#S(e,t)),t=this.#n.map((e,t)=>this.#S(e,t));for(let t=e.length-1;t>=0;t--)this.#t?.prepend(e[t]);for(let e of t)this.#t?.append(e);this.#r=[...e,...t]}#S(e,t){let n=e.cloneNode(!0);n.setAttribute(`data-carousel-clone`,String(t)),n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`inert`,``),n.removeAttribute(`id`);for(let e of n.querySelectorAll(`[id]`))e.removeAttribute(`id`);for(let e of n.querySelectorAll(`img`))for(let[t,n]of Object.entries(Vt))e.setAttribute(t,n);return n}#C(){return this.#t?[...this.#t.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(`slot`)):[]}#w(){let e=this.#t,t=this.#C();if(!e||!t.length)return 0;let n=e.getBoundingClientRect(),r=n.left+n.width/2,i=0,a=1/0;return t.forEach((e,t)=>{let n=e.getBoundingClientRect(),o=Math.abs(n.left+n.width/2-r);o<a&&(a=o,i=t)}),i}#T(e){let t=this.#C();if(!t.length)return;let n=this.#w()+e;t[Math.max(0,Math.min(t.length-1,n))]?.scrollIntoView({inline:`center`,block:`nearest`,behavior:`smooth`})}#E(){requestAnimationFrame(()=>{let e=this.#n[0];e&&(this.#g=!0,e.scrollIntoView({inline:`center`,block:`nearest`,behavior:`instant`}),requestAnimationFrame(()=>{this.#g=!1,this.#k()}))})}#D=()=>{this.#i?.trackScrolled&&!this.hasAttribute(`data-scrolled`)&&zt(this.#t?.scrollLeft??0)&&this.setAttribute(`data-scrolled`,``),this.#k(),this.#p&&clearTimeout(this.#p),this.#p=setTimeout(this.#O,150)};#O=()=>{this.#p&&clearTimeout(this.#p),this.#p=null,this.#k();let e=this.#t;if(!e||!this.#i?.clone||this.#g)return;let t=this.#C()[this.#w()],n=t?.getAttribute(`data-carousel-clone`);if(!t||n==null)return;let r=this.#n[Number(n)];if(!r)return;let i=r.getBoundingClientRect().left-t.getBoundingClientRect().left;if(!i)return;this.#g=!0;let a=e.style.scrollBehavior;e.style.scrollBehavior=`auto`,e.scrollLeft+=i,requestAnimationFrame(()=>{e.style.scrollBehavior=a,this.#g=!1,this.#k()})};#k(){let e=this.#C();if(!e.length)return;let t=this.#w(),n=this.#i?.clone?t%this.#n.length:t;this.#s.forEach((e,t)=>e.setAttribute(`aria-selected`,String(t===n)));let r=this.#s[n];if(r&&this.#u.setActive(r,{focus:!1,silent:!0}),this.#a.length&&!this.#i?.clone){let[n,r]=this.#a;n&&(n.disabled=t<=0),r&&(r.disabled=t>=e.length-1)}n!==this.#_&&(this.#_=n,this.dispatchEvent(new CustomEvent(`carousel-change`,{bubbles:!0,composed:!0,detail:{index:n,total:this.#n.length}})))}#A(){let e=(e,t,n,r)=>{let i=document.createElement(`button`);return i.type=`button`,i.className=`carousel__button carousel__button--${e}`,i.setAttribute(`aria-label`,t),i.textContent=n,i.addEventListener(`click`,()=>this.#T(r)),i},t=getComputedStyle(this).direction===`rtl`;this.#a=[e(`prev`,`Previous`,t?`›`:`‹`,-1),e(`next`,`Next`,t?`‹`:`›`,1)],this.append(...this.#a)}#j(){let e=document.createElement(`div`);e.className=`carousel__markers`,e.setAttribute(`role`,`tablist`),e.setAttribute(`aria-label`,this.getAttribute(`aria-label`)??`Slides`),this.#s=this.#n.map((e,t)=>{let n=document.createElement(`button`);return n.type=`button`,n.className=`carousel__marker`,n.setAttribute(`role`,`tab`),n.setAttribute(`aria-label`,Bt(t,this.#n.length)),n.setAttribute(`aria-selected`,String(t===0)),e.id&&n.setAttribute(`aria-controls`,e.id),n.addEventListener(`click`,()=>{e.scrollIntoView({inline:`center`,block:`nearest`,behavior:`smooth`})}),n}),e.append(...this.#s),this.append(e),this.#o=e,this.#u.attach(e)}#M=()=>{let e=this.#t;if(!e)return;let t=this.querySelector(`:scope > .carousel__hint`);t&&(t.hidden=e.scrollWidth<=e.clientWidth+1)};#N(e){this.#P(),e.play?this.#I():(this.#m=!0,this.setAttribute(`aria-live`,`polite`),this.#F()),this.addEventListener(`pointerenter`,this.#R),this.addEventListener(`pointerleave`,this.#z),this.addEventListener(`focusin`,this.#R),this.addEventListener(`focusout`,this.#z)}#P(){let e=this.querySelector(`[slot="autoplay"]`);if(e)this.#c=e,this.#l=!1;else{let e=document.createElement(`button`);e.type=`button`,e.className=`carousel__autoplay`,this.append(e),this.#c=e,this.#l=!0}this.#c.addEventListener(`click`,this.#B),this.#F()}#F(){let e=this.#c;e&&(e.setAttribute(`aria-label`,this.#m?`Play`:`Pause`),e.setAttribute(`aria-pressed`,String(!this.#m)),this.#l&&(e.textContent=this.#m?`▶`:`⏸`))}#I(){this.#f||this.autoplay<=0||(this.#m=!1,this.#f=setInterval(()=>this.#T(1),this.autoplay),this.setAttribute(`aria-live`,`off`),this.#F())}#L(){this.#f&&clearInterval(this.#f),this.#f=null}#R=()=>{!this.#f&&this.#m||(this.#L(),this.#m=!0,this.setAttribute(`aria-live`,`polite`),this.#F())};#z=()=>{this.#h||this.#I()};#B=()=>{this.#m?(this.#h=!1,this.#I()):this.#R()}};customElements.get(`wc-carousel`)||customElements.define(`wc-carousel`,Jt);var Yt=class extends X{static{this.properties={breakpoint:{type:String,reflect:!0},projection:{type:Boolean,reflect:!0},singular:{type:Boolean,reflect:!0}}}createRenderRoot(){return this}#e=[];#t=[];#n=[];#r=null;#i=null;#a=null;#o=[];#s=[];#c=0;#l=!1;#u=null;#d=0;init(){this.breakpoint=`40rem`,this.projection=!1,this.singular=!1}constructor(){super(),this.init()}connectedCallback(){super.connectedCallback(),Z(this,()=>this.#f())}#f(){return this.#r?!0:(this.#p(),this.#e.length===0?!1:(this.#h(),this.projection&&(this.#m(),this.#g(),this.#_(),this.singular&&(this.classList.add(`entries--singular`),this.#y(0))),this.#d=this.#x(),this.#S(),!0))}disconnectedCallback(){super.disconnectedCallback(),this.#u?.disconnect(),this.#u=null,this.#a?.remove(),this.#a=null,this.#o=[],this.#i?this.#i.remove():this.#r?.remove(),this.#r=null,this.#i=null,this.#s=[],this.classList.remove(`entries--wide`,`entries--projection`,`entries--singular`)}#p(){this.#e=[];let e=new Set,t=new Map,n=null;for(let r of this.children){let i=r.tagName.toLowerCase();if(/^h[1-6]$/.test(i))n=r;else if(i===`dl`&&n){let i=new Map,a=r.querySelectorAll(`dt`),o=r.querySelectorAll(`dd`);for(let n=0;n<a.length;n++){let r=a[n],s=r.textContent?.trim()??``,c=o[n]?.innerHTML??``;if(s){i.set(s,c),e.add(s);let n=r.getAttribute(`data-label`);n&&!t.has(s)&&t.set(s,n)}}this.#e.push({title:n.innerHTML,heading:n,dl:r,properties:i}),n=null}}this.#t=[...e],this.#n=this.#t.map(e=>t.get(e)??e)}#m(){this.classList.add(`entries--projection`)}#h(){let e=document.createElement(`table`);e.classList.add(`entries__table`),e.setAttribute(`aria-hidden`,`true`);let t=document.createElement(`thead`),n=document.createElement(`tr`),r=document.createElement(`th`);r.textContent=``,n.appendChild(r),this.#s=[];for(let e of this.#t){let t=document.createElement(`th`);t.textContent=e,n.appendChild(t),this.#s.push(t)}t.appendChild(n),e.appendChild(t);let i=document.createElement(`tbody`);for(let e of this.#e){let t=document.createElement(`tr`),n=document.createElement(`td`);n.innerHTML=e.title,n.style.fontWeight=`600`,t.appendChild(n);for(let n of this.#t){let r=document.createElement(`td`);r.innerHTML=e.properties.get(n)??``,t.appendChild(r)}i.appendChild(t)}e.appendChild(i),this.appendChild(e),this.#r=e}#g(){if(!this.#r)return;let e=document.createElement(`div`);e.classList.add(`entries__scroll`),this.#r.replaceWith(e),e.appendChild(this.#r),this.#i=e}#_(){let e=document.createElement(`nav`);e.classList.add(`entries__nav`),e.setAttribute(`aria-label`,`Column selector`),e.setAttribute(`aria-hidden`,`true`),this.#o=this.#t.map((t,n)=>{let r=document.createElement(`button`);return r.type=`button`,r.classList.add(`entries__nav-btn`),r.textContent=this.#n[n]??t,r.setAttribute(`aria-pressed`,String(n===0)),r.addEventListener(`click`,()=>this.#v(n)),e.appendChild(r),r}),this.#i.before(e),this.#a=e}#v(e){this.#c=e;for(let t=0;t<this.#o.length;t++)this.#o[t]?.setAttribute(`aria-pressed`,String(t===e));if(this.singular)this.#y(e);else{let t=this.#s[e];t&&this.#i&&t.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`start`})}this.dispatchEvent(new CustomEvent(`entries-column-change`,{detail:{column:e,header:this.#t[e]},bubbles:!0,composed:!0}))}#y(e){if(!this.#r)return;let t=e+1;for(let e of this.#r.rows)for(let n=1;n<e.cells.length;n++){let r=e.cells[n];r&&(r.hidden=n!==t)}}#b(){if(this.#r)for(let e of this.#r.rows)for(let t=1;t<e.cells.length;t++){let n=e.cells[t];n&&(n.hidden=!1)}}#x(){let e=this.breakpoint||`40rem`,t=document.createElement(`div`);t.style.width=e,t.style.position=`absolute`,t.style.visibility=`hidden`,this.appendChild(t);let n=t.offsetWidth;return t.remove(),n}#S(){this.#u=new ResizeObserver(this.#C),this.#u.observe(this)}#C=e=>{let t=e[0];if(!t)return;let n=t.contentBoxSize?.[0]?.inlineSize??t.contentRect.width;this.#l=n>=this.#d,this.#l?(this.classList.add(`entries--wide`),this.singular&&this.projection&&this.#b()):(this.classList.remove(`entries--wide`),this.singular&&this.projection&&this.#y(this.#c))}};customElements.get(`wc-entries`)||customElements.define(`wc-entries`,Yt);const Xt=`vitops:consent`;var Zt=class e extends X{static{this.styles=[X.styles,o`
49
+ :host{display:none}:host(:defined){display:inline-flex}.toggle__group{display:inline-flex;border-radius:var(--color-scheme-toggle-radius,.5rem);overflow:hidden;border:var(--color-scheme-toggle-border,1px solid oklch(.5 0 0/.2))}.toggle__segment{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:var(--color-scheme-toggle-padding,.5rem .75rem);border:none;background:var(--color-scheme-toggle-bg,oklch(.95 0 0));color:var(--color-scheme-toggle-color,oklch(.3 0 0));font-size:var(--color-scheme-toggle-font-size,.875rem);font-family:inherit;cursor:pointer;transition:background-color .15s ease,color .15s ease}.toggle__segment:not(:last-child){border-inline-end:1px solid oklch(.5 0 0/.15)}.toggle__segment:hover{background:var(--color-scheme-toggle-hover-bg,oklch(.9 0 0))}.toggle__segment[aria-pressed=true]{background:var(--color-scheme-toggle-active-bg,oklch(.25 .02 260));color:var(--color-scheme-toggle-active-color,oklch(.95 0 0))}.toggle__segment:focus-visible{outline:2px solid var(--color-scheme-toggle-focus-color,oklch(.6 .2 250));outline-offset:2px;z-index:1;position:relative}.toggle__icon{inline-size:1em;block-size:1em;flex-shrink:0}.toggle__icon--light{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20viewBox%3D%220%200%2024%2024%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%225%22%2F%3E%3Cpath%20d%3D%22M12%201v2M12%2021v2M4.22%204.22l1.42%201.42M18.36%2018.36l1.42%201.42M1%2012h2M21%2012h2M4.22%2019.78l1.42-1.42M18.36%205.64l1.42-1.42%22%2F%3E%3C%2Fsvg%3E")}.toggle__icon--dark,.toggle__icon--light{background:currentColor;mask-size:contain;mask-repeat:no-repeat}.toggle__icon--dark{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M21%2012.79A9%209%200%201%201%2011.21%203%207%207%200%200%200%2021%2012.79%22%2F%3E%3C%2Fsvg%3E")}.toggle__icon--system{background:currentColor;mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20viewBox%3D%220%200%2024%2024%22%3E%3Crect%20width%3D%2220%22%20height%3D%2214%22%20x%3D%222%22%20y%3D%223%22%20rx%3D%222%22%20ry%3D%222%22%2F%3E%3Cpath%20d%3D%22M8%2021h8M12%2017v4%22%2F%3E%3C%2Fsvg%3E");mask-size:contain;mask-repeat:no-repeat}.toggle__label{display:none}@container (min-width: 400px){.toggle__label{display:inline}}@media (prefers-reduced-motion:reduce){.toggle__segment{transition:none}}`]}static{this.properties={scheme:{type:String,reflect:!0}}}constructor(){super(),this._mediaQuery=null,this._boundMediaHandler=null,this._onConsent=()=>{window.vitopsConsent?.granted(`preferences`)&&this._write()},this.init()}init(){this.scheme=e.readStored()??`system`}static{this.STORAGE_KEY=`vitops-color-scheme`}static readStored(){try{let t=localStorage.getItem(e.STORAGE_KEY);return t===`light`||t===`dark`||t===`system`?t:null}catch{return null}}_persist(){let e=window.vitopsConsent;(!e||e.require(`preferences`))&&this._write()}_write(){try{this.scheme===`system`?localStorage.removeItem(e.STORAGE_KEY):localStorage.setItem(e.STORAGE_KEY,this.scheme)}catch{}}connectedCallback(){super.connectedCallback(),this._mediaQuery=window.matchMedia(`(prefers-color-scheme: dark)`),this._boundMediaHandler=this._handleMediaChange.bind(this),this._mediaQuery.addEventListener(`change`,this._boundMediaHandler),document.addEventListener(Xt,this._onConsent),this._applyColorScheme()}disconnectedCallback(){super.disconnectedCallback(),this._mediaQuery&&this._boundMediaHandler&&this._mediaQuery.removeEventListener(`change`,this._boundMediaHandler),document.removeEventListener(Xt,this._onConsent)}_handleMediaChange(e){this.scheme===`system`&&this.requestUpdate()}_applyColorScheme(){let e=document.documentElement;this.scheme===`system`?(e.style.removeProperty(`color-scheme`),delete e.dataset.theme):(e.style.colorScheme=`${this.scheme} only`,e.dataset.theme=this.scheme)}_handleSegmentClick(e){this.scheme!==e&&(this.scheme=e,this._applyColorScheme(),this._persist(),this.dispatchEvent(new CustomEvent(`scheme-change`,{detail:{scheme:this.scheme},bubbles:!0,composed:!0})))}updated(e){e.has(`scheme`)&&this._applyColorScheme()}render(){return Y` <div class="toggle__group" role="group" aria-label="Color scheme" part="group"> <button class="toggle__segment" part="system" type="button" aria-pressed="${this.scheme===`system`}" @click="${()=>this._handleSegmentClick(`system`)}"> <span class="toggle__icon toggle__icon--system" aria-hidden="true"></span> <span class="toggle__label">System</span> </button> <button class="toggle__segment" part="light" type="button" aria-pressed="${this.scheme===`light`}" @click="${()=>this._handleSegmentClick(`light`)}"> <span class="toggle__icon toggle__icon--light" aria-hidden="true"></span> <span class="toggle__label">Light</span> </button> <button class="toggle__segment" part="dark" type="button" aria-pressed="${this.scheme===`dark`}" @click="${()=>this._handleSegmentClick(`dark`)}"> <span class="toggle__icon toggle__icon--dark" aria-hidden="true"></span> <span class="toggle__label">Dark</span> </button> </div> `}};customElements.get(`wc-color-scheme-toggle`)||customElements.define(`wc-color-scheme-toggle`,Zt);var Qt=class extends X{static{this.styles=[X.styles,o`
50
+ :host{--_gap:var(--multi-field-gap, 0.5rem);--_input-padding:var(--multi-field-input-padding, 0.5rem 0.75rem);--_radius:var(--multi-field-border-radius, 0.375rem);--_border-color:var(--multi-field-border-color, oklch(0.8 0 0));--_focus-color:var(--multi-field-focus-color, oklch(0.6 0.2 250));--_button-bg:var(--multi-field-button-bg, oklch(0.95 0 0));--_button-hover-bg:var(--multi-field-button-hover-bg, oklch(0.9 0 0));--_delete-color:var(--multi-field-delete-color, oklch(0.6 0.2 25));--_delete-hover-bg:var(--multi-field-delete-hover-bg, oklch(0.95 0.05 25));display:block}.container,.entries{flex-direction:column}.container,.entries,.entry{display:flex;gap:var(--_gap)}.entry{align-items:center}.entry__input{flex:1;padding:var(--_input-padding);border:1px solid var(--_border-color);border-radius:var(--_radius);font:inherit;background:transparent}.entry__input:focus-visible{outline:2px solid var(--_focus-color);outline-offset:2px}.entry__input:disabled{opacity:.6;cursor:not-allowed}.entry__delete{display:inline-flex;align-items:center;justify-content:center;min-inline-size:2rem;min-block-size:2rem;padding:.25rem;background:transparent;border:1px solid transparent;border-radius:var(--_radius);color:var(--_delete-color);cursor:pointer;transition:background-color .15s ease}.entry__delete:hover:not(:disabled){background:var(--_delete-hover-bg)}.entry__delete:focus-visible{outline:2px solid var(--_focus-color);outline-offset:2px}.entry__delete:disabled{opacity:.3;cursor:not-allowed}.entry__delete-icon{inline-size:1rem;block-size:1rem;background-color:currentColor;mask-size:contain;mask-repeat:no-repeat;mask-position:center;mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20448%20512%22%3E%3Cpath%20d%3D%22M135.2%2017.7%20128%2032H32C14.3%2032%200%2046.3%200%2064s14.3%2032%2032%2032h384c17.7%200%2032-14.3%2032-32s-14.3-32-32-32h-96l-7.2-14.3C307.4%206.8%20296.3%200%20284.2%200H163.8c-12.1%200-23.2%206.8-28.6%2017.7M416%20128H32l21.2%20339c1.6%2025.3%2022.6%2045%2047.9%2045h245.8c25.3%200%2046.3-19.7%2047.9-45z%22%2F%3E%3C%2Fsvg%3E")}.actions{display:flex;gap:var(--_gap);flex-wrap:wrap}.action-button{display:inline-flex;align-items:center;gap:.375rem;padding:.5rem .75rem;background:var(--_button-bg);border:1px solid var(--_border-color);border-radius:var(--_radius);font:inherit;font-size:.875em;cursor:pointer;transition:background-color .15s ease}.action-button:hover:not(:disabled){background:var(--_button-hover-bg)}.action-button:focus-visible{outline:2px solid var(--_focus-color);outline-offset:2px}.action-button:disabled{opacity:.5;cursor:not-allowed}.action-button__icon{inline-size:.875rem;block-size:.875rem;background-color:currentColor;mask-size:contain;mask-repeat:no-repeat;mask-position:center}.action-button__icon--add{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20448%20512%22%3E%3Cpath%20d%3D%22M256%2080c0-17.7-14.3-32-32-32s-32%2014.3-32%2032v144H48c-17.7%200-32%2014.3-32%2032s14.3%2032%2032%2032h144v144c0%2017.7%2014.3%2032%2032%2032s32-14.3%2032-32V288h144c17.7%200%2032-14.3%2032-32s-14.3-32-32-32H256z%22%2F%3E%3C%2Fsvg%3E")}.action-button__icon--clear{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20576%20512%22%3E%3Cpath%20d%3D%22M290.7%2057.4%2057.4%20290.7c-25%2025-25%2065.5%200%2090.5l80%2080c12%2012%2028.3%2018.7%2045.3%2018.7H512c17.7%200%2032-14.3%2032-32s-14.3-32-32-32H387.9l130.7-130.6c25-25%2025-65.5%200-90.5L381.3%2057.4c-25-25-65.5-25-90.5%200zm6.7%20358.6H182.6l-80-80%20124.7-124.7%20137.4%20137.4z%22%2F%3E%3C%2Fsvg%3E")}.initial-slot{display:none}@media (prefers-reduced-motion:reduce){.action-button,.entry__delete{transition:none}}`]}static{this.properties={name:{type:String},type:{type:String},placeholder:{type:String},protectDefaults:{type:Boolean,attribute:`protect-defaults`},min:{type:Number},max:{type:Number},addLabel:{type:String,attribute:`add-label`},clearLabel:{type:String,attribute:`clear-label`},deleteLabel:{type:String,attribute:`delete-label`},_entries:{type:Array,state:!0},_initialized:{type:Boolean,state:!0}}}constructor(){super(),this._handleAdd=()=>{if(this.max>0&&this._entries.length>=this.max)return;let e={id:this._generateId(),value:``,isDefault:!1};this._entries=[...this._entries,e],this.dispatchEvent(new CustomEvent(`multi-field-add`,{bubbles:!0,composed:!0})),this._dispatchChange(),this.updateComplete.then(()=>{let e=this.renderRoot.querySelectorAll(`.entry__input`);e[e.length-1]?.focus()})},this._handleClear=()=>{let e;for(e=this.protectDefaults?this._entries.filter(e=>e.isDefault):[];e.length<this.min;)e.push({id:this._generateId(),value:``,isDefault:!1});this._entries=e,this.dispatchEvent(new CustomEvent(`multi-field-clear`,{bubbles:!0,composed:!0})),this._dispatchChange()},this.init()}init(){this.name=void 0,this.type=`text`,this.placeholder=``,this.protectDefaults=!1,this.min=1,this.max=0,this.addLabel=`Add`,this.clearLabel=`Clear`,this.deleteLabel=`Delete`,this._entries=[],this._initialized=!1,this._idCounter=0}_generateId(){return`entry-${++this._idCounter}`}_initializeFromSlot(){if(this._initialized)return;let e=this.getSlottedNodes([`input`]),t=[];for(let n of e){let e=n,r=e.value||e.getAttribute(`value`)||``;t.push({id:this._generateId(),value:r,isDefault:!0})}for(;t.length<this.min;)t.push({id:this._generateId(),value:``,isDefault:!1});t.length===0&&t.push({id:this._generateId(),value:``,isDefault:!1}),this._entries=t,this._initialized=!0}firstUpdated(){this._initializeFromSlot()}willUpdate(e){if(e.has(`min`)&&this._initialized)for(;this._entries.length<this.min;)this._entries=[...this._entries,{id:this._generateId(),value:``,isDefault:!1}]}_getValues(){return this._entries.map(e=>e.value)}_dispatchChange(){this.dispatchEvent(new CustomEvent(`multi-field-change`,{detail:{values:this._getValues()},bubbles:!0,composed:!0}))}_handleInput(e,t){let n=t.target;this._entries=this._entries.map(t=>t.id===e?{...t,value:n.value}:t),this._dispatchChange()}_handleDelete(e){let t=this._entries.find(t=>t.id===e);if(!t||this.protectDefaults&&t.isDefault||this._entries.length<=this.min)return;let n=t.value;this._entries=this._entries.filter(t=>t.id!==e),this.dispatchEvent(new CustomEvent(`multi-field-delete`,{detail:{value:n},bubbles:!0,composed:!0})),this._dispatchChange()}_canDelete(e){return!(this._entries.length<=this.min||this.protectDefaults&&e.isDefault)}_canAdd(){return!(this.max>0&&this._entries.length>=this.max)}_canClear(){return this.protectDefaults?this._entries.some(e=>!e.isDefault):this._entries.length>this.min}render(){return Y` <div class="container" part="container"> <div class="initial-slot"> <slot @slotchange="${this._initializeFromSlot}"></slot> </div> <div class="entries" part="entries" role="list"> ${this._entries.map(e=>Y` <div class="entry" part="entry" role="listitem"> <input class="entry__input" part="input" type="${this.type}" name="${this.name?`${this.name}[]`:``}" placeholder="${this.placeholder}" .value="${e.value}" @input="${t=>this._handleInput(e.id,t)}" ?data-default="${e.isDefault}"> <button type="button" class="entry__delete" part="delete-button" aria-label="${this.deleteLabel}" ?disabled="${!this._canDelete(e)}" @click="${()=>this._handleDelete(e.id)}"> <span class="entry__delete-icon" aria-hidden="true"></span> </button> </div> `)} </div> <div class="actions" part="actions"> <button type="button" class="action-button" part="add-button" ?disabled="${!this._canAdd()}" @click="${this._handleAdd}"> <span class="action-button__icon action-button__icon--add" aria-hidden="true"></span> <slot name="add-label">${this.addLabel}</slot> </button> <button type="button" class="action-button" part="clear-button" ?disabled="${!this._canClear()}" @click="${this._handleClear}"> <span class="action-button__icon action-button__icon--clear" aria-hidden="true"></span> <slot name="clear-label">${this.clearLabel}</slot> </button> </div> </div> `}};customElements.get(`wc-multi-field`)||customElements.define(`wc-multi-field`,Qt);var $t=class extends X{createRenderRoot(){return this}#e=null;#t;connectedCallback(){super.connectedCallback(),Z(this,()=>this.#n())}#n(){if(this.#e)return!0;let e=this.querySelector(`.marquee__content`);return e?(this.#e=e,this.style.setProperty(`--_marquee-min`,`auto`),this.#r(),this.#t=new ResizeObserver(()=>this.#r()),this.#t.observe(this),!0):!1}disconnectedCallback(){this.#t?.disconnect(),super.disconnectedCallback()}#r(){let e=this.#e;if(!e)return;for(let e of this.querySelectorAll(`[data-marquee-clone]`))e.remove();let t=Number.parseFloat(getComputedStyle(this).columnGap)||0,n=e.getBoundingClientRect().width;if(n<=0)return;this.style.setProperty(`--_marquee-distance`,`${n+t}px`);let r=Math.ceil(this.getBoundingClientRect().width/(n+t))+1;for(let t=0;t<r;t++){let t=e.cloneNode(!0);t.dataset.marqueeClone=``,t.setAttribute(`aria-hidden`,`true`),this.append(t)}}};customElements.get(`wc-marquee`)||customElements.define(`wc-marquee`,$t);function en(e,t){let n=t.trim().toLowerCase();if(!n)return{keep:new Set,hits:0};let r=new Map,i=new Map;for(let t of e){r.set(t.key,t);let e=i.get(t.parent);e?e.push(t):i.set(t.parent,[t])}let a=new Set,o=0,s=e=>{for(let t of i.get(e)??[])a.has(t.key)||(a.add(t.key),s(t.key))};for(let t of e){if(!t.own.includes(n))continue;o++,a.add(t.key),s(t.key);let e=new Set([t.key]),i=r.get(t.parent);for(;i&&!e.has(i.key);)a.add(i.key),e.add(i.key),i=r.get(i.parent)}return{keep:a,hits:o}}function tn(e){let t=new Map;for(let n of e)t.set(n.key,n);return e.filter(e=>{if(e.hidden)return!1;let n=new Set([e.key]),r=e.parent===null||e.parent===void 0?void 0:t.get(e.parent);for(;r;){if(r.hidden||r.expanded===!1)return!1;if(n.has(r.key))break;n.add(r.key),r=r.parent===null||r.parent===void 0?void 0:t.get(r.parent)}return!0})}function nn(e,t,n){let r=tn(e);if(!r.length)return null;let i=r.findIndex(e=>e.key===t),a=i>=0?r[i]:void 0;switch(n){case`first`:return{type:`to`,key:r[0].key};case`last`:return{type:`to`,key:r[r.length-1].key};case`next`:return i<0?{type:`to`,key:r[0].key}:i<r.length-1?{type:`to`,key:r[i+1].key}:null;case`prev`:return i<0?{type:`to`,key:r[0].key}:i>0?{type:`to`,key:r[i-1].key}:null;case`in`:{if(!a||a.expanded===null)return null;if(a.expanded===!1)return{type:`expand`,key:a.key};let e=r[i+1];return e&&e.parent===a.key?{type:`to`,key:e.key}:null}case`out`:return a?a.expanded===!0?{type:`collapse`,key:a.key}:a.parent===null||a.parent===void 0?null:{type:`to`,key:a.parent}:null}}function rn(e,t){let n=e.find(e=>e.key===t);return n?e.filter(e=>e.parent===n.parent&&e.expanded!==null).map(e=>e.key):[]}function an(e,t,n){let r=e;typeof r.moveBefore==`function`?r.moveBefore(t,n):e.insertBefore(t,n)}function Q(e,t,n){for(;e.firstChild;)an(t,e.firstChild,n)}var on=class extends X{static{this.properties={label:{type:String,reflect:!0},nofilter:{type:Boolean,reflect:!0}}}createRenderRoot(){return this}render(){return T}#e=null;#t=[];#n=[];#r=null;#i=null;#a=null;#o=new WeakMap;#s=!1;#c;constructor(){super(),this.label=`Filter`,this.nofilter=!1,this.#c=new qt(this,{items:()=>this.#t.map(e=>e.key),keyToMove:this.#w,textFor:e=>this.#t.find(t=>t.key===e)?.label??``,ignoreWithin:`a, button, input, select, textarea, [contenteditable]`,onMove:(e,t,n)=>{n===`key`&&this.#e?.setAttribute(`data-tree-keyboard`,``),e.querySelector(`:scope > .tree__summary, :scope > .tree__content`)?.scrollIntoView({block:`nearest`})}})}connectedCallback(){super.connectedCallback(),Z(this,()=>this.#l())}#l(){if(this.#e)return!0;if(!this.isConnected)return!1;if(this.parentElement?.closest(`wc-tree`))return!0;let e=this.querySelector(`.tree`);return!e||!e.querySelector(`.tree__item`)?!1:(this.#u(e),this.#e=e,this.#p(),this.#b(),this.#c.attach(e),e.addEventListener(`click`,this.#S),e.addEventListener(`beforematch`,this.#k),e.addEventListener(`pointerdown`,this.#C),window.addEventListener(`hashchange`,this.#D),requestAnimationFrame(()=>this.#O()),!0)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`hashchange`,this.#D),this.#e?.removeEventListener(`click`,this.#S),this.#e?.removeEventListener(`beforematch`,this.#k),this.#e?.removeEventListener(`pointerdown`,this.#C),this.#c.detach(),this.#r?.remove(),this.#r=null,this.#i=null,this.#a=null,this.#t=[],this.#n=[],this.#e=null}#u(e){for(let t of e.querySelectorAll(`details`))try{t.classList.contains(`tree__item`)?this.#f(t):t.parentElement&&this.#d(t.parentElement,t)}catch{}for(let t of e.querySelectorAll(`.tree__item`))t.setAttribute(`role`,`treeitem`);for(let t of e.querySelectorAll(`.tree`))t.setAttribute(`role`,`group`);e.setAttribute(`role`,`tree`),!e.hasAttribute(`aria-label`)&&!e.hasAttribute(`aria-labelledby`)&&e.setAttribute(`aria-label`,this.label)}#d(e,t){let n=t.open,r=t.querySelector(`:scope > summary`),i=document.createElement(`span`);i.className=`tree__summary`,e.insertBefore(i,t),r&&(Q(r,i,null),r.remove()),Q(t,e,t),t.remove(),this.#v(e,n)}#f(e){let t=e.open,n=e.parentElement;if(!n)return;let r=n.tagName===`UL`||n.tagName===`OL`?`li`:`div`,i=document.createElement(r);i.id=e.id,i.className=e.className,n.insertBefore(i,e);let a=e.querySelector(`:scope > summary`),o=document.createElement(`span`);o.className=`tree__summary`,i.appendChild(o),a&&(Q(a,o,null),a.remove()),Q(e,i,null),e.remove(),this.#v(i,t)}#p(){let e=this.#e?.querySelectorAll(`.tree__item`)??[];this.#t=[...e].map(e=>({key:e,parent:e.parentElement?.closest(`.tree__item`)??null,own:this.#h(e),label:this.#m(e)})),this.#n=this.#t.filter(e=>this.#g(e.key)!==null)}#m(e){return(e.querySelector(`:scope > .tree__summary, :scope > .tree__content`)?.textContent??``).trim().toLowerCase()}#h(e){let t=[],n=e.querySelector(`:scope > .tree__summary, :scope > .tree__content`);n?.textContent&&t.push(n.textContent);let r=e.querySelector(`:scope > .tree__desc, :scope > p`);return r?.textContent&&t.push(r.textContent),t.join(` `).toLowerCase()}#g(e){return e.querySelector(`:scope > .tree`)}#_(){return this.#t.map(e=>({...e,hidden:e.key.hidden===!0,expanded:this.#g(e.key)?e.key.getAttribute(`aria-expanded`)===`true`:null}))}#v(e,t){let n=this.#g(e);n&&(e.setAttribute(`aria-expanded`,String(t)),t?n.removeAttribute(`hidden`):n.setAttribute(`hidden`,`until-found`))}#y(e,t){e.hidden=t}#b(){let e=document.createElement(`div`);if(e.className=`tree__toolbar cluster`,!this.nofilter){let t=document.createElement(`input`);t.type=`search`,t.className=`tree__filter`,t.placeholder=this.label,t.setAttribute(`aria-label`,this.label),t.addEventListener(`input`,()=>this.filter(t.value));let n=document.createElement(`div`);n.className=`input-group tree__filter-group`,n.appendChild(t),e.appendChild(n),this.#i=t}for(let[t,n]of[[`Expand all`,!0],[`Collapse all`,!1]]){let r=document.createElement(`button`);r.type=`button`,r.className=`btn`,r.textContent=t,r.addEventListener(`click`,()=>this.toggleAll(n)),e.appendChild(r)}let t=document.createElement(`span`);t.className=`tree__count font-footnote`,t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),e.appendChild(t),this.#a=t,this.#e?.before(e),this.#r=e}toggleAll(e){for(let t of this.#n)this.#v(t.key,e);this.#c.sync()}filter(e){let t=e.trim().toLowerCase();if(!t){for(let{key:e}of this.#t)this.#y(e,!1);if(this.#s){for(let e of this.#n)this.#v(e.key,this.#o.get(e.key)??!1);this.#s=!1}this.#x(``),this.#c.sync();return}if(!this.#s){for(let e of this.#n)this.#o.set(e.key,e.key.getAttribute(`aria-expanded`)===`true`);this.#s=!0}let{keep:n,hits:r}=en(this.#t,t);for(let{key:e}of this.#t)this.#y(e,!n.has(e));for(let e of n){let t=e;this.#g(t)&&this.#v(t,!0)}this.#x(r===1?`1 match`:`${r} matches`),this.#c.sync(),this.dispatchEvent(new CustomEvent(`tree-filter`,{detail:{query:t,matches:r},bubbles:!0}))}#x(e){this.#a&&(this.#a.textContent=e)}#S=e=>{let t=e.target;if(!t||t.closest(`.tree__actions`))return;let n=t.closest(`.tree__summary`);if(!n)return;let r=n.parentElement;!(r instanceof HTMLElement)||!r.classList.contains(`tree__item`)||this.#g(r)&&(this.#v(r,r.getAttribute(`aria-expanded`)!==`true`),this.#c.sync())};#C=()=>{this.#e?.removeAttribute(`data-tree-keyboard`)};#w=(e,t)=>{let n=t.active;if(!n)return null;let r=this.#T(e.key,t.rtl);if(r)return this.#E(n,r);if(e.key===`Enter`||e.key===` `)return this.#g(n)?(this.#v(n,n.getAttribute(`aria-expanded`)!==`true`),this.#c.sync()):n.querySelector(`:scope > .tree__summary a, :scope > .tree__content a`)?.click(),{type:`handled`};if(e.key===`*`){for(let e of rn(this.#_(),n))this.#v(e,!0);return this.#c.sync(),{type:`handled`}}return null};#T(e,t){switch(e){case`ArrowDown`:return`next`;case`ArrowUp`:return`prev`;case`ArrowRight`:return t?`out`:`in`;case`ArrowLeft`:return t?`in`:`out`;case`Home`:return`first`;case`End`:return`last`;default:return null}}#E(e,t){let n=nn(this.#_(),e,t);return n?n.type===`to`?{type:`to`,item:n.key}:(this.#v(n.key,n.type===`expand`),this.#c.sync(),{type:`handled`}):null}#D=()=>this.#O();#O(){let e=decodeURIComponent(location.hash.slice(1));if(!e)return;let t=this.#e?.ownerDocument.getElementById(e);if(!(!t||!this.contains(t))){this.#g(t)&&this.#v(t,!0);for(let e=t.parentElement;e&&(e.classList.contains(`tree__item`)&&this.#v(e,!0),e!==this);e=e.parentElement);this.#i?.value&&this.filter(this.#i.value=``),this.#c.setActive(t,{focus:!1,cause:`api`}),(t.querySelector(`:scope > .tree__summary, :scope > .tree__content`)??t).scrollIntoView({block:`start`,behavior:`smooth`})}}#k=e=>{let t=e.target;if(!(t instanceof HTMLElement))return;let n=t.parentElement;n instanceof HTMLElement&&n.classList.contains(`tree__item`)&&n.setAttribute(`aria-expanded`,`true`)}};customElements.get(`wc-tree`)||customElements.define(`wc-tree`,on);function sn(e){return!e.hasLink||e.onInteractive||e.platformHandled?!1:e.moved<=6}const cn=[`a[href]`,`button`,`input`,`select`,`textarea`,`label`,`summary`,`details`,`audio[controls]`,`video[controls]`,`[contenteditable]`,`[role="button"]`,`[role="link"]`,`[onclick]`,`[data-no-card-link]`].join(`,`);function ln(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}var un=class extends X{static{this.properties={item:{type:String,reflect:!0}}}createRenderRoot(){return this}render(){return T}#e=[];#t;constructor(){super(),this.item=`.card`}connectedCallback(){super.connectedCallback(),Z(this,()=>this.#n())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerdown`,this.#i),this.removeEventListener(`click`,this.#a);for(let e of this.#e)e.removeAttribute(`data-card-link`);this.#e=[]}#n(){if(this.parentElement?.closest(`wc-cards`)||this.#e.length)return!0;let e=[...this.querySelectorAll(this.item)];if(!e.length)return!1;if(this.#e=e.filter(e=>this.#r(e)),!this.#e.length)return!0;for(let e of this.#e)e.setAttribute(`data-card-link`,``);return this.addEventListener(`pointerdown`,this.#i),this.addEventListener(`click`,this.#a),!0}#r(e){return e.querySelector(`a[href][data-card-link-target]`)??e.querySelector(`a[href]`)}#i=e=>{this.#t={x:e.clientX,y:e.clientY}};#a=e=>{let t=e.target,n=t?.closest(`[data-card-link]`);if(!n||!this.contains(n))return;let r=this.#r(n);if(r&&t?.closest(`a[href]`)===r)return;let i=sn({moved:this.#t?ln(this.#t,{x:e.clientX,y:e.clientY}):0,onInteractive:!!t?.closest(cn),platformHandled:e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0,hasLink:!!r});this.#t=void 0,!(!i||!r)&&r.click()}};customElements.get(`wc-cards`)||customElements.define(`wc-cards`,un);function dn(e,t,n){if(t<=1)return[];let r=[Ht({index:e,total:t,delta:-1,loop:n}),Ht({index:e,total:t,delta:1,loop:n})];return[...new Set(r)].filter(t=>t!==e)}var fn=class extends X{createRenderRoot(){return this}render(){return T}#e=!1;#t=null;#n=null;#r=null;#i=[];#a=!1;connectedCallback(){super.connectedCallback(),Z(this,()=>this.#o())}disconnectedCallback(){super.disconnectedCallback();for(let e of this.#i)e.trigger.removeEventListener(`click`,this.#s);this.#r?.removeEventListener(`click`,this.#u),this.#n?.removeEventListener(`carousel-change`,this.#d),this.#i=[],this.#t=null,this.#n=null,this.#r=null,this.#e=!1}#o(){if(this.parentElement?.closest(`wc-gallery`)||this.#e)return!0;let e=[...this.querySelectorAll(`.gallery__trigger[href^="#"]`)],t=this.querySelector(`dialog.lightbox-dialog`);if(!e.length||!t)return!1;let n=t.querySelector(`.lightbox-dialog__track`);if(!n)return!1;let r=[];for(let t of e){let e=t.getAttribute(`href`)?.slice(1),n=e?this.querySelector(`#${CSS.escape(e)}`):null;if(!n)return!1;r.push({trigger:t,slide:n})}this.#a=matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.#t=t,this.#n=n,this.#r=t.querySelector(`.lightbox-dialog__close`),this.#i=r;for(let e of r)e.trigger.addEventListener(`click`,this.#s);return this.#r?.addEventListener(`click`,this.#u),n.addEventListener(`carousel-change`,this.#d),this.#e=!0,!0}#s=e=>{let t=e.currentTarget,n=this.#i.find(e=>e.trigger===t);!n||!this.#t||(e.preventDefault(),this.#c(n))};#c(e){let t=this.#i.indexOf(e),n=this.#i.length,r=()=>{this.#t.showModal(),e.slide.scrollIntoView({inline:`center`,block:`nearest`,behavior:`instant`}),this.#l(t),this.dispatchEvent(new CustomEvent(`gallery-open`,{bubbles:!0,composed:!0,detail:{index:t,total:n}}))},i=e.trigger.querySelector(`.gallery__thumb`),a=e.slide.querySelector(`img`);if(this.#a||!(`startViewTransition`in document)||!i||!a){r();return}i.style.viewTransitionName=`lightbox-active`,document.startViewTransition(()=>{i.style.viewTransitionName=``,a.style.viewTransitionName=`lightbox-active`,r()}).finished.finally(()=>{a.style.viewTransitionName=``})}#l(e){let t=this.#n?.hasAttribute(`loop`)??!1;for(let n of dn(e,this.#i.length,t)){let e=this.#i[n]?.slide.querySelector(`img`),t=e?.currentSrc||e?.src;t&&(new Image().src=t)}}#u=e=>{e.preventDefault(),this.#t?.close()};#d=e=>{this.dispatchEvent(new CustomEvent(`gallery-change`,{bubbles:!0,composed:!0,detail:e.detail}))}};customElements.get(`wc-gallery`)||customElements.define(`wc-gallery`,fn);const pn=/^([^0-9-]*)(-?[0-9,]*\.?[0-9]*)([^0-9]*)$/;function mn(e,t){let n=pn.exec(e.trim()),r=n?.[2]||`0`,i=r.split(`.`)[1];return{prefix:(n?.[1]??``).trim(),suffix:(n?.[3]??``).trim(),value:Number.parseFloat(r.replace(/,/g,``))||0,decimals:t??i?.length??0,grouping:r.includes(`,`)}}function hn(e){return new Intl.NumberFormat(void 0,{minimumFractionDigits:e.decimals,maximumFractionDigits:e.decimals,useGrouping:e.grouping})}const gn={linear:`linear`,"ease-in":`var(--custom-ease-in)`,"ease-out":`var(--custom-ease-out)`,"float-sine":`var(--ease-float-sine)`,"float-bounce":`var(--ease-float-bounce)`};function _n(e){return e?gn[e]:void 0}const $=new WeakMap;let vn;function yn(){return vn??=new IntersectionObserver((e,t)=>{for(let n of e)n.isIntersecting&&(t.unobserve(n.target),$.get(n.target)?.())})}var bn=class extends X{createRenderRoot(){return this}render(){return T}#e=!1;#t=null;#n=null;#r=null;#i=``;#a=``;#o=0;#s=0;#c=0;#l=!1;connectedCallback(){super.connectedCallback(),Z(this,()=>this.#u())}disconnectedCallback(){super.disconnectedCallback(),yn().unobserve(this),$.delete(this),this.#h(),this.#n?.remove(),this.#n=null,this.#t?.classList.remove(`sr-only`),this.#t=null,this.#e=!1}#u(){if(this.parentElement?.closest(`wc-counter`)||this.#e)return!0;let e=this.querySelector(`.counter__value`);if(!e)return!1;this.#t=e;let t=this.getAttribute(`data-decimals`),n=mn(e.textContent??``,t?Number(t):void 0);if(this.#i=n.prefix,this.#a=n.suffix,this.#o=n.value,this.#r=hn(n),this.#e=!0,matchMedia(`(prefers-reduced-motion: reduce)`).matches)return!0;let r=document.createElement(`span`);r.className=`counter__presentation`,r.setAttribute(`aria-hidden`,`true`),r.textContent=e.textContent,e.insertAdjacentElement(`afterend`,r),this.#n=r,this.setAttribute(`aria-live`,`off`);let i=this.getAttribute(`data-from`)??`0`,a=Number(this.getAttribute(`data-duration`)??`1200`);this.style.setProperty(`--counter-from`,i),this.style.setProperty(`--counter-to`,String(this.#o)),this.style.setProperty(`--counter-duration`,`${a}ms`);let o=_n(this.getAttribute(`data-easing`));return o&&this.style.setProperty(`--counter-easing`,o),$.set(this,()=>this.#d(a)),yn().observe(this),!0}#d(e){this.#n&&(this.#l=!1,this.setAttribute(`running`,``),this.#t?.classList.add(`sr-only`),this.#n.addEventListener(`animationend`,this.#m,{once:!0}),this.#c=window.setTimeout(this.#m,e+100),this.#s=requestAnimationFrame(this.#f))}#f=()=>{if(!this.#n||!this.#r)return;let e=Number.parseFloat(getComputedStyle(this.#n).getPropertyValue(`--_n`));this.#p(Number.isFinite(e)?e:this.#o),this.#s=requestAnimationFrame(this.#f)};#p(e){!this.#n||!this.#r||(this.#n.textContent=`${this.#i}${this.#r.format(e)}${this.#a}`)}#m=()=>{this.#l||(this.#l=!0,this.#p(this.#o),this.#h(),this.#t?.classList.remove(`sr-only`),this.removeAttribute(`running`))};#h(){this.#s&&cancelAnimationFrame(this.#s),this.#s=0,this.#c&&clearTimeout(this.#c),this.#c=0,this.#n?.removeEventListener(`animationend`,this.#m)}};customElements.get(`wc-counter`)||customElements.define(`wc-counter`,bn);
package/package.json CHANGED
@@ -1,8 +1,15 @@
1
1
  {
2
2
  "name": "@getvitops/core",
3
- "version": "7.0.0",
3
+ "version": "8.0.0",
4
4
  "description": "The Vitops design-system framework — CSS partials, Lit web components, and browser polyfills.",
5
+ "homepage": "https://docs.vitops.ca",
6
+ "bugs": "https://github.com/getvitops/design-system/issues",
5
7
  "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/getvitops/design-system.git",
11
+ "directory": "packages/core"
12
+ },
6
13
  "files": [
7
14
  "dist",
8
15
  "css",
@@ -21,7 +28,7 @@
21
28
  "publishConfig": {
22
29
  "access": "public"
23
30
  },
24
- "dependencies": {
31
+ "devDependencies": {
25
32
  "@lit-labs/signals": "^0.3.0",
26
33
  "@oddbird/css-anchor-positioning": "^0.9.0",
27
34
  "@oddbird/popover-polyfill": "^0.7.0",
@@ -29,18 +36,19 @@
29
36
  "@webcomponents/webcomponentsjs": "^2.8.0",
30
37
  "colorjs.io": "^0.5.2",
31
38
  "construct-style-sheets-polyfill": "^3.1.0",
32
- "invokers-polyfill": "^1.0.3",
33
- "lit": "^3.3.3",
34
- "scroll-timeline-polyfill": "^1.1.0",
35
- "temporal-polyfill": "^1.0.1",
36
- "@getvitops/utils": "7.0.0"
37
- },
38
- "devDependencies": {
39
39
  "cssnano": "^8.0.5",
40
40
  "happy-dom": "^20.0.0",
41
+ "invokers-polyfill": "^1.0.3",
42
+ "lit": "^3.3.3",
41
43
  "minify-html-literals": "^1.3.5",
42
44
  "postcss": "^8.5.26",
43
45
  "postcss-lit": "^1.4.1",
44
- "vitest": "^4.1.9"
46
+ "scroll-timeline-polyfill": "^1.1.0",
47
+ "temporal-polyfill": "^1.0.1",
48
+ "vitest": "4.1.9",
49
+ "@getvitops/utils": "8.0.0"
50
+ },
51
+ "engines": {
52
+ "node": ">=24"
45
53
  }
46
54
  }