@pebble-software/bonsai 0.0.3
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/README.md +332 -0
- package/dist/components/core/bonsai.d.ts +17 -0
- package/dist/components/ui/a.d.ts +3 -0
- package/dist/components/ui/accordion.d.ts +17 -0
- package/dist/components/ui/alert-dialog.d.ts +23 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/avatar.d.ts +21 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/breadcrumb.d.ts +10 -0
- package/dist/components/ui/button.d.ts +14 -0
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/card.d.ts +15 -0
- package/dist/components/ui/chart.d.ts +44 -0
- package/dist/components/ui/checkbox.d.ts +7 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/combobox.d.ts +31 -0
- package/dist/components/ui/command.d.ts +23 -0
- package/dist/components/ui/dialog.d.ts +23 -0
- package/dist/components/ui/drawer.d.ts +22 -0
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/form.d.ts +24 -0
- package/dist/components/ui/h.d.ts +10 -0
- package/dist/components/ui/input-group.d.ts +18 -0
- package/dist/components/ui/input-otp.d.ts +11 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +10 -0
- package/dist/components/ui/loader.d.ts +14 -0
- package/dist/components/ui/map.d.ts +30 -0
- package/dist/components/ui/p.d.ts +11 -0
- package/dist/components/ui/popover.d.ts +9 -0
- package/dist/components/ui/progress.d.ts +31 -0
- package/dist/components/ui/scroll-area.d.ts +13 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/separator.d.ts +8 -0
- package/dist/components/ui/sidebar.d.ts +70 -0
- package/dist/components/ui/signature-pad.d.ts +7 -0
- package/dist/components/ui/skeleton.d.ts +7 -0
- package/dist/components/ui/switch.d.ts +8 -0
- package/dist/components/ui/table.d.ts +14 -0
- package/dist/components/ui/tabs.d.ts +15 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/toast.d.ts +46 -0
- package/dist/components/ui/tooltip.d.ts +15 -0
- package/dist/hooks/haptics.d.ts +8 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4446 -0
- package/dist/lib/ast/cache.d.ts +8 -0
- package/dist/lib/ast/evaluator.d.ts +2 -0
- package/dist/lib/ast/helpers.d.ts +2 -0
- package/dist/lib/ast/index.d.ts +4 -0
- package/dist/lib/ast/setup.d.ts +2 -0
- package/dist/lib/ast/types.d.ts +1 -0
- package/dist/lib/ast/utils.d.ts +3 -0
- package/dist/lib/haptics.d.ts +8 -0
- package/dist/lib/ui/registry.d.ts +8 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/tests/ast.bugs.test.d.ts +1 -0
- package/dist/tests/ast.engine.test.d.ts +1 -0
- package/dist/tests/ast.helpers.test.d.ts +1 -0
- package/dist/tests/fixtures/examples.d.ts +8 -0
- package/dist/tests/helpers.d.ts +4 -0
- package/dist/tests/render.bindings.test.d.ts +1 -0
- package/dist/tests/render.controlled.test.d.ts +1 -0
- package/dist/tests/render.examples.test.d.ts +1 -0
- package/dist/tests/render.granularity.test.d.ts +1 -0
- package/dist/tests/render.ssr-client.test.d.ts +1 -0
- package/dist/tests/render.structural.test.d.ts +1 -0
- package/dist/tests/schema.contract.test.d.ts +1 -0
- package/dist/tests/schema.examples.test.d.ts +1 -0
- package/dist/tests/schema.kitchen-sink.test.d.ts +1 -0
- package/dist/tests/setup.d.ts +1 -0
- package/dist/tests/store.paths.test.d.ts +1 -0
- package/dist/tests/ui.contracts.test.d.ts +1 -0
- package/package.json +86 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4446 @@
|
|
|
1
|
+
import { jsx as i, jsxs as k, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import * as E from "react";
|
|
3
|
+
import { useState as Ie, useRef as $, useCallback as pe, useEffect as oe, createContext as rt, memo as ge, createElement as G, useMemo as Le, Fragment as Oe, useContext as nt } from "react";
|
|
4
|
+
import { useSnapshot as ot, proxy as it } from "valtio";
|
|
5
|
+
import st, { z as t } from "zod";
|
|
6
|
+
import { createErrorMap as dt } from "zod-validation-error";
|
|
7
|
+
import { cva as _ } from "class-variance-authority";
|
|
8
|
+
import { clsx as lt } from "clsx";
|
|
9
|
+
import { twMerge as ct } from "tailwind-merge";
|
|
10
|
+
import { Accordion as Q } from "@base-ui/react/accordion";
|
|
11
|
+
import { IconChevronDown as me, IconCircleFilled as ut, IconLoader as pt, IconSelector as gt, IconCheck as Ue, IconChevronUp as mt, IconChevronLeft as ht, IconChevronRight as ft, IconMapPinFilled as bt, IconX as xt, IconWriting as vt, IconTextSize as yt, IconEraser as wt } from "@tabler/icons-react";
|
|
12
|
+
import { useWebHaptics as ae } from "web-haptics/react";
|
|
13
|
+
import { Avatar as ue } from "@base-ui/react/avatar";
|
|
14
|
+
import { mergeProps as At } from "@base-ui/react/merge-props";
|
|
15
|
+
import { useRender as zt } from "@base-ui/react/use-render";
|
|
16
|
+
import { Button as It } from "@base-ui/react/button";
|
|
17
|
+
import { getDefaultClassNames as kt, DayPicker as Ct } from "react-day-picker";
|
|
18
|
+
import { Select as L } from "@base-ui/react/select";
|
|
19
|
+
import { Checkbox as ke } from "@base-ui/react/checkbox";
|
|
20
|
+
import { Collapsible as he } from "@base-ui/react/collapsible";
|
|
21
|
+
import { Input as Tt } from "@base-ui/react/input";
|
|
22
|
+
import { OTPInput as _t } from "input-otp";
|
|
23
|
+
import { Map as Nt, Marker as Pt, NavigationControl as Rt, GeolocateControl as St, FullscreenControl as Dt, Layer as Et } from "react-map-gl/maplibre";
|
|
24
|
+
import { Progress as H } from "@base-ui/react/progress";
|
|
25
|
+
import { Tabs as fe } from "@base-ui/react/tabs";
|
|
26
|
+
import Lt from "react-signature-canvas";
|
|
27
|
+
import { Separator as Ot } from "@base-ui/react/separator";
|
|
28
|
+
import { Switch as Ce } from "@base-ui/react/switch";
|
|
29
|
+
import Fe from "jsep";
|
|
30
|
+
import Ut from "@jsep-plugin/arrow";
|
|
31
|
+
var Be = /* @__PURE__ */ ((e) => (e.FORM_CAPTURED = "FORM_CAPTURED", e.FILE_GENERATED = "FILE_GENERATED", e.FILE_UPLOADED = "FILE_UPLOADED", e))(Be || {});
|
|
32
|
+
new Set(Object.values(Be));
|
|
33
|
+
var s = /* @__PURE__ */ ((e) => (e.A = "a", e.P = "p", e.H = "h", e.OL = "ol", e.UL = "ul", e.LI = "li", e.MAP = "map", e.DIV = "div", e.SPAN = "span", e.ACCORDION = "accordion", e.ACCORDION_ITEM = "accordion-item", e.ACCORDION_TRIGGER = "accordion-trigger", e.ACCORDION_CONTENT = "accordion-content", e.ALERT = "alert", e.AVATAR = "avatar", e.BADGE = "badge", e.BUTTON = "button", e.CARD = "card", e.CARD_HEADER = "card-header", e.CARD_TITLE = "card-title", e.CARD_DESCRIPTION = "card-description", e.CARD_CONTENT = "card-content", e.CARD_FOOTER = "card-footer", e.CARD_ACTION = "card-action", e.CARD_ICON = "card-icon", e.CALENDAR = "calendar", e.CHECKBOX = "checkbox", e.COLLAPSIBLE = "collapsible", e.COLLAPSIBLE_TRIGGER = "collapsible-trigger", e.COLLAPSIBLE_CONTENT = "collapsible-content", e.IMAGE = "image", e.OTP = "otp", e.INPUT = "input", e.INPUT_GROUP = "input-group", e.INPUT_GROUP_TEXT = "input-group-text", e.INPUT_GROUP_ADDON = "input-group-addon", e.INPUT_GROUP_BUTTON = "input-group-button", e.INPUT_GROUP_INPUT = "input-group-input", e.INPUT_GROUP_TEXTAREA = "input-group-textarea", e.LABEL = "label", e.LOADER = "loader", e.PROGRESS = "progress", e.SEPARATOR = "separator", e.SKELETON = "skeleton", e.SWITCH = "switch", e.TABLE = "table", e.TABLE_HEADER = "table-header", e.TABLE_BODY = "table-body", e.TABLE_FOOTER = "table-footer", e.TABLE_HEAD = "table-head", e.TABLE_ROW = "table-row", e.TABLE_CELL = "table-cell", e.TABLE_CAPTION = "table-caption", e.TEXTAREA = "textarea", e.SIGNATURE = "signature", e.EACH = "each", e.IF = "if", e))(s || {});
|
|
34
|
+
const Ft = new Set(Object.values(s)), I = t.string().length(24).meta({
|
|
35
|
+
description: "MongoDB ObjectId (24-character hex string)",
|
|
36
|
+
example: "67e091ab2c4d3f22001a2b3c"
|
|
37
|
+
});
|
|
38
|
+
t.string().email().meta({
|
|
39
|
+
description: "Valid email address",
|
|
40
|
+
example: "jack@datahaven.net"
|
|
41
|
+
});
|
|
42
|
+
const C = t.string().datetime({ offset: !0 }).meta({
|
|
43
|
+
description: "ISO 8601 datetime with optional timezone offset",
|
|
44
|
+
example: "2077-12-25T23:59:59Z"
|
|
45
|
+
});
|
|
46
|
+
t.union([t.boolean(), t.string()]).meta({
|
|
47
|
+
description: "Boolean or string-coerced boolean ('true'/'false')",
|
|
48
|
+
example: !0
|
|
49
|
+
});
|
|
50
|
+
t.object({
|
|
51
|
+
error: t.string().meta({ description: "Human-readable error description", example: "Forbidden — no access to this resource" }),
|
|
52
|
+
data: t.any().optional().meta({ description: "Additional error context (if available)" })
|
|
53
|
+
}).meta({ description: "Error API response" });
|
|
54
|
+
const m = t.object({
|
|
55
|
+
id: t.string().optional().meta({ description: "Unique identifier for the element" }),
|
|
56
|
+
className: t.string().optional().meta({ description: "CSS classes to apply to the element" })
|
|
57
|
+
}), Bt = m.extend({
|
|
58
|
+
href: t.string({ error: "Link destination (href) is required" }).min(1, { message: "Link destination (href) cannot be empty" })
|
|
59
|
+
}), jt = m.extend({
|
|
60
|
+
variant: t.enum(["h1", "h2", "h3", "h4", "h5", "h6"], {
|
|
61
|
+
error: "Invalid heading variant. Must be one of: h1, h2, h3, h4, h5, or h6"
|
|
62
|
+
}).optional().meta({ description: "Heading level variant (h1-h6)" }),
|
|
63
|
+
as: t.enum(["h1", "h2", "h3", "h4", "h5", "h6"], {
|
|
64
|
+
error: "Invalid heading element type. Must be one of: h1, h2, h3, h4, h5, or h6"
|
|
65
|
+
}).optional().meta({ description: "Render as a different heading element" })
|
|
66
|
+
}).optional(), Wt = m.extend({
|
|
67
|
+
size: t.enum(["xs", "sm", "md", "lg", "xl"], {
|
|
68
|
+
error: "Invalid paragraph size. Must be one of: xs, sm, md, lg, or xl"
|
|
69
|
+
}).optional().meta({ description: "Paragraph text size" }),
|
|
70
|
+
variant: t.enum(["default", "muted"]).optional().meta({ description: "Paragraph style variant" }),
|
|
71
|
+
as: t.enum(["p", "div", "span"]).optional().meta({ description: "Render as a different element" })
|
|
72
|
+
}).optional(), Gt = m.optional(), $t = m.optional(), qt = m.optional(), Ht = m.optional(), Vt = m.optional(), Mt = m.optional(), Jt = m.extend({
|
|
73
|
+
variant: t.enum(["default", "success", "warning", "destructive"], {
|
|
74
|
+
error: "Invalid alert variant. Must be one of: default, success, warning, or destructive"
|
|
75
|
+
}).optional().meta({ description: "Alert style variant" }),
|
|
76
|
+
size: t.enum(["default", "sm", "lg"]).optional().meta({ description: "Alert size" }),
|
|
77
|
+
raised: t.enum(["xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Alert shadow elevation" })
|
|
78
|
+
}).optional(), Xt = m.extend({
|
|
79
|
+
variant: t.enum(["default", "secondary", "destructive", "outline", "ghost"], {
|
|
80
|
+
error: "Invalid badge variant. Must be one of: default, secondary, destructive, outline, or ghost"
|
|
81
|
+
}).optional().meta({ description: "Badge style variant" }),
|
|
82
|
+
size: t.enum(["sm", "md", "lg"]).optional().meta({ description: "Badge size" }),
|
|
83
|
+
raised: t.enum(["xs", "sm", "md", "lg"]).optional().meta({ description: "Badge shadow elevation" }),
|
|
84
|
+
extrude: t.enum(["xs", "sm", "md", "lg"]).optional().meta({ description: "Badge extrude elevation" })
|
|
85
|
+
}).optional(), Yt = m.extend({
|
|
86
|
+
variant: t.enum(["default", "secondary", "outline", "destructive", "warning", "ghost"], {
|
|
87
|
+
error: "Invalid button variant. Must be one of: default, secondary, outline, destructive, warning, or ghost"
|
|
88
|
+
}).optional().meta({ description: "Button style variant" }),
|
|
89
|
+
size: t.enum(["xs", "sm", "md", "lg"], {
|
|
90
|
+
error: "Invalid button size. Must be one of: xs, sm, md, or lg"
|
|
91
|
+
}).optional().meta({ description: "Button size" }),
|
|
92
|
+
icon: t.enum(["xs", "sm", "md", "lg"]).optional().meta({ description: "Icon-only button size" }),
|
|
93
|
+
raised: t.enum(["xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Button shadow elevation" }),
|
|
94
|
+
extrude: t.enum(["xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Button extrude elevation" }),
|
|
95
|
+
disabled: t.union([t.string(), t.boolean()]).optional().meta({ description: "Whether the button is disabled" }),
|
|
96
|
+
loading: t.union([t.string(), t.boolean()]).optional().meta({ description: "Whether to show a loading spinner" }),
|
|
97
|
+
type: t.enum(["button", "submit"], {
|
|
98
|
+
error: "Invalid button type. Must be either 'button' or 'submit'"
|
|
99
|
+
}).optional().meta({ description: "Button type attribute" })
|
|
100
|
+
}).optional(), Kt = m.extend({
|
|
101
|
+
size: t.enum(["sm", "md"]).optional().meta({ description: "Card size" }),
|
|
102
|
+
raised: t.enum(["none", "xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Card shadow elevation" })
|
|
103
|
+
}).optional(), Zt = m.optional(), Qt = m.optional(), ea = m.optional(), ta = m.optional(), aa = m.optional(), ra = m.optional(), na = m.optional(), oa = m.extend({
|
|
104
|
+
checked: t.union([t.string(), t.boolean()]).optional().meta({ description: "Checkbox checked state" }),
|
|
105
|
+
disabled: t.union([t.string(), t.boolean()]).optional().meta({ description: "Whether the checkbox is disabled" }),
|
|
106
|
+
required: t.union([t.string(), t.boolean()]).optional().meta({ description: "Whether the checkbox must be checked" }),
|
|
107
|
+
size: t.enum(["xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Checkbox size" })
|
|
108
|
+
}).strict(), ia = m.extend({
|
|
109
|
+
src: t.union(
|
|
110
|
+
[
|
|
111
|
+
t.url({ error: "Image source (src) must be a valid URL" }),
|
|
112
|
+
t.string().min(1, { message: "Image source (src) cannot be empty" })
|
|
113
|
+
],
|
|
114
|
+
{
|
|
115
|
+
error: "Image source (src) is required"
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
alt: t.string().optional().default("unknown image url").meta({ description: "Alternative text for the image" })
|
|
119
|
+
}).strict(), sa = m.extend({
|
|
120
|
+
value: t.union([t.string(), t.number()], {
|
|
121
|
+
error: "OTP value is required"
|
|
122
|
+
}).meta({ description: "Current OTP value" }),
|
|
123
|
+
placeholder: t.string().optional().meta({ description: "Placeholder text for the OTP input" }),
|
|
124
|
+
disabled: t.union([t.string(), t.boolean()]).optional().meta({ description: "Whether the OTP input is disabled" }),
|
|
125
|
+
containerClassName: t.string().optional().meta({ description: "Custom CSS class for the OTP input container" })
|
|
126
|
+
}).strict(), da = m.extend({
|
|
127
|
+
value: t.union([t.string(), t.number()], {
|
|
128
|
+
error: "Input value is required"
|
|
129
|
+
}).meta({ description: "Current input value" }),
|
|
130
|
+
placeholder: t.string().optional().meta({ description: "Placeholder text shown when empty" }),
|
|
131
|
+
disabled: t.union([t.string(), t.boolean()]).optional().meta({ description: "Whether the input is disabled" })
|
|
132
|
+
}).strict(), la = m.extend({
|
|
133
|
+
htmlFor: t.string().min(1, {
|
|
134
|
+
message: "Label 'for' attribute is required and must reference an input ID"
|
|
135
|
+
}).meta({ description: "ID of the associated input element" }),
|
|
136
|
+
size: t.enum(["xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Label text size" }),
|
|
137
|
+
variant: t.enum(["default", "underline", "destructive"]).optional().meta({ description: "Label style variant" })
|
|
138
|
+
}).strict(), ca = m.extend({
|
|
139
|
+
checked: t.union([t.string(), t.boolean()], {
|
|
140
|
+
error: "Switch checked state is required"
|
|
141
|
+
}).meta({ description: "Current switch state" }),
|
|
142
|
+
disabled: t.union([t.string(), t.boolean()]).optional().meta({ description: "Whether the switch is disabled" }),
|
|
143
|
+
required: t.union([t.string(), t.boolean()]).optional().meta({ description: "Whether the switch must be turned on" }),
|
|
144
|
+
size: t.enum(["sm", "md", "lg"]).optional().meta({ description: "Switch size" }),
|
|
145
|
+
rounded: t.enum(["none", "sm", "md", "lg", "full"]).optional().meta({ description: "Switch border radius" })
|
|
146
|
+
}).strict(), ua = m.extend({
|
|
147
|
+
value: t.string({ error: "Textarea value is required" }).meta({ description: "Current textarea content" }),
|
|
148
|
+
placeholder: t.string().optional().meta({ description: "Placeholder text shown when empty" }),
|
|
149
|
+
disabled: t.union([t.string(), t.boolean()]).optional().meta({ description: "Whether the textarea is disabled" }),
|
|
150
|
+
autosize: t.boolean().optional().meta({ description: "Whether the textarea auto-resizes to fit content" }),
|
|
151
|
+
rows: t.number().min(1, { message: "Minimum number of rows is 1" }).max(100, { message: "Maximum number of rows is 100" }).optional().meta({ description: "Number of visible text lines" }),
|
|
152
|
+
minLength: t.number().min(0, { message: "Minimum character length cannot be negative" }).optional().meta({ description: "Minimum number of characters allowed" }),
|
|
153
|
+
maxLength: t.number().max(1e4, { message: "Maximum character length cannot exceed 10,000" }).optional().meta({ description: "Maximum number of characters allowed" })
|
|
154
|
+
}).strict(), pa = m.optional(), ga = m.optional(), ma = m.extend({
|
|
155
|
+
align: t.enum(["inline-start", "inline-end", "block-start", "block-end"]).optional().meta({ description: "Alignment of the addon within the input group" })
|
|
156
|
+
}).optional(), ha = m.extend({
|
|
157
|
+
value: t.union([t.string(), t.number()], {
|
|
158
|
+
error: "Input value is required"
|
|
159
|
+
}).meta({ description: "Current input value" }),
|
|
160
|
+
placeholder: t.string().optional().meta({ description: "Placeholder text shown when empty" }),
|
|
161
|
+
disabled: t.union([t.string(), t.boolean()]).optional().meta({ description: "Whether the input is disabled" })
|
|
162
|
+
}).strict(), fa = m.extend({
|
|
163
|
+
variant: t.enum(["default", "secondary", "outline", "destructive", "warning", "ghost"]).optional(),
|
|
164
|
+
size: t.enum(["xs", "sm", "md", "lg"]).optional()
|
|
165
|
+
}).optional(), ba = m.extend({
|
|
166
|
+
value: t.string({ error: "Textarea value is required" }).meta({ description: "Current textarea content" }),
|
|
167
|
+
placeholder: t.string().optional(),
|
|
168
|
+
disabled: t.union([t.string(), t.boolean()]).optional()
|
|
169
|
+
}).strict(), xa = m.extend({
|
|
170
|
+
value: t.string().nullable().meta({ description: "Current signature value (base64 or null if empty)" }),
|
|
171
|
+
canvasClassname: t.string().optional().meta({ description: "Custom CSS class for the signature canvas" }),
|
|
172
|
+
imageType: t.enum(["image/png", "image/jpeg", "image/webp"]).optional().meta({ description: "Image format for the exported signature" })
|
|
173
|
+
}).strict(), va = m.extend({
|
|
174
|
+
selected: t.union([t.string(), t.date(), t.array(t.date())], {
|
|
175
|
+
error: "Invalid calendar selection. Must be a date string, Date object, or array of dates"
|
|
176
|
+
}).optional().meta({ description: "Currently selected date(s)" }),
|
|
177
|
+
buttonVariant: t.enum(["default", "secondary", "outline", "destructive", "warning", "ghost"]).optional().meta({ description: "Variant for calendar navigation buttons" }),
|
|
178
|
+
hideWeekends: t.boolean().optional().meta({ description: "Whether to hide Saturday and Sunday columns" })
|
|
179
|
+
}).optional(), ya = m.extend({
|
|
180
|
+
pins: t.array(
|
|
181
|
+
t.object({
|
|
182
|
+
id: t.union([t.string(), t.number()]).meta({ description: "Unique pin identifier" }),
|
|
183
|
+
latitude: t.number({ error: "Pin latitude is required and must be a number" }).min(-90, { message: "Latitude must be between -90 and 90 degrees" }).max(90, { message: "Latitude must be between -90 and 90 degrees" }),
|
|
184
|
+
longitude: t.number({ error: "Pin longitude is required and must be a number" }).min(-180, {
|
|
185
|
+
message: "Longitude must be between -180 and 180 degrees"
|
|
186
|
+
}).max(180, {
|
|
187
|
+
message: "Longitude must be between -180 and 180 degrees"
|
|
188
|
+
}),
|
|
189
|
+
label: t.string().optional().meta({ description: "Optional pin label" })
|
|
190
|
+
})
|
|
191
|
+
).optional().meta({ description: "Array of map pins to display" }),
|
|
192
|
+
readonly: t.boolean().optional().meta({ description: "Whether the map is read-only" }),
|
|
193
|
+
fixed: t.boolean().optional().meta({ description: "Whether the map viewport is fixed (no pan/zoom)" }),
|
|
194
|
+
allowMultiple: t.boolean().optional().meta({ description: "Whether to allow multiple pins" }),
|
|
195
|
+
zoom: t.number().min(0).max(18).optional().meta({ description: "Initial zoom level" }),
|
|
196
|
+
pitch: t.number().optional().meta({ description: "Map pitch angle" })
|
|
197
|
+
}).optional(), wa = m.optional(), Aa = m.optional(), za = m.optional(), Ia = m.optional(), ka = m.optional(), Ca = m.optional(), Ta = m.optional(), _a = m.optional(), Na = m.extend({
|
|
198
|
+
variant: t.enum(["default", "contained", "separated"]).optional().meta({ description: "Accordion style variant" }),
|
|
199
|
+
raised: t.enum(["xs", "sm", "md", "lg"]).optional().meta({ description: "Accordion shadow elevation" }),
|
|
200
|
+
extrude: t.enum(["xs", "sm", "md", "lg"]).optional().meta({ description: "Accordion extrude elevation" })
|
|
201
|
+
}).optional(), Pa = m.optional(), Ra = m.extend({
|
|
202
|
+
disabled: t.union([t.string(), t.boolean()]).optional().meta({ description: "Whether the accordion trigger is disabled" }),
|
|
203
|
+
icon: t.any().optional().meta({ description: "Custom icon component for the trigger" })
|
|
204
|
+
}).optional(), Sa = m.optional(), Da = m.extend({
|
|
205
|
+
src: t.string().optional().meta({ description: "Image source URL" }),
|
|
206
|
+
alt: t.string().optional().meta({ description: "Alternative text for the avatar image" }),
|
|
207
|
+
size: t.enum(["full", "sm", "md", "lg", "xl"]).optional().meta({ description: "Avatar size" }),
|
|
208
|
+
rounded: t.enum(["none", "sm", "md", "lg", "full"]).optional().meta({ description: "Avatar border radius" }),
|
|
209
|
+
raised: t.enum(["xs", "sm", "md", "lg"]).optional().meta({ description: "Avatar shadow elevation" }),
|
|
210
|
+
fallback: t.string().optional().meta({ description: "Fallback text or element when image fails to load" }),
|
|
211
|
+
badge: t.any().optional().meta({ description: "Badge element to overlay on the avatar" })
|
|
212
|
+
}).optional(), Ea = m.optional(), La = m.optional(), Oa = m.optional(), Ua = m.extend({
|
|
213
|
+
variant: t.enum(["spinner", "ping"]).optional().meta({ description: "Loader animation variant" }),
|
|
214
|
+
fill: t.enum(["default", "destructive", "warning", "pending"]).optional().meta({ description: "Loader fill color" }),
|
|
215
|
+
size: t.enum(["sm", "md", "lg"]).optional().meta({ description: "Loader size" }),
|
|
216
|
+
icon: t.any().optional().meta({ description: "Custom spinner icon component" }),
|
|
217
|
+
pingIcon: t.any().optional().meta({ description: "Custom ping icon component" }),
|
|
218
|
+
iconProps: t.any().optional().meta({ description: "Props to pass to the icon components" })
|
|
219
|
+
}).optional(), Fa = m.extend({
|
|
220
|
+
mode: t.enum(["single", "multiple"]).optional().meta({ description: "Progress display mode" }),
|
|
221
|
+
value: t.union([
|
|
222
|
+
t.number().nullable(),
|
|
223
|
+
t.array(
|
|
224
|
+
t.object({
|
|
225
|
+
name: t.string().optional(),
|
|
226
|
+
value: t.number()
|
|
227
|
+
})
|
|
228
|
+
)
|
|
229
|
+
]).optional().meta({ description: "Current progress value(s)" }),
|
|
230
|
+
size: t.enum(["xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Progress size" }),
|
|
231
|
+
raised: t.enum(["default", "xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Progress shadow elevation" }),
|
|
232
|
+
stacked: t.enum(["default", "xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Progress stacked spacing" })
|
|
233
|
+
}).optional(), Ba = m.extend({
|
|
234
|
+
variant: t.enum(["circle", "square", "default", "text"]).optional().meta({ description: "Skeleton shape variant" }),
|
|
235
|
+
animate: t.boolean().optional().meta({ description: "Whether to animate the skeleton" })
|
|
236
|
+
}).optional(), je = t.lazy(() => t.union([t.string(), Hr])), g = t.object({
|
|
237
|
+
children: t.array(je).optional().meta({ description: "Child nodes to render inside this element" })
|
|
238
|
+
}), ja = g.extend({
|
|
239
|
+
type: t.literal(s.DIV),
|
|
240
|
+
args: Ht
|
|
241
|
+
}).meta({ description: "Container div element for grouping content" }), Wa = g.extend({
|
|
242
|
+
type: t.literal(s.A),
|
|
243
|
+
args: Bt
|
|
244
|
+
}).meta({ description: "Anchor/link element" }), Ga = g.extend({
|
|
245
|
+
type: t.literal(s.H),
|
|
246
|
+
args: jt
|
|
247
|
+
}).meta({ description: "Heading element (h1-h6)" }), $a = g.extend({
|
|
248
|
+
type: t.literal(s.P),
|
|
249
|
+
args: Wt
|
|
250
|
+
}).meta({ description: "Paragraph text element" }), qa = g.extend({
|
|
251
|
+
type: t.literal(s.OL),
|
|
252
|
+
args: Gt
|
|
253
|
+
}).meta({ description: "Ordered list element" }), Ha = g.extend({
|
|
254
|
+
type: t.literal(s.UL),
|
|
255
|
+
args: $t
|
|
256
|
+
}).meta({ description: "Unordered list element" }), Va = g.extend({
|
|
257
|
+
type: t.literal(s.LI),
|
|
258
|
+
args: qt
|
|
259
|
+
}).meta({ description: "List item element" }), Ma = g.extend({
|
|
260
|
+
type: t.literal(s.SPAN),
|
|
261
|
+
args: Vt
|
|
262
|
+
}).meta({ description: "Inline span element" }), Ja = g.extend({
|
|
263
|
+
type: t.literal(s.SEPARATOR),
|
|
264
|
+
args: Mt
|
|
265
|
+
}).meta({ description: "Horizontal separator / divider element" }), Xa = g.extend({
|
|
266
|
+
type: t.literal(s.ALERT),
|
|
267
|
+
args: Jt
|
|
268
|
+
}).meta({ description: "Alert message box" }), Ya = g.extend({
|
|
269
|
+
type: t.literal(s.BADGE),
|
|
270
|
+
args: Xt
|
|
271
|
+
}).meta({ description: "Badge/status indicator" }), Ka = g.extend({
|
|
272
|
+
type: t.literal(s.BUTTON),
|
|
273
|
+
args: Yt
|
|
274
|
+
}).meta({ description: "Clickable button element" }), Za = g.extend({
|
|
275
|
+
type: t.literal(s.CARD),
|
|
276
|
+
args: Kt
|
|
277
|
+
}).meta({ description: "Card container element" }), Qa = g.extend({
|
|
278
|
+
type: t.literal(s.CHECKBOX),
|
|
279
|
+
args: oa
|
|
280
|
+
}).meta({ description: "Checkbox input element" }), er = g.extend({
|
|
281
|
+
type: t.literal(s.IMAGE),
|
|
282
|
+
args: ia
|
|
283
|
+
}).meta({ description: "Image element" }), tr = g.extend({
|
|
284
|
+
type: t.literal(s.OTP),
|
|
285
|
+
args: sa
|
|
286
|
+
}).meta({ description: "One-time password (OTP) input" }), ar = g.extend({
|
|
287
|
+
type: t.literal(s.INPUT),
|
|
288
|
+
args: da
|
|
289
|
+
}).meta({ description: "Text input element" }), rr = g.extend({
|
|
290
|
+
type: t.literal(s.LABEL),
|
|
291
|
+
args: la
|
|
292
|
+
}).meta({ description: "Form label element" }), nr = g.extend({
|
|
293
|
+
type: t.literal(s.SWITCH),
|
|
294
|
+
args: ca
|
|
295
|
+
}).meta({ description: "Toggle switch element" }), or = g.extend({
|
|
296
|
+
type: t.literal(s.TEXTAREA),
|
|
297
|
+
args: ua
|
|
298
|
+
}).meta({ description: "Multi-line text input" }), ir = g.extend({
|
|
299
|
+
type: t.literal(s.SIGNATURE),
|
|
300
|
+
args: xa
|
|
301
|
+
}).meta({ description: "Signature pad input" }), sr = g.extend({
|
|
302
|
+
type: t.literal(s.CALENDAR),
|
|
303
|
+
args: va
|
|
304
|
+
}).meta({ description: "Date picker calendar" }), dr = g.extend({
|
|
305
|
+
type: t.literal(s.MAP),
|
|
306
|
+
args: ya
|
|
307
|
+
}).meta({ description: "Interactive map element" }), lr = g.extend({
|
|
308
|
+
type: t.literal(s.CARD_HEADER),
|
|
309
|
+
args: Zt
|
|
310
|
+
}).meta({ description: "Card header container" }), cr = g.extend({
|
|
311
|
+
type: t.literal(s.CARD_TITLE),
|
|
312
|
+
args: Qt
|
|
313
|
+
}).meta({ description: "Card title element" }), ur = g.extend({
|
|
314
|
+
type: t.literal(s.CARD_DESCRIPTION),
|
|
315
|
+
args: ea
|
|
316
|
+
}).meta({ description: "Card description element" }), pr = g.extend({
|
|
317
|
+
type: t.literal(s.CARD_CONTENT),
|
|
318
|
+
args: ta
|
|
319
|
+
}).meta({ description: "Card content body" }), gr = g.extend({
|
|
320
|
+
type: t.literal(s.CARD_FOOTER),
|
|
321
|
+
args: aa
|
|
322
|
+
}).meta({ description: "Card footer container" }), mr = g.extend({
|
|
323
|
+
type: t.literal(s.CARD_ACTION),
|
|
324
|
+
args: ra
|
|
325
|
+
}).meta({ description: "Card action slot" }), hr = g.extend({
|
|
326
|
+
type: t.literal(s.CARD_ICON),
|
|
327
|
+
args: na
|
|
328
|
+
}).meta({ description: "Card icon slot" }), fr = g.extend({
|
|
329
|
+
type: t.literal(s.TABLE),
|
|
330
|
+
args: wa
|
|
331
|
+
}).meta({ description: "Table container" }), br = g.extend({
|
|
332
|
+
type: t.literal(s.TABLE_HEADER),
|
|
333
|
+
args: Aa
|
|
334
|
+
}).meta({ description: "Table header section" }), xr = g.extend({
|
|
335
|
+
type: t.literal(s.TABLE_BODY),
|
|
336
|
+
args: za
|
|
337
|
+
}).meta({ description: "Table body section" }), vr = g.extend({
|
|
338
|
+
type: t.literal(s.TABLE_FOOTER),
|
|
339
|
+
args: Ia
|
|
340
|
+
}).meta({ description: "Table footer section" }), yr = g.extend({
|
|
341
|
+
type: t.literal(s.TABLE_HEAD),
|
|
342
|
+
args: ka
|
|
343
|
+
}).meta({ description: "Table header cell" }), wr = g.extend({
|
|
344
|
+
type: t.literal(s.TABLE_ROW),
|
|
345
|
+
args: Ca
|
|
346
|
+
}).meta({ description: "Table row" }), Ar = g.extend({
|
|
347
|
+
type: t.literal(s.TABLE_CELL),
|
|
348
|
+
args: Ta
|
|
349
|
+
}).meta({ description: "Table data cell" }), zr = g.extend({
|
|
350
|
+
type: t.literal(s.TABLE_CAPTION),
|
|
351
|
+
args: _a
|
|
352
|
+
}).meta({ description: "Table caption" }), Ir = g.extend({
|
|
353
|
+
type: t.literal(s.ACCORDION),
|
|
354
|
+
args: Na
|
|
355
|
+
}).meta({ description: "Accordion container" }), kr = g.extend({
|
|
356
|
+
type: t.literal(s.ACCORDION_ITEM),
|
|
357
|
+
args: Pa
|
|
358
|
+
}).meta({ description: "Accordion item" }), Cr = g.extend({
|
|
359
|
+
type: t.literal(s.ACCORDION_TRIGGER),
|
|
360
|
+
args: Ra
|
|
361
|
+
}).meta({ description: "Accordion trigger" }), Tr = g.extend({
|
|
362
|
+
type: t.literal(s.ACCORDION_CONTENT),
|
|
363
|
+
args: Sa
|
|
364
|
+
}).meta({ description: "Accordion content panel" }), _r = g.extend({
|
|
365
|
+
type: t.literal(s.AVATAR),
|
|
366
|
+
args: Da
|
|
367
|
+
}).meta({ description: "Avatar image or fallback" }), Nr = g.extend({
|
|
368
|
+
type: t.literal(s.COLLAPSIBLE),
|
|
369
|
+
args: Ea
|
|
370
|
+
}).meta({ description: "Collapsible container" }), Pr = g.extend({
|
|
371
|
+
type: t.literal(s.COLLAPSIBLE_TRIGGER),
|
|
372
|
+
args: La
|
|
373
|
+
}).meta({ description: "Collapsible trigger" }), Rr = g.extend({
|
|
374
|
+
type: t.literal(s.COLLAPSIBLE_CONTENT),
|
|
375
|
+
args: Oa
|
|
376
|
+
}).meta({ description: "Collapsible content panel" }), Sr = g.extend({
|
|
377
|
+
type: t.literal(s.LOADER),
|
|
378
|
+
args: Ua
|
|
379
|
+
}).meta({ description: "Loading spinner indicator" }), Dr = g.extend({
|
|
380
|
+
type: t.literal(s.PROGRESS),
|
|
381
|
+
args: Fa
|
|
382
|
+
}).meta({ description: "Progress bar indicator" }), Er = g.extend({
|
|
383
|
+
type: t.literal(s.SKELETON),
|
|
384
|
+
args: Ba
|
|
385
|
+
}).meta({ description: "Skeleton loading placeholder" }), Lr = g.extend({
|
|
386
|
+
type: t.literal(s.INPUT_GROUP),
|
|
387
|
+
args: pa
|
|
388
|
+
}).meta({ description: "Input group container" }), Or = g.extend({
|
|
389
|
+
type: t.literal(s.INPUT_GROUP_TEXT),
|
|
390
|
+
args: ga
|
|
391
|
+
}).meta({ description: "Text element within input group" }), Ur = g.extend({
|
|
392
|
+
type: t.literal(s.INPUT_GROUP_ADDON),
|
|
393
|
+
args: ma
|
|
394
|
+
}).meta({ description: "Addon container within input group" }), Fr = g.extend({
|
|
395
|
+
type: t.literal(s.INPUT_GROUP_INPUT),
|
|
396
|
+
args: ha
|
|
397
|
+
}).meta({ description: "Input element within input group" }), Br = g.extend({
|
|
398
|
+
type: t.literal(s.INPUT_GROUP_BUTTON),
|
|
399
|
+
args: fa
|
|
400
|
+
}).meta({ description: "Button element within input group" }), jr = g.extend({
|
|
401
|
+
type: t.literal(s.INPUT_GROUP_TEXTAREA),
|
|
402
|
+
args: ba
|
|
403
|
+
}).meta({ description: "Textarea element within input group" }), Wr = t.object({
|
|
404
|
+
items: t.string({ error: "each.items is required" }).min(1, { message: "each.items cannot be empty" }).meta({
|
|
405
|
+
description: 'Binding path to the array to iterate, e.g. "{{applicants}}". Must be a plain path (not a computed/filtered expression) so each row maps back to a real store index for two-way binding.'
|
|
406
|
+
}),
|
|
407
|
+
as: t.string({ error: "each.as is required" }).min(1, { message: "each.as cannot be empty" }).meta({ description: 'Alias name bound to the current item, e.g. "applicant"' }),
|
|
408
|
+
index: t.string().optional().meta({ description: "Alias name bound to the current numeric index" }),
|
|
409
|
+
key: t.string().optional().meta({
|
|
410
|
+
description: 'Binding expression used as the React key per row, e.g. "{{applicant.id}}". Falls back to the row index when omitted.'
|
|
411
|
+
})
|
|
412
|
+
}).strict(), Gr = g.extend({
|
|
413
|
+
type: t.literal(s.EACH),
|
|
414
|
+
args: Wr
|
|
415
|
+
}).meta({ description: "Repeats its children once per item in a bound array" }), $r = t.object({
|
|
416
|
+
condition: t.string({ error: "if.condition is required" }).min(1, { message: "if.condition cannot be empty" }).meta({ description: "Binding expression; children render only when it evaluates truthy" })
|
|
417
|
+
}).strict(), qr = g.extend({
|
|
418
|
+
type: t.literal(s.IF),
|
|
419
|
+
args: $r
|
|
420
|
+
}).meta({ description: "Conditionally renders its children based on a bound expression" }), Hr = t.discriminatedUnion("type", [
|
|
421
|
+
ja,
|
|
422
|
+
Wa,
|
|
423
|
+
Ga,
|
|
424
|
+
$a,
|
|
425
|
+
qa,
|
|
426
|
+
Ha,
|
|
427
|
+
Va,
|
|
428
|
+
Ma,
|
|
429
|
+
Ja,
|
|
430
|
+
Xa,
|
|
431
|
+
Ya,
|
|
432
|
+
Ka,
|
|
433
|
+
Za,
|
|
434
|
+
lr,
|
|
435
|
+
cr,
|
|
436
|
+
ur,
|
|
437
|
+
pr,
|
|
438
|
+
gr,
|
|
439
|
+
mr,
|
|
440
|
+
hr,
|
|
441
|
+
Qa,
|
|
442
|
+
er,
|
|
443
|
+
tr,
|
|
444
|
+
ar,
|
|
445
|
+
rr,
|
|
446
|
+
nr,
|
|
447
|
+
or,
|
|
448
|
+
ir,
|
|
449
|
+
sr,
|
|
450
|
+
dr,
|
|
451
|
+
fr,
|
|
452
|
+
br,
|
|
453
|
+
xr,
|
|
454
|
+
vr,
|
|
455
|
+
yr,
|
|
456
|
+
wr,
|
|
457
|
+
Ar,
|
|
458
|
+
zr,
|
|
459
|
+
Ir,
|
|
460
|
+
kr,
|
|
461
|
+
Cr,
|
|
462
|
+
Tr,
|
|
463
|
+
_r,
|
|
464
|
+
Nr,
|
|
465
|
+
Pr,
|
|
466
|
+
Rr,
|
|
467
|
+
Sr,
|
|
468
|
+
Dr,
|
|
469
|
+
Er,
|
|
470
|
+
Lr,
|
|
471
|
+
Or,
|
|
472
|
+
Ur,
|
|
473
|
+
Fr,
|
|
474
|
+
Br,
|
|
475
|
+
jr,
|
|
476
|
+
Gr,
|
|
477
|
+
qr
|
|
478
|
+
]), W = je;
|
|
479
|
+
t.object({
|
|
480
|
+
_id: I.meta({ readOnly: !0 }),
|
|
481
|
+
email: t.string().email().meta({
|
|
482
|
+
description: "User's email address (used as the primary identifier)",
|
|
483
|
+
example: "jack@datahaven.net",
|
|
484
|
+
readOnly: !0
|
|
485
|
+
}),
|
|
486
|
+
name: t.string().min(1).max(100).meta({ description: "Full display name", example: "Razor Jack" }),
|
|
487
|
+
emailVerified: t.boolean().nullable().optional().meta({ description: "Whether the user's email has been verified" }),
|
|
488
|
+
image: t.string().optional().meta({ description: "Avatar image URL", example: "https://cdn.datahaven.net/avatars/rj7741.png" }),
|
|
489
|
+
createdAt: C.optional().meta({ description: "When the user account was created", readOnly: !0 }),
|
|
490
|
+
updatedAt: C.optional().meta({ description: "When the user account was last updated", readOnly: !0 })
|
|
491
|
+
}).strict().meta({
|
|
492
|
+
description: "An authenticated user account. Users are distinct from organization memberships — a user may belong to multiple organizations."
|
|
493
|
+
});
|
|
494
|
+
t.object({
|
|
495
|
+
name: t.string().min(1).optional().meta({ description: "Updated display name", example: "Cyber Jack" }),
|
|
496
|
+
image: t.string().optional().meta({ description: "Updated avatar URL", example: "https://cdn.datahaven.net/avatars/cj7741.png" })
|
|
497
|
+
}).strict().meta({ description: "Update the authenticated user's profile" });
|
|
498
|
+
t.object({
|
|
499
|
+
_id: I.meta({ readOnly: !0 }),
|
|
500
|
+
clientId: t.string().min(1).meta({ description: "Unique client identifier for the organization", example: "pb-org-7f3a2b9c", readOnly: !0 }),
|
|
501
|
+
name: t.string().min(3).max(50).meta({ description: "Unique organization slug/identifier", example: "neon-shadow" }),
|
|
502
|
+
displayName: t.string().min(3).max(50).meta({ description: "Human-readable organization name shown in UI and emails", example: "Neon Shadow Corp" }),
|
|
503
|
+
legalName: t.string().min(3).max(50).meta({ description: "Legal business name for contracts and compliance", example: "Neon Shadow Corporation Ltd." }),
|
|
504
|
+
legalAddress: t.string().min(3).max(100).meta({ description: "Registered business address", example: "42 Cyber Avenue, Night City, NC 20777" }),
|
|
505
|
+
contactEmail: t.string().email().meta({ description: "Primary contact email for the organization", example: "legal@neon-shadow.io" }),
|
|
506
|
+
icon: t.string().meta({ description: "Organization icon/logo URL", example: "https://cdn.neon-shadow.io/icon.png" }),
|
|
507
|
+
banner: t.string().nullable().optional().meta({ description: "Organization banner image URL", example: "https://cdn.neon-shadow.io/banner.png" }),
|
|
508
|
+
createdBy: I.meta({ description: "User ObjectId who created the organization", readOnly: !0 }),
|
|
509
|
+
customerId: t.string().optional().nullable().meta({ description: "Stripe customer ID for billing", example: "cus_9x8y7z6w5v4u3t2s", readOnly: !0 }),
|
|
510
|
+
subscriptionId: t.string().optional().nullable().meta({ description: "Stripe subscription ID", example: "sub_1A2B3C4D5E6F7G8H", readOnly: !0 }),
|
|
511
|
+
createdAt: C.meta({ description: "When the organization was created", readOnly: !0 }),
|
|
512
|
+
updatedAt: C.meta({ description: "When the organization was last updated", readOnly: !0 })
|
|
513
|
+
}).strict().meta({
|
|
514
|
+
description: "A tenant organization. Each organization has its own isolated workspace, templates, signature requests, and API keys."
|
|
515
|
+
});
|
|
516
|
+
t.object({
|
|
517
|
+
name: t.string().min(3).max(50).meta({ description: "Unique organization slug/identifier", example: "neon-shadow" }),
|
|
518
|
+
displayName: t.string().min(3).max(50).meta({ description: "Human-readable name shown in UI", example: "Neon Shadow Corp" }),
|
|
519
|
+
legalName: t.string().min(3).max(50).meta({ description: "Legal business name", example: "Neon Shadow Corporation Ltd." }),
|
|
520
|
+
legalAddress: t.string().min(3).max(100).meta({ description: "Registered business address", example: "42 Cyber Avenue, Night City, NC 20777" }),
|
|
521
|
+
contactEmail: t.string().email().meta({ description: "Primary contact email", example: "legal@neon-shadow.io" }),
|
|
522
|
+
icon: t.string().meta({ description: "Organization icon/logo URL", example: "https://cdn.neon-shadow.io/icon.png" })
|
|
523
|
+
}).strict().meta({ description: "Create a new organization" });
|
|
524
|
+
t.object({
|
|
525
|
+
_id: I.meta({ readOnly: !0 }),
|
|
526
|
+
organization: I.meta({ description: "The organization this membership belongs to", readOnly: !0 }),
|
|
527
|
+
user: I.meta({ description: "The user who is a member of the organization", readOnly: !0 }),
|
|
528
|
+
role: t.string().min(1).meta({ description: "Role identifier (e.g. 'admin', 'member', 'viewer')", example: "admin" }),
|
|
529
|
+
permissions: t.string().min(1).meta({ description: "Permission set identifier or JSON string", example: '{"templates":"rw","forms":"r"}' }),
|
|
530
|
+
status: t.enum(["active", "inactive", "blocked"]).meta({ description: "Membership status", example: "active" }),
|
|
531
|
+
lastLogin: C.nullable().meta({ description: "When the user last logged into this organization", readOnly: !0 }),
|
|
532
|
+
createdAt: C.meta({ description: "When the membership was created", readOnly: !0 }),
|
|
533
|
+
updatedAt: C.optional().meta({ description: "When the membership was last updated", readOnly: !0 })
|
|
534
|
+
}).strict().meta({
|
|
535
|
+
description: "A user's membership within an organization. This links a User to an Organization and defines their role and permissions."
|
|
536
|
+
});
|
|
537
|
+
t.object({
|
|
538
|
+
email: t.string().email().meta({ description: "Email address of the user to invite", example: "jack@datahaven.net" }),
|
|
539
|
+
name: t.string().min(3).meta({ description: "Display name of the invited user", example: "Razor Jack" }),
|
|
540
|
+
role: t.string().min(2).meta({ description: "Role to assign (e.g. 'admin', 'member')", example: "member" }),
|
|
541
|
+
image: t.string().optional().meta({ description: "Avatar URL for the invited user", example: "https://cdn.datahaven.net/avatars/rj7741.png" }),
|
|
542
|
+
permissions: t.string().min(1).meta({ description: "Permission set to assign", example: '{"templates":"r","forms":"rw"}' })
|
|
543
|
+
}).strict().meta({ description: "Invite a user to join an organization" });
|
|
544
|
+
t.object({
|
|
545
|
+
_id: I.meta({ description: "OrganizationUser membership MongoDB ObjectId", readOnly: !0 }),
|
|
546
|
+
role: t.string().min(2).meta({ description: "Updated role", example: "viewer" }),
|
|
547
|
+
permissions: t.string().min(1).meta({ description: "Updated permission set", example: '{"templates":"r"}' })
|
|
548
|
+
}).strict().meta({ description: "Update an organization user's role or permissions" });
|
|
549
|
+
t.object({
|
|
550
|
+
_id: I.meta({ readOnly: !0 }),
|
|
551
|
+
organization: I.meta({ description: "Organization that owns this template", readOnly: !0 }),
|
|
552
|
+
createdBy: I.meta({ description: "OrganizationUser ID who created this template", readOnly: !0 }),
|
|
553
|
+
name: t.string().min(1).meta({ description: "Template name (unique within the organization)", example: "Neural_NDA_v3" }),
|
|
554
|
+
description: t.string().default("").meta({ description: "Human-readable description of the template's purpose", example: "Standard non-disclosure agreement with neural implant data clause" }),
|
|
555
|
+
config: t.any().meta({ description: "The Bonsai component tree defining the template layout and fields" }),
|
|
556
|
+
header: t.string().optional().meta({ description: "A small Bonsai component tree used for page headers in PDF rendering output" }),
|
|
557
|
+
footer: t.string().optional().meta({ description: "A small Bonsai component tree used for page footers in PDF rendering output" }),
|
|
558
|
+
contentHash: t.string().optional().meta({ description: "SHA-256 hash of the serialized config, used for deduplication", example: "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1" }),
|
|
559
|
+
css: t.string().optional().meta({ description: "Generated Tailwind CSS for the template layout" }),
|
|
560
|
+
tags: t.array(t.string()).default([]).meta({ description: "Tags for organizing and discovering templates", example: ["nda", "legal", "neural-interface"] }),
|
|
561
|
+
active: t.boolean().default(!0).meta({ description: "Whether the template is active and available for use" }),
|
|
562
|
+
lastUsed: C.nullable().optional().meta({ description: "When the template was last referenced in a signature request", readOnly: !0 }),
|
|
563
|
+
usageCount: t.number().default(0).meta({ description: "Total number of signature requests created from this template" }),
|
|
564
|
+
version: t.number().default(1).meta({ description: "Template schema version (increments on significant config changes)" }),
|
|
565
|
+
createdAt: C.meta({ description: "When the template was created", readOnly: !0 }),
|
|
566
|
+
updatedAt: C.meta({ description: "When the template was last updated", readOnly: !0 })
|
|
567
|
+
}).strict().meta({
|
|
568
|
+
description: "A reusable Bonsai signature template. Templates define the form layout via a component tree and can be referenced by ID when creating signature requests."
|
|
569
|
+
});
|
|
570
|
+
t.object({
|
|
571
|
+
ou: I.meta({ description: "OrganizationUser ID of the user creating the template" }),
|
|
572
|
+
name: t.string().min(1).meta({ description: "Template name (must be unique within the organization)", example: "Neural_NDA_v3" }),
|
|
573
|
+
description: t.string().optional().meta({ description: "Optional description of the template's purpose", example: "Standard NDA with neural implant clause" }),
|
|
574
|
+
config: W.meta({ description: "The Bonsai component tree that defines the template layout" }),
|
|
575
|
+
pdf: t.object({
|
|
576
|
+
header: W.optional().meta({ description: "PDF header Bonsai component tree" }),
|
|
577
|
+
footer: W.optional().meta({ description: "PDF footer Bonsai component tree" })
|
|
578
|
+
}).optional(),
|
|
579
|
+
tags: t.array(t.string()).optional().meta({ description: "Tags for organizing and filtering templates", example: ["nda", "legal"] })
|
|
580
|
+
}).strict().meta({ description: "Create a new reusable signature template" });
|
|
581
|
+
t.object({
|
|
582
|
+
id: t.string().meta({ description: "MongoDB ObjectId of the created template", example: "67e091ab2c4d3f22001a2b3c", readOnly: !0 }),
|
|
583
|
+
name: t.string().meta({ description: "Template name", example: "Neural_NDA_v3" }),
|
|
584
|
+
contentHash: t.string().optional().meta({ description: "SHA-256 hash of the config, useful for deduplication" })
|
|
585
|
+
}).strict().meta({ description: "Created template summary" });
|
|
586
|
+
const Vr = t.enum([
|
|
587
|
+
"pending",
|
|
588
|
+
"captured",
|
|
589
|
+
"completed",
|
|
590
|
+
"error",
|
|
591
|
+
"revoked"
|
|
592
|
+
]);
|
|
593
|
+
t.object({
|
|
594
|
+
_id: I.meta({ readOnly: !0 }),
|
|
595
|
+
id: t.string().meta({ description: "Public-facing unique request ID (random hex string)", example: "fr_a7b8c9d0e1f2", readOnly: !0 }),
|
|
596
|
+
token: t.string().meta({ description: "Verification token used for cookie-based auth in the signer's browser", readOnly: !0 }),
|
|
597
|
+
email: t.string().email().meta({ description: "Recipient email address where the signature link was sent", example: "jack@datahaven.net" }),
|
|
598
|
+
name: t.string().min(1).meta({ description: "Recipient's display name", example: "Razor Jack" }),
|
|
599
|
+
attachments: t.array(t.string()).optional().meta({ description: "Array of attachment URLs included with the form", example: ["https://files.datahaven.net/nda_v3.pdf"] }),
|
|
600
|
+
data: t.any().optional().meta({ description: "Form field data submitted by the signer" }),
|
|
601
|
+
webhooks: t.array(I).optional().meta({ description: "Webhook ObjectIds notified on lifecycle events", example: ["67e091ab2c4d3f22001a2b3c"] }),
|
|
602
|
+
metadata: t.any().optional().meta({ description: "Capture-time metadata such as IP address, user agent, and timestamps" }),
|
|
603
|
+
expiry: C.meta({ description: "When the signature request link expires" }),
|
|
604
|
+
due: C.optional().nullable().meta({ description: "Soft deadline for completing the signature" }),
|
|
605
|
+
digest: t.string().meta({ description: "SHA-256 hash of the serialized payload, used for deduplication", readOnly: !0 }),
|
|
606
|
+
template: t.any().meta({ description: "Snapshot of the Bonsai component tree config at the time of form creation", readOnly: !0 }),
|
|
607
|
+
header: t.any().meta({ description: "Snapshot of the (small) Bonsai component tree config used for the output PDF page header rendering", readOnly: !0 }),
|
|
608
|
+
footer: t.any().meta({ description: "Snapshot of the (small) Bonsai component tree config used for the output PDF page footer rendering", readOnly: !0 }),
|
|
609
|
+
css: t.string().meta({ description: "Tailwind CSS generated from the template at the time of form creation", readOnly: !0 }),
|
|
610
|
+
status: Vr.meta({ description: "Current lifecycle status of the form request", example: "pending" }),
|
|
611
|
+
organization: I.meta({ description: "Organization that owns this form request", readOnly: !0 }),
|
|
612
|
+
createdAt: C.meta({ description: "When the form request was created", readOnly: !0 }),
|
|
613
|
+
updatedAt: C.meta({ description: "When the form request was last updated", readOnly: !0 })
|
|
614
|
+
}).strict().meta({
|
|
615
|
+
description: "A signature request sent to a recipient. Tracks the full lifecycle from creation through signing, completion, or revocation."
|
|
616
|
+
});
|
|
617
|
+
t.object({
|
|
618
|
+
name: t.string().min(1).meta({ description: "Recipient's display name (used in the email greeting and form header)", example: "Razor Jack" }),
|
|
619
|
+
email: t.string().email().meta({ description: "Recipient email address where the signature link will be sent", example: "jack@datahaven.net" }),
|
|
620
|
+
template: t.union([W, t.string()]).meta({
|
|
621
|
+
description: "Either an inline Bonsai component tree config, or a saved template MongoDB ObjectId to use as the form layout"
|
|
622
|
+
}),
|
|
623
|
+
expiry: t.coerce.date().optional().meta({ description: "When the signature request link expires (ISO 8601 date)", example: "2077-12-25T23:59:59Z" }),
|
|
624
|
+
due: t.coerce.date().optional().meta({ description: "Soft deadline for the signature (ISO 8601 date)", example: "2077-12-20T18:00:00Z" }),
|
|
625
|
+
webhooks: t.array(t.string()).min(1).meta({ description: "Array of webhook ObjectIds to notify on form lifecycle events", example: ["67e091ab2c4d3f22001a2b3c"] }),
|
|
626
|
+
attachments: t.array(t.string()).optional().meta({ description: "Array of attachment URLs to include with the form", example: ["https://files.datahaven.net/nda_v3.pdf"] }),
|
|
627
|
+
metadata: t.any().optional().meta({ description: "Arbitrary metadata to associate with the form request", example: { department: "Legal", priority: "high" } }),
|
|
628
|
+
data: t.any().optional().meta({ description: "Pre-filled form field data to populate the form on load", example: { full_name: "Razor Jack", badge_id: "RJ-7741" } }),
|
|
629
|
+
pdf: t.union([t.boolean(), t.object({
|
|
630
|
+
header: t.union([W, t.string()]).optional().meta({ description: "A (small) Bonsai component tree config used for the output PDF page header rendering" }),
|
|
631
|
+
footer: t.union([W, t.string()]).optional().meta({ description: "A (small) Bonsai component tree config used for the output PDF page footer rendering" })
|
|
632
|
+
})]).optional().meta({ description: "PDF file config object (header||footer) or `true/false` boolean to trigger PDF file generation after form capture" })
|
|
633
|
+
}).strict().meta({ description: "Create a new signature request targeting a recipient" });
|
|
634
|
+
t.object({
|
|
635
|
+
formId: t.string().meta({ description: "MongoDB ObjectId of the newly created form request", example: "67e091ab2c4d3f22001a2b3c", readOnly: !0 })
|
|
636
|
+
}).strict().meta({ description: "Created form request identifier" });
|
|
637
|
+
t.object({
|
|
638
|
+
reason: t.string().optional().meta({ description: "Optional explanation for why the form was revoked (logged for audit)", example: "Signer compromised — ICE breach detected on endpoint" })
|
|
639
|
+
}).strict().meta({ description: "Payload for revoking a signature request" });
|
|
640
|
+
t.object({
|
|
641
|
+
email: t.string().email().optional().meta({ description: "Override the recipient email address (uses the original if omitted)", example: "jack@neon-shadow.io" })
|
|
642
|
+
}).strict().meta({ description: "Payload for re-sending the signature request email" });
|
|
643
|
+
t.object({
|
|
644
|
+
data: t.record(t.string(), t.any()).optional().meta({
|
|
645
|
+
description: "Form field data collected from the signer",
|
|
646
|
+
example: { signature: "data:image/png;base64,iVBOR...", accepted_terms: !0 }
|
|
647
|
+
})
|
|
648
|
+
}).strict().meta({ description: "Submit captured form data from the signer's browser session" });
|
|
649
|
+
t.object({
|
|
650
|
+
_id: I.meta({ readOnly: !0 }),
|
|
651
|
+
id: t.string().meta({ description: "Public key identifier (e.g. pb-xxxx). Used as the 'client' field when authenticating.", example: "pb-a7f3b2c9d1e8f4a5b6c7d8e9", readOnly: !0 }),
|
|
652
|
+
secret: t.string().meta({ description: "Encrypted API key secret — only viewable at creation time", readOnly: !0 }),
|
|
653
|
+
allowedOrigins: t.array(t.string()).default([]).meta({ description: "CORS origin allowlist. Requests from origins not in this list are rejected.", example: ["https://console.neon-shadow.io"] }),
|
|
654
|
+
allowedIps: t.array(t.string()).default([]).meta({ description: "IP CIDR allowlist. Requests from IPs not in this list are rejected.", example: ["203.0.113.0/24"] }),
|
|
655
|
+
active: t.boolean().default(!0).meta({ description: "Whether the key is active and can be used for authentication" }),
|
|
656
|
+
expiry: C.meta({ description: "When the API key expires and can no longer be used" }),
|
|
657
|
+
lastUsed: C.meta({ description: "Timestamp of the most recent request using this key", readOnly: !0 }),
|
|
658
|
+
audience: t.enum(["internal", "external"]).meta({ description: "Key audience — 'internal' for server-to-server, 'external' for client-side", example: "internal" }),
|
|
659
|
+
organization: I.meta({ description: "Organization this key belongs to", readOnly: !0 }),
|
|
660
|
+
generatedBy: I.meta({ description: "OrganizationUser ID who created this key", readOnly: !0 }),
|
|
661
|
+
createdAt: C.meta({ description: "When the API key was created", readOnly: !0 }),
|
|
662
|
+
updatedAt: C.meta({ description: "When the API key was last updated", readOnly: !0 })
|
|
663
|
+
}).strict().meta({
|
|
664
|
+
description: "An API key scoped to an organization. Each key has configurable IP and origin restrictions for fine-grained access control."
|
|
665
|
+
});
|
|
666
|
+
t.object({
|
|
667
|
+
ou: I.meta({ description: "OrganizationUser ID of the user creating the API key" }),
|
|
668
|
+
expiry: t.coerce.date().optional().meta({ description: "Key expiration date (defaults to +1 year from creation)", example: "2078-12-19T00:00:00Z" }),
|
|
669
|
+
audience: t.enum(["internal", "external"]).meta({ description: "Key audience — 'internal' for server-to-server, 'external' for client-side usage", example: "internal" }),
|
|
670
|
+
allowedOrigins: t.array(t.string()).optional().meta({ description: "CORS origin allowlist (e.g. ['https://app.example.com']). Empty array disables origin restriction.", example: ["https://console.neon-shadow.io", "https://api.datahaven.net"] }),
|
|
671
|
+
allowedIps: t.array(t.string()).optional().meta({ description: "IP CIDR allowlist (e.g. ['203.0.113.0/24']). Empty array disables IP restriction.", example: ["203.0.113.0/24", "10.0.0.0/8"] })
|
|
672
|
+
}).strict().meta({ description: "Payload for creating a new API key" });
|
|
673
|
+
t.object({
|
|
674
|
+
id: t.string().meta({ description: "Public API key ID (e.g. pb-xxxx)", example: "pb-a7f3b2c9d1e8f4a5b6c7d8e9", readOnly: !0 }),
|
|
675
|
+
secret: t.string().meta({ description: "API key secret — **this is the only time the secret is returned**. Store it securely.", readOnly: !0 })
|
|
676
|
+
}).strict().meta({ description: "API key credentials — the secret is only shown once" });
|
|
677
|
+
t.object({
|
|
678
|
+
_id: I.meta({ readOnly: !0 }),
|
|
679
|
+
id: t.string().meta({ description: "Public webhook identifier (e.g. pb-wbhk-xxxx)", example: "pb-wbhk-a7b8c9d0", readOnly: !0 }),
|
|
680
|
+
url: t.string().url().meta({ description: "HTTPS endpoint receiving POST event notifications", example: "https://hooks.datahaven.net/events" }),
|
|
681
|
+
secret: t.string().meta({ description: "HMAC-SHA256 signing secret — used to verify that webhook payloads genuinely came from Bonsai", readOnly: !0 }),
|
|
682
|
+
active: t.boolean().default(!0).meta({ description: "Whether the webhook is active and receiving events" }),
|
|
683
|
+
lastUsed: C.meta({ description: "When the webhook last received an event", readOnly: !0 }),
|
|
684
|
+
organization: I.meta({ description: "Organization that owns this webhook", readOnly: !0 }),
|
|
685
|
+
generatedBy: I.meta({ description: "OrganizationUser ID who created this webhook", readOnly: !0 }),
|
|
686
|
+
createdAt: C.meta({ description: "When the webhook was created", readOnly: !0 }),
|
|
687
|
+
updatedAt: C.meta({ description: "When the webhook was last updated", readOnly: !0 })
|
|
688
|
+
}).strict().meta({
|
|
689
|
+
description: "A webhook destination for form request lifecycle events. When a form is created, signed, or revoked, Bonsai sends a POST request to this URL with a JSON payload signed via HMAC-SHA256."
|
|
690
|
+
});
|
|
691
|
+
t.object({
|
|
692
|
+
ou: I.meta({ description: "OrganizationUser ID of the user creating the webhook" }),
|
|
693
|
+
url: t.string().url().meta({ description: "HTTPS endpoint that will receive POST event notifications", example: "https://hooks.datahaven.net/events" })
|
|
694
|
+
}).strict().meta({ description: "Payload for creating a new webhook destination" });
|
|
695
|
+
t.object({
|
|
696
|
+
id: t.string().meta({ description: "Webhook MongoDB ObjectId", example: "67e091ab2c4d3f22001a2b3c", readOnly: !0 }),
|
|
697
|
+
secret: t.string().meta({ description: "HMAC signing secret — **this is the only time the secret is returned**. Use it to verify webhook payload authenticity.", readOnly: !0 })
|
|
698
|
+
}).strict().meta({ description: "Webhook credentials — the signing secret is only shown once" });
|
|
699
|
+
t.object({
|
|
700
|
+
client: t.string().min(1).meta({ description: "API key ID (e.g. pb-xxxx)", example: "pb-7f3a2b9c1d8e4f5a6b7c8d9e" }),
|
|
701
|
+
secret: t.string().min(1).meta({ description: "API key secret", example: "sk_liv...1f0e" }),
|
|
702
|
+
refresh: t.boolean().optional().meta({ description: "If true, also issues a refresh token (30 day expiry)", example: !0 })
|
|
703
|
+
}).strict().meta({ description: "Credentials for obtaining a JWT access token" });
|
|
704
|
+
t.object({
|
|
705
|
+
token: t.string().meta({ description: "JWT access token (1 hour expiry). Include as Bearer token in subsequent requests.", example: "eyJhbGciOiJIUzI1NiIs...f456" }),
|
|
706
|
+
refresh: t.string().optional().meta({ description: "Refresh token (30 day expiry). Use at POST /v1/token/refresh to get a new JWT without re-entering credentials.", example: "rt_live_8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d" })
|
|
707
|
+
}).strict().meta({ description: "Token response containing JWT and optional refresh token" });
|
|
708
|
+
t.object({
|
|
709
|
+
refreshToken: t.string().min(1).meta({ description: "Refresh token obtained from a prior POST /v1/token response", example: "rt_live_8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d" })
|
|
710
|
+
}).strict().meta({ description: "Request to refresh an expired JWT using a refresh token" });
|
|
711
|
+
t.object({
|
|
712
|
+
token: t.string().meta({ description: "New JWT access token (1 hour expiry)", example: "eyJhbGciOiJIUzI1NiIs...c012" })
|
|
713
|
+
}).strict().meta({ description: "New JWT access token" });
|
|
714
|
+
const Mr = t.enum([
|
|
715
|
+
"application/pdf",
|
|
716
|
+
"image/png",
|
|
717
|
+
"image/jpeg",
|
|
718
|
+
"image/webp",
|
|
719
|
+
"text/plain",
|
|
720
|
+
"text/csv"
|
|
721
|
+
]);
|
|
722
|
+
t.object({
|
|
723
|
+
ttl: t.coerce.number().int().min(60).max(86400).default(3600).meta({ description: "Signed URL lifetime in seconds (default 3600, min 60, max 86400 [24h])", example: 3600 })
|
|
724
|
+
}).strict().meta({ description: "Query parameters for generating a signed download URL" });
|
|
725
|
+
t.object({
|
|
726
|
+
downloadUrl: t.string().url().meta({ description: "Pre-signed GCS download URL", example: "https://storage.googleapis.com/bonsai-secure/f1e2d3...X-Goog-Signature=def456" }),
|
|
727
|
+
filename: t.string().meta({ description: "Original filename (for Content-Disposition)", example: "signed_nda_razorjack.pdf" }),
|
|
728
|
+
mimeType: Mr.meta({ description: "MIME type (for Content-Type)", example: "application/pdf" }),
|
|
729
|
+
size: t.number().int().meta({ description: "File size in bytes", example: 245760 })
|
|
730
|
+
}).strict().meta({ description: "Signed download URL for secure file access" });
|
|
731
|
+
const Jr = t.enum([
|
|
732
|
+
"pending",
|
|
733
|
+
"generating",
|
|
734
|
+
"completed",
|
|
735
|
+
"error",
|
|
736
|
+
"revoked"
|
|
737
|
+
]);
|
|
738
|
+
t.object({
|
|
739
|
+
_id: I.meta({ readOnly: !0 }),
|
|
740
|
+
id: t.string().meta({ description: "Public-facing unique request ID (random hex string)", example: "fr_a7b8c9d0e1f2", readOnly: !0 }),
|
|
741
|
+
token: t.string().meta({ description: "Verification token used for cookie-based auth in the signer's browser", readOnly: !0 }),
|
|
742
|
+
data: t.any().optional().meta({ description: "Form field data submitted by the signer/requester" }),
|
|
743
|
+
webhooks: t.array(I).optional().meta({ description: "Webhook ObjectIds notified on lifecycle events", example: ["67e091ab2c4d3f22001a2b3c"] }),
|
|
744
|
+
metadata: t.any().optional().meta({ description: "File metadata such as size, contentType, etc." }),
|
|
745
|
+
digest: t.string().meta({ description: "SHA-256 hash of the serialized payload, used for deduplication", readOnly: !0 }),
|
|
746
|
+
template: t.any().meta({ description: "Snapshot of the Bonsai component tree config at the time of PDF creation" }),
|
|
747
|
+
header: t.any().meta({ description: "Snapshot of the (small) Bonsai component tree config used for the output PDF page header rendering" }),
|
|
748
|
+
footer: t.any().meta({ description: "Snapshot of the (small) Bonsai component tree config used for the output PDF page footer rendering" }),
|
|
749
|
+
css: t.string().meta({ description: "Tailwind CSS generated from the template at the time of PDF generation request", readOnly: !0 }),
|
|
750
|
+
status: Jr.meta({ description: "Current lifecycle status of the PDF request", example: "pending" }),
|
|
751
|
+
organization: I.meta({ description: "Organization that owns this PDF request", readOnly: !0 }),
|
|
752
|
+
createdAt: C.meta({ description: "When the PDF request was created", readOnly: !0 }),
|
|
753
|
+
updatedAt: C.meta({ description: "When the PDF request was last updated", readOnly: !0 })
|
|
754
|
+
}).strict().meta({
|
|
755
|
+
description: "A PDF request used to trigger the generation of a custom PDF file. Tracks the full lifecycle and alerts sends results via webhook."
|
|
756
|
+
});
|
|
757
|
+
t.object({
|
|
758
|
+
template: t.union([W, t.string()]).meta({
|
|
759
|
+
description: "Either an inline Bonsai component tree config, or a saved template MongoDB ObjectId to use as the PDF content layout"
|
|
760
|
+
}),
|
|
761
|
+
webhooks: t.array(t.string()).min(1).meta({ description: "Array of webhook ObjectIds to notify on form lifecycle events", example: ["67e091ab2c4d3f22001a2b3c"] }),
|
|
762
|
+
metadata: t.any().optional().meta({ description: "Arbitrary metadata to associate with the PDF request", example: { department: "Legal", priority: "high" } }),
|
|
763
|
+
data: t.any().optional().meta({ description: "Pre-filled template field data to populate the PDF with", example: { full_name: "Razor Jack", badge_id: "RJ-7741" } }),
|
|
764
|
+
header: t.union([W, t.string()]).optional().meta({ description: "A (small) Bonsai component tree config used for the output PDF page header rendering" }),
|
|
765
|
+
footer: t.union([W, t.string()]).optional().meta({ description: "A (small) Bonsai component tree config used for the output PDF page footer rendering" })
|
|
766
|
+
}).strict().meta({ description: "Create a new PDF request to generate a PDF file from a Bonsai template" });
|
|
767
|
+
t.object({
|
|
768
|
+
pdfId: t.string().meta({ description: "MongoDB ObjectId of the newly created PDF request (this is NOT the rendered pdf file - a file ID is returned after async pdf generation via webhook)", example: "67e091ab2c4d3f22001a2b3c", readOnly: !0 })
|
|
769
|
+
}).strict().meta({ description: "Created form request identifier" });
|
|
770
|
+
st.config({
|
|
771
|
+
customError: dt()
|
|
772
|
+
});
|
|
773
|
+
const We = E.forwardRef(({ ...e }, a) => /* @__PURE__ */ i("a", { ref: a, ...e }));
|
|
774
|
+
We.displayName = "A";
|
|
775
|
+
function l(...e) {
|
|
776
|
+
return ct(lt(e));
|
|
777
|
+
}
|
|
778
|
+
const Xr = _("font-heading font-semibold scroll-m-20", {
|
|
779
|
+
variants: {
|
|
780
|
+
variant: {
|
|
781
|
+
h1: "text-6xl font-semibold tracking-tight",
|
|
782
|
+
h2: "text-4xl font-semibold tracking-tight first:mt-0",
|
|
783
|
+
h3: "text-2xl font-semibold tracking-tight",
|
|
784
|
+
h4: "text-xl font-semibold tracking-tight",
|
|
785
|
+
h5: "text-lg font-semibold tracking-tight",
|
|
786
|
+
h6: "text-base font-semibold tracking-tight"
|
|
787
|
+
}
|
|
788
|
+
},
|
|
789
|
+
defaultVariants: {
|
|
790
|
+
variant: "h3"
|
|
791
|
+
}
|
|
792
|
+
}), Ge = E.forwardRef(
|
|
793
|
+
({ className: e, variant: a, as: r, ...n }, o) => /* @__PURE__ */ i(
|
|
794
|
+
r || a || "h3",
|
|
795
|
+
{
|
|
796
|
+
ref: o,
|
|
797
|
+
className: l(Xr({ variant: a }), e),
|
|
798
|
+
...n
|
|
799
|
+
}
|
|
800
|
+
)
|
|
801
|
+
);
|
|
802
|
+
Ge.displayName = "H";
|
|
803
|
+
const Yr = _("text-base", {
|
|
804
|
+
variants: {
|
|
805
|
+
variant: {
|
|
806
|
+
default: "",
|
|
807
|
+
muted: "text-muted"
|
|
808
|
+
},
|
|
809
|
+
size: {
|
|
810
|
+
xs: "text-xs font-light leading-snug",
|
|
811
|
+
sm: "text-sm font-light leading-snug",
|
|
812
|
+
md: "text-base",
|
|
813
|
+
lg: "text-lg font-semibold",
|
|
814
|
+
xl: "text-xl font-bold"
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
defaultVariants: {
|
|
818
|
+
variant: "default",
|
|
819
|
+
size: "md"
|
|
820
|
+
}
|
|
821
|
+
}), $e = E.forwardRef(
|
|
822
|
+
({ className: e, variant: a, size: r, as: n = "p", ...o }, d) => /* @__PURE__ */ i(
|
|
823
|
+
n,
|
|
824
|
+
{
|
|
825
|
+
ref: d,
|
|
826
|
+
className: l(Yr({ variant: a, size: r }), e),
|
|
827
|
+
...o
|
|
828
|
+
}
|
|
829
|
+
)
|
|
830
|
+
);
|
|
831
|
+
$e.displayName = "P";
|
|
832
|
+
const Kr = [
|
|
833
|
+
{ duration: 10, intensity: 0.2 },
|
|
834
|
+
{ duration: 5, delay: 120, intensity: 0.4 }
|
|
835
|
+
], Zr = [{ duration: 10, intensity: 0.2 }], Qr = [
|
|
836
|
+
{ duration: 10, intensity: 0.2 },
|
|
837
|
+
{ duration: 5, delay: 190, intensity: 0.4 }
|
|
838
|
+
], en = [{ duration: 20, intensity: 0.2 }], tn = [{ duration: 10, intensity: 0.2 }], an = _("flex w-full flex-col", {
|
|
839
|
+
variants: {
|
|
840
|
+
variant: {
|
|
841
|
+
default: "",
|
|
842
|
+
contained: "",
|
|
843
|
+
separated: "gap-4"
|
|
844
|
+
},
|
|
845
|
+
raised: {
|
|
846
|
+
xs: "",
|
|
847
|
+
sm: "",
|
|
848
|
+
md: "",
|
|
849
|
+
lg: ""
|
|
850
|
+
},
|
|
851
|
+
extrude: {
|
|
852
|
+
xs: "",
|
|
853
|
+
sm: "",
|
|
854
|
+
md: "",
|
|
855
|
+
lg: ""
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
defaultVariants: {
|
|
859
|
+
variant: "default"
|
|
860
|
+
}
|
|
861
|
+
});
|
|
862
|
+
function rn({
|
|
863
|
+
className: e,
|
|
864
|
+
variant: a = "default",
|
|
865
|
+
raised: r,
|
|
866
|
+
extrude: n,
|
|
867
|
+
...o
|
|
868
|
+
}) {
|
|
869
|
+
return /* @__PURE__ */ i(
|
|
870
|
+
Q.Root,
|
|
871
|
+
{
|
|
872
|
+
"data-slot": "accordion",
|
|
873
|
+
"data-variant": a,
|
|
874
|
+
"data-raised": r ?? void 0,
|
|
875
|
+
"data-extrude": n ?? void 0,
|
|
876
|
+
className: l(
|
|
877
|
+
an({ variant: a, raised: r, extrude: n }),
|
|
878
|
+
"group/accordion",
|
|
879
|
+
e
|
|
880
|
+
),
|
|
881
|
+
...o
|
|
882
|
+
}
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
function nn({ className: e, ...a }) {
|
|
886
|
+
return /* @__PURE__ */ i(
|
|
887
|
+
Q.Item,
|
|
888
|
+
{
|
|
889
|
+
"data-slot": "accordion-item",
|
|
890
|
+
className: l(
|
|
891
|
+
"group/accordion-item",
|
|
892
|
+
"data-closed:z-1 data-open:z-2 transition-[box-shadow,translate] linear duration-200",
|
|
893
|
+
"group-data-[variant=default]/accordion:bg-surface",
|
|
894
|
+
"group-data-[variant=default]/accordion:first:rounded-t-base",
|
|
895
|
+
"group-data-[variant=default]/accordion:last:rounded-b-base",
|
|
896
|
+
"group-data-[variant=default]/accordion:border-b",
|
|
897
|
+
"group-data-[variant=default]/accordion:last:border-b-transparent",
|
|
898
|
+
"group-data-[variant=contained]/accordion:bg-surface",
|
|
899
|
+
"group-data-[variant=contained]/accordion:first:rounded-t-base",
|
|
900
|
+
"group-data-[variant=contained]/accordion:last:rounded-b-base",
|
|
901
|
+
"group-data-[variant=contained]/accordion:border-2",
|
|
902
|
+
"group-data-[variant=contained]/accordion:border-border",
|
|
903
|
+
"group-data-[variant=contained]/accordion:not-last:data-closed:-mb-1",
|
|
904
|
+
"group-data-[variant=separated]/accordion:bg-surface",
|
|
905
|
+
"group-data-[variant=separated]/accordion:border-2",
|
|
906
|
+
"group-data-[variant=separated]/accordion:border-border",
|
|
907
|
+
"group-data-[variant=separated]/accordion:rounded-base",
|
|
908
|
+
"group-data-[variant=separated]/accordion:data-closed:not-last:mb-0",
|
|
909
|
+
"group-data-raised/accordion:data-open:z-1",
|
|
910
|
+
"group-data-raised/accordion:border",
|
|
911
|
+
"group-data-raised/accordion:border-border",
|
|
912
|
+
"group-data-raised/accordion:not-last:data-closed:-mb-1",
|
|
913
|
+
"group-data-[raised=xs]/accordion:shadow-xs group-data-[raised=xs]/accordion:-translate-0.5",
|
|
914
|
+
"group-data-[raised=sm]/accordion:shadow-sm group-data-[raised=sm]/accordion:-translate-0.75",
|
|
915
|
+
"group-data-[raised=md]/accordion:shadow-md group-data-[raised=md]/accordion:-translate-1",
|
|
916
|
+
"group-data-[raised=lg]/accordion:shadow-lg group-data-[raised=lg]/accordion:-translate-1.25",
|
|
917
|
+
"group-data-extrude/accordion:data-open:z-1",
|
|
918
|
+
"group-data-extrude/accordion:border",
|
|
919
|
+
"group-data-extrude/accordion:data-open:border-border",
|
|
920
|
+
"group-data-extrude/accordion:not-last:data-open:-mb-1",
|
|
921
|
+
"group-data-extrude/accordion:border-t-transparent",
|
|
922
|
+
"group-data-extrude/accordion:border-l-transparent",
|
|
923
|
+
"group-data-extrude/accordion:border-r-transparent",
|
|
924
|
+
"group-data-[extrude=xs]/accordion:data-open:shadow-xs group-data-[extrude=xs]/accordion:data-open:-translate-0.5",
|
|
925
|
+
"group-data-[extrude=sm]/accordion:data-open:shadow-sm group-data-[extrude=sm]/accordion:data-open:-translate-0.75",
|
|
926
|
+
"group-data-[extrude=md]/accordion:data-open:shadow-md group-data-[extrude=md]/accordion:data-open:-translate-1",
|
|
927
|
+
"group-data-[extrude=lg]/accordion:data-open:shadow-lg group-data-[extrude=lg]/accordion:data-open:-translate-1.25",
|
|
928
|
+
e
|
|
929
|
+
),
|
|
930
|
+
...a
|
|
931
|
+
}
|
|
932
|
+
);
|
|
933
|
+
}
|
|
934
|
+
function on({
|
|
935
|
+
className: e,
|
|
936
|
+
children: a,
|
|
937
|
+
disabled: r,
|
|
938
|
+
icon: n = me,
|
|
939
|
+
onClick: o,
|
|
940
|
+
...d
|
|
941
|
+
}) {
|
|
942
|
+
const { trigger: c } = ae();
|
|
943
|
+
return /* @__PURE__ */ i(Q.Header, { className: "flex", children: /* @__PURE__ */ k(
|
|
944
|
+
Q.Trigger,
|
|
945
|
+
{
|
|
946
|
+
"data-slot": "accordion-trigger",
|
|
947
|
+
className: l(
|
|
948
|
+
"neo-base neo-accordion-focus pt-3 text-left text-base font-medium cursor-pointer shrink-0 group/accordion-trigger relative flex flex-1 items-center justify-between border border-transparent transition-[opacity,border], data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
949
|
+
"p-4",
|
|
950
|
+
"hover:underline",
|
|
951
|
+
"group-first/accordion-item:rounded-t-base",
|
|
952
|
+
"group-last/accordion-item:group-data-closed/accordion-item:rounded-b-base",
|
|
953
|
+
"group-data-open/accordion-item:group-has-data-[slot=accordion-content]/accordion-item:pb-2",
|
|
954
|
+
"group-data-open/accordion-item:group-has-data-[slot=accordion-content]/accordion-item:mb-2",
|
|
955
|
+
"group-data-[variant=separated]/accordion:pt-4",
|
|
956
|
+
e
|
|
957
|
+
),
|
|
958
|
+
onClick: (p) => {
|
|
959
|
+
c(tn), o?.(p);
|
|
960
|
+
},
|
|
961
|
+
...d,
|
|
962
|
+
children: [
|
|
963
|
+
a,
|
|
964
|
+
/* @__PURE__ */ i(
|
|
965
|
+
n,
|
|
966
|
+
{
|
|
967
|
+
"data-slot": "accordion-trigger-icon",
|
|
968
|
+
className: l(
|
|
969
|
+
"group-aria-expanded/accordion-trigger:-rotate-180 transition-[rotate] duration-300",
|
|
970
|
+
"text-muted ml-auto size-4 pointer-events-none"
|
|
971
|
+
)
|
|
972
|
+
}
|
|
973
|
+
)
|
|
974
|
+
]
|
|
975
|
+
}
|
|
976
|
+
) });
|
|
977
|
+
}
|
|
978
|
+
function sn({
|
|
979
|
+
className: e,
|
|
980
|
+
children: a,
|
|
981
|
+
...r
|
|
982
|
+
}) {
|
|
983
|
+
return /* @__PURE__ */ i(
|
|
984
|
+
Q.Panel,
|
|
985
|
+
{
|
|
986
|
+
"data-slot": "accordion-content",
|
|
987
|
+
keepMounted: !0,
|
|
988
|
+
className: "overflow-hidden text-sm transition-[height] duration-300 ease-out data-ending-style:h-0 data-starting-style:h-0 h-(--accordion-panel-height)",
|
|
989
|
+
...r,
|
|
990
|
+
children: /* @__PURE__ */ i(
|
|
991
|
+
"div",
|
|
992
|
+
{
|
|
993
|
+
className: l(
|
|
994
|
+
"pt-0 px-4 pb-4 data-ending-style:h-0 data-starting-style:h-0 [&_p:not(:last-child)]:mb-4",
|
|
995
|
+
e
|
|
996
|
+
),
|
|
997
|
+
children: a
|
|
998
|
+
}
|
|
999
|
+
)
|
|
1000
|
+
}
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
const dn = _(
|
|
1004
|
+
"relative grid px-4 py-3 gap-0.5 rounded-base border text-left text-sm *:[svg]:row-span-2 *:[svg]:translate-y-1 *:[svg]:text-current has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-24 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5",
|
|
1005
|
+
{
|
|
1006
|
+
variants: {
|
|
1007
|
+
variant: {
|
|
1008
|
+
default: "bg-surface text-card-foreground",
|
|
1009
|
+
success: "bg-main-secondary text-card-foreground",
|
|
1010
|
+
warning: "text-foreground bg-accent-yellow-secondary",
|
|
1011
|
+
destructive: "text-foreground bg-accent-red-secondary border-border *:[svg]:text-current"
|
|
1012
|
+
},
|
|
1013
|
+
size: {
|
|
1014
|
+
default: "w-full",
|
|
1015
|
+
sm: "w-sm",
|
|
1016
|
+
lg: "w-full"
|
|
1017
|
+
},
|
|
1018
|
+
raised: {
|
|
1019
|
+
xs: "shadow-xs -translate-0.5",
|
|
1020
|
+
sm: "shadow-sm -translate-0.75",
|
|
1021
|
+
md: "shadow-md -translate-1",
|
|
1022
|
+
lg: "shadow-lg -translate-1.25",
|
|
1023
|
+
xl: "shadow-xl -translate-1.5"
|
|
1024
|
+
}
|
|
1025
|
+
},
|
|
1026
|
+
defaultVariants: {
|
|
1027
|
+
variant: "default"
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
);
|
|
1031
|
+
function ln({
|
|
1032
|
+
className: e,
|
|
1033
|
+
variant: a = "default",
|
|
1034
|
+
size: r = "default",
|
|
1035
|
+
raised: n,
|
|
1036
|
+
...o
|
|
1037
|
+
}) {
|
|
1038
|
+
return /* @__PURE__ */ i(
|
|
1039
|
+
"div",
|
|
1040
|
+
{
|
|
1041
|
+
"data-slot": "alert",
|
|
1042
|
+
role: "alert",
|
|
1043
|
+
className: l(
|
|
1044
|
+
dn({ variant: a, raised: n, size: r }),
|
|
1045
|
+
"group/alert",
|
|
1046
|
+
e
|
|
1047
|
+
),
|
|
1048
|
+
...o
|
|
1049
|
+
}
|
|
1050
|
+
);
|
|
1051
|
+
}
|
|
1052
|
+
const cn = _("relative flex shrink-0 select-none", {
|
|
1053
|
+
variants: {
|
|
1054
|
+
size: {
|
|
1055
|
+
full: "size-full",
|
|
1056
|
+
sm: "size-8",
|
|
1057
|
+
md: "size-10",
|
|
1058
|
+
lg: "size-12",
|
|
1059
|
+
xl: "size-14"
|
|
1060
|
+
},
|
|
1061
|
+
raised: {
|
|
1062
|
+
xs: "shadow-xs -translate-0.5 ring-0",
|
|
1063
|
+
sm: "shadow-sm -translate-0.75 ring-0",
|
|
1064
|
+
md: "shadow-md -translate-1 ring-0",
|
|
1065
|
+
lg: "shadow-lg -translate-1.25 ring-0"
|
|
1066
|
+
},
|
|
1067
|
+
rounded: {
|
|
1068
|
+
none: "",
|
|
1069
|
+
sm: "rounded-sm",
|
|
1070
|
+
md: "rounded-md",
|
|
1071
|
+
lg: "rounded-lg",
|
|
1072
|
+
full: "rounded-full"
|
|
1073
|
+
}
|
|
1074
|
+
},
|
|
1075
|
+
defaultVariants: {
|
|
1076
|
+
size: "md",
|
|
1077
|
+
rounded: "full"
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
function un({
|
|
1081
|
+
className: e,
|
|
1082
|
+
size: a = "md",
|
|
1083
|
+
rounded: r = "full",
|
|
1084
|
+
raised: n,
|
|
1085
|
+
src: o,
|
|
1086
|
+
alt: d,
|
|
1087
|
+
fallback: c,
|
|
1088
|
+
badge: p,
|
|
1089
|
+
children: u,
|
|
1090
|
+
...h
|
|
1091
|
+
}) {
|
|
1092
|
+
return /* @__PURE__ */ i(
|
|
1093
|
+
ue.Root,
|
|
1094
|
+
{
|
|
1095
|
+
"data-slot": "avatar",
|
|
1096
|
+
"data-size": a,
|
|
1097
|
+
"data-raised": n,
|
|
1098
|
+
"data-rounded": r,
|
|
1099
|
+
className: l(
|
|
1100
|
+
cn({ size: a, rounded: r, raised: n }),
|
|
1101
|
+
"group/avatar",
|
|
1102
|
+
e
|
|
1103
|
+
),
|
|
1104
|
+
...h,
|
|
1105
|
+
children: u ?? /* @__PURE__ */ k(B, { children: [
|
|
1106
|
+
o && /* @__PURE__ */ i(
|
|
1107
|
+
ue.Image,
|
|
1108
|
+
{
|
|
1109
|
+
"data-slot": "avatar-image",
|
|
1110
|
+
className: l(
|
|
1111
|
+
"aspect-square size-full object-cover border",
|
|
1112
|
+
"group-data-[rounded=sm]/avatar:rounded-sm",
|
|
1113
|
+
"group-data-[rounded=md]/avatar:rounded-md",
|
|
1114
|
+
"group-data-[rounded=lg]/avatar:rounded-lg",
|
|
1115
|
+
"group-data-[rounded=full]/avatar:rounded-full"
|
|
1116
|
+
),
|
|
1117
|
+
src: o,
|
|
1118
|
+
alt: d
|
|
1119
|
+
}
|
|
1120
|
+
),
|
|
1121
|
+
c != null && /* @__PURE__ */ i(
|
|
1122
|
+
ue.Fallback,
|
|
1123
|
+
{
|
|
1124
|
+
"data-slot": "avatar-fallback",
|
|
1125
|
+
className: l(
|
|
1126
|
+
"text-foreground bg-surface flex size-full items-center justify-center border text-sm ",
|
|
1127
|
+
"group-data-[size=sm]/avatar:text-xs",
|
|
1128
|
+
"group-data-[rounded=sm]/avatar:rounded-sm",
|
|
1129
|
+
"group-data-[rounded=md]/avatar:rounded-md",
|
|
1130
|
+
"group-data-[rounded=lg]/avatar:rounded-lg",
|
|
1131
|
+
"group-data-[rounded=full]/avatar:rounded-full"
|
|
1132
|
+
),
|
|
1133
|
+
delay: 150,
|
|
1134
|
+
children: c
|
|
1135
|
+
}
|
|
1136
|
+
),
|
|
1137
|
+
p != null && /* @__PURE__ */ i(
|
|
1138
|
+
"span",
|
|
1139
|
+
{
|
|
1140
|
+
"data-slot": "avatar-badge",
|
|
1141
|
+
className: l(
|
|
1142
|
+
"overflow-hidden text-primary-foreground ring-surface absolute right-1 bottom-1 z-10 inline-flex items-center justify-center bg-main select-none border-1",
|
|
1143
|
+
"group-data-[size=sm]/avatar:size-3",
|
|
1144
|
+
"group-data-[size=sm]/avatar:[&>svg]:hidden",
|
|
1145
|
+
"group-data-[size=sm]/avatar:translate-0.75",
|
|
1146
|
+
"group-data-[size=md]/avatar:size-4",
|
|
1147
|
+
"group-data-[size=md]/avatar:[&>svg]:size-3",
|
|
1148
|
+
"group-data-[size=md]/avatar:translate-1.5",
|
|
1149
|
+
"group-data-[size=lg]/avatar:size-5",
|
|
1150
|
+
"group-data-[size=lg]/avatar:[&>svg]:size-4",
|
|
1151
|
+
"group-data-[size=lg]/avatar:translate-1.5",
|
|
1152
|
+
"group-data-[size=xl]/avatar:size-6",
|
|
1153
|
+
"group-data-[size=xl]/avatar:[&>svg]:size-5",
|
|
1154
|
+
"group-data-[size=xl]/avatar:translate-1.5",
|
|
1155
|
+
"group-data-[size=full]/avatar:size-4",
|
|
1156
|
+
"group-data-[size=full]/avatar:[&>svg]:size-3",
|
|
1157
|
+
"group-data-[size=full]/avatar:translate-1.5",
|
|
1158
|
+
"group-data-[raised=xs]/avatar:shadow-xs",
|
|
1159
|
+
"group-data-[raised=sm]/avatar:shadow-sm",
|
|
1160
|
+
"group-data-[raised=md]/avatar:shadow-md",
|
|
1161
|
+
"group-data-[raised=lg]/avatar:shadow-lg",
|
|
1162
|
+
"group-data-[rounded=sm]/avatar:rounded-sm",
|
|
1163
|
+
"group-data-[rounded=md]/avatar:rounded-md",
|
|
1164
|
+
"group-data-[rounded=lg]/avatar:rounded-lg",
|
|
1165
|
+
"group-data-[rounded=full]/avatar:rounded-full",
|
|
1166
|
+
"group-data-[rounded=full]/avatar:translate-0"
|
|
1167
|
+
),
|
|
1168
|
+
children: p
|
|
1169
|
+
}
|
|
1170
|
+
)
|
|
1171
|
+
] })
|
|
1172
|
+
}
|
|
1173
|
+
);
|
|
1174
|
+
}
|
|
1175
|
+
const pn = _(
|
|
1176
|
+
"gap-1 px-2 py-0.5 [button]:cursor-pointer rounded-full border text-xs font-medium transition-[color,box-shadow,translate] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none aria-invalid:border-accent-red duration-200 overflow-hidden",
|
|
1177
|
+
{
|
|
1178
|
+
variants: {
|
|
1179
|
+
variant: {
|
|
1180
|
+
default: "bg-main text-foreground",
|
|
1181
|
+
secondary: "bg-main-secondary text-foreground",
|
|
1182
|
+
destructive: "bg-accent-red text-foreground",
|
|
1183
|
+
outline: "border-border text-foreground",
|
|
1184
|
+
ghost: "text-muted hover:bg-foreground/20 border-transparent"
|
|
1185
|
+
},
|
|
1186
|
+
size: {
|
|
1187
|
+
sm: "h-5 text-xs [&>svg]:size-3",
|
|
1188
|
+
md: "text-sm [&>svg]:size-4",
|
|
1189
|
+
lg: "text-base [&>svg]:size-5"
|
|
1190
|
+
},
|
|
1191
|
+
raised: {
|
|
1192
|
+
xs: "shadow-xs -translate-px",
|
|
1193
|
+
sm: "shadow-sm -translate-0.5",
|
|
1194
|
+
md: "shadow-md -translate-0.75",
|
|
1195
|
+
lg: "shadow-lg -translate-1"
|
|
1196
|
+
},
|
|
1197
|
+
extrude: {
|
|
1198
|
+
xs: "hover:shadow-xs hover:-translate-px focus-visible:shadow-xs focus-visible:-translate-px active:shadow-none active:translate-0 disabled:shadow-none disabled:translate-0",
|
|
1199
|
+
sm: "hover:shadow-sm hover:-translate-0.5 focus-visible:shadow-sm focus-visible:-translate-0.5 active:shadow-none active:translate-0 disabled:shadow-none disabled:translate-0",
|
|
1200
|
+
md: "hover:shadow-md hover:-translate-0.75 focus-visible:shadow-md focus-visible:-translate-0.75 active:shadow-none active:translate-0 disabled:shadow-none disabled:translate-0",
|
|
1201
|
+
lg: "hover:shadow-lg hover:-translate-1 focus-visible:shadow-lg focus-visible:-translate-1 active:shadow-none active:translate-0 disabled:shadow-none disabled:translate-0"
|
|
1202
|
+
}
|
|
1203
|
+
},
|
|
1204
|
+
defaultVariants: {
|
|
1205
|
+
variant: "default",
|
|
1206
|
+
size: "md"
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
);
|
|
1210
|
+
function gn({
|
|
1211
|
+
className: e,
|
|
1212
|
+
variant: a = "default",
|
|
1213
|
+
size: r = "md",
|
|
1214
|
+
raised: n,
|
|
1215
|
+
extrude: o,
|
|
1216
|
+
render: d,
|
|
1217
|
+
...c
|
|
1218
|
+
}) {
|
|
1219
|
+
return zt({
|
|
1220
|
+
defaultTagName: "span",
|
|
1221
|
+
props: At(
|
|
1222
|
+
{
|
|
1223
|
+
className: l(
|
|
1224
|
+
pn({ size: r, variant: a, raised: n, extrude: o }),
|
|
1225
|
+
"group/badge",
|
|
1226
|
+
e
|
|
1227
|
+
),
|
|
1228
|
+
tabIndex: c.tabIndex
|
|
1229
|
+
},
|
|
1230
|
+
c
|
|
1231
|
+
),
|
|
1232
|
+
render: d,
|
|
1233
|
+
state: {
|
|
1234
|
+
slot: "badge",
|
|
1235
|
+
variant: a
|
|
1236
|
+
}
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
1239
|
+
const mn = _(
|
|
1240
|
+
"h-fit inline-grid [&_svg]:col-start-1 [&_svg]:col-end-1 [&_svg]:row-start-1 [&_svg]:row-end-1 duration-1000",
|
|
1241
|
+
{
|
|
1242
|
+
variants: {
|
|
1243
|
+
variant: {
|
|
1244
|
+
spinner: "*:data-[slot=loader-icon]:hidden *:data-[slot=loader-ping]:hidden *:data-[slot=loader-spinner]:animate-spin",
|
|
1245
|
+
ping: "*:data-[slot=loader-spinner]:hidden *:data-[slot=loader-ping]:animate-ping"
|
|
1246
|
+
},
|
|
1247
|
+
fill: {
|
|
1248
|
+
default: "[&_svg]:fill-main",
|
|
1249
|
+
destructive: "[&_svg]:fill-accent-red",
|
|
1250
|
+
warning: "[&_svg]:fill-accent-yellow",
|
|
1251
|
+
pending: "[&_svg]:fill-accent-blue"
|
|
1252
|
+
},
|
|
1253
|
+
size: {
|
|
1254
|
+
sm: "[&_svg]:size-3",
|
|
1255
|
+
md: "[&_svg]:size-4",
|
|
1256
|
+
lg: "[&_svg]:size-5"
|
|
1257
|
+
}
|
|
1258
|
+
},
|
|
1259
|
+
defaultVariants: {
|
|
1260
|
+
variant: "spinner",
|
|
1261
|
+
fill: "default",
|
|
1262
|
+
size: "md"
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
);
|
|
1266
|
+
function qe({
|
|
1267
|
+
icon: e,
|
|
1268
|
+
pingIcon: a,
|
|
1269
|
+
variant: r = "spinner",
|
|
1270
|
+
fill: n = "default",
|
|
1271
|
+
size: o = "md",
|
|
1272
|
+
iconProps: d,
|
|
1273
|
+
className: c,
|
|
1274
|
+
...p
|
|
1275
|
+
}) {
|
|
1276
|
+
const u = e || ut, h = a || u;
|
|
1277
|
+
return /* @__PURE__ */ k(
|
|
1278
|
+
"span",
|
|
1279
|
+
{
|
|
1280
|
+
role: "status",
|
|
1281
|
+
"data-slot": "loader-container",
|
|
1282
|
+
className: l(mn({ variant: r, fill: n, size: o }), c),
|
|
1283
|
+
"aria-label": r ?? "loading",
|
|
1284
|
+
...p,
|
|
1285
|
+
children: [
|
|
1286
|
+
/* @__PURE__ */ i(u, { "data-slot": "loader-icon", ...d }),
|
|
1287
|
+
/* @__PURE__ */ i(h, { "data-slot": "loader-ping", ...d }),
|
|
1288
|
+
/* @__PURE__ */ i(pt, { "data-slot": "loader-spinner", ...d })
|
|
1289
|
+
]
|
|
1290
|
+
}
|
|
1291
|
+
);
|
|
1292
|
+
}
|
|
1293
|
+
const M = _(
|
|
1294
|
+
"neo-base neo-button-focus relative group cursor-pointer rounded-base border-2 border-border text-sm font-medium [&_svg:not([class*='size-'])]:size-4.5 inline-flex items-center justify-center whitespace-nowrap transition-[translate,box-shadow,border,color] duration-200 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 select-none",
|
|
1295
|
+
{
|
|
1296
|
+
variants: {
|
|
1297
|
+
variant: {
|
|
1298
|
+
default: "bg-main text-main-foreground",
|
|
1299
|
+
secondary: "bg-main-secondary text-secondary-foreground",
|
|
1300
|
+
outline: "bg-surface text-primary-foreground",
|
|
1301
|
+
destructive: "bg-accent-red text-main-foreground",
|
|
1302
|
+
warning: "bg-accent-yellow text-main-foreground",
|
|
1303
|
+
ghost: "bg-transparent border-transparent active:bg-foreground/20 focus-visible:border-border active:border-border hover:border-border shadow-none translate-0"
|
|
1304
|
+
},
|
|
1305
|
+
size: {
|
|
1306
|
+
xs: "h-7 gap-1 px-2",
|
|
1307
|
+
sm: "h-8 gap-1 px-2",
|
|
1308
|
+
md: "h-9 gap-1.5 px-2.5",
|
|
1309
|
+
lg: "h-10 gap-1.5 px-2.5"
|
|
1310
|
+
},
|
|
1311
|
+
icon: {
|
|
1312
|
+
xs: "size-6 [&_svg:not([class*='size-'])]:size-3.5",
|
|
1313
|
+
sm: "size-8 [&_svg:not([class*='size-'])]:size-4.5",
|
|
1314
|
+
md: "size-9 [&_svg:not([class*='size-'])]:size-5.5",
|
|
1315
|
+
lg: "size-10 [&_svg:not([class*='size-'])]:size-6.5"
|
|
1316
|
+
},
|
|
1317
|
+
raised: {
|
|
1318
|
+
xs: "shadow-xs -translate-0.5 hover:shadow-min hover:-translate-px focus-visible:-translate-px focus-visible:shadow-min active:shadow-none active:translate-0",
|
|
1319
|
+
sm: "shadow-sm -translate-0.75 hover:shadow-xs hover:-translate-0.5 focus-visible:-translate-0.5 focus-visible:shadow-xs active:shadow-none active:translate-0",
|
|
1320
|
+
md: "shadow-md -translate-1 hover:shadow-sm hover:-translate-0.75 focus-visible:-translate-0.75 focus-visible:shadow-sm active:shadow-none active:translate-0",
|
|
1321
|
+
lg: "shadow-lg -translate-[4.75px] hover:shadow-md hover:-translate-1 focus-visible:-translate-1 focus-visible:shadow-md active:shadow-none active:translate-0",
|
|
1322
|
+
xl: "shadow-xl -translate-[5.5px] hover:shadow-lg hover:-translate-[4.75px] focus-visible:-translate-[4.75px] focus-visible:shadow-lg active:shadow-none active:translate-0"
|
|
1323
|
+
},
|
|
1324
|
+
extrude: {
|
|
1325
|
+
xs: "shadow-none translate-0 hover:shadow-xs hover:-translate-0.5 focus-visible:shadow-xs focus-visible:-translate-0.5 active:shadow-none active:translate-0 disabled:shadow-none disabled:translate-0 aria-expanded:shadow-xs aria-expanded:-translate-0.5",
|
|
1326
|
+
sm: "shadow-none translate-0 hover:shadow-sm hover:-translate-0.75 focus-visible:shadow-sm focus-visible:-translate-0.75 active:shadow-none active:translate-0 disabled:shadow-none disabled:translate-0 aria-expanded:shadow-sm aria-expanded:-translate-0.75",
|
|
1327
|
+
md: "shadow-none translate-0 hover:shadow-md hover:-translate-1 focus-visible:shadow-md focus-visible:-translate-1 active:shadow-none active:translate-0 disabled:shadow-none disabled:translate-0 aria-expanded:shadow-md aria-expanded:-translate-1",
|
|
1328
|
+
lg: "shadow-none translate-0 hover:shadow-lg hover:-translate-1.25 focus-visible:shadow-lg focus-visible:-translate-1.25 active:shadow-none active:translate-0 disabled:shadow-none disabled:translate-0 aria-expanded:shadow-lg aria-expanded:-translate-1.25",
|
|
1329
|
+
xl: "shadow-none translate-0 hover:shadow-xl hover:-translate-1.5 focus-visible:shadow-lg focus-visible:-translate-1.5 active:shadow-none active:translate-0 disabled:shadow-none disabled:translate-0 aria-expanded:shadow-lg aria-expanded:-translate-1.5"
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
defaultVariants: {
|
|
1333
|
+
variant: "default",
|
|
1334
|
+
size: "lg"
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
);
|
|
1338
|
+
function de({
|
|
1339
|
+
className: e,
|
|
1340
|
+
variant: a,
|
|
1341
|
+
size: r,
|
|
1342
|
+
icon: n,
|
|
1343
|
+
raised: o,
|
|
1344
|
+
extrude: d,
|
|
1345
|
+
loading: c,
|
|
1346
|
+
onClick: p,
|
|
1347
|
+
children: u,
|
|
1348
|
+
...h
|
|
1349
|
+
}) {
|
|
1350
|
+
const { trigger: f } = ae();
|
|
1351
|
+
return /* @__PURE__ */ k(
|
|
1352
|
+
It,
|
|
1353
|
+
{
|
|
1354
|
+
"data-slot": "button",
|
|
1355
|
+
"data-loading": c,
|
|
1356
|
+
"aria-label": h["aria-label"] ?? "button",
|
|
1357
|
+
className: l(
|
|
1358
|
+
M({ variant: a, size: r, raised: o, extrude: d, icon: n }),
|
|
1359
|
+
"group/button",
|
|
1360
|
+
e
|
|
1361
|
+
),
|
|
1362
|
+
onClick: (b) => {
|
|
1363
|
+
f(Kr), p?.(b);
|
|
1364
|
+
},
|
|
1365
|
+
...h,
|
|
1366
|
+
children: [
|
|
1367
|
+
/* @__PURE__ */ i("div", { className: "hidden group-data-[loading=true]:flex w-full absolute inset-0 items-center justify-center", children: /* @__PURE__ */ i(qe, {}) }),
|
|
1368
|
+
/* @__PURE__ */ i("div", { className: "visible group-data-[loading=true]:invisible w-full flex gap-1.5 justify-center items-center", children: u })
|
|
1369
|
+
]
|
|
1370
|
+
}
|
|
1371
|
+
);
|
|
1372
|
+
}
|
|
1373
|
+
const He = L.Root;
|
|
1374
|
+
He.displayName = "Select";
|
|
1375
|
+
function hn({ className: e, ...a }) {
|
|
1376
|
+
return /* @__PURE__ */ i(
|
|
1377
|
+
L.Value,
|
|
1378
|
+
{
|
|
1379
|
+
"data-slot": "select-value",
|
|
1380
|
+
className: l(
|
|
1381
|
+
"flex flex-1 text-left",
|
|
1382
|
+
"group/select-trigger:line-clamp-1 group/select-trigger:items-center data-placeholder:text-subtle font-base",
|
|
1383
|
+
e
|
|
1384
|
+
),
|
|
1385
|
+
...a
|
|
1386
|
+
}
|
|
1387
|
+
);
|
|
1388
|
+
}
|
|
1389
|
+
function fn({
|
|
1390
|
+
className: e,
|
|
1391
|
+
size: a = "lg",
|
|
1392
|
+
variant: r = "outline",
|
|
1393
|
+
raised: n,
|
|
1394
|
+
extrude: o,
|
|
1395
|
+
children: d,
|
|
1396
|
+
...c
|
|
1397
|
+
}) {
|
|
1398
|
+
return /* @__PURE__ */ k(
|
|
1399
|
+
L.Trigger,
|
|
1400
|
+
{
|
|
1401
|
+
"data-slot": "select-trigger",
|
|
1402
|
+
"data-size": a,
|
|
1403
|
+
"aria-label": c["aria-label"] ?? "select-trigger",
|
|
1404
|
+
className: l(
|
|
1405
|
+
M({ size: a, variant: r, raised: n, extrude: o }),
|
|
1406
|
+
"group/select-trigger neo-base neo-input-focus disabled:opacity-50 [&_svg]:shrink-0 w-full",
|
|
1407
|
+
e
|
|
1408
|
+
),
|
|
1409
|
+
...c,
|
|
1410
|
+
children: [
|
|
1411
|
+
d,
|
|
1412
|
+
/* @__PURE__ */ i(
|
|
1413
|
+
L.Icon,
|
|
1414
|
+
{
|
|
1415
|
+
className: "flex items-center justify-center",
|
|
1416
|
+
render: /* @__PURE__ */ i(
|
|
1417
|
+
gt,
|
|
1418
|
+
{
|
|
1419
|
+
"data-slot": "select-selector",
|
|
1420
|
+
className: "text-muted size-4 pointer-events-none"
|
|
1421
|
+
}
|
|
1422
|
+
)
|
|
1423
|
+
}
|
|
1424
|
+
)
|
|
1425
|
+
]
|
|
1426
|
+
}
|
|
1427
|
+
);
|
|
1428
|
+
}
|
|
1429
|
+
function bn({
|
|
1430
|
+
className: e,
|
|
1431
|
+
children: a,
|
|
1432
|
+
side: r = "bottom",
|
|
1433
|
+
sideOffset: n = 4,
|
|
1434
|
+
align: o = "center",
|
|
1435
|
+
alignOffset: d = 0,
|
|
1436
|
+
alignItemWithTrigger: c = !0,
|
|
1437
|
+
...p
|
|
1438
|
+
}) {
|
|
1439
|
+
return /* @__PURE__ */ i(L.Portal, { children: /* @__PURE__ */ i(
|
|
1440
|
+
L.Positioner,
|
|
1441
|
+
{
|
|
1442
|
+
side: r,
|
|
1443
|
+
sideOffset: n,
|
|
1444
|
+
align: o,
|
|
1445
|
+
alignOffset: d,
|
|
1446
|
+
alignItemWithTrigger: c,
|
|
1447
|
+
className: "isolate z-50",
|
|
1448
|
+
children: /* @__PURE__ */ k(
|
|
1449
|
+
L.Popup,
|
|
1450
|
+
{
|
|
1451
|
+
"data-slot": "select-content",
|
|
1452
|
+
className: l(
|
|
1453
|
+
"neo-base neo-focus relative isolate bg-surface text-foreground rounded-base shadow-md border-2 z-50 duration-100",
|
|
1454
|
+
"max-h-(--available-height) w-(--anchor-width) min-w-36",
|
|
1455
|
+
"origin-(--transform-origin) overflow-x-hidden overflow-y-auto",
|
|
1456
|
+
"data-open:animate-in data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95",
|
|
1457
|
+
"data-closed:animate-out data-closed:fade-out-0",
|
|
1458
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
1459
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
1460
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
1461
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
1462
|
+
e
|
|
1463
|
+
),
|
|
1464
|
+
...p,
|
|
1465
|
+
children: [
|
|
1466
|
+
/* @__PURE__ */ i(vn, {}),
|
|
1467
|
+
/* @__PURE__ */ i(L.List, { className: "flex flex-col gap-0.5 p-0.5", children: a }),
|
|
1468
|
+
/* @__PURE__ */ i(yn, {})
|
|
1469
|
+
]
|
|
1470
|
+
}
|
|
1471
|
+
)
|
|
1472
|
+
}
|
|
1473
|
+
) });
|
|
1474
|
+
}
|
|
1475
|
+
function xn({
|
|
1476
|
+
className: e,
|
|
1477
|
+
children: a,
|
|
1478
|
+
...r
|
|
1479
|
+
}) {
|
|
1480
|
+
return /* @__PURE__ */ k(
|
|
1481
|
+
L.Item,
|
|
1482
|
+
{
|
|
1483
|
+
"data-slot": "select-item",
|
|
1484
|
+
className: l(
|
|
1485
|
+
"neo-base flex items-center gap-2 py-1.5 pr-8 pl-2 relative w-full cursor-pointer select-none",
|
|
1486
|
+
"border-2 border-transparent hover:border-border focus-visible:border-border outline-hidden rounded-base text-sm",
|
|
1487
|
+
"*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
1488
|
+
"data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
1489
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1490
|
+
e
|
|
1491
|
+
),
|
|
1492
|
+
...r,
|
|
1493
|
+
children: [
|
|
1494
|
+
/* @__PURE__ */ i(L.ItemText, { className: "flex flex-1 gap-2 shrink-0 whitespace-nowrap", children: a }),
|
|
1495
|
+
/* @__PURE__ */ i(
|
|
1496
|
+
L.ItemIndicator,
|
|
1497
|
+
{
|
|
1498
|
+
render: /* @__PURE__ */ i("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
|
|
1499
|
+
children: /* @__PURE__ */ i(Ue, { className: "pointer-events-none" })
|
|
1500
|
+
}
|
|
1501
|
+
)
|
|
1502
|
+
]
|
|
1503
|
+
}
|
|
1504
|
+
);
|
|
1505
|
+
}
|
|
1506
|
+
function vn({
|
|
1507
|
+
className: e,
|
|
1508
|
+
...a
|
|
1509
|
+
}) {
|
|
1510
|
+
return /* @__PURE__ */ i(
|
|
1511
|
+
L.ScrollUpArrow,
|
|
1512
|
+
{
|
|
1513
|
+
"data-slot": "select-scroll-up-button",
|
|
1514
|
+
className: l(
|
|
1515
|
+
"bg-surface z-10 flex cursor-default items-center justify-center py-1 top-0 w-full",
|
|
1516
|
+
e
|
|
1517
|
+
),
|
|
1518
|
+
...a,
|
|
1519
|
+
children: /* @__PURE__ */ i(mt, {})
|
|
1520
|
+
}
|
|
1521
|
+
);
|
|
1522
|
+
}
|
|
1523
|
+
function yn({
|
|
1524
|
+
className: e,
|
|
1525
|
+
...a
|
|
1526
|
+
}) {
|
|
1527
|
+
return /* @__PURE__ */ i(
|
|
1528
|
+
L.ScrollDownArrow,
|
|
1529
|
+
{
|
|
1530
|
+
"data-slot": "select-scroll-down-button",
|
|
1531
|
+
className: l(
|
|
1532
|
+
"bg-surface z-10 flex cursor-default items-center justify-center py-1 bottom-0 w-full",
|
|
1533
|
+
e
|
|
1534
|
+
),
|
|
1535
|
+
...a,
|
|
1536
|
+
children: /* @__PURE__ */ i(me, {})
|
|
1537
|
+
}
|
|
1538
|
+
);
|
|
1539
|
+
}
|
|
1540
|
+
function wn({
|
|
1541
|
+
className: e,
|
|
1542
|
+
classNames: a,
|
|
1543
|
+
showOutsideDays: r = !0,
|
|
1544
|
+
captionLayout: n = "label",
|
|
1545
|
+
hideWeekdays: o = !1,
|
|
1546
|
+
buttonVariant: d = "outline",
|
|
1547
|
+
hideWeekends: c,
|
|
1548
|
+
formatters: p,
|
|
1549
|
+
components: u,
|
|
1550
|
+
...h
|
|
1551
|
+
}) {
|
|
1552
|
+
const f = kt();
|
|
1553
|
+
return /* @__PURE__ */ i(
|
|
1554
|
+
Ct,
|
|
1555
|
+
{
|
|
1556
|
+
showOutsideDays: r,
|
|
1557
|
+
className: l(
|
|
1558
|
+
"p-3 bg-surface group/calendar [--cell-size:--spacing(8)]",
|
|
1559
|
+
"in-data-[slot=card-content]:bg-transparent",
|
|
1560
|
+
"in-data-[slot=popover-content]:bg-transparent",
|
|
1561
|
+
e
|
|
1562
|
+
),
|
|
1563
|
+
captionLayout: n,
|
|
1564
|
+
formatters: {
|
|
1565
|
+
formatCaption: (b) => b.toLocaleString("default", { month: "short", year: "numeric" }),
|
|
1566
|
+
formatMonthDropdown: (b) => b.toLocaleString("default", { month: "short" }),
|
|
1567
|
+
...p
|
|
1568
|
+
},
|
|
1569
|
+
classNames: {
|
|
1570
|
+
root: l("w-fit", f.root),
|
|
1571
|
+
nav: l(
|
|
1572
|
+
"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
|
|
1573
|
+
f.nav
|
|
1574
|
+
),
|
|
1575
|
+
button_previous: l(
|
|
1576
|
+
M({ variant: d, icon: "sm" }),
|
|
1577
|
+
"aria-disabled:opacity-50 aria-disabled:translate-[0px] aria-disabled:shadow-none aria-disabled:pointer-events-none",
|
|
1578
|
+
f.button_previous
|
|
1579
|
+
),
|
|
1580
|
+
button_next: l(
|
|
1581
|
+
M({ variant: d, icon: "sm" }),
|
|
1582
|
+
"aria-disabled:opacity-50 aria-disabled:translate-[0px] aria-disabled:shadow-none aria-disabled:pointer-events-none",
|
|
1583
|
+
f.button_next
|
|
1584
|
+
),
|
|
1585
|
+
caption_label: l("select-none", f.caption_label),
|
|
1586
|
+
months: l(
|
|
1587
|
+
"flex gap-4 flex-col md:flex-row relative",
|
|
1588
|
+
f.months
|
|
1589
|
+
),
|
|
1590
|
+
month: l(
|
|
1591
|
+
"flex flex-col w-full gap-4 *:first:*:h-(--cell-size) *:first:*:flex *:first:*:items-center *:first:*:justify-center *:first:**:font-medium *:first:**:font-heading *:first:**:text-base",
|
|
1592
|
+
f.month
|
|
1593
|
+
),
|
|
1594
|
+
table: "w-full border-collapse",
|
|
1595
|
+
weekdays: l("flex", f.weekdays),
|
|
1596
|
+
weekday: l(
|
|
1597
|
+
o ? "hidden" : "text-sm font-normal font-heading text-muted text-center select-none flex-1",
|
|
1598
|
+
f.weekday
|
|
1599
|
+
),
|
|
1600
|
+
week_number: l(
|
|
1601
|
+
"text-sm font-normal font-heading text-muted text-center select-none flex size-(--cell-size) items-center justify-center my-auto",
|
|
1602
|
+
f.week_number
|
|
1603
|
+
),
|
|
1604
|
+
week_number_header: l(
|
|
1605
|
+
"select-none w-(--cell-size)",
|
|
1606
|
+
f.week_number_header
|
|
1607
|
+
),
|
|
1608
|
+
week: l("flex w-full", f.week),
|
|
1609
|
+
day: l(
|
|
1610
|
+
"relative text-center group/day select-none transition-[width,padding,margin] duration-200",
|
|
1611
|
+
f.day
|
|
1612
|
+
),
|
|
1613
|
+
day_button: l("m-1", f.day_button),
|
|
1614
|
+
today: l(
|
|
1615
|
+
"*:data-[slot=calendar-day-button]:font-semibold *:data-[slot=calendar-day-button]:text-lg",
|
|
1616
|
+
f.today
|
|
1617
|
+
),
|
|
1618
|
+
outside: l(
|
|
1619
|
+
"text-muted aria-selected:text-foreground opacity-50 hover:opacity-100 aria-selected:opacity-100 aria-selected:*:data-[slot=calendar-day-button]:bg-main-secondary hover:*:data-[slot=calendar-day-button]:bg-surface *:data-[slot=calendar-day-button]:bg-foreground/20",
|
|
1620
|
+
f.outside
|
|
1621
|
+
),
|
|
1622
|
+
...a
|
|
1623
|
+
},
|
|
1624
|
+
components: {
|
|
1625
|
+
Root: ({ className: b, rootRef: y, ...w }) => /* @__PURE__ */ i(
|
|
1626
|
+
"div",
|
|
1627
|
+
{
|
|
1628
|
+
"data-slot": "calendar",
|
|
1629
|
+
ref: y,
|
|
1630
|
+
className: l(b),
|
|
1631
|
+
...w
|
|
1632
|
+
}
|
|
1633
|
+
),
|
|
1634
|
+
Chevron: ({ className: b, orientation: y, ...w }) => y === "left" ? /* @__PURE__ */ i(ht, { className: l("size-4", b), ...w }) : y === "right" ? /* @__PURE__ */ i(
|
|
1635
|
+
ft,
|
|
1636
|
+
{
|
|
1637
|
+
className: l("size-4", b),
|
|
1638
|
+
...w
|
|
1639
|
+
}
|
|
1640
|
+
) : /* @__PURE__ */ i(me, { className: l("size-4", b), ...w }),
|
|
1641
|
+
Weekday: ({ children: b, ...y }) => {
|
|
1642
|
+
const w = y["aria-label"] === "Saturday" || y["aria-label"] === "Sunday";
|
|
1643
|
+
return c && w ? /* @__PURE__ */ i("td", { hidden: !0 }) : /* @__PURE__ */ i("td", { ...y, children: b });
|
|
1644
|
+
},
|
|
1645
|
+
Day: ({ children: b, ...y }) => {
|
|
1646
|
+
const w = new Date(y.day.date).getDay();
|
|
1647
|
+
return c && (w === 0 || w === 6) ? /* @__PURE__ */ i("td", { hidden: !0 }) : y.modifiers.hidden ? /* @__PURE__ */ i("td", { className: "all-unset size-(--cell-size) m-1 bg-foreground opacity-20 rounded-base" }) : /* @__PURE__ */ i("td", { ...y, children: b });
|
|
1648
|
+
},
|
|
1649
|
+
Dropdown: zn,
|
|
1650
|
+
DayButton: An,
|
|
1651
|
+
...u
|
|
1652
|
+
},
|
|
1653
|
+
...h
|
|
1654
|
+
}
|
|
1655
|
+
);
|
|
1656
|
+
}
|
|
1657
|
+
function An({
|
|
1658
|
+
day: e,
|
|
1659
|
+
modifiers: a,
|
|
1660
|
+
...r
|
|
1661
|
+
}) {
|
|
1662
|
+
const n = E.useRef(null);
|
|
1663
|
+
return E.useEffect(() => {
|
|
1664
|
+
a.focused && n.current?.focus();
|
|
1665
|
+
}, [a.focused]), /* @__PURE__ */ i(
|
|
1666
|
+
de,
|
|
1667
|
+
{
|
|
1668
|
+
"data-slot": "calendar-day-button",
|
|
1669
|
+
"data-day": e.date.toLocaleDateString(),
|
|
1670
|
+
"data-selected-single": a.selected && !a.range_start && !a.range_end && !a.range_middle,
|
|
1671
|
+
"data-range-start": a.range_start,
|
|
1672
|
+
"data-range-end": a.range_end,
|
|
1673
|
+
"data-range-middle": a.range_middle,
|
|
1674
|
+
"aria-label": e.date.toDateString(),
|
|
1675
|
+
raised: a.range_start || a.range_end ? "md" : a.range_middle ? "xs" : "sm",
|
|
1676
|
+
variant: a.selected ? "default" : "outline",
|
|
1677
|
+
extrude: a.selected ? null : "xs",
|
|
1678
|
+
disabled: a.disabled,
|
|
1679
|
+
icon: "sm",
|
|
1680
|
+
...r
|
|
1681
|
+
}
|
|
1682
|
+
);
|
|
1683
|
+
}
|
|
1684
|
+
function zn(e) {
|
|
1685
|
+
const { options: a, onChange: r, value: n } = e, o = a?.find((c) => c.value === n), d = (c) => {
|
|
1686
|
+
r?.({
|
|
1687
|
+
target: { value: c }
|
|
1688
|
+
});
|
|
1689
|
+
};
|
|
1690
|
+
return /* @__PURE__ */ k(
|
|
1691
|
+
He,
|
|
1692
|
+
{
|
|
1693
|
+
value: n?.toString(),
|
|
1694
|
+
onValueChange: (c) => d(c),
|
|
1695
|
+
children: [
|
|
1696
|
+
/* @__PURE__ */ i(
|
|
1697
|
+
fn,
|
|
1698
|
+
{
|
|
1699
|
+
variant: "ghost",
|
|
1700
|
+
raised: null,
|
|
1701
|
+
extrude: null,
|
|
1702
|
+
className: "w-fit mx-1",
|
|
1703
|
+
size: "sm",
|
|
1704
|
+
children: /* @__PURE__ */ i(hn, { children: o?.label })
|
|
1705
|
+
}
|
|
1706
|
+
),
|
|
1707
|
+
/* @__PURE__ */ i(bn, { className: "bg-transparent border-0 w-30 shadow-none", children: /* @__PURE__ */ i("div", { className: "p-2", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center bg-foreground shadow-xs rounded-base", children: a?.map((c) => /* @__PURE__ */ i(
|
|
1708
|
+
xn,
|
|
1709
|
+
{
|
|
1710
|
+
className: l(
|
|
1711
|
+
M({ extrude: "md" }),
|
|
1712
|
+
"not-last:rounded-b-none not-first:rounded-t-none border-2 not-last:border-b-0 hover:border-2 hover:z-2 z-1 duration-200"
|
|
1713
|
+
),
|
|
1714
|
+
value: c.value.toString(),
|
|
1715
|
+
children: c.label
|
|
1716
|
+
},
|
|
1717
|
+
c.value
|
|
1718
|
+
)) }) }) })
|
|
1719
|
+
]
|
|
1720
|
+
}
|
|
1721
|
+
);
|
|
1722
|
+
}
|
|
1723
|
+
const In = _(
|
|
1724
|
+
"bg-surface border text-foreground overflow-hidden rounded-base text-sm flex flex-col",
|
|
1725
|
+
{
|
|
1726
|
+
variants: {
|
|
1727
|
+
size: {
|
|
1728
|
+
sm: "gap-3 py-3 md:gap-4 md:py-4",
|
|
1729
|
+
md: "gap-4 py-4 md:gap-6 md:py-6"
|
|
1730
|
+
},
|
|
1731
|
+
raised: {
|
|
1732
|
+
none: "shadow-none",
|
|
1733
|
+
xs: "shadow-xs -translate-0.5",
|
|
1734
|
+
sm: "shadow-sm -translate-0.75",
|
|
1735
|
+
md: "shadow-md -translate-1",
|
|
1736
|
+
lg: "shadow-lg -translate-1.25",
|
|
1737
|
+
xl: "shadow-xl -translate-1.5"
|
|
1738
|
+
}
|
|
1739
|
+
},
|
|
1740
|
+
defaultVariants: {
|
|
1741
|
+
size: "md",
|
|
1742
|
+
raised: "md"
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
);
|
|
1746
|
+
function kn({
|
|
1747
|
+
className: e,
|
|
1748
|
+
size: a = "md",
|
|
1749
|
+
raised: r = "md",
|
|
1750
|
+
...n
|
|
1751
|
+
}) {
|
|
1752
|
+
return /* @__PURE__ */ i(
|
|
1753
|
+
"div",
|
|
1754
|
+
{
|
|
1755
|
+
"data-slot": "card",
|
|
1756
|
+
"data-size": a,
|
|
1757
|
+
className: l(In({ raised: r, size: a }), "group/card", e),
|
|
1758
|
+
...n
|
|
1759
|
+
}
|
|
1760
|
+
);
|
|
1761
|
+
}
|
|
1762
|
+
function Cn({ className: e, ...a }) {
|
|
1763
|
+
return /* @__PURE__ */ i(
|
|
1764
|
+
"div",
|
|
1765
|
+
{
|
|
1766
|
+
"data-slot": "card-header",
|
|
1767
|
+
className: l(
|
|
1768
|
+
"has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",
|
|
1769
|
+
"gap-1 group/card-header @container/card-header grid auto-rows-min items-start",
|
|
1770
|
+
"group-data-[size=sm]/card:px-3 group-data-[size=sm]/card:[.border-b]:pb-3",
|
|
1771
|
+
"group-data-[size=md]/card:px-4 group-data-[size=md]/card:[.border-b]:pb-4",
|
|
1772
|
+
"md:group-data-[size=sm]/card:px-4 md:group-data-[size=sm]/card:[.border-b]:pb-4",
|
|
1773
|
+
"md:group-data-[size=md]/card:px-6 md:group-data-[size=md]/card:[.border-b]:pb-6",
|
|
1774
|
+
e
|
|
1775
|
+
),
|
|
1776
|
+
...a
|
|
1777
|
+
}
|
|
1778
|
+
);
|
|
1779
|
+
}
|
|
1780
|
+
function Tn({ className: e, ...a }) {
|
|
1781
|
+
return /* @__PURE__ */ i(
|
|
1782
|
+
"div",
|
|
1783
|
+
{
|
|
1784
|
+
"data-slot": "card-title",
|
|
1785
|
+
className: l(
|
|
1786
|
+
"col-start-1 row-start-1 font-heading leading-normal font-medium mt-0.5 self-center",
|
|
1787
|
+
"group-has-data-[slot=card-description]/card-header:leading-tight",
|
|
1788
|
+
"group-has-data-[slot=card-description]/card-header:mt-0",
|
|
1789
|
+
"group-data-[size=sm]/card:text-base",
|
|
1790
|
+
"group-data-[size=md]/card:text-lg",
|
|
1791
|
+
"group-has-data-[slot=card-icon]/card-header:group-data-[size=sm]/card:pl-9",
|
|
1792
|
+
"group-has-data-[slot=card-icon]/card-header:group-data-[size=md]/card:pl-12",
|
|
1793
|
+
"group-has-data-[slot=card-icon]/card-header:group-has-data-[slot=card-description]/card-header:group-data-[size=sm]/card:pl-13",
|
|
1794
|
+
"group-has-data-[slot=card-icon]/card-header:group-has-data-[slot=card-description]/card-header:group-data-[size=md]/card:pl-14",
|
|
1795
|
+
e
|
|
1796
|
+
),
|
|
1797
|
+
...a
|
|
1798
|
+
}
|
|
1799
|
+
);
|
|
1800
|
+
}
|
|
1801
|
+
function _n({ className: e, ...a }) {
|
|
1802
|
+
return /* @__PURE__ */ i(
|
|
1803
|
+
"div",
|
|
1804
|
+
{
|
|
1805
|
+
"data-slot": "card-description",
|
|
1806
|
+
className: l(
|
|
1807
|
+
"text-muted col-start-1 row-start-2",
|
|
1808
|
+
"group-data-[size=sm]/card:text-xs",
|
|
1809
|
+
"group-data-[size=md]/card:text-sm",
|
|
1810
|
+
"group-has-data-[slot=card-icon]/card-header:group-data-[size=sm]/card:pl-13",
|
|
1811
|
+
"group-has-data-[slot=card-icon]/card-header:group-data-[size=md]/card:pl-14",
|
|
1812
|
+
e
|
|
1813
|
+
),
|
|
1814
|
+
...a
|
|
1815
|
+
}
|
|
1816
|
+
);
|
|
1817
|
+
}
|
|
1818
|
+
function Nn({ className: e, ...a }) {
|
|
1819
|
+
return /* @__PURE__ */ i(
|
|
1820
|
+
"div",
|
|
1821
|
+
{
|
|
1822
|
+
"data-slot": "card-action",
|
|
1823
|
+
className: l(
|
|
1824
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
1825
|
+
e
|
|
1826
|
+
),
|
|
1827
|
+
...a
|
|
1828
|
+
}
|
|
1829
|
+
);
|
|
1830
|
+
}
|
|
1831
|
+
function Pn({ className: e, ...a }) {
|
|
1832
|
+
return /* @__PURE__ */ i(
|
|
1833
|
+
"div",
|
|
1834
|
+
{
|
|
1835
|
+
"data-slot": "card-icon",
|
|
1836
|
+
className: l(
|
|
1837
|
+
"bg-main col-span-1 row-span-2 col-start-1 row-start-1 rounded-sm border-2 flex items-center justify-center self-start",
|
|
1838
|
+
"group-data-[size=sm]/card:p-0.75",
|
|
1839
|
+
"group-data-[size=md]/card:p-1",
|
|
1840
|
+
"group-data-[size=sm]/card:size-7",
|
|
1841
|
+
"group-data-[size=md]/card:size-8",
|
|
1842
|
+
"group-has-data-[slot=card-description]/card-header:group-data-[size=sm]/card:size-10",
|
|
1843
|
+
"group-has-data-[slot=card-description]/card-header:group-data-[size=md]/card:size-11",
|
|
1844
|
+
e
|
|
1845
|
+
),
|
|
1846
|
+
...a
|
|
1847
|
+
}
|
|
1848
|
+
);
|
|
1849
|
+
}
|
|
1850
|
+
function Rn({ className: e, ...a }) {
|
|
1851
|
+
return /* @__PURE__ */ i(
|
|
1852
|
+
"div",
|
|
1853
|
+
{
|
|
1854
|
+
"data-slot": "card-content",
|
|
1855
|
+
className: l(
|
|
1856
|
+
"group-data-[size=sm]/card:px-3",
|
|
1857
|
+
"group-data-[size=md]/card:px-4",
|
|
1858
|
+
"md:group-data-[size=sm]/card:px-4",
|
|
1859
|
+
"md:group-data-[size=md]/card:px-6",
|
|
1860
|
+
e
|
|
1861
|
+
),
|
|
1862
|
+
...a
|
|
1863
|
+
}
|
|
1864
|
+
);
|
|
1865
|
+
}
|
|
1866
|
+
function Sn({ className: e, ...a }) {
|
|
1867
|
+
return /* @__PURE__ */ i(
|
|
1868
|
+
"div",
|
|
1869
|
+
{
|
|
1870
|
+
"data-slot": "card-footer",
|
|
1871
|
+
className: l(
|
|
1872
|
+
"flex items-center justify-end",
|
|
1873
|
+
"group-data-[size=sm]/card:px-3 group-data-[size=sm]/card:[.border-t]:pt-3",
|
|
1874
|
+
"group-data-[size=md]/card:px-4 group-data-[size=md]/card:[.border-t]:pt-4",
|
|
1875
|
+
"md:group-data-[size=sm]/card:px-4 md:group-data-[size=sm]/card:[.border-t]:pt-4",
|
|
1876
|
+
"md:group-data-[size=md]/card:px-6 md:group-data-[size=md]/card:[.border-t]:pt-6",
|
|
1877
|
+
e
|
|
1878
|
+
),
|
|
1879
|
+
...a
|
|
1880
|
+
}
|
|
1881
|
+
);
|
|
1882
|
+
}
|
|
1883
|
+
const Dn = _(
|
|
1884
|
+
"neo-base neo-checkbox-focus flex size-5 cursor-pointer items-center justify-center rounded-md border relative shrink-0 transition-[color,opacity,box-shadow,translate] data-checked:bg-main aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-invalid:bg-accent-red-secondary",
|
|
1885
|
+
{
|
|
1886
|
+
variants: {
|
|
1887
|
+
size: {
|
|
1888
|
+
xs: "size-4.5",
|
|
1889
|
+
sm: "size-5",
|
|
1890
|
+
md: "size-5.5",
|
|
1891
|
+
lg: "size-6",
|
|
1892
|
+
xl: "size-6.5"
|
|
1893
|
+
}
|
|
1894
|
+
},
|
|
1895
|
+
defaultVariants: {
|
|
1896
|
+
size: "md"
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
);
|
|
1900
|
+
function En({
|
|
1901
|
+
className: e,
|
|
1902
|
+
size: a,
|
|
1903
|
+
onCheckedChange: r,
|
|
1904
|
+
...n
|
|
1905
|
+
}) {
|
|
1906
|
+
const { trigger: o } = ae();
|
|
1907
|
+
return /* @__PURE__ */ i(
|
|
1908
|
+
ke.Root,
|
|
1909
|
+
{
|
|
1910
|
+
"data-slot": "checkbox",
|
|
1911
|
+
"data-size": a,
|
|
1912
|
+
className: l(
|
|
1913
|
+
Dn({ size: a }),
|
|
1914
|
+
"peer group/checkbox",
|
|
1915
|
+
e
|
|
1916
|
+
),
|
|
1917
|
+
"aria-label": n["aria-label"] ?? "checkbox",
|
|
1918
|
+
onCheckedChange: (d, c) => {
|
|
1919
|
+
o(en), r?.(d, c);
|
|
1920
|
+
},
|
|
1921
|
+
...n,
|
|
1922
|
+
children: /* @__PURE__ */ i(
|
|
1923
|
+
ke.Indicator,
|
|
1924
|
+
{
|
|
1925
|
+
"data-slot": "checkbox-indicator",
|
|
1926
|
+
className: "grid place-content-center text-current",
|
|
1927
|
+
children: /* @__PURE__ */ i(
|
|
1928
|
+
Ue,
|
|
1929
|
+
{
|
|
1930
|
+
stroke: 3.5,
|
|
1931
|
+
className: l(
|
|
1932
|
+
"size-4",
|
|
1933
|
+
"group-data-[size=xs]/checkbox:size-3",
|
|
1934
|
+
"group-data-[size=sm]/checkbox:size-3.5",
|
|
1935
|
+
"group-data-[size=md]/checkbox:size-4",
|
|
1936
|
+
"group-data-[size=lg]/checkbox:size-4.5",
|
|
1937
|
+
"group-data-[size=xl]/checkbox:size-5"
|
|
1938
|
+
)
|
|
1939
|
+
}
|
|
1940
|
+
)
|
|
1941
|
+
}
|
|
1942
|
+
)
|
|
1943
|
+
}
|
|
1944
|
+
);
|
|
1945
|
+
}
|
|
1946
|
+
function Ln({ className: e, ...a }) {
|
|
1947
|
+
return /* @__PURE__ */ i(
|
|
1948
|
+
he.Root,
|
|
1949
|
+
{
|
|
1950
|
+
className: l("group/collapsible", e),
|
|
1951
|
+
"data-slot": "collapsible",
|
|
1952
|
+
...a
|
|
1953
|
+
}
|
|
1954
|
+
);
|
|
1955
|
+
}
|
|
1956
|
+
function On({
|
|
1957
|
+
className: e,
|
|
1958
|
+
...a
|
|
1959
|
+
}) {
|
|
1960
|
+
return /* @__PURE__ */ i(
|
|
1961
|
+
he.Trigger,
|
|
1962
|
+
{
|
|
1963
|
+
className: l(
|
|
1964
|
+
"group-data-open/collapsible:[&_svg]:-scale-y-100",
|
|
1965
|
+
e
|
|
1966
|
+
),
|
|
1967
|
+
"data-slot": "collapsible-trigger",
|
|
1968
|
+
...a
|
|
1969
|
+
}
|
|
1970
|
+
);
|
|
1971
|
+
}
|
|
1972
|
+
function Un({
|
|
1973
|
+
className: e,
|
|
1974
|
+
children: a,
|
|
1975
|
+
...r
|
|
1976
|
+
}) {
|
|
1977
|
+
return /* @__PURE__ */ i(
|
|
1978
|
+
he.Panel,
|
|
1979
|
+
{
|
|
1980
|
+
className: l("group overflow-hidden", e),
|
|
1981
|
+
"data-slot": "collapsible-content",
|
|
1982
|
+
keepMounted: !0,
|
|
1983
|
+
...r,
|
|
1984
|
+
children: /* @__PURE__ */ i(
|
|
1985
|
+
"div",
|
|
1986
|
+
{
|
|
1987
|
+
"data-slot": "collapsible-content-container",
|
|
1988
|
+
className: l(
|
|
1989
|
+
"transition-[opacity,translate] duration-300",
|
|
1990
|
+
"group-data-starting-style:-translate-y-20 group-data-starting-style:opacity-0",
|
|
1991
|
+
"group-data-ending-style:-translate-y-20 group-data-ending-style:opacity-0"
|
|
1992
|
+
),
|
|
1993
|
+
children: a
|
|
1994
|
+
}
|
|
1995
|
+
)
|
|
1996
|
+
}
|
|
1997
|
+
);
|
|
1998
|
+
}
|
|
1999
|
+
function Ve({ className: e, type: a, ...r }) {
|
|
2000
|
+
return /* @__PURE__ */ i(
|
|
2001
|
+
Tt,
|
|
2002
|
+
{
|
|
2003
|
+
type: a,
|
|
2004
|
+
"data-slot": "input",
|
|
2005
|
+
className: l(
|
|
2006
|
+
"neo-base neo-input-focus transition-[translate,box-shadow] h-10 w-full min-w-0 placeholder:text-subtle rounded-base border px-2.5 py-1 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 bg-surface",
|
|
2007
|
+
e
|
|
2008
|
+
),
|
|
2009
|
+
...r
|
|
2010
|
+
}
|
|
2011
|
+
);
|
|
2012
|
+
}
|
|
2013
|
+
function Fn({
|
|
2014
|
+
className: e,
|
|
2015
|
+
containerClassName: a,
|
|
2016
|
+
...r
|
|
2017
|
+
}) {
|
|
2018
|
+
return /* @__PURE__ */ i(
|
|
2019
|
+
_t,
|
|
2020
|
+
{
|
|
2021
|
+
"data-slot": "input-otp",
|
|
2022
|
+
containerClassName: l(
|
|
2023
|
+
"cn-input-otp flex items-center has-disabled:opacity-50",
|
|
2024
|
+
a
|
|
2025
|
+
),
|
|
2026
|
+
spellCheck: !1,
|
|
2027
|
+
className: l("disabled:cursor-not-allowed", e),
|
|
2028
|
+
...r
|
|
2029
|
+
}
|
|
2030
|
+
);
|
|
2031
|
+
}
|
|
2032
|
+
function Me({
|
|
2033
|
+
className: e,
|
|
2034
|
+
onInput: a,
|
|
2035
|
+
autosize: r = !1,
|
|
2036
|
+
...n
|
|
2037
|
+
}) {
|
|
2038
|
+
return /* @__PURE__ */ i(
|
|
2039
|
+
"textarea",
|
|
2040
|
+
{
|
|
2041
|
+
"data-slot": "textarea",
|
|
2042
|
+
onInput: a || ((d) => {
|
|
2043
|
+
if (r) {
|
|
2044
|
+
const c = d.currentTarget;
|
|
2045
|
+
c.style.height = "auto", c.style.height = c.scrollHeight + "px";
|
|
2046
|
+
}
|
|
2047
|
+
}),
|
|
2048
|
+
className: l(
|
|
2049
|
+
"neo-base neo-input-focus",
|
|
2050
|
+
"flex field-sizing-content transition-all",
|
|
2051
|
+
"h-10 min-h-16 w-full min-w-0",
|
|
2052
|
+
"placeholder:text-subtle",
|
|
2053
|
+
"rounded-base border px-2.5 py-2",
|
|
2054
|
+
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
2055
|
+
e
|
|
2056
|
+
),
|
|
2057
|
+
...n
|
|
2058
|
+
}
|
|
2059
|
+
);
|
|
2060
|
+
}
|
|
2061
|
+
function Je({ className: e, ...a }) {
|
|
2062
|
+
return /* @__PURE__ */ i(
|
|
2063
|
+
"div",
|
|
2064
|
+
{
|
|
2065
|
+
"data-slot": "input-group",
|
|
2066
|
+
role: "group",
|
|
2067
|
+
className: l(
|
|
2068
|
+
"group/input-group",
|
|
2069
|
+
"relative flex w-full min-w-0 items-center border-border h-10 rounded-base border shadow-none has-[>textarea]:h-auto",
|
|
2070
|
+
"has-[>[data-align=block-end]]:p-1 has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:h-auto",
|
|
2071
|
+
"has-[>[data-align=block-start]]:p-1 has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:h-auto",
|
|
2072
|
+
e
|
|
2073
|
+
),
|
|
2074
|
+
...a
|
|
2075
|
+
}
|
|
2076
|
+
);
|
|
2077
|
+
}
|
|
2078
|
+
const Bn = _(
|
|
2079
|
+
"text-muted h-full gap-2 p-2 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 flex cursor-text items-center justify-center select-none",
|
|
2080
|
+
{
|
|
2081
|
+
variants: {
|
|
2082
|
+
align: {
|
|
2083
|
+
"inline-start": "mr-0.5 has-[>button]:mr-0 has-[>kbd]:mr-0 has-[>button]:-ml-0.75 has-[>kbd]:-ml-0.75 order-first",
|
|
2084
|
+
"inline-end": "ml-0.5 has-[>button]:ml-0 has-[>kbd]:ml-0 has-[>button]:-mr-0.75 has-[>kbd]:-mr-0.75 order-last",
|
|
2085
|
+
"block-start": "mb-1 [.border-b]:pb-3 order-first w-full justify-start",
|
|
2086
|
+
"block-end": "mt-1 [.border-t]:pt-3 order-last w-full justify-start"
|
|
2087
|
+
}
|
|
2088
|
+
},
|
|
2089
|
+
defaultVariants: {
|
|
2090
|
+
align: "inline-start"
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
);
|
|
2094
|
+
function Xe({
|
|
2095
|
+
className: e,
|
|
2096
|
+
align: a = "inline-start",
|
|
2097
|
+
...r
|
|
2098
|
+
}) {
|
|
2099
|
+
return /* @__PURE__ */ i(
|
|
2100
|
+
"div",
|
|
2101
|
+
{
|
|
2102
|
+
role: "group",
|
|
2103
|
+
"data-slot": "input-group-addon",
|
|
2104
|
+
"data-align": a,
|
|
2105
|
+
className: l(Bn({ align: a }), e),
|
|
2106
|
+
onClick: (n) => {
|
|
2107
|
+
n.target.closest("button") || n.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
2108
|
+
},
|
|
2109
|
+
...r
|
|
2110
|
+
}
|
|
2111
|
+
);
|
|
2112
|
+
}
|
|
2113
|
+
const jn = _("gap-2 text-sm flex items-center", {
|
|
2114
|
+
variants: {
|
|
2115
|
+
size: {
|
|
2116
|
+
xs: "h-7 gap-1 rounded-sm px-1.5 py-0.5",
|
|
2117
|
+
sm: "",
|
|
2118
|
+
"icon-xs": "size-6 rounded-sm p-0 has-[>svg]:p-0",
|
|
2119
|
+
"icon-sm": "size-10 p-0 has-[>svg]:p-0"
|
|
2120
|
+
}
|
|
2121
|
+
},
|
|
2122
|
+
defaultVariants: {
|
|
2123
|
+
size: "xs"
|
|
2124
|
+
}
|
|
2125
|
+
});
|
|
2126
|
+
function Wn({
|
|
2127
|
+
className: e,
|
|
2128
|
+
type: a = "button",
|
|
2129
|
+
variant: r = "outline",
|
|
2130
|
+
extrude: n = "xs",
|
|
2131
|
+
size: o,
|
|
2132
|
+
...d
|
|
2133
|
+
}) {
|
|
2134
|
+
return /* @__PURE__ */ i(
|
|
2135
|
+
de,
|
|
2136
|
+
{
|
|
2137
|
+
type: a,
|
|
2138
|
+
"data-size": o,
|
|
2139
|
+
variant: r,
|
|
2140
|
+
extrude: n ?? null,
|
|
2141
|
+
"aria-label": d["aria-label"] ?? "input-button",
|
|
2142
|
+
className: l(jn({ size: o }), e),
|
|
2143
|
+
...d
|
|
2144
|
+
}
|
|
2145
|
+
);
|
|
2146
|
+
}
|
|
2147
|
+
function Gn({ className: e, ...a }) {
|
|
2148
|
+
return /* @__PURE__ */ i(
|
|
2149
|
+
"span",
|
|
2150
|
+
{
|
|
2151
|
+
className: l(
|
|
2152
|
+
"text-subtle gap-2 font-base flex items-center [&_svg]:pointer-events-none",
|
|
2153
|
+
e
|
|
2154
|
+
),
|
|
2155
|
+
...a
|
|
2156
|
+
}
|
|
2157
|
+
);
|
|
2158
|
+
}
|
|
2159
|
+
function Ye({
|
|
2160
|
+
className: e,
|
|
2161
|
+
...a
|
|
2162
|
+
}) {
|
|
2163
|
+
return /* @__PURE__ */ i(
|
|
2164
|
+
Ve,
|
|
2165
|
+
{
|
|
2166
|
+
"data-slot": "input-group-control",
|
|
2167
|
+
className: l(
|
|
2168
|
+
"h-10 hover:border-border focus:border-border flex-1 bg-surface -m-0.5",
|
|
2169
|
+
"group-has-[>[data-align=block-start]]/input-group:m-0",
|
|
2170
|
+
"group-has-[>[data-align=block-end]]/input-group:m-0",
|
|
2171
|
+
"group-has-[>[data-align=inline-start]]/input-group:pl-1.5",
|
|
2172
|
+
"group-has-[>[data-align=inline-end]]/input-group:pr-1.5",
|
|
2173
|
+
"group-has-[>[data-align=block-start]]/input-group:rounded-base",
|
|
2174
|
+
"group-has-[>[data-align=block-end]]/input-group:rounded-base",
|
|
2175
|
+
"group-has-[>[data-align=inline-start]]/input-group:rounded-l-none",
|
|
2176
|
+
"group-has-[>[data-align=inline-start]]/input-group:hover:rounded-l-sm",
|
|
2177
|
+
"group-has-[>[data-align=inline-start]]/input-group:focus:rounded-l-sm",
|
|
2178
|
+
"group-has-[>[data-align=inline-end]]/input-group:rounded-r-none",
|
|
2179
|
+
"group-has-[>[data-align=inline-end]]/input-group:hover:rounded-r-sm",
|
|
2180
|
+
"group-has-[>[data-align=inline-end]]/input-group:focus:rounded-r-sm",
|
|
2181
|
+
e
|
|
2182
|
+
),
|
|
2183
|
+
...a
|
|
2184
|
+
}
|
|
2185
|
+
);
|
|
2186
|
+
}
|
|
2187
|
+
function $n({
|
|
2188
|
+
className: e,
|
|
2189
|
+
...a
|
|
2190
|
+
}) {
|
|
2191
|
+
return /* @__PURE__ */ i(
|
|
2192
|
+
Me,
|
|
2193
|
+
{
|
|
2194
|
+
"data-slot": "input-group-control",
|
|
2195
|
+
className: l(
|
|
2196
|
+
"h-auto hover:border-border focus:border-border flex-1 bg-surface",
|
|
2197
|
+
"group-has-[>[data-align=block-start]]/input-group:m-0",
|
|
2198
|
+
"group-has-[>[data-align=block-end]]/input-group:m-0",
|
|
2199
|
+
"group-has-[>[data-align=block-start]]/input-group:rounded-base",
|
|
2200
|
+
"group-has-[>[data-align=block-end]]/input-group:rounded-base",
|
|
2201
|
+
"group-has-[>[data-align=inline-start]]/input-group:rounded-l-none",
|
|
2202
|
+
"group-has-[>[data-align=inline-start]]/input-group:hover:rounded-l-base",
|
|
2203
|
+
"group-has-[>[data-align=inline-start]]/input-group:focus:rounded-l-base",
|
|
2204
|
+
"group-has-[>[data-align=inline-end]]/input-group:rounded-r-none",
|
|
2205
|
+
"group-has-[>[data-align=inline-end]]/input-group:hover:rounded-r-base",
|
|
2206
|
+
"group-has-[>[data-align=inline-end]]/input-group:focus:rounded-r-base",
|
|
2207
|
+
e
|
|
2208
|
+
),
|
|
2209
|
+
...a
|
|
2210
|
+
}
|
|
2211
|
+
);
|
|
2212
|
+
}
|
|
2213
|
+
const qn = _(
|
|
2214
|
+
"gap-2 leading-none group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",
|
|
2215
|
+
{
|
|
2216
|
+
variants: {
|
|
2217
|
+
variant: {
|
|
2218
|
+
default: "",
|
|
2219
|
+
underline: "hover:underline hover:underline-offset-3 hover:decoration-2",
|
|
2220
|
+
destructive: "font-bold! text-accent-red"
|
|
2221
|
+
},
|
|
2222
|
+
size: {
|
|
2223
|
+
xs: "text-xs font-normal",
|
|
2224
|
+
sm: "text-sm font-medium",
|
|
2225
|
+
md: "text-base font-medium",
|
|
2226
|
+
lg: "text-lg font-semibold",
|
|
2227
|
+
xl: "text-xl font-semibold"
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
);
|
|
2232
|
+
function Hn({
|
|
2233
|
+
size: e = "sm",
|
|
2234
|
+
variant: a,
|
|
2235
|
+
className: r,
|
|
2236
|
+
htmlFor: n,
|
|
2237
|
+
...o
|
|
2238
|
+
}) {
|
|
2239
|
+
return /* @__PURE__ */ i(
|
|
2240
|
+
"label",
|
|
2241
|
+
{
|
|
2242
|
+
"data-slot": "label",
|
|
2243
|
+
htmlFor: n,
|
|
2244
|
+
className: l(qn({ size: e, variant: a }), r),
|
|
2245
|
+
...o
|
|
2246
|
+
}
|
|
2247
|
+
);
|
|
2248
|
+
}
|
|
2249
|
+
const Vn = {
|
|
2250
|
+
id: "default_center",
|
|
2251
|
+
latitude: 51.049999,
|
|
2252
|
+
longitude: -114.066666
|
|
2253
|
+
};
|
|
2254
|
+
function Mn({
|
|
2255
|
+
pins: e,
|
|
2256
|
+
onChange: a,
|
|
2257
|
+
allowMultiple: r = !0,
|
|
2258
|
+
readonly: n = !1,
|
|
2259
|
+
fixed: o = !1,
|
|
2260
|
+
zoom: d = 12,
|
|
2261
|
+
pitch: c,
|
|
2262
|
+
className: p,
|
|
2263
|
+
children: u,
|
|
2264
|
+
...h
|
|
2265
|
+
}) {
|
|
2266
|
+
const f = E.useRef(null), [b, y] = E.useState(null), w = r ? b : e ? e[0]?.id : null, P = E.useMemo(() => ({ ...!e || e.length === 0 ? Vn : e[0], zoom: d, pitch: c }), [e, d, c]), U = E.useCallback(
|
|
2267
|
+
(v) => {
|
|
2268
|
+
if (n || o) return;
|
|
2269
|
+
const A = e ? e.filter((S) => S.id !== v) : [];
|
|
2270
|
+
a?.(A), w === v && y(null);
|
|
2271
|
+
},
|
|
2272
|
+
[e, a, w]
|
|
2273
|
+
), T = (v, A) => {
|
|
2274
|
+
v.stopPropagation(), y((S) => S && S === A ? null : A);
|
|
2275
|
+
}, R = E.useCallback(
|
|
2276
|
+
(v, A) => {
|
|
2277
|
+
if (!a || !e || o || n) return;
|
|
2278
|
+
const S = e.map(
|
|
2279
|
+
(N) => N.id === A ? { ...N, longitude: v.lngLat.lng, latitude: v.lngLat.lat } : N
|
|
2280
|
+
);
|
|
2281
|
+
a(S);
|
|
2282
|
+
},
|
|
2283
|
+
[e, a]
|
|
2284
|
+
), z = E.useCallback(
|
|
2285
|
+
(v) => {
|
|
2286
|
+
if (w && r)
|
|
2287
|
+
return y(null);
|
|
2288
|
+
if (n || !a || o) return;
|
|
2289
|
+
if (!r && e) {
|
|
2290
|
+
const S = e[0];
|
|
2291
|
+
return a([
|
|
2292
|
+
{
|
|
2293
|
+
...S,
|
|
2294
|
+
longitude: v.lngLat.lng,
|
|
2295
|
+
latitude: v.lngLat.lat
|
|
2296
|
+
}
|
|
2297
|
+
]);
|
|
2298
|
+
}
|
|
2299
|
+
const A = {
|
|
2300
|
+
id: crypto.randomUUID(),
|
|
2301
|
+
longitude: v.lngLat.lng,
|
|
2302
|
+
latitude: v.lngLat.lat
|
|
2303
|
+
};
|
|
2304
|
+
a(e ? [...e, A] : [A]), y(A.id);
|
|
2305
|
+
},
|
|
2306
|
+
[e, a, n, w]
|
|
2307
|
+
);
|
|
2308
|
+
E.useEffect(() => () => {
|
|
2309
|
+
f.current?.getMap()?.remove();
|
|
2310
|
+
}, []);
|
|
2311
|
+
const x = E.useMemo(() => o ? {
|
|
2312
|
+
dragPan: !1,
|
|
2313
|
+
scrollZoom: !1,
|
|
2314
|
+
doubleClickZoom: !1,
|
|
2315
|
+
touchZoom: !1,
|
|
2316
|
+
keyboard: !1,
|
|
2317
|
+
dragRotate: !1,
|
|
2318
|
+
...h
|
|
2319
|
+
} : h, [n, o, e]);
|
|
2320
|
+
return /* @__PURE__ */ i(
|
|
2321
|
+
"div",
|
|
2322
|
+
{
|
|
2323
|
+
"data-slot": "map-container",
|
|
2324
|
+
className: l(
|
|
2325
|
+
"h-96 w-96 bg-foreground rounded-base overflow-hidden relative",
|
|
2326
|
+
p
|
|
2327
|
+
),
|
|
2328
|
+
children: /* @__PURE__ */ k(
|
|
2329
|
+
Nt,
|
|
2330
|
+
{
|
|
2331
|
+
"data-slot": "map",
|
|
2332
|
+
ref: f,
|
|
2333
|
+
initialViewState: P,
|
|
2334
|
+
mapStyle: "https://tiles.openfreemap.org/styles/liberty",
|
|
2335
|
+
style: {
|
|
2336
|
+
width: "100%",
|
|
2337
|
+
height: "100%"
|
|
2338
|
+
},
|
|
2339
|
+
onClick: z,
|
|
2340
|
+
minZoom: 0,
|
|
2341
|
+
maxZoom: 18,
|
|
2342
|
+
maxPitch: 80,
|
|
2343
|
+
reuseMaps: !0,
|
|
2344
|
+
doubleClickZoom: !1,
|
|
2345
|
+
sky: {
|
|
2346
|
+
"sky-color": "#5294FFFF",
|
|
2347
|
+
"horizon-color": "#DDEFFDFF"
|
|
2348
|
+
},
|
|
2349
|
+
attributionControl: !1,
|
|
2350
|
+
"aria-readonly": n,
|
|
2351
|
+
...x,
|
|
2352
|
+
children: [
|
|
2353
|
+
(e ?? []).map(({ children: v, id: A, ...S }) => /* @__PURE__ */ i(
|
|
2354
|
+
Pt,
|
|
2355
|
+
{
|
|
2356
|
+
"data-slot": "map-marker",
|
|
2357
|
+
anchor: "bottom",
|
|
2358
|
+
draggable: !o && !n,
|
|
2359
|
+
onDragEnd: (N) => R(N, A),
|
|
2360
|
+
className: l(
|
|
2361
|
+
"animate-in",
|
|
2362
|
+
w === A ? "z-2" : "z-1 hover:z-10 hover:*:opacity-90"
|
|
2363
|
+
),
|
|
2364
|
+
...S,
|
|
2365
|
+
children: /* @__PURE__ */ i(
|
|
2366
|
+
"div",
|
|
2367
|
+
{
|
|
2368
|
+
"data-slot": "map-marker-inner",
|
|
2369
|
+
"data-selected": w === A,
|
|
2370
|
+
onClick: (N) => T(N, A),
|
|
2371
|
+
className: "data-[selected=true]:cursor-grab cursor-pointer group *:[svg]:drop-shadow-[1px_1px_0_rgba(0,0,0,1)]",
|
|
2372
|
+
children: v ? v(() => U(A)) : /* @__PURE__ */ k(B, { children: [
|
|
2373
|
+
/* @__PURE__ */ i(
|
|
2374
|
+
bt,
|
|
2375
|
+
{
|
|
2376
|
+
"data-slot": "map-marker-svg",
|
|
2377
|
+
className: "fill-main-secondary hover:scale-110 group-data-[selected=true]:hover:scale-145 group-data-[selected=true]:scale-140 group-data-[selected=true]:fill-main size-10 stroke-foreground transition-all duration-300 ease origin-bottom"
|
|
2378
|
+
}
|
|
2379
|
+
),
|
|
2380
|
+
!n && !o && r && /* @__PURE__ */ i(
|
|
2381
|
+
"div",
|
|
2382
|
+
{
|
|
2383
|
+
"data-slot": "map-marker-popup",
|
|
2384
|
+
className: "absolute -right-2 -top-6 duration-300 ease origin-bottom-left scale-0 opacity-0 pointer-events-none group-data-[selected=true]:pointer-events-auto group-data-[selected=true]:scale-100 group-data-[selected=true]:opacity-100",
|
|
2385
|
+
children: /* @__PURE__ */ i(
|
|
2386
|
+
"a",
|
|
2387
|
+
{
|
|
2388
|
+
type: "button",
|
|
2389
|
+
"data-slot": "map-marker-delete",
|
|
2390
|
+
onClick: (N) => {
|
|
2391
|
+
N.stopPropagation(), U(A);
|
|
2392
|
+
},
|
|
2393
|
+
className: l(
|
|
2394
|
+
M({
|
|
2395
|
+
icon: "xs",
|
|
2396
|
+
raised: null,
|
|
2397
|
+
variant: "destructive",
|
|
2398
|
+
extrude: "xs"
|
|
2399
|
+
}),
|
|
2400
|
+
"rounded-full"
|
|
2401
|
+
),
|
|
2402
|
+
"aria-label": "Delete Pin",
|
|
2403
|
+
children: /* @__PURE__ */ i(xt, {})
|
|
2404
|
+
}
|
|
2405
|
+
)
|
|
2406
|
+
}
|
|
2407
|
+
)
|
|
2408
|
+
] })
|
|
2409
|
+
}
|
|
2410
|
+
)
|
|
2411
|
+
},
|
|
2412
|
+
A
|
|
2413
|
+
)),
|
|
2414
|
+
u || /* @__PURE__ */ k(B, { children: [
|
|
2415
|
+
/* @__PURE__ */ i(Jn, {}),
|
|
2416
|
+
!o && /* @__PURE__ */ k(B, { children: [
|
|
2417
|
+
/* @__PURE__ */ i(
|
|
2418
|
+
Rt,
|
|
2419
|
+
{
|
|
2420
|
+
"data-slot": "map-nav-control",
|
|
2421
|
+
position: "bottom-right",
|
|
2422
|
+
showCompass: !1
|
|
2423
|
+
}
|
|
2424
|
+
),
|
|
2425
|
+
/* @__PURE__ */ i(
|
|
2426
|
+
St,
|
|
2427
|
+
{
|
|
2428
|
+
"data-slot": "map-geolocate-control",
|
|
2429
|
+
position: "top-left"
|
|
2430
|
+
}
|
|
2431
|
+
),
|
|
2432
|
+
/* @__PURE__ */ i(
|
|
2433
|
+
Dt,
|
|
2434
|
+
{
|
|
2435
|
+
"data-slot": "map-fullscreen-control",
|
|
2436
|
+
position: "top-right"
|
|
2437
|
+
}
|
|
2438
|
+
)
|
|
2439
|
+
] })
|
|
2440
|
+
] })
|
|
2441
|
+
]
|
|
2442
|
+
}
|
|
2443
|
+
)
|
|
2444
|
+
}
|
|
2445
|
+
);
|
|
2446
|
+
}
|
|
2447
|
+
const ie = {
|
|
2448
|
+
"water-fill": {
|
|
2449
|
+
type: "fill",
|
|
2450
|
+
source: "openmaptiles",
|
|
2451
|
+
"source-layer": "water",
|
|
2452
|
+
paint: { "fill-color": "#00C8F0FF" },
|
|
2453
|
+
beforeId: "landcover_sand"
|
|
2454
|
+
},
|
|
2455
|
+
"park-fill": {
|
|
2456
|
+
type: "fill",
|
|
2457
|
+
source: "openmaptiles",
|
|
2458
|
+
"source-layer": "park",
|
|
2459
|
+
paint: { "fill-color": "#05E17AFF", "fill-opacity": 0.3 },
|
|
2460
|
+
beforeId: "park_outline"
|
|
2461
|
+
},
|
|
2462
|
+
"landcover-grass-fill": {
|
|
2463
|
+
type: "fill",
|
|
2464
|
+
source: "openmaptiles",
|
|
2465
|
+
"source-layer": "landcover",
|
|
2466
|
+
filter: ["==", ["get", "class"], "grass"],
|
|
2467
|
+
paint: { "fill-color": "#00D696FF", "fill-opacity": 0.3 },
|
|
2468
|
+
beforeId: "landcover_ice"
|
|
2469
|
+
},
|
|
2470
|
+
"landcover-sand-fill": {
|
|
2471
|
+
type: "fill",
|
|
2472
|
+
source: "openmaptiles",
|
|
2473
|
+
"source-layer": "landcover",
|
|
2474
|
+
filter: ["==", ["get", "class"], "sand"],
|
|
2475
|
+
paint: {
|
|
2476
|
+
"fill-color": "#FACC00FF"
|
|
2477
|
+
},
|
|
2478
|
+
beforeId: "aeroway_fill"
|
|
2479
|
+
},
|
|
2480
|
+
"landuse-other-fill": {
|
|
2481
|
+
type: "fill",
|
|
2482
|
+
source: "openmaptiles",
|
|
2483
|
+
"source-layer": "landuse",
|
|
2484
|
+
paint: {
|
|
2485
|
+
"fill-color": "#FDF7C4FF",
|
|
2486
|
+
"fill-opacity": 0.4
|
|
2487
|
+
},
|
|
2488
|
+
beforeId: "landcover_wood"
|
|
2489
|
+
},
|
|
2490
|
+
"landuse-residential-fill": {
|
|
2491
|
+
type: "fill",
|
|
2492
|
+
source: "openmaptiles",
|
|
2493
|
+
"source-layer": "landuse",
|
|
2494
|
+
filter: ["==", ["get", "class"], "residential"],
|
|
2495
|
+
paint: {
|
|
2496
|
+
"fill-color": "#FFEDD6FF",
|
|
2497
|
+
"fill-opacity": 1
|
|
2498
|
+
},
|
|
2499
|
+
beforeId: "landcover_wood"
|
|
2500
|
+
},
|
|
2501
|
+
"road-ramp-casing": {
|
|
2502
|
+
type: "line",
|
|
2503
|
+
source: "openmaptiles",
|
|
2504
|
+
"source-layer": "transportation",
|
|
2505
|
+
filter: ["all", ["==", ["get", "ramp"], 1]],
|
|
2506
|
+
layout: { "line-cap": "butt", "line-join": "round" },
|
|
2507
|
+
paint: {
|
|
2508
|
+
"line-color": "#FFEDD6FF",
|
|
2509
|
+
"line-width": [
|
|
2510
|
+
"interpolate",
|
|
2511
|
+
["exponential", 1.2],
|
|
2512
|
+
["zoom"],
|
|
2513
|
+
8,
|
|
2514
|
+
1.5,
|
|
2515
|
+
20,
|
|
2516
|
+
17
|
|
2517
|
+
]
|
|
2518
|
+
},
|
|
2519
|
+
beforeId: "road-highlight-casing"
|
|
2520
|
+
},
|
|
2521
|
+
"road-highlight-casing": {
|
|
2522
|
+
type: "line",
|
|
2523
|
+
source: "openmaptiles",
|
|
2524
|
+
"source-layer": "transportation",
|
|
2525
|
+
filter: [
|
|
2526
|
+
"all",
|
|
2527
|
+
["match", ["get", "brunnel"], ["bridge", "tunnel", "ramp"], !1, !0],
|
|
2528
|
+
["match", ["get", "class"], ["secondary", "tertiary"], !0, !1],
|
|
2529
|
+
["match", ["get", "class"], ["primary", "trunk"], !0, !1],
|
|
2530
|
+
["match", ["get", "class"], ["motorway"], !0, !1],
|
|
2531
|
+
["!=", ["get", "ramp"], 1]
|
|
2532
|
+
],
|
|
2533
|
+
layout: { "line-cap": "butt", "line-join": "round" },
|
|
2534
|
+
paint: {
|
|
2535
|
+
"line-color": "#FFEDD6FF",
|
|
2536
|
+
"line-width": [
|
|
2537
|
+
"interpolate",
|
|
2538
|
+
["exponential", 1.2],
|
|
2539
|
+
["zoom"],
|
|
2540
|
+
8,
|
|
2541
|
+
1.5,
|
|
2542
|
+
20,
|
|
2543
|
+
17
|
|
2544
|
+
]
|
|
2545
|
+
},
|
|
2546
|
+
beforeId: "road-ramp-line"
|
|
2547
|
+
},
|
|
2548
|
+
"road-ramp-line": {
|
|
2549
|
+
type: "line",
|
|
2550
|
+
source: "openmaptiles",
|
|
2551
|
+
"source-layer": "transportation",
|
|
2552
|
+
filter: ["all", ["==", ["get", "ramp"], 1]],
|
|
2553
|
+
layout: { "line-cap": "round", "line-join": "round" },
|
|
2554
|
+
paint: {
|
|
2555
|
+
"line-color": "#FFEDD6FF",
|
|
2556
|
+
"line-width": [
|
|
2557
|
+
"interpolate",
|
|
2558
|
+
["exponential", 1.3],
|
|
2559
|
+
["zoom"],
|
|
2560
|
+
5,
|
|
2561
|
+
0,
|
|
2562
|
+
7,
|
|
2563
|
+
1,
|
|
2564
|
+
20,
|
|
2565
|
+
18
|
|
2566
|
+
]
|
|
2567
|
+
},
|
|
2568
|
+
beforeId: "road-motorway-line"
|
|
2569
|
+
},
|
|
2570
|
+
"road-motorway-line": {
|
|
2571
|
+
type: "line",
|
|
2572
|
+
source: "openmaptiles",
|
|
2573
|
+
"source-layer": "transportation",
|
|
2574
|
+
filter: [
|
|
2575
|
+
"all",
|
|
2576
|
+
["match", ["get", "brunnel"], ["bridge", "tunnel"], !1, !0],
|
|
2577
|
+
["match", ["get", "class"], ["motorway"], !0, !1]
|
|
2578
|
+
],
|
|
2579
|
+
layout: { "line-cap": "round", "line-join": "round" },
|
|
2580
|
+
paint: {
|
|
2581
|
+
"line-color": "#FF7A05FF",
|
|
2582
|
+
"line-width": [
|
|
2583
|
+
"interpolate",
|
|
2584
|
+
["exponential", 1.3],
|
|
2585
|
+
["zoom"],
|
|
2586
|
+
5,
|
|
2587
|
+
0,
|
|
2588
|
+
7,
|
|
2589
|
+
1,
|
|
2590
|
+
20,
|
|
2591
|
+
18
|
|
2592
|
+
]
|
|
2593
|
+
},
|
|
2594
|
+
beforeId: "road-secondary-tertiary-line"
|
|
2595
|
+
},
|
|
2596
|
+
"road-secondary-tertiary-line": {
|
|
2597
|
+
type: "line",
|
|
2598
|
+
source: "openmaptiles",
|
|
2599
|
+
"source-layer": "transportation",
|
|
2600
|
+
filter: [
|
|
2601
|
+
"all",
|
|
2602
|
+
["match", ["get", "brunnel"], ["bridge", "tunnel"], !1, !0],
|
|
2603
|
+
["match", ["get", "class"], ["secondary", "tertiary"], !0, !1],
|
|
2604
|
+
["!=", ["get", "ramp"], 1]
|
|
2605
|
+
],
|
|
2606
|
+
layout: { "line-cap": "butt", "line-join": "round" },
|
|
2607
|
+
paint: {
|
|
2608
|
+
"line-color": "#FACC00FF",
|
|
2609
|
+
"line-width": [
|
|
2610
|
+
"interpolate",
|
|
2611
|
+
["exponential", 1.2],
|
|
2612
|
+
["zoom"],
|
|
2613
|
+
6.5,
|
|
2614
|
+
0,
|
|
2615
|
+
8,
|
|
2616
|
+
0.5,
|
|
2617
|
+
20,
|
|
2618
|
+
13
|
|
2619
|
+
]
|
|
2620
|
+
},
|
|
2621
|
+
beforeId: "road-trunk-primary-line"
|
|
2622
|
+
},
|
|
2623
|
+
"road-trunk-primary-line": {
|
|
2624
|
+
type: "line",
|
|
2625
|
+
source: "openmaptiles",
|
|
2626
|
+
"source-layer": "transportation",
|
|
2627
|
+
filter: [
|
|
2628
|
+
"all",
|
|
2629
|
+
["match", ["get", "brunnel"], ["bridge", "tunnel"], !1, !0],
|
|
2630
|
+
["match", ["get", "class"], ["primary", "trunk"], !0, !1],
|
|
2631
|
+
["!=", ["get", "ramp"], 1]
|
|
2632
|
+
],
|
|
2633
|
+
layout: { "line-cap": "round", "line-join": "round" },
|
|
2634
|
+
paint: {
|
|
2635
|
+
"line-color": "#FDF7C4FF",
|
|
2636
|
+
"line-width": [
|
|
2637
|
+
"interpolate",
|
|
2638
|
+
["exponential", 1.2],
|
|
2639
|
+
["zoom"],
|
|
2640
|
+
6.5,
|
|
2641
|
+
0,
|
|
2642
|
+
8,
|
|
2643
|
+
0.5,
|
|
2644
|
+
20,
|
|
2645
|
+
13
|
|
2646
|
+
]
|
|
2647
|
+
},
|
|
2648
|
+
beforeId: "road-transit-rail-line-casing"
|
|
2649
|
+
},
|
|
2650
|
+
"road-transit-rail-line-casing": {
|
|
2651
|
+
type: "line",
|
|
2652
|
+
source: "openmaptiles",
|
|
2653
|
+
"source-layer": "transportation",
|
|
2654
|
+
filter: [
|
|
2655
|
+
"all",
|
|
2656
|
+
["match", ["get", "brunnel"], ["bridge", "tunnel"], !0, !0],
|
|
2657
|
+
["==", ["get", "class"], "transit"]
|
|
2658
|
+
],
|
|
2659
|
+
paint: {
|
|
2660
|
+
"line-color": "#FF4D4F",
|
|
2661
|
+
"line-dasharray": [0.2, 8],
|
|
2662
|
+
"line-width": [
|
|
2663
|
+
"interpolate",
|
|
2664
|
+
["exponential", 1.4],
|
|
2665
|
+
["zoom"],
|
|
2666
|
+
14.5,
|
|
2667
|
+
0,
|
|
2668
|
+
15,
|
|
2669
|
+
3,
|
|
2670
|
+
20,
|
|
2671
|
+
8
|
|
2672
|
+
]
|
|
2673
|
+
},
|
|
2674
|
+
beforeId: "road-transit-rail-line"
|
|
2675
|
+
},
|
|
2676
|
+
"road-transit-rail-line": {
|
|
2677
|
+
type: "line",
|
|
2678
|
+
source: "openmaptiles",
|
|
2679
|
+
"source-layer": "transportation",
|
|
2680
|
+
filter: [
|
|
2681
|
+
"all",
|
|
2682
|
+
["match", ["get", "brunnel"], ["bridge", "tunnel"], !0, !0],
|
|
2683
|
+
["==", ["get", "class"], "transit"]
|
|
2684
|
+
],
|
|
2685
|
+
layout: { "line-cap": "round", "line-join": "round" },
|
|
2686
|
+
paint: {
|
|
2687
|
+
"line-color": "#FF4D4F",
|
|
2688
|
+
"line-width": [
|
|
2689
|
+
"interpolate",
|
|
2690
|
+
["exponential", 1.4],
|
|
2691
|
+
["zoom"],
|
|
2692
|
+
14,
|
|
2693
|
+
0.4,
|
|
2694
|
+
15,
|
|
2695
|
+
0.75,
|
|
2696
|
+
20,
|
|
2697
|
+
2
|
|
2698
|
+
]
|
|
2699
|
+
},
|
|
2700
|
+
beforeId: "building-extrusion"
|
|
2701
|
+
},
|
|
2702
|
+
"building-extrusion": {
|
|
2703
|
+
type: "fill-extrusion",
|
|
2704
|
+
source: "openmaptiles",
|
|
2705
|
+
"source-layer": "building",
|
|
2706
|
+
paint: {
|
|
2707
|
+
"fill-extrusion-color": "#B3B3B3FF",
|
|
2708
|
+
"fill-extrusion-height": ["get", "render_height"]
|
|
2709
|
+
},
|
|
2710
|
+
beforeId: "water_name_line_label"
|
|
2711
|
+
}
|
|
2712
|
+
};
|
|
2713
|
+
function Jn({ omit: e = [] }) {
|
|
2714
|
+
const a = E.useMemo(() => {
|
|
2715
|
+
const r = new Set(e), n = [], o = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), c = (p) => {
|
|
2716
|
+
if (r.has(p) || o.has(p)) return;
|
|
2717
|
+
if (d.has(p)) {
|
|
2718
|
+
console.warn(
|
|
2719
|
+
`Circular dependency detected involving map layer: ${p}`
|
|
2720
|
+
);
|
|
2721
|
+
return;
|
|
2722
|
+
}
|
|
2723
|
+
d.add(p);
|
|
2724
|
+
const u = ie[p];
|
|
2725
|
+
let h = u.beforeId;
|
|
2726
|
+
for (; h && r.has(h); )
|
|
2727
|
+
h = ie[h]?.beforeId;
|
|
2728
|
+
h && ie[h] && c(h), d.delete(p), o.add(p), n.push({ key: p, layer: { ...u, beforeId: h } });
|
|
2729
|
+
};
|
|
2730
|
+
return Object.keys(ie).forEach(c), n;
|
|
2731
|
+
}, [e]);
|
|
2732
|
+
return /* @__PURE__ */ i(B, { children: a.map(({ key: r, layer: n }) => /* @__PURE__ */ i(Et, { id: r, "data-slot": `map-layer-${r}`, ...n }, r)) });
|
|
2733
|
+
}
|
|
2734
|
+
const Te = _("group/progress flex flex-wrap", {
|
|
2735
|
+
variants: {
|
|
2736
|
+
size: {
|
|
2737
|
+
xs: "gap-1",
|
|
2738
|
+
sm: "gap-1",
|
|
2739
|
+
md: "gap-1",
|
|
2740
|
+
lg: "gap-2",
|
|
2741
|
+
xl: "gap-2"
|
|
2742
|
+
},
|
|
2743
|
+
raised: {
|
|
2744
|
+
default: "",
|
|
2745
|
+
xs: "*:-translate-0.5",
|
|
2746
|
+
sm: "*:-translate-0.75",
|
|
2747
|
+
md: "*:-translate-1",
|
|
2748
|
+
lg: "*:-translate-[4.75px]",
|
|
2749
|
+
xl: "*:-translate-[5.5px]"
|
|
2750
|
+
},
|
|
2751
|
+
stacked: {
|
|
2752
|
+
default: "[--stack-translate:--spacing(0)]",
|
|
2753
|
+
xs: "[--stack-translate:--spacing(0.5)] **:data-[value=100]:rounded-xl **:data-[value=100]:scale-x-101",
|
|
2754
|
+
sm: "[--stack-translate:3px] **:data-[value=100]:rounded-xl **:data-[value=100]:scale-x-101",
|
|
2755
|
+
md: "[--stack-translate:--spacing(1)] **:data-[value=100]:rounded-xl **:data-[value=100]:scale-x-101",
|
|
2756
|
+
lg: "[--stack-translate:4.75px] **:data-[value=100]:rounded-xl **:data-[value=100]:scale-x-101",
|
|
2757
|
+
xl: "[--stack-translate:5.5px] **:data-[value=100]:rounded-xl **:data-[value=100]:scale-x-101"
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2760
|
+
});
|
|
2761
|
+
function Xn(e) {
|
|
2762
|
+
const {
|
|
2763
|
+
size: a = "md",
|
|
2764
|
+
raised: r = "default",
|
|
2765
|
+
stacked: n = "default",
|
|
2766
|
+
className: o,
|
|
2767
|
+
children: d,
|
|
2768
|
+
...c
|
|
2769
|
+
} = e;
|
|
2770
|
+
if (e.mode === "multiple") {
|
|
2771
|
+
const p = [...e.value].sort((u, h) => h.value - u.value);
|
|
2772
|
+
return /* @__PURE__ */ k(
|
|
2773
|
+
H.Root,
|
|
2774
|
+
{
|
|
2775
|
+
"data-slot": "progress",
|
|
2776
|
+
"data-size": a,
|
|
2777
|
+
"data-raised": r,
|
|
2778
|
+
"data-stacked": n,
|
|
2779
|
+
className: l(Te({ size: a, raised: r, stacked: n }), o),
|
|
2780
|
+
...c,
|
|
2781
|
+
children: [
|
|
2782
|
+
d,
|
|
2783
|
+
/* @__PURE__ */ i(
|
|
2784
|
+
_e,
|
|
2785
|
+
{
|
|
2786
|
+
style: {
|
|
2787
|
+
marginTop: `calc(var(--stack-translate, 0px) * ${p.length - 1})`,
|
|
2788
|
+
transform: `translateX(calc(var(--stack-translate, 0px) * ${p.length - 1}))`
|
|
2789
|
+
},
|
|
2790
|
+
className: "grid grid-cols-1 *:row-start-1 *:col-start-1 *:row-end-1 *:col-end-1 items-end *:self-start",
|
|
2791
|
+
children: p.map((u, h) => /* @__PURE__ */ i(
|
|
2792
|
+
Kn,
|
|
2793
|
+
{
|
|
2794
|
+
index: h,
|
|
2795
|
+
"data-value": u.value,
|
|
2796
|
+
...u,
|
|
2797
|
+
children: /* @__PURE__ */ i(
|
|
2798
|
+
H.Value,
|
|
2799
|
+
{
|
|
2800
|
+
className: l(
|
|
2801
|
+
u.value < 5 ? "pr-0.5" : "",
|
|
2802
|
+
"text-muted leading-none font-heading tabular-nums h-full flex flex-row items-end justify-end gap-1 ml-auto my-auto",
|
|
2803
|
+
"group-data-[size=xs]/progress:hidden",
|
|
2804
|
+
"group-data-[size=sm]/progress:hidden",
|
|
2805
|
+
"group-data-[size=md]/progress:text-[11px]",
|
|
2806
|
+
"group-data-[size=lg]/progress:text-xs",
|
|
2807
|
+
"group-data-[size=xl]/progress:text-xs",
|
|
2808
|
+
"group-data-[size=md]/progress:pb-px group-data-[size=md]/progress:pr-1.25",
|
|
2809
|
+
"group-data-[size=lg]/progress:pb-1 group-data-[size=lg]/progress:pr-1.5 group-data-[size=lg]/progress:translate-y-px",
|
|
2810
|
+
"group-data-[size=xl]/progress:pb-1.75 group-data-[size=xl]/progress:pr-1.75 group-data-[size=xl]/progress:translate-y-0.5",
|
|
2811
|
+
"group-data-[stacked=default]/progress:translate-y-0 group-data-[stacked=default]/progress:items-center"
|
|
2812
|
+
),
|
|
2813
|
+
"data-slot": "progress-indicator-group-value",
|
|
2814
|
+
children: () => /* @__PURE__ */ k(B, { children: [
|
|
2815
|
+
u.name && /* @__PURE__ */ i(
|
|
2816
|
+
"span",
|
|
2817
|
+
{
|
|
2818
|
+
className: "font-semibold line-clamp-1 opacity-0 -translate-y-10 transition-[opacity,translate] duration-200 hover:ease-in ease-out",
|
|
2819
|
+
"data-slot": "progress-name",
|
|
2820
|
+
children: u.name
|
|
2821
|
+
}
|
|
2822
|
+
),
|
|
2823
|
+
u.value.toLocaleString("default", {
|
|
2824
|
+
minimumFractionDigits: 0,
|
|
2825
|
+
maximumFractionDigits: 2
|
|
2826
|
+
}),
|
|
2827
|
+
u.value < 5 ? "" : "%"
|
|
2828
|
+
] })
|
|
2829
|
+
}
|
|
2830
|
+
)
|
|
2831
|
+
},
|
|
2832
|
+
h
|
|
2833
|
+
))
|
|
2834
|
+
}
|
|
2835
|
+
)
|
|
2836
|
+
]
|
|
2837
|
+
}
|
|
2838
|
+
);
|
|
2839
|
+
}
|
|
2840
|
+
return /* @__PURE__ */ k(
|
|
2841
|
+
H.Root,
|
|
2842
|
+
{
|
|
2843
|
+
...c,
|
|
2844
|
+
value: e.value,
|
|
2845
|
+
"data-slot": "progress",
|
|
2846
|
+
"data-size": a,
|
|
2847
|
+
"data-raised": r,
|
|
2848
|
+
"data-stacked": n,
|
|
2849
|
+
className: l(Te({ size: a, raised: r, stacked: n }), o),
|
|
2850
|
+
children: [
|
|
2851
|
+
d,
|
|
2852
|
+
/* @__PURE__ */ i(_e, { children: /* @__PURE__ */ i(Yn, { "data-value": e.value }) })
|
|
2853
|
+
]
|
|
2854
|
+
}
|
|
2855
|
+
);
|
|
2856
|
+
}
|
|
2857
|
+
function _e({ className: e, ...a }) {
|
|
2858
|
+
return /* @__PURE__ */ i(
|
|
2859
|
+
H.Track,
|
|
2860
|
+
{
|
|
2861
|
+
className: l(
|
|
2862
|
+
"bg-surface border-2 rounded-full relative flex w-full items-center",
|
|
2863
|
+
"group-data-[raised=xs]/progress:shadow-xs",
|
|
2864
|
+
"group-data-[raised=sm]/progress:shadow-sm",
|
|
2865
|
+
"group-data-[raised=md]/progress:shadow-md",
|
|
2866
|
+
"group-data-[raised=lg]/progress:shadow-lg",
|
|
2867
|
+
"group-data-[raised=xl]/progress:shadow-xl",
|
|
2868
|
+
"group-data-[size=xs]/progress:h-3",
|
|
2869
|
+
"group-data-[size=sm]/progress:h-4",
|
|
2870
|
+
"group-data-[size=md]/progress:h-5",
|
|
2871
|
+
"group-data-[size=lg]/progress:h-6",
|
|
2872
|
+
"group-data-[size=xl]/progress:h-7",
|
|
2873
|
+
"group-data-[stacked=default]/progress:overflow-hidden",
|
|
2874
|
+
"overflow-visible",
|
|
2875
|
+
e
|
|
2876
|
+
),
|
|
2877
|
+
"data-slot": "progress-track",
|
|
2878
|
+
...a
|
|
2879
|
+
}
|
|
2880
|
+
);
|
|
2881
|
+
}
|
|
2882
|
+
function Yn({
|
|
2883
|
+
className: e,
|
|
2884
|
+
...a
|
|
2885
|
+
}) {
|
|
2886
|
+
return /* @__PURE__ */ i(
|
|
2887
|
+
H.Indicator,
|
|
2888
|
+
{
|
|
2889
|
+
"data-slot": "progress-indicator",
|
|
2890
|
+
className: l(
|
|
2891
|
+
"bg-main h-full transition-all overflow-hidden border-2 rounded-l-xl",
|
|
2892
|
+
"group-data-[stacked=default]/progress:rounded-l-none",
|
|
2893
|
+
"group-data-[stacked=default]/progress:border-0",
|
|
2894
|
+
"group-data-[stacked=xs]/progress:shadow-xs group-data-[stacked=xs]/progress:-translate-0.5",
|
|
2895
|
+
"group-data-[stacked=sm]/progress:shadow-sm group-data-[stacked=sm]/progress:-translate-0.75",
|
|
2896
|
+
"group-data-[stacked=md]/progress:shadow-md group-data-[stacked=md]/progress:-translate-1",
|
|
2897
|
+
"group-data-[stacked=lg]/progress:shadow-lg group-data-[stacked=lg]/progress:-translate-[4.75px]",
|
|
2898
|
+
"group-data-[stacked=xl]/progress:shadow-xl group-data-[stacked=xl]/progress:-translate-[5.5px]",
|
|
2899
|
+
e
|
|
2900
|
+
),
|
|
2901
|
+
...a
|
|
2902
|
+
}
|
|
2903
|
+
);
|
|
2904
|
+
}
|
|
2905
|
+
function Kn({
|
|
2906
|
+
className: e,
|
|
2907
|
+
children: a,
|
|
2908
|
+
value: r,
|
|
2909
|
+
index: n,
|
|
2910
|
+
...o
|
|
2911
|
+
}) {
|
|
2912
|
+
return /* @__PURE__ */ i(
|
|
2913
|
+
H.Indicator,
|
|
2914
|
+
{
|
|
2915
|
+
"data-slot": "progress-indicator-group",
|
|
2916
|
+
"data-value": r,
|
|
2917
|
+
"data-group": !0,
|
|
2918
|
+
className: l(
|
|
2919
|
+
"group/progress-indicator-group bg-main overflow-hidden transition-height duration-200 ease-in hover:ease-out border-2 rounded-l-xl",
|
|
2920
|
+
"group-data-[size=xs]/progress:h-2.5 group-data-[size=xs]/progress:hover:h-2.5 group-data-[stacked=default]/progress:group-data-[size=xs]/progress:hover:h-2.5",
|
|
2921
|
+
"group-data-[size=sm]/progress:h-3.5 group-data-[size=sm]/progress:hover:h-3.5 group-data-[stacked=default]/progress:group-data-[size=sm]/progress:hover:h-3.5",
|
|
2922
|
+
"group-data-[size=md]/progress:h-4.5 group-data-[size=md]/progress:hover:h-7.75 group-data-[stacked=default]/progress:group-data-[size=md]/progress:hover:h-4.5",
|
|
2923
|
+
"group-data-[size=lg]/progress:h-5.5 group-data-[size=lg]/progress:hover:h-9.75 group-data-[stacked=default]/progress:group-data-[size=lg]/progress:hover:h-5.5",
|
|
2924
|
+
"group-data-[size=xl]/progress:h-6.5 group-data-[size=xl]/progress:hover:h-11.25 group-data-[stacked=default]/progress:group-data-[size=xl]/progress:hover:h-6.5",
|
|
2925
|
+
"group-data-[stacked=default]/progress:rounded-none group-data-[stacked=default]/progress:border-0 group-data-[stacked=default]/progress:rounded-l-none",
|
|
2926
|
+
"group-data-[stacked=xs]/progress:shadow-xs group-data-[stacked=xs]/progress:-translate-0.5",
|
|
2927
|
+
"group-data-[stacked=sm]/progress:shadow-sm group-data-[stacked=sm]/progress:-translate-0.75",
|
|
2928
|
+
"group-data-[stacked=md]/progress:shadow-md group-data-[stacked=md]/progress:-translate-1",
|
|
2929
|
+
"group-data-[stacked=lg]/progress:shadow-lg group-data-[stacked=lg]/progress:-translate-[4.75px]",
|
|
2930
|
+
"group-data-[stacked=xl]/progress:shadow-xl group-data-[stacked=xl]/progress:-translate-[5.5px]",
|
|
2931
|
+
"hover:**:data-[slot=progress-value]:flex-wrap hover:**:text-foreground hover:**:**:data-[slot=progress-name]:opacity-100 hover:**:data-[slot=progress-name]:translate-0",
|
|
2932
|
+
e
|
|
2933
|
+
),
|
|
2934
|
+
...o,
|
|
2935
|
+
style: {
|
|
2936
|
+
minWidth: `${r}%`,
|
|
2937
|
+
maxWidth: `${r}%`,
|
|
2938
|
+
transform: `translateX(calc(var(--stack-translate, 0px) * -${n})) translateY(calc(var(--stack-translate, 0px) * -${n}))`
|
|
2939
|
+
},
|
|
2940
|
+
children: a
|
|
2941
|
+
}
|
|
2942
|
+
);
|
|
2943
|
+
}
|
|
2944
|
+
function Zn({
|
|
2945
|
+
className: e,
|
|
2946
|
+
orientation: a = "horizontal",
|
|
2947
|
+
...r
|
|
2948
|
+
}) {
|
|
2949
|
+
return /* @__PURE__ */ i(
|
|
2950
|
+
fe.Root,
|
|
2951
|
+
{
|
|
2952
|
+
"data-slot": "tabs",
|
|
2953
|
+
"data-orientation": a,
|
|
2954
|
+
className: l(
|
|
2955
|
+
"gap-2 group/tabs flex",
|
|
2956
|
+
"data-[orientation=horizontal]:flex-col",
|
|
2957
|
+
"data-[orientation=vertical]:w-full",
|
|
2958
|
+
e
|
|
2959
|
+
),
|
|
2960
|
+
...r
|
|
2961
|
+
}
|
|
2962
|
+
);
|
|
2963
|
+
}
|
|
2964
|
+
const Qn = _(
|
|
2965
|
+
"overflow-auto inline-flex bg-transparent w-fit items-start justify-start group-data-horizontal/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
|
|
2966
|
+
{
|
|
2967
|
+
variants: {
|
|
2968
|
+
variant: {
|
|
2969
|
+
default: "gap-1.5 border-2 rounded-base p-[calc(var(--trigger-translate)+6px)]",
|
|
2970
|
+
ghost: "gap-1 border-none rounded-none p-[calc(var(--trigger-translate)+6px)]",
|
|
2971
|
+
icon: "gap-1.5 border-2 rounded-base p-[calc(var(--trigger-translate)+6px)]",
|
|
2972
|
+
contained: "gap-0 border-0 rounded-md p-[calc(var(--trigger-translate)+2px)]"
|
|
2973
|
+
},
|
|
2974
|
+
size: {
|
|
2975
|
+
sm: "",
|
|
2976
|
+
md: "",
|
|
2977
|
+
lg: "",
|
|
2978
|
+
xl: ""
|
|
2979
|
+
},
|
|
2980
|
+
extrude: {
|
|
2981
|
+
default: "[--trigger-shadow:var(--shadow-none)] [--trigger-translate:0px] [--focus-trigger-translate:0px]",
|
|
2982
|
+
xs: "[--trigger-shadow:var(--shadow-min)] [--trigger-translate:1px] [--focus-trigger-shadow:var(--shadow-none)] [--focus-trigger-translate:0px]",
|
|
2983
|
+
sm: "[--trigger-shadow:var(--shadow-xs)] [--trigger-translate:2px] [--focus-trigger-shadow:var(--shadow-min)] [--focus-trigger-translate:1px]",
|
|
2984
|
+
md: "[--trigger-shadow:var(--shadow-sm)] [--trigger-translate:3px] [--focus-trigger-shadow:var(--shadow-xs)] [--focus-trigger-translate:2px]",
|
|
2985
|
+
lg: "[--trigger-shadow:var(--shadow-md)] [--trigger-translate:4px] [--focus-trigger-shadow:var(--shadow-xs)] [--focus-trigger-translate:2px]",
|
|
2986
|
+
xl: "[--trigger-shadow:var(--shadow-lg)] [--trigger-translate:5px] [--focus-trigger-shadow:var(--shadow-xs)] [--focus-trigger-translate:2px]"
|
|
2987
|
+
}
|
|
2988
|
+
},
|
|
2989
|
+
defaultVariants: {
|
|
2990
|
+
variant: "default",
|
|
2991
|
+
size: "md",
|
|
2992
|
+
extrude: "default"
|
|
2993
|
+
}
|
|
2994
|
+
}
|
|
2995
|
+
);
|
|
2996
|
+
function eo({
|
|
2997
|
+
className: e,
|
|
2998
|
+
variant: a = "default",
|
|
2999
|
+
size: r = "md",
|
|
3000
|
+
extrude: n = "default",
|
|
3001
|
+
...o
|
|
3002
|
+
}) {
|
|
3003
|
+
return /* @__PURE__ */ i(
|
|
3004
|
+
fe.List,
|
|
3005
|
+
{
|
|
3006
|
+
"data-slot": "tabs-list",
|
|
3007
|
+
"data-variant": a,
|
|
3008
|
+
"data-size": r,
|
|
3009
|
+
className: l(
|
|
3010
|
+
Qn({ variant: a, size: r, extrude: n }),
|
|
3011
|
+
"group/tabs-list",
|
|
3012
|
+
e
|
|
3013
|
+
),
|
|
3014
|
+
...o
|
|
3015
|
+
}
|
|
3016
|
+
);
|
|
3017
|
+
}
|
|
3018
|
+
function Ne({
|
|
3019
|
+
label: e,
|
|
3020
|
+
description: a,
|
|
3021
|
+
children: r,
|
|
3022
|
+
className: n,
|
|
3023
|
+
onClick: o,
|
|
3024
|
+
...d
|
|
3025
|
+
}) {
|
|
3026
|
+
const { trigger: c } = ae();
|
|
3027
|
+
return /* @__PURE__ */ k(
|
|
3028
|
+
fe.Tab,
|
|
3029
|
+
{
|
|
3030
|
+
"data-slot": "tabs-trigger",
|
|
3031
|
+
"aria-label": d.value ?? "tabs-trigger",
|
|
3032
|
+
className: l(
|
|
3033
|
+
"group/tabs-trigger neo-base relative inline-flex flex-1 items-center justify-center overflow-hidden cursor-pointer rounded-base border-2 py-1",
|
|
3034
|
+
"bg-surface data-active:bg-main",
|
|
3035
|
+
"font-medium h-[calc(100%-1px)] whitespace-nowrap [&_svg]:shrink-0",
|
|
3036
|
+
"transition-[translate,box-shadow,border,color] duration-200",
|
|
3037
|
+
"aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:shadow-none aria-disabled:translate-0",
|
|
3038
|
+
"group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start",
|
|
3039
|
+
"active:shadow-none active:translate-0",
|
|
3040
|
+
"data-active:shadow-(--trigger-shadow) data-active:-translate-(--trigger-translate)",
|
|
3041
|
+
"hover:shadow-(--trigger-shadow) hover:-translate-(--trigger-translate)",
|
|
3042
|
+
"focus-visible:shadow-(--focus-trigger-shadow) focus-visible:-translate-(--focus-trigger-translate)",
|
|
3043
|
+
"focus-visible:hover:-translate-(--focus-trigger-translate) focus-visible:**:font-semibold",
|
|
3044
|
+
"group-data-[size=xl]/tabs-list:min-h-12",
|
|
3045
|
+
"group-data-[size=sm]/tabs-list:[&_svg:not([class*='size-'])]:size-4",
|
|
3046
|
+
"group-data-[size=md]/tabs-list:[&_svg:not([class*='size-'])]:size-5",
|
|
3047
|
+
"group-data-[size=lg]/tabs-list:[&_svg:not([class*='size-'])]:size-6",
|
|
3048
|
+
"group-data-[size=xl]/tabs-list:[&_svg:not([class*='size-'])]:size-7",
|
|
3049
|
+
"group-data-[variant=default]/tabs-list:group-data-[size=sm]/tabs-list:px-3",
|
|
3050
|
+
"group-data-[variant=default]/tabs-list:group-data-[size=md]/tabs-list:px-4",
|
|
3051
|
+
"group-data-[variant=default]/tabs-list:group-data-[size=lg]/tabs-list:px-5",
|
|
3052
|
+
"group-data-[variant=default]/tabs-list:group-data-[size=xl]/tabs-list:px-6",
|
|
3053
|
+
"group-data-[variant=ghost]/tabs-list:group-data-[size=sm]/tabs-list:px-3",
|
|
3054
|
+
"group-data-[variant=ghost]/tabs-list:group-data-[size=md]/tabs-list:px-4",
|
|
3055
|
+
"group-data-[variant=ghost]/tabs-list:group-data-[size=lg]/tabs-list:px-5",
|
|
3056
|
+
"group-data-[variant=ghost]/tabs-list:group-data-[size=xl]/tabs-list:px-6",
|
|
3057
|
+
"group-data-[variant=ghost]/tabs-list:border-none",
|
|
3058
|
+
"group-data-[variant=ghost]/tabs-list:data-active:bg-transparent group-data-[variant=ghost]/tabs-list:shadow-none",
|
|
3059
|
+
"group-data-[variant=icon]/tabs-list:group-data-[size=sm]/tabs-list:px-1.5",
|
|
3060
|
+
"group-data-[variant=icon]/tabs-list:group-data-[size=md]/tabs-list:px-2",
|
|
3061
|
+
"group-data-[variant=icon]/tabs-list:group-data-[size=lg]/tabs-list:px-2.5",
|
|
3062
|
+
"group-data-[variant=icon]/tabs-list:group-data-[size=xl]/tabs-list:px-3",
|
|
3063
|
+
"group-data-[variant=icon]/tabs-list:m-auto group-data-[variant=icon]/tabs-list:max-w-fit group-data-[variant=icon]/tabs-list:aspect-square group-data-[variant=icon]/tabs-list:items-center group-data-[variant=icon]/tabs-list:justify-center group-data-[variant=icon]/tabs-list:hover:border-foreground group-data-[variant=icon]/tabs-list:border-transparent group-data-[variant=icon]/tabs-list:data-active:border-border",
|
|
3064
|
+
"group-data-[variant=contained]/tabs-list:group-data-[size=sm]/tabs-list:px-3",
|
|
3065
|
+
"group-data-[variant=contained]/tabs-list:group-data-[size=md]/tabs-list:px-4",
|
|
3066
|
+
"group-data-[variant=contained]/tabs-list:group-data-[size=lg]/tabs-list:px-5",
|
|
3067
|
+
"group-data-[variant=contained]/tabs-list:group-data-[size=xl]/tabs-list:px-6",
|
|
3068
|
+
"group-data-[orientation=horizontal]/tabs:group-data-[variant=contained]/tabs-list:not-last:rounded-r-none group-data-[orientation=horizontal]/tabs:group-data-[variant=contained]/tabs-list:not-first:rounded-l-none group-data-[orientation=vertical]/tabs:group-data-[variant=contained]/tabs-list:not-last:rounded-b-none group-data-[orientation=vertical]/tabs:group-data-[variant=contained]/tabs-list:not-first:rounded-t-none group-data-[variant=contained]/tabs-list:-m-px",
|
|
3069
|
+
r ? "gap-1.5" : "flex-col gap-0.5",
|
|
3070
|
+
n
|
|
3071
|
+
),
|
|
3072
|
+
onClick: (p) => {
|
|
3073
|
+
c(Zr), o?.(p);
|
|
3074
|
+
},
|
|
3075
|
+
...d,
|
|
3076
|
+
children: [
|
|
3077
|
+
e && /* @__PURE__ */ i(
|
|
3078
|
+
"span",
|
|
3079
|
+
{
|
|
3080
|
+
"data-slot": "tabs-trigger-label",
|
|
3081
|
+
className: l(
|
|
3082
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 font-medium font-heading",
|
|
3083
|
+
"group-data-[size=sm]/tabs-list:text-sm",
|
|
3084
|
+
"group-data-[size=md]/tabs-list:text-base",
|
|
3085
|
+
"group-data-[size=lg]/tabs-list:text-lg",
|
|
3086
|
+
"group-data-[size=xl]/tabs-list:text-2xl"
|
|
3087
|
+
),
|
|
3088
|
+
children: e
|
|
3089
|
+
}
|
|
3090
|
+
),
|
|
3091
|
+
a && /* @__PURE__ */ i(
|
|
3092
|
+
"span",
|
|
3093
|
+
{
|
|
3094
|
+
"data-slot": "tabs-trigger-description",
|
|
3095
|
+
className: l(
|
|
3096
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 whitespace-normal",
|
|
3097
|
+
"group-data-[size=sm]/tabs-list:text-xs",
|
|
3098
|
+
"group-data-[size=md]/tabs-list:text-sm",
|
|
3099
|
+
"group-data-[size=lg]/tabs-list:text-base",
|
|
3100
|
+
"group-data-[size=xl]/tabs-list:text-lg"
|
|
3101
|
+
),
|
|
3102
|
+
children: a
|
|
3103
|
+
}
|
|
3104
|
+
),
|
|
3105
|
+
r,
|
|
3106
|
+
/* @__PURE__ */ i(
|
|
3107
|
+
"div",
|
|
3108
|
+
{
|
|
3109
|
+
"data-slot": "tabs-trigger-indicator",
|
|
3110
|
+
className: l(
|
|
3111
|
+
"pointer-events-none h-[3px] rounded-full bg-foreground absolute hidden bottom-0 left-1 right-1",
|
|
3112
|
+
"group-data-[variant=ghost]/tabs-list:group-data-active/tabs-trigger:block"
|
|
3113
|
+
)
|
|
3114
|
+
}
|
|
3115
|
+
)
|
|
3116
|
+
]
|
|
3117
|
+
}
|
|
3118
|
+
);
|
|
3119
|
+
}
|
|
3120
|
+
const Pe = '"Great Vibes", cursive', to = 64, ao = 24, ro = 20;
|
|
3121
|
+
function Re({
|
|
3122
|
+
canvas: e,
|
|
3123
|
+
text: a,
|
|
3124
|
+
width: r,
|
|
3125
|
+
height: n,
|
|
3126
|
+
ratio: o
|
|
3127
|
+
}) {
|
|
3128
|
+
const d = e.getContext("2d");
|
|
3129
|
+
if (!d) return !1;
|
|
3130
|
+
const c = Math.max(1, Math.floor(r)), p = Math.max(1, Math.floor(n)), u = Math.max(o || 1, 1);
|
|
3131
|
+
e.width = Math.max(1, Math.floor(c * u)), e.height = Math.max(1, Math.floor(p * u)), d.setTransform(u, 0, 0, u, 0, 0), d.clearRect(0, 0, c, p);
|
|
3132
|
+
const h = a.trim();
|
|
3133
|
+
if (!h) return !1;
|
|
3134
|
+
const f = Math.max(1, c - ro * 2);
|
|
3135
|
+
d.fillStyle = "#000", d.textAlign = "center", d.textBaseline = "middle";
|
|
3136
|
+
let b = to;
|
|
3137
|
+
for (; b > ao && (d.font = `${b}px ${Pe}`, !(d.measureText(h).width <= f)); )
|
|
3138
|
+
b -= 1;
|
|
3139
|
+
return d.font = `${b}px ${Pe}`, d.fillText(h, c / 2, p / 2, f), !0;
|
|
3140
|
+
}
|
|
3141
|
+
function no({
|
|
3142
|
+
value: e,
|
|
3143
|
+
onChange: a,
|
|
3144
|
+
canvasClassname: r,
|
|
3145
|
+
imageType: n = "image/png"
|
|
3146
|
+
}) {
|
|
3147
|
+
const [o, d] = Ie("sign"), [c, p] = Ie(""), u = $(null), h = $(null), f = $(a), b = $(e ?? null), y = $(!1), w = $({ width: 0, height: 0 }), P = pe((x) => {
|
|
3148
|
+
b.current !== x && (b.current = x, f.current?.(x));
|
|
3149
|
+
}, []);
|
|
3150
|
+
oe(() => {
|
|
3151
|
+
f.current = a;
|
|
3152
|
+
}, [a]), oe(() => {
|
|
3153
|
+
b.current = e ?? null;
|
|
3154
|
+
}, [e]), oe(() => {
|
|
3155
|
+
if (y.current || (y.current = !0, !e || o !== "sign")) return;
|
|
3156
|
+
const x = u.current;
|
|
3157
|
+
if (x)
|
|
3158
|
+
try {
|
|
3159
|
+
x.fromDataURL(e);
|
|
3160
|
+
} catch {
|
|
3161
|
+
x.clear();
|
|
3162
|
+
}
|
|
3163
|
+
}, []), oe(() => {
|
|
3164
|
+
if (o !== "type") return;
|
|
3165
|
+
const x = h.current;
|
|
3166
|
+
if (!x) return;
|
|
3167
|
+
if (w.current.width === 0) {
|
|
3168
|
+
const j = x.getBoundingClientRect();
|
|
3169
|
+
w.current = {
|
|
3170
|
+
width: Math.max(1, Math.floor(j.width)),
|
|
3171
|
+
height: Math.max(1, Math.floor(j.height))
|
|
3172
|
+
};
|
|
3173
|
+
}
|
|
3174
|
+
const v = w.current;
|
|
3175
|
+
if (!v.width || !v.height) return;
|
|
3176
|
+
const A = window.devicePixelRatio || 1;
|
|
3177
|
+
if (!Re({
|
|
3178
|
+
canvas: x,
|
|
3179
|
+
text: c,
|
|
3180
|
+
width: v.width,
|
|
3181
|
+
height: v.height,
|
|
3182
|
+
ratio: A
|
|
3183
|
+
})) {
|
|
3184
|
+
P(null);
|
|
3185
|
+
return;
|
|
3186
|
+
}
|
|
3187
|
+
const N = document.createElement("canvas");
|
|
3188
|
+
Re({
|
|
3189
|
+
canvas: N,
|
|
3190
|
+
text: c,
|
|
3191
|
+
width: v.width,
|
|
3192
|
+
height: v.height,
|
|
3193
|
+
ratio: A
|
|
3194
|
+
}), P(N.toDataURL(n));
|
|
3195
|
+
}, [o, c, n, P]);
|
|
3196
|
+
const U = () => {
|
|
3197
|
+
u.current?.clear(), p(""), P(null);
|
|
3198
|
+
}, T = () => {
|
|
3199
|
+
if (o !== "sign") return;
|
|
3200
|
+
const x = u.current?.toDataURL(n) ?? null;
|
|
3201
|
+
P(x);
|
|
3202
|
+
}, R = (x) => {
|
|
3203
|
+
x !== o && (U(), d(x));
|
|
3204
|
+
}, z = (x) => {
|
|
3205
|
+
p(x.target.value);
|
|
3206
|
+
};
|
|
3207
|
+
return /* @__PURE__ */ i("div", { id: "signature", children: /* @__PURE__ */ k(
|
|
3208
|
+
Je,
|
|
3209
|
+
{
|
|
3210
|
+
className: l(
|
|
3211
|
+
o === "type" ? "max-h-84" : "max-h-69",
|
|
3212
|
+
"overflow-hidden transition-[max-height] duration-300 has-[>[data-align=block-start]]:p-2 gap-2"
|
|
3213
|
+
),
|
|
3214
|
+
children: [
|
|
3215
|
+
/* @__PURE__ */ i(Xe, { align: "block-start", className: "p-0!", children: /* @__PURE__ */ k("div", { className: "relative w-full rounded-base", children: [
|
|
3216
|
+
/* @__PURE__ */ k("div", { className: "absolute top-4 left-4 right-3 bg-transparent flex flex-row items-start justify-between gap-3", children: [
|
|
3217
|
+
/* @__PURE__ */ i(
|
|
3218
|
+
Zn,
|
|
3219
|
+
{
|
|
3220
|
+
value: o,
|
|
3221
|
+
onValueChange: (x) => R(x),
|
|
3222
|
+
className: "-mt-1",
|
|
3223
|
+
children: /* @__PURE__ */ k(eo, { variant: "contained", extrude: "sm", size: "md", children: [
|
|
3224
|
+
/* @__PURE__ */ k(Ne, { value: "sign", children: [
|
|
3225
|
+
/* @__PURE__ */ i(vt, {}),
|
|
3226
|
+
/* @__PURE__ */ i("span", { className: "hidden sm:flex", children: "Draw" })
|
|
3227
|
+
] }),
|
|
3228
|
+
/* @__PURE__ */ k(Ne, { value: "type", children: [
|
|
3229
|
+
/* @__PURE__ */ i(yt, {}),
|
|
3230
|
+
/* @__PURE__ */ i("span", { className: "hidden sm:flex", children: "Type" })
|
|
3231
|
+
] })
|
|
3232
|
+
] })
|
|
3233
|
+
}
|
|
3234
|
+
),
|
|
3235
|
+
/* @__PURE__ */ k(
|
|
3236
|
+
de,
|
|
3237
|
+
{
|
|
3238
|
+
size: "sm",
|
|
3239
|
+
raised: "xs",
|
|
3240
|
+
variant: "outline",
|
|
3241
|
+
onClick: U,
|
|
3242
|
+
children: [
|
|
3243
|
+
/* @__PURE__ */ i(wt, {}),
|
|
3244
|
+
/* @__PURE__ */ i("span", { className: "hidden sm:flex", children: "Clear" })
|
|
3245
|
+
]
|
|
3246
|
+
}
|
|
3247
|
+
)
|
|
3248
|
+
] }),
|
|
3249
|
+
o === "sign" ? /* @__PURE__ */ i(
|
|
3250
|
+
Lt,
|
|
3251
|
+
{
|
|
3252
|
+
ref: u,
|
|
3253
|
+
onEnd: T,
|
|
3254
|
+
canvasProps: {
|
|
3255
|
+
className: r ?? l(
|
|
3256
|
+
"w-full h-[256px]",
|
|
3257
|
+
"bg-size-[32px_32px] bg-surface",
|
|
3258
|
+
"bg-[linear-gradient(to_right,#80808022_1px,transparent_1px),linear-gradient(to_bottom,#80808022_1px,transparent_1px)]",
|
|
3259
|
+
"inset-shadow-sm",
|
|
3260
|
+
"border-border border-2 rounded-base",
|
|
3261
|
+
"cursor-crosshair"
|
|
3262
|
+
)
|
|
3263
|
+
}
|
|
3264
|
+
}
|
|
3265
|
+
) : /* @__PURE__ */ i(
|
|
3266
|
+
"canvas",
|
|
3267
|
+
{
|
|
3268
|
+
ref: h,
|
|
3269
|
+
className: l(
|
|
3270
|
+
"w-full h-64",
|
|
3271
|
+
"bg-size-[32px_32px] bg-surface",
|
|
3272
|
+
"bg-[linear-gradient(to_right,#80808022_1px,transparent_1px),linear-gradient(to_bottom,#80808022_1px,transparent_1px)]",
|
|
3273
|
+
"inset-shadow-sm",
|
|
3274
|
+
"border-border border-2 rounded-base"
|
|
3275
|
+
)
|
|
3276
|
+
}
|
|
3277
|
+
)
|
|
3278
|
+
] }) }),
|
|
3279
|
+
/* @__PURE__ */ i(
|
|
3280
|
+
Ye,
|
|
3281
|
+
{
|
|
3282
|
+
disabled: o !== "type",
|
|
3283
|
+
className: l(
|
|
3284
|
+
o === "type" ? "animate-in zoom-in-0 spin-in-20 scale-100" : "animate-out zoom-out-0 spin-out-20 scale-0",
|
|
3285
|
+
"py-2 text-lg font-medium transition-[scale,translate,box-shadow] duration-300 origin-bottom-left"
|
|
3286
|
+
),
|
|
3287
|
+
placeholder: "Enter Full Name",
|
|
3288
|
+
value: c,
|
|
3289
|
+
onChange: z
|
|
3290
|
+
}
|
|
3291
|
+
)
|
|
3292
|
+
]
|
|
3293
|
+
}
|
|
3294
|
+
) });
|
|
3295
|
+
}
|
|
3296
|
+
const oo = _("bg-border shrink-0", {
|
|
3297
|
+
variants: {
|
|
3298
|
+
stroke: {
|
|
3299
|
+
thin: "border-0.5",
|
|
3300
|
+
regular: "border-1",
|
|
3301
|
+
thick: "border-2"
|
|
3302
|
+
},
|
|
3303
|
+
orientation: {
|
|
3304
|
+
horizontal: "h-px w-full",
|
|
3305
|
+
vertical: "w-px self-stretch"
|
|
3306
|
+
}
|
|
3307
|
+
},
|
|
3308
|
+
defaultVariants: {
|
|
3309
|
+
stroke: "regular",
|
|
3310
|
+
orientation: "horizontal"
|
|
3311
|
+
}
|
|
3312
|
+
});
|
|
3313
|
+
function io({
|
|
3314
|
+
className: e,
|
|
3315
|
+
orientation: a,
|
|
3316
|
+
stroke: r,
|
|
3317
|
+
...n
|
|
3318
|
+
}) {
|
|
3319
|
+
return /* @__PURE__ */ i(
|
|
3320
|
+
Ot,
|
|
3321
|
+
{
|
|
3322
|
+
"data-slot": "separator",
|
|
3323
|
+
orientation: a,
|
|
3324
|
+
className: l(oo({ orientation: a, stroke: r }), e),
|
|
3325
|
+
...n
|
|
3326
|
+
}
|
|
3327
|
+
);
|
|
3328
|
+
}
|
|
3329
|
+
const so = _("bg-foreground/30 rounded-base", {
|
|
3330
|
+
variants: {
|
|
3331
|
+
variant: {
|
|
3332
|
+
circle: "aspect-square w-auto rounded-full",
|
|
3333
|
+
square: "aspect-square w-auto",
|
|
3334
|
+
default: "grow",
|
|
3335
|
+
text: "aspect-[1/19] w-auto rounded-full max-h-10"
|
|
3336
|
+
},
|
|
3337
|
+
animate: {
|
|
3338
|
+
true: "animate-pulse",
|
|
3339
|
+
false: ""
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
3342
|
+
});
|
|
3343
|
+
function lo({
|
|
3344
|
+
variant: e = "default",
|
|
3345
|
+
animate: a = !0,
|
|
3346
|
+
className: r,
|
|
3347
|
+
...n
|
|
3348
|
+
}) {
|
|
3349
|
+
return /* @__PURE__ */ i(
|
|
3350
|
+
"div",
|
|
3351
|
+
{
|
|
3352
|
+
"data-slot": "skeleton",
|
|
3353
|
+
className: l(so({ variant: e, animate: a }), r),
|
|
3354
|
+
...n
|
|
3355
|
+
}
|
|
3356
|
+
);
|
|
3357
|
+
}
|
|
3358
|
+
const co = _(
|
|
3359
|
+
"neo-base neo-switch-focus relative cursor-pointer inline-flex items-center data-checked:bg-main data-unchecked:bg-surface shrink-0 border-2 border-border transition-[translate,box-shadow,color] aria-disabled:cursor-not-allowed aria-disabled:opacity-50",
|
|
3360
|
+
{
|
|
3361
|
+
variants: {
|
|
3362
|
+
size: {
|
|
3363
|
+
sm: "h-5 w-10",
|
|
3364
|
+
md: "h-6 w-12",
|
|
3365
|
+
lg: "h-7 w-14"
|
|
3366
|
+
},
|
|
3367
|
+
rounded: {
|
|
3368
|
+
none: "rounded-none",
|
|
3369
|
+
sm: "rounded-sm",
|
|
3370
|
+
md: "rounded-md",
|
|
3371
|
+
lg: "rounded-lg",
|
|
3372
|
+
full: "rounded-[999px]"
|
|
3373
|
+
}
|
|
3374
|
+
},
|
|
3375
|
+
defaultVariants: {
|
|
3376
|
+
size: "md",
|
|
3377
|
+
rounded: "full"
|
|
3378
|
+
}
|
|
3379
|
+
}
|
|
3380
|
+
);
|
|
3381
|
+
function uo({
|
|
3382
|
+
className: e,
|
|
3383
|
+
size: a = "md",
|
|
3384
|
+
rounded: r = "full",
|
|
3385
|
+
onCheckedChange: n,
|
|
3386
|
+
...o
|
|
3387
|
+
}) {
|
|
3388
|
+
const { trigger: d } = ae();
|
|
3389
|
+
return /* @__PURE__ */ i(
|
|
3390
|
+
Ce.Root,
|
|
3391
|
+
{
|
|
3392
|
+
"data-slot": "switch",
|
|
3393
|
+
"data-size": a,
|
|
3394
|
+
"data-rounded": r,
|
|
3395
|
+
className: l(
|
|
3396
|
+
co({ size: a, rounded: r }),
|
|
3397
|
+
"peer group/switch",
|
|
3398
|
+
e
|
|
3399
|
+
),
|
|
3400
|
+
"aria-label": o["aria-label"] ?? "switch",
|
|
3401
|
+
onCheckedChange: (c, p) => {
|
|
3402
|
+
d(Qr), n?.(c, p);
|
|
3403
|
+
},
|
|
3404
|
+
...o,
|
|
3405
|
+
children: /* @__PURE__ */ i(
|
|
3406
|
+
Ce.Thumb,
|
|
3407
|
+
{
|
|
3408
|
+
"data-slot": "switch-thumb",
|
|
3409
|
+
className: l(
|
|
3410
|
+
"bg-surface border-2 border-border pointer-events-none block transition-[translate] duration-300",
|
|
3411
|
+
"group-data-checked/switch:ml-px group-data-unchecked/switch:-ml-px",
|
|
3412
|
+
"group-data-[rounded=full]/switch:group-data-checked/switch:ml-0 group-data-[rounded=full]/switch:group-data-unchecked/switch:ml-0",
|
|
3413
|
+
"group-data-unchecked/switch:translate-x-1",
|
|
3414
|
+
"group-data-[size=sm]/switch:size-3",
|
|
3415
|
+
"group-data-[size=md]/switch:size-4",
|
|
3416
|
+
"group-data-[size=lg]/switch:size-5",
|
|
3417
|
+
"group-data-[size=sm]/switch:group-data-checked/switch:translate-x-5",
|
|
3418
|
+
"group-data-[size=md]/switch:group-data-checked/switch:translate-x-6",
|
|
3419
|
+
"group-data-[size=lg]/switch:group-data-checked/switch:translate-x-7",
|
|
3420
|
+
"group-data-[rounded=none]/switch:rounded-none",
|
|
3421
|
+
"group-data-[rounded=sm]/switch:rounded-sm",
|
|
3422
|
+
"group-data-[rounded=md]/switch:rounded-md",
|
|
3423
|
+
"group-data-[rounded=lg]/switch:rounded-lg",
|
|
3424
|
+
"group-data-[rounded=full]/switch:rounded-full"
|
|
3425
|
+
)
|
|
3426
|
+
}
|
|
3427
|
+
)
|
|
3428
|
+
}
|
|
3429
|
+
);
|
|
3430
|
+
}
|
|
3431
|
+
const po = _("w-full caption-bottom text-sm", {
|
|
3432
|
+
variants: {
|
|
3433
|
+
variant: {
|
|
3434
|
+
default: "",
|
|
3435
|
+
filled: "",
|
|
3436
|
+
lines: ""
|
|
3437
|
+
}
|
|
3438
|
+
}
|
|
3439
|
+
});
|
|
3440
|
+
function go({
|
|
3441
|
+
className: e,
|
|
3442
|
+
variant: a = "default",
|
|
3443
|
+
...r
|
|
3444
|
+
}) {
|
|
3445
|
+
return /* @__PURE__ */ i(
|
|
3446
|
+
"div",
|
|
3447
|
+
{
|
|
3448
|
+
"data-slot": "table-container",
|
|
3449
|
+
className: "relative w-full overflow-x-auto",
|
|
3450
|
+
children: /* @__PURE__ */ i(
|
|
3451
|
+
"table",
|
|
3452
|
+
{
|
|
3453
|
+
"data-slot": "table",
|
|
3454
|
+
"data-variant": a,
|
|
3455
|
+
className: l(po({ variant: a }), "group/table", e),
|
|
3456
|
+
...r
|
|
3457
|
+
}
|
|
3458
|
+
)
|
|
3459
|
+
}
|
|
3460
|
+
);
|
|
3461
|
+
}
|
|
3462
|
+
function mo({ className: e, ...a }) {
|
|
3463
|
+
return /* @__PURE__ */ i(
|
|
3464
|
+
"thead",
|
|
3465
|
+
{
|
|
3466
|
+
"data-slot": "table-header",
|
|
3467
|
+
className: l("[&_tr]:border-b font-heading", e),
|
|
3468
|
+
...a
|
|
3469
|
+
}
|
|
3470
|
+
);
|
|
3471
|
+
}
|
|
3472
|
+
function ho({ className: e, ...a }) {
|
|
3473
|
+
return /* @__PURE__ */ i(
|
|
3474
|
+
"tbody",
|
|
3475
|
+
{
|
|
3476
|
+
"data-slot": "table-body",
|
|
3477
|
+
className: l("[&_tr:last-child]:border-0", e),
|
|
3478
|
+
...a
|
|
3479
|
+
}
|
|
3480
|
+
);
|
|
3481
|
+
}
|
|
3482
|
+
function fo({ className: e, ...a }) {
|
|
3483
|
+
return /* @__PURE__ */ i(
|
|
3484
|
+
"tfoot",
|
|
3485
|
+
{
|
|
3486
|
+
"data-slot": "table-footer",
|
|
3487
|
+
className: l(
|
|
3488
|
+
"*:bg-transparent border-t font-medium font-heading [&>tr]:last:border-b-0",
|
|
3489
|
+
"group-data-[variant=default]/table:bg-surface",
|
|
3490
|
+
"group-data-[variant=filled]/table:bg-main-secondary",
|
|
3491
|
+
"group-data-[variant=lines]/table:bg-surface",
|
|
3492
|
+
e
|
|
3493
|
+
),
|
|
3494
|
+
...a
|
|
3495
|
+
}
|
|
3496
|
+
);
|
|
3497
|
+
}
|
|
3498
|
+
function bo({ className: e, ...a }) {
|
|
3499
|
+
return /* @__PURE__ */ i(
|
|
3500
|
+
"tr",
|
|
3501
|
+
{
|
|
3502
|
+
"data-slot": "table-row",
|
|
3503
|
+
className: l(
|
|
3504
|
+
"border-b transition-colors duration-300 ease",
|
|
3505
|
+
"group-data-[variant=default]/table:bg-surface",
|
|
3506
|
+
"group-data-[variant=default]/table:hover:even:bg-main",
|
|
3507
|
+
"group-data-[variant=default]/table:hover:odd:bg-main-secondary",
|
|
3508
|
+
"group-data-[variant=default]/table:data-[state=selected]:bg-subtle",
|
|
3509
|
+
"group-data-[variant=filled]/table:bg-main",
|
|
3510
|
+
"group-data-[variant=filled]/table:hover:odd:bg-surface",
|
|
3511
|
+
"group-data-[variant=filled]/table:hover:even:bg-main-secondary",
|
|
3512
|
+
"group-data-[variant=filled]/table:data-[state=selected]:bg-foreground/25",
|
|
3513
|
+
"group-data-[variant=filled]/table:last:border-b-2",
|
|
3514
|
+
"group-data-[variant=lines]/table:bg-surface",
|
|
3515
|
+
"group-data-[variant=lines]/table:hover:even:bg-main",
|
|
3516
|
+
"group-data-[variant=lines]/table:hover:odd:bg-main-secondary",
|
|
3517
|
+
"group-data-[variant=lines]/table:data-[state=selected]:bg-main/50",
|
|
3518
|
+
e
|
|
3519
|
+
),
|
|
3520
|
+
...a
|
|
3521
|
+
}
|
|
3522
|
+
);
|
|
3523
|
+
}
|
|
3524
|
+
function xo({ className: e, ...a }) {
|
|
3525
|
+
return /* @__PURE__ */ i(
|
|
3526
|
+
"th",
|
|
3527
|
+
{
|
|
3528
|
+
"data-slot": "table-head",
|
|
3529
|
+
className: l(
|
|
3530
|
+
"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0",
|
|
3531
|
+
"group-data-[variant=filled]/table:border-r-2 group-data-[variant=filled]/table:border-t-2 group-data-[variant=filled]/table:first:border-l-2",
|
|
3532
|
+
"group-data-[variant=lines]/table:not-last:border-r-2",
|
|
3533
|
+
e
|
|
3534
|
+
),
|
|
3535
|
+
...a
|
|
3536
|
+
}
|
|
3537
|
+
);
|
|
3538
|
+
}
|
|
3539
|
+
function vo({ className: e, ...a }) {
|
|
3540
|
+
return /* @__PURE__ */ i(
|
|
3541
|
+
"td",
|
|
3542
|
+
{
|
|
3543
|
+
"data-slot": "table-cell",
|
|
3544
|
+
className: l(
|
|
3545
|
+
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
|
|
3546
|
+
"group-data-[variant=filled]/table:first:border-l-2 group-data-[variant=filled]/table:border-r-2",
|
|
3547
|
+
"group-data-[variant=lines]/table:not-last:border-r-2",
|
|
3548
|
+
e
|
|
3549
|
+
),
|
|
3550
|
+
...a
|
|
3551
|
+
}
|
|
3552
|
+
);
|
|
3553
|
+
}
|
|
3554
|
+
function yo({
|
|
3555
|
+
className: e,
|
|
3556
|
+
...a
|
|
3557
|
+
}) {
|
|
3558
|
+
return /* @__PURE__ */ i(
|
|
3559
|
+
"caption",
|
|
3560
|
+
{
|
|
3561
|
+
"data-slot": "table-caption",
|
|
3562
|
+
className: l(
|
|
3563
|
+
"text-muted hover:text-foreground mt-4 text-sm font-heading",
|
|
3564
|
+
e
|
|
3565
|
+
),
|
|
3566
|
+
...a
|
|
3567
|
+
}
|
|
3568
|
+
);
|
|
3569
|
+
}
|
|
3570
|
+
const wo = {
|
|
3571
|
+
[s.A]: We,
|
|
3572
|
+
[s.H]: Ge,
|
|
3573
|
+
[s.P]: $e,
|
|
3574
|
+
[s.OL]: "ol",
|
|
3575
|
+
[s.UL]: "ul",
|
|
3576
|
+
[s.LI]: "li",
|
|
3577
|
+
[s.DIV]: "div",
|
|
3578
|
+
[s.SPAN]: "span",
|
|
3579
|
+
[s.IMAGE]: "img",
|
|
3580
|
+
[s.ACCORDION]: rn,
|
|
3581
|
+
[s.ACCORDION_ITEM]: nn,
|
|
3582
|
+
[s.ACCORDION_TRIGGER]: on,
|
|
3583
|
+
[s.ACCORDION_CONTENT]: sn,
|
|
3584
|
+
[s.ALERT]: ln,
|
|
3585
|
+
[s.AVATAR]: un,
|
|
3586
|
+
[s.BADGE]: gn,
|
|
3587
|
+
[s.BUTTON]: de,
|
|
3588
|
+
[s.CARD]: kn,
|
|
3589
|
+
[s.CARD_HEADER]: Cn,
|
|
3590
|
+
[s.CARD_TITLE]: Tn,
|
|
3591
|
+
[s.CARD_DESCRIPTION]: _n,
|
|
3592
|
+
[s.CARD_CONTENT]: Rn,
|
|
3593
|
+
[s.CARD_FOOTER]: Sn,
|
|
3594
|
+
[s.CARD_ACTION]: Nn,
|
|
3595
|
+
[s.CARD_ICON]: Pn,
|
|
3596
|
+
[s.MAP]: Mn,
|
|
3597
|
+
[s.CALENDAR]: wn,
|
|
3598
|
+
[s.CHECKBOX]: En,
|
|
3599
|
+
[s.COLLAPSIBLE]: Ln,
|
|
3600
|
+
[s.COLLAPSIBLE_TRIGGER]: On,
|
|
3601
|
+
[s.COLLAPSIBLE_CONTENT]: Un,
|
|
3602
|
+
[s.OTP]: Fn,
|
|
3603
|
+
[s.INPUT]: Ve,
|
|
3604
|
+
[s.INPUT_GROUP]: Je,
|
|
3605
|
+
[s.INPUT_GROUP_TEXT]: Gn,
|
|
3606
|
+
[s.INPUT_GROUP_ADDON]: Xe,
|
|
3607
|
+
[s.INPUT_GROUP_INPUT]: Ye,
|
|
3608
|
+
[s.INPUT_GROUP_BUTTON]: Wn,
|
|
3609
|
+
[s.INPUT_GROUP_TEXTAREA]: $n,
|
|
3610
|
+
[s.LABEL]: Hn,
|
|
3611
|
+
[s.LOADER]: qe,
|
|
3612
|
+
[s.PROGRESS]: Xn,
|
|
3613
|
+
[s.SWITCH]: uo,
|
|
3614
|
+
[s.SEPARATOR]: io,
|
|
3615
|
+
[s.SKELETON]: lo,
|
|
3616
|
+
[s.TABLE]: go,
|
|
3617
|
+
[s.TABLE_HEADER]: mo,
|
|
3618
|
+
[s.TABLE_BODY]: ho,
|
|
3619
|
+
[s.TABLE_FOOTER]: fo,
|
|
3620
|
+
[s.TABLE_HEAD]: xo,
|
|
3621
|
+
[s.TABLE_ROW]: bo,
|
|
3622
|
+
[s.TABLE_CELL]: vo,
|
|
3623
|
+
[s.TABLE_CAPTION]: yo,
|
|
3624
|
+
[s.TEXTAREA]: Me,
|
|
3625
|
+
[s.SIGNATURE]: no
|
|
3626
|
+
}, Ao = {
|
|
3627
|
+
[s.INPUT]: {
|
|
3628
|
+
text: {
|
|
3629
|
+
valueProp: "value",
|
|
3630
|
+
changeProp: "onChange",
|
|
3631
|
+
extractor: (e) => e.target.value
|
|
3632
|
+
},
|
|
3633
|
+
email: {
|
|
3634
|
+
valueProp: "value",
|
|
3635
|
+
changeProp: "onChange",
|
|
3636
|
+
extractor: (e) => e.target.value
|
|
3637
|
+
},
|
|
3638
|
+
password: {
|
|
3639
|
+
valueProp: "value",
|
|
3640
|
+
changeProp: "onChange",
|
|
3641
|
+
extractor: (e) => e.target.value
|
|
3642
|
+
},
|
|
3643
|
+
number: {
|
|
3644
|
+
valueProp: "value",
|
|
3645
|
+
changeProp: "onChange",
|
|
3646
|
+
extractor: (e) => e.target.valueAsNumber ?? e.target.value
|
|
3647
|
+
},
|
|
3648
|
+
default: {
|
|
3649
|
+
valueProp: "value",
|
|
3650
|
+
changeProp: "onChange",
|
|
3651
|
+
extractor: (e) => e.target.value
|
|
3652
|
+
}
|
|
3653
|
+
},
|
|
3654
|
+
[s.OTP]: {
|
|
3655
|
+
valueProp: "value",
|
|
3656
|
+
changeProp: "onChange",
|
|
3657
|
+
extractor: (e) => e.target.value
|
|
3658
|
+
},
|
|
3659
|
+
[s.CHECKBOX]: {
|
|
3660
|
+
valueProp: "checked",
|
|
3661
|
+
changeProp: "onCheckedChange",
|
|
3662
|
+
extractor: (e) => e
|
|
3663
|
+
},
|
|
3664
|
+
[s.TEXTAREA]: {
|
|
3665
|
+
valueProp: "value",
|
|
3666
|
+
changeProp: "onChange",
|
|
3667
|
+
extractor: (e) => e.target.value
|
|
3668
|
+
},
|
|
3669
|
+
[s.INPUT_GROUP_INPUT]: {
|
|
3670
|
+
valueProp: "value",
|
|
3671
|
+
changeProp: "onChange",
|
|
3672
|
+
extractor: (e) => e.target.value
|
|
3673
|
+
},
|
|
3674
|
+
[s.INPUT_GROUP_TEXTAREA]: {
|
|
3675
|
+
valueProp: "value",
|
|
3676
|
+
changeProp: "onChange",
|
|
3677
|
+
extractor: (e) => e.target.value
|
|
3678
|
+
},
|
|
3679
|
+
[s.SWITCH]: {
|
|
3680
|
+
valueProp: "checked",
|
|
3681
|
+
changeProp: "onCheckedChange",
|
|
3682
|
+
extractor: (e) => e
|
|
3683
|
+
},
|
|
3684
|
+
[s.SIGNATURE]: {
|
|
3685
|
+
valueProp: "value",
|
|
3686
|
+
changeProp: "onChange",
|
|
3687
|
+
extractor: (e) => e
|
|
3688
|
+
},
|
|
3689
|
+
[s.CALENDAR]: {
|
|
3690
|
+
valueProp: "selected",
|
|
3691
|
+
changeProp: "onSelect",
|
|
3692
|
+
extractor: (e) => e
|
|
3693
|
+
},
|
|
3694
|
+
[s.MAP]: {
|
|
3695
|
+
valueProp: "value",
|
|
3696
|
+
changeProp: "onChange",
|
|
3697
|
+
extractor: (e) => e
|
|
3698
|
+
}
|
|
3699
|
+
};
|
|
3700
|
+
Fe.plugins.register(Ut);
|
|
3701
|
+
class zo {
|
|
3702
|
+
cache = /* @__PURE__ */ new Map();
|
|
3703
|
+
maxSize;
|
|
3704
|
+
constructor(a) {
|
|
3705
|
+
this.maxSize = a;
|
|
3706
|
+
}
|
|
3707
|
+
get(a) {
|
|
3708
|
+
const r = this.cache.get(a);
|
|
3709
|
+
return r !== void 0 && (this.cache.delete(a), this.cache.set(a, r)), r;
|
|
3710
|
+
}
|
|
3711
|
+
set(a, r) {
|
|
3712
|
+
if (this.cache.delete(a), this.cache.set(a, r), this.cache.size > this.maxSize) {
|
|
3713
|
+
const { value: n, done: o } = this.cache.keys().next();
|
|
3714
|
+
o || this.cache.delete(n);
|
|
3715
|
+
}
|
|
3716
|
+
}
|
|
3717
|
+
clear() {
|
|
3718
|
+
this.cache.clear();
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
const Io = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
3722
|
+
function Se(e, a) {
|
|
3723
|
+
if (e != null && !(typeof a == "string" && Io.has(a)) && Object.prototype.hasOwnProperty.call(e, a))
|
|
3724
|
+
return e[a];
|
|
3725
|
+
}
|
|
3726
|
+
function Ke(e) {
|
|
3727
|
+
if (e.type === "Identifier") return e.name;
|
|
3728
|
+
if (e.type === "MemberExpression") {
|
|
3729
|
+
const a = Ke(e.object);
|
|
3730
|
+
if (a == null) return null;
|
|
3731
|
+
const r = e.property;
|
|
3732
|
+
return e.computed ? r.type !== "Literal" ? null : `${a}[${JSON.stringify(r.value)}]` : r.type !== "Identifier" ? null : `${a}.${r.name}`;
|
|
3733
|
+
}
|
|
3734
|
+
return null;
|
|
3735
|
+
}
|
|
3736
|
+
function ko(e) {
|
|
3737
|
+
const a = e.match(/^[^.[]+/);
|
|
3738
|
+
return a ? a[0] : e;
|
|
3739
|
+
}
|
|
3740
|
+
function Co(e) {
|
|
3741
|
+
const a = /* @__PURE__ */ new Set();
|
|
3742
|
+
function r(n, o) {
|
|
3743
|
+
if (n)
|
|
3744
|
+
switch (n.type) {
|
|
3745
|
+
case "Identifier": {
|
|
3746
|
+
const d = n.name;
|
|
3747
|
+
o.has(d) || a.add(d);
|
|
3748
|
+
return;
|
|
3749
|
+
}
|
|
3750
|
+
case "MemberExpression": {
|
|
3751
|
+
const d = Ke(n);
|
|
3752
|
+
if (d != null) {
|
|
3753
|
+
o.has(ko(d)) || a.add(d);
|
|
3754
|
+
return;
|
|
3755
|
+
}
|
|
3756
|
+
r(n.object, o), r(n.property, o);
|
|
3757
|
+
return;
|
|
3758
|
+
}
|
|
3759
|
+
case "UnaryExpression":
|
|
3760
|
+
r(n.argument, o);
|
|
3761
|
+
return;
|
|
3762
|
+
case "BinaryExpression":
|
|
3763
|
+
r(n.left, o), r(n.right, o);
|
|
3764
|
+
return;
|
|
3765
|
+
case "ConditionalExpression":
|
|
3766
|
+
r(n.test, o), r(n.consequent, o), r(n.alternate, o);
|
|
3767
|
+
return;
|
|
3768
|
+
case "ArrayExpression":
|
|
3769
|
+
n.elements.forEach((d) => r(d, o));
|
|
3770
|
+
return;
|
|
3771
|
+
case "CallExpression": {
|
|
3772
|
+
const d = n.callee;
|
|
3773
|
+
d.type === "MemberExpression" && r(d.object, o), n.arguments.forEach((c) => {
|
|
3774
|
+
if (c.type === "ArrowFunctionExpression") {
|
|
3775
|
+
const p = new Set(o);
|
|
3776
|
+
c.params?.forEach((u) => {
|
|
3777
|
+
u.type === "Identifier" && p.add(u.name);
|
|
3778
|
+
}), r(c.body, p);
|
|
3779
|
+
} else
|
|
3780
|
+
r(c, o);
|
|
3781
|
+
});
|
|
3782
|
+
return;
|
|
3783
|
+
}
|
|
3784
|
+
case "Compound":
|
|
3785
|
+
n.body.forEach((d) => r(d, o));
|
|
3786
|
+
return;
|
|
3787
|
+
default:
|
|
3788
|
+
return;
|
|
3789
|
+
}
|
|
3790
|
+
}
|
|
3791
|
+
return r(e, /* @__PURE__ */ new Set()), Array.from(a);
|
|
3792
|
+
}
|
|
3793
|
+
const K = (e, a = 2) => String(e).padStart(a, "0");
|
|
3794
|
+
function To(e) {
|
|
3795
|
+
const a = e instanceof Date ? e : new Date(e);
|
|
3796
|
+
return Number.isNaN(a.getTime()) ? null : a;
|
|
3797
|
+
}
|
|
3798
|
+
function se(e) {
|
|
3799
|
+
const a = typeof e == "number" ? e : parseFloat(e);
|
|
3800
|
+
return Number.isNaN(a) ? 0 : a;
|
|
3801
|
+
}
|
|
3802
|
+
function De(e) {
|
|
3803
|
+
return e.flat(1 / 0).map(se);
|
|
3804
|
+
}
|
|
3805
|
+
const _o = {
|
|
3806
|
+
// Uses UTC getters so SSR and client render the same calendar date regardless of local timezone.
|
|
3807
|
+
formatDate(e, a = "YYYY-MM-DD") {
|
|
3808
|
+
const r = To(e);
|
|
3809
|
+
if (!r) return "";
|
|
3810
|
+
if (a === "short" || a === "medium" || a === "long" || a === "full")
|
|
3811
|
+
return new Intl.DateTimeFormat("en-US", { dateStyle: a, timeZone: "UTC" }).format(r);
|
|
3812
|
+
const n = {
|
|
3813
|
+
YYYY: String(r.getUTCFullYear()),
|
|
3814
|
+
MM: K(r.getUTCMonth() + 1),
|
|
3815
|
+
DD: K(r.getUTCDate()),
|
|
3816
|
+
HH: K(r.getUTCHours()),
|
|
3817
|
+
mm: K(r.getUTCMinutes()),
|
|
3818
|
+
ss: K(r.getUTCSeconds())
|
|
3819
|
+
};
|
|
3820
|
+
return a.replace(/YYYY|MM|DD|HH|mm|ss/g, (o) => n[o]);
|
|
3821
|
+
},
|
|
3822
|
+
formatCurrency(e, a = "USD", r = "en-US") {
|
|
3823
|
+
const n = se(e);
|
|
3824
|
+
return new Intl.NumberFormat(r, { style: "currency", currency: a }).format(n);
|
|
3825
|
+
},
|
|
3826
|
+
upper(e) {
|
|
3827
|
+
return String(e ?? "").toUpperCase();
|
|
3828
|
+
},
|
|
3829
|
+
lower(e) {
|
|
3830
|
+
return String(e ?? "").toLowerCase();
|
|
3831
|
+
},
|
|
3832
|
+
trim(e) {
|
|
3833
|
+
return String(e ?? "").trim();
|
|
3834
|
+
},
|
|
3835
|
+
concat(...e) {
|
|
3836
|
+
return e.map((a) => a ?? "").join("");
|
|
3837
|
+
},
|
|
3838
|
+
join(e, a = ", ") {
|
|
3839
|
+
return Array.isArray(e) ? e.join(a) : "";
|
|
3840
|
+
},
|
|
3841
|
+
default(e, a) {
|
|
3842
|
+
return e == null || e === "" ? a : e;
|
|
3843
|
+
},
|
|
3844
|
+
length(e) {
|
|
3845
|
+
return typeof e == "string" || Array.isArray(e) ? e.length : 0;
|
|
3846
|
+
},
|
|
3847
|
+
count(e) {
|
|
3848
|
+
return Array.isArray(e) ? e.length : 0;
|
|
3849
|
+
},
|
|
3850
|
+
sum(e) {
|
|
3851
|
+
return Array.isArray(e) ? e.reduce((a, r) => a + se(r), 0) : 0;
|
|
3852
|
+
},
|
|
3853
|
+
min(...e) {
|
|
3854
|
+
const a = De(e);
|
|
3855
|
+
return a.length ? Math.min(...a) : void 0;
|
|
3856
|
+
},
|
|
3857
|
+
max(...e) {
|
|
3858
|
+
const a = De(e);
|
|
3859
|
+
return a.length ? Math.max(...a) : void 0;
|
|
3860
|
+
},
|
|
3861
|
+
round(e, a = 0) {
|
|
3862
|
+
const r = 10 ** a;
|
|
3863
|
+
return Math.round(se(e) * r) / r;
|
|
3864
|
+
}
|
|
3865
|
+
}, No = /* @__PURE__ */ new Set(["map", "filter", "some", "every", "find"]);
|
|
3866
|
+
function Po(e, a, r) {
|
|
3867
|
+
const n = { ...r };
|
|
3868
|
+
return (e.params ?? []).forEach((o, d) => {
|
|
3869
|
+
o.type === "Identifier" && (n[o.name] = a[d]);
|
|
3870
|
+
}), D(e.body, n);
|
|
3871
|
+
}
|
|
3872
|
+
function D(e, a) {
|
|
3873
|
+
switch (e.type) {
|
|
3874
|
+
case "Literal":
|
|
3875
|
+
return e.value;
|
|
3876
|
+
case "Identifier":
|
|
3877
|
+
return Se(a, e.name);
|
|
3878
|
+
case "MemberExpression": {
|
|
3879
|
+
const r = D(e.object, a), n = e.property, o = e.computed ? D(n, a) : n.name;
|
|
3880
|
+
return Se(r, o);
|
|
3881
|
+
}
|
|
3882
|
+
case "UnaryExpression": {
|
|
3883
|
+
const r = D(e.argument, a);
|
|
3884
|
+
switch (e.operator) {
|
|
3885
|
+
case "!":
|
|
3886
|
+
return !r;
|
|
3887
|
+
case "-":
|
|
3888
|
+
return -r;
|
|
3889
|
+
case "+":
|
|
3890
|
+
return +r;
|
|
3891
|
+
case "~":
|
|
3892
|
+
return ~r;
|
|
3893
|
+
default:
|
|
3894
|
+
throw new Error(`Unknown unary operator: ${e.operator}`);
|
|
3895
|
+
}
|
|
3896
|
+
}
|
|
3897
|
+
case "BinaryExpression": {
|
|
3898
|
+
const r = e.operator;
|
|
3899
|
+
if (r === "&&" || r === "||" || r === "??") {
|
|
3900
|
+
const d = D(e.left, a);
|
|
3901
|
+
return (r === "&&" ? !d : r === "||" ? !!d : d != null) ? d : D(e.right, a);
|
|
3902
|
+
}
|
|
3903
|
+
const n = D(e.left, a), o = D(e.right, a);
|
|
3904
|
+
switch (r) {
|
|
3905
|
+
case "===":
|
|
3906
|
+
return n === o;
|
|
3907
|
+
case "!==":
|
|
3908
|
+
return n !== o;
|
|
3909
|
+
case "==":
|
|
3910
|
+
return n == o;
|
|
3911
|
+
case "!=":
|
|
3912
|
+
return n != o;
|
|
3913
|
+
case "<":
|
|
3914
|
+
return n < o;
|
|
3915
|
+
case ">":
|
|
3916
|
+
return n > o;
|
|
3917
|
+
case "<=":
|
|
3918
|
+
return n <= o;
|
|
3919
|
+
case ">=":
|
|
3920
|
+
return n >= o;
|
|
3921
|
+
case "+":
|
|
3922
|
+
return n + o;
|
|
3923
|
+
case "-":
|
|
3924
|
+
return n - o;
|
|
3925
|
+
case "*":
|
|
3926
|
+
return n * o;
|
|
3927
|
+
case "/":
|
|
3928
|
+
return n / o;
|
|
3929
|
+
case "%":
|
|
3930
|
+
return n % o;
|
|
3931
|
+
case "**":
|
|
3932
|
+
return n ** o;
|
|
3933
|
+
case "&":
|
|
3934
|
+
return n & o;
|
|
3935
|
+
case "|":
|
|
3936
|
+
return n | o;
|
|
3937
|
+
case "^":
|
|
3938
|
+
return n ^ o;
|
|
3939
|
+
case "<<":
|
|
3940
|
+
return n << o;
|
|
3941
|
+
case ">>":
|
|
3942
|
+
return n >> o;
|
|
3943
|
+
case ">>>":
|
|
3944
|
+
return n >>> o;
|
|
3945
|
+
default:
|
|
3946
|
+
throw new Error(`Unknown binary operator: ${r}`);
|
|
3947
|
+
}
|
|
3948
|
+
}
|
|
3949
|
+
case "ConditionalExpression": {
|
|
3950
|
+
const r = D(e.test, a);
|
|
3951
|
+
return D(r ? e.consequent : e.alternate, a);
|
|
3952
|
+
}
|
|
3953
|
+
case "ArrayExpression":
|
|
3954
|
+
return e.elements.map(
|
|
3955
|
+
(r) => r ? D(r, a) : void 0
|
|
3956
|
+
);
|
|
3957
|
+
case "CallExpression": {
|
|
3958
|
+
const r = e.callee, n = e.arguments;
|
|
3959
|
+
if (r.type === "MemberExpression") {
|
|
3960
|
+
if (r.computed || r.property.type !== "Identifier")
|
|
3961
|
+
throw new Error(
|
|
3962
|
+
"Method calls must use a fixed dot-notation method name"
|
|
3963
|
+
);
|
|
3964
|
+
const d = r.property.name;
|
|
3965
|
+
if (!No.has(d))
|
|
3966
|
+
throw new Error(`Unknown array method: ${d}`);
|
|
3967
|
+
const c = D(r.object, a);
|
|
3968
|
+
if (!Array.isArray(c))
|
|
3969
|
+
throw new Error(`.${d}() can only be called on an array`);
|
|
3970
|
+
const [p] = n;
|
|
3971
|
+
if (n.length !== 1 || p.type !== "ArrowFunctionExpression")
|
|
3972
|
+
throw new Error(
|
|
3973
|
+
`.${d}() requires a single arrow-function argument`
|
|
3974
|
+
);
|
|
3975
|
+
return c[d](
|
|
3976
|
+
(u, h) => Po(p, [u, h], a)
|
|
3977
|
+
);
|
|
3978
|
+
}
|
|
3979
|
+
if (r.type !== "Identifier")
|
|
3980
|
+
throw new Error(
|
|
3981
|
+
"Function calls are only allowed via a bare helper name"
|
|
3982
|
+
);
|
|
3983
|
+
const o = _o[r.name];
|
|
3984
|
+
if (typeof o != "function")
|
|
3985
|
+
throw new Error(`Unknown helper: ${r.name}`);
|
|
3986
|
+
return o(...n.map((d) => D(d, a)));
|
|
3987
|
+
}
|
|
3988
|
+
default:
|
|
3989
|
+
throw new Error(`Unsupported expression type: ${e.type}`);
|
|
3990
|
+
}
|
|
3991
|
+
}
|
|
3992
|
+
const Ee = new zo(250);
|
|
3993
|
+
function Ze(e) {
|
|
3994
|
+
let a = Ee.get(e);
|
|
3995
|
+
return a || (a = Fe(e), Ee.set(e, a), a);
|
|
3996
|
+
}
|
|
3997
|
+
function Ro(e) {
|
|
3998
|
+
if (!e || typeof e != "string")
|
|
3999
|
+
return [];
|
|
4000
|
+
if (!e.startsWith("{{") || !e.endsWith("}}"))
|
|
4001
|
+
return [];
|
|
4002
|
+
const a = e.slice(2, -2).trim();
|
|
4003
|
+
if (!a)
|
|
4004
|
+
return [];
|
|
4005
|
+
try {
|
|
4006
|
+
return Co(Ze(a));
|
|
4007
|
+
} catch (r) {
|
|
4008
|
+
return console.error(`Error extracting variables from "${e}":`, r), [];
|
|
4009
|
+
}
|
|
4010
|
+
}
|
|
4011
|
+
function So(e, a) {
|
|
4012
|
+
if (!e || typeof e != "string" || !e.startsWith("{{") || !e.endsWith("}}"))
|
|
4013
|
+
return e;
|
|
4014
|
+
const r = e.slice(2, -2).trim();
|
|
4015
|
+
if (r)
|
|
4016
|
+
try {
|
|
4017
|
+
return D(Ze(r), a);
|
|
4018
|
+
} catch (n) {
|
|
4019
|
+
console.error(`Error parsing expression "${e}":`, n);
|
|
4020
|
+
return;
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4023
|
+
const Qe = rt(null);
|
|
4024
|
+
function be() {
|
|
4025
|
+
const e = nt(Qe);
|
|
4026
|
+
if (!e)
|
|
4027
|
+
throw new Error("useBonsaiStore must be used within a <Bonsai> component");
|
|
4028
|
+
return e;
|
|
4029
|
+
}
|
|
4030
|
+
function Do() {
|
|
4031
|
+
const e = be();
|
|
4032
|
+
return pe(
|
|
4033
|
+
(a, r) => Lo(e.data, a, r),
|
|
4034
|
+
[e]
|
|
4035
|
+
);
|
|
4036
|
+
}
|
|
4037
|
+
const xe = /* @__PURE__ */ new Set([
|
|
4038
|
+
"area",
|
|
4039
|
+
"base",
|
|
4040
|
+
"br",
|
|
4041
|
+
"col",
|
|
4042
|
+
"embed",
|
|
4043
|
+
"hr",
|
|
4044
|
+
"img",
|
|
4045
|
+
"input",
|
|
4046
|
+
"link",
|
|
4047
|
+
"meta",
|
|
4048
|
+
"param",
|
|
4049
|
+
"source",
|
|
4050
|
+
"track",
|
|
4051
|
+
"wbr"
|
|
4052
|
+
]), F = (e, a, r) => `${e.type || "div"}-${r}-${a}`, Eo = /[^.[\]]+|\[(?:[^\[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/g;
|
|
4053
|
+
function ve(e) {
|
|
4054
|
+
return e.match(Eo) || [];
|
|
4055
|
+
}
|
|
4056
|
+
function q(e) {
|
|
4057
|
+
return e.startsWith("[") && e.endsWith("]") ? e.slice(1, -1).replace(/^["']|["']$/g, "") : e;
|
|
4058
|
+
}
|
|
4059
|
+
function ee(e, a, r = void 0) {
|
|
4060
|
+
return a ? ve(a).reduce((o, d) => {
|
|
4061
|
+
if (o != null)
|
|
4062
|
+
return o[q(d)];
|
|
4063
|
+
}, e) ?? r : e;
|
|
4064
|
+
}
|
|
4065
|
+
function Lo(e, a, r) {
|
|
4066
|
+
if (!a) {
|
|
4067
|
+
Object.assign(e, r);
|
|
4068
|
+
return;
|
|
4069
|
+
}
|
|
4070
|
+
const n = ve(a);
|
|
4071
|
+
let o = e;
|
|
4072
|
+
for (let d = 0; d < n.length - 1; d++) {
|
|
4073
|
+
const c = q(n[d]), p = q(n[d + 1]);
|
|
4074
|
+
o[c] ??= /^\d+$/.test(p) ? [] : {}, o = o[c];
|
|
4075
|
+
}
|
|
4076
|
+
o[q(n[n.length - 1])] = r;
|
|
4077
|
+
}
|
|
4078
|
+
function te(e, a) {
|
|
4079
|
+
if (!a) return e;
|
|
4080
|
+
const r = e.match(/^[^.[]+/), n = r ? r[0] : e, o = a[n];
|
|
4081
|
+
return o == null ? e : o + e.slice(n.length);
|
|
4082
|
+
}
|
|
4083
|
+
function Oo(e, a, r, n) {
|
|
4084
|
+
const o = e.match(/^[^.[]+/), d = o ? o[0] : e;
|
|
4085
|
+
return n && d in n ? e === d ? n[d] : void 0 : r && d in r ? ee(a.data ?? a, te(e, r)) : e in a && e !== "data" ? a[e] : ee(a.data ?? a, e);
|
|
4086
|
+
}
|
|
4087
|
+
function ye(e) {
|
|
4088
|
+
const a = /* @__PURE__ */ new Set();
|
|
4089
|
+
function r(n) {
|
|
4090
|
+
typeof n == "string" && n.startsWith("{{") && n.endsWith("}}") && Ro(n).forEach((d) => a.add(d));
|
|
4091
|
+
}
|
|
4092
|
+
return typeof e == "string" ? r(e) : Object.values(e?.args ?? {}).forEach(r), Array.from(a);
|
|
4093
|
+
}
|
|
4094
|
+
const O = (e, a) => So(e, a);
|
|
4095
|
+
function et(e, a) {
|
|
4096
|
+
return e.reduce((r, n) => {
|
|
4097
|
+
const o = a(n), d = ve(n);
|
|
4098
|
+
if (d.length === 1)
|
|
4099
|
+
return r[n] = o, r;
|
|
4100
|
+
let c = r;
|
|
4101
|
+
for (let p = 0; p < d.length - 1; p++) {
|
|
4102
|
+
const u = q(d[p]), h = q(d[p + 1]);
|
|
4103
|
+
(!(u in c) || typeof c[u] != "object" || c[u] === null) && (c[u] = /^\d+$/.test(h) ? [] : {}), c = c[u];
|
|
4104
|
+
}
|
|
4105
|
+
return c[q(d[d.length - 1])] = o, r;
|
|
4106
|
+
}, {});
|
|
4107
|
+
}
|
|
4108
|
+
const we = (e) => e && Ft.has(e) ? wo[e] ?? "div" : "div", le = (e, a, r, n = {}) => {
|
|
4109
|
+
const o = { key: r, ...e?.args, ...n };
|
|
4110
|
+
return Object.keys(o).forEach((d) => {
|
|
4111
|
+
o[d] = O(o[d], a);
|
|
4112
|
+
}), o;
|
|
4113
|
+
};
|
|
4114
|
+
function Uo(e, a, r, n, o) {
|
|
4115
|
+
return n[e.changeProp] ? {} : {
|
|
4116
|
+
[e.changeProp]: (d) => o(a, e.extractor(d)),
|
|
4117
|
+
[e.valueProp]: r
|
|
4118
|
+
};
|
|
4119
|
+
}
|
|
4120
|
+
function tt({
|
|
4121
|
+
tree: e,
|
|
4122
|
+
dataSlice: a,
|
|
4123
|
+
elementKey: r,
|
|
4124
|
+
ElementType: n,
|
|
4125
|
+
ctrlInput: o,
|
|
4126
|
+
keyPath: d,
|
|
4127
|
+
storeValue: c,
|
|
4128
|
+
updateData: p,
|
|
4129
|
+
children: u
|
|
4130
|
+
}) {
|
|
4131
|
+
const h = Uo(
|
|
4132
|
+
o,
|
|
4133
|
+
d,
|
|
4134
|
+
c,
|
|
4135
|
+
e.args ?? {},
|
|
4136
|
+
p
|
|
4137
|
+
), f = le(e, a, r, h);
|
|
4138
|
+
return u !== void 0 ? G(n, f, u) : G(n, f);
|
|
4139
|
+
}
|
|
4140
|
+
function at(e, a) {
|
|
4141
|
+
const r = Ao[e];
|
|
4142
|
+
if (r) {
|
|
4143
|
+
if (typeof r == "object" && "default" in r) {
|
|
4144
|
+
const n = a?.args?.type || "default", o = r;
|
|
4145
|
+
return o[n] || o.default;
|
|
4146
|
+
}
|
|
4147
|
+
return r;
|
|
4148
|
+
}
|
|
4149
|
+
}
|
|
4150
|
+
function Fo(e) {
|
|
4151
|
+
if (typeof e != "string") {
|
|
4152
|
+
const a = e?.type;
|
|
4153
|
+
if (a === s.EACH || a === s.IF) return !1;
|
|
4154
|
+
}
|
|
4155
|
+
return ye(e).length === 0;
|
|
4156
|
+
}
|
|
4157
|
+
const Bo = ge(
|
|
4158
|
+
({ tree: e, index: a = 0, path: r = "root", scope: n, indexScope: o }) => {
|
|
4159
|
+
if (!e) return null;
|
|
4160
|
+
if (typeof e == "string")
|
|
4161
|
+
return e;
|
|
4162
|
+
try {
|
|
4163
|
+
const d = e.type || "div", c = we(d), p = F(e, a, r), u = le(e, {}, p);
|
|
4164
|
+
if (d === s.IMAGE && (u.src === "" || u.src == null))
|
|
4165
|
+
return null;
|
|
4166
|
+
const h = e.children && e.children.length > 0 ? e.children.map(
|
|
4167
|
+
(b, y) => V(
|
|
4168
|
+
b,
|
|
4169
|
+
y,
|
|
4170
|
+
`${r}-${a}`,
|
|
4171
|
+
n,
|
|
4172
|
+
o,
|
|
4173
|
+
F(e, y, `${r}-${a}`)
|
|
4174
|
+
)
|
|
4175
|
+
) : void 0, f = typeof c == "string" && xe.has(c) ? void 0 : h;
|
|
4176
|
+
return f !== void 0 ? G(c, u, f) : G(c, u);
|
|
4177
|
+
} catch (d) {
|
|
4178
|
+
return console.error(`Error at ${r}-${a}:`, d), null;
|
|
4179
|
+
}
|
|
4180
|
+
}
|
|
4181
|
+
);
|
|
4182
|
+
function V(e, a, r, n, o, d) {
|
|
4183
|
+
return Fo(e) ? /* @__PURE__ */ i(
|
|
4184
|
+
Bo,
|
|
4185
|
+
{
|
|
4186
|
+
tree: e,
|
|
4187
|
+
index: a,
|
|
4188
|
+
path: r,
|
|
4189
|
+
scope: n,
|
|
4190
|
+
indexScope: o
|
|
4191
|
+
},
|
|
4192
|
+
d
|
|
4193
|
+
) : /* @__PURE__ */ i(
|
|
4194
|
+
jo,
|
|
4195
|
+
{
|
|
4196
|
+
tree: e,
|
|
4197
|
+
index: a,
|
|
4198
|
+
path: r,
|
|
4199
|
+
scope: n,
|
|
4200
|
+
indexScope: o
|
|
4201
|
+
},
|
|
4202
|
+
d
|
|
4203
|
+
);
|
|
4204
|
+
}
|
|
4205
|
+
const Z = ge(
|
|
4206
|
+
({ tree: e, index: a = 0, path: r = "root", data: n, scope: o }) => {
|
|
4207
|
+
const d = Le(() => ye(e ?? ""), [e]), c = pe(() => {
|
|
4208
|
+
}, []);
|
|
4209
|
+
if (!e) return null;
|
|
4210
|
+
const p = et(d, (u) => u in n && u !== "data" ? n[u] : ee(n.data ?? n, u));
|
|
4211
|
+
if (typeof e == "string")
|
|
4212
|
+
return O(e, p);
|
|
4213
|
+
try {
|
|
4214
|
+
const u = e.type || "div";
|
|
4215
|
+
if (u === s.IF)
|
|
4216
|
+
return O(e.args.condition, p) ? /* @__PURE__ */ i(B, { children: (e.children ?? []).map((R, z) => /* @__PURE__ */ i(
|
|
4217
|
+
Z,
|
|
4218
|
+
{
|
|
4219
|
+
tree: R,
|
|
4220
|
+
index: z,
|
|
4221
|
+
path: `${r}-${a}-if`,
|
|
4222
|
+
data: n,
|
|
4223
|
+
scope: o
|
|
4224
|
+
},
|
|
4225
|
+
F(R, z, `${r}-${a}-if`)
|
|
4226
|
+
)) }) : null;
|
|
4227
|
+
if (u === s.EACH) {
|
|
4228
|
+
const { as: T, index: R, key: z } = e.args, x = O(e.args.items, p), v = Array.isArray(x) ? x : [], A = typeof e.args.items == "string" && e.args.items.startsWith("{{") && e.args.items.endsWith("}}") ? e.args.items.slice(2, -2).trim() : "", S = A ? te(A, o) : "";
|
|
4229
|
+
return /* @__PURE__ */ i(B, { children: v.map((N, j) => {
|
|
4230
|
+
const ce = {
|
|
4231
|
+
...n,
|
|
4232
|
+
data: {
|
|
4233
|
+
...n.data ?? n,
|
|
4234
|
+
[T]: N,
|
|
4235
|
+
...R ? { [R]: j } : {}
|
|
4236
|
+
}
|
|
4237
|
+
}, J = S ? { ...o, [T]: `${S}.${j}` } : o, re = z ? O(z, { ...p, [T]: N }) : j, ne = `${r}-${a}-each-${re}`;
|
|
4238
|
+
return /* @__PURE__ */ i(Oe, { children: (e.children ?? []).map((X, Y) => /* @__PURE__ */ i(
|
|
4239
|
+
Z,
|
|
4240
|
+
{
|
|
4241
|
+
tree: X,
|
|
4242
|
+
index: Y,
|
|
4243
|
+
path: ne,
|
|
4244
|
+
data: ce,
|
|
4245
|
+
scope: J
|
|
4246
|
+
},
|
|
4247
|
+
F(X, Y, ne)
|
|
4248
|
+
)) }, String(re));
|
|
4249
|
+
}) });
|
|
4250
|
+
}
|
|
4251
|
+
const h = we(u), f = F(e, a, r), b = at(u, e);
|
|
4252
|
+
let y;
|
|
4253
|
+
if (b) {
|
|
4254
|
+
const T = e.args[b.valueProp];
|
|
4255
|
+
if (typeof T == "string" && T.startsWith("{{") && T.endsWith("}}")) {
|
|
4256
|
+
const R = T.slice(2, -2).trim(), z = te(R, o);
|
|
4257
|
+
y = {
|
|
4258
|
+
keyPath: z,
|
|
4259
|
+
storeValue: ee(n.data ?? n, z)
|
|
4260
|
+
};
|
|
4261
|
+
}
|
|
4262
|
+
}
|
|
4263
|
+
if (u === s.IMAGE) {
|
|
4264
|
+
const T = O(e.args?.src, p);
|
|
4265
|
+
if (T === "" || T == null) return null;
|
|
4266
|
+
}
|
|
4267
|
+
const w = e.children && e.children.length > 0 ? e.children.map((T, R) => /* @__PURE__ */ i(
|
|
4268
|
+
Z,
|
|
4269
|
+
{
|
|
4270
|
+
tree: T,
|
|
4271
|
+
index: R,
|
|
4272
|
+
path: `${r}-${a}`,
|
|
4273
|
+
data: n,
|
|
4274
|
+
scope: o
|
|
4275
|
+
},
|
|
4276
|
+
F(e, R, `${r}-${a}`)
|
|
4277
|
+
)) : void 0, P = typeof h == "string" && xe.has(h) ? void 0 : w;
|
|
4278
|
+
if (y && b)
|
|
4279
|
+
return /* @__PURE__ */ i(
|
|
4280
|
+
tt,
|
|
4281
|
+
{
|
|
4282
|
+
tree: e,
|
|
4283
|
+
dataSlice: p,
|
|
4284
|
+
elementKey: f,
|
|
4285
|
+
ElementType: h,
|
|
4286
|
+
ctrlInput: b,
|
|
4287
|
+
keyPath: y.keyPath,
|
|
4288
|
+
storeValue: y.storeValue,
|
|
4289
|
+
updateData: c,
|
|
4290
|
+
children: P
|
|
4291
|
+
}
|
|
4292
|
+
);
|
|
4293
|
+
const U = le(e, p, f);
|
|
4294
|
+
return P !== void 0 ? G(h, U, P) : G(h, U);
|
|
4295
|
+
} catch (u) {
|
|
4296
|
+
return console.error(`Error at ${r}-${a}:`, u), null;
|
|
4297
|
+
}
|
|
4298
|
+
}
|
|
4299
|
+
), jo = ge(
|
|
4300
|
+
({ tree: e, index: a = 0, path: r = "root", scope: n, indexScope: o }) => {
|
|
4301
|
+
const d = be(), c = ot(d, { sync: !0 }), p = Do(), u = Le(() => ye(e ?? ""), [e]);
|
|
4302
|
+
if (!e) return null;
|
|
4303
|
+
const h = et(
|
|
4304
|
+
u,
|
|
4305
|
+
(f) => Oo(f, c, n, o)
|
|
4306
|
+
);
|
|
4307
|
+
if (typeof e == "string")
|
|
4308
|
+
return O(e, h);
|
|
4309
|
+
try {
|
|
4310
|
+
const f = e.type || "div";
|
|
4311
|
+
if (f === s.IF)
|
|
4312
|
+
return O(e.args.condition, h) ? /* @__PURE__ */ i(B, { children: (e.children ?? []).map(
|
|
4313
|
+
(x, v) => V(
|
|
4314
|
+
x,
|
|
4315
|
+
v,
|
|
4316
|
+
`${r}-${a}-if`,
|
|
4317
|
+
n,
|
|
4318
|
+
o,
|
|
4319
|
+
F(x, v, `${r}-${a}-if`)
|
|
4320
|
+
)
|
|
4321
|
+
) }) : null;
|
|
4322
|
+
if (f === s.EACH) {
|
|
4323
|
+
const { as: z, index: x, key: v } = e.args, A = O(e.args.items, h), S = Array.isArray(A) ? A : [], N = typeof e.args.items == "string" && e.args.items.startsWith("{{") && e.args.items.endsWith("}}") ? e.args.items.slice(2, -2).trim() : "", j = N ? te(N, n) : "";
|
|
4324
|
+
return /* @__PURE__ */ i(B, { children: S.map((ce, J) => {
|
|
4325
|
+
const re = j ? { ...n, [z]: `${j}.${J}` } : n, ne = x ? { ...o, [x]: J } : o, X = v ? O(v, { ...h, [z]: ce }) : J, Y = `${r}-${a}-each-${X}`;
|
|
4326
|
+
return /* @__PURE__ */ i(Oe, { children: (e.children ?? []).map(
|
|
4327
|
+
(Ae, ze) => V(
|
|
4328
|
+
Ae,
|
|
4329
|
+
ze,
|
|
4330
|
+
Y,
|
|
4331
|
+
re,
|
|
4332
|
+
ne,
|
|
4333
|
+
F(Ae, ze, Y)
|
|
4334
|
+
)
|
|
4335
|
+
) }, String(X));
|
|
4336
|
+
}) });
|
|
4337
|
+
}
|
|
4338
|
+
const b = we(f), y = F(e, a, r), w = at(f, e);
|
|
4339
|
+
let P;
|
|
4340
|
+
if (w) {
|
|
4341
|
+
const z = e.args[w.valueProp];
|
|
4342
|
+
if (typeof z == "string" && z.startsWith("{{") && z.endsWith("}}")) {
|
|
4343
|
+
const x = z.slice(2, -2).trim(), v = te(x, n);
|
|
4344
|
+
P = {
|
|
4345
|
+
keyPath: v,
|
|
4346
|
+
storeValue: ee(c.data ?? c, v)
|
|
4347
|
+
};
|
|
4348
|
+
}
|
|
4349
|
+
}
|
|
4350
|
+
if (f === s.IMAGE) {
|
|
4351
|
+
const z = O(e.args?.src, h);
|
|
4352
|
+
if (z === "" || z == null) return null;
|
|
4353
|
+
}
|
|
4354
|
+
const U = e.children && e.children.length > 0 ? e.children.map(
|
|
4355
|
+
(z, x) => V(
|
|
4356
|
+
z,
|
|
4357
|
+
x,
|
|
4358
|
+
`${r}-${a}`,
|
|
4359
|
+
n,
|
|
4360
|
+
o,
|
|
4361
|
+
F(e, x, `${r}-${a}`)
|
|
4362
|
+
)
|
|
4363
|
+
) : void 0, T = typeof b == "string" && xe.has(b) ? void 0 : U;
|
|
4364
|
+
if (P && w)
|
|
4365
|
+
return /* @__PURE__ */ i(
|
|
4366
|
+
tt,
|
|
4367
|
+
{
|
|
4368
|
+
tree: e,
|
|
4369
|
+
dataSlice: h,
|
|
4370
|
+
elementKey: y,
|
|
4371
|
+
ElementType: b,
|
|
4372
|
+
ctrlInput: w,
|
|
4373
|
+
keyPath: P.keyPath,
|
|
4374
|
+
storeValue: P.storeValue,
|
|
4375
|
+
updateData: p,
|
|
4376
|
+
children: T
|
|
4377
|
+
}
|
|
4378
|
+
);
|
|
4379
|
+
const R = le(e, h, y);
|
|
4380
|
+
return T !== void 0 ? G(b, R, T) : G(b, R);
|
|
4381
|
+
} catch (f) {
|
|
4382
|
+
return console.error(`Error at ${r}-${a}:`, f), null;
|
|
4383
|
+
}
|
|
4384
|
+
}
|
|
4385
|
+
);
|
|
4386
|
+
function Wo({
|
|
4387
|
+
template: e,
|
|
4388
|
+
expiry: a,
|
|
4389
|
+
data: r,
|
|
4390
|
+
status: n = "pending",
|
|
4391
|
+
render: o = "web"
|
|
4392
|
+
}) {
|
|
4393
|
+
const d = {
|
|
4394
|
+
data: r ?? {},
|
|
4395
|
+
expiry: a ?? "",
|
|
4396
|
+
status: n,
|
|
4397
|
+
submitting: !1
|
|
4398
|
+
};
|
|
4399
|
+
return o === "pdf" ? /* @__PURE__ */ i("div", { "data-mode": o, className: "group bonsai-root w-full", children: /* @__PURE__ */ i(Z, { tree: e, index: 0, path: "root", data: d }) }) : /* @__PURE__ */ i("form", { "data-mode": o, className: "group bonsai-root", children: /* @__PURE__ */ i(Z, { tree: e, index: 0, path: "root", data: d }) });
|
|
4400
|
+
}
|
|
4401
|
+
function Go({
|
|
4402
|
+
captureUrl: e,
|
|
4403
|
+
template: a,
|
|
4404
|
+
render: r = "web"
|
|
4405
|
+
}) {
|
|
4406
|
+
const n = be(), o = async (d) => {
|
|
4407
|
+
if (d.preventDefault(), n.status !== "pending") {
|
|
4408
|
+
n.submitting = !0;
|
|
4409
|
+
return;
|
|
4410
|
+
}
|
|
4411
|
+
n.submitting = !0;
|
|
4412
|
+
try {
|
|
4413
|
+
await fetch(e, {
|
|
4414
|
+
method: "POST",
|
|
4415
|
+
credentials: "include",
|
|
4416
|
+
headers: {
|
|
4417
|
+
"Content-Type": "application/json"
|
|
4418
|
+
},
|
|
4419
|
+
body: JSON.stringify({
|
|
4420
|
+
data: n.data
|
|
4421
|
+
})
|
|
4422
|
+
}), n.status = "captured";
|
|
4423
|
+
} finally {
|
|
4424
|
+
n.submitting = !1;
|
|
4425
|
+
}
|
|
4426
|
+
};
|
|
4427
|
+
return r === "pdf" ? /* @__PURE__ */ i("div", { "data-mode": r, className: "group bonsai-root w-full", children: V(a, 0, "root", void 0, void 0, "root-0") }) : /* @__PURE__ */ i("form", { "data-mode": r, className: "group bonsai-root", onSubmit: o, children: V(a, 0, "root", void 0, void 0, "root-0") });
|
|
4428
|
+
}
|
|
4429
|
+
function vi(e) {
|
|
4430
|
+
return typeof window > "u" ? /* @__PURE__ */ i(Wo, { ...e }) : /* @__PURE__ */ i($o, { ...e });
|
|
4431
|
+
}
|
|
4432
|
+
function $o(e) {
|
|
4433
|
+
const a = $(null);
|
|
4434
|
+
return a.current === null && (a.current = it({
|
|
4435
|
+
status: e.status ?? "pending",
|
|
4436
|
+
expiry: e.expiry ?? "",
|
|
4437
|
+
data: e.data ?? {},
|
|
4438
|
+
submitting: !1
|
|
4439
|
+
})), /* @__PURE__ */ i(Qe.Provider, { value: a.current, children: /* @__PURE__ */ i(Go, { ...e }) });
|
|
4440
|
+
}
|
|
4441
|
+
export {
|
|
4442
|
+
vi as Bonsai,
|
|
4443
|
+
wo as componentMap,
|
|
4444
|
+
Ao as controlledInputMap,
|
|
4445
|
+
Do as useUpdateData
|
|
4446
|
+
};
|