PageSourceSearch

https://amulai.in/assets/index-CyyIhpJ6.js

js amulai.in collected 2026-10-08 02:00:26 UTC 4,494 bytes, 104 lines download raw bytes

1import { r, a2 as p } from "./index-R4mJxZbd.js";
2import { u as M } from "./cn-Dd5iCqLA.js";
3function L(n, e, { checkForDefaultPrevented: t = true } = {}) {
4  return function(s) {
5    if (n == null ? void 0 : n(s), t === false || !s.defaultPrevented) return e == null ? void 0 : e(s);
6  };
7}
8var g = (globalThis == null ? void 0 : globalThis.document) ? r.useLayoutEffect : () => {
9}, S = p[" useId ".trim().toString()] || (() => {
10}), y = 0;
11function D(n) {
12  const [e, t] = r.useState(S());
13  return g(() => {
14    t((o) => o ?? String(y++));
15  }, [n]), n || (e ? `radix-${e}` : "");
16}
17function h(n, e) {
18  return r.useReducer((t, o) => e[t][o] ?? t, n);
19}
20var O = (n) => {
21  const { present: e, children: t } = n, o = I(e), s = typeof t == "function" ? t({ present: o.isPresent }) : r.Children.only(t), c = M(o.ref, P(s));
22  return typeof t == "function" || o.isPresent ? r.cloneElement(s, { ref: c }) : null;
23};
24O.displayName = "Presence";
25function I(n) {
26  const [e, t] = r.useState(), o = r.useRef(null), s = r.useRef(n), c = r.useRef("none"), m = n ? "mounted" : "unmounted", [a, f] = h(m, { mounted: { UNMOUNT: "unmounted", ANIMATION_OUT: "unmountSuspended" }, unmountSuspended: { MOUNT: "mounted", ANIMATION_END: "unmounted" }, unmounted: { MOUNT: "mounted" } });
27  return r.useEffect(() => {
28    const i = v(o.current);
29    c.current = a === "mounted" ? i : "none";
30  }, [a]), g(() => {
31    const i = o.current, u = s.current;
32    if (u !== n) {
33      const N = c.current, d = v(i);
34      n ? f("MOUNT") : d === "none" || (i == null ? void 0 : i.display) === "none" ? f("UNMOUNT") : f(u && N !== d ? "ANIMATION_OUT" : "UNMOUNT"), s.current = n;
35    }
36  }, [n, f]), g(() => {
37    if (e) {
38      let i;
39      const u = e.ownerDocument.defaultView ?? window, l = (d) => {
40        const E = v(o.current).includes(CSS.escape(d.animationName));
41        if (d.target === e && E && (f("ANIMATION_END"), !s.current)) {
42          const R = e.style.animationFillMode;
43          e.style.animationFillMode = "forwards", i = u.setTimeout(() => {
44            e.style.animationFillMode === "forwards" && (e.style.animationFillMode = R);
45          });
46        }
47      }, N = (d) => {
48        d.target === e && (c.current = v(o.current));
49      };
50      return e.addEventListener("animationstart", N), e.addEventListener("animationcancel", l), e.addEventListener("animationend", l), () => {
51        u.clearTimeout(i), e.removeEventListener("animationstart", N), e.removeEventListener("animationcancel", l), e.removeEventListener("animationend", l);
52      };
53    } else f("ANIMATION_END");
54  }, [e, f]), { isPresent: ["mounted", "unmountSuspended"].includes(a), ref: r.useCallback((i) => {
55    o.current = i ? getComputedStyle(i) : null, t(i);
56  }, []) };
57}
58function v(n) {
59  return (n == null ? void 0 : n.animationName) || "none";
60}
61function P(n) {
62  var _a, _b;
63  let e = (_a = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : _a.get, t = e && "isReactWarning" in e && e.isReactWarning;
64  return t ? n.ref : (e = (_b = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : _b.get, t = e && "isReactWarning" in e && e.isReactWarning, t ? n.props.ref : n.props.ref || n.ref);
65}
66var T = p[" useInsertionEffect ".trim().toString()] || g;
67function F({ prop: n, defaultProp: e, onChange: t = () => {
68}, caller: o }) {
69  const [s, c, m] = w({ defaultProp: e, onChange: t }), a = n !== void 0, f = a ? n : s;
70  {
71    const u = r.useRef(n !== void 0);
72    r.useEffect(() => {
73      const l = u.current;
74      l !== a && console.warn(`${o} is changing from ${l ? "controlled" : "uncontrolled"} to ${a ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`), u.current = a;
75    }, [a, o]);
76  }
77  const i = r.useCallback((u) => {
78    var _a;
79    if (a) {
80      const l = C(u) ? u(n) : u;
81      l !== n && ((_a = m.current) == null ? void 0 : _a.call(m, l));
82    } else c(u);
83  }, [a, n, c, m]);
84  return [f, i];
85}
86function w({ defaultProp: n, onChange: e }) {
87  const [t, o] = r.useState(n), s = r.useRef(t), c = r.useRef(e);
88  return T(() => {
89    c.current = e;
90  }, [e]), r.useEffect(() => {
91    var _a;
92    s.current !== t && ((_a = c.current) == null ? void 0 : _a.call(c, t), s.current = t);
93  }, [t, s]), [t, o, c];
94}
95function C(n) {
96  return typeof n == "function";
97}
98export {
99  O as P,
100  D as a,
101  g as b,
102  L as c,
103  F as u
104};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.