@hussmartinez/pdf-sdk 0.0.0-stage → 0.1.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 (395) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +66 -0
  3. package/README.md +84 -2
  4. package/dist/assets/pdfjs/build/pdf.worker.min.mjs +28 -0
  5. package/dist/assets/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
  6. package/dist/assets/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
  7. package/dist/assets/pdfjs/cmaps/78-H.bcmap +0 -0
  8. package/dist/assets/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
  9. package/dist/assets/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
  10. package/dist/assets/pdfjs/cmaps/78-V.bcmap +0 -0
  11. package/dist/assets/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
  12. package/dist/assets/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
  13. package/dist/assets/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
  14. package/dist/assets/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
  15. package/dist/assets/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
  16. package/dist/assets/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
  17. package/dist/assets/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
  18. package/dist/assets/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
  19. package/dist/assets/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
  20. package/dist/assets/pdfjs/cmaps/Add-H.bcmap +0 -0
  21. package/dist/assets/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
  22. package/dist/assets/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
  23. package/dist/assets/pdfjs/cmaps/Add-V.bcmap +0 -0
  24. package/dist/assets/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
  25. package/dist/assets/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
  26. package/dist/assets/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
  27. package/dist/assets/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
  28. package/dist/assets/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
  29. package/dist/assets/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
  30. package/dist/assets/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
  31. package/dist/assets/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  32. package/dist/assets/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
  33. package/dist/assets/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
  34. package/dist/assets/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
  35. package/dist/assets/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
  36. package/dist/assets/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
  37. package/dist/assets/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
  38. package/dist/assets/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  39. package/dist/assets/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
  40. package/dist/assets/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
  41. package/dist/assets/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
  42. package/dist/assets/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
  43. package/dist/assets/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
  44. package/dist/assets/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
  45. package/dist/assets/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
  46. package/dist/assets/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  47. package/dist/assets/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
  48. package/dist/assets/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
  49. package/dist/assets/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
  50. package/dist/assets/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  51. package/dist/assets/pdfjs/cmaps/B5-H.bcmap +0 -0
  52. package/dist/assets/pdfjs/cmaps/B5-V.bcmap +0 -0
  53. package/dist/assets/pdfjs/cmaps/B5pc-H.bcmap +0 -0
  54. package/dist/assets/pdfjs/cmaps/B5pc-V.bcmap +0 -0
  55. package/dist/assets/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
  56. package/dist/assets/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
  57. package/dist/assets/pdfjs/cmaps/CNS1-H.bcmap +0 -0
  58. package/dist/assets/pdfjs/cmaps/CNS1-V.bcmap +0 -0
  59. package/dist/assets/pdfjs/cmaps/CNS2-H.bcmap +0 -0
  60. package/dist/assets/pdfjs/cmaps/CNS2-V.bcmap +3 -0
  61. package/dist/assets/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
  62. package/dist/assets/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
  63. package/dist/assets/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
  64. package/dist/assets/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
  65. package/dist/assets/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
  66. package/dist/assets/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
  67. package/dist/assets/pdfjs/cmaps/EUC-H.bcmap +0 -0
  68. package/dist/assets/pdfjs/cmaps/EUC-V.bcmap +0 -0
  69. package/dist/assets/pdfjs/cmaps/Ext-H.bcmap +0 -0
  70. package/dist/assets/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
  71. package/dist/assets/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
  72. package/dist/assets/pdfjs/cmaps/Ext-V.bcmap +0 -0
  73. package/dist/assets/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
  74. package/dist/assets/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
  75. package/dist/assets/pdfjs/cmaps/GB-H.bcmap +4 -0
  76. package/dist/assets/pdfjs/cmaps/GB-V.bcmap +0 -0
  77. package/dist/assets/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
  78. package/dist/assets/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
  79. package/dist/assets/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
  80. package/dist/assets/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
  81. package/dist/assets/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
  82. package/dist/assets/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
  83. package/dist/assets/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
  84. package/dist/assets/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
  85. package/dist/assets/pdfjs/cmaps/GBT-H.bcmap +0 -0
  86. package/dist/assets/pdfjs/cmaps/GBT-V.bcmap +0 -0
  87. package/dist/assets/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
  88. package/dist/assets/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
  89. package/dist/assets/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
  90. package/dist/assets/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
  91. package/dist/assets/pdfjs/cmaps/H.bcmap +0 -0
  92. package/dist/assets/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
  93. package/dist/assets/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
  94. package/dist/assets/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
  95. package/dist/assets/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
  96. package/dist/assets/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
  97. package/dist/assets/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
  98. package/dist/assets/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
  99. package/dist/assets/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
  100. package/dist/assets/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
  101. package/dist/assets/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
  102. package/dist/assets/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
  103. package/dist/assets/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
  104. package/dist/assets/pdfjs/cmaps/Hankaku.bcmap +0 -0
  105. package/dist/assets/pdfjs/cmaps/Hiragana.bcmap +0 -0
  106. package/dist/assets/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
  107. package/dist/assets/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
  108. package/dist/assets/pdfjs/cmaps/KSC-H.bcmap +0 -0
  109. package/dist/assets/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
  110. package/dist/assets/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
  111. package/dist/assets/pdfjs/cmaps/KSC-V.bcmap +0 -0
  112. package/dist/assets/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
  113. package/dist/assets/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  114. package/dist/assets/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  115. package/dist/assets/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
  116. package/dist/assets/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
  117. package/dist/assets/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
  118. package/dist/assets/pdfjs/cmaps/Katakana.bcmap +0 -0
  119. package/dist/assets/pdfjs/cmaps/LICENSE +36 -0
  120. package/dist/assets/pdfjs/cmaps/NWP-H.bcmap +0 -0
  121. package/dist/assets/pdfjs/cmaps/NWP-V.bcmap +0 -0
  122. package/dist/assets/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
  123. package/dist/assets/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
  124. package/dist/assets/pdfjs/cmaps/Roman.bcmap +0 -0
  125. package/dist/assets/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  126. package/dist/assets/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  127. package/dist/assets/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  128. package/dist/assets/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  129. package/dist/assets/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  130. package/dist/assets/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  131. package/dist/assets/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  132. package/dist/assets/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  133. package/dist/assets/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
  134. package/dist/assets/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
  135. package/dist/assets/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
  136. package/dist/assets/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
  137. package/dist/assets/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
  138. package/dist/assets/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
  139. package/dist/assets/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
  140. package/dist/assets/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
  141. package/dist/assets/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  142. package/dist/assets/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  143. package/dist/assets/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  144. package/dist/assets/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  145. package/dist/assets/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  146. package/dist/assets/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  147. package/dist/assets/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  148. package/dist/assets/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  149. package/dist/assets/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  150. package/dist/assets/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  151. package/dist/assets/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  152. package/dist/assets/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  153. package/dist/assets/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  154. package/dist/assets/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  155. package/dist/assets/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  156. package/dist/assets/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  157. package/dist/assets/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  158. package/dist/assets/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  159. package/dist/assets/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  160. package/dist/assets/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  161. package/dist/assets/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  162. package/dist/assets/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  163. package/dist/assets/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  164. package/dist/assets/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
  165. package/dist/assets/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
  166. package/dist/assets/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
  167. package/dist/assets/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
  168. package/dist/assets/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
  169. package/dist/assets/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
  170. package/dist/assets/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
  171. package/dist/assets/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
  172. package/dist/assets/pdfjs/cmaps/V.bcmap +0 -0
  173. package/dist/assets/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
  174. package/dist/assets/pdfjs/iccs/CGATS001Compat-v2-micro.icc +0 -0
  175. package/dist/assets/pdfjs/iccs/LICENSE +116 -0
  176. package/dist/assets/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  177. package/dist/assets/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  178. package/dist/assets/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  179. package/dist/assets/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  180. package/dist/assets/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  181. package/dist/assets/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  182. package/dist/assets/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  183. package/dist/assets/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  184. package/dist/assets/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  185. package/dist/assets/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  186. package/dist/assets/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  187. package/dist/assets/pdfjs/wasm/LICENSE_JBIG2 +196 -0
  188. package/dist/assets/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
  189. package/dist/assets/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  190. package/dist/assets/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
  191. package/dist/assets/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
  192. package/dist/assets/pdfjs/wasm/LICENSE_QCMS +21 -0
  193. package/dist/assets/pdfjs/wasm/jbig2.wasm +0 -0
  194. package/dist/assets/pdfjs/wasm/openjpeg.wasm +0 -0
  195. package/dist/assets/pdfjs/wasm/qcms_bg.wasm +0 -0
  196. package/dist/assets/processing/processing.worker.js +57 -0
  197. package/dist/assets/processing/qpdf.wasm +0 -0
  198. package/dist/element.d.ts +12 -0
  199. package/dist/element.js +0 -0
  200. package/dist/index.d.ts +1286 -0
  201. package/dist/index.js +1 -0
  202. package/dist/lazy/78-EUC-H.bcmap-sYP3SMNV.js +3 -0
  203. package/dist/lazy/78-EUC-V.bcmap-w3SY_Y_q.js +3 -0
  204. package/dist/lazy/78-H.bcmap-CeA2DrtT.js +3 -0
  205. package/dist/lazy/78-RKSJ-H.bcmap-D4cLhL3_.js +3 -0
  206. package/dist/lazy/78-RKSJ-V.bcmap-DdK1ZiTU.js +3 -0
  207. package/dist/lazy/78-V.bcmap-CVoLO4i0.js +3 -0
  208. package/dist/lazy/78ms-RKSJ-H.bcmap-B20DW4UH.js +3 -0
  209. package/dist/lazy/78ms-RKSJ-V.bcmap-CLnY5REh.js +3 -0
  210. package/dist/lazy/83pv-RKSJ-H.bcmap-Ck3Sc38p.js +3 -0
  211. package/dist/lazy/90ms-RKSJ-H.bcmap-C-vgp7Oe.js +3 -0
  212. package/dist/lazy/90ms-RKSJ-V.bcmap-CnYvCBfH.js +3 -0
  213. package/dist/lazy/90msp-RKSJ-H.bcmap-BIx2U_Lw.js +3 -0
  214. package/dist/lazy/90msp-RKSJ-V.bcmap-LSpKnFnA.js +3 -0
  215. package/dist/lazy/90pv-RKSJ-H.bcmap-ohvXiazb.js +3 -0
  216. package/dist/lazy/90pv-RKSJ-V.bcmap-DiMSuPqu.js +3 -0
  217. package/dist/lazy/Add-H.bcmap-D50q_cPt.js +3 -0
  218. package/dist/lazy/Add-RKSJ-H.bcmap-DLQ79XiS.js +3 -0
  219. package/dist/lazy/Add-RKSJ-V.bcmap-DgMvx1Yl.js +3 -0
  220. package/dist/lazy/Add-V.bcmap-njFd39xE.js +3 -0
  221. package/dist/lazy/Adobe-CNS1-0.bcmap-DC9aIYc6.js +3 -0
  222. package/dist/lazy/Adobe-CNS1-1.bcmap-CjXhkA0W.js +3 -0
  223. package/dist/lazy/Adobe-CNS1-2.bcmap-BfDCyJYh.js +3 -0
  224. package/dist/lazy/Adobe-CNS1-3.bcmap-C5_dNXD-.js +3 -0
  225. package/dist/lazy/Adobe-CNS1-4.bcmap-DkB6y9PJ.js +3 -0
  226. package/dist/lazy/Adobe-CNS1-5.bcmap-13hTC0vp.js +3 -0
  227. package/dist/lazy/Adobe-CNS1-6.bcmap-CcQ66yT1.js +3 -0
  228. package/dist/lazy/Adobe-CNS1-UCS2.bcmap-jD7ZNdHN.js +3 -0
  229. package/dist/lazy/Adobe-GB1-0.bcmap-CwfHCw6h.js +3 -0
  230. package/dist/lazy/Adobe-GB1-1.bcmap-DRWrCran.js +3 -0
  231. package/dist/lazy/Adobe-GB1-2.bcmap-0nedEhcq.js +3 -0
  232. package/dist/lazy/Adobe-GB1-3.bcmap-Cq3lCVsW.js +3 -0
  233. package/dist/lazy/Adobe-GB1-4.bcmap-BzTb6Nsg.js +3 -0
  234. package/dist/lazy/Adobe-GB1-5.bcmap-BUHSmz5c.js +3 -0
  235. package/dist/lazy/Adobe-GB1-UCS2.bcmap-DUfIxWQW.js +3 -0
  236. package/dist/lazy/Adobe-Japan1-0.bcmap-BjG9GiRM.js +3 -0
  237. package/dist/lazy/Adobe-Japan1-1.bcmap-DQTj-iQt.js +3 -0
  238. package/dist/lazy/Adobe-Japan1-2.bcmap-BOsCSmmm.js +3 -0
  239. package/dist/lazy/Adobe-Japan1-3.bcmap-ChGf7g8t.js +3 -0
  240. package/dist/lazy/Adobe-Japan1-4.bcmap-CI6iUMgQ.js +3 -0
  241. package/dist/lazy/Adobe-Japan1-5.bcmap-kbwPceJO.js +3 -0
  242. package/dist/lazy/Adobe-Japan1-6.bcmap-CAvvqYpW.js +3 -0
  243. package/dist/lazy/Adobe-Japan1-UCS2.bcmap-DbZiEgfC.js +3 -0
  244. package/dist/lazy/Adobe-Korea1-0.bcmap-Der5jvBG.js +3 -0
  245. package/dist/lazy/Adobe-Korea1-1.bcmap-DafpcUyn.js +3 -0
  246. package/dist/lazy/Adobe-Korea1-2.bcmap-D1nh75yR.js +3 -0
  247. package/dist/lazy/Adobe-Korea1-UCS2.bcmap-CNeMfPHO.js +3 -0
  248. package/dist/lazy/B5-H.bcmap-gyhuoKf7.js +3 -0
  249. package/dist/lazy/B5-V.bcmap-BGqDqEjZ.js +3 -0
  250. package/dist/lazy/B5pc-H.bcmap-C8B_dVbb.js +3 -0
  251. package/dist/lazy/B5pc-V.bcmap-ETo7py2B.js +3 -0
  252. package/dist/lazy/CNS-EUC-H.bcmap-BgwyrNdN.js +3 -0
  253. package/dist/lazy/CNS-EUC-V.bcmap-BbC68G9k.js +3 -0
  254. package/dist/lazy/CNS1-H.bcmap-DZIguuvp.js +3 -0
  255. package/dist/lazy/CNS1-V.bcmap-DjthPwLF.js +3 -0
  256. package/dist/lazy/CNS2-H.bcmap-CTuiQP8Z.js +3 -0
  257. package/dist/lazy/CNS2-V.bcmap-BU5ZzL4C.js +3 -0
  258. package/dist/lazy/ETHK-B5-H.bcmap-AYx-kODg.js +3 -0
  259. package/dist/lazy/ETHK-B5-V.bcmap-C_2Sxwdm.js +3 -0
  260. package/dist/lazy/ETen-B5-H.bcmap-BAKuplan.js +3 -0
  261. package/dist/lazy/ETen-B5-V.bcmap-Dnm6aXlS.js +3 -0
  262. package/dist/lazy/ETenms-B5-H.bcmap-DZ8Y3Rnc.js +3 -0
  263. package/dist/lazy/ETenms-B5-V.bcmap-DPnnTEiA.js +3 -0
  264. package/dist/lazy/EUC-H.bcmap-B1COGDXX.js +3 -0
  265. package/dist/lazy/EUC-V.bcmap-BRvFq5yx.js +3 -0
  266. package/dist/lazy/Ext-H.bcmap-CNU3PCfs.js +3 -0
  267. package/dist/lazy/Ext-RKSJ-H.bcmap-T22CGXk4.js +3 -0
  268. package/dist/lazy/Ext-RKSJ-V.bcmap-K2DXeZ3P.js +3 -0
  269. package/dist/lazy/Ext-V.bcmap-3sNuPEfV.js +3 -0
  270. package/dist/lazy/FoxitDingbats.pfb-DVieKaw5.js +3 -0
  271. package/dist/lazy/FoxitFixed.pfb-Cxgpn9hN.js +3 -0
  272. package/dist/lazy/FoxitFixedBold.pfb-SBojmP3G.js +3 -0
  273. package/dist/lazy/FoxitFixedBoldItalic.pfb-DhsbZ2IP.js +3 -0
  274. package/dist/lazy/FoxitFixedItalic.pfb-Dm09mdyI.js +3 -0
  275. package/dist/lazy/FoxitSerif.pfb-DyMzSE_0.js +3 -0
  276. package/dist/lazy/FoxitSerifBold.pfb-DTzLt76W.js +3 -0
  277. package/dist/lazy/FoxitSerifBoldItalic.pfb-X3fHgghe.js +3 -0
  278. package/dist/lazy/FoxitSerifItalic.pfb-Nz1cnSKc.js +3 -0
  279. package/dist/lazy/FoxitSymbol.pfb-BL-rU8nS.js +3 -0
  280. package/dist/lazy/GB-EUC-H.bcmap-CsgH6-Rh.js +3 -0
  281. package/dist/lazy/GB-EUC-V.bcmap-DUouvrJu.js +3 -0
  282. package/dist/lazy/GB-H.bcmap-CuVli79K.js +3 -0
  283. package/dist/lazy/GB-V.bcmap-C3uPsDRC.js +3 -0
  284. package/dist/lazy/GBK-EUC-H.bcmap-BBDA5YUr.js +3 -0
  285. package/dist/lazy/GBK-EUC-V.bcmap-CjEpjWSW.js +3 -0
  286. package/dist/lazy/GBK2K-H.bcmap-DEJkj1gN.js +3 -0
  287. package/dist/lazy/GBK2K-V.bcmap-NYgNeNsu.js +3 -0
  288. package/dist/lazy/GBKp-EUC-H.bcmap-BIQuHkue.js +3 -0
  289. package/dist/lazy/GBKp-EUC-V.bcmap-BNBPmQ4v.js +3 -0
  290. package/dist/lazy/GBT-EUC-H.bcmap-D7OWs_0J.js +3 -0
  291. package/dist/lazy/GBT-EUC-V.bcmap-D_rNNyCu.js +3 -0
  292. package/dist/lazy/GBT-H.bcmap-B4SLNj_c.js +3 -0
  293. package/dist/lazy/GBT-V.bcmap-Cq6Niv8e.js +3 -0
  294. package/dist/lazy/GBTpc-EUC-H.bcmap-CX8SXrun.js +3 -0
  295. package/dist/lazy/GBTpc-EUC-V.bcmap-hM7BhuwC.js +3 -0
  296. package/dist/lazy/GBpc-EUC-H.bcmap-BIEXt7KG.js +3 -0
  297. package/dist/lazy/GBpc-EUC-V.bcmap-DWeqNOzl.js +3 -0
  298. package/dist/lazy/H.bcmap-DsMNeuh7.js +3 -0
  299. package/dist/lazy/HKdla-B5-H.bcmap-CI5u0d4T.js +3 -0
  300. package/dist/lazy/HKdla-B5-V.bcmap-yk9YM4CN.js +3 -0
  301. package/dist/lazy/HKdlb-B5-H.bcmap-DenLwP2C.js +3 -0
  302. package/dist/lazy/HKdlb-B5-V.bcmap-BKFxIrzq.js +3 -0
  303. package/dist/lazy/HKgccs-B5-H.bcmap-i607pEmt.js +3 -0
  304. package/dist/lazy/HKgccs-B5-V.bcmap-BA9Nvcnu.js +3 -0
  305. package/dist/lazy/HKm314-B5-H.bcmap-BamdAWrg.js +3 -0
  306. package/dist/lazy/HKm314-B5-V.bcmap-JIFeW7D_.js +3 -0
  307. package/dist/lazy/HKm471-B5-H.bcmap-CIOwD0zn.js +3 -0
  308. package/dist/lazy/HKm471-B5-V.bcmap-BkDoTPME.js +3 -0
  309. package/dist/lazy/HKscs-B5-H.bcmap--SdxOf4z.js +3 -0
  310. package/dist/lazy/HKscs-B5-V.bcmap-DmqMO-Th.js +3 -0
  311. package/dist/lazy/Hankaku.bcmap-B2fyvO8A.js +3 -0
  312. package/dist/lazy/Hiragana.bcmap-DP3YLVOE.js +3 -0
  313. package/dist/lazy/KSC-EUC-H.bcmap-DQ5YvjA7.js +3 -0
  314. package/dist/lazy/KSC-EUC-V.bcmap-BNvwGfQX.js +3 -0
  315. package/dist/lazy/KSC-H.bcmap-Ca-HYPS4.js +3 -0
  316. package/dist/lazy/KSC-Johab-H.bcmap-CfF2UvBc.js +3 -0
  317. package/dist/lazy/KSC-Johab-V.bcmap-LBN9I8dg.js +3 -0
  318. package/dist/lazy/KSC-V.bcmap-5U7FPho3.js +3 -0
  319. package/dist/lazy/KSCms-UHC-H.bcmap-CmoPtsRN.js +3 -0
  320. package/dist/lazy/KSCms-UHC-HW-H.bcmap-CVBsfTPV.js +3 -0
  321. package/dist/lazy/KSCms-UHC-HW-V.bcmap-Dv90XUw-.js +3 -0
  322. package/dist/lazy/KSCms-UHC-V.bcmap-BlaojGc1.js +3 -0
  323. package/dist/lazy/KSCpc-EUC-H.bcmap-FrupvwaV.js +3 -0
  324. package/dist/lazy/KSCpc-EUC-V.bcmap-MG3GiZE4.js +3 -0
  325. package/dist/lazy/Katakana.bcmap-C8Bmgyhi.js +3 -0
  326. package/dist/lazy/NWP-H.bcmap-CAdIwPDs.js +3 -0
  327. package/dist/lazy/NWP-V.bcmap-DJ8FpnB4.js +3 -0
  328. package/dist/lazy/RKSJ-H.bcmap-qGRAHcEF.js +3 -0
  329. package/dist/lazy/RKSJ-V.bcmap-Dg3ddxaN.js +3 -0
  330. package/dist/lazy/Roman.bcmap-D4SBc9em.js +3 -0
  331. package/dist/lazy/UniCNS-UCS2-H.bcmap-CAjdESaO.js +3 -0
  332. package/dist/lazy/UniCNS-UCS2-V.bcmap-BHZM4Vzw.js +3 -0
  333. package/dist/lazy/UniCNS-UTF16-H.bcmap-Cm4ZnlrX.js +3 -0
  334. package/dist/lazy/UniCNS-UTF16-V.bcmap-BP1BFVyb.js +3 -0
  335. package/dist/lazy/UniCNS-UTF32-H.bcmap-DGLG7zQ_.js +3 -0
  336. package/dist/lazy/UniCNS-UTF32-V.bcmap-C6v0CIVn.js +3 -0
  337. package/dist/lazy/UniCNS-UTF8-H.bcmap-97YD5l2o.js +3 -0
  338. package/dist/lazy/UniCNS-UTF8-V.bcmap-B_zdNm-u.js +3 -0
  339. package/dist/lazy/UniGB-UCS2-H.bcmap-BcioIbCK.js +3 -0
  340. package/dist/lazy/UniGB-UCS2-V.bcmap-Cu-XDS3_.js +3 -0
  341. package/dist/lazy/UniGB-UTF16-H.bcmap-DPDBbQj_.js +3 -0
  342. package/dist/lazy/UniGB-UTF16-V.bcmap-Bwwxp3b7.js +3 -0
  343. package/dist/lazy/UniGB-UTF32-H.bcmap-D-uBJmmw.js +3 -0
  344. package/dist/lazy/UniGB-UTF32-V.bcmap-CLe_N_q5.js +3 -0
  345. package/dist/lazy/UniGB-UTF8-H.bcmap-CadVYdlJ.js +3 -0
  346. package/dist/lazy/UniGB-UTF8-V.bcmap-B9mD6Kt7.js +3 -0
  347. package/dist/lazy/UniJIS-UCS2-H.bcmap-BaCSu9QA.js +3 -0
  348. package/dist/lazy/UniJIS-UCS2-HW-H.bcmap-CYQj9xSp.js +3 -0
  349. package/dist/lazy/UniJIS-UCS2-HW-V.bcmap-CDzIwh-J.js +3 -0
  350. package/dist/lazy/UniJIS-UCS2-V.bcmap-DqCxM_EZ.js +3 -0
  351. package/dist/lazy/UniJIS-UTF16-H.bcmap-9TPLuUCU.js +3 -0
  352. package/dist/lazy/UniJIS-UTF16-V.bcmap-D6-nIWTQ.js +3 -0
  353. package/dist/lazy/UniJIS-UTF32-H.bcmap-CzmUWSLA.js +3 -0
  354. package/dist/lazy/UniJIS-UTF32-V.bcmap--KhJJEJE.js +3 -0
  355. package/dist/lazy/UniJIS-UTF8-H.bcmap-BwrhFSFd.js +3 -0
  356. package/dist/lazy/UniJIS-UTF8-V.bcmap-DGwbFkaL.js +3 -0
  357. package/dist/lazy/UniJIS2004-UTF16-H.bcmap-CdsS_d3_.js +3 -0
  358. package/dist/lazy/UniJIS2004-UTF16-V.bcmap-BnlV29Vf.js +3 -0
  359. package/dist/lazy/UniJIS2004-UTF32-H.bcmap-DSULVyIs.js +3 -0
  360. package/dist/lazy/UniJIS2004-UTF32-V.bcmap-CzBB970E.js +3 -0
  361. package/dist/lazy/UniJIS2004-UTF8-H.bcmap-BBuoGqhC.js +3 -0
  362. package/dist/lazy/UniJIS2004-UTF8-V.bcmap-dXgQhdTV.js +3 -0
  363. package/dist/lazy/UniJISPro-UCS2-HW-V.bcmap-ePVViljk.js +3 -0
  364. package/dist/lazy/UniJISPro-UCS2-V.bcmap-b2Oljrl4.js +3 -0
  365. package/dist/lazy/UniJISPro-UTF8-V.bcmap-CbPXe9gt.js +3 -0
  366. package/dist/lazy/UniJISX0213-UTF32-H.bcmap-Blmknifg.js +3 -0
  367. package/dist/lazy/UniJISX0213-UTF32-V.bcmap-Dtggmq9y.js +3 -0
  368. package/dist/lazy/UniJISX02132004-UTF32-H.bcmap-3YBd8tyQ.js +3 -0
  369. package/dist/lazy/UniJISX02132004-UTF32-V.bcmap-B8VdB9qS.js +3 -0
  370. package/dist/lazy/UniKS-UCS2-H.bcmap-CIhkpKgh.js +3 -0
  371. package/dist/lazy/UniKS-UCS2-V.bcmap-Cg-GDuqq.js +3 -0
  372. package/dist/lazy/UniKS-UTF16-H.bcmap-EZHb2IFq.js +3 -0
  373. package/dist/lazy/UniKS-UTF16-V.bcmap-BhqhAhYP.js +3 -0
  374. package/dist/lazy/UniKS-UTF32-H.bcmap-Cgay0dIp.js +3 -0
  375. package/dist/lazy/UniKS-UTF32-V.bcmap-DYXyatLV.js +3 -0
  376. package/dist/lazy/UniKS-UTF8-H.bcmap-BvHYimUT.js +3 -0
  377. package/dist/lazy/UniKS-UTF8-V.bcmap-DStcP2w0.js +3 -0
  378. package/dist/lazy/V.bcmap-DuWGSyNm.js +3 -0
  379. package/dist/lazy/WP-Symbol.bcmap-GltcyRl-.js +3 -0
  380. package/dist/lazy/_virtual_hm-pdfjs-data-BSzhlxyq.js +194 -0
  381. package/dist/lazy/jbig2.wasm-CUnHTdWi.js +3 -0
  382. package/dist/lazy/openjpeg.wasm-bdyxAnqz.js +3 -0
  383. package/dist/lazy/processing-worker-CxoVSxEZ.js +30 -0
  384. package/dist/lazy/processing-worker-CxoVSxEZ.js.map +1 -0
  385. package/dist/lazy/render-worker-WgnZ-czI.js +30 -0
  386. package/dist/lazy/render-worker-WgnZ-czI.js.map +1 -0
  387. package/dist/lazy/runtime-G4hlayVF.js +22652 -0
  388. package/dist/lazy/runtime-G4hlayVF.js.map +1 -0
  389. package/dist/react.d.ts +1332 -0
  390. package/dist/react.js +899 -0
  391. package/dist/react.js.map +1 -0
  392. package/dist/shared/en-B0u26URn.js +1244 -0
  393. package/dist/shared/en-B0u26URn.js.map +1 -0
  394. package/dist/styles.css +335 -0
  395. package/package.json +107 -3
