@react-pdf-kit/viewer 2.7.0 → 2.7.1-rc.1

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.
Files changed (152) hide show
  1. package/dist/{AnnotationLayer-D6BfL976.js → AnnotationLayer-CAIvKf_O.js} +1 -1
  2. package/dist/{Button-jStpvb3T.js → Button-DBu3SaMk.js} +3 -3
  3. package/dist/{Checkbox-Brta-YKG.js → Checkbox-Cl-BpoFJ.js} +4 -4
  4. package/dist/{Combination-DqNkTtir.js → Combination-11kyhTGt.js} +15 -15
  5. package/dist/Container-BuamPhw4.js +18 -0
  6. package/dist/{DocumentDialog-DHAWcYIz.js → DocumentDialog-cRr9sSSH.js} +10 -10
  7. package/dist/{DropDown-DikL-krI.js → DropDown-D6c4mnJL.js} +2 -2
  8. package/dist/{Input-DGJSVFE8.js → Input-Dpo1Xfxe.js} +5 -5
  9. package/dist/{LoaderIcon-D9YjinGf.js → LoaderIcon-B3ddfd0D.js} +1 -1
  10. package/dist/{LoadingIndicator-DiWoWs4Y.js → LoadingIndicator-Bzzf28Xv.js} +1 -1
  11. package/dist/{MenuItem-BJDWfzAw.js → MenuItem-BP_RjUuW.js} +2 -2
  12. package/dist/{MenuSeparator-D1H5l8Ej.js → MenuSeparator-Df2Dzzea.js} +1 -1
  13. package/dist/Paginate.module-DhE7N8AA.js +9 -0
  14. package/dist/{PaginationContext--n91mIJ4.js → PaginationContext-Cwf8sCpK.js} +77 -67
  15. package/dist/{PasswordModal-CA6x2l7v.js → PasswordModal-BtHVvrMg.js} +13 -12
  16. package/dist/{RPDropFileZone-D1C3ouep.js → RPDropFileZone-Bq1bzWmO.js} +1 -1
  17. package/dist/{RPPage-BuSGUFzw.js → RPPage-C_r8aeTc.js} +1 -1
  18. package/dist/{RPPages-CQsmCbyj.js → RPPages-DeA52_rv.js} +12 -12
  19. package/dist/RPTooltip-B4KrW-_f.js +568 -0
  20. package/dist/{SkipLink-Bvbn3miT.js → SkipLink-CdcjClGB.js} +1 -1
  21. package/dist/{Thumbnail-Dwo2-4Ki.js → Thumbnail-DyRfHsAh.js} +3 -3
  22. package/dist/{Thumbnails-ComClyJJ.js → Thumbnails-Cbr54TOa.js} +2 -2
  23. package/dist/assets/Button.css +1 -1
  24. package/dist/assets/DocumentDialog.css +1 -1
  25. package/dist/assets/Input.css +1 -1
  26. package/dist/assets/Paginate.css +1 -1
  27. package/dist/assets/PasswordModal.css +1 -1
  28. package/dist/assets/SkipLink.css +1 -1
  29. package/dist/assets/style.js +1 -1
  30. package/dist/{clsx-B7LyVm5O.js → clsx-DSGuh5YW.js} +1 -1
  31. package/dist/components/RPController.js +1 -1
  32. package/dist/components/RPDropFileZone.js +1 -1
  33. package/dist/components/RPPages.js +1 -1
  34. package/dist/components/RPProvider.js +1 -1
  35. package/dist/components/icons/LoaderIcon.js +1 -1
  36. package/dist/components/layout/Container.js +1 -1
  37. package/dist/components/layout/LayoutContainer.js +1 -1
  38. package/dist/components/layout/RPDefaultLayout.js +56 -55
  39. package/dist/components/layout/RPLayout.js +39 -38
  40. package/dist/components/layout/SkipLink.js +1 -1
  41. package/dist/components/layout/sidebar/RPSidebar.js +3 -3
  42. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  43. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  44. package/dist/components/layout/toolbar/DarkModeTool.js +2 -2
  45. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  46. package/dist/components/layout/toolbar/DocumentProperties.js +3 -3
  47. package/dist/components/layout/toolbar/FileDownloadTool.js +3 -3
  48. package/dist/components/layout/toolbar/FileUploadTool.js +3 -3
  49. package/dist/components/layout/toolbar/FullScreenTool.js +5 -4
  50. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  51. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  52. package/dist/components/layout/toolbar/MostPageTool.js +5 -5
  53. package/dist/components/layout/toolbar/OtherTool.js +6 -6
  54. package/dist/components/layout/toolbar/Paginate.js +20 -5
  55. package/dist/components/layout/toolbar/PrintTool.js +3 -3
  56. package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
  57. package/dist/components/layout/toolbar/RPMoreOptions.js +6 -6
  58. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  59. package/dist/components/layout/toolbar/RotateTool.js +4 -4
  60. package/dist/components/layout/toolbar/ScrollModeTool.js +3 -3
  61. package/dist/components/layout/toolbar/SearchCloseButton.js +2 -2
  62. package/dist/components/layout/toolbar/SearchResultNavigator.js +2 -2
  63. package/dist/components/layout/toolbar/SearchTool.js +7 -6
  64. package/dist/components/layout/toolbar/SelectionModeTool.js +4 -4
  65. package/dist/components/layout/toolbar/ThumbnailTool.js +2 -2
  66. package/dist/components/layout/toolbar/ToolbarCustom.js +2 -2
  67. package/dist/components/layout/toolbar/ToolbarDefault.js +2 -2
  68. package/dist/components/layout/toolbar/ViewModeTool.js +4 -4
  69. package/dist/components/layout/toolbar/ZoomTool.js +7 -7
  70. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +3 -3
  71. package/dist/components/layout/toolbar/tools/DualPageTool.js +2 -2
  72. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +1 -1
  73. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +2 -2
  74. package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
  75. package/dist/components/layout/toolbar/tools/FirstPageTool.js +1 -1
  76. package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
  77. package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +2 -2
  78. package/dist/components/layout/toolbar/tools/InputPageTool.js +37 -25
  79. package/dist/components/layout/toolbar/tools/LastPageTool.js +1 -1
  80. package/dist/components/layout/toolbar/tools/NextPageTool.js +3 -3
  81. package/dist/components/layout/toolbar/tools/PageScrollingTool.js +2 -2
  82. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +3 -3
  83. package/dist/components/layout/toolbar/tools/PrintTool.js +2 -2
  84. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +2 -2
  85. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +2 -2
  86. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +2 -2
  87. package/dist/components/layout/toolbar/tools/SinglePageTool.js +2 -2
  88. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
  89. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +2 -2
  90. package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +2 -2
  91. package/dist/components/layout/toolbar/tools/ZoomInTool.js +2 -2
  92. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +6 -6
  93. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +2 -2
  94. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +2 -2
  95. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +2 -2
  96. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +2 -2
  97. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +2 -2
  98. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +5 -5
  99. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +2 -2
  100. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +4 -4
  101. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +3 -3
  102. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +4 -4
  103. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +4 -4
  104. package/dist/components/page/AnnotationLayer.js +1 -1
  105. package/dist/components/page/DualPage.js +2 -2
  106. package/dist/components/page/DualPageWithCover.js +2 -2
  107. package/dist/components/page/RPPage.js +1 -1
  108. package/dist/components/page/SinglePage.js +2 -2
  109. package/dist/components/ui/Button.js +1 -1
  110. package/dist/components/ui/Checkbox.js +1 -1
  111. package/dist/components/ui/DropDown.js +1 -1
  112. package/dist/components/ui/Input.js +1 -1
  113. package/dist/components/ui/LoadingIndicator.js +1 -1
  114. package/dist/components/ui/PasswordModal.js +1 -1
  115. package/dist/components/ui/RPTooltip.js +1 -1
  116. package/dist/contexts/ElementThumbnailContext.js +1 -1
  117. package/dist/contexts/LoaderContext.js +1 -1
  118. package/dist/contexts/LocalizationContext.js +12 -6
  119. package/dist/contexts/PaginationContext.js +1 -1
  120. package/dist/contexts/RenderQueueProvider.js +1 -1
  121. package/dist/{de_DE--0LF-SJR.js → de_DE-DwUvXUWH.js} +24 -6
  122. package/dist/{dist-BRVqFn7R.js → dist-BfuBBQ14.js} +6 -6
  123. package/dist/{dist-C3WNMuW2.js → dist-CHiIt8ey.js} +2 -2
  124. package/dist/{dist-bK-AHWLF.js → dist-CgoP608h.js} +7 -7
  125. package/dist/dist-Ch2NetCM.js +1134 -0
  126. package/dist/floating-ui.react-dom-DWNOhDoc.js +1096 -0
  127. package/dist/icons.js +1 -1
  128. package/dist/{lib-BiapEtK1.js → lib-CSInlR9T.js} +142 -237
  129. package/dist/{main-CHO5p1qM.js → main-BVY8P7qz.js} +3 -3
  130. package/dist/main.js +5 -5
  131. package/dist/style-C8T5x1fE.js +5 -0
  132. package/dist/types/locales/de_DE.json.d.ts +6 -2
  133. package/dist/types/locales/en_US.json.d.ts +6 -2
  134. package/dist/types/locales/it_IT.json.d.ts +6 -2
  135. package/dist/types/locales/pt_PT.json.d.ts +6 -2
  136. package/dist/types/locales/th_TH.json.d.ts +6 -2
  137. package/dist/types/locales/zh_CN.json.d.ts +6 -2
  138. package/dist/types/utils/types.d.ts +4 -0
  139. package/dist/utils/hooks/useLicense.js +2 -2
  140. package/dist/utils/hooks/useLocalization.js +1 -1
  141. package/dist/utils/hooks/usePaginate.js +1 -1
  142. package/dist/utils/hooks/usePresentPage.js +1 -1
  143. package/dist/utils/hooks/useScrollToPage.js +1 -1
  144. package/dist/utils/hooks/useSearch.js +1 -1
  145. package/dist/utils/types.js +1 -1
  146. package/package.json +1 -1
  147. package/dist/Container-DTWaZzc7.js +0 -16
  148. package/dist/Paginate.module-B0GMw-MB.js +0 -8
  149. package/dist/RPTooltip-ZZoFqP7C.js +0 -381
  150. package/dist/dist-7FA4Do6I.js +0 -1286
  151. package/dist/dist-CKteKPPA.js +0 -947
  152. package/dist/style-DKH7g1Kh.js +0 -5
