zudoku 0.3.0-dev.33 → 0.3.0-dev.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/main.js +1 -2
- package/dist/app/main.js.map +1 -1
- package/dist/lib/components/index.d.ts +3 -0
- package/dist/lib/components/index.js +2 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/vite/config.js +1 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-component.js +1 -1
- package/dist/vite/plugin-component.js.map +1 -1
- package/lib/{index.esm-CPEExBJE.js → AnchorLink-DCzimaMt.js} +166 -156
- package/lib/AnchorLink-DCzimaMt.js.map +1 -0
- package/lib/{DevPortalProvider-BlxLX6GG.js → DevPortalProvider-Demv4Ngx.js} +250 -230
- package/lib/DevPortalProvider-Demv4Ngx.js.map +1 -0
- package/lib/{Markdown-CL8KPvJN.js → Markdown-kde-UTpz.js} +3 -3
- package/lib/{Markdown-CL8KPvJN.js.map → Markdown-kde-UTpz.js.map} +1 -1
- package/lib/{MdxComponents-Ev_hBHb2.js → MdxComponents-BZ-Y_6jI.js} +8 -8
- package/lib/{MdxComponents-Ev_hBHb2.js.map → MdxComponents-BZ-Y_6jI.js.map} +1 -1
- package/lib/{MdxPage-Z3HKNTrj.js → MdxPage-CGTgSCJL.js} +82 -88
- package/lib/MdxPage-CGTgSCJL.js.map +1 -0
- package/lib/{OperationList-DfkWNe8Y.js → OperationList-BDAtLdf9.js} +1693 -1862
- package/lib/OperationList-BDAtLdf9.js.map +1 -0
- package/lib/{Route-Bf1_D_vC.js → Route-BqfQoDR2.js} +2 -2
- package/lib/{Route-Bf1_D_vC.js.map → Route-BqfQoDR2.js.map} +1 -1
- package/lib/Select-DIOQWPp3.js +4571 -0
- package/lib/Select-DIOQWPp3.js.map +1 -0
- package/lib/Spinner-B9MAj2Pw.js +182 -0
- package/lib/Spinner-B9MAj2Pw.js.map +1 -0
- package/lib/{hook-CTmJ6CWq.js → hook-D1DiFbcT.js} +3 -3
- package/lib/{hook-CTmJ6CWq.js.map → hook-D1DiFbcT.js.map} +1 -1
- package/lib/index-BB2EBBgh.js +412 -0
- package/lib/index-BB2EBBgh.js.map +1 -0
- package/lib/{index-BjSy8IQO.js → index-CdZQPXUQ.js} +6 -6
- package/lib/{index-BjSy8IQO.js.map → index-CdZQPXUQ.js.map} +1 -1
- package/lib/{jsx-runtime-CM0TzjGp.js → jsx-runtime-Bt86M5tA.js} +5 -5
- package/lib/{jsx-runtime-CM0TzjGp.js.map → jsx-runtime-Bt86M5tA.js.map} +1 -1
- package/lib/util-CYBrkBUo.js +41 -0
- package/lib/util-CYBrkBUo.js.map +1 -0
- package/lib/zudoku.auth-openid.js +1 -1
- package/lib/zudoku.components.js +548 -280
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +99 -111
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +46 -2
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/package.json +1 -1
- package/src/app/main.tsx +1 -2
- package/src/lib/components/index.ts +2 -0
- package/lib/DevPortalProvider-BlxLX6GG.js.map +0 -1
- package/lib/MdxPage-Z3HKNTrj.js.map +0 -1
- package/lib/OperationList-DfkWNe8Y.js.map +0 -1
- package/lib/Select-DSa3bN4t.js +0 -4770
- package/lib/Select-DSa3bN4t.js.map +0 -1
- package/lib/index-BdWBDosx.js +0 -74
- package/lib/index-BdWBDosx.js.map +0 -1
- package/lib/index.esm-CPEExBJE.js.map +0 -1
- package/lib/mutation-91kw0lHb.js +0 -208
- package/lib/mutation-91kw0lHb.js.map +0 -1
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { u as M, g as h, c as w, a as D, e as U, P as A, d as k } from "./index-BB2EBBgh.js";
|
|
3
|
+
import * as W from "react-dom";
|
|
4
|
+
import { j as N } from "./jsx-runtime-Bt86M5tA.js";
|
|
5
|
+
import { c as F } from "./MdxComponents-BZ-Y_6jI.js";
|
|
6
|
+
/**
|
|
7
|
+
* @license lucide-react v0.378.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
const B = F("LoaderCircle", [
|
|
13
|
+
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
14
|
+
]);
|
|
15
|
+
function G(e, n) {
|
|
16
|
+
return s.useReducer((r, t) => n[r][t] ?? r, e);
|
|
17
|
+
}
|
|
18
|
+
var S = (e) => {
|
|
19
|
+
const { present: n, children: r } = e, t = $(n), o = typeof r == "function" ? r({ present: t.isPresent }) : s.Children.only(r), c = M(t.ref, q(o));
|
|
20
|
+
return typeof r == "function" || t.isPresent ? s.cloneElement(o, { ref: c }) : null;
|
|
21
|
+
};
|
|
22
|
+
S.displayName = "Presence";
|
|
23
|
+
function $(e) {
|
|
24
|
+
const [n, r] = s.useState(), t = s.useRef({}), o = s.useRef(e), c = s.useRef("none"), l = e ? "mounted" : "unmounted", [f, i] = G(l, {
|
|
25
|
+
mounted: {
|
|
26
|
+
UNMOUNT: "unmounted",
|
|
27
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
28
|
+
},
|
|
29
|
+
unmountSuspended: {
|
|
30
|
+
MOUNT: "mounted",
|
|
31
|
+
ANIMATION_END: "unmounted"
|
|
32
|
+
},
|
|
33
|
+
unmounted: {
|
|
34
|
+
MOUNT: "mounted"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return s.useEffect(() => {
|
|
38
|
+
const a = v(t.current);
|
|
39
|
+
c.current = f === "mounted" ? a : "none";
|
|
40
|
+
}, [f]), h(() => {
|
|
41
|
+
const a = t.current, d = o.current;
|
|
42
|
+
if (d !== e) {
|
|
43
|
+
const g = c.current, m = v(a);
|
|
44
|
+
e ? i("MOUNT") : m === "none" || (a == null ? void 0 : a.display) === "none" ? i("UNMOUNT") : i(d && g !== m ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
|
|
45
|
+
}
|
|
46
|
+
}, [e, i]), h(() => {
|
|
47
|
+
if (n) {
|
|
48
|
+
const a = (p) => {
|
|
49
|
+
const m = v(t.current).includes(p.animationName);
|
|
50
|
+
p.target === n && m && W.flushSync(() => i("ANIMATION_END"));
|
|
51
|
+
}, d = (p) => {
|
|
52
|
+
p.target === n && (c.current = v(t.current));
|
|
53
|
+
};
|
|
54
|
+
return n.addEventListener("animationstart", d), n.addEventListener("animationcancel", a), n.addEventListener("animationend", a), () => {
|
|
55
|
+
n.removeEventListener("animationstart", d), n.removeEventListener("animationcancel", a), n.removeEventListener("animationend", a);
|
|
56
|
+
};
|
|
57
|
+
} else
|
|
58
|
+
i("ANIMATION_END");
|
|
59
|
+
}, [n, i]), {
|
|
60
|
+
isPresent: ["mounted", "unmountSuspended"].includes(f),
|
|
61
|
+
ref: s.useCallback((a) => {
|
|
62
|
+
a && (t.current = getComputedStyle(a)), r(a);
|
|
63
|
+
}, [])
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function v(e) {
|
|
67
|
+
return (e == null ? void 0 : e.animationName) || "none";
|
|
68
|
+
}
|
|
69
|
+
function q(e) {
|
|
70
|
+
var t, o;
|
|
71
|
+
let n = (t = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : t.get, r = n && "isReactWarning" in n && n.isReactWarning;
|
|
72
|
+
return r ? e.ref : (n = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
73
|
+
}
|
|
74
|
+
var O = "Collapsible", [z, X] = w(O), [H, P] = z(O), I = s.forwardRef(
|
|
75
|
+
(e, n) => {
|
|
76
|
+
const {
|
|
77
|
+
__scopeCollapsible: r,
|
|
78
|
+
open: t,
|
|
79
|
+
defaultOpen: o,
|
|
80
|
+
disabled: c,
|
|
81
|
+
onOpenChange: l,
|
|
82
|
+
...f
|
|
83
|
+
} = e, [i = !1, a] = D({
|
|
84
|
+
prop: t,
|
|
85
|
+
defaultProp: o,
|
|
86
|
+
onChange: l
|
|
87
|
+
});
|
|
88
|
+
return /* @__PURE__ */ N.jsx(
|
|
89
|
+
H,
|
|
90
|
+
{
|
|
91
|
+
scope: r,
|
|
92
|
+
disabled: c,
|
|
93
|
+
contentId: U(),
|
|
94
|
+
open: i,
|
|
95
|
+
onOpenToggle: s.useCallback(() => a((d) => !d), [a]),
|
|
96
|
+
children: /* @__PURE__ */ N.jsx(
|
|
97
|
+
A.div,
|
|
98
|
+
{
|
|
99
|
+
"data-state": E(i),
|
|
100
|
+
"data-disabled": c ? "" : void 0,
|
|
101
|
+
...f,
|
|
102
|
+
ref: n
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
I.displayName = O;
|
|
110
|
+
var _ = "CollapsibleTrigger", L = s.forwardRef(
|
|
111
|
+
(e, n) => {
|
|
112
|
+
const { __scopeCollapsible: r, ...t } = e, o = P(_, r);
|
|
113
|
+
return /* @__PURE__ */ N.jsx(
|
|
114
|
+
A.button,
|
|
115
|
+
{
|
|
116
|
+
type: "button",
|
|
117
|
+
"aria-controls": o.contentId,
|
|
118
|
+
"aria-expanded": o.open || !1,
|
|
119
|
+
"data-state": E(o.open),
|
|
120
|
+
"data-disabled": o.disabled ? "" : void 0,
|
|
121
|
+
disabled: o.disabled,
|
|
122
|
+
...t,
|
|
123
|
+
ref: n,
|
|
124
|
+
onClick: k(e.onClick, o.onOpenToggle)
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
L.displayName = _;
|
|
130
|
+
var x = "CollapsibleContent", j = s.forwardRef(
|
|
131
|
+
(e, n) => {
|
|
132
|
+
const { forceMount: r, ...t } = e, o = P(x, e.__scopeCollapsible);
|
|
133
|
+
return /* @__PURE__ */ N.jsx(S, { present: r || o.open, children: ({ present: c }) => /* @__PURE__ */ N.jsx(J, { ...t, ref: n, present: c }) });
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
j.displayName = x;
|
|
137
|
+
var J = s.forwardRef((e, n) => {
|
|
138
|
+
const { __scopeCollapsible: r, present: t, children: o, ...c } = e, l = P(x, r), [f, i] = s.useState(t), a = s.useRef(null), d = M(n, a), p = s.useRef(0), g = p.current, m = s.useRef(0), R = m.current, b = l.open || f, T = s.useRef(b), C = s.useRef();
|
|
139
|
+
return s.useEffect(() => {
|
|
140
|
+
const u = requestAnimationFrame(() => T.current = !1);
|
|
141
|
+
return () => cancelAnimationFrame(u);
|
|
142
|
+
}, []), h(() => {
|
|
143
|
+
const u = a.current;
|
|
144
|
+
if (u) {
|
|
145
|
+
C.current = C.current || {
|
|
146
|
+
transitionDuration: u.style.transitionDuration,
|
|
147
|
+
animationName: u.style.animationName
|
|
148
|
+
}, u.style.transitionDuration = "0s", u.style.animationName = "none";
|
|
149
|
+
const y = u.getBoundingClientRect();
|
|
150
|
+
p.current = y.height, m.current = y.width, T.current || (u.style.transitionDuration = C.current.transitionDuration, u.style.animationName = C.current.animationName), i(t);
|
|
151
|
+
}
|
|
152
|
+
}, [l.open, t]), /* @__PURE__ */ N.jsx(
|
|
153
|
+
A.div,
|
|
154
|
+
{
|
|
155
|
+
"data-state": E(l.open),
|
|
156
|
+
"data-disabled": l.disabled ? "" : void 0,
|
|
157
|
+
id: l.contentId,
|
|
158
|
+
hidden: !b,
|
|
159
|
+
...c,
|
|
160
|
+
ref: d,
|
|
161
|
+
style: {
|
|
162
|
+
"--radix-collapsible-content-height": g ? `${g}px` : void 0,
|
|
163
|
+
"--radix-collapsible-content-width": R ? `${R}px` : void 0,
|
|
164
|
+
...e.style
|
|
165
|
+
},
|
|
166
|
+
children: b && o
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
});
|
|
170
|
+
function E(e) {
|
|
171
|
+
return e ? "open" : "closed";
|
|
172
|
+
}
|
|
173
|
+
var Y = I, Z = L, ee = j;
|
|
174
|
+
const ne = ({ size: e = 16 }) => /* @__PURE__ */ N.jsx(B, { size: e, className: "animate-spin" });
|
|
175
|
+
export {
|
|
176
|
+
ee as C,
|
|
177
|
+
S as P,
|
|
178
|
+
Y as R,
|
|
179
|
+
ne as S,
|
|
180
|
+
Z as T
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=Spinner-B9MAj2Pw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner-B9MAj2Pw.js","sources":["../../../node_modules/.pnpm/lucide-react@0.378.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/loader-circle.js","../../../node_modules/.pnpm/@radix-ui+react-presence@1.1.0_@types+react-dom@18.3.0_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-presence/dist/index.mjs","../../../node_modules/.pnpm/@radix-ui+react-collapsible@1.1.0_@types+react-dom@18.3.0_@types+react@18.3.3_react-dom@18.3._qjsk5diswkeszbepgt4ntypuku/node_modules/@radix-ui/react-collapsible/dist/index.mjs","../src/lib/components/Spinner.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.378.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst LoaderCircle = createLucideIcon(\"LoaderCircle\", [\n [\"path\", { d: \"M21 12a9 9 0 1 1-6.219-8.56\", key: \"13zald\" }]\n]);\n\nexport { LoaderCircle as default };\n//# sourceMappingURL=loader-circle.js.map\n","\"use client\";\n\n// packages/react/presence/src/Presence.tsx\nimport * as React2 from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// packages/react/presence/src/useStateMachine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n\n// packages/react/presence/src/Presence.tsx\nvar Presence = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n};\nPresence.displayName = \"Presence\";\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef({});\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === \"mounted\" ? currentAnimationName : \"none\";\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n const handleAnimationEnd = (event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n ReactDOM.flushSync(() => send(\"ANIMATION_END\"));\n }\n };\n const handleAnimationStart = (event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n if (node2) stylesRef.current = getComputedStyle(node2);\n setNode(node2);\n }, [])\n };\n}\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Presence\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// packages/react/collapsible/src/Collapsible.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { jsx } from \"react/jsx-runtime\";\nvar COLLAPSIBLE_NAME = \"Collapsible\";\nvar [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);\nvar [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);\nvar Collapsible = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeCollapsible,\n open: openProp,\n defaultOpen,\n disabled,\n onOpenChange,\n ...collapsibleProps\n } = props;\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(\n CollapsibleProvider,\n {\n scope: __scopeCollapsible,\n disabled,\n contentId: useId(),\n open,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\nCollapsible.displayName = COLLAPSIBLE_NAME;\nvar TRIGGER_NAME = \"CollapsibleTrigger\";\nvar CollapsibleTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeCollapsible, ...triggerProps } = props;\n const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"CollapsibleContent\";\nvar CollapsibleContent = React.forwardRef(\n (props, forwardedRef) => {\n const { forceMount, ...contentProps } = props;\n const context = useCollapsibleContext(CONTENT_NAME, props.__scopeCollapsible);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });\n }\n);\nCollapsibleContent.displayName = CONTENT_NAME;\nvar CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => {\n const { __scopeCollapsible, present, children, ...contentProps } = props;\n const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);\n const [isPresent, setIsPresent] = React.useState(present);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const heightRef = React.useRef(0);\n const height = heightRef.current;\n const widthRef = React.useRef(0);\n const width = widthRef.current;\n const isOpen = context.open || isPresent;\n const isMountAnimationPreventedRef = React.useRef(isOpen);\n const originalStylesRef = React.useRef();\n React.useEffect(() => {\n const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);\n return () => cancelAnimationFrame(rAF);\n }, []);\n useLayoutEffect(() => {\n const node = ref.current;\n if (node) {\n originalStylesRef.current = originalStylesRef.current || {\n transitionDuration: node.style.transitionDuration,\n animationName: node.style.animationName\n };\n node.style.transitionDuration = \"0s\";\n node.style.animationName = \"none\";\n const rect = node.getBoundingClientRect();\n heightRef.current = rect.height;\n widthRef.current = rect.width;\n if (!isMountAnimationPreventedRef.current) {\n node.style.transitionDuration = originalStylesRef.current.transitionDuration;\n node.style.animationName = originalStylesRef.current.animationName;\n }\n setIsPresent(present);\n }\n }, [context.open, present]);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n id: context.contentId,\n hidden: !isOpen,\n ...contentProps,\n ref: composedRefs,\n style: {\n [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,\n [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,\n ...props.style\n },\n children: isOpen && children\n }\n );\n});\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Root = Collapsible;\nvar Trigger = CollapsibleTrigger;\nvar Content = CollapsibleContent;\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n Content,\n Root,\n Trigger,\n createCollapsibleScope\n};\n//# sourceMappingURL=index.mjs.map\n","import { LoaderCircle } from \"lucide-react\";\n\nexport const Spinner = ({ size = 16 }: { size?: number }) => (\n <LoaderCircle size={size} className=\"animate-spin\" />\n);\n"],"names":["LoaderCircle","createLucideIcon","useStateMachine","initialState","machine","React","state","event","Presence","props","present","children","presence","usePresence","child","React2","ref","useComposedRefs","getElementRef","node","setNode","stylesRef","prevPresentRef","prevAnimationNameRef","send","currentAnimationName","getAnimationName","useLayoutEffect","styles","wasPresent","prevAnimationName","handleAnimationEnd","isCurrentAnimation","ReactDOM","handleAnimationStart","node2","element","getter","_a","mayWarn","_b","COLLAPSIBLE_NAME","createCollapsibleContext","createCollapsibleScope","createContextScope","CollapsibleProvider","useCollapsibleContext","Collapsible","forwardedRef","__scopeCollapsible","openProp","defaultOpen","disabled","onOpenChange","collapsibleProps","open","setOpen","useControllableState","jsx","useId","prevOpen","Primitive","getState","TRIGGER_NAME","CollapsibleTrigger","triggerProps","context","composeEventHandlers","CONTENT_NAME","CollapsibleContent","forceMount","contentProps","CollapsibleContentImpl","isPresent","setIsPresent","composedRefs","heightRef","height","widthRef","width","isOpen","isMountAnimationPreventedRef","originalStylesRef","rAF","rect","Root","Trigger","Content","Spinner","size"],"mappings":";;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAeC,EAAiB,gBAAgB;AAAA,EACpD,CAAC,QAAQ,EAAE,GAAG,+BAA+B,KAAK,SAAQ,CAAE;AAC9D,CAAC;ACDD,SAASC,EAAgBC,GAAcC,GAAS;AAC9C,SAAOC,EAAM,WAAW,CAACC,GAAOC,MACZH,EAAQE,CAAK,EAAEC,CAAK,KAClBD,GACnBH,CAAY;AACjB;AAGG,IAACK,IAAW,CAACC,MAAU;AACx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EAAM;AAAA,MACV;AAAA,MACD,UAAUuE,KAAUrE;AAAA,IACrB;AAAA,EACL;AACA,CAAC;AACD,SAASmD,EAASP,GAAM;AACtB,SAAOA,IAAO,SAAS;AACzB;AACG,IAAC8B,IAAOtC,GACPuC,IAAUtB,GACVuB,KAAUlB;AC7ID,MAAAmB,KAAU,CAAC,EAAE,MAAAC,IAAO,SAC9B/B,gBAAAA,MAAA1D,GAAA,EAAa,MAAAyF,GAAY,WAAU,eAAe,CAAA;","x_google_ignoreList":[0,1,2]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as s } from "./jsx-runtime-
|
|
2
|
-
import { u as i } from "./DevPortalProvider-
|
|
1
|
+
import { j as s } from "./jsx-runtime-Bt86M5tA.js";
|
|
2
|
+
import { u as i } from "./DevPortalProvider-Demv4Ngx.js";
|
|
3
3
|
import { u as a } from "./state-Ds_OxRHP.js";
|
|
4
4
|
function r({ error: t }) {
|
|
5
5
|
const n = (t == null ? void 0 : t.message) ?? "Something went wrong", e = t == null ? void 0 : t.stack;
|
|
@@ -32,4 +32,4 @@ export {
|
|
|
32
32
|
r as E,
|
|
33
33
|
u
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=hook-
|
|
35
|
+
//# sourceMappingURL=hook-D1DiFbcT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook-
|
|
1
|
+
{"version":3,"file":"hook-D1DiFbcT.js","sources":["../src/lib/errors/ErrorAlert.tsx","../src/lib/authentication/hook.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function ErrorAlert({ error }: { error: any }) {\n const message = error?.message ?? \"Something went wrong\";\n const stack = error?.stack;\n\n return (\n <div className=\"flex h-screen max-h-screen min-h-full items-center justify-center bg-primary-background px-4 py-16 lg:px-8\">\n <div className=\"mx-auto max-w-[85%] sm:max-w-[50%]\">\n <h1 className=\"text-4xl font-bold tracking-tight text-h1-text sm:text-5xl\">\n Something went wrong\n </h1>\n <p className=\"mt-5 text-h1-text\">{message}</p>\n {stack ? (\n <pre className=\"mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700\">\n {stack}\n </pre>\n ) : null}\n </div>\n </div>\n );\n}\n","import { useDevPortal } from \"../components/context/DevPortalProvider.js\";\nimport { useAuthState } from \"./state.js\";\n\nexport const useAuth = () => {\n const { authentication } = useDevPortal();\n const authState = useAuthState();\n const isAuthEnabled = typeof authentication !== \"undefined\";\n\n return {\n isAuthEnabled,\n isPending: authState.isPending,\n profile: authState.profile,\n isAuthenticated: authState.profile,\n\n login: async () => {\n if (!isAuthEnabled) {\n throw new Error(\"Authentication is not enabled.\");\n }\n // TODO: Should handle errors/state\n await authentication.login();\n },\n\n logout: async () => {\n if (!isAuthEnabled) {\n throw new Error(\"Authentication is not enabled.\");\n }\n // TODO: Should handle errors/state\n await authentication.logout();\n\n // Redirect to home\n window.location.href = \"/\";\n },\n };\n};\n"],"names":["ErrorAlert","error","message","stack","jsxs","jsx","useAuth","authentication","useDevPortal","authState","useAuthState","isAuthEnabled"],"mappings":";;;AACgB,SAAAA,EAAW,EAAE,OAAAC,KAAyB;AAC9C,QAAAC,KAAUD,KAAA,gBAAAA,EAAO,YAAW,wBAC5BE,IAAQF,KAAA,gBAAAA,EAAO;AAErB,+BACG,OAAI,EAAA,WAAU,8GACb,UAACG,gBAAAA,EAAA,KAAA,OAAA,EAAI,WAAU,sCACb,UAAA;AAAA,IAACC,gBAAAA,EAAA,IAAA,MAAA,EAAG,WAAU,8DAA6D,UAE3E,wBAAA;AAAA,IACCA,gBAAAA,EAAA,IAAA,KAAA,EAAE,WAAU,qBAAqB,UAAQH,GAAA;AAAA,IACzCC,IACEE,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAU,gJACZ,YACH,CAAA,IACE;AAAA,EAAA,EACN,CAAA,EACF,CAAA;AAEJ;ACjBO,MAAMC,IAAU,MAAM;AACrB,QAAA,EAAE,gBAAAC,MAAmBC,KACrBC,IAAYC,KACZC,IAAgB,OAAOJ,IAAmB;AAEzC,SAAA;AAAA,IACL,eAAAI;AAAA,IACA,WAAWF,EAAU;AAAA,IACrB,SAASA,EAAU;AAAA,IACnB,iBAAiBA,EAAU;AAAA,IAE3B,OAAO,YAAY;AACjB,UAAI,CAACE;AACG,cAAA,IAAI,MAAM,gCAAgC;AAGlD,YAAMJ,EAAe;IACvB;AAAA,IAEA,QAAQ,YAAY;AAClB,UAAI,CAACI;AACG,cAAA,IAAI,MAAM,gCAAgC;AAGlD,YAAMJ,EAAe,UAGrB,OAAO,SAAS,OAAO;AAAA,IACzB;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
var W = (e) => {
|
|
2
|
+
throw TypeError(e);
|
|
3
|
+
};
|
|
4
|
+
var N = (e, t, s) => t.has(e) || W("Cannot " + s);
|
|
5
|
+
var c = (e, t, s) => (N(e, t, "read from private field"), s ? s.call(e) : t.get(e)), b = (e, t, s) => t.has(e) ? W("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), E = (e, t, s, n) => (N(e, t, "write to private field"), n ? n.call(e, s) : t.set(e, s), s), C = (e, t, s) => (N(e, t, "access private method"), s);
|
|
6
|
+
import { R as L, z, n as Z } from "./DevPortalProvider-Demv4Ngx.js";
|
|
7
|
+
import * as r from "react";
|
|
8
|
+
import { j as P } from "./jsx-runtime-Bt86M5tA.js";
|
|
9
|
+
import * as q from "react-dom";
|
|
10
|
+
var y, h, w, x, S, k, ct = (k = class extends L {
|
|
11
|
+
constructor(t) {
|
|
12
|
+
super();
|
|
13
|
+
b(this, x);
|
|
14
|
+
b(this, y);
|
|
15
|
+
b(this, h);
|
|
16
|
+
b(this, w);
|
|
17
|
+
this.mutationId = t.mutationId, E(this, h, t.mutationCache), E(this, y, []), this.state = t.state || J(), this.setOptions(t.options), this.scheduleGc();
|
|
18
|
+
}
|
|
19
|
+
setOptions(t) {
|
|
20
|
+
this.options = t, this.updateGcTime(this.options.gcTime);
|
|
21
|
+
}
|
|
22
|
+
get meta() {
|
|
23
|
+
return this.options.meta;
|
|
24
|
+
}
|
|
25
|
+
addObserver(t) {
|
|
26
|
+
c(this, y).includes(t) || (c(this, y).push(t), this.clearGcTimeout(), c(this, h).notify({
|
|
27
|
+
type: "observerAdded",
|
|
28
|
+
mutation: this,
|
|
29
|
+
observer: t
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
removeObserver(t) {
|
|
33
|
+
E(this, y, c(this, y).filter((s) => s !== t)), this.scheduleGc(), c(this, h).notify({
|
|
34
|
+
type: "observerRemoved",
|
|
35
|
+
mutation: this,
|
|
36
|
+
observer: t
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
optionalRemove() {
|
|
40
|
+
c(this, y).length || (this.state.status === "pending" ? this.scheduleGc() : c(this, h).remove(this));
|
|
41
|
+
}
|
|
42
|
+
continue() {
|
|
43
|
+
var t;
|
|
44
|
+
return ((t = c(this, w)) == null ? void 0 : t.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
|
|
45
|
+
this.execute(this.state.variables);
|
|
46
|
+
}
|
|
47
|
+
async execute(t) {
|
|
48
|
+
var o, i, u, a, l, d, R, p, m, g, v, j, M, $, A, I, _, F, G, V;
|
|
49
|
+
E(this, w, z({
|
|
50
|
+
fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
|
|
51
|
+
onFail: (f, O) => {
|
|
52
|
+
C(this, x, S).call(this, { type: "failed", failureCount: f, error: O });
|
|
53
|
+
},
|
|
54
|
+
onPause: () => {
|
|
55
|
+
C(this, x, S).call(this, { type: "pause" });
|
|
56
|
+
},
|
|
57
|
+
onContinue: () => {
|
|
58
|
+
C(this, x, S).call(this, { type: "continue" });
|
|
59
|
+
},
|
|
60
|
+
retry: this.options.retry ?? 0,
|
|
61
|
+
retryDelay: this.options.retryDelay,
|
|
62
|
+
networkMode: this.options.networkMode,
|
|
63
|
+
canRun: () => c(this, h).canRun(this)
|
|
64
|
+
}));
|
|
65
|
+
const s = this.state.status === "pending", n = !c(this, w).canStart();
|
|
66
|
+
try {
|
|
67
|
+
if (!s) {
|
|
68
|
+
C(this, x, S).call(this, { type: "pending", variables: t, isPaused: n }), await ((i = (o = c(this, h).config).onMutate) == null ? void 0 : i.call(
|
|
69
|
+
o,
|
|
70
|
+
t,
|
|
71
|
+
this
|
|
72
|
+
));
|
|
73
|
+
const O = await ((a = (u = this.options).onMutate) == null ? void 0 : a.call(u, t));
|
|
74
|
+
O !== this.state.context && C(this, x, S).call(this, {
|
|
75
|
+
type: "pending",
|
|
76
|
+
context: O,
|
|
77
|
+
variables: t,
|
|
78
|
+
isPaused: n
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const f = await c(this, w).start();
|
|
82
|
+
return await ((d = (l = c(this, h).config).onSuccess) == null ? void 0 : d.call(
|
|
83
|
+
l,
|
|
84
|
+
f,
|
|
85
|
+
t,
|
|
86
|
+
this.state.context,
|
|
87
|
+
this
|
|
88
|
+
)), await ((p = (R = this.options).onSuccess) == null ? void 0 : p.call(R, f, t, this.state.context)), await ((g = (m = c(this, h).config).onSettled) == null ? void 0 : g.call(
|
|
89
|
+
m,
|
|
90
|
+
f,
|
|
91
|
+
null,
|
|
92
|
+
this.state.variables,
|
|
93
|
+
this.state.context,
|
|
94
|
+
this
|
|
95
|
+
)), await ((j = (v = this.options).onSettled) == null ? void 0 : j.call(v, f, null, t, this.state.context)), C(this, x, S).call(this, { type: "success", data: f }), f;
|
|
96
|
+
} catch (f) {
|
|
97
|
+
try {
|
|
98
|
+
throw await (($ = (M = c(this, h).config).onError) == null ? void 0 : $.call(
|
|
99
|
+
M,
|
|
100
|
+
f,
|
|
101
|
+
t,
|
|
102
|
+
this.state.context,
|
|
103
|
+
this
|
|
104
|
+
)), await ((I = (A = this.options).onError) == null ? void 0 : I.call(
|
|
105
|
+
A,
|
|
106
|
+
f,
|
|
107
|
+
t,
|
|
108
|
+
this.state.context
|
|
109
|
+
)), await ((F = (_ = c(this, h).config).onSettled) == null ? void 0 : F.call(
|
|
110
|
+
_,
|
|
111
|
+
void 0,
|
|
112
|
+
f,
|
|
113
|
+
this.state.variables,
|
|
114
|
+
this.state.context,
|
|
115
|
+
this
|
|
116
|
+
)), await ((V = (G = this.options).onSettled) == null ? void 0 : V.call(
|
|
117
|
+
G,
|
|
118
|
+
void 0,
|
|
119
|
+
f,
|
|
120
|
+
t,
|
|
121
|
+
this.state.context
|
|
122
|
+
)), f;
|
|
123
|
+
} finally {
|
|
124
|
+
C(this, x, S).call(this, { type: "error", error: f });
|
|
125
|
+
}
|
|
126
|
+
} finally {
|
|
127
|
+
c(this, h).runNext(this);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}, y = new WeakMap(), h = new WeakMap(), w = new WeakMap(), x = new WeakSet(), S = function(t) {
|
|
131
|
+
const s = (n) => {
|
|
132
|
+
switch (t.type) {
|
|
133
|
+
case "failed":
|
|
134
|
+
return {
|
|
135
|
+
...n,
|
|
136
|
+
failureCount: t.failureCount,
|
|
137
|
+
failureReason: t.error
|
|
138
|
+
};
|
|
139
|
+
case "pause":
|
|
140
|
+
return {
|
|
141
|
+
...n,
|
|
142
|
+
isPaused: !0
|
|
143
|
+
};
|
|
144
|
+
case "continue":
|
|
145
|
+
return {
|
|
146
|
+
...n,
|
|
147
|
+
isPaused: !1
|
|
148
|
+
};
|
|
149
|
+
case "pending":
|
|
150
|
+
return {
|
|
151
|
+
...n,
|
|
152
|
+
context: t.context,
|
|
153
|
+
data: void 0,
|
|
154
|
+
failureCount: 0,
|
|
155
|
+
failureReason: null,
|
|
156
|
+
error: null,
|
|
157
|
+
isPaused: t.isPaused,
|
|
158
|
+
status: "pending",
|
|
159
|
+
variables: t.variables,
|
|
160
|
+
submittedAt: Date.now()
|
|
161
|
+
};
|
|
162
|
+
case "success":
|
|
163
|
+
return {
|
|
164
|
+
...n,
|
|
165
|
+
data: t.data,
|
|
166
|
+
failureCount: 0,
|
|
167
|
+
failureReason: null,
|
|
168
|
+
error: null,
|
|
169
|
+
status: "success",
|
|
170
|
+
isPaused: !1
|
|
171
|
+
};
|
|
172
|
+
case "error":
|
|
173
|
+
return {
|
|
174
|
+
...n,
|
|
175
|
+
data: void 0,
|
|
176
|
+
error: t.error,
|
|
177
|
+
failureCount: n.failureCount + 1,
|
|
178
|
+
failureReason: t.error,
|
|
179
|
+
isPaused: !1,
|
|
180
|
+
status: "error"
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
this.state = s(this.state), Z.batch(() => {
|
|
185
|
+
c(this, y).forEach((n) => {
|
|
186
|
+
n.onMutationUpdate(t);
|
|
187
|
+
}), c(this, h).notify({
|
|
188
|
+
mutation: this,
|
|
189
|
+
type: "updated",
|
|
190
|
+
action: t
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
}, k);
|
|
194
|
+
function J() {
|
|
195
|
+
return {
|
|
196
|
+
context: void 0,
|
|
197
|
+
data: void 0,
|
|
198
|
+
error: null,
|
|
199
|
+
failureCount: 0,
|
|
200
|
+
failureReason: null,
|
|
201
|
+
isPaused: !1,
|
|
202
|
+
status: "idle",
|
|
203
|
+
variables: void 0,
|
|
204
|
+
submittedAt: 0
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function lt(e, t, { checkForDefaultPrevented: s = !0 } = {}) {
|
|
208
|
+
return function(o) {
|
|
209
|
+
if (e == null || e(o), s === !1 || !o.defaultPrevented)
|
|
210
|
+
return t == null ? void 0 : t(o);
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function ft(e, t) {
|
|
214
|
+
const s = r.createContext(t);
|
|
215
|
+
function n(i) {
|
|
216
|
+
const { children: u, ...a } = i, l = r.useMemo(() => a, Object.values(a));
|
|
217
|
+
return /* @__PURE__ */ P.jsx(s.Provider, { value: l, children: u });
|
|
218
|
+
}
|
|
219
|
+
function o(i) {
|
|
220
|
+
const u = r.useContext(s);
|
|
221
|
+
if (u) return u;
|
|
222
|
+
if (t !== void 0) return t;
|
|
223
|
+
throw new Error(`\`${i}\` must be used within \`${e}\``);
|
|
224
|
+
}
|
|
225
|
+
return n.displayName = e + "Provider", [n, o];
|
|
226
|
+
}
|
|
227
|
+
function ht(e, t = []) {
|
|
228
|
+
let s = [];
|
|
229
|
+
function n(i, u) {
|
|
230
|
+
const a = r.createContext(u), l = s.length;
|
|
231
|
+
s = [...s, u];
|
|
232
|
+
function d(p) {
|
|
233
|
+
const { scope: m, children: g, ...v } = p, j = (m == null ? void 0 : m[e][l]) || a, M = r.useMemo(() => v, Object.values(v));
|
|
234
|
+
return /* @__PURE__ */ P.jsx(j.Provider, { value: M, children: g });
|
|
235
|
+
}
|
|
236
|
+
function R(p, m) {
|
|
237
|
+
const g = (m == null ? void 0 : m[e][l]) || a, v = r.useContext(g);
|
|
238
|
+
if (v) return v;
|
|
239
|
+
if (u !== void 0) return u;
|
|
240
|
+
throw new Error(`\`${p}\` must be used within \`${i}\``);
|
|
241
|
+
}
|
|
242
|
+
return d.displayName = i + "Provider", [d, R];
|
|
243
|
+
}
|
|
244
|
+
const o = () => {
|
|
245
|
+
const i = s.map((u) => r.createContext(u));
|
|
246
|
+
return function(a) {
|
|
247
|
+
const l = (a == null ? void 0 : a[e]) || i;
|
|
248
|
+
return r.useMemo(
|
|
249
|
+
() => ({ [`__scope${e}`]: { ...a, [e]: l } }),
|
|
250
|
+
[a, l]
|
|
251
|
+
);
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
return o.scopeName = e, [n, K(o, ...t)];
|
|
255
|
+
}
|
|
256
|
+
function K(...e) {
|
|
257
|
+
const t = e[0];
|
|
258
|
+
if (e.length === 1) return t;
|
|
259
|
+
const s = () => {
|
|
260
|
+
const n = e.map((o) => ({
|
|
261
|
+
useScope: o(),
|
|
262
|
+
scopeName: o.scopeName
|
|
263
|
+
}));
|
|
264
|
+
return function(i) {
|
|
265
|
+
const u = n.reduce((a, { useScope: l, scopeName: d }) => {
|
|
266
|
+
const p = l(i)[`__scope${d}`];
|
|
267
|
+
return { ...a, ...p };
|
|
268
|
+
}, {});
|
|
269
|
+
return r.useMemo(() => ({ [`__scope${t.scopeName}`]: u }), [u]);
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
return s.scopeName = t.scopeName, s;
|
|
273
|
+
}
|
|
274
|
+
function T(e) {
|
|
275
|
+
const t = r.useRef(e);
|
|
276
|
+
return r.useEffect(() => {
|
|
277
|
+
t.current = e;
|
|
278
|
+
}), r.useMemo(() => (...s) => {
|
|
279
|
+
var n;
|
|
280
|
+
return (n = t.current) == null ? void 0 : n.call(t, ...s);
|
|
281
|
+
}, []);
|
|
282
|
+
}
|
|
283
|
+
function dt({
|
|
284
|
+
prop: e,
|
|
285
|
+
defaultProp: t,
|
|
286
|
+
onChange: s = () => {
|
|
287
|
+
}
|
|
288
|
+
}) {
|
|
289
|
+
const [n, o] = Q({ defaultProp: t, onChange: s }), i = e !== void 0, u = i ? e : n, a = T(s), l = r.useCallback(
|
|
290
|
+
(d) => {
|
|
291
|
+
if (i) {
|
|
292
|
+
const p = typeof d == "function" ? d(e) : d;
|
|
293
|
+
p !== e && a(p);
|
|
294
|
+
} else
|
|
295
|
+
o(d);
|
|
296
|
+
},
|
|
297
|
+
[i, e, o, a]
|
|
298
|
+
);
|
|
299
|
+
return [u, l];
|
|
300
|
+
}
|
|
301
|
+
function Q({
|
|
302
|
+
defaultProp: e,
|
|
303
|
+
onChange: t
|
|
304
|
+
}) {
|
|
305
|
+
const s = r.useState(e), [n] = s, o = r.useRef(n), i = T(t);
|
|
306
|
+
return r.useEffect(() => {
|
|
307
|
+
o.current !== n && (i(n), o.current = n);
|
|
308
|
+
}, [n, o, i]), s;
|
|
309
|
+
}
|
|
310
|
+
var X = globalThis != null && globalThis.document ? r.useLayoutEffect : () => {
|
|
311
|
+
};
|
|
312
|
+
function Y(e, t) {
|
|
313
|
+
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
314
|
+
}
|
|
315
|
+
function B(...e) {
|
|
316
|
+
return (t) => e.forEach((s) => Y(s, t));
|
|
317
|
+
}
|
|
318
|
+
function pt(...e) {
|
|
319
|
+
return r.useCallback(B(...e), e);
|
|
320
|
+
}
|
|
321
|
+
var U = r.forwardRef((e, t) => {
|
|
322
|
+
const { children: s, ...n } = e, o = r.Children.toArray(s), i = o.find(tt);
|
|
323
|
+
if (i) {
|
|
324
|
+
const u = i.props.children, a = o.map((l) => l === i ? r.Children.count(u) > 1 ? r.Children.only(null) : r.isValidElement(u) ? u.props.children : null : l);
|
|
325
|
+
return /* @__PURE__ */ P.jsx(D, { ...n, ref: t, children: r.isValidElement(u) ? r.cloneElement(u, void 0, a) : null });
|
|
326
|
+
}
|
|
327
|
+
return /* @__PURE__ */ P.jsx(D, { ...n, ref: t, children: s });
|
|
328
|
+
});
|
|
329
|
+
U.displayName = "Slot";
|
|
330
|
+
var D = r.forwardRef((e, t) => {
|
|
331
|
+
const { children: s, ...n } = e;
|
|
332
|
+
if (r.isValidElement(s)) {
|
|
333
|
+
const o = st(s);
|
|
334
|
+
return r.cloneElement(s, {
|
|
335
|
+
...et(n, s.props),
|
|
336
|
+
// @ts-ignore
|
|
337
|
+
ref: t ? B(t, o) : o
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
return r.Children.count(s) > 1 ? r.Children.only(null) : null;
|
|
341
|
+
});
|
|
342
|
+
D.displayName = "SlotClone";
|
|
343
|
+
var H = ({ children: e }) => /* @__PURE__ */ P.jsx(P.Fragment, { children: e });
|
|
344
|
+
function tt(e) {
|
|
345
|
+
return r.isValidElement(e) && e.type === H;
|
|
346
|
+
}
|
|
347
|
+
function et(e, t) {
|
|
348
|
+
const s = { ...t };
|
|
349
|
+
for (const n in t) {
|
|
350
|
+
const o = e[n], i = t[n];
|
|
351
|
+
/^on[A-Z]/.test(n) ? o && i ? s[n] = (...a) => {
|
|
352
|
+
i(...a), o(...a);
|
|
353
|
+
} : o && (s[n] = o) : n === "style" ? s[n] = { ...o, ...i } : n === "className" && (s[n] = [o, i].filter(Boolean).join(" "));
|
|
354
|
+
}
|
|
355
|
+
return { ...e, ...s };
|
|
356
|
+
}
|
|
357
|
+
function st(e) {
|
|
358
|
+
var n, o;
|
|
359
|
+
let t = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, s = t && "isReactWarning" in t && t.isReactWarning;
|
|
360
|
+
return s ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, s = t && "isReactWarning" in t && t.isReactWarning, s ? e.props.ref : e.props.ref || e.ref);
|
|
361
|
+
}
|
|
362
|
+
var nt = [
|
|
363
|
+
"a",
|
|
364
|
+
"button",
|
|
365
|
+
"div",
|
|
366
|
+
"form",
|
|
367
|
+
"h2",
|
|
368
|
+
"h3",
|
|
369
|
+
"img",
|
|
370
|
+
"input",
|
|
371
|
+
"label",
|
|
372
|
+
"li",
|
|
373
|
+
"nav",
|
|
374
|
+
"ol",
|
|
375
|
+
"p",
|
|
376
|
+
"span",
|
|
377
|
+
"svg",
|
|
378
|
+
"ul"
|
|
379
|
+
], mt = nt.reduce((e, t) => {
|
|
380
|
+
const s = r.forwardRef((n, o) => {
|
|
381
|
+
const { asChild: i, ...u } = n, a = i ? U : t;
|
|
382
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ P.jsx(a, { ...u, ref: o });
|
|
383
|
+
});
|
|
384
|
+
return s.displayName = `Primitive.${t}`, { ...e, [t]: s };
|
|
385
|
+
}, {});
|
|
386
|
+
function yt(e, t) {
|
|
387
|
+
e && q.flushSync(() => e.dispatchEvent(t));
|
|
388
|
+
}
|
|
389
|
+
var ot = r.useId || (() => {
|
|
390
|
+
}), rt = 0;
|
|
391
|
+
function xt(e) {
|
|
392
|
+
const [t, s] = r.useState(ot());
|
|
393
|
+
return X(() => {
|
|
394
|
+
s((n) => n ?? String(rt++));
|
|
395
|
+
}, [e]), t ? `radix-${t}` : "";
|
|
396
|
+
}
|
|
397
|
+
export {
|
|
398
|
+
ct as M,
|
|
399
|
+
mt as P,
|
|
400
|
+
U as S,
|
|
401
|
+
dt as a,
|
|
402
|
+
T as b,
|
|
403
|
+
ht as c,
|
|
404
|
+
lt as d,
|
|
405
|
+
xt as e,
|
|
406
|
+
ft as f,
|
|
407
|
+
X as g,
|
|
408
|
+
J as h,
|
|
409
|
+
yt as i,
|
|
410
|
+
pt as u
|
|
411
|
+
};
|
|
412
|
+
//# sourceMappingURL=index-BB2EBBgh.js.map
|