@alfadocs/ui-kit 0.1.9 → 0.2.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.
Files changed (281) hide show
  1. package/README.md +30 -0
  2. package/dist/_chunks/accordion-DOmxGEWU.js +228 -0
  3. package/dist/_chunks/{agenda-card-DwLIxgi7.js → agenda-card-CalZqycc.js} +12 -3
  4. package/dist/_chunks/{agenda-tray-DUvengGQ.js → agenda-tray-3ffFDQZC.js} +54 -51
  5. package/dist/_chunks/{ai-prompt-input.agent-0NHYLTWD.js → ai-prompt-input-BBiDlEIS.js} +231 -231
  6. package/dist/_chunks/{alert-BlOUMkXj.js → alert-B1sj8Ss0.js} +24 -14
  7. package/dist/_chunks/{apexcharts-theme-BkSShpEy.js → apexcharts-theme-BJigns_V.js} +7 -2
  8. package/dist/_chunks/{app-frame-6d7Lu4ea.js → app-frame-CDJOgPXe.js} +7 -16
  9. package/dist/_chunks/{audio-recorder.agent--VKeykUp.js → audio-recorder-B4U1LuiQ.js} +161 -162
  10. package/dist/_chunks/{audio-visualiser-CeMPCZkd.js → audio-visualiser-ByDEFLNm.js} +25 -19
  11. package/dist/_chunks/autocomplete-D4oUZbsP.js +466 -0
  12. package/dist/_chunks/{badge-mrstWxve.js → badge-DKFbntoa.js} +16 -13
  13. package/dist/_chunks/{balance-cell-renderer-5CA7zpAi.js → balance-cell-renderer-B8zgIM-m.js} +63 -44
  14. package/dist/_chunks/{breadcrumb.agent-GM2hAKFX.js → breadcrumb-D1snXjPb.js} +165 -157
  15. package/dist/_chunks/{button-7mLWcMp_.js → button-DD_0Xdmr.js} +12 -2
  16. package/dist/_chunks/{calendar-nGEgelJs.js → calendar-zy0tUUVG.js} +13 -18
  17. package/dist/_chunks/{card-BEy58ZKp.js → card-CWzuTLYE.js} +40 -34
  18. package/dist/_chunks/{chart.agent-_pRYS17d.js → chart-BLvFl169.js} +147 -131
  19. package/dist/_chunks/chat-container-ClzsWXp2.js +220 -0
  20. package/dist/_chunks/chat-input-DOlsB1fm.js +333 -0
  21. package/dist/_chunks/{chat-message-ByouZpPP.js → chat-message-DoAhgUTj.js} +23 -13
  22. package/dist/_chunks/{collapsible.agent-DkS1jVyn.js → collapsible-CuxUBoHJ.js} +97 -99
  23. package/dist/_chunks/{color-picker-94qcBZqZ.js → color-picker-CTIcHlDF.js} +111 -45
  24. package/dist/_chunks/combobox-DCNXqbC7.js +460 -0
  25. package/dist/_chunks/command-palette-C_vgSgrI.js +441 -0
  26. package/dist/_chunks/{date-picker-BqPTn7bO.js → date-picker-B1PO1ZQP.js} +190 -181
  27. package/dist/_chunks/{date-range-picker-B2hGsffw.js → date-range-picker-mix2nEVC.js} +21 -8
  28. package/dist/_chunks/{date-time-picker-Bzt0S8yO.js → date-time-picker-Dnong_BY.js} +30 -15
  29. package/dist/_chunks/{description-list-DvJbp6Yg.js → description-list-BYA77Yud.js} +26 -23
  30. package/dist/_chunks/dialog-BPD7wlGE.js +211 -0
  31. package/dist/_chunks/dropdown-menu-CpiF6CPz.js +300 -0
  32. package/dist/_chunks/{empty-state-DQPtRp2b.js → empty-state-3CLJIXSj.js} +132 -101
  33. package/dist/_chunks/file-upload-C947ACDK.js +829 -0
  34. package/dist/_chunks/{floating-action-button-Cnw-f6AG.js → floating-action-button-C8OYj8mE.js} +9 -2
  35. package/dist/_chunks/{form-field-BfsPLTSc.js → form-field-Bmkeh7WY.js} +12 -11
  36. package/dist/_chunks/{form-field-context-94LwgYTQ.js → form-field-context-B3APVHKx.js} +4 -2
  37. package/dist/_chunks/{freemium-paywall.agent-_nQqLyRF.js → freemium-paywall-CnvceDav.js} +124 -117
  38. package/dist/_chunks/{header-BGn1mRp8.js → header-D0ULgQl3.js} +69 -68
  39. package/dist/_chunks/{icon-button-Wnnde5lc.js → icon-button-C4CGcYuz.js} +11 -3
  40. package/dist/_chunks/{kbd-8baVw3KU.js → kbd-Cglkd7CY.js} +6 -2
  41. package/dist/_chunks/{key-value-pair-JRFS9Xrh.js → key-value-pair-CgWvAIGb.js} +2 -2
  42. package/dist/_chunks/{leo-sidebar-BwINPdix.js → leo-sidebar-CfEY-xi2.js} +16 -20
  43. package/dist/_chunks/{link-QheANk74.js → link-8QmFjIz2.js} +2 -5
  44. package/dist/_chunks/list-qP6p0NTw.js +434 -0
  45. package/dist/_chunks/{logo-BpFoCL-s.js → logo-_Z-jLq80.js} +155 -26
  46. package/dist/_chunks/{matrix-rain-BEkvux64.js → matrix-rain-CRPMXcVx.js} +8 -2
  47. package/dist/_chunks/{message-card-qhoGv947.js → message-card-ChCX9Iv6.js} +63 -60
  48. package/dist/_chunks/{message-tray-xHUCra-Y.js → message-tray-n8q9ITXI.js} +71 -76
  49. package/dist/_chunks/{multi-select.agent-Do6CeQUT.js → multi-select-wqqrgjUQ.js} +326 -291
  50. package/dist/_chunks/{navigation-menu.agent-D69ND6Qq.js → navigation-menu-ClbHeawy.js} +136 -123
  51. package/dist/_chunks/{notification-card-CsVEYJE-.js → notification-card-hBlPN1-c.js} +3 -3
  52. package/dist/_chunks/{notification-tray-DTXMq42J.js → notification-tray-C5cnXbl9.js} +70 -66
  53. package/dist/_chunks/{number-input-fvGmnRy9.js → number-input-Q7wkHnvQ.js} +7 -3
  54. package/dist/_chunks/{otp-input-EglXOUue.js → otp-input-C9gUByF0.js} +6 -3
  55. package/dist/_chunks/{pagination.agent-BkZQl45y.js → pagination-3AC4zTsi.js} +234 -194
  56. package/dist/_chunks/{password-input-D6kuYXmr.js → password-input-C4LmjIH1.js} +6 -9
  57. package/dist/_chunks/{patient-shell-BRmrrUUW.js → patient-shell-BlsEUKWB.js} +10 -15
  58. package/dist/_chunks/{payment-form-BWaXas8z.js → payment-form-C3vT_npe.js} +195 -186
  59. package/dist/_chunks/{pdf-viewer.agent-BaGEDheA.js → pdf-viewer-CZIfY08H.js} +270 -241
  60. package/dist/_chunks/{phone-input-C8Op4sEc.js → phone-input-CSHJOJ13.js} +4 -9
  61. package/dist/_chunks/popover-DekUKNBk.js +293 -0
  62. package/dist/_chunks/{privacy-lock.agent-C1i1-T58.js → privacy-lock-BKsI6ReN.js} +117 -109
  63. package/dist/_chunks/progress-C11tqhoI.js +298 -0
  64. package/dist/_chunks/{recaptcha-widget.agent-BGHpU5zD.js → recaptcha-widget-NyfOfLII.js} +95 -86
  65. package/dist/_chunks/resizable-mpXXyIsN.js +483 -0
  66. package/dist/_chunks/{rich-text-editor.agent-DnE125Tz.js → rich-text-editor-C7TCIlQO.js} +298 -209
  67. package/dist/_chunks/{scroll-area-DLr5w9Dd.js → scroll-area-DEDU-lp-.js} +67 -54
  68. package/dist/_chunks/{search-bar.agent-DxFAxctc.js → search-bar-BTDfgYtg.js} +291 -268
  69. package/dist/_chunks/{search-input-Xw3cdWXW.js → search-input-CdJIEjFo.js} +116 -107
  70. package/dist/_chunks/{select-DY1Cb2Tg.js → select-y6bXV1f1.js} +84 -83
  71. package/dist/_chunks/{separator-B4wXDLNC.js → separator-CYU_bGFn.js} +2 -5
  72. package/dist/_chunks/{sheet-B9kH9pcI.js → sheet-4tgMFwj0.js} +135 -60
  73. package/dist/_chunks/{sidebar-CHF5xr_P.js → sidebar-Bx3wCDyy.js} +546 -457
  74. package/dist/_chunks/{sign-in-with-alfadocs-button-BN_FPGHT.js → sign-in-with-alfadocs-button-B9UrqOqH.js} +9 -5
  75. package/dist/_chunks/{signature-capture.agent-BpeDwFht.js → signature-capture-DjMlFOzS.js} +210 -212
  76. package/dist/_chunks/{skeleton-dtqyF09N.js → skeleton-CZbwyJAA.js} +9 -3
  77. package/dist/_chunks/{slider-CcsQTZTA.js → slider-BT2bZWsy.js} +138 -134
  78. package/dist/_chunks/{slot-grid-D_l5VsHG.js → slot-grid-CgpYgBkW.js} +105 -95
  79. package/dist/_chunks/{sparkline.agent-56Sj7nOP.js → sparkline-_gy8aJDG.js} +107 -100
  80. package/dist/_chunks/{spinner-GCcv67vh.js → spinner-DLaYfLPl.js} +66 -14
  81. package/dist/_chunks/{stat-DUB6g90R.js → stat-B9PHSPbN.js} +45 -27
  82. package/dist/_chunks/{stepper-calendar.agent-9iT3ClIB.js → stepper-calendar-BLOJUE0-.js} +189 -187
  83. package/dist/_chunks/stepper-progress-jFY8BSf7.js +208 -0
  84. package/dist/_chunks/{suggestion-chip-DhFrkRPj.js → suggestion-chip-C4Jz0LrM.js} +50 -52
  85. package/dist/_chunks/{switch-BYEH8I53.js → switch-C0psfIQF.js} +2 -2
  86. package/dist/_chunks/{tabs.agent-h7NvsTR1.js → tabs-DaFA3Muo.js} +183 -155
  87. package/dist/_chunks/{tag-BqidXKo3.js → tag-DuLMjRbF.js} +90 -32
  88. package/dist/_chunks/{task-card-CY5ztNkU.js → task-card-Dw_ZJDL8.js} +5 -2
  89. package/dist/_chunks/{task-tray-CCoUdorl.js → task-tray-XlIW9ueh.js} +50 -49
  90. package/dist/_chunks/{text-area-C_M8wliK.js → text-area-CO9Dz0qX.js} +2 -2
  91. package/dist/_chunks/{text-input-BX39e6T6.js → text-input-DZwt9L8H.js} +65 -62
  92. package/dist/_chunks/{theme-root-DDb0TJjd.js → theme-root-CSKD5ZRm.js} +9 -2
  93. package/dist/_chunks/{theme-toggle.agent-btmXTWdW.js → theme-toggle-B9zzCnvl.js} +179 -177
  94. package/dist/_chunks/{time-picker-B8AMIrX7.js → time-picker-DvPUmHH-.js} +95 -93
  95. package/dist/_chunks/{timeline.agent-CRPza9wc.js → timeline-BvmnQadS.js} +96 -96
  96. package/dist/_chunks/{toast.agent-BjEGuq1Z.js → toast.agent-BwKXA0km.js} +46 -8
  97. package/dist/_chunks/{tooth-scheme.agent-CWrQBjJM.js → tooth-scheme-3mITSXiZ.js} +146 -162
  98. package/dist/_chunks/{transcript-panel.agent-BXEYP6w-.js → transcript-panel-Bx5ANMsv.js} +110 -101
  99. package/dist/_chunks/{typing-indicator-CbUBf-Dx.js → typing-indicator-BZ5jXZPn.js} +27 -5
  100. package/dist/_chunks/{use-theme-BMUhembX.js → use-theme-B1cwAXJR.js} +2 -5
  101. package/dist/_chunks/{visually-hidden-Bw7vBHLm.js → visually-hidden-BHxEUGyT.js} +11 -2
  102. package/dist/_chunks/{warning-stack-8Pa3pekh.js → warning-stack-VygGHSqC.js} +11 -13
  103. package/dist/_chunks/{workflow-map-D2A7rTEG.js → workflow-map-C-nlogPC.js} +430 -452
  104. package/dist/agent-catalog.json +580 -15
  105. package/dist/components/_shared/index.d.ts +2 -2
  106. package/dist/components/accordion/index.d.ts +1 -1
  107. package/dist/components/accordion/index.js +5 -6
  108. package/dist/components/agenda-card/index.js +1 -1
  109. package/dist/components/agenda-tray/agenda-tray.d.ts +1 -1
  110. package/dist/components/agenda-tray/index.js +1 -1
  111. package/dist/components/ai-prompt-input/ai-prompt-input.d.ts +1 -1
  112. package/dist/components/ai-prompt-input/index.js +1 -1
  113. package/dist/components/alert/index.d.ts +1 -1
  114. package/dist/components/alert/index.js +1 -1
  115. package/dist/components/app-frame/index.js +1 -1
  116. package/dist/components/audio-recorder/index.js +1 -1
  117. package/dist/components/audio-visualiser/index.js +1 -1
  118. package/dist/components/autocomplete/index.js +1 -1
  119. package/dist/components/badge/index.js +1 -1
  120. package/dist/components/breadcrumb/breadcrumb.d.ts +1 -1
  121. package/dist/components/breadcrumb/index.js +1 -1
  122. package/dist/components/button/index.js +2 -2
  123. package/dist/components/calendar/index.js +1 -1
  124. package/dist/components/card/index.js +1 -1
  125. package/dist/components/chart/index.d.ts +1 -1
  126. package/dist/components/chart/index.js +1 -1
  127. package/dist/components/chat-container/chat-container.d.ts +1 -1
  128. package/dist/components/chat-container/index.js +2 -3
  129. package/dist/components/chat-input/chat-input.d.ts +1 -1
  130. package/dist/components/chat-input/index.js +3 -4
  131. package/dist/components/chat-message/index.js +1 -1
  132. package/dist/components/checkbox-group/index.d.ts +1 -1
  133. package/dist/components/collapsible/collapsible.d.ts +1 -1
  134. package/dist/components/collapsible/index.d.ts +1 -1
  135. package/dist/components/collapsible/index.js +1 -1
  136. package/dist/components/color-picker/index.js +1 -1
  137. package/dist/components/combobox/index.d.ts +1 -1
  138. package/dist/components/combobox/index.js +1 -1
  139. package/dist/components/command-palette/command-palette.d.ts +46 -13
  140. package/dist/components/command-palette/index.js +1 -1
  141. package/dist/components/data-table/data-table.d.ts +3 -1
  142. package/dist/components/data-table/index.js +1 -1
  143. package/dist/components/data-table/toolbar.d.ts +6 -5
  144. package/dist/components/date-picker/date-picker.d.ts +1 -1
  145. package/dist/components/date-picker/index.d.ts +1 -1
  146. package/dist/components/date-picker/index.js +1 -1
  147. package/dist/components/date-range-picker/index.js +1 -1
  148. package/dist/components/date-time-picker/index.d.ts +1 -1
  149. package/dist/components/date-time-picker/index.js +1 -1
  150. package/dist/components/description-list/description-list.d.ts +1 -2
  151. package/dist/components/description-list/index.js +1 -1
  152. package/dist/components/dialog/dialog.d.ts +2 -2
  153. package/dist/components/dialog/index.js +1 -1
  154. package/dist/components/dropdown-menu/dropdown-menu.d.ts +11 -16
  155. package/dist/components/dropdown-menu/index.js +3 -4
  156. package/dist/components/empty-state/index.js +1 -1
  157. package/dist/components/file-upload/index.d.ts +1 -1
  158. package/dist/components/file-upload/index.js +1 -1
  159. package/dist/components/floating-action-button/index.js +1 -1
  160. package/dist/components/form-field/index.js +2 -2
  161. package/dist/components/freemium-paywall/freemium-paywall.d.ts +1 -1
  162. package/dist/components/freemium-paywall/index.js +1 -1
  163. package/dist/components/header/index.js +1 -1
  164. package/dist/components/icon-button/index.js +1 -1
  165. package/dist/components/kbd/index.js +1 -1
  166. package/dist/components/key-value-pair/index.js +1 -1
  167. package/dist/components/link/index.js +1 -1
  168. package/dist/components/list/index.js +1 -1
  169. package/dist/components/logo/index.js +1 -1
  170. package/dist/components/matrix-rain/index.js +1 -1
  171. package/dist/components/message-card/index.d.ts +1 -1
  172. package/dist/components/message-card/index.js +1 -1
  173. package/dist/components/message-tray/index.js +1 -1
  174. package/dist/components/message-tray/message-tray.d.ts +1 -1
  175. package/dist/components/multi-select/index.js +1 -1
  176. package/dist/components/navigation-menu/index.js +1 -1
  177. package/dist/components/navigation-menu/navigation-menu.d.ts +1 -1
  178. package/dist/components/notification-card/index.d.ts +1 -1
  179. package/dist/components/notification-card/index.js +1 -1
  180. package/dist/components/notification-tray/index.js +1 -1
  181. package/dist/components/notification-tray/notification-tray.d.ts +1 -1
  182. package/dist/components/number-input/index.js +1 -1
  183. package/dist/components/otp-input/index.js +1 -1
  184. package/dist/components/pagination/index.js +1 -1
  185. package/dist/components/pagination/pagination.d.ts +4 -6
  186. package/dist/components/password-input/index.js +1 -1
  187. package/dist/components/payment-form/index.js +7 -8
  188. package/dist/components/payment-form/payment-form.d.ts +1 -1
  189. package/dist/components/pdf-viewer/index.js +1 -1
  190. package/dist/components/phone-input/index.d.ts +1 -1
  191. package/dist/components/phone-input/index.js +1 -1
  192. package/dist/components/popover/index.js +3 -4
  193. package/dist/components/privacy-lock/index.js +1 -1
  194. package/dist/components/privacy-lock/privacy-lock.d.ts +1 -1
  195. package/dist/components/progress/index.js +3 -4
  196. package/dist/components/recaptcha-widget/index.js +1 -1
  197. package/dist/components/resizable/index.d.ts +1 -1
  198. package/dist/components/resizable/index.js +1 -1
  199. package/dist/components/rich-text-editor/index.js +1 -1
  200. package/dist/components/scroll-area/index.js +1 -1
  201. package/dist/components/search-bar/index.js +1 -1
  202. package/dist/components/search-bar/search-bar.d.ts +1 -1
  203. package/dist/components/search-input/index.js +1 -1
  204. package/dist/components/select/index.js +1 -1
  205. package/dist/components/select/select.d.ts +1 -1
  206. package/dist/components/separator/index.js +1 -1
  207. package/dist/components/sheet/index.js +3 -4
  208. package/dist/components/sheet/sheet.d.ts +2 -2
  209. package/dist/components/sidebar/index.js +7 -8
  210. package/dist/components/sidebar/sidebar.d.ts +0 -2
  211. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  212. package/dist/components/signature-capture/index.js +1 -1
  213. package/dist/components/skeleton/index.js +1 -1
  214. package/dist/components/slider/index.js +1 -1
  215. package/dist/components/slot-grid/index.js +1 -1
  216. package/dist/components/sparkline/index.js +1 -1
  217. package/dist/components/spinner/index.js +1 -1
  218. package/dist/components/stat/index.js +1 -1
  219. package/dist/components/stepper-calendar/index.js +1 -1
  220. package/dist/components/stepper-calendar/stepper-calendar.d.ts +1 -1
  221. package/dist/components/stepper-progress/index.d.ts +1 -1
  222. package/dist/components/stepper-progress/index.js +1 -2
  223. package/dist/components/stepper-progress/stepper-progress.d.ts +1 -1
  224. package/dist/components/suggestion-chip/index.js +1 -1
  225. package/dist/components/switch/index.js +1 -1
  226. package/dist/components/tabs/index.d.ts +1 -1
  227. package/dist/components/tabs/index.js +1 -1
  228. package/dist/components/tag/index.js +1 -1
  229. package/dist/components/task-card/index.js +1 -1
  230. package/dist/components/task-tray/index.js +1 -1
  231. package/dist/components/task-tray/task-tray.d.ts +1 -1
  232. package/dist/components/text-area/index.js +1 -1
  233. package/dist/components/text-input/index.js +1 -1
  234. package/dist/components/theme-root/index.js +1 -1
  235. package/dist/components/theme-toggle/index.js +1 -1
  236. package/dist/components/theme-toggle/theme-toggle.d.ts +1 -1
  237. package/dist/components/time-picker/index.js +1 -1
  238. package/dist/components/time-picker/time-picker.d.ts +1 -1
  239. package/dist/components/timeline/index.js +1 -1
  240. package/dist/components/timeline/timeline.d.ts +1 -1
  241. package/dist/components/toast/index.js +1 -1
  242. package/dist/components/tooth-scheme/index.js +1 -1
  243. package/dist/components/tooth-scheme/tooth-scheme.d.ts +1 -1
  244. package/dist/components/transcript-panel/index.js +1 -1
  245. package/dist/components/transcript-panel/transcript-panel.d.ts +1 -1
  246. package/dist/components/typing-indicator/index.js +1 -1
  247. package/dist/components/visually-hidden/index.js +1 -1
  248. package/dist/components/warning-stack/index.js +1 -1
  249. package/dist/components/workflow/index.js +1 -1
  250. package/dist/components/workflow/workflow-editor.d.ts +1 -1
  251. package/dist/hooks/index.js +1 -1
  252. package/dist/index.js +392 -402
  253. package/dist/patterns/leo-assistant/index.js +1 -1
  254. package/dist/patterns/patient-shell/index.js +1 -1
  255. package/dist/safe-html/index.js +20 -3
  256. package/dist/tokens.css +2 -2
  257. package/package.json +12 -2
  258. package/dist/_chunks/accordion-BEnrZmAn.js +0 -120
  259. package/dist/_chunks/accordion.agent-BTjeO1Sx.js +0 -52
  260. package/dist/_chunks/autocomplete.agent-Dh7KioS6.js +0 -432
  261. package/dist/_chunks/chat-container-Dl0Kfy5a.js +0 -175
  262. package/dist/_chunks/chat-container.agent-CM4WModE.js +0 -27
  263. package/dist/_chunks/chat-input-C_tMQv92.js +0 -252
  264. package/dist/_chunks/chat-input.agent-Bsz3ckGa.js +0 -69
  265. package/dist/_chunks/combobox.agent-CAvUkkIe.js +0 -410
  266. package/dist/_chunks/command-palette.agent-HatEt_EM.js +0 -391
  267. package/dist/_chunks/dialog.agent-Daf1TTko.js +0 -179
  268. package/dist/_chunks/dropdown-menu-C7AZipNz.js +0 -219
  269. package/dist/_chunks/dropdown-menu.agent-BcxIKOjK.js +0 -43
  270. package/dist/_chunks/file-upload.agent-DJaH2dHg.js +0 -681
  271. package/dist/_chunks/list.agent-D0iWt4VI.js +0 -420
  272. package/dist/_chunks/payment-form.agent-kuIfodCj.js +0 -31
  273. package/dist/_chunks/popover-kFN8s84V.js +0 -229
  274. package/dist/_chunks/popover.agent-K_d1cfbj.js +0 -39
  275. package/dist/_chunks/progress-wNsqkw8I.js +0 -253
  276. package/dist/_chunks/progress.agent-C68rDOXL.js +0 -27
  277. package/dist/_chunks/resizable.agent-CMwZzvsi.js +0 -456
  278. package/dist/_chunks/sheet.agent-QAyTOxgk.js +0 -46
  279. package/dist/_chunks/sidebar.agent-C9TM_ZDZ.js +0 -49
  280. package/dist/_chunks/stepper-progress-Bmen-YXB.js +0 -149
  281. package/dist/_chunks/stepper-progress.agent-q9InWca4.js +0 -61