@@ -1,381 +0,0 @@
1
- import { withRef as e } from "./utils/withRef.js";
2
- import { d as t, f as n, i as r, l as i, n as a, s as o, t as s } from "./dist-bK-AHWLF.js";
3
- import { n as c, r as l, t as u } from "./dist-BRVqFn7R.js";
4
- import { a as d, i as f, n as p, r as m, t as h } from "./dist-7FA4Do6I.js";
5
- import * as g from "react";
6
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
7
- import './assets/RPTooltip.css';//#region node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.3_@types+react-dom@18.3.7_@types+react@18.3.27__@ty_a0e385f362a25de1e1388c87472ea469/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
8
- var y = Object.freeze({
9
- position: "absolute",
10
- border: 0,
11
- width: 1,
12
- height: 1,
13
- padding: 0,
14
- margin: -1,
15
- overflow: "hidden",
16
- clip: "rect(0, 0, 0, 0)",
17
- whiteSpace: "nowrap",
18
- wordWrap: "normal"
19
- }), b = "VisuallyHidden", x = g.forwardRef((e, t) => /* @__PURE__ */ _(r.span, {
20
- ...e,
21
- ref: t,
22
- style: {
23
- ...y,
24
- ...e.style
25
- }
26
- }));
27
- x.displayName = b;
28
- var S = x, [C, w] = i("Tooltip", [d]), T = d(), E = "TooltipProvider", D = 700, O = "tooltip.open", [k, A] = C(E), j = (e) => {
29
- let { __scopeTooltip: t, delayDuration: n = D, skipDelayDuration: r = 300, disableHoverableContent: i = !1, children: a } = e, o = g.useRef(!0), s = g.useRef(!1), c = g.useRef(0);
30
- return g.useEffect(() => {
31
- let e = c.current;
32
- return () => window.clearTimeout(e);
33
- }, []), /* @__PURE__ */ _(k, {
34
- scope: t,
35
- isOpenDelayedRef: o,
36
- delayDuration: n,
37
- onOpen: g.useCallback(() => {
38
- window.clearTimeout(c.current), o.current = !1;
39
- }, []),
40
- onClose: g.useCallback(() => {
41
- window.clearTimeout(c.current), c.current = window.setTimeout(() => o.current = !0, r);
42
- }, [r]),
43
- isPointerInTransitRef: s,
44
- onPointerInTransitChange: g.useCallback((e) => {
45
- s.current = e;
46
- }, []),
47
- disableHoverableContent: i,
48
- children: a
49
- });
50
- };
51
- j.displayName = E;
52
- var M = "Tooltip", [N, P] = C(M), F = (e) => {
53
- let { __scopeTooltip: t, children: n, open: r, defaultOpen: i, onOpenChange: a, disableHoverableContent: o, delayDuration: l } = e, u = A(M, e.__scopeTooltip), d = T(t), [p, m] = g.useState(null), h = c(), v = g.useRef(0), y = o ?? u.disableHoverableContent, b = l ?? u.delayDuration, x = g.useRef(!1), [S, C] = s({
54
- prop: r,
55
- defaultProp: i ?? !1,
56
- onChange: (e) => {
57
- e ? (u.onOpen(), document.dispatchEvent(new CustomEvent(O))) : u.onClose(), a?.(e);
58
- },
59
- caller: M
60
- }), w = g.useMemo(() => S ? x.current ? "delayed-open" : "instant-open" : "closed", [S]), E = g.useCallback(() => {
61
- window.clearTimeout(v.current), v.current = 0, x.current = !1, C(!0);
62
- }, [C]), D = g.useCallback(() => {
63
- window.clearTimeout(v.current), v.current = 0, C(!1);
64
- }, [C]), k = g.useCallback(() => {
65
- window.clearTimeout(v.current), v.current = window.setTimeout(() => {
66
- x.current = !0, C(!0), v.current = 0;
67
- }, b);
68
- }, [b, C]);
69
- return g.useEffect(() => () => {
70
- v.current &&= (window.clearTimeout(v.current), 0);
71
- }, []), /* @__PURE__ */ _(f, {
72
- ...d,
73
- children: /* @__PURE__ */ _(N, {
74
- scope: t,
75
- contentId: h,
76
- open: S,
77
- stateAttribute: w,
78
- trigger: p,
79
- onTriggerChange: m,
80
- onTriggerEnter: g.useCallback(() => {
81
- u.isOpenDelayedRef.current ? k() : E();
82
- }, [
83
- u.isOpenDelayedRef,
84
- k,
85
- E
86
- ]),
87
- onTriggerLeave: g.useCallback(() => {
88
- y ? D() : (window.clearTimeout(v.current), v.current = 0);
89
- }, [D, y]),
90
- onOpen: E,
91
- onClose: D,
92
- disableHoverableContent: y,
93
- children: n
94
- })
95
- });
96
- };
97
- F.displayName = M;
98
- var I = "TooltipTrigger", L = g.forwardRef((e, i) => {
99
- let { __scopeTooltip: a, ...o } = e, s = P(I, a), c = A(I, a), l = T(a), u = t(i, g.useRef(null), s.onTriggerChange), d = g.useRef(!1), f = g.useRef(!1), p = g.useCallback(() => d.current = !1, []);
100
- return g.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ _(h, {
101
- asChild: !0,
102
- ...l,
103
- children: /* @__PURE__ */ _(r.button, {
104
- "aria-describedby": s.open ? s.contentId : void 0,
105
- "data-state": s.stateAttribute,
106
- ...o,
107
- ref: u,
108
- onPointerMove: n(e.onPointerMove, (e) => {
109
- e.pointerType !== "touch" && !f.current && !c.isPointerInTransitRef.current && (s.onTriggerEnter(), f.current = !0);
110
- }),
111
- onPointerLeave: n(e.onPointerLeave, () => {
112
- s.onTriggerLeave(), f.current = !1;
113
- }),
114
- onPointerDown: n(e.onPointerDown, () => {
115
- s.open && s.onClose(), d.current = !0, document.addEventListener("pointerup", p, { once: !0 });
116
- }),
117
- onFocus: n(e.onFocus, () => {
118
- d.current || s.onOpen();
119
- }),
120
- onBlur: n(e.onBlur, s.onClose),
121
- onClick: n(e.onClick, s.onClose)
122
- })
123
- });
124
- });
125
- L.displayName = I;
126
- var R = "TooltipPortal", [z, B] = C(R, { forceMount: void 0 }), V = (e) => {
127
- let { __scopeTooltip: t, forceMount: n, children: r, container: i } = e, o = P(R, t);
128
- return /* @__PURE__ */ _(z, {
129
- scope: t,
130
- forceMount: n,
131
- children: /* @__PURE__ */ _(a, {
132
- present: n || o.open,
133
- children: /* @__PURE__ */ _(u, {
134
- asChild: !0,
135
- container: i,
136
- children: r
137
- })
138
- })
139
- });
140
- };
141
- V.displayName = R;
142
- var H = "TooltipContent", U = g.forwardRef((e, t) => {
143
- let n = B(H, e.__scopeTooltip), { forceMount: r = n.forceMount, side: i = "top", ...o } = e, s = P(H, e.__scopeTooltip);
144
- return /* @__PURE__ */ _(a, {
145
- present: r || s.open,
146
- children: s.disableHoverableContent ? /* @__PURE__ */ _(J, {
147
- side: i,
148
- ...o,
149
- ref: t
150
- }) : /* @__PURE__ */ _(W, {
151
- side: i,
152
- ...o,
153
- ref: t
154
- })
155
- });
156
- }), W = g.forwardRef((e, n) => {
157
- let r = P(H, e.__scopeTooltip), i = A(H, e.__scopeTooltip), a = g.useRef(null), o = t(n, a), [s, c] = g.useState(null), { trigger: l, onClose: u } = r, d = a.current, { onPointerInTransitChange: f } = i, p = g.useCallback(() => {
158
- c(null), f(!1);
159
- }, [f]), m = g.useCallback((e, t) => {
160
- let n = e.currentTarget, r = {
161
- x: e.clientX,
162
- y: e.clientY
163
- }, i = Q(r, Z(r, n.getBoundingClientRect())), a = ee(t.getBoundingClientRect());
164
- c(ne([...i, ...a])), f(!0);
165
- }, [f]);
166
- return g.useEffect(() => () => p(), [p]), g.useEffect(() => {
167
- if (l && d) {
168
- let e = (e) => m(e, d), t = (e) => m(e, l);
169
- return l.addEventListener("pointerleave", e), d.addEventListener("pointerleave", t), () => {
170
- l.removeEventListener("pointerleave", e), d.removeEventListener("pointerleave", t);
171
- };
172
- }
173
- }, [
174
- l,
175
- d,
176
- m,
177
- p
178
- ]), g.useEffect(() => {
179
- if (s) {
180
- let e = (e) => {
181
- let t = e.target, n = {
182
- x: e.clientX,
183
- y: e.clientY
184
- }, r = l?.contains(t) || d?.contains(t), i = !te(n, s);
185
- r ? p() : i && (p(), u());
186
- };
187
- return document.addEventListener("pointermove", e), () => document.removeEventListener("pointermove", e);
188
- }
189
- }, [
190
- l,
191
- d,
192
- s,
193
- u,
194
- p
195
- ]), /* @__PURE__ */ _(J, {
196
- ...e,
197
- ref: o
198
- });
199
- }), [G, K] = C(M, { isInside: !1 }), q = o("TooltipContent"), J = g.forwardRef((e, t) => {
200
- let { __scopeTooltip: n, children: r, "aria-label": i, onEscapeKeyDown: a, onPointerDownOutside: o, ...s } = e, c = P(H, n), u = T(n), { onClose: d } = c;
201
- return g.useEffect(() => (document.addEventListener(O, d), () => document.removeEventListener(O, d)), [d]), g.useEffect(() => {
202
- if (c.trigger) {
203
- let e = (e) => {
204
- e.target?.contains(c.trigger) && d();
205
- };
206
- return window.addEventListener("scroll", e, { capture: !0 }), () => window.removeEventListener("scroll", e, { capture: !0 });
207
- }
208
- }, [c.trigger, d]), /* @__PURE__ */ _(l, {
209
- asChild: !0,
210
- disableOutsidePointerEvents: !1,
211
- onEscapeKeyDown: a,
212
- onPointerDownOutside: o,
213
- onFocusOutside: (e) => e.preventDefault(),
214
- onDismiss: d,
215
- children: /* @__PURE__ */ v(m, {
216
- "data-state": c.stateAttribute,
217
- ...u,
218
- ...s,
219
- ref: t,
220
- style: {
221
- ...s.style,
222
- "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
223
- "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
224
- "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
225
- "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
226
- "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
227
- },
228
- children: [/* @__PURE__ */ _(q, { children: r }), /* @__PURE__ */ _(G, {
229
- scope: n,
230
- isInside: !0,
231
- children: /* @__PURE__ */ _(S, {
232
- id: c.contentId,
233
- role: "tooltip",
234
- children: i || r
235
- })
236
- })]
237
- })
238
- });
239
- });
240
- U.displayName = H;
241
- var Y = "TooltipArrow", X = g.forwardRef((e, t) => {
242
- let { __scopeTooltip: n, ...r } = e, i = T(n);
243
- return K(Y, n).isInside ? null : /* @__PURE__ */ _(p, {
244
- ...i,
245
- ...r,
246
- ref: t
247
- });
248
- });
249
- X.displayName = Y;
250
- function Z(e, t) {
251
- let n = Math.abs(t.top - e.y), r = Math.abs(t.bottom - e.y), i = Math.abs(t.right - e.x), a = Math.abs(t.left - e.x);
252
- switch (Math.min(n, r, i, a)) {
253
- case a: return "left";
254
- case i: return "right";
255
- case n: return "top";
256
- case r: return "bottom";
257
- default: throw Error("unreachable");
258
- }
259
- }
260
- function Q(e, t, n = 5) {
261
- let r = [];
262
- switch (t) {
263
- case "top":
264
- r.push({
265
- x: e.x - n,
266
- y: e.y + n
267
- }, {
268
- x: e.x + n,
269
- y: e.y + n
270
- });
271
- break;
272
- case "bottom":
273
- r.push({
274
- x: e.x - n,
275
- y: e.y - n
276
- }, {
277
- x: e.x + n,
278
- y: e.y - n
279
- });
280
- break;
281
- case "left":
282
- r.push({
283
- x: e.x + n,
284
- y: e.y - n
285
- }, {
286
- x: e.x + n,
287
- y: e.y + n
288
- });
289
- break;
290
- case "right":
291
- r.push({
292
- x: e.x - n,
293
- y: e.y - n
294
- }, {
295
- x: e.x - n,
296
- y: e.y + n
297
- });
298
- break;
299
- }
300
- return r;
301
- }
302
- function ee(e) {
303
- let { top: t, right: n, bottom: r, left: i } = e;
304
- return [
305
- {
306
- x: i,
307
- y: t
308
- },
309
- {
310
- x: n,
311
- y: t
312
- },
313
- {
314
- x: n,
315
- y: r
316
- },
317
- {
318
- x: i,
319
- y: r
320
- }
321
- ];
322
- }
323
- function te(e, t) {
324
- let { x: n, y: r } = e, i = !1;
325
- for (let e = 0, a = t.length - 1; e < t.length; a = e++) {
326
- let o = t[e], s = t[a], c = o.x, l = o.y, u = s.x, d = s.y;
327
- l > r != d > r && n < (u - c) * (r - l) / (d - l) + c && (i = !i);
328
- }
329
- return i;
330
- }
331
- function ne(e) {
332
- let t = e.slice();
333
- return t.sort((e, t) => e.x < t.x ? -1 : e.x > t.x ? 1 : e.y < t.y ? -1 : +(e.y > t.y)), re(t);
334
- }
335
- function re(e) {
336
- if (e.length <= 1) return e.slice();
337
- let t = [];
338
- for (let n = 0; n < e.length; n++) {
339
- let r = e[n];
340
- for (; t.length >= 2;) {
341
- let e = t[t.length - 1], n = t[t.length - 2];
342
- if ((e.x - n.x) * (r.y - n.y) >= (e.y - n.y) * (r.x - n.x)) t.pop();
343
- else break;
344
- }
345
- t.push(r);
346
- }
347
- t.pop();
348
- let n = [];
349
- for (let t = e.length - 1; t >= 0; t--) {
350
- let r = e[t];
351
- for (; n.length >= 2;) {
352
- let e = n[n.length - 1], t = n[n.length - 2];
353
- if ((e.x - t.x) * (r.y - t.y) >= (e.y - t.y) * (r.x - t.x)) n.pop();
354
- else break;
355
- }
356
- n.push(r);
357
- }
358
- return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
359
- }
360
- var $ = {
361
- tooltipContent: "_tooltipContent_12gjy_1",
362
- tooltipArrow: "_tooltipArrow_12gjy_8",
363
- fadeIn: "_fadeIn_12gjy_1"
364
- }, ie = e(({ children: e, content: t, className: n, style: r }, i) => /* @__PURE__ */ _(j, { children: /* @__PURE__ */ v(F, {
365
- delayDuration: 1e3,
366
- children: [/* @__PURE__ */ _(L, {
367
- asChild: !0,
368
- children: /* @__PURE__ */ _("div", {
369
- ref: i,
370
- className: n,
371
- style: r,
372
- children: e
373
- })
374
- }), /* @__PURE__ */ v(U, {
375
- className: $.tooltipContent,
376
- sideOffset: 5,
377
- children: [/* @__PURE__ */ _(X, { className: $.tooltipArrow }), /* @__PURE__ */ _("span", { children: t })]
378
- })]
379
- }) }));
380
- //#endregion
381
- export { ie as t };