package/dist/react.js ADDED
@@ -0,0 +1,899 @@
1
+ "use client";
2
+ import { i as createPdfJsEngine, n as createPdfSession, o as linkDestination, r as createPdfProcessor, s as safeLinkUrl, t as pdfMessages } from "./shared/en-B0u26URn.js";
3
+ import { createMessages } from "@hussmartinez/sdk-core";
4
+ import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ // src/react/context.ts
7
+ var PdfContext = /* @__PURE__ */ createContext(void 0);
8
+ // src/react/hooks.ts
9
+ function usePdfContext(hook) {
10
+ const value = useContext(PdfContext);
11
+ if (!value) throw new Error(`${hook} must be used inside a PdfSessionProvider.`);
12
+ return value;
13
+ }
14
+ function usePdfSession() {
15
+ return usePdfContext("usePdfSession").session;
16
+ }
17
+ function usePdfDocument() {
18
+ const { session } = usePdfContext("usePdfDocument");
19
+ return useSyncExternalStore(session.subscribe, session.getSnapshot, session.getSnapshot);
20
+ }
21
+ function usePdfMessages() {
22
+ return usePdfContext("usePdfMessages").messages;
23
+ }
24
+ // src/react/PdfSessionProvider.tsx
25
+ function own(props) {
26
+ const assets = props.assetsUrl === void 0 ? {} : { assetsUrl: props.assetsUrl };
27
+ const engine = props.engine ?? createPdfJsEngine(assets);
28
+ const processor = props.processor ?? createPdfProcessor(assets);
29
+ const session = createPdfSession({
30
+ engine,
31
+ processor,
32
+ ...props.filePolicy ? { filePolicy: props.filePolicy } : {},
33
+ ...props.onEvent ? { onEvent: props.onEvent } : {}
34
+ });
35
+ return {
36
+ session,
37
+ dispose() {
38
+ session.close();
39
+ if (!props.engine) engine.destroy();
40
+ if (!props.processor) processor.destroy();
41
+ }
42
+ };
43
+ }
44
+ function PdfSessionProvider(props) {
45
+ const { session: given, messages: overrides, locale = "en", children } = props;
46
+ const [owned] = useState(() => given ? void 0 : own(props));
47
+ const session = given ?? owned.session;
48
+ useEffect(() => {
49
+ if (!owned) return;
50
+ const pending = owned.pending;
51
+ if (pending !== void 0) clearTimeout(pending);
52
+ return () => {
53
+ owned.pending = setTimeout(() => owned.dispose(), 0);
54
+ };
55
+ }, [owned]);
56
+ const messages = useMemo(() => createMessages(pdfMessages, {
57
+ locale,
58
+ ...overrides ? { overrides } : {}
59
+ }), [locale, overrides]);
60
+ const value = useMemo(() => ({
61
+ session,
62
+ messages
63
+ }), [session, messages]);
64
+ return /* @__PURE__ */ jsx(PdfContext.Provider, {
65
+ value,
66
+ children
67
+ });
68
+ }
69
+ // src/react/use-near-observer.ts
70
+ function useNearObserver(root) {
71
+ const observer = useRef(void 0);
72
+ const callbacks = useRef(/* @__PURE__ */ new Map());
73
+ useEffect(() => {
74
+ const created = new IntersectionObserver((entries) => {
75
+ for (const entry of entries) callbacks.current.get(entry.target)?.(entry.isIntersecting);
76
+ }, {
77
+ root: root.current,
78
+ rootMargin: "100% 0px"
79
+ });
80
+ observer.current = created;
81
+ for (const element of callbacks.current.keys()) created.observe(element);
82
+ return () => created.disconnect();
83
+ }, [root]);
84
+ return useCallback((element, onNear) => {
85
+ callbacks.current.set(element, onNear);
86
+ observer.current?.observe(element);
87
+ return () => {
88
+ callbacks.current.delete(element);
89
+ observer.current?.unobserve(element);
90
+ };
91
+ }, []);
92
+ }
93
+ function useNear(observe, element, sized) {
94
+ const [near, setNear] = useState(false);
95
+ useEffect(() => {
96
+ const target = element.current;
97
+ if (!sized || !target) return;
98
+ const stop = observe(target, setNear);
99
+ return () => {
100
+ stop();
101
+ setNear(false);
102
+ };
103
+ }, [
104
+ observe,
105
+ element,
106
+ sized
107
+ ]);
108
+ return near;
109
+ }
110
+ // src/react/use-page-drawing.ts
111
+ function usePageDrawing(options) {
112
+ const { session, pageKey, rotation, near, displayWidth, queue, onMeasured } = options;
113
+ const canvas = useRef(null);
114
+ const [info, setInfo] = useState();
115
+ const [drawn, setDrawn] = useState(false);
116
+ const [failure, setFailure] = useState();
117
+ const measured = useRef(onMeasured);
118
+ measured.current = onMeasured;
119
+ useEffect(() => {
120
+ if (!near) return;
121
+ const controller = new AbortController();
122
+ session.getPage(pageKey, { signal: controller.signal }).then((read) => {
123
+ setInfo(read);
124
+ measured.current?.(read);
125
+ }, (reason) => {
126
+ if (!controller.signal.aborted) setFailure(reason);
127
+ });
128
+ return () => controller.abort();
129
+ }, [
130
+ near,
131
+ session,
132
+ pageKey,
133
+ rotation
134
+ ]);
135
+ useEffect(() => {
136
+ const target = canvas.current;
137
+ if (!near || !info || !target || displayWidth <= 0) return;
138
+ const turned = info.rotation === 90 || info.rotation === 270;
139
+ const scale = displayWidth / (turned ? info.height : info.width);
140
+ const render = queue.schedule(async (signal) => {
141
+ try {
142
+ await session.renderPage(pageKey, target, {
143
+ scale,
144
+ pixelRatio: globalThis.devicePixelRatio || 1,
145
+ signal
146
+ });
147
+ if (!signal.aborted) {
148
+ setDrawn(true);
149
+ setFailure(void 0);
150
+ }
151
+ } catch (reason) {
152
+ if (!signal.aborted) setFailure(reason);
153
+ }
154
+ });
155
+ return () => render.cancel();
156
+ }, [
157
+ near,
158
+ info,
159
+ displayWidth,
160
+ session,
161
+ pageKey,
162
+ queue
163
+ ]);
164
+ useEffect(() => {
165
+ if (near) return;
166
+ const target = canvas.current;
167
+ if (target) {
168
+ target.width = 0;
169
+ target.height = 0;
170
+ }
171
+ setDrawn(false);
172
+ }, [near]);
173
+ return {
174
+ canvas,
175
+ info,
176
+ drawn,
177
+ failure
178
+ };
179
+ }
180
+ // src/react/viewer/geometry.ts
181
+ function pageGeometry(size, rotation, displayWidth) {
182
+ const turned = rotation === 90 || rotation === 270;
183
+ const scale = displayWidth / (turned ? size.height : size.width);
184
+ const pageWidth = size.width * scale;
185
+ const pageHeight = size.height * scale;
186
+ const width = turned ? pageHeight : pageWidth;
187
+ const height = turned ? pageWidth : pageHeight;
188
+ return {
189
+ width,
190
+ height,
191
+ pageWidth,
192
+ pageHeight,
193
+ transform: {
194
+ 0: "none",
195
+ 90: `translate(${width}px, 0) rotate(90deg)`,
196
+ 180: `translate(${width}px, ${height}px) rotate(180deg)`,
197
+ 270: `translate(0, ${height}px) rotate(270deg)`
198
+ }[rotation]
199
+ };
200
+ }
201
+ // src/react/viewer/render-queue.ts
202
+ var RenderQueue = class {
203
+ #limit;
204
+ #running = 0;
205
+ #waiting = [];
206
+ constructor(limit = 2) {
207
+ this.#limit = Math.max(1, limit);
208
+ }
209
+ schedule(task) {
210
+ const entry = {
211
+ task,
212
+ controller: new AbortController()
213
+ };
214
+ this.#waiting.push(entry);
215
+ this.#next();
216
+ return { cancel: () => {
217
+ const index = this.#waiting.indexOf(entry);
218
+ if (index >= 0) this.#waiting.splice(index, 1);
219
+ entry.controller.abort();
220
+ } };
221
+ }
222
+ #next() {
223
+ while (this.#running < this.#limit && this.#waiting.length > 0) {
224
+ const entry = this.#waiting.pop();
225
+ this.#running += 1;
226
+ entry.task(entry.controller.signal).catch(() => {}).finally(() => {
227
+ this.#running -= 1;
228
+ this.#next();
229
+ });
230
+ }
231
+ }
232
+ };
233
+ // src/react/thumbnails/PdfThumbnails.tsx
234
+ var LETTER$1 = {
235
+ width: 612,
236
+ height: 792
237
+ };
238
+ var join$3 = (...names) => names.filter(Boolean).join(" ");
239
+ function Thumbnail(props) {
240
+ const { page, index, count, id, selected, current, active, displayWidth, classNames } = props;
241
+ const messages = usePdfMessages();
242
+ const element = useRef(null);
243
+ const near = useNear(props.observe, element, displayWidth > 0);
244
+ const { canvas, info, drawn } = usePageDrawing({
245
+ session: props.session,
246
+ pageKey: page.key,
247
+ rotation: page.rotation,
248
+ near,
249
+ displayWidth,
250
+ queue: props.queue,
251
+ onMeasured: props.onMeasured
252
+ });
253
+ const geometry = pageGeometry(info ?? { ...props.estimate }, info?.rotation ?? 0, displayWidth);
254
+ return /* @__PURE__ */ jsxs("div", {
255
+ ref: element,
256
+ id,
257
+ role: "option",
258
+ "aria-selected": selected,
259
+ "aria-current": current ? "true" : void 0,
260
+ "aria-label": messages.t("thumbnails.page", {
261
+ page: index + 1,
262
+ count
263
+ }),
264
+ "aria-busy": near && !drawn,
265
+ tabIndex: active ? 0 : -1,
266
+ className: join$3("hm-pdf-thumbnail", classNames.thumbnail),
267
+ "data-hm-page-key": page.key,
268
+ onClick: (event) => props.onPointer(index, event),
269
+ children: [/* @__PURE__ */ jsx("div", {
270
+ className: join$3("hm-pdf-thumbnail-frame", classNames.frame),
271
+ style: {
272
+ width: `${geometry.width}px`,
273
+ height: `${geometry.height}px`
274
+ },
275
+ children: /* @__PURE__ */ jsx("canvas", {
276
+ ref: canvas,
277
+ "aria-hidden": "true",
278
+ className: join$3("hm-pdf-thumbnail-canvas", classNames.canvas)
279
+ })
280
+ }), /* @__PURE__ */ jsx("span", {
281
+ "aria-hidden": "true",
282
+ className: join$3("hm-pdf-thumbnail-number", classNames.number),
283
+ children: messages.t("thumbnails.number", { page: index + 1 })
284
+ })]
285
+ });
286
+ }
287
+ function PdfThumbnails(props) {
288
+ const { className, classNames = {}, unstyled = false, concurrency = 2 } = props;
289
+ const session = usePdfSession();
290
+ const snapshot = usePdfDocument();
291
+ const messages = usePdfMessages();
292
+ const root = useRef(null);
293
+ const prefix = useId();
294
+ const observe = useNearObserver(root);
295
+ const [queue] = useState(() => new RenderQueue(concurrency));
296
+ const [width, setWidth] = useState(0);
297
+ const [estimate, setEstimate] = useState(LETTER$1);
298
+ const [activeKey, setActiveKey] = useState();
299
+ const anchor = useRef(void 0);
300
+ const { plan, selection, currentPage } = snapshot;
301
+ const keys = plan.pages.map((page) => page.key);
302
+ const active = activeKey && keys.includes(activeKey) ? activeKey : currentPage ?? keys[0];
303
+ const activeIndex = active ? keys.indexOf(active) : -1;
304
+ useEffect(() => {
305
+ const element = root.current;
306
+ if (!element) return;
307
+ const observer = new ResizeObserver(([entry]) => {
308
+ if (entry) setWidth(entry.contentRect.width);
309
+ });
310
+ observer.observe(element);
311
+ return () => observer.disconnect();
312
+ }, []);
313
+ useEffect(() => {
314
+ const element = root.current;
315
+ if (!element || !currentPage || element.contains(document.activeElement)) return;
316
+ element.querySelector(`[data-hm-page-key="${CSS.escape(currentPage)}"]`)?.scrollIntoView({ block: "nearest" });
317
+ }, [currentPage]);
318
+ const onMeasured = useCallback((info) => {
319
+ setEstimate((current) => current === LETTER$1 ? {
320
+ width: info.width,
321
+ height: info.height
322
+ } : current);
323
+ }, []);
324
+ const focus = (index) => {
325
+ const key = keys[index];
326
+ if (!key) return;
327
+ setActiveKey(key);
328
+ root.current?.querySelector(`[data-hm-page-key="${CSS.escape(key)}"]`)?.focus();
329
+ };
330
+ const choose = (index, mode) => {
331
+ const key = keys[index];
332
+ if (!key) return;
333
+ focus(index);
334
+ if (mode === "focus") return;
335
+ if (mode === "toggle") {
336
+ session.select(selection.includes(key) ? selection.filter((k) => k !== key) : [...selection, key]);
337
+ anchor.current = key;
338
+ return;
339
+ }
340
+ if (mode === "range" && anchor.current && keys.includes(anchor.current)) {
341
+ const from = keys.indexOf(anchor.current);
342
+ const [start, end] = from < index ? [from, index] : [index, from];
343
+ session.select(keys.slice(start, end + 1));
344
+ } else {
345
+ session.select([key]);
346
+ anchor.current = key;
347
+ }
348
+ session.goToPage(key);
349
+ };
350
+ const onKeyDown = (event) => {
351
+ if (keys.length === 0) return;
352
+ const modifier = event.ctrlKey || event.metaKey;
353
+ const move = (index) => {
354
+ event.preventDefault();
355
+ const target = Math.max(0, Math.min(keys.length - 1, index));
356
+ choose(target, event.shiftKey ? "range" : modifier ? "focus" : "only");
357
+ };
358
+ switch (event.key) {
359
+ case "ArrowDown":
360
+ case "ArrowRight":
361
+ move(activeIndex + 1);
362
+ break;
363
+ case "ArrowUp":
364
+ case "ArrowLeft":
365
+ move(activeIndex - 1);
366
+ break;
367
+ case "Home":
368
+ move(0);
369
+ break;
370
+ case "End":
371
+ move(keys.length - 1);
372
+ break;
373
+ case " ":
374
+ event.preventDefault();
375
+ if (activeIndex >= 0) choose(activeIndex, "toggle");
376
+ break;
377
+ case "Escape":
378
+ if (active) session.select([active]);
379
+ break;
380
+ case "a":
381
+ case "A": if (modifier) {
382
+ event.preventDefault();
383
+ session.select(keys);
384
+ }
385
+ }
386
+ };
387
+ const onPointer = (index, event) => {
388
+ choose(index, event.shiftKey ? "range" : event.ctrlKey || event.metaKey ? "toggle" : "only");
389
+ };
390
+ return /* @__PURE__ */ jsx("div", {
391
+ ref: root,
392
+ role: "listbox",
393
+ "aria-label": messages.t("thumbnails.label"),
394
+ "aria-multiselectable": "true",
395
+ "aria-orientation": "vertical",
396
+ tabIndex: keys.length === 0 ? 0 : -1,
397
+ onKeyDown,
398
+ className: join$3("hm-pdf-thumbnails", className, classNames.root),
399
+ ...unstyled ? { "data-hm-unstyled": "" } : {},
400
+ children: plan.pages.map((page, index) => /* @__PURE__ */ jsx(Thumbnail, {
401
+ page,
402
+ index,
403
+ count: keys.length,
404
+ id: `${prefix}-${page.key}`,
405
+ selected: selection.includes(page.key),
406
+ current: page.key === currentPage,
407
+ active: page.key === active,
408
+ displayWidth: width,
409
+ estimate,
410
+ observe,
411
+ queue,
412
+ session,
413
+ onMeasured,
414
+ onPointer,
415
+ classNames
416
+ }, page.key))
417
+ });
418
+ }
419
+ // src/react/viewer/PdfViewerPage.tsx
420
+ var join$2 = (...names) => names.filter(Boolean).join(" ");
421
+ function PdfViewerPage(props) {
422
+ const { page, number, count, displayWidth, estimate, observe, queue, onMeasured, classNames } = props;
423
+ const session = usePdfSession();
424
+ const messages = usePdfMessages();
425
+ const element = useRef(null);
426
+ const textLayer = useRef(null);
427
+ const near = useNear(observe, element, displayWidth > 0);
428
+ const [text, setText] = useState();
429
+ const [links, setLinks] = useState([]);
430
+ const { canvas, info, drawn, failure } = usePageDrawing({
431
+ session,
432
+ pageKey: page.key,
433
+ rotation: page.rotation,
434
+ near,
435
+ displayWidth,
436
+ queue,
437
+ onMeasured
438
+ });
439
+ useEffect(() => {
440
+ if (!near || text) return;
441
+ const controller = new AbortController();
442
+ const signal = controller.signal;
443
+ Promise.all([session.getTextContent(page.key, { signal }), session.getLinks(page.key, { signal })]).then(([content, found]) => {
444
+ setText(content);
445
+ setLinks(found);
446
+ }, () => {});
447
+ return () => controller.abort();
448
+ }, [
449
+ near,
450
+ session,
451
+ page.key,
452
+ text
453
+ ]);
454
+ const geometry = pageGeometry(info ?? {
455
+ ...estimate,
456
+ rotation: 0
457
+ }, info?.rotation ?? 0, displayWidth);
458
+ useLayoutEffect(() => {
459
+ const layer = textLayer.current;
460
+ if (!layer || !text) return;
461
+ for (const span of layer.querySelectorAll("[data-hm-width]")) {
462
+ span.style.transform = "";
463
+ const natural = span.getBoundingClientRect().width;
464
+ const wanted = Number(span.dataset["hmWidth"]) * geometry.pageWidth;
465
+ if (natural > 0 && wanted > 0) span.style.transform = `scaleX(${wanted / natural})`;
466
+ }
467
+ }, [text, geometry.pageWidth]);
468
+ const overlay = {
469
+ width: `${geometry.pageWidth}px`,
470
+ height: `${geometry.pageHeight}px`,
471
+ transform: geometry.transform
472
+ };
473
+ return /* @__PURE__ */ jsxs("div", {
474
+ ref: element,
475
+ role: "group",
476
+ "aria-label": messages.t("viewer.page", {
477
+ page: number,
478
+ count
479
+ }),
480
+ "aria-busy": near && !drawn && !failure,
481
+ className: join$2("hm-pdf-page", classNames.page),
482
+ "data-hm-page-key": page.key,
483
+ style: {
484
+ width: `${geometry.width}px`,
485
+ height: `${geometry.height}px`
486
+ },
487
+ children: [
488
+ /* @__PURE__ */ jsx("canvas", {
489
+ ref: canvas,
490
+ "aria-hidden": "true",
491
+ className: join$2("hm-pdf-page-canvas", classNames.canvas)
492
+ }),
493
+ failure !== void 0 ? /* @__PURE__ */ jsx("p", {
494
+ role: "alert",
495
+ className: join$2("hm-pdf-page-error", classNames.error),
496
+ children: messages.error(failure)
497
+ }) : null,
498
+ near && text ? /* @__PURE__ */ jsx("div", {
499
+ ref: textLayer,
500
+ className: join$2("hm-pdf-text-layer", classNames.textLayer),
501
+ style: overlay,
502
+ children: text.items.map((item, index) => /* @__PURE__ */ jsxs("span", {
503
+ "data-hm-width": item.rect.width,
504
+ style: {
505
+ left: `${item.rect.x * 100}%`,
506
+ top: `${item.rect.y * 100}%`,
507
+ fontSize: `${item.rect.height * geometry.pageHeight}px`,
508
+ lineHeight: 1
509
+ },
510
+ children: [item.text, item.endOfLine ? "\n" : ""]
511
+ }, index))
512
+ }) : null,
513
+ near && links.length > 0 ? /* @__PURE__ */ jsx("div", {
514
+ className: join$2("hm-pdf-link-layer", classNames.linkLayer),
515
+ style: overlay,
516
+ children: links.map((link, index) => {
517
+ const href = safeLinkUrl(link.url);
518
+ const destination = href && linkDestination(href);
519
+ if (!href || !destination) return null;
520
+ const email = href.startsWith("mailto:");
521
+ const label = email ? messages.t("viewer.emailLink", { destination }) : messages.t("viewer.webLink", { destination });
522
+ return /* @__PURE__ */ jsx("a", {
523
+ className: join$2("hm-pdf-link", classNames.link),
524
+ href,
525
+ target: email ? void 0 : "_blank",
526
+ rel: "noopener noreferrer",
527
+ referrerPolicy: "no-referrer",
528
+ title: label,
529
+ style: {
530
+ left: `${link.rect.x * 100}%`,
531
+ top: `${link.rect.y * 100}%`,
532
+ width: `${link.rect.width * 100}%`,
533
+ height: `${link.rect.height * 100}%`
534
+ },
535
+ children: /* @__PURE__ */ jsx("span", {
536
+ className: "hm-pdf-link-label",
537
+ children: label
538
+ })
539
+ }, index);
540
+ })
541
+ }) : null
542
+ ]
543
+ });
544
+ }
545
+ // src/react/viewer/PdfViewer.tsx
546
+ var LETTER = {
547
+ width: 612,
548
+ height: 792
549
+ };
550
+ var join$1 = (...names) => names.filter(Boolean).join(" ");
551
+ function PdfViewer(props) {
552
+ const { className, classNames = {}, unstyled = false, zoom = 1, concurrency = 2 } = props;
553
+ const snapshot = usePdfDocument();
554
+ const messages = usePdfMessages();
555
+ const root = useRef(null);
556
+ const pages = useRef(null);
557
+ const [width, setWidth] = useState(0);
558
+ const [estimate, setEstimate] = useState(LETTER);
559
+ const [queue] = useState(() => new RenderQueue(concurrency));
560
+ const observe = useNearObserver(root);
561
+ const session = usePdfSession();
562
+ const anchor = useRef(void 0);
563
+ const own = useRef(void 0);
564
+ const findPage = useCallback((key) => root.current?.querySelector(`[data-hm-page-key="${CSS.escape(key)}"]`) ?? void 0, []);
565
+ const scrollOwn = useCallback((element, top) => {
566
+ element.scrollTop = top;
567
+ own.current = element.scrollTop;
568
+ }, []);
569
+ useEffect(() => {
570
+ const element = pages.current;
571
+ if (!element) return;
572
+ const observer = new ResizeObserver(([entry]) => {
573
+ if (entry) setWidth(entry.contentRect.width);
574
+ const viewer = root.current;
575
+ const held = anchor.current;
576
+ if (!viewer || !held) return;
577
+ const page = findPage(held.key);
578
+ if (!page) {
579
+ anchor.current = void 0;
580
+ return;
581
+ }
582
+ const top = page.offsetTop - held.offset;
583
+ if (Math.abs(viewer.scrollTop - top) >= 1) scrollOwn(viewer, top);
584
+ });
585
+ observer.observe(element);
586
+ return () => observer.disconnect();
587
+ }, [findPage, scrollOwn]);
588
+ useEffect(() => {
589
+ const element = root.current;
590
+ if (!element) return;
591
+ let frame = 0;
592
+ const measure = () => {
593
+ frame = 0;
594
+ const { scrollTop } = element;
595
+ const line = scrollTop + element.clientHeight / 3;
596
+ const user = own.current === void 0 || Math.abs(scrollTop - own.current) >= 1;
597
+ let current;
598
+ let top;
599
+ for (const page of element.querySelectorAll("[data-hm-page-key]")) {
600
+ if (page.offsetTop > line) break;
601
+ current = page;
602
+ if (page.offsetTop <= scrollTop || !top) top = page;
603
+ }
604
+ if (user) {
605
+ own.current = void 0;
606
+ anchor.current = top && {
607
+ key: top.dataset["hmPageKey"],
608
+ offset: top.offsetTop - scrollTop
609
+ };
610
+ }
611
+ const key = current?.dataset["hmPageKey"];
612
+ if (key) session.setCurrentPage(key);
613
+ };
614
+ const onScroll = () => {
615
+ frame ||= requestAnimationFrame(measure);
616
+ };
617
+ element.addEventListener("scroll", onScroll, { passive: true });
618
+ return () => {
619
+ element.removeEventListener("scroll", onScroll);
620
+ cancelAnimationFrame(frame);
621
+ };
622
+ }, [session]);
623
+ const sequence = snapshot.navigation?.sequence;
624
+ const target = snapshot.navigation?.page;
625
+ useEffect(() => {
626
+ const element = root.current;
627
+ if (!element || sequence === void 0 || target === void 0) return;
628
+ const page = findPage(target);
629
+ if (!page) return;
630
+ const inset = Number.parseFloat(getComputedStyle(pages.current).paddingTop) || 0;
631
+ anchor.current = {
632
+ key: target,
633
+ offset: inset
634
+ };
635
+ scrollOwn(element, page.offsetTop - inset);
636
+ }, [
637
+ sequence,
638
+ target,
639
+ findPage,
640
+ scrollOwn
641
+ ]);
642
+ const onMeasured = useCallback((info) => {
643
+ setEstimate((current) => current === LETTER ? {
644
+ width: info.width,
645
+ height: info.height
646
+ } : current);
647
+ }, []);
648
+ const { plan } = snapshot;
649
+ const displayWidth = Math.max(0, width * zoom);
650
+ return /* @__PURE__ */ jsx("section", {
651
+ ref: root,
652
+ tabIndex: 0,
653
+ "aria-label": messages.t("viewer.label"),
654
+ className: join$1("hm-pdf-viewer", className, classNames.root),
655
+ ...unstyled ? { "data-hm-unstyled": "" } : {},
656
+ children: /* @__PURE__ */ jsx("div", {
657
+ ref: pages,
658
+ className: join$1("hm-pdf-viewer-pages", classNames.pages),
659
+ children: plan.pages.length === 0 ? /* @__PURE__ */ jsx("p", {
660
+ className: join$1("hm-pdf-viewer-empty", classNames.empty),
661
+ children: messages.t("viewer.empty")
662
+ }) : plan.pages.map((page, index) => /* @__PURE__ */ jsx(PdfViewerPage, {
663
+ page,
664
+ number: index + 1,
665
+ count: plan.pages.length,
666
+ displayWidth,
667
+ estimate,
668
+ observe,
669
+ queue,
670
+ onMeasured,
671
+ classNames
672
+ }, page.key))
673
+ })
674
+ });
675
+ }
676
+ // src/react/editor/PdfEditorStart.tsx
677
+ var hasFiles = (event) => event.dataTransfer.types.includes("Files");
678
+ function PdfEditorStart(props) {
679
+ const { error, onFile, button, className, alertClassName } = props;
680
+ const messages = usePdfMessages();
681
+ const input = useRef(null);
682
+ const [dragging, setDragging] = useState(false);
683
+ const titleId = useId();
684
+ const hintId = useId();
685
+ const choose = (event) => {
686
+ const [file] = event.target.files ?? [];
687
+ event.target.value = "";
688
+ if (file) onFile(file);
689
+ };
690
+ const onDragOver = (event) => {
691
+ if (!hasFiles(event)) return;
692
+ event.preventDefault();
693
+ event.dataTransfer.dropEffect = "copy";
694
+ setDragging(true);
695
+ };
696
+ const onDragLeave = (event) => {
697
+ if (event.currentTarget.contains(event.relatedTarget)) return;
698
+ setDragging(false);
699
+ };
700
+ const onDrop = (event) => {
701
+ if (!hasFiles(event)) return;
702
+ event.preventDefault();
703
+ setDragging(false);
704
+ const [file] = event.dataTransfer.files;
705
+ if (file) onFile(file);
706
+ };
707
+ return /* @__PURE__ */ jsxs("div", {
708
+ className,
709
+ "data-hm-dragging": dragging ? "" : void 0,
710
+ onDragEnter: onDragOver,
711
+ onDragOver,
712
+ onDragLeave,
713
+ onDrop,
714
+ children: [
715
+ /* @__PURE__ */ jsx("p", {
716
+ id: titleId,
717
+ className: "hm-pdf-editor-start-title",
718
+ children: messages.t(error ? "editor.start.retryTitle" : "editor.start.title")
719
+ }),
720
+ error ? /* @__PURE__ */ jsx("p", {
721
+ role: "alert",
722
+ className: alertClassName,
723
+ children: messages.error(error)
724
+ }) : null,
725
+ /* @__PURE__ */ jsx("button", {
726
+ ref: button,
727
+ type: "button",
728
+ className: "hm-pdf-editor-button",
729
+ "aria-describedby": hintId,
730
+ onClick: () => input.current?.click(),
731
+ children: messages.t(error ? "editor.start.retry" : "editor.start.choose")
732
+ }),
733
+ /* @__PURE__ */ jsx("p", {
734
+ id: hintId,
735
+ className: "hm-pdf-editor-start-hint",
736
+ children: messages.t("editor.start.hint")
737
+ }),
738
+ /* @__PURE__ */ jsx("input", {
739
+ ref: input,
740
+ type: "file",
741
+ accept: "application/pdf,.pdf",
742
+ tabIndex: -1,
743
+ "aria-hidden": "true",
744
+ hidden: true,
745
+ onChange: choose
746
+ })
747
+ ]
748
+ });
749
+ }
750
+ // src/react/editor/PdfEditor.tsx
751
+ function warningText(messages, warning) {
752
+ const t = messages.t;
753
+ return t(`warnings.${warning.limit}`, { actual: warning.actual });
754
+ }
755
+ var join = (...names) => names.filter(Boolean).join(" ");
756
+ function changeBetween(before, after) {
757
+ const pageCount = after.plan.pages.length;
758
+ if (after.status === "ready" && after.sources[0]?.id !== before.sources[0]?.id) return {
759
+ reason: "open",
760
+ pageCount
761
+ };
762
+ if (before.sources.length > 0 && after.sources.length === 0) return {
763
+ reason: "close",
764
+ pageCount: 0
765
+ };
766
+ if (after.status === "ready" && after.plan !== before.plan) return {
767
+ reason: "edit",
768
+ pageCount
769
+ };
770
+ }
771
+ function PdfEditorBody(props) {
772
+ const { file, onChange, className, classNames = {}, unstyled = false, handle } = props;
773
+ const session = usePdfSession();
774
+ const snapshot = usePdfDocument();
775
+ const messages = usePdfMessages();
776
+ const root = useRef(null);
777
+ const startButton = useRef(null);
778
+ const [announcement, setAnnouncement] = useState("");
779
+ const latestOnChange = useRef(onChange);
780
+ latestOnChange.current = onChange;
781
+ useImperativeHandle(handle, () => ({
782
+ session,
783
+ open: (next) => session.open(next),
784
+ export: (options) => session.export(options),
785
+ undo: () => session.undo(),
786
+ redo: () => session.redo(),
787
+ close: () => session.close()
788
+ }), [session]);
789
+ useEffect(() => {
790
+ if (file === void 0) return;
791
+ if (file === null) {
792
+ session.close();
793
+ return;
794
+ }
795
+ const controller = new AbortController();
796
+ session.open(file, { signal: controller.signal }).catch(() => {});
797
+ return () => controller.abort();
798
+ }, [session, file]);
799
+ useEffect(() => {
800
+ let before = session.getSnapshot();
801
+ return session.subscribe(() => {
802
+ const after = session.getSnapshot();
803
+ const change = changeBetween(before, after);
804
+ before = after;
805
+ if (!change) return;
806
+ if (change.reason === "open") setAnnouncement(messages.t("editor.opened", { count: change.pageCount }));
807
+ else if (change.reason === "close") setAnnouncement(messages.t("editor.closed"));
808
+ latestOnChange.current?.(change);
809
+ });
810
+ }, [session, messages]);
811
+ const { status } = snapshot;
812
+ const previous = useRef(status);
813
+ useEffect(() => {
814
+ if (previous.current === status) return;
815
+ previous.current = status;
816
+ const active = document.activeElement;
817
+ if (!(active === null || active === document.body || root.current?.contains(active))) return;
818
+ if (status === "ready") root.current?.querySelector(".hm-pdf-viewer")?.focus();
819
+ if (status === "error") startButton.current?.focus();
820
+ }, [status]);
821
+ const open = (chosen) => {
822
+ session.open(chosen).catch(() => {});
823
+ };
824
+ const { error, warnings } = snapshot;
825
+ const showError = error !== void 0 && error.code !== "ABORTED";
826
+ let content;
827
+ if (status === "ready") content = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PdfThumbnails, {
828
+ className: join("hm-pdf-editor-sidebar", classNames.sidebar),
829
+ unstyled
830
+ }), /* @__PURE__ */ jsx(PdfViewer, { unstyled })] });
831
+ else if (status === "opening") content = /* @__PURE__ */ jsxs("div", {
832
+ role: "status",
833
+ className: join("hm-pdf-editor-loading", classNames.status),
834
+ children: [/* @__PURE__ */ jsx("progress", {
835
+ className: "hm-pdf-editor-progress",
836
+ "aria-hidden": "true"
837
+ }), /* @__PURE__ */ jsx("p", { children: messages.t("editor.opening") })]
838
+ });
839
+ else content = /* @__PURE__ */ jsx(PdfEditorStart, {
840
+ error: showError ? error : void 0,
841
+ onFile: open,
842
+ button: startButton,
843
+ className: join("hm-pdf-editor-start", classNames.start),
844
+ alertClassName: join("hm-pdf-editor-alert", classNames.alert)
845
+ });
846
+ return /* @__PURE__ */ jsxs("div", {
847
+ ref: root,
848
+ role: "group",
849
+ "aria-label": messages.t("editor.label"),
850
+ "aria-busy": status === "opening" || snapshot.busy,
851
+ className: join("hm-pdf-editor", className, classNames.root),
852
+ "data-hm-status": status,
853
+ ...unstyled ? { "data-hm-unstyled": "" } : {},
854
+ children: [
855
+ /* @__PURE__ */ jsxs("div", {
856
+ className: join("hm-pdf-editor-header", classNames.header),
857
+ children: [
858
+ /* @__PURE__ */ jsx("div", { className: join("hm-pdf-editor-toolbar", classNames.toolbar) }),
859
+ status === "ready" && showError ? /* @__PURE__ */ jsx("p", {
860
+ role: "alert",
861
+ className: join("hm-pdf-editor-alert", classNames.alert),
862
+ children: messages.error(error)
863
+ }) : null,
864
+ status === "ready" && warnings.length > 0 ? /* @__PURE__ */ jsx("div", {
865
+ role: "status",
866
+ className: join("hm-pdf-editor-warnings", classNames.status),
867
+ children: /* @__PURE__ */ jsx("ul", { children: warnings.map((warning) => /* @__PURE__ */ jsx("li", { children: warningText(messages, warning) }, warning.limit)) })
868
+ }) : null
869
+ ]
870
+ }),
871
+ /* @__PURE__ */ jsx("div", {
872
+ className: join("hm-pdf-editor-body", classNames.body),
873
+ children: content
874
+ }),
875
+ /* @__PURE__ */ jsx("p", {
876
+ role: "status",
877
+ className: "hm-pdf-editor-announcer",
878
+ children: announcement
879
+ })
880
+ ]
881
+ });
882
+ }
883
+ var PdfEditor = /* @__PURE__ */ forwardRef(function PdfEditor(props, handle) {
884
+ const { file, onChange, className, classNames, unstyled, ...provider } = props;
885
+ return /* @__PURE__ */ jsx(PdfSessionProvider, {
886
+ ...provider,
887
+ children: /* @__PURE__ */ jsx(PdfEditorBody, {
888
+ handle,
889
+ ...file !== void 0 ? { file } : {},
890
+ ...onChange ? { onChange } : {},
891
+ ...className !== void 0 ? { className } : {},
892
+ ...classNames ? { classNames } : {},
893
+ ...unstyled !== void 0 ? { unstyled } : {}
894
+ })
895
+ });
896
+ });
897
+ export { PdfEditor, PdfSessionProvider, PdfThumbnails, PdfViewer, usePdfDocument, usePdfMessages, usePdfSession };
898
+
899
+ //# sourceMappingURL=react.js.map