@@ -1,43 +1,89 @@
1
1
  import { jsx as a, jsxs as Z } from "react/jsx-runtime";
2
- import { forwardRef as Re, useId as Oe, useMemo as je, useState as m, useEffect as w, useRef as A, useCallback as L, useImperativeHandle as Ve } from "react";
3
- import * as de from "pdfjs-dist";
2
+ import { forwardRef as je, useId as Ve, useMemo as be, useState as m, useEffect as w, useRef as A, useCallback as L, useImperativeHandle as Fe } from "react";
3
+ import * as ce from "pdfjs-dist";
4
4
  import { c as W } from "./index-D2ZczOXr.js";
5
- import { useTranslation as ce } from "react-i18next";
5
+ import { useTranslation as le } from "react-i18next";
6
6
  import * as X from "@radix-ui/react-popover";
7
- import ze from "pdfjs-dist/build/pdf.worker.min.mjs?url";
8
- import { S as Fe } from "./spinner-GCcv67vh.js";
9
- import { A as ve } from "./alert-BlOUMkXj.js";
10
- import { X as Ee } from "./x-CCcI3eJp.js";
11
- import { C as _e } from "./chevron-left-CX1jqD2M.js";
12
- import { C as Le } from "./chevron-right-BrpYejk0.js";
13
- import { c as Pe } from "./createLucideIcon-CrFbzy84.js";
14
- import { S as Ze } from "./search-BonnQsHv.js";
15
- import { P as Be } from "./printer-CeVEWfQq.js";
7
+ import Se from "pdfjs-dist/build/pdf.worker.min.mjs?url";
8
+ import { S as Ee } from "./spinner-DLaYfLPl.js";
9
+ import { A as ye } from "./alert-B1sj8Ss0.js";
10
+ import { u as _e } from "./registry-C9nwlNyL.js";
11
+ import { X as Le } from "./x-CCcI3eJp.js";
12
+ import { C as Ze } from "./chevron-left-CX1jqD2M.js";
13
+ import { C as Be } from "./chevron-right-BrpYejk0.js";
14
+ import { c as Me } from "./createLucideIcon-CrFbzy84.js";
15
+ import { S as Ke } from "./search-BonnQsHv.js";
16
+ import { P as He } from "./printer-CeVEWfQq.js";
16
17
  /**
17
18
  * @license lucide-react v1.8.0 - ISC
18
19
  *
19
20
  * This source code is licensed under the ISC license.
20
21
  * See the LICENSE file in the root directory of this source tree.
21
22
  */
