@gemboss/ui 0.71.0 → 0.74.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 +398 -2
- package/README.md +185 -2
- package/catalog/editor.html +1 -1
- package/catalog/index.html +50 -50
- package/gemboss-ui.css +4 -4
- package/package.json +17 -1
- package/parts/components.css +3 -3
- package/parts/core.css +1 -1
- package/parts/shell.css +2 -2
- package/src/GemMark.tsx +9 -2
- package/src/app-nav.css +1 -1
- package/src/assistant/chat-cards.tsx +118 -19
- package/src/assistant/chat.tsx +97 -12
- package/src/assistant/figures.tsx +119 -0
- package/src/assistant/gallery.tsx +67 -0
- package/src/assistant/host.tsx +29 -15
- package/src/assistant/ideas.tsx +90 -0
- package/src/assistant/index.ts +8 -1
- package/src/assistant/plus.tsx +61 -0
- package/src/assistant-chat.css +1 -1
- package/src/assistant-figures.css +1 -0
- package/src/assistant-plus.css +1 -0
- package/src/assistant.css +1 -1
- package/src/auth.tsx +7 -3
- package/src/board-move.ts +2 -1
- package/src/brand-gem.tsx +10 -2
- package/src/brand.tsx +6 -3
- package/src/chat-cards-drawn.css +1 -0
- package/src/chat-cards-float.css +1 -0
- package/src/chat-cards.css +1 -1
- package/src/chat-composer-menus.css +1 -1
- package/src/chat-composer.css +1 -1
- package/src/chat-shortcuts.css +1 -0
- package/src/chat-voice.css +1 -1
- package/src/chat.css +1 -1
- package/src/chips-drawn.css +1 -0
- package/src/collections.tsx +4 -2
- package/src/dialog.css +1 -1
- package/src/editor/choice-cards.tsx +8 -5
- package/src/editor/controls.tsx +8 -5
- package/src/editor/field-control.tsx +8 -3
- package/src/editor/field-frame.tsx +5 -3
- package/src/editor/field-spec.ts +12 -3
- package/src/editor/index.ts +2 -0
- package/src/editor/inspector-frame.tsx +3 -2
- package/src/editor/media-words.ts +21 -0
- package/src/editor-empty.css +1 -1
- package/src/editor-inspector-frame.css +1 -1
- package/src/editor-media.css +1 -1
- package/src/editor.css +1 -1
- package/src/email-canvas.css +1 -0
- package/src/email-card.tsx +44 -0
- package/src/email-editor/canvas.tsx +109 -0
- package/src/email-editor/editor.tsx +45 -4
- package/src/email-editor/index.ts +2 -1
- package/src/email-editor/model.ts +9 -1
- package/src/email-parts.css +1 -0
- package/src/email-parts.tsx +81 -0
- package/src/email-thumb.css +1 -0
- package/src/email-thumb.tsx +206 -0
- package/src/flow-strip.css +1 -0
- package/src/flow-strip.tsx +50 -0
- package/src/gemboss-field-drawn.css +1 -0
- package/src/index.ts +15 -2
- package/src/kit-plain.css +1 -1
- package/src/kit-plain.js +1 -1
- package/src/list-page.tsx +6 -3
- package/src/media-card.css +1 -0
- package/src/menu-layer.ts +2 -0
- package/src/menu-select.css +1 -1
- package/src/menu.css +1 -1
- package/src/metrics.css +1 -0
- package/src/metrics.tsx +59 -0
- package/src/picture-actions.css +1 -0
- package/src/picture-actions.tsx +23 -0
- package/src/reader-dialog.css +1 -1
- package/src/segmented.tsx +6 -0
- package/src/services.ts +17 -0
- package/src/settings-dialog.css +1 -1
- package/src/sheet.css +1 -1
- package/src/shell.css +1 -1
- package/src/shell.tsx +9 -2
- package/src/site.tsx +3 -3
- package/src/stat-tile.css +1 -0
- package/src/stat-tile.tsx +39 -0
- package/src/ui.css +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* EmailParts (15/11/2026, unreleased): the email preview panel, what a brand setting puts in EVERY email, read off the real email:
|
|
4
|
+
* its top (the logo or the name) and its foot (the postal address, the unsubscribe links), with "⋯" between. Canvas
|
|
5
|
+
* NqQGmVzRJMjv536LLbMGaT, boards R1 and R2 (GemBoss Settings › Email › Email brand: "In every email · as sent"), so a change to
|
|
6
|
+
* the logo, the button colour or the address is seen as shoppers see it, not described.
|
|
7
|
+
*
|
|
8
|
+
* `html` is one email as sent (GemReach's thumbnail of a store email). Each part is that email in its own sandboxed iframe with
|
|
9
|
+
* every row of its card hidden but the first (`head`) or the last (`foot`), laid out at 600px and scaled to the panel's width.
|
|
10
|
+
* `sandbox="allow-same-origin"` and NOTHING else: no script runs in it; the page reads the part's height once it has drawn, so
|
|
11
|
+
* the box is exactly as tall as the part (an address on two lines). `mark` rings the foot in the warning tone (an address not
|
|
12
|
+
* confirmed yet, R2) and `note` says why under it. Until `html` comes: the kit's skeleton; `null`: the parts are not drawn and
|
|
13
|
+
* `note` says the rest.
|
|
14
|
+
*/
|
|
15
|
+
import "./email-parts.css";
|
|
16
|
+
import React, { useState } from "react";
|
|
17
|
+
import { EMAIL_THUMB_FRAME, emailThumbDoc } from "./email-thumb";
|
|
18
|
+
|
|
19
|
+
const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
|
|
20
|
+
|
|
21
|
+
/** A part is laid out at the card's own 600px: GemReach's phone layout (620 and under) only narrows its sides to 20px, which is how
|
|
22
|
+
* the board crops them (R1: the address 11px in from the box's edge at 366px). */
|
|
23
|
+
export const EMAIL_PART_WIDTH = 600;
|
|
24
|
+
|
|
25
|
+
/** GemReach's mail card shown one row at a time: the first row (`head`, its logo in the middle of the box), or the last (`foot`) without its rule above. */
|
|
26
|
+
export const EMAIL_PART_CSS: Record<"head" | "foot", string> = {
|
|
27
|
+
head: ".gr-card>tbody>tr:not(:first-child){display:none!important}.gr-card>tbody>tr:first-child>td{padding-top:20px!important;padding-bottom:20px!important}",
|
|
28
|
+
foot: ".gr-card>tbody>tr:not(:last-child){display:none!important}.gr-card>tbody>tr:last-child>td{border-top:0!important}",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
function EmailPart({ html, part, label, mark }: { html: string; part: "head" | "foot"; label: string; mark?: boolean }) {
|
|
32
|
+
const [height, setHeight] = useState<number | null>(null);
|
|
33
|
+
const [width, setWidth] = useState<number | null>(null);
|
|
34
|
+
const scale = width ? width / EMAIL_PART_WIDTH : null;
|
|
35
|
+
return (
|
|
36
|
+
<span className={cx("ui-emailparts__part", mark && "ui-emailparts__part--mark")}
|
|
37
|
+
ref={(el) => { if (el && el.clientWidth && el.clientWidth !== width) setWidth(el.clientWidth); }}
|
|
38
|
+
style={height && scale ? { height: Math.ceil(height * scale) } : undefined}>
|
|
39
|
+
<iframe className="ui-emailparts__frame" title={label} sandbox="allow-same-origin" tabIndex={-1}
|
|
40
|
+
srcDoc={emailThumbDoc(html, `${EMAIL_THUMB_FRAME}${EMAIL_PART_CSS[part]}`)}
|
|
41
|
+
style={{ width: EMAIL_PART_WIDTH, height: height ?? 120, ...(scale ? { transform: `scale(${scale})` } : {}) }}
|
|
42
|
+
onLoad={(e) => {
|
|
43
|
+
const doc = e.currentTarget.contentDocument;
|
|
44
|
+
const h = doc?.querySelector(".gr-card")?.getBoundingClientRect().height ?? doc?.documentElement.scrollHeight;
|
|
45
|
+
if (h) setHeight(Math.ceil(h));
|
|
46
|
+
}} />
|
|
47
|
+
</span>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function EmailParts({ html, title = "In every email", aside = "as sent", mark, note, className }: {
|
|
52
|
+
/** One email as sent; undefined while it is asked for; null when it could not be drawn. */
|
|
53
|
+
html: string | null | undefined;
|
|
54
|
+
title?: React.ReactNode;
|
|
55
|
+
aside?: React.ReactNode;
|
|
56
|
+
/** Ring the foot: something in it is not printed yet (R2). */
|
|
57
|
+
mark?: boolean;
|
|
58
|
+
/** One line under the parts. */
|
|
59
|
+
note?: React.ReactNode;
|
|
60
|
+
className?: string;
|
|
61
|
+
}) {
|
|
62
|
+
return (
|
|
63
|
+
<aside className={cx("ui-card ui-emailparts", className)} aria-label={typeof title === "string" ? title : undefined}>
|
|
64
|
+
<div className="ui-emailparts__head"><h2 className="ui-emailparts__title">{title}</h2>{aside ? <span className="ui-emailparts__aside">{aside}</span> : null}</div>
|
|
65
|
+
{html === undefined ? (
|
|
66
|
+
<>
|
|
67
|
+
<span className="ui-emailparts__part ui-emailparts__part--wait" aria-hidden="true" />
|
|
68
|
+
<span className="ui-emailparts__gap" aria-hidden="true">⋯</span>
|
|
69
|
+
<span className="ui-emailparts__part ui-emailparts__part--wait ui-emailparts__part--tall" aria-hidden="true" />
|
|
70
|
+
</>
|
|
71
|
+
) : html ? (
|
|
72
|
+
<>
|
|
73
|
+
<EmailPart html={html} part="head" label="The top of every email" />
|
|
74
|
+
<span className="ui-emailparts__gap" aria-hidden="true">⋯</span>
|
|
75
|
+
<EmailPart html={html} part="foot" label="The foot of every email" mark={mark} />
|
|
76
|
+
</>
|
|
77
|
+
) : null}
|
|
78
|
+
{note ? <div className="ui-emailparts__note">{note}</div> : null}
|
|
79
|
+
</aside>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ui-emailthumb{--ui-emailthumb-scale: .42;position:relative;display:block;width:100%;height:100%;overflow:hidden;background:#fff}.ui-emailthumb--list{--ui-emailthumb-scale: .1446;flex:none;width:96px;height:72px;border-radius:6px;box-shadow:0 0 0 1px var(--ui-border)}.ui-emailthumb--sm{--ui-emailthumb-scale: .0843;flex:none;width:56px;height:42px;border-radius:4px;box-shadow:0 0 0 1px var(--ui-border)}.ui-emailthumb__frame{position:absolute;top:0;left:0;display:block;border:0;background:#fff;color-scheme:light;transform:scale(var(--ui-emailthumb-scale));transform-origin:0 0;pointer-events:none}.ui-emailthumb>.ui-emailthumb__wait{position:absolute;inset:0;display:block;border-radius:inherit;background:linear-gradient(90deg,var(--ui-surface-2) 25%,var(--ui-border) 37%,var(--ui-surface-2) 63%);background-size:400% 100%;animation:ui-skeleton-sheen 1.4s ease-in-out infinite}.ui-emailthumb>.ui-emailthumb__none{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:inherit;background:var(--ui-surface-2);color:var(--ui-text-muted)}@media (prefers-reduced-motion: reduce){.ui-emailthumb>.ui-emailthumb__wait{animation:none;background:var(--ui-surface-2)}}.ui-thumbcell{display:flex;align-items:center;gap:12px;min-width:0}.ui-thumbcell__body{display:flex;flex-direction:column;gap:6px;min-width:0}.ui-thumbcell__title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ui-text-muted)}.ui-thumbcell__title>b{font-weight:600;color:var(--ui-text)}.ui-thumbcell__title>b>a{color:inherit;text-decoration:none}.ui-thumbcell__context{color:var(--ui-text-muted)}@media (hover: hover){.ui-thumbcell__title>b>a:hover{text-decoration:underline}}.ui-thumbcell__line{display:block;min-width:0;color:var(--ui-text-muted)}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* EmailThumb (15/11/2026, unreleased): an email shown as itself, small. The HTML the email is sent as (GemReach's thumbnail,
|
|
4
|
+
* `GET /t/v1/templates/:id/thumbnail`: the store's brand kit, a sample person, the marketing footer) is drawn in a sandboxed iframe
|
|
5
|
+
* (`srcdoc`, `sandbox=""`: no script runs, nothing is read back) and scaled down with a CSS transform, cropped to its box. Canvas
|
|
6
|
+
* NqQGmVzRJMjv536LLbMGaT, board L6 option 1 (Chris 15/11/2026, J2 Q9: "an iframe first, a PNG later"); it replaced a drawn
|
|
7
|
+
* envelope that looked the same for every email (G30).
|
|
8
|
+
*
|
|
9
|
+
* Three sizes, one email:
|
|
10
|
+
* - `fill` (the default): the box it is put in, a MediaCard's 4:3 picture (EmailCard), a Stage window;
|
|
11
|
+
* - `list`: 96×72, the picture of a row or a table cell (ResourceItem's `media`, ThumbCell);
|
|
12
|
+
* - `sm`: 56×42, a small row (an overview's "Needs you", a funnel's email panel).
|
|
13
|
+
*
|
|
14
|
+
* The email is laid out at `width` (664 by default) before it is scaled: GemReach's mail is a 600px column that turns into its phone
|
|
15
|
+
* layout at 620 and under (one column, 20px sides), so it is laid out a little wider than itself to look as it does on a computer,
|
|
16
|
+
* with 32px of white on each side. `frameCss` lays it on white from the top of its card (`EMAIL_THUMB_FRAME`), as a card shows it.
|
|
17
|
+
*
|
|
18
|
+
* Lazy: with `load`, nothing is asked until the box comes within 200px of the screen (an IntersectionObserver), and at most four
|
|
19
|
+
* emails are asked at once on a page. `cacheKey` keeps the answer in the page's memory, so the same email in a second place draws at
|
|
20
|
+
* once. Until it draws: the kit's skeleton sheen. An email that does not draw (`load` answers null, or fails): the box stays, an
|
|
21
|
+
* envelope in it, and the card says the rest.
|
|
22
|
+
*
|
|
23
|
+
* The frame is decoration: the card or the row it sits in names the email, so it is out of the tab order and hidden from a screen
|
|
24
|
+
* reader (`title` is still given, as every iframe should have one).
|
|
25
|
+
*/
|
|
26
|
+
import "./email-thumb.css";
|
|
27
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
28
|
+
import { Icon } from "./icons";
|
|
29
|
+
|
|
30
|
+
const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
|
|
31
|
+
|
|
32
|
+
export type EmailThumbSize = "fill" | "list" | "sm";
|
|
33
|
+
|
|
34
|
+
/** The width an email is laid out at before it is scaled (see the module's note). */
|
|
35
|
+
export const EMAIL_THUMB_WIDTH = 664;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* GemReach's mail on white, from the top of its card: the grey around the card and the 24px above it go, so the logo sits near the
|
|
39
|
+
* top of the box as a card's picture shows it. The rest of the email is untouched. `:root` light: a thumbnail is the email as most
|
|
40
|
+
* people open it, whatever the admin's own scheme.
|
|
41
|
+
*/
|
|
42
|
+
export const EMAIL_THUMB_FRAME =
|
|
43
|
+
":root{color-scheme:light!important}html,body{margin:0!important;background:#fff!important;overflow:hidden!important}" +
|
|
44
|
+
".gr-bg{background-color:#fff!important}body>table.gr-bg>tbody>tr>td{padding:0!important}";
|
|
45
|
+
|
|
46
|
+
/** The iframe's document: the email, with `css` laid over it last (just before `</head>`, else at the very top). */
|
|
47
|
+
export function emailThumbDoc(html: string, css: string | null = EMAIL_THUMB_FRAME): string {
|
|
48
|
+
if (!css) return html;
|
|
49
|
+
const style = `<style data-ui-email-thumb>${css}</style>`;
|
|
50
|
+
const at = html.search(/<\/head\s*>/i);
|
|
51
|
+
return at >= 0 ? `${html.slice(0, at)}${style}${html.slice(at)}` : `${style}${html}`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** How much the email is scaled to fill a box `box` px wide; the frame's own height so it reaches the box's bottom. */
|
|
55
|
+
export function emailThumbFit(box: { width: number; height: number }, width = EMAIL_THUMB_WIDTH): { scale: number; height: number } {
|
|
56
|
+
if (!(box.width > 0) || !(width > 0)) return { scale: 0, height: 0 };
|
|
57
|
+
const scale = box.width / width;
|
|
58
|
+
return { scale, height: Math.ceil((box.height > 0 ? box.height : (box.width * 3) / 4) / scale) };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ── The page's memory, and four asks at a time ──────────────────────────────────────────────────────────────────────────────
|
|
62
|
+
|
|
63
|
+
const KEEP = 200;
|
|
64
|
+
const kept = new Map<string, Promise<string | null>>();
|
|
65
|
+
let running = 0;
|
|
66
|
+
const waiting: Array<() => void> = [];
|
|
67
|
+
|
|
68
|
+
/** At most four emails are asked at once: a gallery of 40 does not send 40 requests in the same tick. */
|
|
69
|
+
function inTurn<T>(work: () => Promise<T>): Promise<T> {
|
|
70
|
+
return new Promise<T>((resolve, reject) => {
|
|
71
|
+
const go = () => {
|
|
72
|
+
running += 1;
|
|
73
|
+
work().then(resolve, reject).finally(() => {
|
|
74
|
+
running -= 1;
|
|
75
|
+
waiting.shift()?.();
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
if (running < 4) go();
|
|
79
|
+
else waiting.push(go);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The email's HTML, asked once per `key` on this page (the newest 200 kept). A failure is not kept: the next box that shows it asks
|
|
85
|
+
* again. Exported for the tests and for a screen that wants to warm a few before they scroll in.
|
|
86
|
+
*/
|
|
87
|
+
export function loadEmailThumb(key: string | undefined, load: () => Promise<string | null>): Promise<string | null> {
|
|
88
|
+
if (!key) return inTurn(load);
|
|
89
|
+
const hit = kept.get(key);
|
|
90
|
+
if (hit) {
|
|
91
|
+
kept.delete(key);
|
|
92
|
+
kept.set(key, hit);
|
|
93
|
+
return hit;
|
|
94
|
+
}
|
|
95
|
+
const asked = inTurn(load);
|
|
96
|
+
kept.set(key, asked);
|
|
97
|
+
asked.catch(() => kept.delete(key));
|
|
98
|
+
while (kept.size > KEEP) kept.delete(kept.keys().next().value!);
|
|
99
|
+
return asked;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Forget the page's emails (tests; a screen that knows every email changed, like a brand kit saved). */
|
|
103
|
+
export function forgetEmailThumbs(): void {
|
|
104
|
+
kept.clear();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface EmailThumbProps {
|
|
108
|
+
/** The email's HTML. Given, it draws at once (no `load`). */
|
|
109
|
+
html?: string | null;
|
|
110
|
+
/** Asked for the HTML when the box comes near the screen. Null, or a failure, draws the envelope. */
|
|
111
|
+
load?: () => Promise<string | null>;
|
|
112
|
+
/** Names this email in the page's memory (its id and version, or the answer's ETag). */
|
|
113
|
+
cacheKey?: string;
|
|
114
|
+
/** The frame's title (what the email is). */
|
|
115
|
+
title: string;
|
|
116
|
+
size?: EmailThumbSize;
|
|
117
|
+
/** The width the email is laid out at, before it is scaled. */
|
|
118
|
+
width?: number;
|
|
119
|
+
/** Laid over the email last; `null` draws it as sent, grey around the card. */
|
|
120
|
+
frameCss?: string | null;
|
|
121
|
+
className?: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
type State = "idle" | "loading" | "drawing" | "drawn" | "none";
|
|
125
|
+
// Whole class names, never built from a template (the admin's orphan-rule gate reads them).
|
|
126
|
+
const SIZE: Record<EmailThumbSize, string | null> = { fill: null, list: "ui-emailthumb--list", sm: "ui-emailthumb--sm" };
|
|
127
|
+
|
|
128
|
+
export function EmailThumb({ html, load, cacheKey, title, size = "fill", width = EMAIL_THUMB_WIDTH, frameCss = EMAIL_THUMB_FRAME, className }: EmailThumbProps) {
|
|
129
|
+
const box = useRef<HTMLSpanElement>(null);
|
|
130
|
+
const [got, setGot] = useState<string | null | undefined>(html ?? undefined);
|
|
131
|
+
const [state, setState] = useState<State>(html ? "drawing" : html === null && !load ? "none" : "idle");
|
|
132
|
+
const [fit, setFit] = useState<{ scale: number; height: number } | null>(null);
|
|
133
|
+
|
|
134
|
+
// The HTML: given, or asked once the box is near the screen.
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
if (html !== undefined && html !== null) { setGot(html); setState("drawing"); return; }
|
|
137
|
+
if (!load) { setState("none"); return; }
|
|
138
|
+
const el = box.current;
|
|
139
|
+
let gone = false;
|
|
140
|
+
const ask = () => {
|
|
141
|
+
setState("loading");
|
|
142
|
+
loadEmailThumb(cacheKey, load).then(
|
|
143
|
+
(h) => { if (!gone) { setGot(h); setState(h ? "drawing" : "none"); } },
|
|
144
|
+
() => { if (!gone) setState("none"); },
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
if (!el || typeof IntersectionObserver === "undefined") { ask(); return () => { gone = true; }; }
|
|
148
|
+
const io = new IntersectionObserver((seen) => {
|
|
149
|
+
if (seen.some((s) => s.isIntersecting)) { io.disconnect(); ask(); }
|
|
150
|
+
}, { rootMargin: "200px" });
|
|
151
|
+
io.observe(el);
|
|
152
|
+
return () => { gone = true; io.disconnect(); };
|
|
153
|
+
// `load` is a new function on every render of the caller: the email is named by `cacheKey` and `html`.
|
|
154
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
155
|
+
}, [html, cacheKey]);
|
|
156
|
+
|
|
157
|
+
// The scale, from the box's own size (a card's width follows the grid).
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
const el = box.current;
|
|
160
|
+
if (!el) return;
|
|
161
|
+
const measure = () => setFit(emailThumbFit({ width: el.clientWidth, height: el.clientHeight }, width));
|
|
162
|
+
measure();
|
|
163
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
164
|
+
const ro = new ResizeObserver(measure);
|
|
165
|
+
ro.observe(el);
|
|
166
|
+
return () => ro.disconnect();
|
|
167
|
+
}, [width]);
|
|
168
|
+
|
|
169
|
+
const style = fit && fit.scale > 0 ? ({ "--ui-emailthumb-scale": String(fit.scale) } as React.CSSProperties) : undefined;
|
|
170
|
+
return (
|
|
171
|
+
<span ref={box} className={cx("ui-emailthumb", SIZE[size], className)} data-state={state} style={style}>
|
|
172
|
+
{got && state !== "none" ? (
|
|
173
|
+
<iframe className="ui-emailthumb__frame" title={title} sandbox="" srcDoc={emailThumbDoc(got, frameCss)} tabIndex={-1} aria-hidden="true"
|
|
174
|
+
loading="lazy" style={{ width, height: fit?.height || Math.ceil((width * 3) / 4) }} onLoad={() => setState("drawn")} />
|
|
175
|
+
) : null}
|
|
176
|
+
{state === "none" ? <span className="ui-emailthumb__none" aria-hidden="true"><Icon name="inbox" size={size === "sm" ? 14 : size === "list" ? 18 : 24} /></span>
|
|
177
|
+
: state !== "drawn" ? <span className="ui-emailthumb__wait" aria-hidden="true" /> : null}
|
|
178
|
+
</span>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* ThumbCell: a table cell or a row's start that holds a picture and words, the kit's table cells holding text only. The picture (an
|
|
184
|
+
* EmailThumb `list`), then the name in bold with its context muted after a middle dot ("Welcome · Whole store"), then one more line
|
|
185
|
+
* under it: a FlowStrip, a subject, a count. Board N2's Flow column.
|
|
186
|
+
*/
|
|
187
|
+
export function ThumbCell({ thumb, title, context, children, className }: {
|
|
188
|
+
thumb: React.ReactNode;
|
|
189
|
+
/** The name: a link to the thing when the row opens it. */
|
|
190
|
+
title: React.ReactNode;
|
|
191
|
+
/** Where it runs, what it is for: muted after a middle dot. */
|
|
192
|
+
context?: React.ReactNode;
|
|
193
|
+
/** The second line. */
|
|
194
|
+
children?: React.ReactNode;
|
|
195
|
+
className?: string;
|
|
196
|
+
}) {
|
|
197
|
+
return (
|
|
198
|
+
<span className={cx("ui-thumbcell", className)}>
|
|
199
|
+
{thumb}
|
|
200
|
+
<span className="ui-thumbcell__body">
|
|
201
|
+
<span className="ui-thumbcell__title"><b>{title}</b>{context ? <span className="ui-thumbcell__context"> · {context}</span> : null}</span>
|
|
202
|
+
{children ? <span className="ui-thumbcell__line">{children}</span> : null}
|
|
203
|
+
</span>
|
|
204
|
+
</span>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ui-flowstrip{display:flex;align-items:center;flex-wrap:nowrap;min-width:0;margin:0;padding:0;list-style:none}.ui-flowstrip__step{position:relative;display:inline-flex;flex:none;align-items:center;gap:4px;height:24px;padding:0 8px;border-radius:999px;background:var(--ui-surface);box-shadow:inset 0 0 0 1px var(--ui-border);color:var(--ui-text);font-size:var(--ui-fs-caption);line-height:16px;white-space:nowrap}.ui-flowstrip__step+.ui-flowstrip__step{margin-left:18px}.ui-flowstrip__step+.ui-flowstrip__step:before{content:"";position:absolute;left:-15px;top:50%;width:12px;height:1px;background:var(--ui-text-muted)}.ui-flowstrip__step+.ui-flowstrip__step:after{content:"";position:absolute;left:-6px;top:calc(50% - 3px);border:3px solid transparent;border-left:4px solid var(--ui-text-muted);border-right-width:0}.ui-flowstrip__step>svg{flex:none}.ui-flowstrip__step--start{background:var(--ui-text);box-shadow:none;color:var(--ui-surface)}.ui-flowstrip__step--wait{background:var(--ui-surface-2)}.ui-flowstrip__step--split{font-weight:450}.ui-flowstrip__step--email{background:var(--gemboss-accent-soft);box-shadow:none;color:var(--gemboss-accent-strong)}.ui-flowstrip__step--more{color:var(--ui-text-muted)}.ui-flowstrip--md .ui-flowstrip__step{height:28px;font-size:var(--ui-fs-body)}.ui-flowstrip--md .ui-flowstrip__step+.ui-flowstrip__step{margin-left:22px}.ui-flowstrip--md .ui-flowstrip__step+.ui-flowstrip__step:before{left:-19px;width:16px}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FlowStrip (15/11/2026, unreleased): a flow's steps in one row, joined by arrows. Canvas NqQGmVzRJMjv536LLbMGaT, boards N2 (the
|
|
3
|
+
* Email flows table), N3 (a recipe card's foot), U2 (the Ops console's store flows): what starts it, the waits, each email, a split.
|
|
4
|
+
*
|
|
5
|
+
* - `start`: ink, a target, the event ("Checkout", "Signs up");
|
|
6
|
+
* - `wait`: a clock and how long ("1 h", "25 d");
|
|
7
|
+
* - `email`: the accent's soft fill and an envelope; its words are for a screen reader (the row shows the email's picture);
|
|
8
|
+
* - `split`: white, the sliders, the question ("Ordered?").
|
|
9
|
+
* `max` keeps the first steps and ends in "+N" (a card's foot holds three). `md` is a size up, for a page about one flow.
|
|
10
|
+
*
|
|
11
|
+
* An ordered list, named by `label`. Server-renderable; no colour of its own (tokens).
|
|
12
|
+
*/
|
|
13
|
+
import "./flow-strip.css";
|
|
14
|
+
import React from "react";
|
|
15
|
+
import { Icon, type IconName } from "./icons";
|
|
16
|
+
|
|
17
|
+
const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
|
|
18
|
+
|
|
19
|
+
export type FlowStepKind = "start" | "wait" | "email" | "split";
|
|
20
|
+
export interface FlowStep { kind: FlowStepKind; label: string }
|
|
21
|
+
|
|
22
|
+
const ICON: Record<FlowStepKind, IconName> = { start: "target", wait: "clock", email: "inbox", split: "sliders" };
|
|
23
|
+
// Whole class names, never built from a template: a class written out is one grep (and the admin's orphan-rule gate) can find.
|
|
24
|
+
const STEP: Record<FlowStepKind, string> = {
|
|
25
|
+
start: "ui-flowstrip__step ui-flowstrip__step--start", wait: "ui-flowstrip__step ui-flowstrip__step--wait",
|
|
26
|
+
email: "ui-flowstrip__step ui-flowstrip__step--email", split: "ui-flowstrip__step ui-flowstrip__step--split",
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function FlowStrip({ steps, size = "sm", max, label = "Steps", className }: {
|
|
30
|
+
steps: readonly FlowStep[];
|
|
31
|
+
size?: "sm" | "md";
|
|
32
|
+
/** At most this many steps, then "+N". */
|
|
33
|
+
max?: number;
|
|
34
|
+
label?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
}) {
|
|
37
|
+
const shown = max && max > 0 && steps.length > max ? steps.slice(0, max) : steps;
|
|
38
|
+
const more = steps.length - shown.length;
|
|
39
|
+
return (
|
|
40
|
+
<ol className={cx("ui-flowstrip", size === "md" && "ui-flowstrip--md", className)} aria-label={label}>
|
|
41
|
+
{shown.map((s, i) => (
|
|
42
|
+
<li key={i} className={STEP[s.kind]}>
|
|
43
|
+
<Icon name={ICON[s.kind]} size={size === "md" ? 16 : 14} />
|
|
44
|
+
{s.kind === "email" ? <span className="ui-sr-only">{s.label}</span> : <span>{s.label}</span>}
|
|
45
|
+
</li>
|
|
46
|
+
))}
|
|
47
|
+
{more > 0 ? <li className="ui-flowstrip__step ui-flowstrip__step--more"><span aria-hidden="true">+{more}</span><span className="ui-sr-only">{more} more {more === 1 ? "step" : "steps"}</span></li> : null}
|
|
48
|
+
</ol>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@media (pointer: coarse),(max-width: 47.9975em){.gemboss-field--group:not(:has([type=color]),.gemboss-ei-color-group){--gemboss-field-drawn-inset: 4px;position:relative;isolation:isolate;overflow:visible;-webkit-background-clip:text!important;background-clip:text!important;border-image:linear-gradient(#0000,#0000)!important}.gemboss-field--group:not(:has([type=color]),.gemboss-ei-color-group):before{content:"";position:absolute;inset:calc(var(--gemboss-field-drawn-inset) - 1px) -1px;z-index:-1;box-sizing:border-box;pointer-events:none;background:inherit;-webkit-background-clip:border-box;background-clip:border-box;border-width:inherit;border-style:inherit;border-color:inherit;border-image:none;border-radius:inherit}.gemboss-field--group:not(:has([type=color]),.gemboss-ei-color-group):focus-within{outline:none}.gemboss-field--group:not(:has([type=color]),.gemboss-ei-color-group):focus-within:before{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px}}@media (pointer: coarse) and (min-width: 48em){.gemboss-field--group:not(:has([type=color]),.gemboss-ei-color-group){--gemboss-field-drawn-inset: 6px}}
|
package/src/index.ts
CHANGED
|
@@ -43,8 +43,8 @@ export { SiteBrand, SiteHeader } from "./site";
|
|
|
43
43
|
// 0.36.0: the button after the logo and its panel of Gem services; the catalogue is plain data (also `@gemboss/ui/services`).
|
|
44
44
|
export { ServiceSwitcher, Switcher, SERVICES_HEALTH_URL, type ServiceSwitcherLabels, type ServiceSwitcherProps, type SwitcherItem, type SwitcherProps } from "./service-switcher";
|
|
45
45
|
export {
|
|
46
|
-
GEM_SERVICES, SERVICE_GROUPS, SERVICE_TINTS, groupServices,
|
|
47
|
-
type GemService, type ServiceGroup, type ServiceGroupId, type ServiceId, type ServiceTint,
|
|
46
|
+
GEM_FACETS, GEM_SERVICES, SERVICE_GROUPS, SERVICE_TINTS, groupServices,
|
|
47
|
+
type GemFacet, type GemService, type ServiceGroup, type ServiceGroupId, type ServiceId, type ServiceTint,
|
|
48
48
|
} from "./services";
|
|
49
49
|
export { TopbarSearch } from "./search";
|
|
50
50
|
// 21/10/2026: the fleet's one language button (the globe + "EN" / "VI" / "中") and its menu; language-switcher.css its own entry.
|
|
@@ -116,6 +116,16 @@ export { JobCard, JOB_CARD_LABELS, jobProgressShare, jobStepWindow, type JobCard
|
|
|
116
116
|
export { VersionPair, VersionBlank, MomentPicture, Figure, type VersionPairProps, type MomentMark, type MomentPictureProps, type FigureProps, type FigureTone } from "./versions";
|
|
117
117
|
// The core notice on one line with its one action (GemX board ubl-AB-6p, Funnels › Personalize's nudge).
|
|
118
118
|
export { Notice, type NoticeProps } from "./notice";
|
|
119
|
+
// Big numbers on cards (unreleased): the plain kit's large metric card for React hosts, its own entry.
|
|
120
|
+
export { Metric, Metrics, type MetricProps, type MetricsProps } from "./metrics";
|
|
121
|
+
// GemBoss Reach's emails as themselves (canvas NqQGmVzRJMjv536LLbMGaT, 15/11/2026): the real email in a card, a row, a cell; a flow's
|
|
122
|
+
// steps; a home page's numbers; the top and foot every email carries. GemReach's Ops console draws the same.
|
|
123
|
+
export { EmailThumb, ThumbCell, emailThumbDoc, emailThumbFit, loadEmailThumb, forgetEmailThumbs, EMAIL_THUMB_FRAME, EMAIL_THUMB_WIDTH, type EmailThumbProps, type EmailThumbSize } from "./email-thumb";
|
|
124
|
+
export { EmailCard, type EmailCardProps } from "./email-card";
|
|
125
|
+
export { PictureActions } from "./picture-actions";
|
|
126
|
+
export { FlowStrip, type FlowStep, type FlowStepKind } from "./flow-strip";
|
|
127
|
+
export { StatTile, StatTiles } from "./stat-tile";
|
|
128
|
+
export { EmailParts, EMAIL_PART_CSS, EMAIL_PART_WIDTH } from "./email-parts";
|
|
119
129
|
// A section's own nav beside the rail folded to its icons (0.62.0, canvas Hsou4RYo… direction A): its own module and entry, which bring
|
|
120
130
|
// rail-mini.css too, so the admin's first load carries neither.
|
|
121
131
|
export {
|
|
@@ -150,3 +160,6 @@ export {
|
|
|
150
160
|
type PeoplePanelProps, type PersonRowProps, type Presence, type TeamChatLabels, type TeamChatPanel, type TeamChatProps, type TeamChatView, type ThreadPanelProps,
|
|
151
161
|
} from "./team-chat";
|
|
152
162
|
export { chatDayISO, chatDayKey, chatDayWord, teamChatRows, type ChatRow, type ChatRowMessage, type ChatRowOptions } from "./team-chat-data";
|
|
163
|
+
|
|
164
|
+
// The kit's "this layer consumes Escape" (keydown and the keyup a Polaris Modal closes on), for app layers that act on Escape.
|
|
165
|
+
export { consumeEscape } from "./escape";
|
package/src/kit-plain.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ui-check{display:inline-flex;align-items:center;gap:var(--ui-space-2);min-height:44px;max-width:100%;overflow-wrap:break-word;cursor:pointer;font-size:var(--ui-fs-body);color:var(--ui-text)}.ui-check>input{flex:none;width:18px;height:18px;margin:0;accent-color:var(--ui-accent);cursor:inherit}.ui-check>input:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.ui-check:has(>input:disabled){opacity:.5;cursor:not-allowed}.ui-check>:last-child:not(input){min-width:0}.ui-label{display:block;margin:0 0 var(--ui-space-1);font-size:var(--ui-fs-caption);font-weight:600;color:var(--ui-text-muted)}.ui-kv{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:var(--ui-space-2) var(--ui-space-4);margin:0;font-size:var(--ui-fs-body)}.ui-kv>dt{color:var(--ui-text-muted)}.ui-kv>dd{margin:0;min-width:0;overflow-wrap:anywhere;color:var(--ui-text)}.ui-link,.ui-prose :where(a:not([class])){color:var(--gemboss-accent-strong, #3a44de);text-decoration:underline;text-decoration-thickness:from-font;text-underline-offset:2px}.ui-link:visited,.ui-prose :where(a:not([class])):visited{color:var(--gemboss-accent-strong, #3a44de)}@media (hover: hover){.ui-link:hover,.ui-prose :where(a:not([class])):hover{color:var(--gemboss-accent, #5661f5);text-decoration-thickness:2px}}.ui-link:focus-visible,.ui-prose :where(a:not([class])):focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:2px;border-radius:2px}.ui-card--media{position:relative;padding:0;overflow:hidden;display:flex;flex-direction:column}.ui-card__link{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;color:var(--ui-text);font-size:var(--ui-fs-body);line-height:20px;font-weight:650;text-decoration:none;overflow-wrap:anywhere}.ui-card__link:after{content:"";position:absolute;inset:0;z-index:0}.ui-card__link:focus-visible{outline:none}.ui-card--media:has(.ui-card__link){cursor:pointer}@media (hover: hover){.ui-card--media:has(.ui-card__link:hover){border-color:var(--ui-text-muted)}}.ui-card--media:has(.ui-card__link:focus-visible){outline:2px solid var(--ui-focus);outline-offset:1px}.ui-card--media :is(.ui-card__foot button,.ui-card__foot a,.ui-card__body a:not(.ui-card__link),.ui-card__body button,select,input,summary){position:relative;z-index:1}.ui-card__menu{position:absolute;top:8px;right:8px;z-index:2}.ui-card--media:has(>.ui-card__menu){overflow:visible}.ui-card--media:has(>.ui-card__menu)>.ui-card__media{border-radius:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0}.ui-card__meta{color:var(--ui-text-muted);font-size:var(--ui-fs-caption);line-height:16px}.ui-card--media[data-ratio="4/3"]>.ui-card__media{aspect-ratio:4 / 3}.ui-card--media[data-ratio="1/1"]>.ui-card__media{aspect-ratio:1 / 1}.ui-card__media{display:block;width:100%;aspect-ratio:16 / 10;margin:0;padding:0;border:0;border-bottom:1px solid var(--ui-border);background:var(--ui-surface-2);overflow:hidden;color:inherit}.ui-card__media>img{display:block;width:100%;height:100%;object-fit:cover}button.ui-card__media,a.ui-card__media{cursor:pointer}.ui-card__media:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:-2px}.ui-card__body{display:grid;justify-items:start;gap:var(--ui-space-2, 8px);padding:var(--ui-space-3, 12px) var(--ui-space-4, 16px);min-width:0}.ui-card__foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--ui-space-2, 8px);margin-top:auto;padding:0 var(--ui-space-4, 16px) var(--ui-space-3, 12px);color:var(--ui-text-muted);font-size:var(--ui-fs-caption, 13px)}.ui-overlay>.ui-modal{display:flex;flex-direction:column;max-height:calc(100dvh - 40px)}.ui-modal>.ui-modal__head,.ui-modal>.ui-modal__foot{flex:none}.ui-modal>.ui-modal__body{flex:1 1 auto;min-height:0;overflow:auto}.ui-delta{display:inline-flex;flex-wrap:wrap;align-items:baseline;gap:2px;font-size:var(--gemboss-fs-caption);font-weight:600;color:var(--ui-text-muted);font-variant-numeric:tabular-nums}.ui-delta--good{color:var(--ui-success-fg)}.ui-delta--bad{color:var(--ui-danger-fg)}.ui-metrics--grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr));gap:var(--ui-space-3);margin:0}.ui-metric--lg{gap:4px;padding:var(--ui-space-3) var(--ui-space-4)}.ui-metric--lg .ui-metric__val{font-size:24px;line-height:32px}.ui-metric--lg .ui-metric__lbl{order:-1;font-size:var(--ui-fs-body)}.ui-metric__foot{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;font-size:var(--gemboss-fs-caption);color:var(--ui-text-muted)}@media (max-width: 520px){.ui-metrics--grid{grid-template-columns:repeat(2,minmax(0,1fr))}}.ui-funnel{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:var(--ui-space-2);margin:0;padding:0;list-style:none}.ui-funnel>li{position:relative;display:flex;flex-direction:column;gap:2px;padding:var(--ui-space-3);border-radius:var(--ui-radius-md);background:var(--ui-surface-2);min-width:0}.ui-funnel__val{font-size:20px;font-weight:700;color:var(--ui-text);font-variant-numeric:tabular-nums;line-height:24px}.ui-funnel__lbl{font-size:var(--gemboss-fs-caption);color:var(--ui-text-muted);overflow-wrap:anywhere}.ui-funnel__rate{order:-1;font-size:var(--gemboss-fs-caption);font-weight:600;color:var(--ui-series-1);font-variant-numeric:tabular-nums}@media (max-width: 520px){.ui-funnel{grid-auto-flow:row}}.ui-grid{display:grid;gap:var(--ui-space-4);align-items:start}.ui-grid--2{grid-template-columns:repeat(2,minmax(0,1fr))}.ui-grid--3{grid-template-columns:repeat(3,minmax(0,1fr))}@media (max-width: 1100px){.ui-grid--3{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 960px){.ui-grid--2{grid-template-columns:minmax(0,1fr)}}@media (max-width: 720px){.ui-grid--3{grid-template-columns:minmax(0,1fr)}}.ui-section-head{margin:var(--ui-space-4) 0 0}.ui-section-head>h2{margin:0;font-size:14px;line-height:20px;font-weight:650;color:var(--ui-text)}.ui-section-head>p{margin:2px 0 0;font-size:var(--gemboss-fs-caption);color:var(--ui-text-muted)}.ui-seg{max-width:100%;overflow-x:auto}.ui-seg :is(button,a).is-text{flex:none;white-space:nowrap}@media (max-width: 360px){.ui-seg :is(button,a).is-text{padding:0 9px}}.ui-btn--critical:focus-visible{outline-color:var(--gemboss-danger-strong)}@media (pointer: coarse),(max-width: 47.9975em){.ui-btn,.ui-btn.ui-btn--sm,.ui-select.ui-select{min-height:44px}.ui-btn--icon.ui-btn--sm{min-width:44px}.ui-seg :is(button,a){height:44px}}.ui-badge--success{background:var(--gemboss-success-soft);color:var(--gemboss-success-strong)}.ui-badge--warning{background:var(--gemboss-warning-soft);color:var(--gemboss-warning)}.ui-badge--critical{background:var(--gemboss-danger-soft);color:var(--gemboss-danger-strong)}.ui-badge--info{background:var(--gemboss-accent-soft);color:var(--gemboss-accent-strong)}.ui-badge--dot:before{content:"";flex:none;width:6px;height:6px;border-radius:50%;background:currentColor}.ui-banner{--ui-banner-bg: var(--ui-surface-2);--ui-banner-fg: var(--ui-text);border-radius:var(--ui-radius-lg);overflow:hidden;background:var(--ui-surface);color:var(--ui-text);box-shadow:0 0 0 1px var(--ui-border),0 3px 1px -1px #1a1a1a12;font-size:var(--ui-fs-body);line-height:20px}.ui-banner--success{--ui-banner-bg: var(--gemboss-success-soft);--ui-banner-fg: var(--gemboss-success-strong)}.ui-banner--warning{--ui-banner-bg: var(--gemboss-warning-soft);--ui-banner-fg: var(--gemboss-warning)}.ui-banner--critical{--ui-banner-bg: var(--gemboss-danger-soft);--ui-banner-fg: var(--gemboss-danger-strong)}.ui-banner--info{--ui-banner-bg: var(--gemboss-accent-soft);--ui-banner-fg: var(--gemboss-accent-strong)}.ui-banner__head{display:flex;align-items:center;gap:var(--ui-space-2);min-height:32px;padding:6px var(--ui-space-3);background:var(--ui-banner-bg);color:var(--ui-banner-fg)}.ui-banner__icon{flex:none;width:20px;height:20px;fill:currentColor}.ui-banner__title{flex:1 1 auto;min-width:0;margin:0;font-size:var(--ui-fs-body);font-weight:650;line-height:20px}.ui-banner__close{flex:none;display:inline-grid;place-items:center;width:32px;height:32px;margin:-6px -8px -6px 0;border:0;border-radius:var(--ui-radius-md);background:transparent;color:inherit;cursor:pointer}@media (hover: hover){.ui-banner__close:hover{background:color-mix(in srgb,currentColor 10%,transparent)}}.ui-banner__close:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}.ui-banner__close svg{width:16px;height:16px}.ui-banner__body{padding:var(--ui-space-3) var(--ui-space-4)}.ui-banner__body>:first-child{margin-top:0}.ui-banner__body>:last-child{margin-bottom:0}.ui-banner__actions{display:flex;flex-wrap:wrap;gap:var(--ui-space-2);margin-top:var(--ui-space-3)}@media (pointer: coarse),(max-width: 47.9975em){.ui-banner__close{width:44px;height:44px;margin:-12px -12px -12px 0}}.ui-help{margin:var(--ui-space-1) 0 0;font-size:var(--ui-fs-body);line-height:20px;color:var(--ui-text-muted)}.ui-error:empty{display:none}.ui-error{display:flex;gap:6px;margin:var(--ui-space-1) 0 0;font-size:var(--ui-fs-body);line-height:20px;color:var(--gemboss-danger-strong)}.ui-error:before{content:"";flex:none;width:16px;height:16px;margin-top:2px;background:currentColor;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 4h1.5v5.5h-1.5V6Zm.75 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z'/></svg>") center / contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 4h1.5v5.5h-1.5V6Zm.75 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z'/></svg>") center / contain no-repeat}.ui-select[aria-invalid=true],.ui-textarea[aria-invalid=true]{border-color:var(--gemboss-danger-strong);background-color:var(--gemboss-danger-soft)}.ui-choices{display:grid;grid-template-columns:minmax(0,1fr);gap:0;margin:0;padding:0;border:0;min-width:0}.ui-choices>legend{padding:0}.ui-switch>input[type=checkbox]{appearance:none;-webkit-appearance:none;position:relative;width:32px;height:20px;margin:0;border-radius:var(--gemboss-radius-full);background:var(--gemboss-field-line);transition:background-color var(--gemboss-transition-fast) ease}.ui-switch>input[type=checkbox]:before{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--gemboss-surface);box-shadow:0 1px 2px #0003;transition:transform var(--gemboss-transition-fast) ease}.ui-switch>input[type=checkbox]:checked{background:var(--ui-accent)}.ui-switch>input[type=checkbox]:checked:before{transform:translate(12px)}@media (prefers-reduced-motion: reduce){.ui-switch>input[type=checkbox],.ui-switch>input[type=checkbox]:before{transition:none}}.ui-tooltip{position:relative;display:inline-flex}.ui-tooltip__bubble{position:absolute;z-index:30;bottom:calc(100% + 8px);left:50%;transform:translate(-50%);width:max-content;max-width:240px;padding:4px 8px;border-radius:var(--ui-radius-md);background:var(--ui-surface);color:var(--ui-text);font-size:var(--ui-fs-body);line-height:20px;font-weight:450;box-shadow:0 8px 16px -4px #1a1a1a38,0 0 0 1px var(--ui-border);opacity:0;visibility:hidden;pointer-events:none;transition:opacity var(--gemboss-transition-fast) ease}.ui-tooltip--end .ui-tooltip__bubble{left:auto;right:0;transform:none}.ui-tooltip:hover>.ui-tooltip__bubble,.ui-tooltip:focus-within>.ui-tooltip__bubble{opacity:1;visibility:visible}.ui-spinner{display:inline-block;flex:none;width:20px;height:20px;box-sizing:border-box;border-radius:50%;border:2px solid color-mix(in srgb,var(--ui-text) 18%,transparent);border-top-color:var(--ui-text);animation:ui-spin .7s linear infinite;vertical-align:middle}.ui-spinner--lg{width:44px;height:44px;border-width:4px}@keyframes ui-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.ui-spinner{animation-duration:2s}}.ui-progress{appearance:none;-webkit-appearance:none;display:block;width:100%;height:8px;border:0;border-radius:var(--gemboss-radius-full);overflow:hidden;background:var(--gemboss-divider);color:var(--ui-accent)}.ui-progress::-webkit-progress-bar{background:var(--gemboss-divider);border-radius:inherit}.ui-progress::-webkit-progress-value{background:currentColor;border-radius:inherit}.ui-progress::-moz-progress-bar{background:currentColor;border-radius:inherit}.ui-progress--success{color:var(--gemboss-success)}.ui-progress--critical{color:var(--gemboss-danger)}dialog.ui-modal{padding:0;max-width:calc(100% - 40px);max-height:calc(100dvh - 40px);color:var(--ui-text)}dialog.ui-modal[open]{display:flex;flex-direction:column}dialog.ui-modal::backdrop{background:#00000080}html:has(dialog.ui-modal:modal){overflow:hidden}@media (pointer: coarse),(max-width: 47.9975em){.ui-btn.ui-btn--sm{min-width:44px}}.ui-badge--wrap{white-space:normal;overflow-wrap:anywhere;line-height:16px}.ui-page-head--actions{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px 16px}.ui-page-head--actions>:first-child{min-width:0}.ui-page-head__actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-space-2)}.ui-chips>button.ui-tag--chip{min-height:28px;padding:4px 12px;border-radius:var(--ui-radius-md, 8px);cursor:pointer;font-family:inherit;font-size:var(--gemboss-fs-caption, 12px);color:var(--ui-text)}@media (hover: hover){.ui-chips>button.ui-tag--chip:hover{background:var(--ui-surface-2);border-color:var(--ui-text-muted)}}.ui-chips>button.ui-tag--chip:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px}.ui-chips>button.ui-tag--chip[aria-pressed=true]{background:var(--ui-accent-soft);border-color:var(--ui-accent);color:var(--ui-accent-strong);font-weight:600}@media (pointer: coarse),(max-width: 47.9975em){.ui-chips>button.ui-tag--chip{min-height:44px;min-width:44px;justify-content:center}}@media (max-width: 47.9975em){.gemboss-ec-input.gemboss-ec-input textarea{font-size:16px}}:is(.gemboss-field,.ui-textarea)[readonly][readonly]{background:var(--ui-surface-2);border-color:var(--ui-border);cursor:default}.ui-modal>form{display:contents}.ui-modal>form>.ui-modal__head,.ui-modal>form>.ui-modal__foot{flex:none}.ui-modal>form>.ui-modal__body{flex:1 1 auto;min-height:0;overflow:auto}button.ui-metric{font:inherit;text-align:left;color:inherit;cursor:pointer}@media (hover: hover){button.ui-metric:hover{border-color:var(--ui-text-muted)}}button.ui-metric:focus-visible{outline:2px solid var(--ui-focus);outline-offset:1px}.ui-metric.ui-metric:is([aria-pressed=true],[aria-current=page]){border-color:var(--gemboss-accent);box-shadow:inset 0 0 0 1px var(--gemboss-accent)}.ui-more{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;padding:16px 0;color:var(--ui-text-muted);font-size:var(--ui-fs-body);text-align:center}.ui-more[hidden]{display:none}.ui-chip{display:inline-flex;align-items:center;justify-content:center;gap:4px;box-sizing:border-box;height:var(--ui-btn-h, 28px);padding:0 12px;border:1px dashed var(--ui-border);border-radius:var(--ui-radius-md);background:var(--ui-surface);color:var(--ui-text);font:inherit;font-size:var(--ui-fs-caption);font-weight:550;line-height:16px;white-space:nowrap;text-decoration:none;cursor:pointer}@media (hover: hover){.ui-chip:hover{border-style:solid;background:var(--ui-surface-2)}}.ui-chip:focus-visible{outline:2px solid var(--ui-focus);outline-offset:1px}.ui-chip:is([aria-pressed=true],[aria-current=page],[aria-current=true]){border-style:solid;border-color:var(--ui-accent);background:var(--ui-accent-soft);color:var(--ui-accent-strong)}@media (pointer: coarse),(max-width: 47.9975em){.ui-chip{height:auto;min-height:44px;min-width:44px}}.ui-stack{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--ui-space-4)}.ui-stack--tight{gap:var(--ui-space-2)}
|
|
1
|
+
.ui-check{display:inline-flex;align-items:center;gap:var(--ui-space-2);min-height:44px;max-width:100%;overflow-wrap:break-word;cursor:pointer;font-size:var(--ui-fs-body);color:var(--ui-text)}.ui-check>input{flex:none;width:18px;height:18px;margin:0;accent-color:var(--ui-accent);cursor:inherit}.ui-check>input:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.ui-check:has(>input:disabled){opacity:.5;cursor:not-allowed}.ui-check>:last-child:not(input){min-width:0}.ui-label{display:block;margin:0 0 var(--ui-space-1);font-size:var(--ui-fs-caption);font-weight:600;color:var(--ui-text-muted)}.ui-kv{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:var(--ui-space-2) var(--ui-space-4);margin:0;font-size:var(--ui-fs-body)}.ui-kv>dt{color:var(--ui-text-muted)}.ui-kv>dd{margin:0;min-width:0;overflow-wrap:anywhere;color:var(--ui-text)}.ui-link,.ui-prose :where(a:not([class])){color:var(--gemboss-accent-strong, #3a44de);text-decoration:underline;text-decoration-thickness:from-font;text-underline-offset:2px}.ui-link:visited,.ui-prose :where(a:not([class])):visited{color:var(--gemboss-accent-strong, #3a44de)}@media (hover: hover){.ui-link:hover,.ui-prose :where(a:not([class])):hover{color:var(--gemboss-accent, #5661f5);text-decoration-thickness:2px}}.ui-link:focus-visible,.ui-prose :where(a:not([class])):focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:2px;border-radius:2px}.ui-overlay>.ui-modal{display:flex;flex-direction:column;max-height:calc(100dvh - 40px)}.ui-modal>.ui-modal__head,.ui-modal>.ui-modal__foot{flex:none}.ui-modal>.ui-modal__body{flex:1 1 auto;min-height:0;overflow:auto}.ui-delta{display:inline-flex;flex-wrap:wrap;align-items:baseline;gap:2px;font-size:var(--gemboss-fs-caption);font-weight:600;color:var(--ui-text-muted);font-variant-numeric:tabular-nums}.ui-delta--good{color:var(--ui-success-fg)}.ui-delta--bad{color:var(--ui-danger-fg)}.ui-metrics--grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr));gap:var(--ui-space-3);margin:0}.ui-metric--lg{gap:4px;padding:var(--ui-space-3) var(--ui-space-4)}.ui-metric--lg .ui-metric__val{font-size:24px;line-height:32px}.ui-metric--lg .ui-metric__lbl{order:-1;font-size:var(--ui-fs-body)}.ui-metric__foot{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;font-size:var(--gemboss-fs-caption);color:var(--ui-text-muted)}@media (max-width: 520px){.ui-metrics--grid{grid-template-columns:repeat(2,minmax(0,1fr))}}.ui-funnel{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:var(--ui-space-2);margin:0;padding:0;list-style:none}.ui-funnel>li{position:relative;display:flex;flex-direction:column;gap:2px;padding:var(--ui-space-3);border-radius:var(--ui-radius-md);background:var(--ui-surface-2);min-width:0}.ui-funnel__val{font-size:20px;font-weight:700;color:var(--ui-text);font-variant-numeric:tabular-nums;line-height:24px}.ui-funnel__lbl{font-size:var(--gemboss-fs-caption);color:var(--ui-text-muted);overflow-wrap:anywhere}.ui-funnel__rate{order:-1;font-size:var(--gemboss-fs-caption);font-weight:600;color:var(--ui-series-1);font-variant-numeric:tabular-nums}@media (max-width: 520px){.ui-funnel{grid-auto-flow:row}}.ui-grid{display:grid;gap:var(--ui-space-4);align-items:start}.ui-grid--2{grid-template-columns:repeat(2,minmax(0,1fr))}.ui-grid--3{grid-template-columns:repeat(3,minmax(0,1fr))}@media (max-width: 1100px){.ui-grid--3{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 960px){.ui-grid--2{grid-template-columns:minmax(0,1fr)}}@media (max-width: 720px){.ui-grid--3{grid-template-columns:minmax(0,1fr)}}.ui-section-head{margin:var(--ui-space-4) 0 0}.ui-section-head>h2{margin:0;font-size:14px;line-height:20px;font-weight:650;color:var(--ui-text)}.ui-section-head>p{margin:2px 0 0;font-size:var(--gemboss-fs-caption);color:var(--ui-text-muted)}.ui-seg{max-width:100%;overflow-x:auto}.ui-seg :is(button,a).is-text{flex:none;white-space:nowrap}@media (max-width: 360px){.ui-seg :is(button,a).is-text{padding:0 9px}}.ui-btn--critical:focus-visible{outline-color:var(--gemboss-danger-strong)}@media (pointer: coarse),(max-width: 47.9975em){.ui-btn,.ui-btn.ui-btn--sm,.ui-select.ui-select{min-height:44px}.ui-btn--icon.ui-btn--sm{min-width:44px}.ui-seg :is(button,a){height:44px}}.ui-badge--success{background:var(--gemboss-success-soft);color:var(--gemboss-success-strong)}.ui-badge--warning{background:var(--gemboss-warning-soft);color:var(--gemboss-warning)}.ui-badge--critical{background:var(--gemboss-danger-soft);color:var(--gemboss-danger-strong)}.ui-badge--info{background:var(--gemboss-accent-soft);color:var(--gemboss-accent-strong)}.ui-badge--dot:before{content:"";flex:none;width:6px;height:6px;border-radius:50%;background:currentColor}.ui-banner{--ui-banner-bg: var(--ui-surface-2);--ui-banner-fg: var(--ui-text);border-radius:var(--ui-radius-lg);overflow:hidden;background:var(--ui-surface);color:var(--ui-text);box-shadow:0 0 0 1px var(--ui-border),0 3px 1px -1px #1a1a1a12;font-size:var(--ui-fs-body);line-height:20px}.ui-banner--success{--ui-banner-bg: var(--gemboss-success-soft);--ui-banner-fg: var(--gemboss-success-strong)}.ui-banner--warning{--ui-banner-bg: var(--gemboss-warning-soft);--ui-banner-fg: var(--gemboss-warning)}.ui-banner--critical{--ui-banner-bg: var(--gemboss-danger-soft);--ui-banner-fg: var(--gemboss-danger-strong)}.ui-banner--info{--ui-banner-bg: var(--gemboss-accent-soft);--ui-banner-fg: var(--gemboss-accent-strong)}.ui-banner__head{display:flex;align-items:center;gap:var(--ui-space-2);min-height:32px;padding:6px var(--ui-space-3);background:var(--ui-banner-bg);color:var(--ui-banner-fg)}.ui-banner__icon{flex:none;width:20px;height:20px;fill:currentColor}.ui-banner__title{flex:1 1 auto;min-width:0;margin:0;font-size:var(--ui-fs-body);font-weight:650;line-height:20px}.ui-banner__close{flex:none;display:inline-grid;place-items:center;width:32px;height:32px;margin:-6px -8px -6px 0;border:0;border-radius:var(--ui-radius-md);background:transparent;color:inherit;cursor:pointer}@media (hover: hover){.ui-banner__close:hover{background:color-mix(in srgb,currentColor 10%,transparent)}}.ui-banner__close:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}.ui-banner__close svg{width:16px;height:16px}.ui-banner__body{padding:var(--ui-space-3) var(--ui-space-4)}.ui-banner__body>:first-child{margin-top:0}.ui-banner__body>:last-child{margin-bottom:0}.ui-banner__actions{display:flex;flex-wrap:wrap;gap:var(--ui-space-2);margin-top:var(--ui-space-3)}@media (pointer: coarse),(max-width: 47.9975em){.ui-banner__close{width:44px;height:44px;margin:-12px -12px -12px 0}}.ui-help{margin:var(--ui-space-1) 0 0;font-size:var(--ui-fs-body);line-height:20px;color:var(--ui-text-muted)}.ui-error:empty{display:none}.ui-error{display:flex;gap:6px;margin:var(--ui-space-1) 0 0;font-size:var(--ui-fs-body);line-height:20px;color:var(--gemboss-danger-strong)}.ui-error:before{content:"";flex:none;width:16px;height:16px;margin-top:2px;background:currentColor;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 4h1.5v5.5h-1.5V6Zm.75 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z'/></svg>") center / contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 4h1.5v5.5h-1.5V6Zm.75 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z'/></svg>") center / contain no-repeat}.ui-select[aria-invalid=true],.ui-textarea[aria-invalid=true]{border-color:var(--gemboss-danger-strong);background-color:var(--gemboss-danger-soft)}.ui-choices{display:grid;grid-template-columns:minmax(0,1fr);gap:0;margin:0;padding:0;border:0;min-width:0}.ui-choices>legend{padding:0}.ui-switch>input[type=checkbox]{appearance:none;-webkit-appearance:none;position:relative;width:32px;height:20px;margin:0;border-radius:var(--gemboss-radius-full);background:var(--gemboss-field-line);transition:background-color var(--gemboss-transition-fast) ease}.ui-switch>input[type=checkbox]:before{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--gemboss-surface);box-shadow:0 1px 2px #0003;transition:transform var(--gemboss-transition-fast) ease}.ui-switch>input[type=checkbox]:checked{background:var(--ui-accent)}.ui-switch>input[type=checkbox]:checked:before{transform:translate(12px)}@media (prefers-reduced-motion: reduce){.ui-switch>input[type=checkbox],.ui-switch>input[type=checkbox]:before{transition:none}}.ui-tooltip{position:relative;display:inline-flex}.ui-tooltip__bubble{position:absolute;z-index:30;bottom:calc(100% + 8px);left:50%;transform:translate(-50%);width:max-content;max-width:240px;padding:4px 8px;border-radius:var(--ui-radius-md);background:var(--ui-surface);color:var(--ui-text);font-size:var(--ui-fs-body);line-height:20px;font-weight:450;box-shadow:0 8px 16px -4px #1a1a1a38,0 0 0 1px var(--ui-border);opacity:0;visibility:hidden;pointer-events:none;transition:opacity var(--gemboss-transition-fast) ease}.ui-tooltip--end .ui-tooltip__bubble{left:auto;right:0;transform:none}.ui-tooltip:hover>.ui-tooltip__bubble,.ui-tooltip:focus-within>.ui-tooltip__bubble{opacity:1;visibility:visible}.ui-spinner{display:inline-block;flex:none;width:20px;height:20px;box-sizing:border-box;border-radius:50%;border:2px solid color-mix(in srgb,var(--ui-text) 18%,transparent);border-top-color:var(--ui-text);animation:ui-spin .7s linear infinite;vertical-align:middle}.ui-spinner--lg{width:44px;height:44px;border-width:4px}@keyframes ui-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.ui-spinner{animation-duration:2s}}.ui-progress{appearance:none;-webkit-appearance:none;display:block;width:100%;height:8px;border:0;border-radius:var(--gemboss-radius-full);overflow:hidden;background:var(--gemboss-divider);color:var(--ui-accent)}.ui-progress::-webkit-progress-bar{background:var(--gemboss-divider);border-radius:inherit}.ui-progress::-webkit-progress-value{background:currentColor;border-radius:inherit}.ui-progress::-moz-progress-bar{background:currentColor;border-radius:inherit}.ui-progress--success{color:var(--gemboss-success)}.ui-progress--critical{color:var(--gemboss-danger)}dialog.ui-modal{padding:0;max-width:calc(100% - 40px);max-height:calc(100dvh - 40px);color:var(--ui-text)}dialog.ui-modal[open]{display:flex;flex-direction:column}dialog.ui-modal::backdrop{background:#1f1e1d38;-webkit-backdrop-filter:blur(14px) saturate(1.4);backdrop-filter:blur(14px) saturate(1.4)}html:has(dialog.ui-modal:modal){overflow:hidden}@media (pointer: coarse),(max-width: 47.9975em){.ui-btn.ui-btn--sm{min-width:44px}}.ui-badge--wrap{white-space:normal;overflow-wrap:anywhere;line-height:16px}.ui-page-head--actions{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px 16px}.ui-page-head--actions>:first-child{min-width:0}.ui-page-head__actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-space-2)}.ui-chips>button.ui-tag--chip{min-height:28px;padding:4px 12px;border-radius:var(--ui-radius-md, 8px);cursor:pointer;font-family:inherit;font-size:var(--gemboss-fs-caption, 12px);color:var(--ui-text)}@media (hover: hover){.ui-chips>button.ui-tag--chip:hover{background:var(--ui-surface-2);border-color:var(--ui-text-muted)}}.ui-chips>button.ui-tag--chip:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px}.ui-chips>button.ui-tag--chip[aria-pressed=true]{background:var(--ui-accent-soft);border-color:var(--ui-accent);color:var(--ui-accent-strong);font-weight:600}@media (pointer: coarse),(max-width: 47.9975em){.ui-chips>button.ui-tag--chip{min-height:44px;min-width:44px;justify-content:center}}@media (max-width: 47.9975em){.gemboss-ec-input.gemboss-ec-input textarea{font-size:16px}}:is(.gemboss-field,.ui-textarea)[readonly][readonly]{background:var(--ui-surface-2);border-color:var(--ui-border);cursor:default}.ui-modal>form{display:contents}.ui-modal>form>.ui-modal__head,.ui-modal>form>.ui-modal__foot{flex:none}.ui-modal>form>.ui-modal__body{flex:1 1 auto;min-height:0;overflow:auto}button.ui-metric{font:inherit;text-align:left;color:inherit;cursor:pointer}@media (hover: hover){button.ui-metric:hover{border-color:var(--ui-text-muted)}}button.ui-metric:focus-visible{outline:2px solid var(--ui-focus);outline-offset:1px}.ui-metric.ui-metric:is([aria-pressed=true],[aria-current=page]){border-color:var(--gemboss-accent);box-shadow:inset 0 0 0 1px var(--gemboss-accent)}.ui-more{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;padding:16px 0;color:var(--ui-text-muted);font-size:var(--ui-fs-body);text-align:center}.ui-more[hidden]{display:none}.ui-chip{display:inline-flex;align-items:center;justify-content:center;gap:4px;box-sizing:border-box;height:var(--ui-btn-h, 28px);padding:0 12px;border:1px dashed var(--ui-border);border-radius:var(--ui-radius-md);background:var(--ui-surface);color:var(--ui-text);font:inherit;font-size:var(--ui-fs-caption);font-weight:550;line-height:16px;white-space:nowrap;text-decoration:none;cursor:pointer}@media (hover: hover){.ui-chip:hover{border-style:solid;background:var(--ui-surface-2)}}.ui-chip:focus-visible{outline:2px solid var(--ui-focus);outline-offset:1px}.ui-chip:is([aria-pressed=true],[aria-current=page],[aria-current=true]){border-style:solid;border-color:var(--ui-accent);background:var(--ui-accent-soft);color:var(--ui-accent-strong)}@media (pointer: coarse),(max-width: 47.9975em){.ui-chip{height:auto;min-height:44px;min-width:44px}}.ui-stack{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--ui-space-4)}.ui-stack--tight{gap:var(--ui-space-2)}
|
package/src/kit-plain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(g){"use strict";if(g.gembossUI)return;var X='<svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M5 5l10 10M15 5L5 15" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" fill="none"/></svg>',we='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, iframe, [tabindex]:not([tabindex="-1"])',qe=function(e){return Array.prototype.slice.call(e.querySelectorAll(we)).filter(function(t){return!t.matches('[tabindex="-1"]')&&(t.checkVisibility?t.checkVisibility({visibilityProperty:!0}):t.getClientRects().length>0)})},E=function(e){return String(e).replace(/[&<>"']/g,function(t){return{"&":"&","<":"<",">":">",'"':""","'":"'"}[t]})},m=[],Ce=0,H=null;function z(e){var t=e.title||"",r=e.label||"",n=e.closeLabel||"Close",a=document.activeElement,i=document.createElement("div");i.className="ui-overlay"+(e.overlayClass?" "+e.overlayClass:""),i.setAttribute("role","presentation");var l="gb-modal-title-"+ ++Ce;i.innerHTML='<div class="ui-modal'+(e.className?" "+e.className:"")+'" role="dialog" aria-modal="true" '+(t?'aria-labelledby="'+l+'"':'aria-label="'+E(r)+'"')+' tabindex="-1">'+(t?'<div class="ui-modal__head"><div class="ui-modal__title" id="'+l+'">'+t+'</div><button type="button" class="ui-modal__close" aria-label="'+E(n)+'">'+X+"</button></div>":"")+(e.body||"")+(e.foot?'<div class="ui-modal__foot">'+e.foot+"</div>":"")+"</div>";var u=i.firstChild,s=!1,c={panel:u,overlay:i,close:function(d,b){var A=b&&b.force;return m.indexOf(c)<0?Promise.resolve():!A&&e.beforeClose?s?Promise.resolve():(s=!0,Promise.resolve().then(function(){return e.beforeClose(d)}).catch(function(L){return console.error(L),!1}).then(function(L){s=!1,L&&m.indexOf(c)>=0&&f(d)})):(f(d),Promise.resolve())}};function f(d){m.splice(m.indexOf(c),1),removeEventListener("keydown",v),i.remove();var b=m[m.length-1];b||(document.body.style.overflow=H||"",H=null),a&&a.isConnected&&a.focus&&(!b||b.panel.contains(a))?a.focus():b&&b.panel.focus(),e.onClose&&e.onClose(d)}function v(d){if(!(d===S||m[m.length-1]!==c)){if(d.key==="Escape"){if(d.isComposing||d.keyCode===229)return;d.preventDefault(),c.close(null);return}if(d.key==="Tab"){var b=qe(u);if(b.length){var A=b[0],L=b[b.length-1];u.contains(document.activeElement)?!d.shiftKey&&document.activeElement===L?(d.preventDefault(),A.focus()):d.shiftKey&&document.activeElement===A&&(d.preventDefault(),L.focus()):(d.preventDefault(),A.focus())}}}}var h=!1;i.addEventListener("mousedown",function(d){h=d.target===i}),i.addEventListener("click",function(d){d.target===i&&h&&c.close(null),h=!1});var p=u.querySelector(".ui-modal__head .ui-modal__close");p&&(p.onclick=function(){c.close(null)});var S=window.event;addEventListener("keydown",v),m.length||(H=document.body.style.overflow),m.push(c);var O=document.body;try{for(var k=document.querySelectorAll("dialog[open]"),y=k.length-1;y>=0;y--)if(k[y].matches(":modal")){O=k[y];break}}catch{}return O.append(i),document.body.style.overflow="hidden",setTimeout(function(){(u.querySelector("[autofocus]")||u).focus()},0),c}function Me(e,t){t=t||{};var r=document.querySelector(".gemboss-toast-viewport"),n=!r;r||(r=document.createElement("div"),r.className="gemboss-toast-viewport",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),document.body.append(r));var a=document.createElement("div");a.className="gemboss-toast"+(t.error?" is-error":""),t.error&&a.setAttribute("role","alert");var i=document.createElement("span");i.className="gemboss-toast-text",i.textContent=String(e),a.append(i);var l=t.duration===0;if(l){var u=document.createElement("button");u.type="button",u.className="gemboss-toast-dismiss",u.setAttribute("aria-label",t.dismissLabel||"Dismiss"),u.innerHTML=X,u.onclick=function(){a.remove()},a.append(u)}n&&(r.dataset.readyAt=String(Date.now()+50));var s=Math.max(0,Number(r.dataset.readyAt||0)-Date.now()),c=function(){r.append(a)};return s||r._gbQueue?((r._gbQueue=r._gbQueue||[]).push(c),r._gbFlush||(r._gbFlush=setTimeout(function(){var f=r._gbQueue;r._gbQueue=null,r._gbFlush=null,f.forEach(function(v){v()})},s))):c(),l||setTimeout(function(){a.remove()},s+(t.duration||(t.error?6e3:3500))),a}var G=!1,J="details.ui-menu, details.gb-account",Y=".ui-menu__item, .gemboss-account-menu-item";function F(e){document.querySelectorAll("details.ui-menu[open], details.gb-account[open]").forEach(function(t){t!==e&&!(e&&t.contains(e))&&(t.open=!1)})}function Te(){G||(G=!0,document.addEventListener("click",function(e){var t=e.target.closest&&e.target.closest(Y),r=t&&t.closest(J);r&&r.open&&r.contains(document.activeElement)&&r.querySelector("summary").focus()},!0),document.addEventListener("click",function(e){var t=e.target.closest&&e.target.closest(J);F(t),t&&e.target.closest(Y)&&(t.open=!1)}),addEventListener("blur",function(){F()}),addEventListener("keydown",function(e){var t=e.key==="Escape"&&!e.isComposing&&document.querySelector("details.ui-menu[open], details.gb-account[open]");if(t){e.preventDefault(),e.stopImmediatePropagation(),t.open=!1;var r=t.querySelector("summary");r&&r.focus()}},!0))}var j=!1,Z=typeof HTMLElement<"u"&&Object.prototype.hasOwnProperty.call(HTMLElement.prototype,"popover");function R(e){return{list:e.querySelector(":scope > .ui-menu__list"),button:e.querySelector(":scope > summary")}}function ee(e,t,r){e.style.maxHeight="",e.style.left="0px",e.style.top="0px";var n=t.getBoundingClientRect(),a=document.documentElement.clientWidth,i=g.innerHeight,l=e.offsetWidth,u=e.offsetHeight,s=i-n.bottom-4-8,c=n.top-4-8,f;u<=s||s>=c?(f=n.bottom+4,u>s&&(e.style.maxHeight=Math.max(s,0)+"px"),e.setAttribute("data-side","bottom")):(u>c&&(e.style.maxHeight=Math.max(c,0)+"px"),f=n.top-4-Math.min(u,c),e.setAttribute("data-side","top"));var v=r?n.right-l:n.left;v=Math.max(8,Math.min(v,a-l-8)),e.style.left=Math.round(v)+"px",e.style.top=Math.round(f)+"px"}function B(e){var t=R(e),r=t.list,n=t.button;!r||!n||!e.open||!Z||(r.getAttribute("popover")!=="manual"&&r.setAttribute("popover","manual"),r.matches(":popover-open")||r.showPopover(),ee(r,n,e.classList.contains("ui-menu--end")))}function Ne(e){var t=R(e).list;t&&t.hasAttribute("popover")&&t.matches(":popover-open")&&t.hidePopover()}function te(e){e&&e.closest&&e.closest(".ui-menu__list")||document.querySelectorAll("details.ui-menu[open]").forEach(function(t){var r=R(t).list;!r||!r.matches(":popover-open")||(!e||e.nodeType===9||e.contains&&e.contains(t))&&(t.open=!1)})}function re(){var e=document.documentElement;e.getAttribute("data-gb-menus")!=="float"&&e.setAttribute("data-gb-menus","float")}function ne(){j||!Z||typeof document>"u"||(j=!0,addEventListener("click",function(e){var t=e.target;t&&t.closest&&t.closest("details.ui-menu > summary")&&re()},!0),document.querySelectorAll("details.ui-menu[open]").forEach(B),document.addEventListener("toggle",function(e){var t=e.target;!t||!t.matches||!t.matches("details.ui-menu")||(t.open?(re(),B(t)):Ne(t))},!0),document.addEventListener("scroll",function(e){te(e.target)},!0),addEventListener("resize",function(){te(null)}))}ne();function Oe(e){e=e||{};var t=e.tone==="critical";return new Promise(function(r){var n=z({title:E(e.title||""),label:e.title?"":e.label||"Confirm",closeLabel:e.closeLabel||e.cancelLabel,body:e.body?'<div class="ui-modal__body">'+E(e.body)+"</div>":"",foot:'<button type="button" class="ui-btn" data-gb-confirm="0"'+(t?" autofocus":"")+">"+E(e.cancelLabel||"Cancel")+'</button><button type="button" class="ui-btn ui-btn--primary'+(t?" ui-btn--critical":"")+'" data-gb-confirm="1"'+(t?"":" autofocus")+">"+E(e.confirmLabel||"OK")+"</button>",onClose:function(a){r(a===!0)}});n.panel.querySelectorAll("[data-gb-confirm]").forEach(function(a){a.onclick=function(){n.close(a.getAttribute("data-gb-confirm")==="1")}})})}var ae=!1;function De(){if(!ae){ae=!0;var e=function(){return document.querySelector(".gemboss-platform-shell")},t=function(n){var a=e();if(a){a.classList.toggle("is-mobile-nav-open",n);var i=a.querySelector(".gemboss-mobile-nav-backdrop");i&&(i.tabIndex=n?0:-1);var l=a.querySelector(".gemboss-mobile-menu-btn");if(l){var u=a.querySelector(".icon-nav[id]");u&&!l.hasAttribute("aria-controls")&&l.setAttribute("aria-controls",u.id),l.setAttribute("aria-expanded",String(n));var s=l.getAttribute(n?"data-label-close":"data-label-open");s&&l.setAttribute("aria-label",s)}}},r=function(){var n=e();return!!n&&n.classList.contains("is-mobile-nav-open")};document.addEventListener("click",function(n){var a=n.target;a.closest&&(a.closest(".gemboss-mobile-menu-btn")?t(!r()):(a.closest(".gemboss-mobile-nav-backdrop")||a.closest(".icon-nav .gnav-item, .icon-nav .gnav-subitem"))&&t(!1))}),addEventListener("keydown",function(n){n.key==="Escape"&&!n.isComposing&&n.keyCode!==229&&r()&&!m.length&&t(!1)}),addEventListener("gemboss:assistant-docked",function(){t(!1)}),t(r())}}var ie=!1,oe="M3 17 17 3";function le(e){return document.getElementById(e.getAttribute("aria-controls")||"")||e.parentNode&&e.parentNode.querySelector("input")}function ue(e,t){var r=le(e);if(r){r.type=t?"text":"password";var n=t?e.getAttribute("data-label-hide")||"Hide password":e.getAttribute("data-label-show")||"Show password";e.setAttribute("aria-label",n),e.setAttribute("title",n);var a=e.querySelector("svg"),i=a&&a.querySelector('path[d="'+oe+'"]');if(a&&t&&!i){var l=document.createElementNS("http://www.w3.org/2000/svg","path");l.setAttribute("d",oe),a.append(l)}i&&!t&&i.remove()}}function Pe(){ie||(ie=!0,document.addEventListener("click",function(e){var t=e.target.closest&&e.target.closest(".gb-auth-pw-toggle"),r=t&&le(t);r&&ue(t,r.type==="password")}))}function Ke(){document.querySelectorAll(".gb-auth-pw-toggle").forEach(function(e){ue(e,!1)})}var ce=!1;function He(){ce||(ce=!0,document.addEventListener("keydown",function(e){var t=document.querySelector(".gemboss-topbar-search-input");if(t){var r=e.target,n=r&&(r.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(r.tagName));(e.key==="k"||e.key==="K")&&(e.metaKey||e.ctrlKey)&&!e.altKey?(e.preventDefault(),t.focus(),t.select()):e.key==="/"&&!n&&!e.metaKey&&!e.ctrlKey&&!e.altKey?(e.preventDefault(),t.focus()):e.key==="Escape"&&r===t&&t.blur()}}))}var Fe=120,Re=15e3,Be=typeof HTMLScriptElement<"u"&&!!HTMLScriptElement.supports&&HTMLScriptElement.supports("speculationrules"),se=!1,I=0,de=0,D=null,fe={},be=!1;function x(e){var t=e&&e.closest?e.closest("a[href]"):null;if(!t||!(t.matches(".gnav-item, .gnav-subitem")||t.hasAttribute("data-gb-pending"))||t.getAttribute("data-gb-nav")==="next"||t.closest('[data-gb-nav="off"]')||t.target&&t.target!=="_self"||t.hasAttribute("download"))return null;var r;try{r=new URL(t.href,location.href)}catch{return null}return r.origin!==location.origin||!/^https?:$/.test(r.protocol)||r.pathname===location.pathname&&r.search===location.search&&(r.hash||(t.getAttribute("href")||"").indexOf("#")>-1)?null:t}function w(){clearTimeout(de),document.querySelectorAll("[data-gb-busy]").forEach(function(e){e.removeAttribute("data-gb-busy"),e.removeAttribute("aria-busy");var t=e.querySelector(":scope > .gb-pending-mark");t&&t.remove()})}function Ie(e){if(w(),e.setAttribute("data-gb-busy",""),e.setAttribute("aria-busy","true"),e.hasAttribute("data-gb-pending")){var t=document.createElement("span");t.className="gb-pending-mark",t.setAttribute("role","status"),t.innerHTML='<span class="ui-sr-only">'+E(e.getAttribute("data-gb-pending-label")||"Loading")+"</span>",e.appendChild(t)}de=setTimeout(w,Re)}function ve(e){if(!(be||g.next||g.__next_f||g.__NEXT_DATA__||e.closest('[data-gb-prefetch="off"]'))){var t=navigator.connection;if(!(t&&t.saveData)){var r=new URL(e.href,location.href);r.hash="";var n=r.href;if(!(fe[n]||r.pathname===location.pathname&&r.search===location.search)){fe[n]=!0;var a;Be?(a=document.createElement("script"),a.type="speculationrules",a.textContent=JSON.stringify({prefetch:[{source:"list",urls:[n]}]})):(a=document.createElement("link"),a.rel="prefetch",a.href=n),a.setAttribute("data-gb-prefetched",""),document.head.appendChild(a)}}}}function me(){if(!(se||typeof document>"u")){se=!0,addEventListener("click",function(r){if(!(r.button!==0||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey)){var n=x(r.target);if(n){if(r.defaultPrevented){be=!0;return}Ie(n)}}});var e=function(r){r!==D&&(clearTimeout(I),D=r,r&&(I=setTimeout(function(){D===r&&ve(r)},Fe)))},t=null;document.addEventListener("mousedown",function(r){t=x(r.target),t&&t===D&&clearTimeout(I)}),document.addEventListener("mouseover",function(r){e(x(r.target))}),document.addEventListener("focusin",function(r){var n=x(r.target);n&&n===t||e(n)}),document.addEventListener("touchstart",function(r){var n=x(r.target);n&&ve(n)},{passive:!0}),addEventListener("pageshow",w),addEventListener("keydown",function(r){r.key==="Escape"&&w()}),g.navigation&&g.navigation.addEventListener&&g.navigation.addEventListener("navigateerror",w)}}me();var Ue='a[href], button, input, select, textarea, label, summary, details, dialog, [role="dialog"], [role="menu"], [role="button"], [role="menuitem"], [role="checkbox"], [contenteditable="true"], [contenteditable=""], [data-row-ignore], .ui-table__check',pe='details[open], dialog[open], [role="dialog"], [role="menu"]';function Ve(e,t){return t&&t.closest&&t.closest(pe)?!0:Array.prototype.some.call(e.querySelectorAll(pe),function(r){return r.checkVisibility?r.checkVisibility():r.getClientRects().length>0})}var ge=!1,q=null,U=".ui-index, .ui-resource";function We(e){for(var t=e.getAttribute("data-href"),r=e.querySelectorAll("a[href]"),n=0;n<r.length;n++)if(r[n].getAttribute("href")===t)return r[n];return null}function he(e){if(!(e.defaultPrevented||e.button>1||!e.target.closest)){var t=e.target.closest("[data-href]");if(t){var r=e.target.closest(Ue);if(!(r&&t.contains(r))){var n=g.getSelection?g.getSelection():null;if(!(n&&!n.isCollapsed&&n.anchorNode&&t.contains(n.anchorNode))){var a=We(t),i=a?a.href:new URL(t.getAttribute("data-href"),location.href).href;if(e.metaKey||e.ctrlKey||e.shiftKey||e.button===1){g.open(i,"_blank","noopener");return}a?a.click():location.assign(i)}}}}}function ye(e){var t=[];return e.querySelectorAll("input[data-gb-select]").forEach(function(r){r.checked&&t.push(r.value)}),t}function C(e){var t=e.querySelectorAll("input[data-gb-select]"),r=0;t.forEach(function(i){var l=i.closest("tr, .ui-list__item, [data-href]");i.checked&&r++,l&&(l.classList.toggle("is-selected",i.checked),l.matches(".ui-list__item")||l.setAttribute("aria-selected",i.checked?"true":"false"))}),e.querySelectorAll("input[data-gb-select-all]").forEach(function(i){i.checked=r>0&&r===t.length,i.indeterminate=r>0&&r<t.length});var n=e.querySelector(".ui-bulkbar");n&&e.matches(".ui-resource")?n.querySelectorAll(".ui-bulkbar__actions button").forEach(function(i){i.disabled=r===0}):n&&(n.hidden=r===0);var a=e.querySelector("[data-gb-count]");a&&(a.textContent=(a.getAttribute("data-gb-count")||"{n} selected").replace("{n}",r)),e.dispatchEvent(new CustomEvent("gb:selection",{bubbles:!0,detail:{ids:ye(e),total:t.length}}))}function Ae(e){e.querySelectorAll("input[data-gb-select]").forEach(function(t){t.checked=!1}),C(e)}function Ee(e){if(!e)return"";var t=e.getAttribute("data-sort-value");return t??e.textContent.trim()}function Qe(e){var t=e.closest("th"),r=e.closest("table");if(!(!t||!r)){var n=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending";if(r.querySelectorAll("thead th[aria-sort]").forEach(function(c){c!==t&&c.setAttribute("aria-sort","none")}),t.setAttribute("aria-sort",n),r.getAttribute("data-gb-sort")!=="client"){r.dispatchEvent(new CustomEvent("gb:sort",{bubbles:!0,detail:{key:t.getAttribute("data-key"),direction:n}}));return}var a=Array.prototype.indexOf.call(t.parentElement.children,t),i=r.tBodies[0];if(i){var l=Array.prototype.slice.call(i.rows),u=n==="ascending"?1:-1,s=function(c){var f=String(c).replace(/[\s,%$€£¥]/g,"");return f!==""&&!isNaN(+f)?+f:null};l.sort(function(c,f){var v=Ee(c.cells[a]),h=Ee(f.cells[a]),p=s(v),S=s(h);return u*(p!=null&&S!=null?p-S:String(v).localeCompare(String(h),void 0,{numeric:!0,sensitivity:"base"}))}),l.forEach(function(c){i.appendChild(c)})}}}function $e(e){return Array.prototype.slice.call(e.querySelectorAll(":scope > .ui-board__col[data-col]"))}function M(e){return Array.prototype.slice.call(e.querySelectorAll("li[data-id]")).filter(function(t){return t.closest(".ui-board__col")===e})}function V(e){var t=e.getAttribute("data-name")||(e.querySelector(".ui-card__link, h2, h3, h4")||e).textContent||"";return t.trim().replace(/\s+/g," ").slice(0,80)||"Card"}function P(e){var t=e.querySelector(".ui-board__name");return(t&&t.textContent||e.getAttribute("data-col")||"").trim()}function _(e,t){var r=e.querySelector(":scope > [data-gb-live]");r||(r=document.createElement("div"),r.className="ui-sr-only",r.setAttribute("aria-live","assertive"),r.setAttribute("data-gb-live",""),e.appendChild(r)),r.textContent="",setTimeout(function(){r.textContent=t},30)}function _e(e,t){var r=e.querySelector(".ui-board__count"),n=r?parseInt(r.textContent,10):NaN;r&&String(n)===r.textContent.trim()&&(r.textContent=String(n+t))}function Xe(e,t,r,n){var a=t.closest(".ui-board__col"),i=M(r).filter(function(f){return f!==t});if(n<i.length)i[n].parentNode.insertBefore(t,i[n]);else if(i.length){var l=i[i.length-1];l.parentNode.insertBefore(t,l.nextSibling)}else{var u=r.querySelector("ol.ui-board__list");if(!u){u=document.createElement("ol"),u.className="ui-board__list";var s=r.querySelector(":scope > .ui-board__empty");s?s.replaceWith(u):r.querySelector(".ui-board__head").after(u)}u.appendChild(t)}if(a!==r&&(_e(a,-1),_e(r,1),!M(a).length&&!a.querySelector(".ui-board__next a[data-gb-more]"))){var c=document.createElement("p");c.className="ui-board__empty",c.textContent=e.getAttribute("data-empty-label")||"Nothing here",a.querySelectorAll(":scope > ol.ui-board__list, :scope > details.ui-board__more").forEach(function(f){f.remove()}),a.querySelector(".ui-board__head").after(c)}}var o=null;function T(e){return M(e).filter(function(t){return!o||t!==o.li})}function W(e){e.querySelectorAll("[data-gb-drop]").forEach(function(t){t.removeAttribute("data-gb-drop")}),e.querySelectorAll("[data-gb-over]").forEach(function(t){t.removeAttribute("data-gb-over")})}function Q(){if(o){W(o.b),o.to.setAttribute("data-gb-over","");var e=T(o.to),t=o.index<e.length?e[o.index]:e[e.length-1];if(t){t.setAttribute("data-gb-drop",o.index<e.length?"before":"after");var r=t.closest("details:not([open])");r&&o.b.contains(r)&&(r.open=!0),o.keys&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}}function K(){return o?P(o.to)+", position "+(o.index+1)+" of "+(T(o.to).length+1):""}function $(){o&&(o.li.removeAttribute("data-gb-lifted"),o.b.removeAttribute("data-gb-dragging"),W(o.b),o=null)}function Se(e,t,r){var n=t.closest(".ui-board__col");if(!(!n||!t.getAttribute("data-id"))){var a=M(n).indexOf(t);o={b:e,li:t,id:t.getAttribute("data-id"),from:n,to:n,index:a,origin:a,keys:r},t.setAttribute("data-gb-lifted",r?"key":"drag"),r&&(Q(),_(e,"Picked up "+V(t)+". "+K()+". Arrow keys move it, Space drops it, Escape cancels."))}}function ke(){if(o){var e=o,t=V(e.li),r=e.to===e.from&&e.index===e.origin,n=K();if($(),r){_(e.b,t+" dropped where it was, in "+P(e.from)+".");return}var a=new CustomEvent("gb:move",{bubbles:!0,cancelable:!0,detail:{id:e.id,from:e.from.getAttribute("data-col"),to:e.to.getAttribute("data-col"),index:e.index}}),i=e.b.dispatchEvent(a);if(i&&Xe(e.b,e.li,e.to,e.index),_(e.b,"Moved "+t+" to "+n+"."),e.keys){var l=10,u=function(){var s=Array.prototype.slice.call(e.b.querySelectorAll("li[data-id]")).filter(function(c){return c.getAttribute("data-id")===e.id})[0];s&&document.activeElement!==s?s.focus():!s&&l-- >0&&requestAnimationFrame(u)};requestAnimationFrame(u)}}}function N(e){if(o){var t=o;$(),t.keys&&_(t.b,(e||"")+V(t.li)+" stays in "+P(t.from)+".")}}function Le(e){var t=e&&e.closest?e.closest(".ui-board[data-gb-move]"):null;return t}function ze(e){var t=Le(e.target),r=t&&e.target.closest("li[data-id]");if(!(!r||!t.contains(r)||t.__gbMoveOn)){if(!o){(e.key===" "||e.key==="Spacebar")&&e.target===r&&(e.preventDefault(),Se(t,r,!0));return}if(!(o.li!==r||!o.keys)){var n=$e(t);if(e.key==="ArrowUp"||e.key==="ArrowDown")e.preventDefault(),o.index=Math.max(0,Math.min(T(o.to).length,o.index+(e.key==="ArrowUp"?-1:1)));else if(e.key==="ArrowLeft"||e.key==="ArrowRight"){e.preventDefault();var a=n.indexOf(o.to)+(e.key==="ArrowLeft"?-1:1);if(a<0||a>=n.length){_(t,K()+". No column further "+(e.key==="ArrowLeft"?"left":"right")+".");return}o.to=n[a],o.index=Math.min(o.index,T(o.to).length)}else if(e.key===" "||e.key==="Spacebar"||e.key==="Enter"){e.preventDefault(),ke();return}else if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),N("Move cancelled. ");return}else if(e.key==="Tab"){N("Move cancelled. ");return}else return;Q(),_(t,K())}}}function Ge(e){var t=e.closest(".ui-board__col"),r=e.closest(".ui-board"),n=e.closest(".ui-board__next")||e.parentNode;if(!(!t||!r||n.getAttribute("aria-busy")==="true")){var a=t.getAttribute("data-col"),i=e.href;n.setAttribute("aria-busy","true"),n.innerHTML='<span class="ui-spinner" aria-hidden="true"></span><span role="status">Loading\u2026</span>',fetch(i,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(function(l){if(!l.ok)throw new Error(String(l.status));return l.text()}).then(function(l){var u=new DOMParser().parseFromString(l,"text/html"),s=r.id?u.getElementById(r.id):u,c=Array.prototype.slice.call((s||u).querySelectorAll(".ui-board__col[data-col]")).filter(function(b){return b.getAttribute("data-col")===a})[0];if(!c)throw new Error("no column "+a);var f={};r.querySelectorAll("li[data-id]").forEach(function(b){f[b.getAttribute("data-id")]=1});var v=t.querySelector(":scope > ol.ui-board__list");if(!v){v=document.createElement("ol"),v.className="ui-board__list";var h=t.querySelector(":scope > .ui-board__empty");h?h.replaceWith(v):n.before(v)}var p=M(c).filter(function(b){return!f[b.getAttribute("data-id")]}).map(function(b){var A=document.importNode(b,!0);return v.appendChild(A),A}),S=c.querySelector(".ui-board__count"),O=t.querySelector(".ui-board__count");S&&O&&(O.textContent=S.textContent);var k=c.querySelector(".ui-board__next");k&&k.querySelector("a[data-gb-more]")?(n.innerHTML=k.innerHTML,n.removeAttribute("aria-busy")):n.remove();try{history.replaceState(history.state,"",i)}catch{}_(r,p.length+" more "+(p.length===1?"card":"cards")+" in "+P(t)+".");var y=p[0];if(y){var d=y.matches("[tabindex]")?y:y.querySelector("a[href], button, [tabindex]");d&&d.focus({preventScroll:!1})}}).catch(function(){n.removeAttribute("aria-busy"),n.innerHTML=`<span role="alert" class="ui-more__error">Couldn't load.</span>`;var l=document.createElement("a");l.className="ui-btn ui-btn--sm",l.href=i,l.setAttribute("data-gb-more",""),l.textContent="Try again",n.appendChild(l),l.focus()})}}function xe(){if(!(ge||typeof document>"u")){ge=!0,document.addEventListener("keydown",ze),document.addEventListener("focusout",function(t){o&&o.keys&&t.target===o.li&&!o.li.contains(t.relatedTarget)&&N("Move cancelled. ")}),document.addEventListener("dragstart",function(t){var r=Le(t.target),n=r&&t.target.closest("li[data-id]");!n||!r.contains(n)||r.__gbMoveOn||!t.dataTransfer||(o&&$(),Se(r,n,!1),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",n.getAttribute("data-id")||""),requestAnimationFrame(function(){o&&r.setAttribute("data-gb-dragging","")}))});var e=function(t){var r=t.target.closest?t.target.closest(".ui-board__col[data-col]"):null;if(!r||!o||!o.b.contains(r))return null;for(var n=T(r),a=n.length,i=0;i<n.length;i++){var l=n[i].getBoundingClientRect();if(l.height){if(t.clientY<l.top+l.height/2){a=i;break}a=i+1}}return{col:r,index:a}};document.addEventListener("dragover",function(t){if(!(!o||o.keys)){var r=e(t);r&&(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),(r.col!==o.to||r.index!==o.index||!o.b.querySelector("[data-gb-over]"))&&(o.to=r.col,o.index=r.index,Q()))}}),document.addEventListener("dragleave",function(t){o&&!o.keys&&!o.b.contains(t.relatedTarget)&&W(o.b)}),document.addEventListener("drop",function(t){if(!(!o||o.keys)){t.preventDefault();var r=e(t);if(!r){N();return}o.to=r.col,o.index=r.index,ke()}}),document.addEventListener("dragend",function(){o&&!o.keys&&N()}),document.addEventListener("click",function(t){var r=t.target;if(!(!r||!r.closest)){var n=r.closest(".ui-board a[data-gb-more][href]");if(n){!t.defaultPrevented&&t.button===0&&!t.metaKey&&!t.ctrlKey&&!t.shiftKey&&!t.altKey&&typeof fetch=="function"&&(t.preventDefault(),Ge(n));return}var a=r.closest("table[data-gb-sort] button.ui-table__sort");if(a){Qe(a);return}var i=r.closest("td.ui-table__check, th.ui-table__check");if(i&&r===i){var l=i.querySelector("input[data-gb-select], input[data-gb-select-all]");if(l){l.click();return}}var u=r.closest("input[data-gb-select]");if(u){var s=u.closest(U);if(s&&t.shiftKey&&q&&q!==u&&s.contains(q)){for(var c=Array.prototype.slice.call(s.querySelectorAll("input[data-gb-select]")),f=c.indexOf(q),v=c.indexOf(u),h=u.checked,p=Math.min(f,v);p<=Math.max(f,v);p++)c[p].checked=h;C(s)}q=u;return}he(t)}}),document.addEventListener("auxclick",function(t){t.button===1&&he(t)}),document.addEventListener("change",function(t){var r=t.target;if(!(!r||!r.matches)){var n=r.closest(U);n&&(r.matches("input[data-gb-select-all]")?(n.querySelectorAll("input[data-gb-select]").forEach(function(a){a.checked=r.checked}),C(n)):r.matches("input[data-gb-select]")&&C(n))}}),document.addEventListener("keydown",function(t){if(!(t.key!=="Escape"||t.defaultPrevented||m.length)){var r=document.activeElement&&document.activeElement.closest?document.activeElement.closest(U):null;r&&Ve(r,document.activeElement)||r&&r.querySelector("input[data-gb-select]:checked")&&Ae(r)}})}}xe(),g.gembossUI={openModal:z,toast:Me,confirm:Oe,initMenus:Te,closeMenus:F,initSearch:He,initShell:De,initPasswordFields:Pe,resetPasswordFields:Ke,initNav:me,openModals:function(){return m.length},initCollections:xe,selection:ye,clearSelection:Ae,syncSelection:C,initMenuLayer:ne,floatMenu:B,placeFloating:ee}})(globalThis);
|
|
1
|
+
(function(g){"use strict";if(g.gembossUI)return;var X='<svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M5 5l10 10M15 5L5 15" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" fill="none"/></svg>',we='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, iframe, [tabindex]:not([tabindex="-1"])',qe=function(e){return Array.prototype.slice.call(e.querySelectorAll(we)).filter(function(t){return!t.matches('[tabindex="-1"]')&&(t.checkVisibility?t.checkVisibility({visibilityProperty:!0}):t.getClientRects().length>0)})},E=function(e){return String(e).replace(/[&<>"']/g,function(t){return{"&":"&","<":"<",">":">",'"':""","'":"'"}[t]})},m=[],Ce=0,H=null;function z(e){var t=e.title||"",r=e.label||"",n=e.closeLabel||"Close",a=document.activeElement,i=document.createElement("div");i.className="ui-overlay"+(e.overlayClass?" "+e.overlayClass:""),i.setAttribute("role","presentation");var l="gb-modal-title-"+ ++Ce;i.innerHTML='<div class="ui-modal'+(e.className?" "+e.className:"")+'" role="dialog" aria-modal="true" '+(t?'aria-labelledby="'+l+'"':'aria-label="'+E(r)+'"')+' tabindex="-1">'+(t?'<div class="ui-modal__head"><div class="ui-modal__title" id="'+l+'">'+t+'</div><button type="button" class="ui-modal__close" aria-label="'+E(n)+'">'+X+"</button></div>":"")+(e.body||"")+(e.foot?'<div class="ui-modal__foot">'+e.foot+"</div>":"")+"</div>";var u=i.firstChild,s=!1,c={panel:u,overlay:i,close:function(d,b){var A=b&&b.force;return m.indexOf(c)<0?Promise.resolve():!A&&e.beforeClose?s?Promise.resolve():(s=!0,Promise.resolve().then(function(){return e.beforeClose(d)}).catch(function(x){return console.error(x),!1}).then(function(x){s=!1,x&&m.indexOf(c)>=0&&f(d)})):(f(d),Promise.resolve())}};function f(d){m.splice(m.indexOf(c),1),removeEventListener("keydown",v),i.remove();var b=m[m.length-1];b||(document.body.style.overflow=H||"",H=null),a&&a.isConnected&&a.focus&&(!b||b.panel.contains(a))?a.focus():b&&b.panel.focus(),e.onClose&&e.onClose(d)}function v(d){if(!(d===S||m[m.length-1]!==c)){if(d.key==="Escape"){if(d.isComposing||d.keyCode===229)return;d.preventDefault(),c.close(null);return}if(d.key==="Tab"){var b=qe(u);if(b.length){var A=b[0],x=b[b.length-1];u.contains(document.activeElement)?!d.shiftKey&&document.activeElement===x?(d.preventDefault(),A.focus()):d.shiftKey&&document.activeElement===A&&(d.preventDefault(),x.focus()):(d.preventDefault(),A.focus())}}}}var h=!1;i.addEventListener("mousedown",function(d){h=d.target===i}),i.addEventListener("click",function(d){d.target===i&&h&&c.close(null),h=!1});var p=u.querySelector(".ui-modal__head .ui-modal__close");p&&(p.onclick=function(){c.close(null)});var S=window.event;addEventListener("keydown",v),m.length||(H=document.body.style.overflow),m.push(c);var O=document.body;try{for(var k=document.querySelectorAll("dialog[open]"),y=k.length-1;y>=0;y--)if(k[y].matches(":modal")){O=k[y];break}}catch{}return O.append(i),document.body.style.overflow="hidden",setTimeout(function(){(u.querySelector("[autofocus]")||u).focus()},0),c}function Me(e,t){t=t||{};var r=document.querySelector(".gemboss-toast-viewport"),n=!r;r||(r=document.createElement("div"),r.className="gemboss-toast-viewport",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),document.body.append(r));var a=document.createElement("div");a.className="gemboss-toast"+(t.error?" is-error":""),t.error&&a.setAttribute("role","alert");var i=document.createElement("span");i.className="gemboss-toast-text",i.textContent=String(e),a.append(i);var l=t.duration===0;if(l){var u=document.createElement("button");u.type="button",u.className="gemboss-toast-dismiss",u.setAttribute("aria-label",t.dismissLabel||"Dismiss"),u.innerHTML=X,u.onclick=function(){a.remove()},a.append(u)}n&&(r.dataset.readyAt=String(Date.now()+50));var s=Math.max(0,Number(r.dataset.readyAt||0)-Date.now()),c=function(){r.append(a)};return s||r._gbQueue?((r._gbQueue=r._gbQueue||[]).push(c),r._gbFlush||(r._gbFlush=setTimeout(function(){var f=r._gbQueue;r._gbQueue=null,r._gbFlush=null,f.forEach(function(v){v()})},s))):c(),l||setTimeout(function(){a.remove()},s+(t.duration||(t.error?6e3:3500))),a}var G=!1,J="details.ui-menu, details.gb-account",Y=".ui-menu__item, .gemboss-account-menu-item";function F(e){document.querySelectorAll("details.ui-menu[open], details.gb-account[open]").forEach(function(t){t!==e&&!(e&&t.contains(e))&&(t.open=!1)})}function Te(){G||(G=!0,document.addEventListener("click",function(e){var t=e.target.closest&&e.target.closest(Y),r=t&&t.closest(J);r&&r.open&&r.contains(document.activeElement)&&r.querySelector("summary").focus()},!0),document.addEventListener("click",function(e){var t=e.target.closest&&e.target.closest(J);F(t),t&&e.target.closest(Y)&&(t.open=!1)}),addEventListener("blur",function(){F()}),addEventListener("keydown",function(e){var t=e.key==="Escape"&&!e.isComposing&&document.querySelector("details.ui-menu[open], details.gb-account[open]");if(t){e.preventDefault(),e.stopImmediatePropagation(),t.open=!1;var r=t.querySelector("summary");r&&r.focus()}},!0))}var j=!1,Z=typeof HTMLElement<"u"&&Object.prototype.hasOwnProperty.call(HTMLElement.prototype,"popover");function R(e){return{list:e.querySelector(":scope > .ui-menu__list"),button:e.querySelector(":scope > summary")}}function ee(e,t,r){e.style.maxHeight="",e.style.left="0px",e.style.top="0px";var n=t.getBoundingClientRect(),a=document.documentElement.clientWidth,i=g.innerHeight,l=e.offsetWidth,u=e.offsetHeight,s=i-n.bottom-4-8,c=n.top-4-8,f;u<=s||s>=c?(f=n.bottom+4,u>s&&(e.style.maxHeight=Math.max(s,0)+"px"),e.setAttribute("data-side","bottom")):(u>c&&(e.style.maxHeight=Math.max(c,0)+"px"),f=n.top-4-Math.min(u,c),e.setAttribute("data-side","top"));var v=r?n.right-l:n.left;v=Math.max(8,Math.min(v,a-l-8)),e.style.left=Math.round(v)+"px",e.style.top=Math.round(f)+"px"}function B(e){var t=R(e),r=t.list,n=t.button;!r||!n||!e.open||!Z||(r.style.setProperty("--ui-menu-trigger",n.offsetWidth+"px"),r.getAttribute("popover")!=="manual"&&r.setAttribute("popover","manual"),r.matches(":popover-open")||r.showPopover(),ee(r,n,e.classList.contains("ui-menu--end")))}function Ne(e){var t=R(e).list;t&&t.hasAttribute("popover")&&t.matches(":popover-open")&&t.hidePopover()}function te(e){e&&e.closest&&e.closest(".ui-menu__list")||document.querySelectorAll("details.ui-menu[open]").forEach(function(t){var r=R(t).list;!r||!r.matches(":popover-open")||(!e||e.nodeType===9||e.contains&&e.contains(t))&&(t.open=!1)})}function re(){var e=document.documentElement;e.getAttribute("data-gb-menus")!=="float"&&e.setAttribute("data-gb-menus","float")}function ne(){j||!Z||typeof document>"u"||(j=!0,addEventListener("click",function(e){var t=e.target;t&&t.closest&&t.closest("details.ui-menu > summary")&&re()},!0),document.querySelectorAll("details.ui-menu[open]").forEach(B),document.addEventListener("toggle",function(e){var t=e.target;!t||!t.matches||!t.matches("details.ui-menu")||(t.open?(re(),B(t)):Ne(t))},!0),document.addEventListener("scroll",function(e){te(e.target)},!0),addEventListener("resize",function(){te(null)}))}ne();function Oe(e){e=e||{};var t=e.tone==="critical";return new Promise(function(r){var n=z({title:E(e.title||""),label:e.title?"":e.label||"Confirm",closeLabel:e.closeLabel||e.cancelLabel,body:e.body?'<div class="ui-modal__body">'+E(e.body)+"</div>":"",foot:'<button type="button" class="ui-btn" data-gb-confirm="0"'+(t?" autofocus":"")+">"+E(e.cancelLabel||"Cancel")+'</button><button type="button" class="ui-btn ui-btn--primary'+(t?" ui-btn--critical":"")+'" data-gb-confirm="1"'+(t?"":" autofocus")+">"+E(e.confirmLabel||"OK")+"</button>",onClose:function(a){r(a===!0)}});n.panel.querySelectorAll("[data-gb-confirm]").forEach(function(a){a.onclick=function(){n.close(a.getAttribute("data-gb-confirm")==="1")}})})}var ae=!1;function De(){if(!ae){ae=!0;var e=function(){return document.querySelector(".gemboss-platform-shell")},t=function(n){var a=e();if(a){a.classList.toggle("is-mobile-nav-open",n);var i=a.querySelector(".gemboss-mobile-nav-backdrop");i&&(i.tabIndex=n?0:-1);var l=a.querySelector(".gemboss-mobile-menu-btn");if(l){var u=a.querySelector(".icon-nav[id]");u&&!l.hasAttribute("aria-controls")&&l.setAttribute("aria-controls",u.id),l.setAttribute("aria-expanded",String(n));var s=l.getAttribute(n?"data-label-close":"data-label-open");s&&l.setAttribute("aria-label",s)}}},r=function(){var n=e();return!!n&&n.classList.contains("is-mobile-nav-open")};document.addEventListener("click",function(n){var a=n.target;a.closest&&(a.closest(".gemboss-mobile-menu-btn")?t(!r()):(a.closest(".gemboss-mobile-nav-backdrop")||a.closest(".icon-nav .gnav-item, .icon-nav .gnav-subitem"))&&t(!1))}),addEventListener("keydown",function(n){n.key==="Escape"&&!n.isComposing&&n.keyCode!==229&&r()&&!m.length&&t(!1)}),addEventListener("gemboss:assistant-docked",function(){t(!1)}),t(r())}}var ie=!1,oe="M3 17 17 3";function le(e){return document.getElementById(e.getAttribute("aria-controls")||"")||e.parentNode&&e.parentNode.querySelector("input")}function ue(e,t){var r=le(e);if(r){r.type=t?"text":"password";var n=t?e.getAttribute("data-label-hide")||"Hide password":e.getAttribute("data-label-show")||"Show password";e.setAttribute("aria-label",n),e.setAttribute("title",n);var a=e.querySelector("svg"),i=a&&a.querySelector('path[d="'+oe+'"]');if(a&&t&&!i){var l=document.createElementNS("http://www.w3.org/2000/svg","path");l.setAttribute("d",oe),a.append(l)}i&&!t&&i.remove()}}function Pe(){ie||(ie=!0,document.addEventListener("click",function(e){var t=e.target.closest&&e.target.closest(".gb-auth-pw-toggle"),r=t&&le(t);r&&ue(t,r.type==="password")}))}function Ke(){document.querySelectorAll(".gb-auth-pw-toggle").forEach(function(e){ue(e,!1)})}var ce=!1;function He(){ce||(ce=!0,document.addEventListener("keydown",function(e){var t=document.querySelector(".gemboss-topbar-search-input");if(t){var r=e.target,n=r&&(r.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(r.tagName));(e.key==="k"||e.key==="K")&&(e.metaKey||e.ctrlKey)&&!e.altKey?(e.preventDefault(),t.focus(),t.select()):e.key==="/"&&!n&&!e.metaKey&&!e.ctrlKey&&!e.altKey?(e.preventDefault(),t.focus()):e.key==="Escape"&&r===t&&t.blur()}}))}var Fe=120,Re=15e3,Be=typeof HTMLScriptElement<"u"&&!!HTMLScriptElement.supports&&HTMLScriptElement.supports("speculationrules"),se=!1,I=0,de=0,D=null,fe={},be=!1;function L(e){var t=e&&e.closest?e.closest("a[href]"):null;if(!t||!(t.matches(".gnav-item, .gnav-subitem")||t.hasAttribute("data-gb-pending"))||t.getAttribute("data-gb-nav")==="next"||t.closest('[data-gb-nav="off"]')||t.target&&t.target!=="_self"||t.hasAttribute("download"))return null;var r;try{r=new URL(t.href,location.href)}catch{return null}return r.origin!==location.origin||!/^https?:$/.test(r.protocol)||r.pathname===location.pathname&&r.search===location.search&&(r.hash||(t.getAttribute("href")||"").indexOf("#")>-1)?null:t}function w(){clearTimeout(de),document.querySelectorAll("[data-gb-busy]").forEach(function(e){e.removeAttribute("data-gb-busy"),e.removeAttribute("aria-busy");var t=e.querySelector(":scope > .gb-pending-mark");t&&t.remove()})}function Ie(e){if(w(),e.setAttribute("data-gb-busy",""),e.setAttribute("aria-busy","true"),e.hasAttribute("data-gb-pending")){var t=document.createElement("span");t.className="gb-pending-mark",t.setAttribute("role","status"),t.innerHTML='<span class="ui-sr-only">'+E(e.getAttribute("data-gb-pending-label")||"Loading")+"</span>",e.appendChild(t)}de=setTimeout(w,Re)}function ve(e){if(!(be||g.next||g.__next_f||g.__NEXT_DATA__||e.closest('[data-gb-prefetch="off"]'))){var t=navigator.connection;if(!(t&&t.saveData)){var r=new URL(e.href,location.href);r.hash="";var n=r.href;if(!(fe[n]||r.pathname===location.pathname&&r.search===location.search)){fe[n]=!0;var a;Be?(a=document.createElement("script"),a.type="speculationrules",a.textContent=JSON.stringify({prefetch:[{source:"list",urls:[n]}]})):(a=document.createElement("link"),a.rel="prefetch",a.href=n),a.setAttribute("data-gb-prefetched",""),document.head.appendChild(a)}}}}function me(){if(!(se||typeof document>"u")){se=!0,addEventListener("click",function(r){if(!(r.button!==0||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey)){var n=L(r.target);if(n){if(r.defaultPrevented){be=!0;return}Ie(n)}}});var e=function(r){r!==D&&(clearTimeout(I),D=r,r&&(I=setTimeout(function(){D===r&&ve(r)},Fe)))},t=null;document.addEventListener("mousedown",function(r){t=L(r.target),t&&t===D&&clearTimeout(I)}),document.addEventListener("mouseover",function(r){e(L(r.target))}),document.addEventListener("focusin",function(r){var n=L(r.target);n&&n===t||e(n)}),document.addEventListener("touchstart",function(r){var n=L(r.target);n&&ve(n)},{passive:!0}),addEventListener("pageshow",w),addEventListener("keydown",function(r){r.key==="Escape"&&w()}),g.navigation&&g.navigation.addEventListener&&g.navigation.addEventListener("navigateerror",w)}}me();var Ue='a[href], button, input, select, textarea, label, summary, details, dialog, [role="dialog"], [role="menu"], [role="button"], [role="menuitem"], [role="checkbox"], [contenteditable="true"], [contenteditable=""], [data-row-ignore], .ui-table__check',pe='details[open], dialog[open], [role="dialog"], [role="menu"]';function Ve(e,t){return t&&t.closest&&t.closest(pe)?!0:Array.prototype.some.call(e.querySelectorAll(pe),function(r){return r.checkVisibility?r.checkVisibility():r.getClientRects().length>0})}var ge=!1,q=null,U=".ui-index, .ui-resource";function We(e){for(var t=e.getAttribute("data-href"),r=e.querySelectorAll("a[href]"),n=0;n<r.length;n++)if(r[n].getAttribute("href")===t)return r[n];return null}function he(e){if(!(e.defaultPrevented||e.button>1||!e.target.closest)){var t=e.target.closest("[data-href]");if(t){var r=e.target.closest(Ue);if(!(r&&t.contains(r))){var n=g.getSelection?g.getSelection():null;if(!(n&&!n.isCollapsed&&n.anchorNode&&t.contains(n.anchorNode))){var a=We(t),i=a?a.href:new URL(t.getAttribute("data-href"),location.href).href;if(e.metaKey||e.ctrlKey||e.shiftKey||e.button===1){g.open(i,"_blank","noopener");return}a?a.click():location.assign(i)}}}}}function ye(e){var t=[];return e.querySelectorAll("input[data-gb-select]").forEach(function(r){r.checked&&t.push(r.value)}),t}function C(e){var t=e.querySelectorAll("input[data-gb-select]"),r=0;t.forEach(function(i){var l=i.closest("tr, .ui-list__item, [data-href]");i.checked&&r++,l&&(l.classList.toggle("is-selected",i.checked),l.matches(".ui-list__item")||l.setAttribute("aria-selected",i.checked?"true":"false"))}),e.querySelectorAll("input[data-gb-select-all]").forEach(function(i){i.checked=r>0&&r===t.length,i.indeterminate=r>0&&r<t.length});var n=e.querySelector(".ui-bulkbar");n&&e.matches(".ui-resource")?n.querySelectorAll(".ui-bulkbar__actions button").forEach(function(i){i.disabled=r===0}):n&&(n.hidden=r===0);var a=e.querySelector("[data-gb-count]");a&&(a.textContent=(a.getAttribute("data-gb-count")||"{n} selected").replace("{n}",r)),e.dispatchEvent(new CustomEvent("gb:selection",{bubbles:!0,detail:{ids:ye(e),total:t.length}}))}function Ae(e){e.querySelectorAll("input[data-gb-select]").forEach(function(t){t.checked=!1}),C(e)}function Ee(e){if(!e)return"";var t=e.getAttribute("data-sort-value");return t??e.textContent.trim()}function Qe(e){var t=e.closest("th"),r=e.closest("table");if(!(!t||!r)){var n=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending";if(r.querySelectorAll("thead th[aria-sort]").forEach(function(c){c!==t&&c.setAttribute("aria-sort","none")}),t.setAttribute("aria-sort",n),r.getAttribute("data-gb-sort")!=="client"){r.dispatchEvent(new CustomEvent("gb:sort",{bubbles:!0,detail:{key:t.getAttribute("data-key"),direction:n}}));return}var a=Array.prototype.indexOf.call(t.parentElement.children,t),i=r.tBodies[0];if(i){var l=Array.prototype.slice.call(i.rows),u=n==="ascending"?1:-1,s=function(c){var f=String(c).replace(/[\s,%$€£¥]/g,"");return f!==""&&!isNaN(+f)?+f:null};l.sort(function(c,f){var v=Ee(c.cells[a]),h=Ee(f.cells[a]),p=s(v),S=s(h);return u*(p!=null&&S!=null?p-S:String(v).localeCompare(String(h),void 0,{numeric:!0,sensitivity:"base"}))}),l.forEach(function(c){i.appendChild(c)})}}}function $e(e){return Array.prototype.slice.call(e.querySelectorAll(":scope > .ui-board__col[data-col]"))}function M(e){return Array.prototype.slice.call(e.querySelectorAll("li[data-id]")).filter(function(t){return t.closest(".ui-board__col")===e})}function V(e){var t=e.getAttribute("data-name")||(e.querySelector(".ui-card__link, h2, h3, h4")||e).textContent||"";return t.trim().replace(/\s+/g," ").slice(0,80)||"Card"}function P(e){var t=e.querySelector(".ui-board__name");return(t&&t.textContent||e.getAttribute("data-col")||"").trim()}function _(e,t){var r=e.querySelector(":scope > [data-gb-live]");r||(r=document.createElement("div"),r.className="ui-sr-only",r.setAttribute("aria-live","assertive"),r.setAttribute("data-gb-live",""),e.appendChild(r)),r.textContent="",setTimeout(function(){r.textContent=t},30)}function _e(e,t){var r=e.querySelector(".ui-board__count"),n=r?parseInt(r.textContent,10):NaN;r&&String(n)===r.textContent.trim()&&(r.textContent=String(n+t))}function Xe(e,t,r,n){var a=t.closest(".ui-board__col"),i=M(r).filter(function(f){return f!==t});if(n<i.length)i[n].parentNode.insertBefore(t,i[n]);else if(i.length){var l=i[i.length-1];l.parentNode.insertBefore(t,l.nextSibling)}else{var u=r.querySelector("ol.ui-board__list");if(!u){u=document.createElement("ol"),u.className="ui-board__list";var s=r.querySelector(":scope > .ui-board__empty");s?s.replaceWith(u):r.querySelector(".ui-board__head").after(u)}u.appendChild(t)}if(a!==r&&(_e(a,-1),_e(r,1),!M(a).length&&!a.querySelector(".ui-board__next a[data-gb-more]"))){var c=document.createElement("p");c.className="ui-board__empty",c.textContent=e.getAttribute("data-empty-label")||"Nothing here",a.querySelectorAll(":scope > ol.ui-board__list, :scope > details.ui-board__more").forEach(function(f){f.remove()}),a.querySelector(".ui-board__head").after(c)}}var o=null;function T(e){return M(e).filter(function(t){return!o||t!==o.li})}function W(e){e.querySelectorAll("[data-gb-drop]").forEach(function(t){t.removeAttribute("data-gb-drop")}),e.querySelectorAll("[data-gb-over]").forEach(function(t){t.removeAttribute("data-gb-over")})}function Q(){if(o){W(o.b),o.to.setAttribute("data-gb-over","");var e=T(o.to),t=o.index<e.length?e[o.index]:e[e.length-1];if(t){t.setAttribute("data-gb-drop",o.index<e.length?"before":"after");var r=t.closest("details:not([open])");r&&o.b.contains(r)&&(r.open=!0),o.keys&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}}function K(){return o?P(o.to)+", position "+(o.index+1)+" of "+(T(o.to).length+1):""}function $(){o&&(o.li.removeAttribute("data-gb-lifted"),o.b.removeAttribute("data-gb-dragging"),W(o.b),o=null)}function Se(e,t,r){var n=t.closest(".ui-board__col");if(!(!n||!t.getAttribute("data-id"))){var a=M(n).indexOf(t);o={b:e,li:t,id:t.getAttribute("data-id"),from:n,to:n,index:a,origin:a,keys:r},t.setAttribute("data-gb-lifted",r?"key":"drag"),r&&(Q(),_(e,"Picked up "+V(t)+". "+K()+". Arrow keys move it, Space drops it, Escape cancels."))}}function ke(){if(o){var e=o,t=V(e.li),r=e.to===e.from&&e.index===e.origin,n=K();if($(),r){_(e.b,t+" dropped where it was, in "+P(e.from)+".");return}var a=new CustomEvent("gb:move",{bubbles:!0,cancelable:!0,detail:{id:e.id,from:e.from.getAttribute("data-col"),to:e.to.getAttribute("data-col"),index:e.index}}),i=e.b.dispatchEvent(a);if(i&&Xe(e.b,e.li,e.to,e.index),_(e.b,"Moved "+t+" to "+n+"."),e.keys){var l=10,u=function(){var s=Array.prototype.slice.call(e.b.querySelectorAll("li[data-id]")).filter(function(c){return c.getAttribute("data-id")===e.id})[0];s&&document.activeElement!==s?s.focus():!s&&l-- >0&&requestAnimationFrame(u)};requestAnimationFrame(u)}}}function N(e){if(o){var t=o;$(),t.keys&&_(t.b,(e||"")+V(t.li)+" stays in "+P(t.from)+".")}}function xe(e){var t=e&&e.closest?e.closest(".ui-board[data-gb-move]"):null;return t}function ze(e){var t=xe(e.target),r=t&&e.target.closest("li[data-id]");if(!(!r||!t.contains(r)||t.__gbMoveOn)){if(!o){(e.key===" "||e.key==="Spacebar")&&e.target===r&&(e.preventDefault(),Se(t,r,!0));return}if(!(o.li!==r||!o.keys)){var n=$e(t);if(e.key==="ArrowUp"||e.key==="ArrowDown")e.preventDefault(),o.index=Math.max(0,Math.min(T(o.to).length,o.index+(e.key==="ArrowUp"?-1:1)));else if(e.key==="ArrowLeft"||e.key==="ArrowRight"){e.preventDefault();var a=n.indexOf(o.to)+(e.key==="ArrowLeft"?-1:1);if(a<0||a>=n.length){_(t,K()+". No column further "+(e.key==="ArrowLeft"?"left":"right")+".");return}o.to=n[a],o.index=Math.min(o.index,T(o.to).length)}else if(e.key===" "||e.key==="Spacebar"||e.key==="Enter"){e.preventDefault(),ke();return}else if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),N("Move cancelled. ");return}else if(e.key==="Tab"){N("Move cancelled. ");return}else return;Q(),_(t,K())}}}function Ge(e){var t=e.closest(".ui-board__col"),r=e.closest(".ui-board"),n=e.closest(".ui-board__next")||e.parentNode;if(!(!t||!r||n.getAttribute("aria-busy")==="true")){var a=t.getAttribute("data-col"),i=e.href;n.setAttribute("aria-busy","true"),n.innerHTML='<span class="ui-spinner" aria-hidden="true"></span><span role="status">Loading\u2026</span>',fetch(i,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(function(l){if(!l.ok)throw new Error(String(l.status));return l.text()}).then(function(l){var u=new DOMParser().parseFromString(l,"text/html"),s=r.id?u.getElementById(r.id):u,c=Array.prototype.slice.call((s||u).querySelectorAll(".ui-board__col[data-col]")).filter(function(b){return b.getAttribute("data-col")===a})[0];if(!c)throw new Error("no column "+a);var f={};r.querySelectorAll("li[data-id]").forEach(function(b){f[b.getAttribute("data-id")]=1});var v=t.querySelector(":scope > ol.ui-board__list");if(!v){v=document.createElement("ol"),v.className="ui-board__list";var h=t.querySelector(":scope > .ui-board__empty");h?h.replaceWith(v):n.before(v)}var p=M(c).filter(function(b){return!f[b.getAttribute("data-id")]}).map(function(b){var A=document.importNode(b,!0);return v.appendChild(A),A}),S=c.querySelector(".ui-board__count"),O=t.querySelector(".ui-board__count");S&&O&&(O.textContent=S.textContent);var k=c.querySelector(".ui-board__next");k&&k.querySelector("a[data-gb-more]")?(n.innerHTML=k.innerHTML,n.removeAttribute("aria-busy")):n.remove();try{history.replaceState(history.state,"",i)}catch{}_(r,p.length+" more "+(p.length===1?"card":"cards")+" in "+P(t)+".");var y=p[0];if(y){var d=y.matches("[tabindex]")?y:y.querySelector("a[href], button, [tabindex]");d&&d.focus({preventScroll:!1})}}).catch(function(){n.removeAttribute("aria-busy"),n.innerHTML=`<span role="alert" class="ui-more__error">Couldn't load.</span>`;var l=document.createElement("a");l.className="ui-btn ui-btn--sm",l.href=i,l.setAttribute("data-gb-more",""),l.textContent="Try again",n.appendChild(l),l.focus()})}}function Le(){if(!(ge||typeof document>"u")){ge=!0,document.addEventListener("keydown",ze),document.addEventListener("focusout",function(t){o&&o.keys&&t.target===o.li&&!o.li.contains(t.relatedTarget)&&N("Move cancelled. ")}),document.addEventListener("dragstart",function(t){var r=xe(t.target),n=r&&t.target.closest("li[data-id]");!n||!r.contains(n)||r.__gbMoveOn||!t.dataTransfer||(o&&$(),Se(r,n,!1),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",n.getAttribute("data-id")||""),requestAnimationFrame(function(){o&&r.setAttribute("data-gb-dragging","")}))});var e=function(t){var r=t.target.closest?t.target.closest(".ui-board__col[data-col]"):null;if(!r||!o||!o.b.contains(r))return null;for(var n=T(r),a=n.length,i=0;i<n.length;i++){var l=n[i].getBoundingClientRect();if(l.height){if(t.clientY<l.top+l.height/2){a=i;break}a=i+1}}return{col:r,index:a}};document.addEventListener("dragover",function(t){if(!(!o||o.keys)){var r=e(t);r&&(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),(r.col!==o.to||r.index!==o.index||!o.b.querySelector("[data-gb-over]"))&&(o.to=r.col,o.index=r.index,Q()))}}),document.addEventListener("dragleave",function(t){o&&!o.keys&&!o.b.contains(t.relatedTarget)&&W(o.b)}),document.addEventListener("drop",function(t){if(!(!o||o.keys)){t.preventDefault();var r=e(t);if(!r){N();return}o.to=r.col,o.index=r.index,ke()}}),document.addEventListener("dragend",function(){o&&!o.keys&&N()}),document.addEventListener("click",function(t){var r=t.target;if(!(!r||!r.closest)){var n=r.closest(".ui-board a[data-gb-more][href]");if(n){!t.defaultPrevented&&t.button===0&&!t.metaKey&&!t.ctrlKey&&!t.shiftKey&&!t.altKey&&typeof fetch=="function"&&(t.preventDefault(),Ge(n));return}var a=r.closest("table[data-gb-sort] button.ui-table__sort");if(a){Qe(a);return}var i=r.closest("td.ui-table__check, th.ui-table__check");if(i&&r===i){var l=i.querySelector("input[data-gb-select], input[data-gb-select-all]");if(l){l.click();return}}var u=r.closest("input[data-gb-select]");if(u){var s=u.closest(U);if(s&&t.shiftKey&&q&&q!==u&&s.contains(q)){for(var c=Array.prototype.slice.call(s.querySelectorAll("input[data-gb-select]")),f=c.indexOf(q),v=c.indexOf(u),h=u.checked,p=Math.min(f,v);p<=Math.max(f,v);p++)c[p].checked=h;C(s)}q=u;return}he(t)}}),document.addEventListener("auxclick",function(t){t.button===1&&he(t)}),document.addEventListener("change",function(t){var r=t.target;if(!(!r||!r.matches)){var n=r.closest(U);n&&(r.matches("input[data-gb-select-all]")?(n.querySelectorAll("input[data-gb-select]").forEach(function(a){a.checked=r.checked}),C(n)):r.matches("input[data-gb-select]")&&C(n))}}),document.addEventListener("keydown",function(t){if(!(t.key!=="Escape"||t.defaultPrevented||m.length)){var r=document.activeElement&&document.activeElement.closest?document.activeElement.closest(U):null;r&&Ve(r,document.activeElement)||r&&r.querySelector("input[data-gb-select]:checked")&&Ae(r)}})}}Le(),g.gembossUI={openModal:z,toast:Me,confirm:Oe,initMenus:Te,closeMenus:F,initSearch:He,initShell:De,initPasswordFields:Pe,resetPasswordFields:Ke,initNav:me,openModals:function(){return m.length},initCollections:Le,selection:ye,clearSelection:Ae,syncSelection:C,initMenuLayer:ne,floatMenu:B,placeFloating:ee}})(globalThis);
|