@yext/pages-components 1.0.0-rc.9 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES +2 -32
- package/dist/debugger-B7hxI1lw.cjs +1 -0
- package/dist/debugger-BZHlGtkp.js +286 -0
- package/dist/{index-B7qp2Vga.js → index-BDDHMUxc.js} +2209 -2256
- package/dist/index-CPtU5eOw.cjs +104 -0
- package/dist/{index-CNu7g_AK.js → index-DaOqO1Xz.js} +11352 -12470
- package/dist/index-De2GfwGG.cjs +45 -0
- package/dist/index.d.cts +69 -107
- package/dist/index.d.ts +69 -107
- package/dist/pages-components.cjs +1 -1
- package/dist/pages-components.js +29 -28
- package/package.json +17 -22
- package/dist/debugger-DzRFl2aD.js +0 -220
- package/dist/debugger-x0jOMtzI.cjs +0 -1
- package/dist/index-5cVqTMnt.cjs +0 -47
- package/dist/index-DJPbIPVY.cjs +0 -103
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CPtU5eOw.cjs");exports.Address=e.Address;exports.Analytics=e.Analytics;exports.AnalyticsContext=e.AnalyticsContext;exports.AnalyticsProvider=e.AnalyticsProvider;exports.AnalyticsScopeProvider=e.AnalyticsScopeProvider;exports.BaiduMaps=e.BaiduMaps;exports.BingMaps=e.BingMaps;exports.Clusterer=e.Clusterer;exports.CoordinateClass=e.Coordinate;exports.Day=e.Day;exports.GoogleMaps=e.GoogleMaps;exports.HoursStatus=e.HoursStatus;exports.HoursTable=e.HoursTable;exports.Image=e.Image;exports.ImageLayoutOption=e.ImageLayoutOption;exports.LeafletMaps=e.LeafletMaps;exports.LegacyRichText=e.LegacyRichText;exports.LexicalRichText=e.LexicalRichText;exports.Link=e.Link;exports.LinkTypes=e.LinkTypes;exports.ListingPublisherOption=e.ListingPublisherOption;exports.LocationMap=e.LocationMap;exports.Map=e.Map;exports.MapProviderOption=e.MapProviderOption;exports.MapQuestMaps=e.MapQuestMaps;exports.MapboxMaps=e.MapboxMaps;exports.Marker=e.Marker;exports.getDirections=e.getDirections;exports.useAnalytics=e.useAnalytics;exports.useClusterContext=e.useClusterContext;exports.useIdentify=e.useIdentify;exports.useMapContext=e.useMapContext;exports.usePageView=e.usePageView;exports.useScope=e.useScope;exports.useTrack=e.useTrack;
|
package/dist/pages-components.js
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { A as e, x as t, y as i, E as o, G as
|
|
1
|
+
import { A as e, x as t, y as i, E as o, G as r, Y as n, Z as p, Q as u, a2 as c, X as M, _ as l, V as y, W as x, I as L, H as d, a0 as g, U as C, T as A, J as P, K as T, L as k, S as I, N as O, M as S, a1 as b, $ as f, P as h, w as m, z as v, R as B, D, O as H, C as R, F as w, B as G } from "./index-DaOqO1Xz.js";
|
|
2
2
|
export {
|
|
3
3
|
e as Address,
|
|
4
4
|
t as Analytics,
|
|
5
5
|
i as AnalyticsContext,
|
|
6
6
|
o as AnalyticsProvider,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
r as AnalyticsScopeProvider,
|
|
8
|
+
n as BaiduMaps,
|
|
9
|
+
p as BingMaps,
|
|
10
10
|
u as Clusterer,
|
|
11
|
-
c as
|
|
12
|
-
M as
|
|
13
|
-
l as
|
|
14
|
-
y as
|
|
15
|
-
x as
|
|
16
|
-
L as
|
|
11
|
+
c as CoordinateClass,
|
|
12
|
+
M as Day,
|
|
13
|
+
l as GoogleMaps,
|
|
14
|
+
y as HoursStatus,
|
|
15
|
+
x as HoursTable,
|
|
16
|
+
L as Image,
|
|
17
|
+
d as ImageLayoutOption,
|
|
17
18
|
g as LeafletMaps,
|
|
18
|
-
|
|
19
|
+
C as LegacyRichText,
|
|
19
20
|
A as LexicalRichText,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
P as Link,
|
|
22
|
+
T as LinkTypes,
|
|
23
|
+
k as ListingPublisherOption,
|
|
24
|
+
I as LocationMap,
|
|
25
|
+
O as Map,
|
|
26
|
+
S as MapProviderOption,
|
|
27
|
+
b as MapQuestMaps,
|
|
28
|
+
f as MapboxMaps,
|
|
29
|
+
h as Marker,
|
|
30
|
+
m as getDirections,
|
|
31
|
+
v as useAnalytics,
|
|
32
|
+
B as useClusterContext,
|
|
33
|
+
D as useIdentify,
|
|
34
|
+
H as useMapContext,
|
|
35
|
+
R as usePageView,
|
|
36
|
+
w as useScope,
|
|
37
|
+
G as useTrack
|
|
37
38
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yext/pages-components",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "A React component library that supports Yext Pages development",
|
|
5
5
|
"author": "sumo@yext.com",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -49,18 +49,19 @@
|
|
|
49
49
|
"react-dom": "^17.0.2 || ^18.2.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@storybook/addon-a11y": "^
|
|
53
|
-
"@storybook/addon-essentials": "^
|
|
54
|
-
"@storybook/addon-interactions": "^
|
|
55
|
-
"@storybook/addon-links": "^
|
|
56
|
-
"@storybook/blocks": "^
|
|
57
|
-
"@storybook/react": "^
|
|
58
|
-
"@storybook/react-vite": "^
|
|
59
|
-
"@storybook/test-runner": "^0.
|
|
52
|
+
"@storybook/addon-a11y": "^8.2.4",
|
|
53
|
+
"@storybook/addon-essentials": "^8.2.4",
|
|
54
|
+
"@storybook/addon-interactions": "^8.2.4",
|
|
55
|
+
"@storybook/addon-links": "^8.2.4",
|
|
56
|
+
"@storybook/blocks": "^8.2.4",
|
|
57
|
+
"@storybook/react": "^8.2.4",
|
|
58
|
+
"@storybook/react-vite": "^8.2.4",
|
|
59
|
+
"@storybook/test-runner": "^0.19.1",
|
|
60
60
|
"@storybook/testing-library": "^0.2.2",
|
|
61
61
|
"@testing-library/react": "^14.1.2",
|
|
62
62
|
"@testing-library/user-event": "^14.5.1",
|
|
63
63
|
"@types/jest-image-snapshot": "^6.4.0",
|
|
64
|
+
"@types/mdast": "3.0.10",
|
|
64
65
|
"@types/node": "^20.10.4",
|
|
65
66
|
"@types/react": "^18.2.45",
|
|
66
67
|
"@types/react-dom": "^18.2.17",
|
|
@@ -69,18 +70,18 @@
|
|
|
69
70
|
"axe-playwright": "^1.2.3",
|
|
70
71
|
"generate-license-file": "^3.0.1",
|
|
71
72
|
"jest-image-snapshot": "^6.4.0",
|
|
72
|
-
"jsdom": "
|
|
73
|
-
"@playwright/test": "^1.
|
|
74
|
-
"playwright-core": "^1.
|
|
73
|
+
"jsdom": "^24.1.0",
|
|
74
|
+
"@playwright/test": "^1.45.2",
|
|
75
|
+
"playwright-core": "^1.45.2",
|
|
75
76
|
"prop-types": "^15.8.1",
|
|
76
77
|
"react": "^18.2.0",
|
|
77
78
|
"react-dom": "^18.2.0",
|
|
78
|
-
"storybook": "^
|
|
79
|
+
"storybook": "^8.2.4",
|
|
79
80
|
"tsup": "^8.0.1",
|
|
80
81
|
"typescript": "^5.3.3",
|
|
81
|
-
"vite": "^5.
|
|
82
|
+
"vite": "^5.3.4",
|
|
82
83
|
"vite-tsconfig-paths": "^4.2.2",
|
|
83
|
-
"vitest": "1.0
|
|
84
|
+
"vitest": "^1.6.0"
|
|
84
85
|
},
|
|
85
86
|
"dependencies": {
|
|
86
87
|
"@lexical/code": "^0.12.5",
|
|
@@ -91,8 +92,7 @@
|
|
|
91
92
|
"@lexical/rich-text": "^0.12.5",
|
|
92
93
|
"@lexical/table": "^0.12.5",
|
|
93
94
|
"@lexical/utils": "^0.12.5",
|
|
94
|
-
"@
|
|
95
|
-
"@yext/analytics": "^0.6.5",
|
|
95
|
+
"@yext/analytics": "1.0.0-beta.5",
|
|
96
96
|
"browser-or-node": "^2.1.1",
|
|
97
97
|
"classnames": "^2.3.2",
|
|
98
98
|
"cross-fetch": "^4.0.0",
|
|
@@ -110,10 +110,5 @@
|
|
|
110
110
|
"remark-rehype": "10.1.0",
|
|
111
111
|
"unified": "11.0.4",
|
|
112
112
|
"uvu": "0.5.6"
|
|
113
|
-
},
|
|
114
|
-
"overrides": {
|
|
115
|
-
"@storybook/react-vite": {
|
|
116
|
-
"vite": "^5.1.3"
|
|
117
|
-
}
|
|
118
113
|
}
|
|
119
114
|
}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { g as B, j as o, c as j } from "./index-CNu7g_AK.js";
|
|
2
|
-
import { useState as p, useEffect as k, useRef as T } from "react";
|
|
3
|
-
import { createPortal as $ } from "react-dom";
|
|
4
|
-
function H() {
|
|
5
|
-
return B().name !== "browser" || window.hasOwnProperty("debuggerInitialized") ? null : (window.debuggerInitialized = !0, $(/* @__PURE__ */ o.jsx(C, {}), document.body));
|
|
6
|
-
}
|
|
7
|
-
const m = {};
|
|
8
|
-
function C() {
|
|
9
|
-
const [e, i] = p(), [s, n] = p([]), [l, a] = p(!1), t = (r) => {
|
|
10
|
-
i(e === r ? void 0 : r);
|
|
11
|
-
};
|
|
12
|
-
return k(() => (document.documentElement.classList.add("xYextDebug"), document.querySelectorAll("[data-ya-scope]").forEach((c) => {
|
|
13
|
-
const d = c.dataset.yaScope, u = c.querySelectorAll("[data-ya-track]");
|
|
14
|
-
u.forEach((g, h) => {
|
|
15
|
-
const b = g.dataset.yaTrack;
|
|
16
|
-
g.addEventListener("mouseenter", () => {
|
|
17
|
-
n([
|
|
18
|
-
{
|
|
19
|
-
eventEl: g,
|
|
20
|
-
eventName: `${d}_${b}`,
|
|
21
|
-
key: `${d}_${b}_${h}`
|
|
22
|
-
}
|
|
23
|
-
]);
|
|
24
|
-
}), g.addEventListener("mouseleave", () => {
|
|
25
|
-
n([]);
|
|
26
|
-
});
|
|
27
|
-
}), d && (m.hasOwnProperty(d) ? m[d].events = [
|
|
28
|
-
...m[d].events,
|
|
29
|
-
...Array.from(u)
|
|
30
|
-
] : m[d] = {
|
|
31
|
-
scope: c,
|
|
32
|
-
events: Array.from(u)
|
|
33
|
-
});
|
|
34
|
-
}), a(!0), () => {
|
|
35
|
-
document.documentElement.classList.remove("xYextDebug");
|
|
36
|
-
}), []), l ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
37
|
-
/* @__PURE__ */ o.jsxs("div", { className: "analytics-debugger", children: [
|
|
38
|
-
/* @__PURE__ */ o.jsxs("div", { className: "analytics-debugger-toggles", children: [
|
|
39
|
-
/* @__PURE__ */ o.jsx(
|
|
40
|
-
"button",
|
|
41
|
-
{
|
|
42
|
-
className: j("analytics-debugger-toggle", {
|
|
43
|
-
"is-active": e === "Events"
|
|
44
|
-
}),
|
|
45
|
-
onClick: () => t("Events"),
|
|
46
|
-
children: "Events"
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
/* @__PURE__ */ o.jsx(
|
|
50
|
-
"button",
|
|
51
|
-
{
|
|
52
|
-
className: j("analytics-debugger-toggle", {
|
|
53
|
-
"is-active": e === "Scopes"
|
|
54
|
-
}),
|
|
55
|
-
onClick: () => t("Scopes"),
|
|
56
|
-
children: "Scopes"
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
] }),
|
|
60
|
-
e && /* @__PURE__ */ o.jsx("div", { className: "analytics-debugger-tabs", children: e === "Events" ? /* @__PURE__ */ o.jsx(N, { data: m, setTooltips: n }) : /* @__PURE__ */ o.jsx(Y, { data: m, setTooltips: n }) })
|
|
61
|
-
] }),
|
|
62
|
-
/* @__PURE__ */ o.jsx(R, { tooltips: s })
|
|
63
|
-
] }) : null;
|
|
64
|
-
}
|
|
65
|
-
function N(e) {
|
|
66
|
-
const { data: i, setTooltips: s } = e, [n, l] = p(), [a, t] = p(""), r = (c, d, u) => {
|
|
67
|
-
c.scrollIntoView({ behavior: "smooth", block: "nearest" }), n && n.classList.remove("analytics-event-highlight"), l(c), c.classList.add("analytics-event-highlight"), t(u), s([
|
|
68
|
-
{
|
|
69
|
-
eventEl: c,
|
|
70
|
-
eventName: d,
|
|
71
|
-
key: u
|
|
72
|
-
}
|
|
73
|
-
]);
|
|
74
|
-
};
|
|
75
|
-
return /* @__PURE__ */ o.jsxs("div", { className: "analytics-debugger-tab", children: [
|
|
76
|
-
/* @__PURE__ */ o.jsx("h2", { className: "analytics-debugger-tab-title", children: "Event Names" }),
|
|
77
|
-
/* @__PURE__ */ o.jsx("ul", { className: "analytics-debugger-list", children: Object.entries(i).map(
|
|
78
|
-
([c, d]) => d.events.map((u, g) => {
|
|
79
|
-
const h = `${c}_${u.dataset.yaTrack}`, b = `${h}_${g}`;
|
|
80
|
-
return /* @__PURE__ */ o.jsx("li", { className: "analytics-debugger-listItem", children: /* @__PURE__ */ o.jsx(
|
|
81
|
-
"button",
|
|
82
|
-
{
|
|
83
|
-
className: j("analytics-debugger-button", {
|
|
84
|
-
"is-active": b === a
|
|
85
|
-
}),
|
|
86
|
-
onClick: () => r(u, h, b),
|
|
87
|
-
children: h
|
|
88
|
-
}
|
|
89
|
-
) }, b);
|
|
90
|
-
})
|
|
91
|
-
) })
|
|
92
|
-
] });
|
|
93
|
-
}
|
|
94
|
-
function Y(e) {
|
|
95
|
-
const { data: i, setTooltips: s } = e, [n, l] = p(""), a = (t) => {
|
|
96
|
-
const r = i[t];
|
|
97
|
-
r.scope.scrollIntoView({ behavior: "smooth", block: "nearest" }), l(t), s(
|
|
98
|
-
r.events.map((c, d) => ({
|
|
99
|
-
eventEl: c,
|
|
100
|
-
eventName: `${t}_${c.dataset.yaTrack}`,
|
|
101
|
-
key: `${t}_${c.dataset.yaTrack}_${d}`
|
|
102
|
-
}))
|
|
103
|
-
);
|
|
104
|
-
};
|
|
105
|
-
return /* @__PURE__ */ o.jsxs("div", { className: "analytics-debugger-tab", children: [
|
|
106
|
-
/* @__PURE__ */ o.jsx("h2", { className: "analytics-debugger-tab-title", children: "Scope Names" }),
|
|
107
|
-
/* @__PURE__ */ o.jsx("ul", { className: "analytics-debugger-list", children: Object.keys(i).map((t, r) => /* @__PURE__ */ o.jsx("li", { className: "analytics-debugger-listItem", children: /* @__PURE__ */ o.jsx(
|
|
108
|
-
"button",
|
|
109
|
-
{
|
|
110
|
-
className: j("analytics-debugger-button", {
|
|
111
|
-
"is-active": t === n
|
|
112
|
-
}),
|
|
113
|
-
onClick: () => a(t),
|
|
114
|
-
children: t
|
|
115
|
-
}
|
|
116
|
-
) }, t + r)) })
|
|
117
|
-
] });
|
|
118
|
-
}
|
|
119
|
-
function R(e) {
|
|
120
|
-
const i = T({});
|
|
121
|
-
return k(() => {
|
|
122
|
-
if (i.current)
|
|
123
|
-
for (const s of Object.values(i.current)) {
|
|
124
|
-
const n = Object.values(i.current).map((l) => l.el).filter((l) => l !== s.el);
|
|
125
|
-
E(s, n), s.el.style.visibility = "visible";
|
|
126
|
-
}
|
|
127
|
-
}, [e.tooltips]), /* @__PURE__ */ o.jsx(o.Fragment, { children: e.tooltips.map((s) => /* @__PURE__ */ o.jsx(
|
|
128
|
-
"div",
|
|
129
|
-
{
|
|
130
|
-
style: { visibility: "hidden" },
|
|
131
|
-
className: "analytics-debugger-tooltip",
|
|
132
|
-
ref: (n) => {
|
|
133
|
-
n ? i.current[s.key] = {
|
|
134
|
-
el: n,
|
|
135
|
-
tooltip: s
|
|
136
|
-
} : delete i.current[s.key];
|
|
137
|
-
},
|
|
138
|
-
children: /* @__PURE__ */ o.jsx("span", { children: s.eventName })
|
|
139
|
-
},
|
|
140
|
-
s.key
|
|
141
|
-
)) });
|
|
142
|
-
}
|
|
143
|
-
function E(e, i) {
|
|
144
|
-
for (let s = 0; s < 9; s++) {
|
|
145
|
-
const n = L(
|
|
146
|
-
e.tooltip.eventEl.getBoundingClientRect(),
|
|
147
|
-
e.el,
|
|
148
|
-
s
|
|
149
|
-
);
|
|
150
|
-
if (e.el.style.inset = `${n.top} auto auto ${n.left}`, !!S(
|
|
151
|
-
e.el.getBoundingClientRect().left,
|
|
152
|
-
e.el.getBoundingClientRect().top + window.scrollY,
|
|
153
|
-
e.el.getBoundingClientRect().right,
|
|
154
|
-
e.el.getBoundingClientRect().bottom + window.scrollY
|
|
155
|
-
))
|
|
156
|
-
continue;
|
|
157
|
-
let a = !0;
|
|
158
|
-
for (let t = 0; t < i.length; t++) {
|
|
159
|
-
const r = i[t];
|
|
160
|
-
A(e.el, r) && (a = !1);
|
|
161
|
-
}
|
|
162
|
-
if (a)
|
|
163
|
-
break;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
function A(e, i) {
|
|
167
|
-
const s = e.getBoundingClientRect().top + window.scrollY, n = e.getBoundingClientRect().left, l = s + e.clientHeight, a = n + e.clientWidth, t = i.getBoundingClientRect().top + window.scrollY, r = i.getBoundingClientRect().left, c = t + i.clientHeight, d = r + i.clientWidth, u = (g, h, b, f, v, x, y, w) => b <= v && v <= y && f <= x && x <= w || b <= g && g <= y && f <= h && h <= w || b <= g && g <= y && f <= x && x <= w || b <= v && v <= y && f <= h && h <= w;
|
|
168
|
-
return u(n, s, r, t, a, l, d, c) || u(r, t, n, s, d, c, a, l);
|
|
169
|
-
}
|
|
170
|
-
function S(e, i, s, n) {
|
|
171
|
-
return e < 0 || s > window.innerWidth || i < 0 || n > document.documentElement.scrollHeight;
|
|
172
|
-
}
|
|
173
|
-
function L(e, i, s) {
|
|
174
|
-
const n = i.clientHeight, l = i.clientWidth;
|
|
175
|
-
let a, t;
|
|
176
|
-
switch (s) {
|
|
177
|
-
case 0: {
|
|
178
|
-
t = window.scrollY + e.top - n + "px", a = e.left - l + "px";
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
case 1: {
|
|
182
|
-
t = window.scrollY + e.top - n + "px", a = e.left + "px";
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
case 2: {
|
|
186
|
-
t = window.scrollY + e.top - n + "px", a = e.right + "px";
|
|
187
|
-
break;
|
|
188
|
-
}
|
|
189
|
-
case 3: {
|
|
190
|
-
t = window.scrollY + e.top - n + "px", a = e.right - l + "px";
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
case 4: {
|
|
194
|
-
t = window.scrollY + e.bottom + "px", a = e.left - l + "px";
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
case 5: {
|
|
198
|
-
t = window.scrollY + e.bottom + "px", a = e.left + "px";
|
|
199
|
-
break;
|
|
200
|
-
}
|
|
201
|
-
case 6: {
|
|
202
|
-
t = window.scrollY + e.bottom + "px", a = e.right - l + "px";
|
|
203
|
-
break;
|
|
204
|
-
}
|
|
205
|
-
case 7: {
|
|
206
|
-
t = window.scrollY + e.bottom + "px", a = e.right + "px";
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
|
-
default:
|
|
210
|
-
t = 0, a = 0;
|
|
211
|
-
}
|
|
212
|
-
return {
|
|
213
|
-
top: t,
|
|
214
|
-
left: a
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
export {
|
|
218
|
-
C as AnalyticsDebuggerInternal,
|
|
219
|
-
H as default
|
|
220
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-DJPbIPVY.cjs"),p=require("react"),R=require("react-dom");function E(){return s.getRuntime().name!=="browser"||window.hasOwnProperty("debuggerInitialized")?null:(window.debuggerInitialized=!0,R.createPortal(s.jsxRuntimeExports.jsx(w,{}),document.body))}const b={};function w(){const[t,o]=p.useState(),[i,n]=p.useState([]),[l,a]=p.useState(!1),e=r=>{o(t===r?void 0:r)};return p.useEffect(()=>(document.documentElement.classList.add("xYextDebug"),document.querySelectorAll("[data-ya-scope]").forEach(c=>{const u=c.dataset.yaScope,d=c.querySelectorAll("[data-ya-track]");d.forEach((x,m)=>{const g=x.dataset.yaTrack;x.addEventListener("mouseenter",()=>{n([{eventEl:x,eventName:`${u}_${g}`,key:`${u}_${g}_${m}`}])}),x.addEventListener("mouseleave",()=>{n([])})}),u&&(b.hasOwnProperty(u)?b[u].events=[...b[u].events,...Array.from(d)]:b[u]={scope:c,events:Array.from(d)})}),a(!0),()=>{document.documentElement.classList.remove("xYextDebug")}),[]),l?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:"analytics-debugger",children:[s.jsxRuntimeExports.jsxs("div",{className:"analytics-debugger-toggles",children:[s.jsxRuntimeExports.jsx("button",{className:s.c("analytics-debugger-toggle",{"is-active":t==="Events"}),onClick:()=>e("Events"),children:"Events"}),s.jsxRuntimeExports.jsx("button",{className:s.c("analytics-debugger-toggle",{"is-active":t==="Scopes"}),onClick:()=>e("Scopes"),children:"Scopes"})]}),t&&s.jsxRuntimeExports.jsx("div",{className:"analytics-debugger-tabs",children:t==="Events"?s.jsxRuntimeExports.jsx(k,{data:b,setTooltips:n}):s.jsxRuntimeExports.jsx($,{data:b,setTooltips:n})})]}),s.jsxRuntimeExports.jsx(T,{tooltips:i})]}):null}function k(t){const{data:o,setTooltips:i}=t,[n,l]=p.useState(),[a,e]=p.useState(""),r=(c,u,d)=>{c.scrollIntoView({behavior:"smooth",block:"nearest"}),n&&n.classList.remove("analytics-event-highlight"),l(c),c.classList.add("analytics-event-highlight"),e(d),i([{eventEl:c,eventName:u,key:d}])};return s.jsxRuntimeExports.jsxs("div",{className:"analytics-debugger-tab",children:[s.jsxRuntimeExports.jsx("h2",{className:"analytics-debugger-tab-title",children:"Event Names"}),s.jsxRuntimeExports.jsx("ul",{className:"analytics-debugger-list",children:Object.entries(o).map(([c,u])=>u.events.map((d,x)=>{const m=`${c}_${d.dataset.yaTrack}`,g=`${m}_${x}`;return s.jsxRuntimeExports.jsx("li",{className:"analytics-debugger-listItem",children:s.jsxRuntimeExports.jsx("button",{className:s.c("analytics-debugger-button",{"is-active":g===a}),onClick:()=>r(d,m,g),children:m})},g)}))})]})}function $(t){const{data:o,setTooltips:i}=t,[n,l]=p.useState(""),a=e=>{const r=o[e];r.scope.scrollIntoView({behavior:"smooth",block:"nearest"}),l(e),i(r.events.map((c,u)=>({eventEl:c,eventName:`${e}_${c.dataset.yaTrack}`,key:`${e}_${c.dataset.yaTrack}_${u}`})))};return s.jsxRuntimeExports.jsxs("div",{className:"analytics-debugger-tab",children:[s.jsxRuntimeExports.jsx("h2",{className:"analytics-debugger-tab-title",children:"Scope Names"}),s.jsxRuntimeExports.jsx("ul",{className:"analytics-debugger-list",children:Object.keys(o).map((e,r)=>s.jsxRuntimeExports.jsx("li",{className:"analytics-debugger-listItem",children:s.jsxRuntimeExports.jsx("button",{className:s.c("analytics-debugger-button",{"is-active":e===n}),onClick:()=>a(e),children:e})},e+r))})]})}function T(t){const o=p.useRef({});return p.useEffect(()=>{if(o.current)for(const i of Object.values(o.current)){const n=Object.values(o.current).map(l=>l.el).filter(l=>l!==i.el);B(i,n),i.el.style.visibility="visible"}},[t.tooltips]),s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:t.tooltips.map(i=>s.jsxRuntimeExports.jsx("div",{style:{visibility:"hidden"},className:"analytics-debugger-tooltip",ref:n=>{n?o.current[i.key]={el:n,tooltip:i}:delete o.current[i.key]},children:s.jsxRuntimeExports.jsx("span",{children:i.eventName})},i.key))})}function B(t,o){for(let i=0;i<9;i++){const n=N(t.tooltip.eventEl.getBoundingClientRect(),t.el,i);if(t.el.style.inset=`${n.top} auto auto ${n.left}`,!!C(t.el.getBoundingClientRect().left,t.el.getBoundingClientRect().top+window.scrollY,t.el.getBoundingClientRect().right,t.el.getBoundingClientRect().bottom+window.scrollY))continue;let a=!0;for(let e=0;e<o.length;e++){const r=o[e];S(t.el,r)&&(a=!1)}if(a)break}}function S(t,o){const i=t.getBoundingClientRect().top+window.scrollY,n=t.getBoundingClientRect().left,l=i+t.clientHeight,a=n+t.clientWidth,e=o.getBoundingClientRect().top+window.scrollY,r=o.getBoundingClientRect().left,c=e+o.clientHeight,u=r+o.clientWidth,d=(x,m,g,h,j,f,v,y)=>g<=j&&j<=v&&h<=f&&f<=y||g<=x&&x<=v&&h<=m&&m<=y||g<=x&&x<=v&&h<=f&&f<=y||g<=j&&j<=v&&h<=m&&m<=y;return d(n,i,r,e,a,l,u,c)||d(r,e,n,i,u,c,a,l)}function C(t,o,i,n){return t<0||i>window.innerWidth||o<0||n>document.documentElement.scrollHeight}function N(t,o,i){const n=o.clientHeight,l=o.clientWidth;let a,e;switch(i){case 0:{e=window.scrollY+t.top-n+"px",a=t.left-l+"px";break}case 1:{e=window.scrollY+t.top-n+"px",a=t.left+"px";break}case 2:{e=window.scrollY+t.top-n+"px",a=t.right+"px";break}case 3:{e=window.scrollY+t.top-n+"px",a=t.right-l+"px";break}case 4:{e=window.scrollY+t.bottom+"px",a=t.left-l+"px";break}case 5:{e=window.scrollY+t.bottom+"px",a=t.left+"px";break}case 6:{e=window.scrollY+t.bottom+"px",a=t.right-l+"px";break}case 7:{e=window.scrollY+t.bottom+"px",a=t.right+"px";break}default:e=0,a=0}return{top:e,left:a}}exports.AnalyticsDebuggerInternal=w;exports.default=E;
|