22
- const Ke = [
23
+ const Qe = [
23
24
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
24
25
  ["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
25
26
  ["line", { x1: "11", x2: "11", y1: "8", y2: "14", key: "1vmskp" }],
26
27
  ["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
27
- ], He = Pe("zoom-in", Ke);
28
+ ], We = Me("zoom-in", Qe);
28
29
  /**
29
30
  * @license lucide-react v1.8.0 - ISC
30
31
  *
31
32
  * This source code is licensed under the ISC license.
32
33
  * See the LICENSE file in the root directory of this source tree.
33
34
  */
34
- const Qe = [
35
+ const qe = [
35
36
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
36
37
  ["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
37
38
  ["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
38
- ], We = Pe("zoom-out", Qe);
39
- de.GlobalWorkerOptions.workerSrc = ze;
40
- const be = W(
39
+ ], Ue = Me("zoom-out", qe), Je = {
40
+ id: "pdf-viewer",
41
+ capabilities: ["paginate", "view_change", "filter"],
42
+ state: {},
43
+ actions: {
44
+ go_to_page: {
45
+ safety: "read",
46
+ argsType: "{ page: number }",
47
+ description: "Navigate to a specific 1-indexed page.",
48
+ invoke: (i, t) => {
49
+ i.goToPage(t.page);
50
+ }
51
+ },
52
+ set_zoom: {
53
+ safety: "read",
54
+ argsType: "{ zoom: PDFZoomPreset }",
55
+ description: "Apply a zoom preset.",
56
+ invoke: (i, t) => {
57
+ i.setZoom(t.zoom);
58
+ }
59
+ },
60
+ search: {
61
+ safety: "read",
62
+ argsType: "{ query: string }",
63
+ description: "Search the document for the given query and highlight matches.",
64
+ invoke: (i, t) => {
65
+ i.search(t.query);
66
+ }
67
+ },
68
+ print: {
69
+ safety: "read",
70
+ description: "Open the browser print dialog for the document.",
71
+ invoke: (i) => {
72
+ i.print();
73
+ }
74
+ }
75
+ },
76
+ domHooks: {
77
+ root: { attr: "data-component", value: "pdf-viewer" },
78
+ instanceId: {
79
+ attr: "data-component-id",
80
+ sourceProp: "id",
81
+ description: "Sourced from the id prop."
82
+ }
83
+ }
84
+ };
85
+ ce.GlobalWorkerOptions.workerSrc = Se;
86
+ const xe = W(
41
87
  [
42
88
  "ds:pdf-viewer-alfadocs ds:flex ds:flex-col",
43
89
  "ds:gap-[var(--spacing-sm)]",
@@ -49,7 +95,7 @@ const be = W(
49
95
  "ds:focus-visible:outline-[var(--ring)]",
50
96
  "ds:forced-colors:focus-visible:outline-[CanvasText]"
51
97
  ].join(" ")
52
- ), qe = W(
98
+ ), $e = W(
53
99
  [
54
100
  "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
55
101
  "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
@@ -57,7 +103,7 @@ const be = W(
57
103
  "ds:bg-[var(--background)]",
58
104
  "ds:border-b ds:border-[color:var(--border)]"
59
105
  ].join(" ")
60
- ), ye = W(
106
+ ), we = W(
61
107
  [
62
108
  "ds:inline-flex ds:items-center ds:justify-center",
63
109
  "ds:min-block-size-[var(--min-target-size)]",
@@ -74,7 +120,7 @@ const be = W(
74
120
  "ds:forced-colors:focus-visible:outline-[CanvasText]",
75
121
  "ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed"
76
122
  ].join(" ")
77
- ), xe = W(
123
+ ), ke = W(
78
124
  [
79
125
  "ds:min-block-size-[var(--min-target-size)]",
80
126
  "ds:inline-size-[4rem] ds:text-center",
@@ -86,7 +132,7 @@ const be = W(
86
132
  "ds:focus-visible:outline-[var(--ring)]",
87
133
  "ds:forced-colors:focus-visible:outline-[CanvasText]"
88
134
  ].join(" ")
89
- ), Ue = W(
135
+ ), Xe = W(
90
136
  [
91
137
  "ds:min-block-size-[var(--min-target-size)]",
92
138
  "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
@@ -97,7 +143,7 @@ const be = W(
97
143
  "ds:focus-visible:outline-[var(--ring)]",
98
144
  "ds:forced-colors:focus-visible:outline-[CanvasText]"
99
145
  ].join(" ")
100
- ), Je = W(
146
+ ), Ge = W(
101
147
  [
102
148
  "ds:relative ds:flex ds:flex-col ds:items-center",
103
149
  "ds:gap-[var(--spacing-md)]",
@@ -107,14 +153,14 @@ const be = W(
107
153
  "ds:min-block-size-[30rem]",
108
154
  "ds:max-block-size-[80vh]"
109
155
  ].join(" ")
110
- ), $e = W(
156
+ ), Ye = W(
111
157
  [
112
158
  "ds:relative ds:flex ds:items-center ds:justify-center",
113
159
  "ds:bg-[var(--background)]",
114
160
  "ds:shadow-[var(--shadow-md)]",
115
161
  "ds:rounded-[var(--radius-sm)]"
116
162
  ].join(" ")
117
- ), Xe = [
163
+ ), et = [
118
164
  "fit-width",
119
165
  "fit-page",
120
166
  "actual-size",
@@ -128,13 +174,13 @@ const be = W(
128
174
  function J(i) {
129
175
  return typeof i == "number";
130
176
  }
131
- function we(i, t, u) {
177
+ function ze(i, t, u) {
132
178
  if (J(i)) return i;
133
179
  if (i === "actual-size" || !u) return 1;
134
180
  const h = window.getComputedStyle(u), f = parseFloat(h.paddingInlineStart || "0") + parseFloat(h.paddingInlineEnd || "0"), g = parseFloat(h.paddingBlockStart || "0") + parseFloat(h.paddingBlockEnd || "0"), k = Math.max(u.clientWidth - f, 1), p = Math.max(u.clientHeight - g, 1), N = t.width, P = t.height;
135
181
  return i === "fit-width" ? k / N : Math.min(k / N, p / P);
136
182
  }
137
- const Ge = Re(
183
+ const tt = je(
138
184
  ({
139
185
  id: i,
140
186
  src: t,
@@ -147,7 +193,7 @@ const Ge = Re(
147
193
  ariaLabel: N,
148
194
  className: P
149
195
  }, R) => {
150
- const { t: S } = ce(), V = Oe(), B = je(
196
+ const { t: S } = le(), V = Ve(), B = be(
151
197
  () => `pdf-${V.replace(/[^a-zA-Z0-9-_]/g, "")}`,
152
198
  [V]
153
199
  ), [z, q] = m(!1), [v, K] = m(!1);
@@ -157,11 +203,7 @@ const Ge = Re(
157
203
  const e = window.matchMedia("(prefers-reduced-motion: reduce)"), r = () => K(e.matches);
158
204
  return r(), e.addEventListener("change", r), () => e.removeEventListener("change", r);
159
205
  }, []);
160
- const [s, F] = m(null), [c, b] = m(null), [l, E] = m(u), [O, y] = m(h), [I, M] = m(
161
- { start: Math.max(1, u - 1), end: u + 1 }
162
- ), [n, x] = m(""), [j, G] = m(!1), [le, ue] = m(""), [Se, Me] = m(
163
- { current: 0, total: 0 }
164
- ), Y = A(f), ee = A(g), te = A(k);
206
+ const [s, F] = m(null), [c, b] = m(null), [l, E] = m(u), [O, y] = m(h), [I, M] = m({ start: Math.max(1, u - 1), end: u + 1 }), [n, x] = m(""), [j, G] = m(!1), [ue, fe] = m(""), [Ce, Ne] = m({ current: 0, total: 0 }), Y = A(f), ee = A(g), te = A(k);
165
207
  w(() => {
166
208
  Y.current = f, ee.current = g, te.current = k;
167
209
  }, [f, g, k]);
@@ -174,7 +216,7 @@ const Ge = Re(
174
216
  const r = {
175
217
  disableJavaScript: !0,
176
218
  isEvalSupported: !1
177
- }, d = de.getDocument(
219
+ }, d = ce.getDocument(
178
220
  typeof t == "string" ? { url: t, ...r } : t instanceof Uint8Array ? { data: t, ...r } : { data: new Uint8Array(t), ...r }
179
221
  );
180
222
  return d.promise.then(
@@ -233,24 +275,23 @@ const Ge = Re(
233
275
  });
234
276
  },
235
277
  [s, v]
236
- ), fe = L((e) => {
278
+ ), pe = L((e) => {
237
279
  y(e);
238
280
  }, []), $ = L(() => {
239
281
  typeof window < "u" && window.print();
240
- }, []), pe = L((e) => {
241
- ue(e), G(e.length > 0);
242
- }, []);
243
- Ve(
244
- R,
282
+ }, []), me = L((e) => {
283
+ fe(e), G(e.length > 0);
284
+ }, []), ie = be(
245
285
  () => ({
246
286
  goToPage: D,
247
- setZoom: fe,
248
- search: pe,
287
+ setZoom: pe,
288
+ search: me,
249
289
  print: $
250
290
  }),
251
- [D, fe, pe, $]
291
+ [D, pe, me, $]
252
292
  );
253
- const Ce = L(
293
+ Fe(R, () => ie, [ie]), _e(Je, ie, i);
294
+ const Ie = L(
254
295
  (e) => {
255
296
  if (!s) return;
256
297
  const r = e.metaKey || e.ctrlKey;
@@ -279,7 +320,9 @@ const Ge = Re(
279
320
  return;
280
321
  }
281
322
  if (r && e.key === "-") {
282
- e.preventDefault(), y((d) => J(d) ? Math.max(d / 1.25, 0.25) : 0.75);
323
+ e.preventDefault(), y(
324
+ (d) => J(d) ? Math.max(d / 1.25, 0.25) : 0.75
325
+ );
283
326
  return;
284
327
  }
285
328
  if (r && e.key === "0") {
@@ -289,9 +332,9 @@ const Ge = Re(
289
332
  r && e.key.toLowerCase() === "p" && (e.preventDefault(), $());
290
333
  },
291
334
  [l, D, $, s]
292
- ), ie = A(l);
335
+ ), de = A(l);
293
336
  w(() => {
294
- ie.current = l;
337
+ de.current = l;
295
338
  }, [l]), w(() => {
296
339
  if (!s) return;
297
340
  const e = re.current;
@@ -301,13 +344,13 @@ const Ge = Re(
301
344
  for (const T of o) {
302
345
  const U = T.target.dataset.pageNumber;
303
346
  if (!U) continue;
304
- const Ae = Number(U);
305
- r.set(Ae, T.intersectionRatio);
347
+ const Oe = Number(U);
348
+ r.set(Oe, T.intersectionRatio);
306
349
  }
307
- let C = ie.current, _ = 0, H = 1 / 0, Q = -1 / 0;
350
+ let C = de.current, _ = 0, H = 1 / 0, Q = -1 / 0;
308
351
  for (const [T, U] of r.entries())
309
352
  U > _ && (C = T, _ = U), U > 0 && (H = Math.min(H, T), Q = Math.max(Q, T));
310
- _ > 0 && C !== ie.current && E(C), H !== 1 / 0 && M({
353
+ _ > 0 && C !== de.current && E(C), H !== 1 / 0 && M({
311
354
  start: Math.max(1, H - 1),
312
355
  end: Math.min(s.numPages, Q + 1)
313
356
  });
@@ -318,151 +361,140 @@ const Ge = Re(
318
361
  o && d.observe(o);
319
362
  }), () => d.disconnect();
320
363
  }, [s]);
321
- const [Ne, Ie] = m(0);
364
+ const [De, Te] = m(0);
322
365
  w(() => {
323
366
  const e = re.current;
324
367
  if (!e || typeof ResizeObserver > "u") return;
325
368
  const r = new ResizeObserver(() => {
326
- (O === "fit-width" || O === "fit-page") && Ie((d) => d + 1);
369
+ (O === "fit-width" || O === "fit-page") && Te((d) => d + 1);
327
370
  });
328
371
  return r.observe(e), () => r.disconnect();
329
372
  }, [O]);
330
- const me = A([]), [ne, he] = m(0), De = L(
373
+ const he = A([]), [ne, ge] = m(0), Ae = L(
331
374
  (e) => (r) => {
332
- me.current[e] = r;
375
+ he.current[e] = r;
333
376
  },
334
377
  []
335
- ), ge = L((e) => {
336
- const r = me.current[e];
378
+ ), ve = L((e) => {
379
+ const r = he.current[e];
337
380
  r && r.focus();
338
- }, []), ae = 8, Te = L(
381
+ }, []), ae = 8, Re = L(
339
382
  (e) => {
340
383
  const r = z ? "ArrowLeft" : "ArrowRight", d = z ? "ArrowRight" : "ArrowLeft";
341
384
  let o = null;
342
- e.key === r ? o = (ne + 1) % ae : e.key === d ? o = (ne - 1 + ae) % ae : e.key === "Home" ? o = 0 : e.key === "End" && (o = ae - 1), o !== null && (e.preventDefault(), he(o), ge(o));
385
+ e.key === r ? o = (ne + 1) % ae : e.key === d ? o = (ne - 1 + ae) % ae : e.key === "Home" ? o = 0 : e.key === "End" && (o = ae - 1), o !== null && (e.preventDefault(), ge(o), ve(o));
343
386
  },
344
- [ge, z, ne]
387
+ [ve, z, ne]
345
388
  );
346
389
  return c ? /* @__PURE__ */ a(
347
390
  "div",
348
391
  {
349
- className: [be(), P].filter(Boolean).join(" "),
392
+ className: [xe(), P].filter(Boolean).join(" "),
350
393
  "aria-label": N ?? S("pdf.error"),
351
- children: /* @__PURE__ */ a("div", { className: "ds:p-[var(--spacing-lg)]", children: /* @__PURE__ */ a(ve, { variant: "error", live: "polite", children: /* @__PURE__ */ Z(ve.Description, { children: [
394
+ children: /* @__PURE__ */ a("div", { className: "ds:p-[var(--spacing-lg)]", children: /* @__PURE__ */ a(ye, { variant: "error", live: "polite", children: /* @__PURE__ */ Z(ye.Description, { children: [
352
395
  S("pdf.error"),
353
396
  ": ",
354
397
  c.message
355
398
  ] }) }) })
356
399
  }
357
- ) : /* @__PURE__ */ Z(
358
- "div",
359
- {
360
- id: B,
361
- role: "region",
362
- "aria-label": N ?? S("pdf.toolbarLabel"),
363
- className: [be(), P].filter(Boolean).join(" "),
364
- dir: z ? "rtl" : void 0,
365
- onKeyDown: Ce,
366
- tabIndex: -1,
367
- "data-component": "pdf-viewer",
368
- "data-component-id": i,
369
- "data-pdfjs-worker-src": ze,
370
- children: [
371
- p ? /* @__PURE__ */ a(
372
- Ye,
373
- {
374
- currentPage: l,
375
- numPages: (s == null ? void 0 : s.numPages) ?? 0,
376
- zoom: O,
377
- onPrev: () => D(l - 1),
378
- onNext: () => D(l + 1),
379
- onJump: (e) => D(e),
380
- onZoomIn: () => {
381
- y(
382
- (e) => J(e) ? Math.min(e * 1.25, 4) : 1.25
383
- );
384
- },
385
- onZoomOut: () => {
386
- y(
387
- (e) => J(e) ? Math.max(e / 1.25, 0.25) : 0.75
388
- );
389
- },
390
- onZoomPreset: (e) => y(e),
391
- onOpenSearch: () => G(!0),
392
- onPrint: $,
393
- searchOpen: j,
394
- onSearchOpenChange: G,
395
- searchQuery: le,
396
- onSearchQueryChange: (e) => {
397
- ue(e);
398
- },
399
- searchMatches: Se,
400
- register: De,
401
- focusIndex: ne,
402
- setFocusIndex: he,
403
- onToolbarKeyDown: Te,
404
- isRtl: z
405
- }
406
- ) : null,
407
- /* @__PURE__ */ a(
408
- "div",
409
- {
410
- "aria-live": "polite",
411
- "aria-atomic": "true",
412
- className: "ds:sr-only",
413
- children: n
414
- }
415
- ),
416
- /* @__PURE__ */ a(
417
- "div",
418
- {
419
- ref: re,
420
- className: Je(),
421
- "data-testid": "pdf-pages-container",
422
- children: s ? Array.from({ length: s.numPages }, (e, r) => r + 1).map(
423
- (e) => /* @__PURE__ */ a(
424
- et,
425
- {
426
- pageNumber: e,
427
- totalPages: s.numPages,
428
- doc: s.doc,
429
- zoom: O,
430
- container: re.current,
431
- resizeTick: Ne,
432
- shouldRender: e >= I.start && e <= I.end,
433
- registerRef: (r) => {
434
- oe.current[e - 1] = r;
400
+ ) : (
401
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- region-level keyboard shortcuts (search, zoom) intentionally captured at the wrapper for the entire PDF viewer
402
+ /* @__PURE__ */ Z(
403
+ "div",
404
+ {
405
+ id: B,
406
+ role: "region",
407
+ "aria-label": N ?? S("pdf.toolbarLabel"),
408
+ className: [xe(), P].filter(Boolean).join(" "),
409
+ dir: z ? "rtl" : void 0,
410
+ onKeyDown: Ie,
411
+ tabIndex: -1,
412
+ "data-component": "pdf-viewer",
413
+ "data-component-id": i,
414
+ "data-pdfjs-worker-src": Se,
415
+ children: [
416
+ p ? /* @__PURE__ */ a(
417
+ rt,
418
+ {
419
+ currentPage: l,
420
+ numPages: (s == null ? void 0 : s.numPages) ?? 0,
421
+ zoom: O,
422
+ onPrev: () => D(l - 1),
423
+ onNext: () => D(l + 1),
424
+ onJump: (e) => D(e),
425
+ onZoomIn: () => {
426
+ y(
427
+ (e) => J(e) ? Math.min(e * 1.25, 4) : 1.25
428
+ );
429
+ },
430
+ onZoomOut: () => {
431
+ y(
432
+ (e) => J(e) ? Math.max(e / 1.25, 0.25) : 0.75
433
+ );
434
+ },
435
+ onZoomPreset: (e) => y(e),
436
+ onOpenSearch: () => G(!0),
437
+ onPrint: $,
438
+ searchOpen: j,
439
+ onSearchOpenChange: G,
440
+ searchQuery: ue,
441
+ onSearchQueryChange: (e) => {
442
+ fe(e);
443
+ },
444
+ searchMatches: Ce,
445
+ register: Ae,
446
+ focusIndex: ne,
447
+ setFocusIndex: ge,
448
+ onToolbarKeyDown: Re,
449
+ isRtl: z
450
+ }
451
+ ) : null,
452
+ /* @__PURE__ */ a("div", { "aria-live": "polite", "aria-atomic": "true", className: "ds:sr-only", children: n }),
453
+ /* @__PURE__ */ a(
454
+ "div",
455
+ {
456
+ ref: re,
457
+ className: Ge(),
458
+ "data-testid": "pdf-pages-container",
459
+ children: s ? Array.from({ length: s.numPages }, (e, r) => r + 1).map(
460
+ (e) => /* @__PURE__ */ a(
461
+ nt,
462
+ {
463
+ pageNumber: e,
464
+ totalPages: s.numPages,
465
+ doc: s.doc,
466
+ zoom: O,
467
+ container: re.current,
468
+ resizeTick: De,
469
+ shouldRender: e >= I.start && e <= I.end,
470
+ registerRef: (r) => {
471
+ oe.current[e - 1] = r;
472
+ },
473
+ searchQuery: ue,
474
+ onMatchCount: (r) => {
475
+ Ne((d) => r === 0 && d.total === 0 ? d : {
476
+ current: Math.min(d.current || 1, r || 1),
477
+ total: Math.max(d.total, r)
478
+ });
479
+ }
435
480
  },
436
- searchQuery: le,
437
- onMatchCount: (r) => {
438
- Me((d) => r === 0 && d.total === 0 ? d : {
439
- current: Math.min(d.current || 1, r || 1),
440
- total: Math.max(d.total, r)
441
- });
442
- }
443
- },
444
- e
445
- )
446
- ) : /* @__PURE__ */ Z(
447
- "div",
448
- {
449
- className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:text-[var(--muted-foreground)] ds:p-[var(--spacing-lg)]",
450
- children: [
451
- /* @__PURE__ */ a(Fe, { size: "sm", label: S("pdf.loading") }),
452
- /* @__PURE__ */ a("span", { children: S("pdf.loading") })
453
- ]
454
- }
455
- )
456
- }
457
- )
458
- ]
459
- }
481
+ e
482
+ )
483
+ ) : /* @__PURE__ */ Z("div", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:text-[var(--muted-foreground)] ds:p-[var(--spacing-lg)]", children: [
484
+ /* @__PURE__ */ a(Ee, { size: "sm", label: S("pdf.loading") }),
485
+ /* @__PURE__ */ a("span", { children: S("pdf.loading") })
486
+ ] })
487
+ }
488
+ )
489
+ ]
490
+ }
491
+ )
460
492
  );
461
493
  }
462
494
  );
463
- Ge.displayName = "PDFViewer";
464
- function Ye(i) {
465
- const { t } = ce(), {
495
+ tt.displayName = "PDFViewer";
496
+ function rt(i) {
497
+ const { t } = le(), {
466
498
  currentPage: u,
467
499
  numPages: h,
468
500
  zoom: f,
@@ -511,7 +543,7 @@ function Ye(i) {
511
543
  }
512
544
  n.onActivate();
513
545
  },
514
- className: ye(),
546
+ className: we(),
515
547
  children: n.icon
516
548
  }
517
549
  );
@@ -521,7 +553,7 @@ function Ye(i) {
521
553
  {
522
554
  role: "toolbar",
523
555
  "aria-label": t("pdf.toolbarLabel"),
524
- className: qe(),
556
+ className: $e(),
525
557
  children: [
526
558
  M({
527
559
  index: 0,
@@ -529,7 +561,7 @@ function Ye(i) {
529
561
  disabled: O,
530
562
  onActivate: g,
531
563
  icon: /* @__PURE__ */ a(
532
- _e,
564
+ Ze,
533
565
  {
534
566
  "aria-hidden": "true",
535
567
  className: "ds:block-size-4 ds:inline-size-4 ds:rtl:rotate-180"
@@ -542,7 +574,7 @@ function Ye(i) {
542
574
  disabled: y,
543
575
  onActivate: k,
544
576
  icon: /* @__PURE__ */ a(
545
- Le,
577
+ Be,
546
578
  {
547
579
  "aria-hidden": "true",
548
580
  className: "ds:block-size-4 ds:inline-size-4 ds:rtl:rotate-180"
@@ -565,7 +597,7 @@ function Ye(i) {
565
597
  ref: s(2),
566
598
  tabIndex: F === 2 ? 0 : -1,
567
599
  "aria-label": t("pdf.currentPageInput"),
568
- className: xe()
600
+ className: ke()
569
601
  }
570
602
  ),
571
603
  /* @__PURE__ */ a(
@@ -587,13 +619,25 @@ function Ye(i) {
587
619
  index: 3,
588
620
  label: t("pdf.zoom.out"),
589
621
  onActivate: P,
590
- icon: /* @__PURE__ */ a(We, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
622
+ icon: /* @__PURE__ */ a(
623
+ Ue,
624
+ {
625
+ "aria-hidden": "true",
626
+ className: "ds:block-size-4 ds:inline-size-4"
627
+ }
628
+ )
591
629
  }),
592
630
  M({
593
631
  index: 4,
594
632
  label: t("pdf.zoom.in"),
595
633
  onActivate: N,
596
- icon: /* @__PURE__ */ a(He, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
634
+ icon: /* @__PURE__ */ a(
635
+ We,
636
+ {
637
+ "aria-hidden": "true",
638
+ className: "ds:block-size-4 ds:inline-size-4"
639
+ }
640
+ )
597
641
  }),
598
642
  /* @__PURE__ */ Z(
599
643
  "select",
@@ -613,12 +657,12 @@ function Ye(i) {
613
657
  tabIndex: F === 5 ? 0 : -1,
614
658
  onFocus: () => c(5),
615
659
  onKeyDown: b,
616
- className: Ue(),
660
+ className: Xe(),
617
661
  children: [
618
662
  /* @__PURE__ */ a("option", { value: "fit-width", children: t("pdf.zoom.fitWidth") }),
619
663
  /* @__PURE__ */ a("option", { value: "fit-page", children: t("pdf.zoom.fitPage") }),
620
664
  /* @__PURE__ */ a("option", { value: "actual-size", children: t("pdf.zoom.actualSize") }),
621
- Xe.filter(J).map((n) => /* @__PURE__ */ a("option", { value: String(n), children: `${Math.round(n * 100)}%` }, n))
665
+ et.filter(J).map((n) => /* @__PURE__ */ a("option", { value: String(n), children: `${Math.round(n * 100)}%` }, n))
622
666
  ]
623
667
  }
624
668
  ),
@@ -627,7 +671,13 @@ function Ye(i) {
627
671
  index: 6,
628
672
  label: t("pdf.search.open"),
629
673
  onActivate: S,
630
- icon: /* @__PURE__ */ a(Ze, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
674
+ icon: /* @__PURE__ */ a(
675
+ Ke,
676
+ {
677
+ "aria-hidden": "true",
678
+ className: "ds:block-size-4 ds:inline-size-4"
679
+ }
680
+ )
631
681
  }) }),
632
682
  /* @__PURE__ */ a(X.Portal, { children: /* @__PURE__ */ Z(
633
683
  X.Content,
@@ -651,7 +701,9 @@ function Ye(i) {
651
701
  onChange: (n) => v(n.target.value),
652
702
  placeholder: t("pdf.search.placeholder"),
653
703
  "aria-label": t("pdf.search.placeholder"),
654
- className: xe({ className: "ds:inline-size-[16rem] ds:text-start" })
704
+ className: ke({
705
+ className: "ds:inline-size-[16rem] ds:text-start"
706
+ })
655
707
  }
656
708
  ),
657
709
  /* @__PURE__ */ a(
@@ -670,8 +722,14 @@ function Ye(i) {
670
722
  {
671
723
  type: "button",
672
724
  "aria-label": t("pdf.search.close"),
673
- className: ye(),
674
- children: /* @__PURE__ */ a(Ee, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
725
+ className: we(),
726
+ children: /* @__PURE__ */ a(
727
+ Le,
728
+ {
729
+ "aria-hidden": "true",
730
+ className: "ds:block-size-4 ds:inline-size-4"
731
+ }
732
+ )
675
733
  }
676
734
  ) })
677
735
  ]
@@ -682,13 +740,19 @@ function Ye(i) {
682
740
  index: 7,
683
741
  label: t("pdf.print"),
684
742
  onActivate: V,
685
- icon: /* @__PURE__ */ a(Be, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
743
+ icon: /* @__PURE__ */ a(
744
+ He,
745
+ {
746
+ "aria-hidden": "true",
747
+ className: "ds:block-size-4 ds:inline-size-4"
748
+ }
749
+ )
686
750
  })
687
751
  ]
688
752
  }
689
753
  );
690
754
  }
691
- function et(i) {
755
+ function nt(i) {
692
756
  const {
693
757
  pageNumber: t,
694
758
  totalPages: u,
@@ -700,7 +764,7 @@ function et(i) {
700
764
  registerRef: N,
701
765
  searchQuery: P,
702
766
  onMatchCount: R
703
- } = i, { t: S } = ce(), V = A(null), B = A(null), [z, q] = m({
767
+ } = i, { t: S } = le(), V = A(null), B = A(null), [z, q] = m({
704
768
  width: 612,
705
769
  height: 792
706
770
  }), [v, K] = m(null);
@@ -713,8 +777,11 @@ function et(i) {
713
777
  };
714
778
  }, [h, t]), w(() => {
715
779
  if (!v) return;
716
- const c = v.getViewport({ scale: 1 }), b = we(f, c, g), l = v.getViewport({ scale: b });
717
- q({ width: Math.floor(l.width), height: Math.floor(l.height) });
780
+ const c = v.getViewport({ scale: 1 }), b = ze(f, c, g), l = v.getViewport({ scale: b });
781
+ q({
782
+ width: Math.floor(l.width),
783
+ height: Math.floor(l.height)
784
+ });
718
785
  }, [v, f, g, k]), w(() => {
719
786
  if (!v || !p) {
720
787
  const j = V.current;
@@ -725,7 +792,7 @@ function et(i) {
725
792
  if (!c) return;
726
793
  const l = c.getContext("2d");
727
794
  if (!l) return;
728
- const E = v.getViewport({ scale: 1 }), O = we(f, E, g), y = v.getViewport({ scale: O }), I = Math.max(1, window.devicePixelRatio || 1);
795
+ const E = v.getViewport({ scale: 1 }), O = ze(f, E, g), y = v.getViewport({ scale: O }), I = Math.max(1, window.devicePixelRatio || 1);
729
796
  c.width = Math.floor(y.width * I), c.height = Math.floor(y.height * I), l.setTransform(I, 0, 0, I, 0, 0);
730
797
  const M = v.render({
731
798
  canvas: c,
@@ -737,11 +804,11 @@ function et(i) {
737
804
  if (n || !b) return;
738
805
  b.textContent = "";
739
806
  const j = await v.getTextContent();
740
- n || (x = new de.TextLayer({
807
+ n || (x = new ce.TextLayer({
741
808
  textContentSource: j,
742
809
  container: b,
743
810
  viewport: y
744
- }), await x.render(), ke(b, P, R));
811
+ }), await x.render(), Pe(b, P, R));
745
812
  }).catch(() => {
746
813
  }), () => {
747
814
  n = !0;
@@ -755,10 +822,18 @@ function et(i) {
755
822
  } catch {
756
823
  }
757
824
  };
758
- }, [v, p, f, g, k, P, R]), w(() => {
825
+ }, [
826
+ v,
827
+ p,
828
+ f,
829
+ g,
830
+ k,
831
+ P,
832
+ R
833
+ ]), w(() => {
759
834
  if (!p) return;
760
835
  const c = B.current;
761
- c && ke(c, P, R);
836
+ c && Pe(c, P, R);
762
837
  }, [P, p, R]);
763
838
  const s = {
764
839
  width: z.width,
@@ -775,7 +850,7 @@ function et(i) {
775
850
  },
776
851
  "data-page-number": t,
777
852
  "aria-label": S("pdf.pageOf", { current: t, total: u }),
778
- className: $e(),
853
+ className: Ye(),
779
854
  style: F,
780
855
  children: [
781
856
  /* @__PURE__ */ a("canvas", { ref: V, style: s }),
@@ -800,7 +875,7 @@ function et(i) {
800
875
  }
801
876
  );
802
877
  }
803
- function ke(i, t, u) {
878
+ function Pe(i, t, u) {
804
879
  if (i.querySelectorAll("[data-match]").forEach((p) => {
805
880
  p.removeAttribute("data-match");
806
881
  }), !t) {
@@ -813,54 +888,8 @@ function ke(i, t, u) {
813
888
  (p.textContent ?? "").toLowerCase().includes(f) && (p.setAttribute("data-match", "true"), g += 1);
814
889
  }), u(g);
815
890
  }
816
- const mt = {
817
- id: "pdf-viewer",
818
- capabilities: ["paginate", "view_change", "filter"],
819
- state: {},
820
- actions: {
821
- go_to_page: {
822
- safety: "read",
823
- argsType: "{ page: number }",
824
- description: "Navigate to a specific 1-indexed page.",
825
- invoke: (i, t) => {
826
- i.goToPage(t.page);
827
- }
828
- },
829
- set_zoom: {
830
- safety: "read",
831
- argsType: "{ zoom: PDFZoomPreset }",
832
- description: "Apply a zoom preset.",
833
- invoke: (i, t) => {
834
- i.setZoom(t.zoom);
835
- }
836
- },
837
- search: {
838
- safety: "read",
839
- argsType: "{ query: string }",
840
- description: "Search the document for the given query and highlight matches.",
841
- invoke: (i, t) => {
842
- i.search(t.query);
843
- }
844
- },
845
- print: {
846
- safety: "read",
847
- description: "Open the browser print dialog for the document.",
848
- invoke: (i) => {
849
- i.print();
850
- }
851
- }
852
- },
853
- domHooks: {
854
- root: { attr: "data-component", value: "pdf-viewer" },
855
- instanceId: {
856
- attr: "data-component-id",
857
- sourceProp: "id",
858
- description: "Sourced from the id prop."
859
- }
860
- }
861
- };
862
891
  export {
863
- Ge as P,
864
- mt as p
892
+ tt as P,
893
+ Je as p
865
894
  };
866
- //# sourceMappingURL=pdf-viewer.agent-BaGEDheA.js.map
895
+ //# sourceMappingURL=pdf-viewer-CZIfY08H.js.map