MCPcopy
hub / github.com/vercel/next.js / it

Function it

packages/next/src/compiled/@vercel/og/index.node.js:19309–19338  ·  view source on GitHub ↗
({ left: A, top: e, width: t, height: r }, n, i)

Source from the content-addressed store, hash-verified

19307 return [H("clipPath", { id: u2 }, H(t, { x: r, y: n, width: i, height: o, d: e || void 0 })), u2];
19308}
19309function it({ left: A, top: e, width: t, height: r }, n, i) {
19310 let { borderTopLeftRadius: o, borderTopRightRadius: a, borderBottomLeftRadius: u2, borderBottomRightRadius: l2, fontSize: I } = n, E, C, d2, p;
19311 if ([E, o] = un(o, t, r, I, n), [C, a] = un(a, t, r, I, n), [d2, u2] = un(u2, t, r, I, n), [p, l2] = un(l2, t, r, I, n), !i && !In(o) && !In(a) && !In(u2) && !In(l2))
19312 return "";
19313 o ||= [0, 0], a ||= [0, 0], u2 ||= [0, 0], l2 ||= [0, 0], [o[0], a[0]] = an(o[0], a[0], t), [u2[0], l2[0]] = an(u2[0], l2[0], t), [o[1], u2[1]] = an(o[1], u2[1], r), [a[1], l2[1]] = an(a[1], l2[1], r), E && gn(o), C && gn(a), d2 && gn(u2), p && gn(l2);
19314 let y = [];
19315 y[0] = [a, a], y[1] = [l2, [-l2[0], l2[1]]], y[2] = [u2, [-u2[0], -u2[1]]], y[3] = [o, [o[0], -o[1]]];
19316 let k = `h${t - o[0] - a[0]} a${y[0][0]} 0 0 1 ${y[0][1]}`, x2 = `v${r - a[1] - l2[1]} a${y[1][0]} 0 0 1 ${y[1][1]}`, F = `h${l2[0] + u2[0] - t} a${y[2][0]} 0 0 1 ${y[2][1]}`, b = `v${u2[1] + o[1] - r} a${y[3][0]} 0 0 1 ${y[3][1]}`;
19317 if (i) {
19318 let M = function(dA) {
19319 let sA = Kl([o, a, l2, u2][dA]);
19320 return dA === 0 ? [[A + o[0] - sA, e + o[1] - sA], [A + o[0], e]] : dA === 1 ? [[A + t - a[0] + sA, e + a[1] - sA], [A + t, e + a[1]]] : dA === 2 ? [[A + t - l2[0] + sA, e + r - l2[1] + sA], [A + t - l2[0], e + r]] : [[A + u2[0] - sA, e + r - u2[1] + sA], [A, e + r - u2[1]]];
19321 }, v2 = i.indexOf(false);
19322 if (!i.includes(true))
19323 throw new Error("Invalid `partialSides`.");
19324 if (v2 === -1)
19325 v2 = 0;
19326 else
19327 for (; !i[v2]; )
19328 v2 = (v2 + 1) % 4;
19329 let L = "", O = M(v2), J = `M${O[0]} A${y[(v2 + 3) % 4][0]} 0 0 1 ${O[1]}`, j = 0;
19330 for (; j < 4 && i[(v2 + j) % 4]; j++)
19331 L += J + " ", J = [k, x2, F, b][(v2 + j) % 4];
19332 let CA = (v2 + j) % 4;
19333 L += J.split(" ")[0];
19334 let MA = M(CA);
19335 return L += ` A${y[(CA + 3) % 4][0]} 0 0 1 ${MA[0]}`, L;
19336 }
19337 return `M${A + o[0]},${e} ${k} ${x2} ${F} ${b}`;
19338}
19339function Ea(A, e, t) {
19340 return t[A + "Width"] === t[e + "Width"] && t[A + "Style"] === t[e + "Style"] && t[A + "Color"] === t[e + "Color"];
19341}

Callers 15

ArFunction · 0.70
u2Function · 0.70
trFunction · 0.70
middleware.test.tsFile · 0.50
rewrites.test.tsFile · 0.50
redirects.test.tsFile · 0.50
i18n.test.tsFile · 0.50

Calls 8

unFunction · 0.85
gnFunction · 0.85
includesMethod · 0.80
splitMethod · 0.80
InFunction · 0.70
anFunction · 0.70
MFunction · 0.70
indexOfMethod · 0.45

Tested by

no test coverage detected