UNPKG

smart-chat-asp

Version:

smartChat component

87 lines (86 loc) 4.94 kB
import { w as ln, c as O } from "./path-428ebac9.mjs"; import { br as rn, bs as G, bt as P, bu as an, bv as y, aD as tn, bw as K, bx as _, by as un, bz as o, bA as sn, bB as on, bC as fn } from "./lib-abebf4b0.mjs"; function cn(l) { return l.innerRadius; } function yn(l) { return l.outerRadius; } function gn(l) { return l.startAngle; } function mn(l) { return l.endAngle; } function pn(l) { return l && l.padAngle; } function xn(l, h, z, D, v, A, S, r) { var B = z - l, i = D - h, n = S - v, m = r - A, a = m * B - n * i; if (!(a * a < y)) return a = (n * (h - A) - m * (l - v)) / a, [l + a * B, h + a * i]; } function V(l, h, z, D, v, A, S) { var r = l - z, B = h - D, i = (S ? A : -A) / K(r * r + B * B), n = i * B, m = -i * r, a = l + n, s = h + m, f = z + n, c = D + m, j = (a + f) / 2, t = (s + c) / 2, p = f - a, g = c - s, R = p * p + g * g, b = v - A, T = a * c - f * s, C = (g < 0 ? -1 : 1) * K(fn(0, b * b * R - T * T)), E = (T * g - p * C) / R, I = (-T * p - g * C) / R, w = (T * g + p * C) / R, x = (-T * p + g * C) / R, d = E - j, e = I - t, u = w - j, F = x - t; return d * d + e * e > u * u + F * F && (E = w, I = x), { cx: E, cy: I, x01: -n, y01: -m, x11: E * (v / b - 1), y11: I * (v / b - 1) }; } function vn() { var l = cn, h = yn, z = O(0), D = null, v = gn, A = mn, S = pn, r = null, B = ln(i); function i() { var n, m, a = +l.apply(this, arguments), s = +h.apply(this, arguments), f = v.apply(this, arguments) - an, c = A.apply(this, arguments) - an, j = un(c - f), t = c > f; if (r || (r = n = B()), s < a && (m = s, s = a, a = m), !(s > y)) r.moveTo(0, 0); else if (j > tn - y) r.moveTo(s * G(f), s * P(f)), r.arc(0, 0, s, f, c, !t), a > y && (r.moveTo(a * G(c), a * P(c)), r.arc(0, 0, a, c, f, t)); else { var p = f, g = c, R = f, b = c, T = j, C = j, E = S.apply(this, arguments) / 2, I = E > y && (D ? +D.apply(this, arguments) : K(a * a + s * s)), w = _(un(s - a) / 2, +z.apply(this, arguments)), x = w, d = w, e, u; if (I > y) { var F = sn(I / a * P(E)), L = sn(I / s * P(E)); (T -= F * 2) > y ? (F *= t ? 1 : -1, R += F, b -= F) : (T = 0, R = b = (f + c) / 2), (C -= L * 2) > y ? (L *= t ? 1 : -1, p += L, g -= L) : (C = 0, p = g = (f + c) / 2); } var H = s * G(p), J = s * P(p), M = a * G(b), N = a * P(b); if (w > y) { var Q = s * G(g), U = s * P(g), W = a * G(R), X = a * P(R), q; if (j < rn) if (q = xn(H, J, W, X, Q, U, M, N)) { var Y = H - q[0], Z = J - q[1], $ = Q - q[0], k = U - q[1], nn = 1 / P(on((Y * $ + Z * k) / (K(Y * Y + Z * Z) * K($ * $ + k * k))) / 2), en = K(q[0] * q[0] + q[1] * q[1]); x = _(w, (a - en) / (nn - 1)), d = _(w, (s - en) / (nn + 1)); } else x = d = 0; } C > y ? d > y ? (e = V(W, X, H, J, s, d, t), u = V(Q, U, M, N, s, d, t), r.moveTo(e.cx + e.x01, e.cy + e.y01), d < w ? r.arc(e.cx, e.cy, d, o(e.y01, e.x01), o(u.y01, u.x01), !t) : (r.arc(e.cx, e.cy, d, o(e.y01, e.x01), o(e.y11, e.x11), !t), r.arc(0, 0, s, o(e.cy + e.y11, e.cx + e.x11), o(u.cy + u.y11, u.cx + u.x11), !t), r.arc(u.cx, u.cy, d, o(u.y11, u.x11), o(u.y01, u.x01), !t))) : (r.moveTo(H, J), r.arc(0, 0, s, p, g, !t)) : r.moveTo(H, J), !(a > y) || !(T > y) ? r.lineTo(M, N) : x > y ? (e = V(M, N, Q, U, a, -x, t), u = V(H, J, W, X, a, -x, t), r.lineTo(e.cx + e.x01, e.cy + e.y01), x < w ? r.arc(e.cx, e.cy, x, o(e.y01, e.x01), o(u.y01, u.x01), !t) : (r.arc(e.cx, e.cy, x, o(e.y01, e.x01), o(e.y11, e.x11), !t), r.arc(0, 0, a, o(e.cy + e.y11, e.cx + e.x11), o(u.cy + u.y11, u.cx + u.x11), t), r.arc(u.cx, u.cy, x, o(u.y11, u.x11), o(u.y01, u.x01), !t))) : r.arc(0, 0, a, b, R, t); } if (r.closePath(), n) return r = null, n + "" || null; } return i.centroid = function() { var n = (+l.apply(this, arguments) + +h.apply(this, arguments)) / 2, m = (+v.apply(this, arguments) + +A.apply(this, arguments)) / 2 - rn / 2; return [G(m) * n, P(m) * n]; }, i.innerRadius = function(n) { return arguments.length ? (l = typeof n == "function" ? n : O(+n), i) : l; }, i.outerRadius = function(n) { return arguments.length ? (h = typeof n == "function" ? n : O(+n), i) : h; }, i.cornerRadius = function(n) { return arguments.length ? (z = typeof n == "function" ? n : O(+n), i) : z; }, i.padRadius = function(n) { return arguments.length ? (D = n == null ? null : typeof n == "function" ? n : O(+n), i) : D; }, i.startAngle = function(n) { return arguments.length ? (v = typeof n == "function" ? n : O(+n), i) : v; }, i.endAngle = function(n) { return arguments.length ? (A = typeof n == "function" ? n : O(+n), i) : A; }, i.padAngle = function(n) { return arguments.length ? (S = typeof n == "function" ? n : O(+n), i) : S; }, i.context = function(n) { return arguments.length ? (r = n ?? null, i) : r; }, i; } export { vn as a };