Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

594 lines
19 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: 334606b5978d0903.36ee2c232b.js
* Module id: 88112
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
e.i(23741);
var t = e.i(511334),
r = e.i(358379),
n = e.i(484274);
e.i(992734);
var a = e.i(54168),
i = e.i(624977),
o = e.i(573442),
l = e.i(389524),
s = r.createContext(null),
u = (function () {
if ("u" > typeof Map) return Map;
function e(e, t) {
var r = -1;
return (
e.some(function (e, n) {
return e[0] === t && ((r = n), !0);
}),
r
);
}
function t() {
this.__entries__ = [];
}
return (
Object.defineProperty(t.prototype, "size", {
get: function () {
return this.__entries__.length;
},
enumerable: !0,
configurable: !0,
}),
(t.prototype.get = function (t) {
var r = e(this.__entries__, t),
n = this.__entries__[r];
return n && n[1];
}),
(t.prototype.set = function (t, r) {
var n = e(this.__entries__, t);
~n ? (this.__entries__[n][1] = r) : this.__entries__.push([t, r]);
}),
(t.prototype.delete = function (t) {
var r = this.__entries__,
n = e(r, t);
~n && r.splice(n, 1);
}),
(t.prototype.has = function (t) {
return !!~e(this.__entries__, t);
}),
(t.prototype.clear = function () {
this.__entries__.splice(0);
}),
(t.prototype.forEach = function (e, t) {
void 0 === t && (t = null);
for (var r = 0, n = this.__entries__; r < n.length; r++) {
var a = n[r];
e.call(t, a[1], a[0]);
}
}),
t
);
})(),
c =
"u" > typeof window &&
"u" > typeof document &&
window.document === document,
f =
e.g.Math === Math
? e.g
: "u" > typeof self && self.Math === Math
? self
: "u" > typeof window && window.Math === Math
? window
: Function("return this")(),
d =
"function" == typeof requestAnimationFrame
? requestAnimationFrame.bind(f)
: function (e) {
return setTimeout(function () {
return e(Date.now());
}, 1e3 / 60);
},
p = [
"top",
"right",
"bottom",
"left",
"width",
"height",
"size",
"weight",
],
m = "u" > typeof MutationObserver,
h = (function () {
function e() {
(this.connected_ = !1),
(this.mutationEventsAdded_ = !1),
(this.mutationsObserver_ = null),
(this.observers_ = []),
(this.onTransitionEnd_ = this.onTransitionEnd_.bind(this)),
(this.refresh = (function (e, t) {
var r = !1,
n = !1,
a = 0;
function i() {
r && ((r = !1), e()), n && l();
}
function o() {
d(i);
}
function l() {
var e = Date.now();
if (r) {
if (e - a < 2) return;
n = !0;
} else (r = !0), (n = !1), setTimeout(o, 20);
a = e;
}
return l;
})(this.refresh.bind(this), 0));
}
return (
(e.prototype.addObserver = function (e) {
~this.observers_.indexOf(e) || this.observers_.push(e),
this.connected_ || this.connect_();
}),
(e.prototype.removeObserver = function (e) {
var t = this.observers_,
r = t.indexOf(e);
~r && t.splice(r, 1),
!t.length && this.connected_ && this.disconnect_();
}),
(e.prototype.refresh = function () {
this.updateObservers_() && this.refresh();
}),
(e.prototype.updateObservers_ = function () {
var e = this.observers_.filter(function (e) {
return e.gatherActive(), e.hasActive();
});
return (
e.forEach(function (e) {
return e.broadcastActive();
}),
e.length > 0
);
}),
(e.prototype.connect_ = function () {
c &&
!this.connected_ &&
(document.addEventListener(
"transitionend",
this.onTransitionEnd_,
),
window.addEventListener("resize", this.refresh),
m
? ((this.mutationsObserver_ = new MutationObserver(
this.refresh,
)),
this.mutationsObserver_.observe(document, {
attributes: !0,
childList: !0,
characterData: !0,
subtree: !0,
}))
: (document.addEventListener(
"DOMSubtreeModified",
this.refresh,
),
(this.mutationEventsAdded_ = !0)),
(this.connected_ = !0));
}),
(e.prototype.disconnect_ = function () {
c &&
this.connected_ &&
(document.removeEventListener(
"transitionend",
this.onTransitionEnd_,
),
window.removeEventListener("resize", this.refresh),
this.mutationsObserver_ && this.mutationsObserver_.disconnect(),
this.mutationEventsAdded_ &&
document.removeEventListener(
"DOMSubtreeModified",
this.refresh,
),
(this.mutationsObserver_ = null),
(this.mutationEventsAdded_ = !1),
(this.connected_ = !1));
}),
(e.prototype.onTransitionEnd_ = function (e) {
var t = e.propertyName,
r = void 0 === t ? "" : t;
p.some(function (e) {
return !!~r.indexOf(e);
}) && this.refresh();
}),
(e.getInstance = function () {
return this.instance_ || (this.instance_ = new e()), this.instance_;
}),
(e.instance_ = null),
e
);
})(),
v = function (e, t) {
for (var r = 0, n = Object.keys(t); r < n.length; r++) {
var a = n[r];
Object.defineProperty(e, a, {
value: t[a],
enumerable: !1,
writable: !1,
configurable: !0,
});
}
return e;
},
g = function (e) {
return (e && e.ownerDocument && e.ownerDocument.defaultView) || f;
},
b = k(0, 0, 0, 0);
function y(e) {
return parseFloat(e) || 0;
}
function x(e) {
for (var t = [], r = 1; r < arguments.length; r++)
t[r - 1] = arguments[r];
return t.reduce(function (t, r) {
return t + y(e["border-" + r + "-width"]);
}, 0);
}
var w =
"u" > typeof SVGGraphicsElement
? function (e) {
return e instanceof g(e).SVGGraphicsElement;
}
: function (e) {
return (
e instanceof g(e).SVGElement && "function" == typeof e.getBBox
);
};
function k(e, t, r, n) {
return { x: e, y: t, width: r, height: n };
}
var C = (function () {
function e(e) {
(this.broadcastWidth = 0),
(this.broadcastHeight = 0),
(this.contentRect_ = k(0, 0, 0, 0)),
(this.target = e);
}
return (
(e.prototype.isActive = function () {
var e = (function (e) {
if (!c) return b;
if (w(e)) {
var t;
return k(0, 0, (t = e.getBBox()).width, t.height);
}
return (function (e) {
var t,
r = e.clientWidth,
n = e.clientHeight;
if (!r && !n) return b;
var a = g(e).getComputedStyle(e),
i = (function (e) {
for (
var t = {}, r = 0, n = ["top", "right", "bottom", "left"];
r < n.length;
r++
) {
var a = n[r],
i = e["padding-" + a];
t[a] = y(i);
}
return t;
})(a),
o = i.left + i.right,
l = i.top + i.bottom,
s = y(a.width),
u = y(a.height);
if (
("border-box" === a.boxSizing &&
(Math.round(s + o) !== r &&
(s -= x(a, "left", "right") + o),
Math.round(u + l) !== n &&
(u -= x(a, "top", "bottom") + l)),
(t = e) !== g(t).document.documentElement)
) {
var c = Math.round(s + o) - r,
f = Math.round(u + l) - n;
1 !== Math.abs(c) && (s -= c), 1 !== Math.abs(f) && (u -= f);
}
return k(i.left, i.top, s, u);
})(e);
})(this.target);
return (
(this.contentRect_ = e),
e.width !== this.broadcastWidth ||
e.height !== this.broadcastHeight
);
}),
(e.prototype.broadcastRect = function () {
var e = this.contentRect_;
return (
(this.broadcastWidth = e.width),
(this.broadcastHeight = e.height),
e
);
}),
e
);
})(),
E = function (e, t) {
var r,
n,
a,
i,
o,
l =
((r = t.x),
(n = t.y),
(a = t.width),
(i = t.height),
v(
(o = Object.create(
("u" > typeof DOMRectReadOnly ? DOMRectReadOnly : Object)
.prototype,
)),
{
x: r,
y: n,
width: a,
height: i,
top: n,
right: r + a,
bottom: i + n,
left: r,
},
),
o);
v(this, { target: e, contentRect: l });
},
j = (function () {
function e(e, t, r) {
if (
((this.activeObservations_ = []),
(this.observations_ = new u()),
"function" != typeof e)
)
throw TypeError(
"The callback provided as parameter 1 is not a function.",
);
(this.callback_ = e), (this.controller_ = t), (this.callbackCtx_ = r);
}
return (
(e.prototype.observe = function (e) {
if (!arguments.length)
throw TypeError("1 argument required, but only 0 present.");
if (!("u" < typeof Element) && Element instanceof Object) {
if (!(e instanceof g(e).Element))
throw TypeError('parameter 1 is not of type "Element".');
var t = this.observations_;
t.has(e) ||
(t.set(e, new C(e)),
this.controller_.addObserver(this),
this.controller_.refresh());
}
}),
(e.prototype.unobserve = function (e) {
if (!arguments.length)
throw TypeError("1 argument required, but only 0 present.");
if (!("u" < typeof Element) && Element instanceof Object) {
if (!(e instanceof g(e).Element))
throw TypeError('parameter 1 is not of type "Element".');
var t = this.observations_;
t.has(e) &&
(t.delete(e), t.size || this.controller_.removeObserver(this));
}
}),
(e.prototype.disconnect = function () {
this.clearActive(),
this.observations_.clear(),
this.controller_.removeObserver(this);
}),
(e.prototype.gatherActive = function () {
var e = this;
this.clearActive(),
this.observations_.forEach(function (t) {
t.isActive() && e.activeObservations_.push(t);
});
}),
(e.prototype.broadcastActive = function () {
if (this.hasActive()) {
var e = this.callbackCtx_,
t = this.activeObservations_.map(function (e) {
return new E(e.target, e.broadcastRect());
});
this.callback_.call(e, t, e), this.clearActive();
}
}),
(e.prototype.clearActive = function () {
this.activeObservations_.splice(0);
}),
(e.prototype.hasActive = function () {
return this.activeObservations_.length > 0;
}),
e
);
})(),
P = "u" > typeof WeakMap ? new WeakMap() : new u(),
F = function e(t) {
if (!(this instanceof e))
throw TypeError("Cannot call a class as a function.");
if (!arguments.length)
throw TypeError("1 argument required, but only 0 present.");
var r = new j(t, h.getInstance(), this);
P.set(this, r);
};
["observe", "unobserve", "disconnect"].forEach(function (e) {
F.prototype[e] = function () {
var t;
return (t = P.get(this))[e].apply(t, arguments);
};
});
var _ = void 0 !== f.ResizeObserver ? f.ResizeObserver : F,
S = new Map(),
N = new _(function (e) {
e.forEach(function (e) {
var t,
r = e.target;
null == (t = S.get(r)) ||
t.forEach(function (e) {
return e(r);
});
});
}),
O = e.i(634885),
A = e.i(914528),
M = e.i(504997),
T = e.i(483926),
$ = (function (e) {
(0, M.default)(r, e);
var t = (0, T.default)(r);
function r() {
return (0, O.default)(this, r), t.apply(this, arguments);
}
return (
(0, A.default)(r, [
{
key: "render",
value: function () {
return this.props.children;
},
},
]),
r
);
})(r.Component),
I = r.forwardRef(function (e, t) {
var n = e.children,
u = e.disabled,
c = r.useRef(null),
f = r.useRef(null),
d = r.useContext(s),
p = "function" == typeof n,
m = p ? n(c) : n,
h = r.useRef({
width: -1,
height: -1,
offsetWidth: -1,
offsetHeight: -1,
}),
v = !p && r.isValidElement(m) && (0, l.supportRef)(m),
g = v ? (0, l.getNodeRef)(m) : null,
b = (0, l.useComposeRef)(g, c),
y = function () {
var e;
return (
(0, o.default)(c.current) ||
(c.current && "object" === (0, i.default)(c.current)
? (0, o.default)(
null == (e = c.current) ? void 0 : e.nativeElement,
)
: null) ||
(0, o.default)(f.current)
);
};
r.useImperativeHandle(t, function () {
return y();
});
var x = r.useRef(e);
x.current = e;
var w = r.useCallback(function (e) {
var t = x.current,
r = t.onResize,
n = t.data,
i = e.getBoundingClientRect(),
o = i.width,
l = i.height,
s = e.offsetWidth,
u = e.offsetHeight,
c = Math.floor(o),
f = Math.floor(l);
if (
h.current.width !== c ||
h.current.height !== f ||
h.current.offsetWidth !== s ||
h.current.offsetHeight !== u
) {
var p = { width: c, height: f, offsetWidth: s, offsetHeight: u };
h.current = p;
var m = s === Math.round(o) ? o : s,
v = u === Math.round(l) ? l : u,
g = (0, a.default)(
(0, a.default)({}, p),
{},
{ offsetWidth: m, offsetHeight: v },
);
null == d || d(g, e, n),
r &&
Promise.resolve().then(function () {
r(g, e);
});
}
}, []);
return (
r.useEffect(
function () {
var e = y();
return (
e &&
!u &&
(S.has(e) || (S.set(e, new Set()), N.observe(e)),
S.get(e).add(w)),
function () {
S.has(e) &&
(S.get(e).delete(w),
!S.get(e).size && (N.unobserve(e), S.delete(e)));
}
);
},
[c.current, u],
),
r.createElement($, { ref: f }, v ? r.cloneElement(m, { ref: b }) : m)
);
}),
R = r.forwardRef(function (e, a) {
var i = e.children;
return ("function" == typeof i ? [i] : (0, n.default)(i)).map(
function (n, i) {
var o =
(null == n ? void 0 : n.key) ||
"".concat("rc-observer-key", "-").concat(i);
return r.createElement(
I,
(0, t.default)({}, e, { key: o, ref: 0 === i ? a : void 0 }),
n,
);
},
);
});
(R.Collection = function (e) {
var t = e.children,
n = e.onBatchResize,
a = r.useRef(0),
i = r.useRef([]),
o = r.useContext(s),
l = r.useCallback(
function (e, t, r) {
a.current += 1;
var l = a.current;
i.current.push({ size: e, element: t, data: r }),
Promise.resolve().then(function () {
l === a.current &&
(null == n || n(i.current), (i.current = []));
}),
null == o || o(e, t, r);
},
[n, o],
);
return r.createElement(s.Provider, { value: l }, t);
}),
e.s(["default", 0, R], 88112);
};
export default moduleFactory;