@revolist/ui 4.0.1-rc → 4.0.2-rc

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 (218) hide show
  1. package/README.md +6 -5
  2. package/_chunks/calendar-CpaUK7w1.js +248 -0
  3. package/_chunks/chart-frame-BC99KjGa.js +127 -0
  4. package/_chunks/choice-chips-Cs4D-3nH.js +110 -0
  5. package/_chunks/{color-palette-BmZ7kH9R.js → color-palette-BBMFmUNA.js} +41 -41
  6. package/_chunks/color-picker-D90Jg-M8.js +138 -0
  7. package/_chunks/compat.module-DDB2pm9O.js +229 -0
  8. package/_chunks/component-YDcfoOLz.js +859 -0
  9. package/_chunks/{control-tooltip-BCNzQCXE.js → control-tooltip-ztgmsG7H.js} +29 -29
  10. package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
  11. package/_chunks/{controls-NEL5tDaz.js → controls-DIum-E66.js} +192 -192
  12. package/_chunks/{date-control-CYCkb1aQ.js → date-control-BJSzu79z.js} +21 -21
  13. package/_chunks/date-time-BxPJusp9.js +770 -0
  14. package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-Bblyah10.js} +1 -1
  15. package/_chunks/dialog.parts-DBqo3Qwb.js +134 -0
  16. package/_chunks/{dropdown-CkGQBm1Q.js → dropdown-voWqmwAe.js} +102 -102
  17. package/_chunks/duration-87U2EoMS.js +271 -0
  18. package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
  19. package/_chunks/{editor-popup-B7fu_A_T.js → editor-popup-D3JdS8l3.js} +8 -8
  20. package/_chunks/framework-mount-C-Zwm44H.js +54 -0
  21. package/_chunks/hooks.module-CG3gN83z.js +157 -0
  22. package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
  23. package/_chunks/mount-DZe_6VtR.js +90 -0
  24. package/_chunks/native.view-ByyZ1CT5.js +32 -0
  25. package/_chunks/{number-input-NnH57J4j.js → number-input-BeIadZuL.js} +89 -89
  26. package/_chunks/picker-DpP7iQLA.js +122 -0
  27. package/_chunks/preact.module-BBM36DnO.js +290 -0
  28. package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-Ca8ZBty3.js} +10 -10
  29. package/_chunks/reorder-list-Cc3KmfAN.js +59 -0
  30. package/_chunks/request-trail-IdNiFvKH.js +347 -0
  31. package/_chunks/{rich-text-2Rla349o.js → rich-text-BzI1DyfF.js} +167 -167
  32. package/_vendor/preact/LICENSE +21 -0
  33. package/_vendor/preact/compat/src/index.d.ts +353 -0
  34. package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
  35. package/_vendor/preact/compat/src/suspense.d.ts +19 -0
  36. package/_vendor/preact/hooks/src/index.d.ts +145 -0
  37. package/_vendor/preact/src/dom.d.ts +2548 -0
  38. package/_vendor/preact/src/index.d.ts +373 -0
  39. package/_vendor/preact/src/jsx.d.ts +2958 -0
  40. package/activity-message.d.ts +1 -1
  41. package/activity-message.js +16 -16
  42. package/ai/components.d.ts +1 -1
  43. package/ai/index.js +2 -2
  44. package/ai/request-trail.d.ts +1 -1
  45. package/ai/translation-context.d.ts +1 -1
  46. package/alert.d.ts +2 -2
  47. package/assignee/field.d.ts +2 -2
  48. package/assignee/index.js +87 -87
  49. package/assignee/layout.d.ts +2 -2
  50. package/assignee/picker.d.ts +1 -1
  51. package/avatar/index.js +25 -25
  52. package/avatar/index.view.d.ts +1 -1
  53. package/brush-range/component.d.ts +1 -1
  54. package/brush-range/component.js +30 -30
  55. package/buttons/delete-button.js +1 -1
  56. package/buttons/remove-button.d.ts +1 -1
  57. package/buttons/remove-button.js +3 -3
  58. package/buttons/svg-button.d.ts +1 -1
  59. package/buttons/svg-button.js +35 -35
  60. package/calendar/calendar.d.ts +1 -1
  61. package/calendar/calendar.js +1 -1
  62. package/calendar/caption.d.ts +1 -1
  63. package/calendar/day.d.ts +1 -1
  64. package/calendar/day.js +4 -4
  65. package/calendar/header.d.ts +1 -1
  66. package/calendar/header.js +35 -35
  67. package/calendar/index.js +2 -2
  68. package/calendar/month-grid.d.ts +1 -1
  69. package/calendar/month-grid.js +37 -37
  70. package/calendar/picker.d.ts +1 -1
  71. package/calendar/types.d.ts +1 -1
  72. package/calendar/year-grid.d.ts +1 -1
  73. package/calendar/year-grid.js +12 -12
  74. package/checkbox/index.d.ts +2 -2
  75. package/checkbox/index.js +9 -9
  76. package/choice-chips/index.d.ts +1 -1
  77. package/choice-chips/index.js +1 -1
  78. package/color-palette/color-palette.d.ts +1 -1
  79. package/color-palette/color-palette.js +1 -1
  80. package/color-palette/color-picker.d.ts +1 -1
  81. package/color-palette/color-picker.js +2 -2
  82. package/component-catalog.d.ts +19 -19
  83. package/control-presentation.js +18 -18
  84. package/controls.d.ts +4 -4
  85. package/controls.js +1 -1
  86. package/core/editor-commit.d.ts +1 -1
  87. package/core/editor-popup.d.ts +1 -1
  88. package/core/editor-popup.js +1 -1
  89. package/date-time/date-control.d.ts +1 -1
  90. package/date-time/field.d.ts +2 -2
  91. package/date-time/index.js +1 -1
  92. package/date-time/picker.d.ts +1 -1
  93. package/date-time/time-control.d.ts +1 -1
  94. package/date-time/time-selection.d.ts +1 -1
  95. package/date-time/types.d.ts +1 -1
  96. package/dialog/dialog-action-footer.view.d.ts +1 -1
  97. package/dialog/dialog.dom.js +52 -52
  98. package/dialog/dialog.parts.d.ts +18 -18
  99. package/dialog/dialog.parts.js +1 -1
  100. package/dialog/dialog.preact.d.ts +1 -1
  101. package/dialog/dialog.preact.js +6 -6
  102. package/distribution-chart/area-chart.d.ts +1 -1
  103. package/distribution-chart/area-chart.js +25 -25
  104. package/distribution-chart/bar-chart.d.ts +1 -1
  105. package/distribution-chart/bar-chart.js +6 -6
  106. package/distribution-chart/chart-frame.d.ts +1 -1
  107. package/distribution-chart/index.d.ts +1 -1
  108. package/distribution-chart/index.js +6 -6
  109. package/distribution-chart/line-chart.d.ts +1 -1
  110. package/distribution-chart/line-chart.js +9 -9
  111. package/distribution-chart/types.d.ts +1 -1
  112. package/dropdown/content.d.ts +1 -1
  113. package/dropdown/content.js +83 -82
  114. package/dropdown/dropdown.service.d.ts +1 -1
  115. package/dropdown/dropdown.service.js +9 -9
  116. package/dropdown/index.js +1 -1
  117. package/dropdown/lookup-field.d.ts +1 -1
  118. package/dropdown/lookup-field.js +41 -41
  119. package/dropdown/popup.d.ts +1 -1
  120. package/dropdown/popup.js +17 -16
  121. package/duration/controls.d.ts +1 -1
  122. package/duration/index.d.ts +2 -2
  123. package/duration/index.js +1 -1
  124. package/editor-actions.d.ts +1 -1
  125. package/editor-actions.js +21 -20
  126. package/editor-layout/index.d.ts +1 -1
  127. package/editor-layout/index.js +27 -27
  128. package/field-configurator.d.ts +1 -1
  129. package/field-configurator.js +93 -93
  130. package/field-reorder.hook.js +32 -32
  131. package/filter/filters/slider/preact.js +3 -3
  132. package/filter/filters/slider/single.d.ts +1 -1
  133. package/filter/filters/slider/single.js +23 -23
  134. package/filter-badge.d.ts +1 -1
  135. package/filter-badge.js +23 -22
  136. package/filter-controls.d.ts +1 -1
  137. package/filter-controls.js +31 -31
  138. package/form-controls/index.js +20 -20
  139. package/form-controls/presentation.d.ts +1 -1
  140. package/form-controls/presentation.js +44 -44
  141. package/formatting/comparison-preview.d.ts +1 -1
  142. package/formatting/control-tooltip.d.ts +1 -1
  143. package/formatting/icon-controls.d.ts +1 -1
  144. package/formatting/index.js +99 -98
  145. package/formatting/inspector-section.d.ts +1 -1
  146. package/formatting/typography-controls.d.ts +1 -1
  147. package/framework-mount.d.ts +1 -1
  148. package/framework.js +19 -19
  149. package/icons/icon.d.ts +1 -1
  150. package/icons/icon.js +1 -1
  151. package/legend.d.ts +1 -1
  152. package/legend.js +12 -12
  153. package/masked-input/index.d.ts +1 -1
  154. package/masked-input/index.js +109 -109
  155. package/native-control.d.ts +11 -11
  156. package/native-control.js +12 -12
  157. package/native.js +39 -39
  158. package/number-input/index.d.ts +1 -1
  159. package/number-input/index.js +1 -1
  160. package/package.json +1 -2
  161. package/pdf-viewer/component.d.ts +1 -1
  162. package/pdf-viewer/controller.js +1 -1
  163. package/pdf-viewer/header.d.ts +1 -1
  164. package/pdf-viewer/index.js +13 -13
  165. package/pdf-viewer/search-bar.d.ts +1 -1
  166. package/pdf-viewer/status.d.ts +1 -1
  167. package/pdf-viewer/toolbar.d.ts +1 -1
  168. package/pickers.d.ts +1 -1
  169. package/preact-mount.d.ts +1 -1
  170. package/preact-mount.js +1 -1
  171. package/preact.js +14 -14
  172. package/rating-choice.d.ts +1 -1
  173. package/rating-choice.js +1 -1
  174. package/react-adapter.d.ts +1 -1
  175. package/react.js +19 -19
  176. package/reorder-list.d.ts +1 -1
  177. package/reorder-list.js +1 -1
  178. package/resource-picker/resource-picker-avatar.d.ts +1 -1
  179. package/resource-picker/resource-picker-avatar.js +14 -14
  180. package/resource-picker/resource-picker-option.d.ts +1 -1
  181. package/resource-picker/resource-picker-option.js +28 -28
  182. package/resource-picker/resource-picker-popup.d.ts +1 -1
  183. package/resource-picker/resource-picker-popup.js +3 -3
  184. package/resource-picker/resource-picker.d.ts +1 -1
  185. package/resource-picker/resource-picker.js +88 -88
  186. package/rich-text/index.d.ts +1 -1
  187. package/rich-text/index.js +1 -1
  188. package/rich-text/toolbar.d.ts +1 -1
  189. package/search-input/index.js +12 -12
  190. package/segmented-switch/index.d.ts +1 -1
  191. package/segmented-switch/index.js +1 -1
  192. package/status-feedback/render.d.ts +2 -2
  193. package/status-feedback/render.js +13 -13
  194. package/surfaces.js +34 -34
  195. package/svelte.js +2 -2
  196. package/switch/index.js +15 -15
  197. package/time-grid.d.ts +1 -1
  198. package/time-grid.js +58 -58
  199. package/timeline-track/component.d.ts +1 -1
  200. package/timeline-track/index.js +75 -75
  201. package/vue-adapter.d.ts +1 -1
  202. package/vue.d.ts +116 -116
  203. package/vue.js +121 -121
  204. package/_chunks/calendar-BsDxCYhI.js +0 -248
  205. package/_chunks/chart-frame-BvxbmEU9.js +0 -126
  206. package/_chunks/choice-chips-0HfOnK_4.js +0 -110
  207. package/_chunks/color-picker-BRv-__AM.js +0 -138
  208. package/_chunks/component-D4PH5UZT.js +0 -859
  209. package/_chunks/date-time-DjucJmbc.js +0 -769
  210. package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
  211. package/_chunks/duration-BCaktcvz.js +0 -270
  212. package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
  213. package/_chunks/framework-mount-BKIOsvY-.js +0 -54
  214. package/_chunks/mount-0-8opf1j.js +0 -90
  215. package/_chunks/native.view-8q_nwQ7x.js +0 -32
  216. package/_chunks/picker-oazJ7sO_.js +0 -121
  217. package/_chunks/reorder-list-BV3kZXso.js +0 -59
  218. package/_chunks/request-trail-D0oVzdRd.js +0 -347
