UNPKG

hello-csv

Version:

A modern CSV importer written in Preact

1,433 lines 404 kB
var ha = Object.defineProperty; var va = (e, t, n) => t in e ? ha(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var Ce = (e, t, n) => va(e, typeof t != "symbol" ? t + "" : t, n); import { options as Ee, Component as _t, createElement as F, Fragment as ve, toChildArray as ct, render as Fn, createRef as zn, createContext as fe, cloneElement as wa, hydrate as ba } from "preact"; var ot, de, lr, Lo, Vt = 0, Ui = [], he = Ee, Vo = he.__b, Ho = he.__r, zo = he.diffed, Bo = he.__c, jo = he.unmount, Uo = he.__; function Rt(e, t) { he.__h && he.__h(de, e, Vt || t), Vt = 0; var n = de.__H || (de.__H = { __: [], __h: [] }); return e >= n.__.length && n.__.push({}), n.__[e]; } function U(e) { return Vt = 1, it(Wi, e); } function it(e, t, n) { var r = Rt(ot++, 2); if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Wi(void 0, t), function(s) { var a = r.__N ? r.__N[0] : r.__[0], u = r.t(a, s); a !== u && (r.__N = [u, r.__[1]], r.__c.setState({})); }], r.__c = de, !de.u)) { var o = function(s, a, u) { if (!r.__c.__H) return !0; var c = r.__c.__H.__.filter(function(g) { return !!g.__c; }); if (c.every(function(g) { return !g.__N; })) return !i || i.call(this, s, a, u); var p = r.__c.props !== s; return c.forEach(function(g) { if (g.__N) { var d = g.__[0]; g.__ = g.__N, g.__N = void 0, d !== g.__[0] && (p = !0); } }), i && i.call(this, s, a, u) || p; }; de.u = !0; var i = de.shouldComponentUpdate, l = de.componentWillUpdate; de.componentWillUpdate = function(s, a, u) { if (this.__e) { var c = i; i = void 0, o(s, a, u), i = c; } l && l.call(this, s, a, u); }, de.shouldComponentUpdate = o; } return r.__N || r.__; } function re(e, t) { var n = Rt(ot++, 3); !he.__s && no(n.__H, t) && (n.__ = e, n.i = t, de.__H.__h.push(n)); } function Ze(e, t) { var n = Rt(ot++, 4); !he.__s && no(n.__H, t) && (n.__ = e, n.i = t, de.__h.push(n)); } function k(e) { return Vt = 5, W(function() { return { current: e }; }, []); } function eo(e, t, n) { Vt = 6, Ze(function() { return typeof e == "function" ? (e(t()), function() { return e(null); }) : e ? (e.current = t(), function() { return e.current = null; }) : void 0; }, n == null ? n : n.concat(e)); } function W(e, t) { var n = Rt(ot++, 7); return no(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__; } function oe(e, t) { return Vt = 8, W(function() { return e; }, t); } function se(e) { var t = de.context[e.__c], n = Rt(ot++, 9); return n.c = e, t ? (n.__ == null && (n.__ = !0, t.sub(de)), t.props.value) : e.__; } function to(e, t) { he.useDebugValue && he.useDebugValue(t ? t(e) : e); } function ya(e) { var t = Rt(ot++, 10), n = U(); return t.__ = e, de.componentDidCatch || (de.componentDidCatch = function(r, o) { t.__ && t.__(r, o), n[1](r); }), [n[0], function() { n[1](void 0); }]; } function Me() { var e = Rt(ot++, 11); if (!e.__) { for (var t = de.__v; t !== null && !t.__m && t.__ !== null; ) t = t.__; var n = t.__m || (t.__m = [0, 0]); e.__ = "P" + n[0] + "-" + n[1]++; } return e.__; } function xa() { for (var e; e = Ui.shift(); ) if (e.__P && e.__H) try { e.__H.__h.forEach(Tn), e.__H.__h.forEach(Er), e.__H.__h = []; } catch (t) { e.__H.__h = [], he.__e(t, e.__v); } } he.__b = function(e) { de = null, Vo && Vo(e); }, he.__ = function(e, t) { e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Uo && Uo(e, t); }, he.__r = function(e) { Ho && Ho(e), ot = 0; var t = (de = e.__c).__H; t && (lr === de ? (t.__h = [], de.__h = [], t.__.forEach(function(n) { n.__N && (n.__ = n.__N), n.i = n.__N = void 0; })) : (t.__h.forEach(Tn), t.__h.forEach(Er), t.__h = [], ot = 0)), lr = de; }, he.diffed = function(e) { zo && zo(e); var t = e.__c; t && t.__H && (t.__H.__h.length && (Ui.push(t) !== 1 && Lo === he.requestAnimationFrame || ((Lo = he.requestAnimationFrame) || _a)(xa)), t.__H.__.forEach(function(n) { n.i && (n.__H = n.i), n.i = void 0; })), lr = de = null; }, he.__c = function(e, t) { t.some(function(n) { try { n.__h.forEach(Tn), n.__h = n.__h.filter(function(r) { return !r.__ || Er(r); }); } catch (r) { t.some(function(o) { o.__h && (o.__h = []); }), t = [], he.__e(r, n.__v); } }), Bo && Bo(e, t); }, he.unmount = function(e) { jo && jo(e); var t, n = e.__c; n && n.__H && (n.__H.__.forEach(function(r) { try { Tn(r); } catch (o) { t = o; } }), n.__H = void 0, t && he.__e(t, n.__v)); }; var Wo = typeof requestAnimationFrame == "function"; function _a(e) { var t, n = function() { clearTimeout(r), Wo && cancelAnimationFrame(t), setTimeout(e); }, r = setTimeout(n, 100); Wo && (t = requestAnimationFrame(n)); } function Tn(e) { var t = de, n = e.__c; typeof n == "function" && (e.__c = void 0, n()), de = t; } function Er(e) { var t = de; e.__c = e.__(), de = t; } function no(e, t) { return !e || e.length !== t.length || t.some(function(n, r) { return n !== e[r]; }); } function Wi(e, t) { return typeof t == "function" ? t(e) : t; } function Gi(e, t) { for (var n in t) e[n] = t[n]; return e; } function Rr(e, t) { for (var n in e) if (n !== "__source" && !(n in t)) return !0; for (var r in t) if (r !== "__source" && e[r] !== t[r]) return !0; return !1; } function Bn(e, t) { var n = t(), r = U({ t: { __: n, u: t } }), o = r[0].t, i = r[1]; return Ze(function() { o.__ = n, o.u = t, sr(o) && i({ t: o }); }, [e, n, t]), re(function() { return sr(o) && i({ t: o }), e(function() { sr(o) && i({ t: o }); }); }, [e]), n; } function sr(e) { var t, n, r = e.u, o = e.__; try { var i = r(); return !((t = o) === (n = i) && (t !== 0 || 1 / t == 1 / n) || t != t && n != n); } catch { return !0; } } function ro(e) { e(); } function oo(e) { return e; } function io() { return [!1, ro]; } var lo = Ze; function Pn(e, t) { this.props = e, this.context = t; } function qi(e, t) { function n(o) { var i = this.props.ref, l = i == o.ref; return !l && i && (i.call ? i(null) : i.current = null), t ? !t(this.props, o) || !l : Rr(this.props, o); } function r(o) { return this.shouldComponentUpdate = n, F(e, o); } return r.displayName = "Memo(" + (e.displayName || e.name) + ")", r.prototype.isReactComponent = !0, r.__f = !0, r; } (Pn.prototype = new _t()).isPureReactComponent = !0, Pn.prototype.shouldComponentUpdate = function(e, t) { return Rr(this.props, e) || Rr(this.state, t); }; var Go = Ee.__b; Ee.__b = function(e) { e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), Go && Go(e); }; var Sa = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911; function ce(e) { function t(n) { var r = Gi({}, n); return delete r.ref, e(r, n.ref || null); } return t.$$typeof = Sa, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t; } var qo = function(e, t) { return e == null ? null : ct(ct(e).map(t)); }, Ki = { map: qo, forEach: qo, count: function(e) { return e ? ct(e).length : 0; }, only: function(e) { var t = ct(e); if (t.length !== 1) throw "Children.only"; return t[0]; }, toArray: ct }, Ca = Ee.__e; Ee.__e = function(e, t, n, r) { if (e.then) { for (var o, i = t; i = i.__; ) if ((o = i.__c) && o.__c) return t.__e == null && (t.__e = n.__e, t.__k = n.__k), o.__c(e, t); } Ca(e, t, n, r); }; var Ko = Ee.unmount; function Yi(e, t, n) { return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(r) { typeof r.__c == "function" && r.__c(); }), e.__c.__H = null), (e = Gi({}, e)).__c != null && (e.__c.__P === n && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(r) { return Yi(r, t, n); })), e; } function Xi(e, t, n) { return e && n && (e.__v = null, e.__k = e.__k && e.__k.map(function(r) { return Xi(r, t, n); }), e.__c && e.__c.__P === t && (e.__e && n.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = n)), e; } function tn() { this.__u = 0, this.o = null, this.__b = null; } function Zi(e) { var t = e.__.__c; return t && t.__a && t.__a(e); } function Ji(e) { var t, n, r; function o(i) { if (t || (t = e()).then(function(l) { n = l.default || l; }, function(l) { r = l; }), r) throw r; if (!n) throw t; return F(n, i); } return o.displayName = "Lazy", o.__f = !0, o; } function At() { this.i = null, this.l = null; } Ee.unmount = function(e) { var t = e.__c; t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), Ko && Ko(e); }, (tn.prototype = new _t()).__c = function(e, t) { var n = t.__c, r = this; r.o == null && (r.o = []), r.o.push(n); var o = Zi(r.__v), i = !1, l = function() { i || (i = !0, n.__R = null, o ? o(s) : s()); }; n.__R = l; var s = function() { if (!--r.__u) { if (r.state.__a) { var a = r.state.__a; r.__v.__k[0] = Xi(a, a.__c.__P, a.__c.__O); } var u; for (r.setState({ __a: r.__b = null }); u = r.o.pop(); ) u.forceUpdate(); } }; r.__u++ || 32 & t.__u || r.setState({ __a: r.__b = r.__v.__k[0] }), e.then(l, l); }, tn.prototype.componentWillUnmount = function() { this.o = []; }, tn.prototype.render = function(e, t) { if (this.__b) { if (this.__v.__k) { var n = document.createElement("div"), r = this.__v.__k[0].__c; this.__v.__k[0] = Yi(this.__b, n, r.__O = r.__P); } this.__b = null; } var o = t.__a && F(ve, null, e.fallback); return o && (o.__u &= -33), [F(ve, null, t.__a ? null : e.children), o]; }; var Yo = function(e, t, n) { if (++n[1] === n[0] && e.l.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.l.size)) for (n = e.i; n; ) { for (; n.length > 3; ) n.pop()(); if (n[1] < n[0]) break; e.i = n = n[2]; } }; function Ea(e) { return this.getChildContext = function() { return e.context; }, e.children; } function Ra(e) { var t = this, n = e.h; t.componentWillUnmount = function() { Fn(null, t.v), t.v = null, t.h = null; }, t.h && t.h !== n && t.componentWillUnmount(), t.v || (t.h = n, t.v = { nodeType: 1, parentNode: n, childNodes: [], contains: function() { return !0; }, appendChild: function(r) { this.childNodes.push(r), t.h.appendChild(r); }, insertBefore: function(r, o) { this.childNodes.push(r), t.h.insertBefore(r, o); }, removeChild: function(r) { this.childNodes.splice(this.childNodes.indexOf(r) >>> 1, 1), t.h.removeChild(r); } }), Fn(F(Ea, { context: t.context }, e.__v), t.v); } function fn(e, t) { var n = F(Ra, { __v: e, h: t }); return n.containerInfo = t, n; } (At.prototype = new _t()).__a = function(e) { var t = this, n = Zi(t.__v), r = t.l.get(e); return r[0]++, function(o) { var i = function() { t.props.revealOrder ? (r.push(o), Yo(t, e, r)) : o(); }; n ? n(i) : i(); }; }, At.prototype.render = function(e) { this.i = null, this.l = /* @__PURE__ */ new Map(); var t = ct(e.children); e.revealOrder && e.revealOrder[0] === "b" && t.reverse(); for (var n = t.length; n--; ) this.l.set(t[n], this.i = [1, 0, this.i]); return e.children; }, At.prototype.componentDidUpdate = At.prototype.componentDidMount = function() { var e = this; this.l.forEach(function(t, n) { Yo(e, n, t); }); }; var Qi = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, $a = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Ta = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Ia = /[A-Z0-9]/g, Oa = typeof document < "u", Ma = function(e) { return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e); }; function so(e, t, n) { return t.__k == null && (t.textContent = ""), Fn(e, t), typeof n == "function" && n(), e ? e.__c : null; } function el(e, t, n) { return ba(e, t), typeof n == "function" && n(), e ? e.__c : null; } _t.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) { Object.defineProperty(_t.prototype, e, { configurable: !0, get: function() { return this["UNSAFE_" + e]; }, set: function(t) { Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t }); } }); }); var Xo = Ee.event; function Fa() { } function Pa() { return this.cancelBubble; } function Aa() { return this.defaultPrevented; } Ee.event = function(e) { return Xo && (e = Xo(e)), e.persist = Fa, e.isPropagationStopped = Pa, e.isDefaultPrevented = Aa, e.nativeEvent = e; }; var ao, Na = { enumerable: !1, configurable: !0, get: function() { return this.class; } }, Zo = Ee.vnode; Ee.vnode = function(e) { typeof e.type == "string" && function(t) { var n = t.props, r = t.type, o = {}, i = r.indexOf("-") === -1; for (var l in n) { var s = n[l]; if (!(l === "value" && "defaultValue" in n && s == null || Oa && l === "children" && r === "noscript" || l === "class" || l === "className")) { var a = l.toLowerCase(); l === "defaultValue" && "value" in n && n.value == null ? l = "value" : l === "download" && s === !0 ? s = "" : a === "translate" && s === "no" ? s = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? l = "ondblclick" : a !== "onchange" || r !== "input" && r !== "textarea" || Ma(n.type) ? a === "onfocus" ? l = "onfocusin" : a === "onblur" ? l = "onfocusout" : Ta.test(l) && (l = a) : a = l = "oninput" : i && $a.test(l) ? l = l.replace(Ia, "-$&").toLowerCase() : s === null && (s = void 0), a === "oninput" && o[l = a] && (l = "oninputCapture"), o[l] = s; } } r == "select" && o.multiple && Array.isArray(o.value) && (o.value = ct(n.children).forEach(function(u) { u.props.selected = o.value.indexOf(u.props.value) != -1; })), r == "select" && o.defaultValue != null && (o.value = ct(n.children).forEach(function(u) { u.props.selected = o.multiple ? o.defaultValue.indexOf(u.props.value) != -1 : o.defaultValue == u.props.value; })), n.class && !n.className ? (o.class = n.class, Object.defineProperty(o, "className", Na)) : (n.className && !n.class || n.class && n.className) && (o.class = o.className = n.className), t.props = o; }(e), e.$$typeof = Qi, Zo && Zo(e); }; var Jo = Ee.__r; Ee.__r = function(e) { Jo && Jo(e), ao = e.__c; }; var Qo = Ee.diffed; Ee.diffed = function(e) { Qo && Qo(e); var t = e.props, n = e.__e; n != null && e.type === "textarea" && "value" in t && t.value !== n.value && (n.value = t.value == null ? "" : t.value), ao = null; }; var tl = { ReactCurrentDispatcher: { current: { readContext: function(e) { return ao.__n[e.__c].props.value; }, useCallback: oe, useContext: se, useDebugValue: to, useDeferredValue: oo, useEffect: re, useId: Me, useImperativeHandle: eo, useInsertionEffect: lo, useLayoutEffect: Ze, useMemo: W, useReducer: it, useRef: k, useState: U, useSyncExternalStore: Bn, useTransition: io } } }, ka = "18.3.1"; function nl(e) { return F.bind(null, e); } function jt(e) { return !!e && e.$$typeof === Qi; } function rl(e) { return jt(e) && e.type === ve; } function ol(e) { return !!e && !!e.displayName && (typeof e.displayName == "string" || e.displayName instanceof String) && e.displayName.startsWith("Memo("); } function uo(e) { return jt(e) ? wa.apply(null, arguments) : e; } function co(e) { return !!e.__k && (Fn(null, e), !0); } function il(e) { return e && (e.base || e.nodeType === 1 && e) || null; } var ll = function(e, t) { return e(t); }, De = function(e, t) { return e(t); }, sl = ve, al = jt, D = { useState: U, useId: Me, useReducer: it, useEffect: re, useLayoutEffect: Ze, useInsertionEffect: lo, useTransition: io, useDeferredValue: oo, useSyncExternalStore: Bn, startTransition: ro, useRef: k, useImperativeHandle: eo, useMemo: W, useCallback: oe, useContext: se, useDebugValue: to, version: "18.3.1", Children: Ki, render: so, hydrate: el, unmountComponentAtNode: co, createPortal: fn, createElement: F, createContext: fe, createFactory: nl, cloneElement: uo, createRef: zn, Fragment: ve, isValidElement: jt, isElement: al, isFragment: rl, isMemo: ol, findDOMNode: il, Component: _t, PureComponent: Pn, memo: qi, forwardRef: ce, flushSync: De, unstable_batchedUpdates: ll, StrictMode: sl, Suspense: tn, SuspenseList: At, lazy: Ji, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: tl }; const $r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, Children: Ki, Component: _t, Fragment: ve, PureComponent: Pn, StrictMode: sl, Suspense: tn, SuspenseList: At, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: tl, cloneElement: uo, createContext: fe, createElement: F, createFactory: nl, createPortal: fn, createRef: zn, default: D, findDOMNode: il, flushSync: De, forwardRef: ce, hydrate: el, isElement: al, isFragment: rl, isMemo: ol, isValidElement: jt, lazy: Ji, memo: qi, render: so, startTransition: ro, unmountComponentAtNode: co, unstable_batchedUpdates: ll, useCallback: oe, useContext: se, useDebugValue: to, useDeferredValue: oo, useEffect: re, useErrorBoundary: ya, useId: Me, useImperativeHandle: eo, useInsertionEffect: lo, useLayoutEffect: Ze, useMemo: W, useReducer: it, useRef: k, useState: U, useSyncExternalStore: Bn, useTransition: io, version: ka }, Symbol.toStringTag, { value: "Module" })); function Da(e) { return { // eslint-disable-next-line render: function(t) { so(t, e); }, // eslint-disable-next-line unmount: function() { co(e); } }; } var La = 0; function f(e, t, n, r, o, i) { t || (t = {}); var l, s, a = t; if ("ref" in a) for (s in a = {}, t) s == "ref" ? l = t[s] : a[s] = t[s]; var u = { type: e, props: a, key: n, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --La, __i: -1, __u: 0, __source: o, __self: i }; if (typeof e == "function" && (l = e.defaultProps)) for (s in l) a[s] === void 0 && (a[s] = l[s]); return Ee.vnode && Ee.vnode(u), u; } function ul(e) { var t, n, r = ""; if (typeof e == "string" || typeof e == "number") r += e; else if (typeof e == "object") if (Array.isArray(e)) { var o = e.length; for (t = 0; t < o; t++) e[t] && (n = ul(e[t])) && (r && (r += " "), r += n); } else for (n in e) e[n] && (r && (r += " "), r += n); return r; } function Va() { for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = ul(e)) && (r && (r += " "), r += t); return r; } const ei = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, ti = Va, $t = (e, t) => (n) => { var r; if ((t == null ? void 0 : t.variants) == null) return ti(e, n == null ? void 0 : n.class, n == null ? void 0 : n.className); const { variants: o, defaultVariants: i } = t, l = Object.keys(o).map((u) => { const c = n == null ? void 0 : n[u], p = i == null ? void 0 : i[u]; if (c === null) return null; const g = ei(c) || ei(p); return o[u][g]; }), s = n && Object.entries(n).reduce((u, c) => { let [p, g] = c; return g === void 0 || (u[p] = g), u; }, {}), a = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((u, c) => { let { class: p, className: g, ...d } = c; return Object.entries(d).every((m) => { let [h, w] = m; return Array.isArray(w) ? w.includes({ ...i, ...s }[h]) : { ...i, ...s }[h] === w; }) ? [ ...u, p, g ] : u; }, []); return ti(e, l, a, n == null ? void 0 : n.class, n == null ? void 0 : n.className); }, Ha = $t( "text-center inline-block font-semibold px-3 py-2 rounded-md text-sm", { variants: { variant: { primary: "shadow-xs bg-hello-csv-primary text-white", secondary: "bg-white text-hello-csv-primary ring-1 shadow-xs ring-bg-hello-csv-primary ring-inset", tertiary: "bg-white text-gray-900 ring-1 shadow-xs ring-hello-csv-tertiary ring-inset", success: "shadow-xs bg-hello-csv-success text-white", danger: "shadow-xs bg-hello-csv-danger text-white" }, withFullWidth: { true: "w-full", false: "" }, disabled: { true: "opacity-50 cursor-not-allowed pointer-events-none", false: "cursor-pointer" } }, compoundVariants: [ { variant: "primary", disabled: !1, className: "hover:bg-hello-csv-primary-light focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-primary" }, { variant: "secondary", disabled: !1, className: "hover:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-secondary" }, { variant: "tertiary", disabled: !1, className: "hover:bg-hello-csv-tertiary-light" }, { variant: "success", disabled: !1, className: "hover:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-success" }, { variant: "danger", disabled: !1, className: "hover:bg-hello-csv-danger-light focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-danger" } ], defaultVariants: { withFullWidth: !1, variant: "primary", disabled: !1 } } ); function He({ children: e, variant: t, disabled: n, onClick: r, withFullWidth: o }) { const i = Ha({ variant: t, disabled: n, withFullWidth: o }); return /* @__PURE__ */ f( "div", { role: "button", tabIndex: 0, className: i, onClick: r, "aria-disabled": n, children: e } ); } const za = $t("overflow-hidden rounded-md border border-gray-200", { variants: { variant: { default: "bg-white", muted: "bg-hello-csv-muted" }, withPadding: { true: "px-4 py-5 sm:p-6", false: "" } }, defaultVariants: { variant: "default", withPadding: !0 } }), cl = ce( ({ children: e, className: t, variant: n, withPadding: r = !0 }, o) => { const i = za({ variant: n, withPadding: r }); return /* @__PURE__ */ f("div", { ref: o, className: `${i} ${t}`, children: e }); } ); function dl({ checked: e, setChecked: t, label: n }) { const r = Me(); return /* @__PURE__ */ f("div", { className: "flex gap-3", children: [ /* @__PURE__ */ f("div", { className: "flex h-6 shrink-0 items-center", children: /* @__PURE__ */ f("div", { className: "group grid size-4 grid-cols-1", children: [ /* @__PURE__ */ f( "input", { checked: e, onChange: (o) => t(o.target.checked), id: r, type: "checkbox", className: "checked:border-hello-csv-primary checked:bg-hello-csv-primary indeterminate:border-hello-csv-primary indeterminate:bg-hello-csv-primary focus-visible:outline-hello-csv-hello-csv-primary col-start-1 row-start-1 appearance-none rounded-sm border border-gray-300 bg-white focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto" } ), /* @__PURE__ */ f( "svg", { fill: "none", viewBox: "0 0 14 14", className: "pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white group-has-disabled:stroke-gray-950/25", children: [ /* @__PURE__ */ f( "path", { d: "M3 8L6 11L11 3.5", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", className: "opacity-0 group-has-checked:opacity-100" } ), /* @__PURE__ */ f( "path", { d: "M3 7H11", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", className: "opacity-0 group-has-indeterminate:opacity-100" } ) ] } ) ] }) }), n && /* @__PURE__ */ f("div", { className: "text-sm/6", children: /* @__PURE__ */ f("label", { htmlFor: r, className: "font-medium text-gray-900", children: n }) }) ] }); } let Ba = !1; function fo() { return Ba; } const fl = typeof document < "u" ? D.useLayoutEffect : () => { }; function ja(e) { const t = k(null); return fl(() => { t.current = e; }, [ e ]), oe((...n) => { const r = t.current; return r == null ? void 0 : r(...n); }, []); } const gt = (e) => { var t; return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document; }, bt = (e) => e && "window" in e && e.window === e ? e : gt(e).defaultView || window; function Ua(e) { return e !== null && typeof e == "object" && "nodeType" in e && typeof e.nodeType == "number"; } function Wa(e) { return Ua(e) && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in e; } function pl(e, t) { if (!fo()) return t && e ? e.contains(t) : !1; if (!e || !t) return !1; let n = t; for (; n !== null; ) { if (n === e) return !0; n.tagName === "SLOT" && n.assignedSlot ? n = n.assignedSlot.parentNode : Wa(n) ? n = n.host : n = n.parentNode; } return !1; } const Tr = (e = document) => { var t; if (!fo()) return e.activeElement; let n = e.activeElement; for (; n && "shadowRoot" in n && (!((t = n.shadowRoot) === null || t === void 0) && t.activeElement); ) n = n.shadowRoot.activeElement; return n; }; function ml(e) { return fo() && e.target.shadowRoot && e.composedPath ? e.composedPath()[0] : e.target; } function Ga(e) { var t; return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((n) => e.test(n.brand))) || e.test(window.navigator.userAgent); } function qa(e) { var t; return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1; } function gl(e) { let t = null; return () => (t == null && (t = e()), t); } const Ka = gl(function() { return qa(/^Mac/i); }), Ya = gl(function() { return Ga(/Android/i); }); function hl() { let e = k(/* @__PURE__ */ new Map()), t = oe((o, i, l, s) => { let a = s != null && s.once ? (...u) => { e.current.delete(l), l(...u); } : l; e.current.set(l, { type: i, eventTarget: o, fn: a, options: s }), o.addEventListener(i, a, s); }, []), n = oe((o, i, l, s) => { var a; let u = ((a = e.current.get(l)) === null || a === void 0 ? void 0 : a.fn) || l; o.removeEventListener(i, u, s), e.current.delete(l); }, []), r = oe(() => { e.current.forEach((o, i) => { n(o.eventTarget, o.type, i, o.options); }); }, [ n ]); return re(() => r, [ r ]), { addGlobalListener: t, removeGlobalListener: n, removeAllGlobalListeners: r }; } function Xa(e) { return e.mozInputSource === 0 && e.isTrusted ? !0 : Ya() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType; } function vl(e) { let t = e; return t.nativeEvent = e, t.isDefaultPrevented = () => t.defaultPrevented, t.isPropagationStopped = () => t.cancelBubble, t.persist = () => { }, t; } function Za(e, t) { Object.defineProperty(e, "target", { value: t }), Object.defineProperty(e, "currentTarget", { value: t }); } function wl(e) { let t = k({ isFocused: !1, observer: null }); fl(() => { const r = t.current; return () => { r.observer && (r.observer.disconnect(), r.observer = null); }; }, []); let n = ja((r) => { e == null || e(r); }); return oe((r) => { if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) { t.current.isFocused = !0; let o = r.target, i = (l) => { if (t.current.isFocused = !1, o.disabled) { let s = vl(l); n(s); } t.current.observer && (t.current.observer.disconnect(), t.current.observer = null); }; o.addEventListener("focusout", i, { once: !0 }), t.current.observer = new MutationObserver(() => { if (t.current.isFocused && o.disabled) { var l; (l = t.current.observer) === null || l === void 0 || l.disconnect(); let s = o === document.activeElement ? null : document.activeElement; o.dispatchEvent(new FocusEvent("blur", { relatedTarget: s })), o.dispatchEvent(new FocusEvent("focusout", { bubbles: !0, relatedTarget: s })); } }), t.current.observer.observe(o, { attributes: !0, attributeFilter: [ "disabled" ] }); } }, [ n ]); } let Ja = !1, pn = null, Ir = /* @__PURE__ */ new Set(), nn = /* @__PURE__ */ new Map(), St = !1, Or = !1; const Qa = { Tab: !0, Escape: !0 }; function po(e, t) { for (let n of Ir) n(e, t); } function eu(e) { return !(e.metaKey || !Ka() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta"); } function An(e) { St = !0, eu(e) && (pn = "keyboard", po("keyboard", e)); } function kt(e) { pn = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (St = !0, po("pointer", e)); } function bl(e) { Xa(e) && (St = !0, pn = "virtual"); } function yl(e) { e.target === window || e.target === document || Ja || !e.isTrusted || (!St && !Or && (pn = "virtual", po("virtual", e)), St = !1, Or = !1); } function xl() { St = !1, Or = !0; } function Mr(e) { if (typeof window > "u" || nn.get(bt(e))) return; const t = bt(e), n = gt(e); let r = t.HTMLElement.prototype.focus; t.HTMLElement.prototype.focus = function() { St = !0, r.apply(this, arguments); }, n.addEventListener("keydown", An, !0), n.addEventListener("keyup", An, !0), n.addEventListener("click", bl, !0), t.addEventListener("focus", yl, !0), t.addEventListener("blur", xl, !1), typeof PointerEvent < "u" && (n.addEventListener("pointerdown", kt, !0), n.addEventListener("pointermove", kt, !0), n.addEventListener("pointerup", kt, !0)), t.addEventListener("beforeunload", () => { _l(e); }, { once: !0 }), nn.set(t, { focus: r }); } const _l = (e, t) => { const n = bt(e), r = gt(e); t && r.removeEventListener("DOMContentLoaded", t), nn.has(n) && (n.HTMLElement.prototype.focus = nn.get(n).focus, r.removeEventListener("keydown", An, !0), r.removeEventListener("keyup", An, !0), r.removeEventListener("click", bl, !0), n.removeEventListener("focus", yl, !0), n.removeEventListener("blur", xl, !1), typeof PointerEvent < "u" && (r.removeEventListener("pointerdown", kt, !0), r.removeEventListener("pointermove", kt, !0), r.removeEventListener("pointerup", kt, !0)), nn.delete(n)); }; function tu(e) { const t = gt(e); let n; return t.readyState !== "loading" ? Mr(e) : (n = () => { Mr(e); }, t.addEventListener("DOMContentLoaded", n)), () => _l(e, n); } typeof document < "u" && tu(); function Sl() { return pn !== "pointer"; } const nu = /* @__PURE__ */ new Set([ "checkbox", "radio", "range", "color", "file", "image", "button", "submit", "reset" ]); function ru(e, t, n) { let r = gt(n == null ? void 0 : n.target); const o = typeof window < "u" ? bt(n == null ? void 0 : n.target).HTMLInputElement : HTMLInputElement, i = typeof window < "u" ? bt(n == null ? void 0 : n.target).HTMLTextAreaElement : HTMLTextAreaElement, l = typeof window < "u" ? bt(n == null ? void 0 : n.target).HTMLElement : HTMLElement, s = typeof window < "u" ? bt(n == null ? void 0 : n.target).KeyboardEvent : KeyboardEvent; return e = e || r.activeElement instanceof o && !nu.has(r.activeElement.type) || r.activeElement instanceof i || r.activeElement instanceof l && r.activeElement.isContentEditable, !(e && t === "keyboard" && n instanceof s && !Qa[n.key]); } function ou(e, t, n) { Mr(), re(() => { let r = (o, i) => { ru(!!(n != null && n.isTextInput), o, i) && e(Sl()); }; return Ir.add(r), () => { Ir.delete(r); }; }, t); } function iu(e) { let { isDisabled: t, onFocus: n, onBlur: r, onFocusChange: o } = e; const i = oe((a) => { if (a.target === a.currentTarget) return r && r(a), o && o(!1), !0; }, [ r, o ]), l = wl(i), s = oe((a) => { const u = gt(a.target), c = u ? Tr(u) : Tr(); a.target === a.currentTarget && c === ml(a.nativeEvent) && (n && n(a), o && o(!0), l(a)); }, [ o, n, l ]); return { focusProps: { onFocus: !t && (n || o || r) ? s : void 0, onBlur: !t && (r || o) ? i : void 0 } }; } function lu(e) { let { isDisabled: t, onBlurWithin: n, onFocusWithin: r, onFocusWithinChange: o } = e, i = k({ isFocusWithin: !1 }), { addGlobalListener: l, removeAllGlobalListeners: s } = hl(), a = oe((p) => { p.currentTarget.contains(p.target) && i.current.isFocusWithin && !p.currentTarget.contains(p.relatedTarget) && (i.current.isFocusWithin = !1, s(), n && n(p), o && o(!1)); }, [ n, o, i, s ]), u = wl(a), c = oe((p) => { if (!p.currentTarget.contains(p.target)) return; const g = gt(p.target), d = Tr(g); if (!i.current.isFocusWithin && d === ml(p.nativeEvent)) { r && r(p), o && o(!0), i.current.isFocusWithin = !0, u(p); let m = p.currentTarget; l(g, "focus", (h) => { if (i.current.isFocusWithin && !pl(m, h.target)) { let w = new g.defaultView.FocusEvent("blur", { relatedTarget: h.target }); Za(w, m); let _ = vl(w); a(_); } }, { capture: !0 }); } }, [ r, o, u, l, a ]); return t ? { focusWithinProps: { // These cannot be null, that would conflict in mergeProps onFocus: void 0, onBlur: void 0 } } : { focusWithinProps: { onFocus: c, onBlur: a } }; } let Fr = !1, ar = 0; function su() { Fr = !0, setTimeout(() => { Fr = !1; }, 50); } function ni(e) { e.pointerType === "touch" && su(); } function au() { if (!(typeof document > "u")) return typeof PointerEvent < "u" && document.addEventListener("pointerup", ni), ar++, () => { ar--, !(ar > 0) && typeof PointerEvent < "u" && document.removeEventListener("pointerup", ni); }; } function Cl(e) { let { onHoverStart: t, onHoverChange: n, onHoverEnd: r, isDisabled: o } = e, [i, l] = U(!1), s = k({ isHovered: !1, ignoreEmulatedMouseEvents: !1, pointerType: "", target: null }).current; re(au, []); let { addGlobalListener: a, removeAllGlobalListeners: u } = hl(), { hoverProps: c, triggerHoverEnd: p } = W(() => { let g = (h, w) => { if (s.pointerType = w, o || w === "touch" || s.isHovered || !h.currentTarget.contains(h.target)) return; s.isHovered = !0; let _ = h.currentTarget; s.target = _, a(gt(h.target), "pointerover", (S) => { s.isHovered && s.target && !pl(s.target, S.target) && d(S, S.pointerType); }, { capture: !0 }), t && t({ type: "hoverstart", target: _, pointerType: w }), n && n(!0), l(!0); }, d = (h, w) => { let _ = s.target; s.pointerType = "", s.target = null, !(w === "touch" || !s.isHovered || !_) && (s.isHovered = !1, u(), r && r({ type: "hoverend", target: _, pointerType: w }), n && n(!1), l(!1)); }, m = {}; return typeof PointerEvent < "u" && (m.onPointerEnter = (h) => { Fr && h.pointerType === "mouse" || g(h, h.pointerType); }, m.onPointerLeave = (h) => { !o && h.currentTarget.contains(h.target) && d(h, h.pointerType); }), { hoverProps: m, triggerHoverEnd: d }; }, [ t, n, r, o, s, a, u ]); return re(() => { o && p({ currentTarget: s.target }, s.pointerType); }, [ o ]), { hoverProps: c, isHovered: i }; } function El(e = {}) { let { autoFocus: t = !1, isTextInput: n, within: r } = e, o = k({ isFocused: !1, isFocusVisible: t || Sl() }), [i, l] = U(!1), [s, a] = U(() => o.current.isFocused && o.current.isFocusVisible), u = oe(() => a(o.current.isFocused && o.current.isFocusVisible), []), c = oe((d) => { o.current.isFocused = d, l(d), u(); }, [ u ]); ou((d) => { o.current.isFocusVisible = d, u(); }, [], { isTextInput: n }); let { focusProps: p } = iu({ isDisabled: r, onFocusChange: c }), { focusWithinProps: g } = lu({ isDisabled: !r, onFocusWithinChange: c }); return { isFocused: i, isFocusVisible: s, focusProps: r ? g : p }; } var uu = Object.defineProperty, cu = (e, t, n) => t in e ? uu(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, ur = (e, t, n) => (cu(e, typeof t != "symbol" ? t + "" : t, n), n); let du = class { constructor() { ur(this, "current", this.detect()), ur(this, "handoffState", "pending"), ur(this, "currentId", 0); } set(t) { this.current !== t && (this.handoffState = "pending", this.currentId = 0, this.current = t); } reset() { this.set(this.detect()); } nextId() { return ++this.currentId; } get isServer() { return this.current === "server"; } get isClient() { return this.current === "client"; } detect() { return typeof window > "u" || typeof document > "u" ? "server" : "client"; } handoff() { this.handoffState === "pending" && (this.handoffState = "complete"); } get isHandoffComplete() { return this.handoffState === "complete"; } }, xt = new du(); function Ut(e) { return xt.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document; } function jn(e) { typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => { throw t; })); } function Ye() { let e = [], t = { addEventListener(n, r, o, i) { return n.addEventListener(r, o, i), t.add(() => n.removeEventListener(r, o, i)); }, requestAnimationFrame(...n) { let r = requestAnimationFrame(...n); return t.add(() => cancelAnimationFrame(r)); }, nextFrame(...n) { return t.requestAnimationFrame(() => t.requestAnimationFrame(...n)); }, setTimeout(...n) { let r = setTimeout(...n); return t.add(() => clearTimeout(r)); }, microTask(...n) { let r = { current: !0 }; return jn(() => { r.current && n[0](); }), t.add(() => { r.current = !1; }); }, style(n, r, o) { let i = n.style.getPropertyValue(r); return Object.assign(n.style, { [r]: o }), this.add(() => { Object.assign(n.style, { [r]: i }); }); }, group(n) { let r = Ye(); return n(r), this.add(() => r.dispose()); }, add(n) { return e.includes(n) || e.push(n), () => { let r = e.indexOf(n); if (r >= 0) for (let o of e.splice(r, 1)) o(); }; }, dispose() { for (let n of e.splice(0)) n(); } }; return t; } function Tt() { let [e] = U(Ye); return re(() => () => e.dispose(), [e]), e; } let ue = (e, t) => { xt.isServer ? re(e, t) : Ze(e, t); }; function ht(e) { let t = k(e); return ue(() => { t.current = e; }, [e]), t; } let j = function(e) { let t = ht(e); return D.useCallback((...n) => t.current(...n), [t]); }; function fu(e) { let t = e.width / 2, n = e.height / 2; return { top: e.clientY - n, right: e.clientX + t, bottom: e.clientY + n, left: e.clientX - t }; } function pu(e, t) { return !(!e || !t || e.right < t.left || e.left > t.right || e.bottom < t.top || e.top > t.bottom); } function mu({ disabled: e = !1 } = {}) { let t = k(null), [n, r] = U(!1), o = Tt(), i = j(() => { t.current = null, r(!1), o.dispose(); }), l = j((s) => { if (o.dispose(), t.current === null) { t.current = s.currentTarget, r(!0); { let a = Ut(s.currentTarget); o.addEventListener(a, "pointerup", i, !1), o.addEventListener(a, "pointermove", (u) => { if (t.current) { let c = fu(u); r(pu(c, t.current.getBoundingClientRect())); } }, !1), o.addEventListener(a, "pointercancel", i, !1); } } }); return { pressed: n, pressProps: e ? {} : { onPointerDown: l, onPointerUp: i, onClick: i } }; } let gu = fe(void 0); function mo() { return se(gu); } function Pr(...e) { return Array.from(new Set(e.flatMap((t) => typeof t == "string" ? t.split(" ") : []))).filter(Boolean).join(" "); } function ke(e, t, ...n) { if (e in t) { let o = t[e]; return typeof o == "function" ? o(...n) : o; } let r = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((o) => `"${o}"`).join(", ")}.`); throw Error.captureStackTrace && Error.captureStackTrace(r, ke), r; } var Ht = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(Ht || {}), at = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(at || {}); function Se() { let e = vu(); return oe((t) => hu({ mergeRefs: e, ...t }), [e]); } function hu({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: o, visible: i = !0, name: l, mergeRefs: s }) { s = s ?? wu; let a = Rl(t, e); if (i) return Sn(a, n, r, l, s); let u = o ?? 0; if (u & 2) { let { static: c = !1, ...p } = a; if (c) return Sn(p, n, r, l, s); } if (u & 1) { let { unmount: c = !0, ...p } = a; return ke(c ? 0 : 1, { 0() { return null; }, 1() { return Sn({ ...p, hidden: !0, style: { display: "none" } }, n, r, l, s); } }); } return Sn(a, n, r, l, s); } function Sn(e, t = {}, n, r, o) { let { as: i = n, children: l, refName: s = "ref", ...a } = cr(e, ["unmount", "static"]), u = e.ref !== void 0 ? { [s]: e.ref } : {}, c = typeof l == "function" ? l(t) : l; "className" in a && a.className && typeof a.className == "function" && (a.className = a.className(t)), a["aria-labelledby"] && a["aria-labelledby"] === a.id && (a["aria-labelledby"] = void 0); let p = {}; if (t) { let g = !1, d = []; for (let [m, h] of Object.entries(t)) typeof h == "boolean" && (g = !0), h === !0 && d.push(m.replace(/([A-Z])/g, (w) => `-${w.toLowerCase()}`)); if (g) { p["data-headlessui-state"] = d.join(" "); for (let m of d) p[`data-${m}`] = ""; } } if (i === ve && (Object.keys(st(a)).length > 0 || Object.keys(st(p)).length > 0)) if (!jt(c) || Array.isArray(c) && c.length > 1) { if (Object.keys(st(a)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(st(a)).concat(Object.keys(st(p))).map((g) => ` - ${g}`).join(` `), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((g) => ` - ${g}`).join(` `)].join(` `)); } else { let g = c.props, d = g == null ? void 0 : g.className, m = typeof d == "function" ? (..._) => Pr(d(..._), a.className) : Pr(d, a.className), h = m ? { className: m } : {}, w = Rl(c.props, st(cr(a, ["ref"]))); for (let _ in p) _ in w && delete p[_]; return uo(c, Object.assign({}, w, p, u, { ref: o(bu(c), u.ref) }, h)); } return F(i, Object.assign({}, cr(a, ["ref"]), i !== ve && u, i !== ve && p), c); } function vu() { let e = k([]), t = oe((n) => { for (let r of e.current) r != null && (typeof r == "function" ? r(n) : r.current = n); }, []); return (...n) => { if (!n.every((r) => r == null)) return e.current = n, t; }; } function wu(...e) { return e.every((t) => t == null) ? void 0 : (t) => { for (let n of e) n != null && (typeof n == "function" ? n(t) : n.current = t); }; } function Rl(...e) { if (e.length === 0) return {}; if (e.length === 1) return e[0]; let t = {}, n = {}; for (let r of e) for (let o in r) o.startsWith("on") && typeof r[o] == "function" ? (n[o] != null || (n[o] = []), n[o].push(r[o])) : t[o] = r[o]; if (t.disabled || t["aria-disabled"]) for (let r in n) /^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r) && (n[r] = [(o) => { var i; return (i = o == null ? void 0 : o.preventDefault) == null ? void 0 : i.call(o); }]); for (let r in n) Object.assign(t, { [r](o, ...i) { let l = n[r]; for (let s of l) { if ((o instanceof Event || (o == null ? void 0 : o.nativeEvent) instanceof Event) && o.defaultPrevented) return; s(o, ...i); } } }); return t; } function go(...e) { if (e.length === 0) return {}; if (e.length === 1) return e[0]; let t = {}, n = {}; for (let r of e) for (let o in r) o.startsWith("on") && typeof r[o] == "function" ? (n[o] != null || (n[o] = []), n[o].push(r[o])) : t[o] = r[o]; for (let r in n) Object.assign(t, { [r](...o) { let i = n[r]; for (let l of i) l == null || l(...o); } }); return t; } function xe(e) { var t; return Object.assign(ce(e), { displayName: (t = e.displayName) != null ? t : e.name }); } function st(e) { let t = Object.assign({}, e); for (let n in t) t[n] === void 0 && delete t[n]; return t; } function cr(e, t = []) { let n = Object.assign({}, e); for (let r of t) r in n && delete n[r]; return n; } function bu(e) { return D.version.split(".")[0] >= "19" ? e.props.ref : e.ref; } function yu(e, t, n) { let [r, o] = U(n), i = e !== void 0, l = k(i), s = k(!1), a = k(!1); return i && !l.current && !s.current ? (s.current = !0, l.current = i, console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")) : !i && l.current && !a.current && (a.current = !0, l.current = i, console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")), [i ? e : r, j((u) => (i || o(u), t == null ? void 0 : t(u)))]; } function xu(e) { let [t] = U(e); return t; } function $l(e = {}, t = null, n = []) { for (let [r, o] of Object.entries(e)) Il(n, Tl(t, r), o); return n; } function Tl(e, t) { return e ? e + "[" + t + "]" : t; } function Il(e, t, n) { if (Array.isArray(n)) for (let [r, o] of n.entries()) Il(e, Tl(t, r.toString()), o); else n instanceof Date ? e.push([t, n.toISOString()]) : typeof n == "boolean" ? e.push([t, n ? "1" : "0"]) : typeof n == "string" ? e.push([t, n]) : typeof n == "number" ? e.push([t, `${n}`]) : n == null ? e.push([t, ""]) : $l(n, t, e); } let _u = "span"; var zt = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(zt || {}); function Su(e, t) { var n; let { features: r = 1, ...o } = e, i = { ref: t, "aria-hidden": (r & 2) === 2 ? !0 : (n = o["aria-hidden"]) != null ? n : void 0, hidden: (r & 4) === 4 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(r & 4) === 4 && (r & 2) !== 2 && { display: "none" } } }; return Se()({ ourProps: i, theirProps: o, slot: {}, defaultTag: _u, name: "Hidden" }); } let sn = xe(Su), Cu = fe(null); function Eu({ children: e }) { let t = se(Cu); if (!t) return D.createElement(D.Fragment, null, e); let { target: n } = t; return n ? fn(D.createElement(D.Fragment, null, e), n) : null; } function Ru({ data: e, form: t, disabled: n, onReset: r, overrides: o }) { let [i, l] = U(null), s = Tt(); return re(() => { if (r && i) return s.addEventListener(i, "reset", r); }, [i, t, r]), D.createElement(Eu, null, D.createElement($u, { setForm: l, formId: t }), $l(e).map(([a, u]) => D.createElement(sn, { features: zt.Hidden, ...st({ key: a, as: "input", type: "hidden", hidden: !0, readOnly: !0, form: t, disabled: n, name: a, value: u, ...o }) }))); } function $u({ setForm: e, formId: t }) { return re(() => { if (t) { let n = document.getElementById(t); n && e(n); } }, [e, t]), t ? null : D.createElement(sn, { features: zt.Hidden, as: "input", type: "hidden", hidden: !0, readOnly: !0, ref: (n) => { if (!n) return; let r = n.closest("form"); r && e(r); } }); } let Tu = fe(void 0); function Ol() { return se(Tu); } function Iu(e) { let t = e.parentElement, n = null; for (; t && !(t instanceof HTMLFieldSetElement); ) t instanceof HTMLLegendElement && (n = t), t = t.parentElement; let r = (t == null ? void 0 : t.getAttribute("disabled")) === ""; return r && Ou(n) ? !1 : r; } function Ou(e) { if (!e) return !1; let t = e.previousElementSibling; for (; t !== null; ) { if (t instanceof HTMLLegendElement) return !1; t = t.previousElementSibling; } re