@@ -0,0 +1,859 @@
1
+ import { c as e, i as t } from "./preact.module-BBM36DnO.js";
2
+ import { i as n, n as r, r as i, t as a } from "./hooks.module-CG3gN83z.js";
3
+ import { t as o } from "./jsxRuntime.module-F6UFnpT-.js";
4
+ import { SvgIcon as s } from "../icons/icon.js";
5
+ import { t as c } from "./compat.module-DDB2pm9O.js";
6
+ import { Input as l, Select as u } from "../native-control.js";
7
+ import { I as d, L as f, O as p, S as m, _ as h, m as g, n as _, u as v, z as y } from "./controls-DIum-E66.js";
8
+ import { t as b } from "./chevron-left-D0nc4Z5S.js";
9
+ import { t as x } from "./chevron-right-sxHQMSkq.js";
10
+ import { createControlId as S } from "../core/control-id.js";
11
+ import { t as C } from "./chevron-down-GbplLa6s.js";
12
+ import { t as w } from "./xmark-DD_PBvZI.js";
13
+ import { DialogController as T, PopoverController as E, TooltipController as D, attachMenuKeyboard as O } from "../surfaces.js";
14
+ import { avatarTemplate as k } from "../avatar/index.js";
15
+ import { renderProgressBar as A } from "../progress/bar.js";
16
+ import { SearchInput as j } from "../search-input/index.js";
17
+ import { s as M } from "./iso-B0YHBK7m.js";
18
+ import { f as N, h as P, o as F } from "./model-mPO2tG2f.js";
19
+ import { n as I, t as L } from "./date-control-BJSzu79z.js";
20
+ import { t as R } from "./calendar-CpaUK7w1.js";
21
+ import { t as z } from "./dropdown-voWqmwAe.js";
22
+ import { t as ee } from "./chevron-up-BLuNMPDn.js";
23
+ import { t as te } from "./controller-hRBm_Lfz.js";
24
+ //#region src/pickers.tsx
25
+ function B(e) {
26
+ return /* @__PURE__ */ o(z, {
27
+ ...e,
28
+ className: `rv-combobox ${e.className ?? ""}`,
29
+ config: {
30
+ ...e.config,
31
+ search: !0,
32
+ multiSelect: !1
33
+ }
34
+ });
35
+ }
36
+ function V(e) {
37
+ return /* @__PURE__ */ o(z, {
38
+ ...e,
39
+ className: `rv-multi-select ${e.className ?? ""}`,
40
+ config: {
41
+ ...e.config,
42
+ multiSelect: !0
43
+ }
44
+ });
45
+ }
46
+ function H(t) {
47
+ return k(e, t);
48
+ }
49
+ function U(t) {
50
+ return A(e, t);
51
+ }
52
+ function W({ open: e, anchor: t, appendTo: n, onClose: r, children: s, label: c, className: l = "", role: u = "dialog" }) {
53
+ let d = a(null), f = a(r);
54
+ return f.current = r, i(() => {
55
+ if (!e || !t || !d.current) return;
56
+ let r = d.current, i = new E(), a = !0;
57
+ i.open({
58
+ anchor: t,
59
+ appendTo: n,
60
+ content: d.current,
61
+ display: u === "menu" ? "grid" : void 0,
62
+ onClose: () => {
63
+ a && f.current();
64
+ }
65
+ });
66
+ let o = u === "menu" ? O(r, () => i.close()) : void 0;
67
+ return () => {
68
+ a = !1, o?.(), i.destroy(), r.hidden = !0;
69
+ };
70
+ }, [
71
+ e,
72
+ t,
73
+ u,
74
+ n
75
+ ]), /* @__PURE__ */ o("div", {
76
+ ref: d,
77
+ class: `rv-popover ${u === "menu" ? "rv-menu " : ""}${l}`,
78
+ role: u,
79
+ "aria-label": c,
80
+ hidden: !e,
81
+ children: e ? s : null
82
+ });
83
+ }
84
+ function ne({ text: e, children: t }) {
85
+ let n = a(null);
86
+ return i(() => {
87
+ let t = n.current;
88
+ if (!t) return;
89
+ let r = new D(), i, a = () => {
90
+ let n = t.querySelector("button, input, a[href], [tabindex]") ?? t;
91
+ n !== i && (r.bind(n, e), i = n);
92
+ };
93
+ a();
94
+ let o = new t.ownerDocument.defaultView.MutationObserver(a);
95
+ return o.observe(t, {
96
+ childList: !0,
97
+ subtree: !0,
98
+ attributes: !0,
99
+ attributeFilter: ["href", "tabindex"]
100
+ }), t.addEventListener("focus", a, !0), t.addEventListener("pointerenter", a, !0), () => {
101
+ o.disconnect(), t.removeEventListener("focus", a, !0), t.removeEventListener("pointerenter", a, !0), r.destroy();
102
+ };
103
+ }, [e]), /* @__PURE__ */ o("span", {
104
+ ref: n,
105
+ class: "rv-tooltip-anchor",
106
+ children: t
107
+ });
108
+ }
109
+ function G({ open: e, title: r, closeLabel: s, onClose: l, children: u, footer: d, draggable: f, returnFocus: p }) {
110
+ let m = a(null), h = a(l);
111
+ h.current = l;
112
+ let [g, _] = n();
113
+ return i(() => {
114
+ if (!e || !m.current) {
115
+ _(void 0);
116
+ return;
117
+ }
118
+ let t = new T(m.current.ownerDocument), n = !0, i = t.open({
119
+ title: r,
120
+ closeLabel: s,
121
+ draggable: f,
122
+ returnFocus: p,
123
+ surfaceClass: "rv-ui-dialog",
124
+ onClose: () => {
125
+ _(void 0), n && h.current();
126
+ }
127
+ });
128
+ return _({
129
+ body: i.body,
130
+ footer: i.footer
131
+ }), () => {
132
+ n = !1, t.destroy();
133
+ };
134
+ }, [
135
+ e,
136
+ r,
137
+ s,
138
+ f,
139
+ p
140
+ ]), /* @__PURE__ */ o(t, { children: [
141
+ /* @__PURE__ */ o("span", {
142
+ ref: m,
143
+ hidden: !0
144
+ }),
145
+ g && c(u, g.body),
146
+ g && d && c(d, g.footer)
147
+ ] });
148
+ }
149
+ function re({ onConfirm: e, confirmLabel: n, cancelLabel: r, pending: i, ...a }) {
150
+ return /* @__PURE__ */ o(G, {
151
+ ...a,
152
+ footer: /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(_, {
153
+ disabled: i,
154
+ onClick: a.onClose,
155
+ children: r
156
+ }), /* @__PURE__ */ o(_, {
157
+ variant: "primary",
158
+ disabled: i,
159
+ onClick: e,
160
+ children: n
161
+ })] })
162
+ });
163
+ }
164
+ function ie({ value: e, onChange: t, label: r, openLabel: a, disabled: c, readOnly: l, ...u }) {
165
+ let [d, f] = n(!1), [p, m] = n(null), [h, g] = n(e && M(e) ? e : P()), [v, y] = n(N(h, u.calendarSystem)), [b] = n(() => S("rv-date-picker"));
166
+ return i(() => {
167
+ (c || l) && f(!1);
168
+ }, [c, l]), /* @__PURE__ */ o("div", {
169
+ class: "rv-date-picker",
170
+ children: [
171
+ /* @__PURE__ */ o(L, {
172
+ label: r,
173
+ value: e ?? "",
174
+ minDate: u.minDate,
175
+ maxDate: u.maxDate,
176
+ disabled: c,
177
+ readOnly: l,
178
+ onChange: (e) => {
179
+ typeof e != "string" || c || l || e && (u.minDate && e < u.minDate || u.maxDate && e > u.maxDate) || (!e || M(e)) && t(e || void 0);
180
+ }
181
+ }),
182
+ /* @__PURE__ */ o(_, {
183
+ ref: m,
184
+ "aria-label": a,
185
+ "aria-haspopup": "dialog",
186
+ "aria-expanded": d,
187
+ "aria-controls": b,
188
+ disabled: c || l,
189
+ onClick: () => {
190
+ e && M(e) && (g(e), y(N(e, u.calendarSystem))), f(!d);
191
+ },
192
+ children: /* @__PURE__ */ o(s, { svg: I })
193
+ }),
194
+ /* @__PURE__ */ o(W, {
195
+ open: d,
196
+ anchor: p,
197
+ onClose: () => f(!1),
198
+ label: r,
199
+ children: /* @__PURE__ */ o("div", {
200
+ id: b,
201
+ children: /* @__PURE__ */ o(R, {
202
+ ...u,
203
+ month: v,
204
+ focusedDate: h,
205
+ selection: e ? {
206
+ from: e,
207
+ to: e
208
+ } : void 0,
209
+ onMonthChange: y,
210
+ onFocusedDateChange: g,
211
+ onSelect: (e) => {
212
+ t(e), f(!1), p?.focus();
213
+ }
214
+ })
215
+ })
216
+ })
217
+ ]
218
+ });
219
+ }
220
+ function ae({ value: e, onChange: t, label: r, fromLabel: a, toLabel: c, openLabel: l, disabled: u, readOnly: d, ...f }) {
221
+ let [p, m] = n(!1), [h, g] = n(null), [v, y] = n(), [b, x] = n(e?.from ?? P()), [C, w] = n(N(b, f.calendarSystem)), [T] = n(() => S("rv-date-picker"));
222
+ i(() => {
223
+ (u || d) && (m(!1), y(void 0));
224
+ }, [u, d]);
225
+ let E = (n, r) => {
226
+ if (u || d || !M(r) || f.minDate && r < f.minDate || f.maxDate && r > f.maxDate) return;
227
+ let i = r;
228
+ t(F(n === "from" ? i : e?.from ?? i, n === "to" ? i : e?.to ?? i));
229
+ };
230
+ return /* @__PURE__ */ o("div", {
231
+ class: "rv-date-range-picker",
232
+ role: "group",
233
+ "aria-label": r,
234
+ children: [
235
+ /* @__PURE__ */ o(L, {
236
+ label: a,
237
+ value: e?.from ?? "",
238
+ disabled: u,
239
+ readOnly: d,
240
+ minDate: f.minDate,
241
+ maxDate: f.maxDate,
242
+ onChange: (e) => {
243
+ typeof e == "string" && E("from", e);
244
+ }
245
+ }),
246
+ /* @__PURE__ */ o(L, {
247
+ label: c,
248
+ value: e?.to ?? "",
249
+ disabled: u,
250
+ readOnly: d,
251
+ minDate: f.minDate,
252
+ maxDate: f.maxDate,
253
+ onChange: (e) => {
254
+ typeof e == "string" && E("to", e);
255
+ }
256
+ }),
257
+ /* @__PURE__ */ o(_, {
258
+ ref: g,
259
+ disabled: u || d,
260
+ "aria-label": l,
261
+ "aria-haspopup": "dialog",
262
+ "aria-expanded": p,
263
+ "aria-controls": T,
264
+ onClick: () => {
265
+ y(void 0), e && (x(e.from), w(N(e.from, f.calendarSystem))), m(!p);
266
+ },
267
+ children: /* @__PURE__ */ o(s, { svg: I })
268
+ }),
269
+ /* @__PURE__ */ o(W, {
270
+ open: p,
271
+ anchor: h,
272
+ onClose: () => {
273
+ m(!1), y(void 0);
274
+ },
275
+ label: r,
276
+ children: /* @__PURE__ */ o("div", {
277
+ id: T,
278
+ children: /* @__PURE__ */ o(R, {
279
+ ...f,
280
+ month: C,
281
+ focusedDate: b,
282
+ selection: v ? F(v, b) : e,
283
+ onMonthChange: w,
284
+ onFocusedDateChange: x,
285
+ onSelect: (e) => {
286
+ v ? (t(F(v, e)), y(void 0), m(!1), h?.focus()) : y(e);
287
+ }
288
+ })
289
+ })
290
+ })
291
+ ]
292
+ });
293
+ }
294
+ //#endregion
295
+ //#region src/pdf-viewer/translations.ts
296
+ var K = {
297
+ viewer: "PDF document",
298
+ pages: "Document pages",
299
+ toolbar: "PDF tools",
300
+ first: "First page",
301
+ last: "Last page",
302
+ open: "Open PDF",
303
+ previous: "Previous page",
304
+ next: "Next page",
305
+ zoomPercentage: "{percent}%",
306
+ page: "Page",
307
+ of: "of",
308
+ zoom: "Zoom",
309
+ zoomIn: "Zoom in",
310
+ zoomOut: "Zoom out",
311
+ fitWidth: "Fit width",
312
+ fitPage: "Fit page",
313
+ rotate: "Rotate clockwise",
314
+ search: "Find in document",
315
+ previousMatch: "Previous match",
316
+ nextMatch: "Next match",
317
+ closeSearch: "Close search",
318
+ matches: "matches",
319
+ noMatches: "No matches",
320
+ searching: "Searching…",
321
+ download: "Download PDF",
322
+ print: "Print PDF",
323
+ printing: "Preparing print…",
324
+ loading: "Loading PDF…",
325
+ empty: "Open a PDF to get started",
326
+ emptyHint: "View, search, print and download your document.",
327
+ errorDescription: "Check the document and try again.",
328
+ operationError: "Unable to complete the PDF operation. Try again.",
329
+ printDocument: "PDF print document",
330
+ pageCount: "{of} {pages}",
331
+ pageSummary: "{page} {of} {pages}",
332
+ matchSummary: "{match} / {total} {matches}",
333
+ error: "Unable to display this PDF",
334
+ retry: "Retry",
335
+ more: "More PDF tools",
336
+ cancelPrint: "Cancel printing"
337
+ };
338
+ function q(e, t) {
339
+ return e.replace(/\{(\w+)\}/g, (e, n) => String(t[n] ?? e));
340
+ }
341
+ function J(e) {
342
+ return {
343
+ ...K,
344
+ ...Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => typeof e == "string"))
345
+ };
346
+ }
347
+ //#endregion
348
+ //#region src/pdf-viewer/toolbar-options.ts
349
+ function Y(e) {
350
+ return e === !1 ? { tools: [] } : Array.isArray(e) ? { tools: e } : e ?? {};
351
+ }
352
+ function X(e, t) {
353
+ let n = Y(e);
354
+ return t === "navigation" && (!n.boundaryButtons || n.buttons?.first === !1 && n.buttons?.last === !1) && n.buttons?.previous === !1 && n.buttons?.next === !1 && n.showPageInput === !1 && n.showPageCount === !1 || t === "zoom" && n.buttons?.zoomOut === !1 && n.buttons?.zoomIn === !1 && n.showZoomSelect === !1 ? !1 : (!n.tools || n.tools.includes(t)) && (![
355
+ "open",
356
+ "search",
357
+ "rotate",
358
+ "download",
359
+ "print"
360
+ ].includes(t) || n.buttons?.[t] !== !1);
361
+ }
362
+ //#endregion
363
+ //#region src/pdf-viewer/icons.ts
364
+ var Z = {
365
+ previous: b,
366
+ next: x,
367
+ document: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l80 0 0-112c0-35.3 28.7-64 64-64l176 0 0-165.5c0-17-6.7-33.3-18.7-45.3L290.7 18.7C278.7 6.7 262.5 0 245.5 0L96 0zM357.5 176L264 176c-13.3 0-24-10.7-24-24L240 58.5 357.5 176zM240 380c-11 0-20 9-20 20l0 128c0 11 9 20 20 20s20-9 20-20l0-28 12 0c33.1 0 60-26.9 60-60s-26.9-60-60-60l-32 0zm32 80l-12 0 0-40 12 0c11 0 20 9 20 20s-9 20-20 20zm96-80c-11 0-20 9-20 20l0 128c0 11 9 20 20 20l32 0c28.7 0 52-23.3 52-52l0-64c0-28.7-23.3-52-52-52l-32 0zm20 128l0-88 12 0c6.6 0 12 5.4 12 12l0 64c0 6.6-5.4 12-12 12l-12 0zm88-108l0 128c0 11 9 20 20 20s20-9 20-20l0-44 28 0c11 0 20-9 20-20s-9-20-20-20l-28 0 0-24 28 0c11 0 20-9 20-20s-9-20-20-20l-48 0c-11 0-20 9-20 20z\"/></svg>",
368
+ open: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M56 225.6L32.4 296.2 32.4 96c0-35.3 28.7-64 64-64l138.7 0c13.8 0 27.3 4.5 38.4 12.8l38.4 28.8c5.5 4.2 12.3 6.4 19.2 6.4l117.3 0c35.3 0 64 28.7 64 64l0 16-365.4 0c-41.3 0-78 26.4-91.1 65.6zM477.8 448L99 448c-32.8 0-55.9-32.1-45.5-63.2l48-144C108 221.2 126.4 208 147 208l378.8 0c32.8 0 55.9 32.1 45.5 63.2l-48 144c-6.5 19.6-24.9 32.8-45.5 32.8z\"/></svg>",
369
+ search: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z\"/></svg>",
370
+ minus: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32z\"/></svg>",
371
+ plus: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M256 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-160z\"/></svg>",
372
+ rotate: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M488 192l-144 0c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l46.7-46.7c-75.3-58.6-184.3-53.3-253.5 15.9-75 75-75 196.5 0 271.5s196.5 75 271.5 0c8.2-8.2 15.5-16.9 21.9-26.1 10.1-14.5 30.1-18 44.6-7.9s18 30.1 7.9 44.6c-8.5 12.2-18.2 23.8-29.1 34.7-100 100-262.1 100-362 0S-25 175 75 75c94.3-94.3 243.7-99.6 344.3-16.2L471 7c6.9-6.9 17.2-8.9 26.2-5.2S512 14.3 512 24l0 144c0 13.3-10.7 24-24 24z\"/></svg>",
373
+ download: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 210.7-41.4-41.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 242.7 256 32zM64 320c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-46.9 0-56.6 56.6c-31.2 31.2-81.9 31.2-113.1 0L110.9 320 64 320zm304 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\"/></svg>",
374
+ print: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M64 64C64 28.7 92.7 0 128 0L341.5 0c17 0 33.3 6.7 45.3 18.7l42.5 42.5c12 12 18.7 28.3 18.7 45.3l0 37.5-384 0 0-80zM0 256c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 96c0 17.7-14.3 32-32 32l-32 0 0 64c0 35.3-28.7 64-64 64l-256 0c-35.3 0-64-28.7-64-64l0-64-32 0c-17.7 0-32-14.3-32-32l0-96zM128 416l0 32 256 0 0-96-256 0 0 64zM456 272a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"/></svg>",
375
+ close: w,
376
+ up: ee,
377
+ down: C,
378
+ more: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M64 144a56 56 0 1 1 0-112 56 56 0 1 1 0 112zm0 224c30.9 0 56 25.1 56 56s-25.1 56-56 56-56-25.1-56-56 25.1-56 56-56zm56-112c0 30.9-25.1 56-56 56s-56-25.1-56-56 25.1-56 56-56 56 25.1 56 56z\"/></svg>"
379
+ };
380
+ //#endregion
381
+ //#region src/pdf-viewer/toolbar.tsx
382
+ function Q(e) {
383
+ let { controller: r, state: c } = e, p = J(e.text), v = Y(e.config), y = c.status === "ready", b = (e) => v.buttons?.[e] !== !1, x = (e) => {
384
+ let t = v.buttons?.[e];
385
+ return t === !1 ? {} : t ?? {};
386
+ }, S = (t) => X(e.config, t), [C, w] = n(!1), T = a(null), E = a(null), [D, O] = n(String(c.page || "")), k = Number.isFinite(v.zoomStep) && v.zoomStep > 1 ? v.zoomStep : 1.25, A = [...new Set((v.zoomLevels ?? [
387
+ "page-width",
388
+ "page-fit",
389
+ .5,
390
+ .75,
391
+ 1,
392
+ 1.25,
393
+ 1.5,
394
+ 2,
395
+ 3,
396
+ 5
397
+ ]).filter((e) => e === "page-width" || e === "page-fit" || typeof e == "number" && Number.isFinite(e) && e >= .25 && e <= 5))];
398
+ A.includes(c.zoom) || A.push(c.zoom), i(() => {
399
+ O(String(c.page || ""));
400
+ }, [c.page, r]), i(() => {
401
+ w(!1);
402
+ }, [
403
+ e.config,
404
+ y,
405
+ r
406
+ ]), i(() => {
407
+ if (!C) return;
408
+ E.current?.querySelector("[role=\"menuitem\"]:not(:disabled)")?.focus();
409
+ let e = T.current, t = new ResizeObserver(() => {
410
+ e && !e.getClientRects().length && w(!1);
411
+ });
412
+ return e && t.observe(e), () => t.disconnect();
413
+ }, [C]);
414
+ let j = () => {
415
+ w(!1), T.current?.focus({ preventScroll: !0 });
416
+ }, M = () => {
417
+ D.trim() && Number.isFinite(Number(D)) && r.goToPage(Number(D)), O(String(r.snapshot.page));
418
+ };
419
+ return [
420
+ "open",
421
+ "navigation",
422
+ "zoom",
423
+ "search",
424
+ "rotate",
425
+ "download",
426
+ "print"
427
+ ].some(S) ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(d, {
428
+ label: p.toolbar,
429
+ className: `rv-pdf-viewer__toolbar rv-toolbar--surface ${v.className ?? ""}`,
430
+ children: [
431
+ S("open") && /* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(_, {
432
+ variant: "ghost",
433
+ size: "compact",
434
+ ...x("open"),
435
+ title: x("open").title ?? p.open,
436
+ "aria-label": p.open,
437
+ onClick: () => e.onOpen(),
438
+ children: [/* @__PURE__ */ o(s, { svg: Z.open }), /* @__PURE__ */ o("span", {
439
+ class: "rv-pdf-viewer__open-label",
440
+ children: p.open
441
+ })]
442
+ }) }),
443
+ S("navigation") && (v.boundaryButtons || b("previous") || b("next") || v.showPageInput !== !1 || v.showPageCount !== !1) && /* @__PURE__ */ o(f, {
444
+ label: p.page,
445
+ children: /* @__PURE__ */ o(m, {
446
+ page: c.page - 1,
447
+ pageCount: c.pageCount,
448
+ onChange: (e) => r.goToPage(e + 1),
449
+ label: p.page,
450
+ previousLabel: p.previous,
451
+ nextLabel: p.next,
452
+ firstLabel: p.first,
453
+ lastLabel: p.last,
454
+ variant: "icons",
455
+ disabled: !y,
456
+ boundaryButtons: v.boundaryButtons,
457
+ buttons: {
458
+ first: v.buttons?.first,
459
+ previous: v.buttons?.previous,
460
+ next: v.buttons?.next,
461
+ last: v.buttons?.last
462
+ },
463
+ children: [v.showPageInput !== !1 && /* @__PURE__ */ o(l, {
464
+ class: "rv-pdf-viewer__page-input",
465
+ type: "number",
466
+ min: 1,
467
+ max: c.pageCount || 1,
468
+ disabled: !y,
469
+ "aria-label": p.page,
470
+ value: D,
471
+ onInput: (e) => O(e.currentTarget.value),
472
+ onChange: M,
473
+ onKeyDown: (e) => {
474
+ e.key === "Enter" && (e.preventDefault(), M()), e.key === "Escape" && (e.preventDefault(), O(String(c.page)));
475
+ }
476
+ }), v.showPageCount !== !1 && /* @__PURE__ */ o("span", {
477
+ class: "rv-pdf-viewer__page-count",
478
+ children: q(p.pageCount, {
479
+ of: p.of,
480
+ pages: c.pageCount
481
+ })
482
+ })]
483
+ })
484
+ }),
485
+ S("zoom") && (b("zoomOut") || b("zoomIn") || v.showZoomSelect !== !1) && /* @__PURE__ */ o(f, {
486
+ label: p.zoom,
487
+ children: [
488
+ b("zoomOut") && /* @__PURE__ */ o(g, {
489
+ ...x("zoomOut"),
490
+ label: p.zoomOut,
491
+ icon: Z.minus,
492
+ size: "compact",
493
+ disabled: !y || c.scale <= .25 || !!x("zoomOut").disabled,
494
+ onClick: () => r.setZoom(c.scale / k)
495
+ }),
496
+ v.showZoomSelect !== !1 && /* @__PURE__ */ o("div", {
497
+ class: "rv-pdf-viewer__zoom-select",
498
+ children: [/* @__PURE__ */ o(u, {
499
+ "aria-label": p.zoom,
500
+ disabled: !y,
501
+ value: String(c.zoom),
502
+ onChange: (e) => {
503
+ let t = e.currentTarget.value;
504
+ r.setZoom(t === "page-fit" || t === "page-width" ? t : Number(t));
505
+ },
506
+ children: A.map((e) => /* @__PURE__ */ o("option", {
507
+ value: e,
508
+ children: e === "page-width" ? p.fitWidth : e === "page-fit" ? p.fitPage : q(p.zoomPercentage, { percent: Math.round(e * 100) })
509
+ }, String(e)))
510
+ }), /* @__PURE__ */ o(s, { svg: Z.down })]
511
+ }),
512
+ b("zoomIn") && /* @__PURE__ */ o(g, {
513
+ ...x("zoomIn"),
514
+ label: p.zoomIn,
515
+ icon: Z.plus,
516
+ size: "compact",
517
+ disabled: !y || c.scale >= 5 || !!x("zoomIn").disabled,
518
+ onClick: () => r.setZoom(c.scale * k)
519
+ })
520
+ ]
521
+ }),
522
+ S("search") && /* @__PURE__ */ o(f, { children: b("search") && /* @__PURE__ */ o(g, {
523
+ ...x("search"),
524
+ label: p.search,
525
+ icon: Z.search,
526
+ size: "compact",
527
+ disabled: !y || !!x("search").disabled,
528
+ "aria-expanded": e.searchOpen,
529
+ "aria-controls": e.searchId,
530
+ "aria-keyshortcuts": "Control+f Meta+f",
531
+ onClick: (t) => e.onToggleSearch(t.currentTarget)
532
+ }) }),
533
+ (S("rotate") || S("download") || S("print")) && /* @__PURE__ */ o(f, {
534
+ className: "rv-pdf-viewer__actions rv-pdf-viewer__desktop-actions",
535
+ children: [
536
+ S("rotate") && /* @__PURE__ */ o(g, {
537
+ ...x("rotate"),
538
+ label: p.rotate,
539
+ icon: Z.rotate,
540
+ size: "compact",
541
+ disabled: !y || !!x("rotate").disabled,
542
+ onClick: () => r.rotate()
543
+ }),
544
+ S("download") && /* @__PURE__ */ o(g, {
545
+ ...x("download"),
546
+ label: p.download,
547
+ icon: Z.download,
548
+ size: "compact",
549
+ disabled: !y || !!x("download").disabled,
550
+ onClick: () => void r.download()
551
+ }),
552
+ S("print") && /* @__PURE__ */ o(g, {
553
+ ...x("print"),
554
+ label: p.print,
555
+ icon: Z.print,
556
+ size: "compact",
557
+ disabled: !y || c.printing || !!x("print").disabled,
558
+ busy: c.printing,
559
+ onClick: () => void r.print()
560
+ })
561
+ ]
562
+ }),
563
+ (S("rotate") || S("download") || S("print")) && /* @__PURE__ */ o(f, {
564
+ className: "rv-pdf-viewer__more",
565
+ children: /* @__PURE__ */ o(_, {
566
+ ref: T,
567
+ variant: "ghost",
568
+ size: "compact",
569
+ className: "rv-btn-icon",
570
+ title: p.more,
571
+ "aria-label": p.more,
572
+ "aria-haspopup": "menu",
573
+ "aria-expanded": C,
574
+ disabled: !y,
575
+ onClick: () => w(!C),
576
+ onKeyDown: (e) => {
577
+ e.key === "ArrowDown" && (e.preventDefault(), w(!0));
578
+ },
579
+ children: /* @__PURE__ */ o(s, { svg: Z.more })
580
+ })
581
+ })
582
+ ]
583
+ }), /* @__PURE__ */ o(W, {
584
+ open: C,
585
+ anchor: T.current,
586
+ appendTo: e.appendTo,
587
+ onClose: () => w(!1),
588
+ role: "menu",
589
+ label: p.more,
590
+ children: /* @__PURE__ */ o("div", {
591
+ ref: E,
592
+ class: "rv-pdf-viewer__menu",
593
+ children: [
594
+ S("rotate") && /* @__PURE__ */ o(h, {
595
+ className: x("rotate").className,
596
+ disabled: !!x("rotate").disabled,
597
+ onClick: () => {
598
+ r.rotate(), j();
599
+ },
600
+ children: [/* @__PURE__ */ o(s, { svg: Z.rotate }), p.rotate]
601
+ }),
602
+ S("download") && /* @__PURE__ */ o(h, {
603
+ className: x("download").className,
604
+ disabled: !!x("download").disabled,
605
+ onClick: () => {
606
+ r.download(), j();
607
+ },
608
+ children: [/* @__PURE__ */ o(s, { svg: Z.download }), p.download]
609
+ }),
610
+ S("print") && /* @__PURE__ */ o(h, {
611
+ className: x("print").className,
612
+ disabled: c.printing || !!x("print").disabled,
613
+ onClick: () => {
614
+ r.print(), j();
615
+ },
616
+ children: [/* @__PURE__ */ o(s, { svg: Z.print }), p.print]
617
+ })
618
+ ]
619
+ })
620
+ })] }) : null;
621
+ }
622
+ //#endregion
623
+ //#region src/pdf-viewer/search-bar.tsx
624
+ function oe({ id: e, controller: t, state: n, text: r, onClose: a, inputRef: c }) {
625
+ let l = n.status === "ready";
626
+ return i(() => {
627
+ c.current?.focus();
628
+ }, []), /* @__PURE__ */ o("div", {
629
+ id: e,
630
+ class: "rv-pdf-viewer__search",
631
+ role: "search",
632
+ "aria-label": r.search,
633
+ onKeyDown: (e) => {
634
+ e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), a());
635
+ },
636
+ children: [/* @__PURE__ */ o(j, {
637
+ icon: /* @__PURE__ */ o(s, { svg: Z.search }),
638
+ inputRef: c,
639
+ "aria-label": r.search,
640
+ placeholder: r.search,
641
+ value: n.query,
642
+ disabled: !l,
643
+ onValueChange: (e) => t.search(e),
644
+ onKeyDown: (e) => {
645
+ e.key === "Enter" && (e.preventDefault(), t.search(n.query, e.shiftKey, !0));
646
+ }
647
+ }), /* @__PURE__ */ o("div", {
648
+ class: "rv-pdf-viewer__find-controls",
649
+ children: [
650
+ /* @__PURE__ */ o("span", {
651
+ role: "status",
652
+ class: "rv-pdf-viewer__matches",
653
+ children: n.query ? n.searching ? r.searching : n.matchCount ? q(r.matchSummary, {
654
+ match: n.match,
655
+ total: n.matchCount,
656
+ matches: r.matches
657
+ }) : r.noMatches : ""
658
+ }),
659
+ /* @__PURE__ */ o(g, {
660
+ label: r.previousMatch,
661
+ icon: Z.up,
662
+ size: "compact",
663
+ disabled: !l || !n.matchCount,
664
+ onClick: () => t.search(n.query, !0, !0)
665
+ }),
666
+ /* @__PURE__ */ o(g, {
667
+ label: r.nextMatch,
668
+ icon: Z.down,
669
+ size: "compact",
670
+ disabled: !l || !n.matchCount,
671
+ onClick: () => t.search(n.query, !1, !0)
672
+ }),
673
+ /* @__PURE__ */ o(g, {
674
+ label: r.closeSearch,
675
+ icon: Z.close,
676
+ size: "compact",
677
+ onClick: a
678
+ })
679
+ ]
680
+ })]
681
+ });
682
+ }
683
+ //#endregion
684
+ //#region src/pdf-viewer/header.tsx
685
+ function se({ state: e, text: n, onCancelPrint: r, showDetails: i = !0 }) {
686
+ let a = e.status === "ready";
687
+ return /* @__PURE__ */ o("header", {
688
+ class: "rv-pdf-viewer__header",
689
+ children: [
690
+ i && /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(s, {
691
+ svg: Z.document,
692
+ className: "rv-svg-icon rv-pdf-viewer__document-icon"
693
+ }), /* @__PURE__ */ o("span", {
694
+ class: "rv-pdf-viewer__filename",
695
+ title: e.fileName,
696
+ children: e.fileName
697
+ })] }),
698
+ /* @__PURE__ */ o("span", {
699
+ class: "rv-pdf-viewer__summary",
700
+ "aria-live": "polite",
701
+ children: e.printing ? n.printing : a ? q(n.pageSummary, {
702
+ page: e.page,
703
+ of: n.of,
704
+ pages: e.pageCount
705
+ }) : ""
706
+ }),
707
+ e.printing && /* @__PURE__ */ o(_, {
708
+ variant: "ghost",
709
+ size: "compact",
710
+ onClick: () => r(),
711
+ children: n.cancelPrint
712
+ })
713
+ ]
714
+ });
715
+ }
716
+ //#endregion
717
+ //#region src/pdf-viewer/status.tsx
718
+ function ce({ state: e, text: n, controller: r, canOpen: i, onOpen: a }) {
719
+ return e.status === "loading" ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(p, { label: n.loading }), /* @__PURE__ */ o("span", { children: n.loading })] }) : e.status === "error" ? /* @__PURE__ */ o(y, {
720
+ tone: "danger",
721
+ title: n.error,
722
+ description: n.errorDescription,
723
+ actions: /* @__PURE__ */ o(t, { children: [r.canRetry && /* @__PURE__ */ o(_, {
724
+ size: "compact",
725
+ onClick: () => void r.retry(),
726
+ children: n.retry
727
+ }), i && /* @__PURE__ */ o(_, {
728
+ size: "compact",
729
+ onClick: () => a(),
730
+ children: n.open
731
+ })] })
732
+ }) : /* @__PURE__ */ o(v, {
733
+ title: n.empty,
734
+ description: n.emptyHint,
735
+ children: i && /* @__PURE__ */ o(_, {
736
+ variant: "primary",
737
+ onClick: () => a(),
738
+ children: n.open
739
+ })
740
+ });
741
+ }
742
+ //#endregion
743
+ //#region src/pdf-viewer/component.tsx
744
+ function le(e) {
745
+ let t = r(() => new te(e), [
746
+ e.workerSrc,
747
+ e.documentOptions,
748
+ e.initialPage,
749
+ e.initialZoom,
750
+ e.l10n
751
+ ]);
752
+ return /* @__PURE__ */ o($, {
753
+ ...e,
754
+ controller: t
755
+ });
756
+ }
757
+ function $(e) {
758
+ let { controller: t } = e, [r, s] = n(t.snapshot), [c, u] = n(!1), [d] = n(() => S("rv-pdf-search")), f = a(null), p = a(null), m = a(null), h = a(null), g = a(null), _ = J(e.text), v = r.status === "ready", b = Y(e.toolbar).buttons, x = (e) => {
759
+ let t = b?.[e];
760
+ return t !== !1 && !t?.disabled;
761
+ }, C = X(e.toolbar, "search") && x("search"), w = X(e.toolbar, "open") && x("open");
762
+ t.setCallbacks(e), t.setPrintTitle(_.printDocument), i(() => {
763
+ let n = t.subscribe(s);
764
+ return t.attach(m.current).catch(() => {}), e.onReady?.(t), () => {
765
+ n(), t.destroy();
766
+ };
767
+ }, [t]), i(() => {
768
+ t.load(e.source ?? null, e.fileName);
769
+ }, [
770
+ t,
771
+ e.source,
772
+ e.fileName
773
+ ]);
774
+ let T = () => {
775
+ t.clearSearch(), u(!1);
776
+ let e = f.current;
777
+ e?.isConnected && !e.hasAttribute("disabled") ? e.focus({ preventScroll: !0 }) : m.current?.focus({ preventScroll: !0 });
778
+ }, E = (e) => {
779
+ c || (f.current = e), u(!0), g.current?.focus();
780
+ };
781
+ i(() => {
782
+ C || (t.clearSearch(), u(!1), c && m.current?.focus({ preventScroll: !0 }));
783
+ }, [C, t]);
784
+ let D = {
785
+ controller: t,
786
+ state: r,
787
+ text: _,
788
+ config: e.toolbar,
789
+ searchOpen: c,
790
+ searchId: d,
791
+ appendTo: p.current ?? void 0,
792
+ onOpen: () => h.current?.click(),
793
+ onToggleSearch: (e) => c ? T() : E(e)
794
+ };
795
+ return /* @__PURE__ */ o("section", {
796
+ ref: p,
797
+ class: `rv-pdf-viewer ${e.className ?? ""}`,
798
+ style: { height: e.height ?? 640 },
799
+ "aria-label": _.viewer,
800
+ onKeyDown: (e) => {
801
+ (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "f" && v && C && (e.preventDefault(), E(e.target));
802
+ },
803
+ children: [
804
+ (e.showHeader !== !1 || r.printing) && /* @__PURE__ */ o(se, {
805
+ showDetails: e.showHeader !== !1,
806
+ state: r,
807
+ text: _,
808
+ onCancelPrint: () => t.cancelPrint()
809
+ }),
810
+ e.toolbar !== !1 && (e.renderToolbar ? e.renderToolbar(t, r, D) : /* @__PURE__ */ o(Q, { ...D })),
811
+ /* @__PURE__ */ o(l, {
812
+ ref: h,
813
+ type: "file",
814
+ accept: "application/pdf,.pdf",
815
+ hidden: !0,
816
+ "aria-label": _.open,
817
+ onChange: (e) => {
818
+ let n = e.currentTarget.files?.[0];
819
+ e.currentTarget.value = "", n && t.load(n);
820
+ }
821
+ }),
822
+ c && C && /* @__PURE__ */ o(oe, {
823
+ inputRef: g,
824
+ id: d,
825
+ controller: t,
826
+ state: r,
827
+ text: _,
828
+ onClose: T
829
+ }),
830
+ /* @__PURE__ */ o("div", {
831
+ class: "rv-pdf-viewer__body",
832
+ "aria-busy": r.status === "loading",
833
+ children: [/* @__PURE__ */ o("div", {
834
+ ref: m,
835
+ class: "rv-pdf-viewer__viewport",
836
+ tabIndex: 0,
837
+ role: "region",
838
+ "aria-label": _.pages
839
+ }), !v && /* @__PURE__ */ o("div", {
840
+ class: "rv-pdf-viewer__status",
841
+ children: e.renderStatus ? e.renderStatus(r) : /* @__PURE__ */ o(ce, {
842
+ state: r,
843
+ text: _,
844
+ controller: t,
845
+ canOpen: w,
846
+ onOpen: D.onOpen
847
+ })
848
+ })]
849
+ }),
850
+ v && r.error && /* @__PURE__ */ o(y, {
851
+ className: "rv-pdf-viewer__error",
852
+ tone: "danger",
853
+ description: _.operationError
854
+ })
855
+ ]
856
+ });
857
+ }
858
+ //#endregion
859
+ export { H as a, ie as c, V as d, W as f, K as i, ae as l, ne as m, $ as n, B as o, U as p, Q as r, re as s, le as t, G as u };