collabmd 0.1.46 → 0.1.48

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 (317) hide show
  1. package/README.md +9 -5
  2. package/dist/client/assets/{CodeMirrorEditor-UCMRAMCV-CYM5nxUi.js → CodeMirrorEditor-UCMRAMCV-BPH4FJkv.js} +1 -1
  3. package/dist/client/assets/JetBrainsMono-Regular-BQaDgvhP.woff2 +0 -0
  4. package/dist/client/assets/{abnfDiagram-N423BO3Z-CUMTFJhI.js → abnfDiagram-VCTEODGH-BNDLzJ7L.js} +1 -1
  5. package/dist/client/assets/architecture-7GRP2DOG-BMOPAkUC.js +1 -0
  6. package/dist/client/assets/{architectureDiagram-T3A2C74G-w25m71oV.js → architectureDiagram-5GKGNRK7-I39sYjHI.js} +1 -1
  7. package/dist/client/assets/babel-CY5KOv-I.js +16 -0
  8. package/dist/client/assets/base-BYODPHdS.js +1 -0
  9. package/dist/client/assets/blockDiagram-NRAW4CY4-C6DtJy5Y.js +129 -0
  10. package/dist/client/assets/browser-BKLM0ThC-IxjwuOIz-BBqQnUEb.js +1 -0
  11. package/dist/client/assets/c4Diagram-UCG6FXSJ-CtWtxS9_.js +38 -0
  12. package/dist/client/assets/channel-CaoKA_We.js +1 -0
  13. package/dist/client/assets/{chunk-U6XO7XAA-BFxjP5U3.js → chunk-2ZTRR5NV-C2qZJila.js} +1 -1
  14. package/dist/client/assets/{chunk-YOTPTUD7-D0vRKqYp.js → chunk-3Z5EZCMW-DMniOlPd.js} +1 -1
  15. package/dist/client/assets/{chunk-BIQX33UG-DZEsGuSn.js → chunk-5V3GS4D5-i-ZDOEnP.js} +1 -1
  16. package/dist/client/assets/{chunk-MOZMSUNE-XVucA-n6.js → chunk-6AZGARVD-BB6FqMl-.js} +1 -1
  17. package/dist/client/assets/{chunk-5JV3BV7I-Cy5pj3QY.js → chunk-6EIED4P4-DdUJkP0f.js} +1 -1
  18. package/dist/client/assets/{chunk-R7FJI6CG-Cnn3gE-Y.js → chunk-6K3QC6MW-CqVsVn-y.js} +1 -1
  19. package/dist/client/assets/{chunk-OSBZ3O6U-CrKZOUOr.js → chunk-6TQVIW2G-DKlLbNIP.js} +1 -1
  20. package/dist/client/assets/{chunk-JG7HCLWE-BYfiSaVt.js → chunk-747NJXEK-BFkZPlab.js} +1 -1
  21. package/dist/client/assets/{chunk-NSK5VX7P-TLH37VXI.js → chunk-75Z2AOVW-CdFSaPjz.js} +1 -1
  22. package/dist/client/assets/chunk-CKBBP62Z-DG26UiBv.js +2 -0
  23. package/dist/client/assets/{chunk-3NCLNEKW-Y2Jf_LI-.js → chunk-CLGD4ZFX-DQLgbQrv.js} +1 -1
  24. package/dist/client/assets/chunk-DSNCTWBM-8xkug7fQ.js +2 -0
  25. package/dist/client/assets/chunk-DU6HZSFF-COXDzJK1.js +127 -0
  26. package/dist/client/assets/{chunk-2GRJ4B5K-DhnlUv3F.js → chunk-F27PBJKO-CNHIFhjo.js} +1 -1
  27. package/dist/client/assets/{chunk-YGJVY4SA-CjSe7Bx7.js → chunk-FLYJHZSQ-Be7lKF17.js} +1 -1
  28. package/dist/client/assets/{chunk-KEIR6QF5-BICK3FdT.js → chunk-FOHPRMQF-DHwB1DNv.js} +2 -2
  29. package/dist/client/assets/{chunk-5RXB4S5H-BWrwFqMI.js → chunk-G27WJ6UU-D9-eg537.js} +2 -2
  30. package/dist/client/assets/chunk-GMAD6QVW-CbcBqPM5.js +72 -0
  31. package/dist/client/assets/{chunk-QBLGF6JB-CxAyS2mW.js → chunk-I5DQTOEV-Hm2LfiYI.js} +1 -1
  32. package/dist/client/assets/{chunk-5FCAYU7R-Dh5nylU8.js → chunk-ICYGCRZG-749o-pGJ.js} +1 -1
  33. package/dist/client/assets/{chunk-CQNSW5MT-B8S09OIh.js → chunk-IH6LHLGP-CC6I9F3i.js} +1 -1
  34. package/dist/client/assets/chunk-JQ64N6SF-DSFNH4bh.js +1 -0
  35. package/dist/client/assets/{chunk-CYSBUYHQ-C1Rf4art.js → chunk-KI3K4JFJ-Rma-0k_M.js} +1 -1
  36. package/dist/client/assets/{chunk-GF5L2VYU-DkJpO7ff.js → chunk-LCL6LL3I-DmDkVukh.js} +1 -1
  37. package/dist/client/assets/chunk-LNGE3PJU-DWpGwHrW.js +34 -0
  38. package/dist/client/assets/chunk-OBVCFTLP-BJR7u1jh.js +1 -0
  39. package/dist/client/assets/{chunk-5TONJI2A-DQOY3q1H.js → chunk-OUJLGHUK-D0j2JRSg.js} +1 -1
  40. package/dist/client/assets/chunk-P2QGCYS3-BRpqY32H.js +1 -0
  41. package/dist/client/assets/{chunk-KBJHAD2P-CB_3zWUf.js → chunk-POPQ4Y6H-Cb4SlVZF.js} +1 -1
  42. package/dist/client/assets/{chunk-4I5QYGJK-CCB2YcIH.js → chunk-PWAF6VOD-Cz8IwBB5.js} +1 -1
  43. package/dist/client/assets/chunk-R7TYR2AO-CTd0Yj98.js +10 -0
  44. package/dist/client/assets/chunk-RHFEMEQ7-CWY8cf4H.js +168 -0
  45. package/dist/client/assets/chunk-RM4UPSZO-CWRwxNWJ.js +41 -0
  46. package/dist/client/assets/{chunk-6Q2QTUOP-CPlWzBtc.js → chunk-SVP7TREG-CyHOmcac.js} +1 -1
  47. package/dist/client/assets/chunk-TEH6E4GO-DVayPj-q.js +62 -0
  48. package/dist/client/assets/{chunk-EMLP6XTP-RLD4nXpI.js → chunk-UY3FDG6J-CnmaAkG5.js} +1 -1
  49. package/dist/client/assets/{chunk-5HE753X5-Bw-yg4kO.js → chunk-XHIXRSVI-BFQ6B8BE.js} +1 -1
  50. package/dist/client/assets/classDiagram-DTDB5LWJ-7fEmn0zV.js +1 -0
  51. package/dist/client/assets/classDiagram-v2-JRS7N3AN-7fEmn0zV.js +1 -0
  52. package/dist/client/assets/comment-ui-shared-DuoyznXW.js +7 -0
  53. package/dist/client/assets/cynefin-OW5HDTMX-7tP7QfM3.js +1 -0
  54. package/dist/client/assets/{cynefinDiagram-MW4NZA55-CJxXfJek.js → cynefinDiagram-5FMLGOSQ-CdTPi2yO.js} +1 -1
  55. package/dist/client/assets/dagre-3AP2YEHR-5gtJtd0O.js +4 -0
  56. package/dist/client/assets/dagre-PrKaheQc.js +1 -0
  57. package/dist/client/assets/{diagram-7IWD3JNH-B2d2Bm15.js → diagram-S7CK7UJ4-BudWz9WU.js} +4 -4
  58. package/dist/client/assets/{diagram-UB23O5K3-DJcKCwv9.js → diagram-UQ7AKVKN-3v4rbH-s.js} +1 -1
  59. package/dist/client/assets/{diagram-B4RE2ZJO-NP4UAwjR.js → diagram-VSXAHHWV-CQRVEZR7.js} +1 -1
  60. package/dist/client/assets/{diagram-Q27KOJAE-DylDuwor.js → diagram-VX7I27RA-C_-rj0sw.js} +1 -1
  61. package/dist/client/assets/{diagram-LBJQPF4R-D1FJQV8t.js → diagram-Z3DM3KII-B4yxavgj.js} +1 -1
  62. package/dist/client/assets/direct-engine-DdrQKpgq-CtKfQzCt.js +5 -0
  63. package/dist/client/assets/dist-73RPdcyU.js +1 -0
  64. package/dist/client/assets/{dist-Bm6pf9Bl.js → dist-BJ1bJs33.js} +1 -1
  65. package/dist/client/assets/{dist-BalScOwZ.js → dist-BK9QvQrc.js} +1 -1
  66. package/dist/client/assets/{dist-DLMiIsNC.js → dist-BPHLJ09L.js} +1 -1
  67. package/dist/client/assets/{dist-Bf8f4HmM.js → dist-B_yQaEv_.js} +1 -1
  68. package/dist/client/assets/{dist-CC5IrQMG.js → dist-BeajGMhO.js} +1 -1
  69. package/dist/client/assets/{dist-PDZ3bSqm.js → dist-Bw3VIE_v.js} +1 -1
  70. package/dist/client/assets/{dist-xElaxbia.js → dist-ByrG2qBA.js} +1 -1
  71. package/dist/client/assets/{dist-ule2n6ak.js → dist-C5NgpdG5.js} +1 -1
  72. package/dist/client/assets/dist-CH-sQu3r.js +1 -0
  73. package/dist/client/assets/dist-CKS_-are.js +1 -0
  74. package/dist/client/assets/{dist-D-Z6FLem.js → dist-CdmKGRGr.js} +1 -1
  75. package/dist/client/assets/dist-ChRoo3IB.js +9 -0
  76. package/dist/client/assets/{dist-dtAdgL39.js → dist-CietwTVS.js} +1 -1
  77. package/dist/client/assets/{dist-jv4WdPnK.js → dist-D37Hyu3h.js} +1 -1
  78. package/dist/client/assets/dist-D3fehAZ2.js +2 -0
  79. package/dist/client/assets/{dist-BEwK4csK.js → dist-D5wCC32z.js} +1 -1
  80. package/dist/client/assets/{dist-shrl6K_0.js → dist-DDUn5zTz.js} +1 -1
  81. package/dist/client/assets/{dist-CZgOmxK6.js → dist-DGEbEfw4.js} +1 -1
  82. package/dist/client/assets/{dist-B5HTH2BO.js → dist-DVy5woUy.js} +1 -1
  83. package/dist/client/assets/{dist-DZKu9Cs8.js → dist-DZAAWTG-.js} +1 -1
  84. package/dist/client/assets/{dist-TjMh8n1u.js → dist-Dir5dDKZ.js} +1 -1
  85. package/dist/client/assets/dist-Dl_tpDSr.js +1 -0
  86. package/dist/client/assets/{dist-FWJsgGYI.js → dist-DuH3ZrHo.js} +1 -1
  87. package/dist/client/assets/{dist-BjHJDtyU.js → dist-DutPuFmC.js} +1 -1
  88. package/dist/client/assets/{dist-Cqhv5LAk.js → dist-LQ4kDCKz.js} +1 -1
  89. package/dist/client/assets/{dist-CCP_AKPG.js → dist-RKBTaQMb.js} +1 -1
  90. package/dist/client/assets/{dist-BoVBdSjk.js → dist-Tw-Fxpeb.js} +1 -1
  91. package/dist/client/assets/dist-eBx8q6Sy.js +1 -0
  92. package/dist/client/assets/{dist-rGBmqxC7.js → dist-mj2Ht75J.js} +1 -1
  93. package/dist/client/assets/{dist-BDt3rz7l.js → dist-netZOQtD.js} +1 -1
  94. package/dist/client/assets/document-formatter-Dxl_a8XO.js +2 -0
  95. package/dist/client/assets/{drawio-editor-FzY1cVw8.js → drawio-editor-BVaNNtYp.js} +2 -2
  96. package/dist/client/assets/{drawioEditor-BjiKJqlc.js → drawioEditor-BkIBlXx0.js} +2 -2
  97. package/dist/client/assets/{ebnfDiagram-BXEA7PRR-nw0wmA6y.js → ebnfDiagram-PWID7BFC-OXa8VEp1.js} +1 -1
  98. package/dist/client/assets/editor-session-DMyVdHLj.js +54 -0
  99. package/dist/client/assets/embedded-editor-base-B3l6Xy65.css +1 -0
  100. package/dist/client/assets/embedpdf-BmE13ZZ0.js +1 -0
  101. package/dist/client/assets/embedpdf-DA4bA119-BPqZxwjc.js +2363 -0
  102. package/dist/client/assets/{en-7NFCYGKX-BrgYZAEe.js → en-SJ2YIMFF-CJBL3nkq.js} +1 -1
  103. package/dist/client/assets/erDiagram-SSCWMZ5O-C-iy6VkX.js +99 -0
  104. package/dist/client/assets/estree-CuT_pB8K.js +44 -0
  105. package/dist/client/assets/eventmodeling-NTZA5JFV-BR2FzK4R.js +1 -0
  106. package/dist/client/assets/excalidraw-editor-BbSbI80a.css +1 -0
  107. package/dist/client/assets/excalidraw-editor-BjYaNEMY.js +9 -0
  108. package/dist/client/assets/excalidrawEditor-ChqF_d82.js +2 -0
  109. package/dist/client/assets/export-page-Dyu0XCbu.js +57 -0
  110. package/dist/client/assets/exportDocument-CJBx4Xjx.css +1 -0
  111. package/dist/client/assets/exportDocument-Dgvfa2Sd.js +2 -0
  112. package/dist/client/assets/{file-icon-svg-CQAjlWjK.js → file-icon-svg-Y_kpF957.js} +1 -1
  113. package/dist/client/assets/file-kind-BwMIcZbi.js +1 -0
  114. package/dist/client/assets/file-search-DDLyyLDU.js +1 -0
  115. package/dist/client/assets/flowDiagram-A5DVABFB-CiW1eN8C.js +1 -0
  116. package/dist/client/assets/{ganttDiagram-PKOTCBZU-BnM97BCT.js → ganttDiagram-EL5Y4UJY-DtKHAbez.js} +1 -1
  117. package/dist/client/assets/gitGraph-4MIJSDKK-DYlXv_yJ.js +1 -0
  118. package/dist/client/assets/{gitGraphDiagram-DS77QQ5N-BQpQhjuN.js → gitGraphDiagram-WWUBYQGX-oue8fQ5o.js} +1 -1
  119. package/dist/client/assets/github-dark.min-BV82VuKq.css +1 -0
  120. package/dist/client/assets/github.min-v3dd8CNH.css +1 -0
  121. package/dist/client/assets/html-Cdnr2qzU.js +25 -0
  122. package/dist/client/assets/image-ZVKINSPA-0zXSnE7M.js +1 -0
  123. package/dist/client/assets/index-CSNIMyOP.css +1 -0
  124. package/dist/client/assets/index-DG3N2Ps-.js +2 -0
  125. package/dist/client/assets/info-A6RAGUB7-BlU-8_xu.js +1 -0
  126. package/dist/client/assets/{infoDiagram-6WML65LV-DYB8HCDQ.js → infoDiagram-RXCK75RN-BMzo6KIn.js} +1 -1
  127. package/dist/client/assets/{ishikawaDiagram-WSZJBQD7-Coz_P3t6.js → ishikawaDiagram-5VMMS53U-BIM3h287.js} +1 -1
  128. package/dist/client/assets/{journeyDiagram-NVQOT4AX-B6edChce.js → journeyDiagram-EYS64GPL-mF6Lh8O-.js} +1 -1
  129. package/dist/client/assets/{kanban-definition-27J2QSJJ-BFd9-cLc.js → kanban-definition-3QL26DDD-DLN2NyoR.js} +2 -2
  130. package/dist/client/assets/{line-B_S_S8kV.js → line-BfTWJmgf.js} +1 -1
  131. package/dist/client/assets/main-D0wCxpVn.js +903 -0
  132. package/dist/client/assets/markdown-CByV-4CU.js +70 -0
  133. package/dist/client/assets/{mermaid-parser.core-CUVdebAV.js → mermaid-parser.core-Bl0efOMt.js} +2 -2
  134. package/dist/client/assets/mermaid.core-BJRLUQZE.js +11 -0
  135. package/dist/client/assets/{mindmap-definition-FAOFIHXS-C9PQ38Al.js → mindmap-definition-FBJOCRG2-CRyHaHTk.js} +1 -1
  136. package/dist/client/assets/packet-AYTQ26CC-BSJEH9Lb.js +1 -0
  137. package/dist/client/assets/pdfium-RAgkpwfK.wasm +0 -0
  138. package/dist/client/assets/{pegDiagram-VL7TDLO6-BMZUrSaU.js → pegDiagram-XKGWAZYB-B31fKPR2.js} +1 -1
  139. package/dist/client/assets/pie-WAS4IAKB-qxv01Y8W.js +1 -0
  140. package/dist/client/assets/{pieDiagram-7S7Q4E2Y-h8kbCL9o.js → pieDiagram-E7YTZNPT-B5OZPb88.js} +1 -1
  141. package/dist/client/assets/preview-render-compiler-CrJIooVD.js +35 -0
  142. package/dist/client/assets/preview-render-compiler-O0JxBVNF.js +1 -0
  143. package/dist/client/assets/{preview-render-profile-CE-5rVTC.js → preview-render-profile-B4RWYWHt.js} +1 -1
  144. package/dist/client/assets/preview-render-worker-_QTxqKvP.js +60 -0
  145. package/dist/client/assets/prod-BiYPMR1i.js +177 -0
  146. package/dist/client/assets/prod-VxdGZ5Ly.js +1 -0
  147. package/dist/client/assets/{quadrantDiagram-CIZ2JOQS-CkElyfMi.js → quadrantDiagram-AXDQQJYC-Drrw14YH.js} +1 -1
  148. package/dist/client/assets/quick-switcher-controller-CaEjEtq_.js +1 -0
  149. package/dist/client/assets/radar-RG4KPBEZ-B6h6pWOs.js +1 -0
  150. package/dist/client/assets/railroad-74A4TZTK-CGtTWdGc.js +1 -0
  151. package/dist/client/assets/railroad-abnf-HS5TGJTU-Cq7y22IA.js +1 -0
  152. package/dist/client/assets/railroad-ebnf-LZEXJU2U-V0aQVv9m.js +1 -0
  153. package/dist/client/assets/railroad-peg-WCYAUIDC-BQiIsX_p.js +1 -0
  154. package/dist/client/assets/{railroadDiagram-AXF67PYL-c75gnikD.js → railroadDiagram-O6MQD6OU-BPifP0MB.js} +1 -1
  155. package/dist/client/assets/{requirementDiagram-LRYGKXZP-mNxKLuHS.js → requirementDiagram-EFPCY7ZU-CRZG6mRB.js} +2 -2
  156. package/dist/client/assets/{sankeyDiagram-W5VNT64P-0OhplksI.js → sankeyDiagram-P5KCCOFB-DvarEJpo.js} +1 -1
  157. package/dist/client/assets/{sequenceDiagram-SI44F4Z6-BJ_yAocC.js → sequenceDiagram-WJ2MYXX4-B4oWlb-w.js} +1 -1
  158. package/dist/client/assets/standalone-6z5x8CWe.js +29 -0
  159. package/dist/client/assets/{stateDiagram-OKZ733FA-Cc83O86s.js → stateDiagram-HBIQ2CUA-qbHIIqRZ.js} +1 -1
  160. package/dist/client/assets/stateDiagram-v2-4QOOHH4V-B--gjrit.js +1 -0
  161. package/dist/client/assets/swimlanes-XN3QIQJK-xB6CtUGj.js +1 -0
  162. package/dist/client/assets/swimlanesDiagram-VK2B7HYN-DO8XNXEg.js +8 -0
  163. package/dist/client/assets/{timeline-definition-Z64GVDOM-BWDAGTHz.js → timeline-definition-24CTP7MA-Lj_yTNlY.js} +1 -1
  164. package/dist/client/assets/treeView-Q6P3EWNA-BTTYcvrF.js +1 -0
  165. package/dist/client/assets/treemap-WGGIJYW6-Cg7tyfH8.js +1 -0
  166. package/dist/client/assets/{vault-api-client-_LpV1aIn.js → vault-api-client-BkwdFjx0.js} +2 -2
  167. package/dist/client/assets/vault-utils-DvoSftJT.js +22 -0
  168. package/dist/client/assets/{vennDiagram-T6HMQDX7-LOSsnlMB.js → vennDiagram-4TSXK5OY-BekRp5Y0.js} +1 -1
  169. package/dist/client/assets/wardley-WFR3VGLG-C6N1rULY.js +1 -0
  170. package/dist/client/assets/{wardleyDiagram-T6FBY63Y-BxII3foY.js → wardleyDiagram-VM6X3IG4-kdnV_Hdm.js} +1 -1
  171. package/dist/client/assets/worker-engine-m0rlHn8R-S8mpn_O0.js +17369 -0
  172. package/dist/client/assets/{xychartDiagram-ELKLHX3M-B-pTEjju.js → xychartDiagram-S5SC5T6Z-DufGwNSB.js} +3 -3
  173. package/dist/client/assets/yaml-9ltHPDNO.js +154 -0
  174. package/dist/client/drawio-editor.html +1 -1
  175. package/dist/client/excalidraw-editor.html +1 -1
  176. package/dist/client/export-document.html +3 -3
  177. package/dist/client/index.html +56 -24
  178. package/package.json +22 -18
  179. package/src/client/app/index.html +53 -21
  180. package/src/client/application/app-shell/comments-feature.js +2 -3
  181. package/src/client/application/app-shell/export-feature.js +17 -1
  182. package/src/client/application/app-shell/git-feature.js +30 -11
  183. package/src/client/application/app-shell/presence-feature.js +2 -2
  184. package/src/client/application/app-shell/ui-feature-identity.js +13 -0
  185. package/src/client/application/app-shell/ui-feature-shell.js +228 -9
  186. package/src/client/application/app-shell-elements.js +5 -0
  187. package/src/client/application/pdf-preview-controller.js +53 -970
  188. package/src/client/application/preview-render-compiler.js +3 -0
  189. package/src/client/application/quick-switcher-loader.js +1 -1
  190. package/src/client/application/workspace-coordinator.js +21 -4
  191. package/src/client/application/workspace-preview-controller.js +120 -5
  192. package/src/client/application/workspace-route-controller.js +4 -1
  193. package/src/client/assets/vendor/highlight/github-dark.min.css +2 -10
  194. package/src/client/assets/vendor/highlight/github.min.css +2 -10
  195. package/src/client/assets/vendor/jetbrains-mono/JetBrainsMono-Regular.woff2 +0 -0
  196. package/src/client/assets/vendor/jetbrains-mono/OFL.txt +93 -0
  197. package/src/client/bootstrap/collabmd-app-shell.js +31 -8
  198. package/src/client/domain/document-formatter.js +193 -0
  199. package/src/client/domain/file-search.js +73 -0
  200. package/src/client/domain/git-labels.js +5 -0
  201. package/src/client/domain/vault-paths.js +6 -4
  202. package/src/client/domain/wiki-link-completions.js +20 -20
  203. package/src/client/drawio-editor.js +8 -3
  204. package/src/client/excalidraw-editor.js +163 -6
  205. package/src/client/export/export-host.js +57 -36
  206. package/src/client/export/export-page.js +20 -6
  207. package/src/client/export/export-pipeline.js +322 -22
  208. package/src/client/infrastructure/editor-session.js +4 -0
  209. package/src/client/infrastructure/editor-view-adapter.js +60 -14
  210. package/src/client/presentation/bases-preview-controller.js +35 -11
  211. package/src/client/presentation/comment-ui/comment-ui-render.js +4 -0
  212. package/src/client/presentation/comment-ui-controller.js +2 -0
  213. package/src/client/presentation/excalidraw-embed-controller.js +7 -0
  214. package/src/client/presentation/file-action-controller.js +15 -2
  215. package/src/client/presentation/file-explorer-controller.js +3 -5
  216. package/src/client/presentation/file-explorer-view.js +43 -45
  217. package/src/client/presentation/file-history-view-controller.js +6 -1
  218. package/src/client/presentation/file-tree-state.js +5 -14
  219. package/src/client/presentation/git-diff-view-controller.js +36 -11
  220. package/src/client/presentation/git-panel-controller.js +12 -8
  221. package/src/client/presentation/quick-switcher-controller.js +92 -153
  222. package/src/client/styles/components/scrollbars.css +10 -0
  223. package/src/client/styles/export-document.css +44 -29
  224. package/src/client/styles/features/collaboration-presence.css +13 -1
  225. package/src/client/styles/features/preview-markdown.css +79 -0
  226. package/src/client/styles/features/quick-switcher.css +8 -0
  227. package/src/client/styles/foundation/themes.css +1 -0
  228. package/src/client/styles/foundation/tokens.css +8 -0
  229. package/src/client/styles/layout/shell.css +73 -339
  230. package/src/client/styles/layout/sidebar.css +42 -4
  231. package/src/client/styles/layout/view-modes.css +2 -0
  232. package/src/client/styles/overrides/codemirror.css +31 -19
  233. package/src/client/styles/overrides/highlightjs.css +20 -4
  234. package/src/client/styles/surfaces/excalidraw-editor.css +42 -0
  235. package/src/domain/file-kind.js +12 -1
  236. package/src/server/domain/ripgrep-search-service.js +110 -37
  237. package/src/server/infrastructure/git/git-service.js +23 -11
  238. package/src/server/infrastructure/http/create-git-api-command-handler.js +3 -1
  239. package/src/server/infrastructure/http/create-structurizr-api-handler.js +4 -2
  240. package/src/server/infrastructure/persistence/path-utils.js +10 -4
  241. package/src/server/infrastructure/persistence/vault-file-store.js +2 -0
  242. package/src/server/infrastructure/structurizr/structurizr-workspace-service.js +33 -7
  243. package/dist/client/assets/architecture-TIHT7OUA-CsHfPErM.js +0 -1
  244. package/dist/client/assets/base-CxPEiHuy.js +0 -1
  245. package/dist/client/assets/blockDiagram-VBNYF7ZC-CipJt9Jl.js +0 -132
  246. package/dist/client/assets/c4Diagram-5PPSVZJV-B5ktVx6g.js +0 -10
  247. package/dist/client/assets/channel-4Jkmq93I.js +0 -1
  248. package/dist/client/assets/chunk-7BUUIJ7U-Bb538aSH.js +0 -1
  249. package/dist/client/assets/chunk-7Z6QIM7H-BP9Pdsm9.js +0 -10
  250. package/dist/client/assets/chunk-ERSWUTIN-hHdvnhaY.js +0 -41
  251. package/dist/client/assets/chunk-I66GZJ75-CVFiiffQ.js +0 -127
  252. package/dist/client/assets/chunk-J7OUQ5F2-4CEb7pvH.js +0 -2
  253. package/dist/client/assets/chunk-JQJVKLGR-cx8X_24v.js +0 -156
  254. package/dist/client/assets/chunk-QR6OTTB3-CDAA_5Ib.js +0 -62
  255. package/dist/client/assets/chunk-RYQCIY6F-D-a0zH8K.js +0 -1
  256. package/dist/client/assets/chunk-UBXNYLIW-Bhk-PbFK.js +0 -1
  257. package/dist/client/assets/chunk-W5SLKNZC-BdNSCxZ9.js +0 -1
  258. package/dist/client/assets/chunk-WRU74C26-h6_XkD3_.js +0 -70
  259. package/dist/client/assets/chunk-ZIRB5QZD-O39ZBUk3.js +0 -32
  260. package/dist/client/assets/classDiagram-JCYQIIEL-L7lsyW_w.js +0 -1
  261. package/dist/client/assets/classDiagram-v2-OCEON4UE-L7lsyW_w.js +0 -1
  262. package/dist/client/assets/comment-ui-shared-BC4pt4w8.js +0 -7
  263. package/dist/client/assets/cynefin-VYW2F7L2-Ds2Fw2Y0.js +0 -1
  264. package/dist/client/assets/dagre-Buvkdvvj.js +0 -1
  265. package/dist/client/assets/dagre-VZM6K2ZE-L1xArOGs.js +0 -4
  266. package/dist/client/assets/dist-B5Jf1SLZ.js +0 -2
  267. package/dist/client/assets/dist-BKW4PALF.js +0 -1
  268. package/dist/client/assets/dist-BWcHHOx-.js +0 -1
  269. package/dist/client/assets/dist-DaYdhcVs.js +0 -1
  270. package/dist/client/assets/dist-Kh2COra_.js +0 -1
  271. package/dist/client/assets/dist-tOaegDYS2.js +0 -1
  272. package/dist/client/assets/editor-session-Cm9ekeNo.js +0 -54
  273. package/dist/client/assets/embedded-editor-base-CwTkk911.css +0 -1
  274. package/dist/client/assets/erDiagram-JOGREHBK-cYUpEKpf.js +0 -85
  275. package/dist/client/assets/es-DXGV3RHd.js +0 -22
  276. package/dist/client/assets/eventmodeling-45OFAUF4-CLEiVx5s.js +0 -1
  277. package/dist/client/assets/excalidraw-editor-B46zsTFI.js +0 -9
  278. package/dist/client/assets/excalidraw-editor-Bt7gMSoh.css +0 -1
  279. package/dist/client/assets/excalidrawEditor-CT2pHq7e.js +0 -2
  280. package/dist/client/assets/export-page-A7NHawJY.js +0 -39
  281. package/dist/client/assets/exportDocument-B2L8fe34.css +0 -1
  282. package/dist/client/assets/exportDocument-BaqcOAAW.js +0 -2
  283. package/dist/client/assets/file-kind-BbqgGzpc.js +0 -1
  284. package/dist/client/assets/flowDiagram-UKHOOZJN-D0ypP0Ez.js +0 -1
  285. package/dist/client/assets/gitGraph-TEB2WS4Q-CZFBqwW-.js +0 -1
  286. package/dist/client/assets/github-dark.min-Z5exjX_n.css +0 -1
  287. package/dist/client/assets/github.min-D2BCvnWf.css +0 -1
  288. package/dist/client/assets/image-QXRYHUNP-SWEV8H0J.js +0 -1
  289. package/dist/client/assets/index-ClbjMBVt.js +0 -2
  290. package/dist/client/assets/index-Pum8ET-5.css +0 -1
  291. package/dist/client/assets/info-DKCQHKI2--1InqQeT.js +0 -1
  292. package/dist/client/assets/main-B3uPyqic.js +0 -893
  293. package/dist/client/assets/map-BaFkSB1l.js +0 -1
  294. package/dist/client/assets/mermaid.core-DN-lF51U.js +0 -11
  295. package/dist/client/assets/packet-7NZHBO7P-BGMXB0XL.js +0 -1
  296. package/dist/client/assets/pdf-BL9Pr2D5.js +0 -54
  297. package/dist/client/assets/pdf.worker-CLesOks4.mjs +0 -64857
  298. package/dist/client/assets/pdf_viewer-FVkkThnz.js +0 -551
  299. package/dist/client/assets/pie-RZYD4A2V-DgYg3tCt.js +0 -1
  300. package/dist/client/assets/preview-render-compiler-BD-XhkS2.js +0 -35
  301. package/dist/client/assets/preview-render-compiler-BKedaMxx.js +0 -1
  302. package/dist/client/assets/preview-render-worker-CiPqc9n6.js +0 -60
  303. package/dist/client/assets/prod-Dy20X7eT.js +0 -1
  304. package/dist/client/assets/prod-hnwh7wRM.js +0 -177
  305. package/dist/client/assets/quick-switcher-controller-fqOYR7qR.js +0 -12
  306. package/dist/client/assets/radar-I7S5WNFK-Ag-zp_Rq.js +0 -1
  307. package/dist/client/assets/railroad-3IZDKUUU-aibJDIDV.js +0 -1
  308. package/dist/client/assets/railroad-abnf-AHOZXSZD-BBMEuvIl.js +0 -1
  309. package/dist/client/assets/railroad-ebnf-EBAXGLYW-Be1nseej.js +0 -1
  310. package/dist/client/assets/railroad-peg-LSFZ7HO6-DIvD-Eyb.js +0 -1
  311. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-B1-BufUk.js +0 -1
  312. package/dist/client/assets/swimlanes-SLNWSIFB-oVTWEJIj.js +0 -2
  313. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-C5OTVwEu.js +0 -8
  314. package/dist/client/assets/treeView-QDETBFTQ-uHZ-3Fz8.js +0 -1
  315. package/dist/client/assets/treemap-6X3UGDF4-BnUKyy3l.js +0 -1
  316. package/dist/client/assets/vault-utils-wdQ0RNR9.js +0 -1
  317. package/dist/client/assets/wardley-OPB4EBWU-Da7TLC2F.js +0 -1
@@ -0,0 +1,2363 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./worker-engine-m0rlHn8R-S8mpn_O0.js","./browser-BKLM0ThC-IxjwuOIz-BBqQnUEb.js","./direct-engine-DdrQKpgq-CtKfQzCt.js"])))=>i.map(i=>d[i]);
2
+ import{r as e,t}from"./rolldown-runtime-Dd_uD5pT.js";import{t as n}from"./preload-helper-HclGiUj8.js";var r=t(((e,t)=>{t.exports={}}));function i(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){a(o,r,i,s,c,`next`,e)}function c(e){a(o,r,i,s,c,`throw`,e)}s(void 0)})}}function s(e,t,n){return t=f(t),function(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return function(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}(e)}(e,m()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function l(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,C(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=T(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function d(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(m=function(){return!!e})()}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?h(Object(n),!0).forEach(function(t){d(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function v(){var e,t,n=typeof Symbol==`function`?Symbol:{},r=n.iterator||`@@iterator`,i=n.toStringTag||`@@toStringTag`;function a(n,r,i,a){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return y(l,`_invoke`,function(n,r,i){var a,s,c,l=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,c=e,f.n=n,o}};function p(n,r){for(s=n,c=r,t=0;!d&&l&&!i&&t<u.length;t++){var i,a=u[t],p=f.p,m=a[2];n>3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&p<a[1])?(s=0,f.v=r,f.n=a[1]):p<m&&(i=n<3||a[0]>r||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,c)):f.n=c:f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,i,a),!0),l}var o={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(y(t={},r,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,y(e,i,`GeneratorFunction`)),e.prototype=Object.create(d),e}return c.prototype=l,y(d,`constructor`,l),y(l,`constructor`,c),c.displayName=`GeneratorFunction`,y(l,i,`GeneratorFunction`),y(d),y(d,i,`Generator`),y(d,r,function(){return this}),y(d,`toString`,function(){return`[object Generator]`}),(v=function(){return{w:a,m:f}})()}function y(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}y=function(e,t,n,r){function a(t,n){y(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a(`next`,0),a(`throw`,1),a(`return`,2))},y(e,t,n,r)}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||T(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function S(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(e)||T(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
5
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function C(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:t+``}function w(e){return w=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},w(e)}function T(e,t){if(e){if(typeof e==`string`)return i(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}var E,D,O,ee,te,ne,re,ie,ae,oe,se,ce,le={},ue=[],de=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fe=Array.isArray;function pe(e,t){for(var n in t)e[n]=t[n];return e}function me(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function k(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?E.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return he(e,o,r,i,null)}function he(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++O,__i:-1,__u:0};return i==null&&D.vnode!=null&&D.vnode(a),a}function A(e){return e.children}function ge(e,t){this.props=e,this.context=t}function _e(e,t){if(t==null)return e.__?_e(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?_e(e):null}function ve(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return ve(e)}}function ye(e){(!e.__d&&(e.__d=!0)&&ee.push(e)&&!be.__r++||te!=D.debounceRendering)&&((te=D.debounceRendering)||ne)(be)}function be(){for(var e,t,n,r,i,a,o,s=1;ee.length;)ee.length>s&&ee.sort(re),e=ee.shift(),s=ee.length,e.__d&&(n=void 0,r=void 0,i=(r=(t=e).__v).__e,a=[],o=[],t.__P&&((n=pe({},r)).__v=r.__v+1,D.vnode&&D.vnode(n),Oe(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[i]:null,a,i??_e(r),!!(32&r.__u),o),n.__v=r.__v,n.__.__k[n.__i]=n,Ae(a,n,o),r.__e=r.__=null,n.__e!=i&&ve(n)));be.__r=0}function xe(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v=r&&r.__k||ue,y=t.length;for(c=function(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=he(null,o,null,null,null):fe(o)?o=e.__k[a]=he(A,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=he(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=we(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=_e(s)),Pe(s,s));return r}(n,t,v,c,y),d=0;d<y;d++)(p=n.__k[d])!=null&&(f=p.__i==-1?le:v[p.__i]||le,p.__i=d,g=Oe(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&Ne(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),(_=!!(4&p.__u))||f.__k===p.__k?c=Se(p,c,e,_):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function Se(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Se(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=_e(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Ce(e,t){return t||=[],e==null||typeof e==`boolean`||(fe(e)?e.some(function(e){Ce(e,t)}):t.push(e)),t}function we(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function Te(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||de.test(t)?n:n+`px`}function Ee(e,t,n,r,i){var a,o;e:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||Te(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||Te(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(ie,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n.u=r.u:(n.u=ae,e.addEventListener(t,a?se:oe,a)):e.removeEventListener(t,a?se:oe,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break e}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function De(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=ae++;else if(t.t<n.u)return;return n(D.event?D.event(t):t)}}}function Oe(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,O=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=D.__b)&&u(t);e:if(typeof O==`function`)try{if(_=t.props,v=`prototype`in O&&O.prototype.render,y=(u=O.contextType)&&r[u.__c],b=u?y?y.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:(v?t.__c=d=new O(_,b):(t.__c=d=new ge(_,b),d.constructor=O,d.render=Fe),y&&y.sub(d),d.state||(d.state={}),d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),v&&d.__s==null&&(d.__s=d.state),v&&O.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=pe({},d.__s)),pe(d.__s,O.getDerivedStateFromProps(_,d.__s))),p=d.props,m=d.state,d.__v=t,f)v&&O.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),v&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(v&&O.getDerivedStateFromProps==null&&_!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(_,b),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&!1===d.shouldComponentUpdate(_,d.__s,b)){for(t.__v!=n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),x=0;x<d._sb.length;x++)d.__h.push(d._sb[x]);d._sb=[],d.__h.length&&o.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(_,d.__s,b),v&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,m,h)})}if(d.context=b,d.props=_,d.__P=e,d.__e=!1,S=D.__r,C=0,v){for(d.state=d.__s,d.__d=!1,S&&S(t),u=d.render(d.props,d.state,d.context),w=0;w<d._sb.length;w++)d.__h.push(d._sb[w]);d._sb=[]}else do d.__d=!1,S&&S(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++C<25);d.state=d.__s,d.getChildContext!=null&&(r=pe(pe({},r),d.getChildContext())),v&&!f&&d.getSnapshotBeforeUpdate!=null&&(h=d.getSnapshotBeforeUpdate(p,m)),T=u,u!=null&&u.type===A&&u.key==null&&(T=je(u.props.children)),s=xe(e,fe(T)?T:[T],t,n,r,i,a,o,s,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){if(t.__v=null,c||a!=null){if(e.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else{for(E=a.length;E--;)me(a[E]);ke(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||ke(t);D.__e(e,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Me(n.__e,t,n,r,i,a,o,c,l);return(u=D.diffed)&&u(t),128&t.__u?void 0:s}function ke(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(ke)}function Ae(e,t,n){for(var r=0;r<n.length;r++)Ne(n[r],n[++r],n[++r]);D.__c&&D.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){D.__e(e,t.__v)}})}function je(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:fe(e)?e.map(je):pe({},e)}function Me(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props||le,_=t.props,v=t.type;if(v==`svg`?i=`http://www.w3.org/2000/svg`:v==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName==v:p.nodeType==3)){e=p,a[l]=null;break}}if(e==null){if(v==null)return document.createTextNode(_);e=document.createElementNS(i,v,_.is&&_),s&&=(D.__m&&D.__m(t,a),!1),a=null}if(v==null)g===_||s&&e.data==_||(e.data=_);else{if(a&&=E.call(e.childNodes),!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)if(p=g[l],l!=`children`){if(l==`dangerouslySetInnerHTML`)d=p;else if(!(l in _)){if(l==`value`&&`defaultValue`in _||l==`checked`&&`defaultChecked`in _)continue;Ee(e,l,null,p,i)}}for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:s&&typeof p!=`function`||g[l]===p||Ee(e,l,p,g[l],i);if(u)s||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),xe(t.type==`template`?e.content:e,fe(f)?f:[f],t,n,r,v==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&_e(n,0),s,c),a!=null)for(l=a.length;l--;)me(a[l]);s||(l=`value`,v==`progress`&&m==null?e.removeAttribute(`value`):m!=null&&(m!==e[l]||v==`progress`&&!m||v==`option`&&m!=g[l])&&Ee(e,l,m,g[l],i),l=`checked`,h!=null&&h!=e[l]&&Ee(e,l,h,g[l],i))}return e}function Ne(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){D.__e(e,n)}}function Pe(e,t,n){var r,i;if(D.unmount&&D.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Ne(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){D.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Pe(r[i],t,n||typeof e.type!=`function`);n||me(e.__e),e.__c=e.__=e.__e=void 0}function Fe(e,t,n){return this.constructor(e,n)}function Ie(e,t,n){var r,i,a;t==document&&(t=document.documentElement),D.__&&D.__(e,t),r=t.__k,i=[],a=[],Oe(t,e=t.__k=k(A,null,[e]),r||le,le,t.namespaceURI,r?null:t.firstChild?E.call(t.childNodes):null,i,r?r.__e:t.firstChild,!1,a),Ae(i,e,a)}function Le(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,ye(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+ce++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}E=ue.slice,D={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},O=0,ge.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=pe({},this.state);typeof e==`function`&&(e=e(pe({},n),this.props)),e&&pe(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ye(this))},ge.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ye(this))},ge.prototype.render=A,ee=[],ne=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,re=function(e,t){return e.__v.__b-t.__v.__b},be.__r=0,ie=/(PointerCapture)$|Capture$/i,ae=0,oe=De(!1),se=De(!0),ce=0;var Re,ze,Be,Ve,He=0,Ue=[],We=D,Ge=We.__b,Ke=We.__r,qe=We.diffed,Je=We.__c,Ye=We.unmount,Xe=We.__;function Ze(e,t){We.__h&&We.__h(ze,e,He||t),He=0;var n=ze.__H||(ze.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function j(e){return He=1,Qe(st,e)}function Qe(e,t,n){var r=Ze(Re++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):st(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=ze,!ze.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a&&a.call(this,e,t,n)||o};ze.__f=!0;var a=ze.shouldComponentUpdate,o=ze.componentWillUpdate;ze.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},ze.shouldComponentUpdate=i}return r.__N||r.__}function M(e,t){var n=Ze(Re++,3);!We.__s&&ot(n.__H,t)&&(n.__=e,n.u=t,ze.__H.__h.push(n))}function $e(e,t){var n=Ze(Re++,4);!We.__s&&ot(n.__H,t)&&(n.__=e,n.u=t,ze.__h.push(n))}function N(e){return He=5,P(function(){return{current:e}},[])}function P(e,t){var n=Ze(Re++,7);return ot(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function F(e,t){return He=8,P(function(){return e},t)}function et(e){var t=ze.context[e.__c],n=Ze(Re++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(ze)),t.props.value):e.__}function tt(){for(var e;e=Ue.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(it),e.__H.__h.forEach(at),e.__H.__h=[]}catch(t){e.__H.__h=[],We.__e(t,e.__v)}}We.__b=function(e){ze=null,Ge&&Ge(e)},We.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Xe&&Xe(e,t)},We.__r=function(e){Ke&&Ke(e),Re=0;var t=(ze=e.__c).__H;t&&(Be===ze?(t.__h=[],ze.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(it),t.__h.forEach(at),t.__h=[],Re=0)),Be=ze},We.diffed=function(e){qe&&qe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ue.push(t)!==1&&Ve===We.requestAnimationFrame||((Ve=We.requestAnimationFrame)||rt)(tt)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Be=ze=null},We.__c=function(e,t){t.some(function(e){try{e.__h.forEach(it),e.__h=e.__h.filter(function(e){return!e.__||at(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],We.__e(n,e.__v)}}),Je&&Je(e,t)},We.unmount=function(e){Ye&&Ye(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{it(e)}catch(e){t=e}}),n.__H=void 0,t&&We.__e(t,n.__v))};var nt=typeof requestAnimationFrame==`function`;function rt(e){var t,n=function(){clearTimeout(r),nt&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);nt&&(t=requestAnimationFrame(n))}function it(e){var t=ze,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),ze=t}function at(e){var t=ze;e.__c=e.__(),ze=t}function ot(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function st(e,t){return typeof t==`function`?t(e):t}var ct=`/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
6
+ @layer properties;
7
+ @layer theme, base, components, utilities;
8
+ @layer theme {
9
+ :root, :host {
10
+ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
11
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
12
+ --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
13
+ "Courier New", monospace;
14
+ --color-red-500: oklch(63.7% 0.237 25.331);
15
+ --color-red-600: oklch(57.7% 0.245 27.325);
16
+ --color-yellow-500: oklch(79.5% 0.184 86.047);
17
+ --color-green-500: oklch(72.3% 0.219 149.579);
18
+ --color-teal-500: oklch(70.4% 0.14 182.503);
19
+ --color-blue-500: oklch(62.3% 0.214 259.815);
20
+ --color-indigo-500: oklch(58.5% 0.233 277.117);
21
+ --color-purple-500: oklch(62.7% 0.265 303.9);
22
+ --color-pink-500: oklch(65.6% 0.241 354.308);
23
+ --color-gray-300: oklch(87.2% 0.01 258.338);
24
+ --color-white: #fff;
25
+ --spacing: 0.25rem;
26
+ --container-sm: 24rem;
27
+ --text-xs: 0.75rem;
28
+ --text-xs--line-height: calc(1 / 0.75);
29
+ --text-sm: 0.875rem;
30
+ --text-sm--line-height: calc(1.25 / 0.875);
31
+ --text-base: 1rem;
32
+ --text-base--line-height: calc(1.5 / 1);
33
+ --text-lg: 1.125rem;
34
+ --text-lg--line-height: calc(1.75 / 1.125);
35
+ --text-xl: 1.25rem;
36
+ --text-xl--line-height: calc(1.75 / 1.25);
37
+ --font-weight-medium: 500;
38
+ --font-weight-semibold: 600;
39
+ --font-weight-bold: 700;
40
+ --tracking-widest: 0.1em;
41
+ --leading-relaxed: 1.625;
42
+ --radius-md: 0.375rem;
43
+ --radius-lg: 0.5rem;
44
+ --radius-xl: 0.75rem;
45
+ --radius-2xl: 1rem;
46
+ --ease-out: cubic-bezier(0, 0, 0.2, 1);
47
+ --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
48
+ --animate-spin: spin 1s linear infinite;
49
+ --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
50
+ --default-transition-duration: 150ms;
51
+ --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
52
+ --default-font-family: var(--font-sans);
53
+ --default-mono-font-family: var(--font-mono);
54
+ --color-bg-app: var(--ep-background-app);
55
+ --color-bg-surface: var(--ep-background-surface);
56
+ --color-bg-surface-alt: var(--ep-background-surface-alt);
57
+ --color-bg-elevated: var(--ep-background-elevated);
58
+ --color-bg-overlay: var(--ep-background-overlay);
59
+ --color-bg-input: var(--ep-background-input);
60
+ --color-fg-primary: var(--ep-foreground-primary);
61
+ --color-fg-secondary: var(--ep-foreground-secondary);
62
+ --color-fg-muted: var(--ep-foreground-muted);
63
+ --color-fg-disabled: var(--ep-foreground-disabled);
64
+ --color-fg-on-accent: var(--ep-foreground-on-accent);
65
+ --color-border-default: var(--ep-border-default);
66
+ --color-border-subtle: var(--ep-border-subtle);
67
+ --color-border-strong: var(--ep-border-strong);
68
+ --color-accent: var(--ep-accent-primary);
69
+ --color-accent-hover: var(--ep-accent-primary-hover);
70
+ --color-accent-light: var(--ep-accent-primary-light);
71
+ --color-accent-fg: var(--ep-accent-primary-foreground);
72
+ --color-interactive-hover: var(--ep-interactive-hover);
73
+ --color-interactive-active: var(--ep-interactive-active);
74
+ --color-interactive-selected: var(--ep-interactive-selected);
75
+ --color-interactive-focus-ring: var(--ep-interactive-focus-ring);
76
+ --color-state-error: var(--ep-state-error);
77
+ --color-state-error-light: var(--ep-state-error-light);
78
+ --color-state-warning: var(--ep-state-warning);
79
+ --color-state-warning-light: var(--ep-state-warning-light);
80
+ --color-state-success: var(--ep-state-success);
81
+ --color-state-success-light: var(--ep-state-success-light);
82
+ --color-state-info-light: var(--ep-state-info-light);
83
+ --color-tooltip-bg: var(--ep-tooltip-background);
84
+ --color-tooltip-fg: var(--ep-tooltip-foreground);
85
+ }
86
+ }
87
+ @layer base {
88
+ *, ::after, ::before, ::backdrop, ::file-selector-button {
89
+ box-sizing: border-box;
90
+ margin: 0;
91
+ padding: 0;
92
+ border: 0 solid;
93
+ }
94
+ html, :host {
95
+ line-height: 1.5;
96
+ -webkit-text-size-adjust: 100%;
97
+ -moz-tab-size: 4;
98
+ -o-tab-size: 4;
99
+ tab-size: 4;
100
+ font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
101
+ font-feature-settings: var(--default-font-feature-settings, normal);
102
+ font-variation-settings: var(--default-font-variation-settings, normal);
103
+ -webkit-tap-highlight-color: transparent;
104
+ }
105
+ hr {
106
+ height: 0;
107
+ color: inherit;
108
+ border-top-width: 1px;
109
+ }
110
+ abbr:where([title]) {
111
+ -webkit-text-decoration: underline dotted;
112
+ text-decoration: underline dotted;
113
+ }
114
+ h1, h2, h3, h4, h5, h6 {
115
+ font-size: inherit;
116
+ font-weight: inherit;
117
+ }
118
+ a {
119
+ color: inherit;
120
+ -webkit-text-decoration: inherit;
121
+ text-decoration: inherit;
122
+ }
123
+ b, strong {
124
+ font-weight: bolder;
125
+ }
126
+ code, kbd, samp, pre {
127
+ font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
128
+ font-feature-settings: var(--default-mono-font-feature-settings, normal);
129
+ font-variation-settings: var(--default-mono-font-variation-settings, normal);
130
+ font-size: 1em;
131
+ }
132
+ small {
133
+ font-size: 80%;
134
+ }
135
+ sub, sup {
136
+ font-size: 75%;
137
+ line-height: 0;
138
+ position: relative;
139
+ vertical-align: baseline;
140
+ }
141
+ sub {
142
+ bottom: -0.25em;
143
+ }
144
+ sup {
145
+ top: -0.5em;
146
+ }
147
+ table {
148
+ text-indent: 0;
149
+ border-color: inherit;
150
+ border-collapse: collapse;
151
+ }
152
+ :-moz-focusring {
153
+ outline: auto;
154
+ }
155
+ progress {
156
+ vertical-align: baseline;
157
+ }
158
+ summary {
159
+ display: list-item;
160
+ }
161
+ ol, ul, menu {
162
+ list-style: none;
163
+ }
164
+ img, svg, video, canvas, audio, iframe, embed, object {
165
+ display: block;
166
+ vertical-align: middle;
167
+ }
168
+ img, video {
169
+ max-width: 100%;
170
+ height: auto;
171
+ }
172
+ button, input, select, optgroup, textarea, ::file-selector-button {
173
+ font: inherit;
174
+ font-feature-settings: inherit;
175
+ font-variation-settings: inherit;
176
+ letter-spacing: inherit;
177
+ color: inherit;
178
+ border-radius: 0;
179
+ background-color: transparent;
180
+ opacity: 1;
181
+ }
182
+ :where(select:is([multiple], [size])) optgroup {
183
+ font-weight: bolder;
184
+ }
185
+ :where(select:is([multiple], [size])) optgroup option {
186
+ padding-inline-start: 20px;
187
+ }
188
+ ::file-selector-button {
189
+ margin-inline-end: 4px;
190
+ }
191
+ ::-moz-placeholder {
192
+ opacity: 1;
193
+ }
194
+ ::placeholder {
195
+ opacity: 1;
196
+ }
197
+ @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
198
+ ::-moz-placeholder {
199
+ color: currentcolor;
200
+ @supports (color: color-mix(in lab, red, red)) {
201
+ color: color-mix(in oklab, currentcolor 50%, transparent);
202
+ }
203
+ }
204
+ ::placeholder {
205
+ color: currentcolor;
206
+ @supports (color: color-mix(in lab, red, red)) {
207
+ color: color-mix(in oklab, currentcolor 50%, transparent);
208
+ }
209
+ }
210
+ }
211
+ textarea {
212
+ resize: vertical;
213
+ }
214
+ ::-webkit-search-decoration {
215
+ -webkit-appearance: none;
216
+ }
217
+ ::-webkit-date-and-time-value {
218
+ min-height: 1lh;
219
+ text-align: inherit;
220
+ }
221
+ ::-webkit-datetime-edit {
222
+ display: inline-flex;
223
+ }
224
+ ::-webkit-datetime-edit-fields-wrapper {
225
+ padding: 0;
226
+ }
227
+ ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
228
+ padding-block: 0;
229
+ }
230
+ ::-webkit-calendar-picker-indicator {
231
+ line-height: 1;
232
+ }
233
+ :-moz-ui-invalid {
234
+ box-shadow: none;
235
+ }
236
+ button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
237
+ -webkit-appearance: button;
238
+ -moz-appearance: button;
239
+ appearance: button;
240
+ }
241
+ ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
242
+ height: auto;
243
+ }
244
+ [hidden]:where(:not([hidden="until-found"])) {
245
+ display: none !important;
246
+ }
247
+ }
248
+ @layer utilities {
249
+ .pointer-events-auto {
250
+ pointer-events: auto;
251
+ }
252
+ .pointer-events-none {
253
+ pointer-events: none;
254
+ }
255
+ .invisible {
256
+ visibility: hidden;
257
+ }
258
+ .visible {
259
+ visibility: visible;
260
+ }
261
+ .absolute {
262
+ position: absolute;
263
+ }
264
+ .fixed {
265
+ position: fixed;
266
+ }
267
+ .relative {
268
+ position: relative;
269
+ }
270
+ .static {
271
+ position: static;
272
+ }
273
+ .sticky {
274
+ position: sticky;
275
+ }
276
+ .inset-0 {
277
+ inset: calc(var(--spacing) * 0);
278
+ }
279
+ .inset-x-0 {
280
+ inset-inline: calc(var(--spacing) * 0);
281
+ }
282
+ .inset-y-0 {
283
+ inset-block: calc(var(--spacing) * 0);
284
+ }
285
+ .top-0 {
286
+ top: calc(var(--spacing) * 0);
287
+ }
288
+ .top-1 {
289
+ top: calc(var(--spacing) * 1);
290
+ }
291
+ .top-1\\/2 {
292
+ top: calc(1/2 * 100%);
293
+ }
294
+ .top-4 {
295
+ top: calc(var(--spacing) * 4);
296
+ }
297
+ .top-6 {
298
+ top: calc(var(--spacing) * 6);
299
+ }
300
+ .right-0 {
301
+ right: calc(var(--spacing) * 0);
302
+ }
303
+ .right-1 {
304
+ right: calc(var(--spacing) * 1);
305
+ }
306
+ .right-2 {
307
+ right: calc(var(--spacing) * 2);
308
+ }
309
+ .right-4 {
310
+ right: calc(var(--spacing) * 4);
311
+ }
312
+ .bottom-0 {
313
+ bottom: calc(var(--spacing) * 0);
314
+ }
315
+ .left-0 {
316
+ left: calc(var(--spacing) * 0);
317
+ }
318
+ .left-1\\/2 {
319
+ left: calc(1/2 * 100%);
320
+ }
321
+ .z-3 {
322
+ z-index: 3;
323
+ }
324
+ .z-10 {
325
+ z-index: 10;
326
+ }
327
+ .z-40 {
328
+ z-index: 40;
329
+ }
330
+ .z-50 {
331
+ z-index: 50;
332
+ }
333
+ .z-100 {
334
+ z-index: 100;
335
+ }
336
+ .col-start-1 {
337
+ grid-column-start: 1;
338
+ }
339
+ .row-start-1 {
340
+ grid-row-start: 1;
341
+ }
342
+ .container {
343
+ width: 100%;
344
+ @media (width >= 40rem) {
345
+ max-width: 40rem;
346
+ }
347
+ @media (width >= 48rem) {
348
+ max-width: 48rem;
349
+ }
350
+ @media (width >= 64rem) {
351
+ max-width: 64rem;
352
+ }
353
+ @media (width >= 80rem) {
354
+ max-width: 80rem;
355
+ }
356
+ @media (width >= 96rem) {
357
+ max-width: 96rem;
358
+ }
359
+ }
360
+ .mx-4 {
361
+ margin-inline: calc(var(--spacing) * 4);
362
+ }
363
+ .my-2 {
364
+ margin-block: calc(var(--spacing) * 2);
365
+ }
366
+ .my-4 {
367
+ margin-block: calc(var(--spacing) * 4);
368
+ }
369
+ .-mt-1 {
370
+ margin-top: calc(var(--spacing) * -1);
371
+ }
372
+ .mt-0\\.5 {
373
+ margin-top: calc(var(--spacing) * 0.5);
374
+ }
375
+ .mt-1 {
376
+ margin-top: calc(var(--spacing) * 1);
377
+ }
378
+ .mt-2 {
379
+ margin-top: calc(var(--spacing) * 2);
380
+ }
381
+ .mt-3 {
382
+ margin-top: calc(var(--spacing) * 3);
383
+ }
384
+ .mt-4 {
385
+ margin-top: calc(var(--spacing) * 4);
386
+ }
387
+ .mt-5 {
388
+ margin-top: calc(var(--spacing) * 5);
389
+ }
390
+ .mt-6 {
391
+ margin-top: calc(var(--spacing) * 6);
392
+ }
393
+ .mt-8 {
394
+ margin-top: calc(var(--spacing) * 8);
395
+ }
396
+ .-mr-1 {
397
+ margin-right: calc(var(--spacing) * -1);
398
+ }
399
+ .mr-1\\.5 {
400
+ margin-right: calc(var(--spacing) * 1.5);
401
+ }
402
+ .mr-2 {
403
+ margin-right: calc(var(--spacing) * 2);
404
+ }
405
+ .mr-3 {
406
+ margin-right: calc(var(--spacing) * 3);
407
+ }
408
+ .mr-4 {
409
+ margin-right: calc(var(--spacing) * 4);
410
+ }
411
+ .mb-1 {
412
+ margin-bottom: calc(var(--spacing) * 1);
413
+ }
414
+ .mb-1\\.5 {
415
+ margin-bottom: calc(var(--spacing) * 1.5);
416
+ }
417
+ .mb-2 {
418
+ margin-bottom: calc(var(--spacing) * 2);
419
+ }
420
+ .mb-3 {
421
+ margin-bottom: calc(var(--spacing) * 3);
422
+ }
423
+ .mb-4 {
424
+ margin-bottom: calc(var(--spacing) * 4);
425
+ }
426
+ .mb-6 {
427
+ margin-bottom: calc(var(--spacing) * 6);
428
+ }
429
+ .ml-1 {
430
+ margin-left: calc(var(--spacing) * 1);
431
+ }
432
+ .ml-2 {
433
+ margin-left: calc(var(--spacing) * 2);
434
+ }
435
+ .block {
436
+ display: block;
437
+ }
438
+ .contents {
439
+ display: contents;
440
+ }
441
+ .flex {
442
+ display: flex;
443
+ }
444
+ .grid {
445
+ display: grid;
446
+ }
447
+ .hidden {
448
+ display: none;
449
+ }
450
+ .inline {
451
+ display: inline;
452
+ }
453
+ .inline-block {
454
+ display: inline-block;
455
+ }
456
+ .inline-flex {
457
+ display: inline-flex;
458
+ }
459
+ .h-1 {
460
+ height: calc(var(--spacing) * 1);
461
+ }
462
+ .h-1\\.5 {
463
+ height: calc(var(--spacing) * 1.5);
464
+ }
465
+ .h-2 {
466
+ height: calc(var(--spacing) * 2);
467
+ }
468
+ .h-3 {
469
+ height: calc(var(--spacing) * 3);
470
+ }
471
+ .h-3\\.5 {
472
+ height: calc(var(--spacing) * 3.5);
473
+ }
474
+ .h-4 {
475
+ height: calc(var(--spacing) * 4);
476
+ }
477
+ .h-5 {
478
+ height: calc(var(--spacing) * 5);
479
+ }
480
+ .h-6 {
481
+ height: calc(var(--spacing) * 6);
482
+ }
483
+ .h-7 {
484
+ height: calc(var(--spacing) * 7);
485
+ }
486
+ .h-8 {
487
+ height: calc(var(--spacing) * 8);
488
+ }
489
+ .h-9 {
490
+ height: calc(var(--spacing) * 9);
491
+ }
492
+ .h-10 {
493
+ height: calc(var(--spacing) * 10);
494
+ }
495
+ .h-12 {
496
+ height: calc(var(--spacing) * 12);
497
+ }
498
+ .h-16 {
499
+ height: calc(var(--spacing) * 16);
500
+ }
501
+ .h-18 {
502
+ height: calc(var(--spacing) * 18);
503
+ }
504
+ .h-\\[32px\\] {
505
+ height: 32px;
506
+ }
507
+ .h-full {
508
+ height: 100%;
509
+ }
510
+ .h-px {
511
+ height: 1px;
512
+ }
513
+ .max-h-48 {
514
+ max-height: calc(var(--spacing) * 48);
515
+ }
516
+ .max-h-60 {
517
+ max-height: calc(var(--spacing) * 60);
518
+ }
519
+ .min-h-0 {
520
+ min-height: calc(var(--spacing) * 0);
521
+ }
522
+ .\\!w-full {
523
+ width: 100% !important;
524
+ }
525
+ .w-2 {
526
+ width: calc(var(--spacing) * 2);
527
+ }
528
+ .w-3 {
529
+ width: calc(var(--spacing) * 3);
530
+ }
531
+ .w-3\\.5 {
532
+ width: calc(var(--spacing) * 3.5);
533
+ }
534
+ .w-4 {
535
+ width: calc(var(--spacing) * 4);
536
+ }
537
+ .w-5 {
538
+ width: calc(var(--spacing) * 5);
539
+ }
540
+ .w-6 {
541
+ width: calc(var(--spacing) * 6);
542
+ }
543
+ .w-8 {
544
+ width: calc(var(--spacing) * 8);
545
+ }
546
+ .w-9 {
547
+ width: calc(var(--spacing) * 9);
548
+ }
549
+ .w-10 {
550
+ width: calc(var(--spacing) * 10);
551
+ }
552
+ .w-12 {
553
+ width: calc(var(--spacing) * 12);
554
+ }
555
+ .w-16 {
556
+ width: calc(var(--spacing) * 16);
557
+ }
558
+ .w-18 {
559
+ width: calc(var(--spacing) * 18);
560
+ }
561
+ .w-32 {
562
+ width: calc(var(--spacing) * 32);
563
+ }
564
+ .w-\\[32px\\] {
565
+ width: 32px;
566
+ }
567
+ .w-auto {
568
+ width: auto;
569
+ }
570
+ .w-full {
571
+ width: 100%;
572
+ }
573
+ .w-px {
574
+ width: 1px;
575
+ }
576
+ .max-w-\\[80\\%\\] {
577
+ max-width: 80%;
578
+ }
579
+ .max-w-\\[90\\%\\] {
580
+ max-width: 90%;
581
+ }
582
+ .max-w-\\[150px\\] {
583
+ max-width: 150px;
584
+ }
585
+ .max-w-\\[180px\\] {
586
+ max-width: 180px;
587
+ }
588
+ .max-w-\\[240px\\] {
589
+ max-width: 240px;
590
+ }
591
+ .max-w-sm {
592
+ max-width: var(--container-sm);
593
+ }
594
+ .min-w-0 {
595
+ min-width: calc(var(--spacing) * 0);
596
+ }
597
+ .min-w-\\[8rem\\] {
598
+ min-width: 8rem;
599
+ }
600
+ .min-w-\\[32px\\] {
601
+ min-width: 32px;
602
+ }
603
+ .min-w-\\[120px\\] {
604
+ min-width: 120px;
605
+ }
606
+ .min-w-\\[200px\\] {
607
+ min-width: 200px;
608
+ }
609
+ .flex-1 {
610
+ flex: 1;
611
+ }
612
+ .flex-\\[2\\] {
613
+ flex: 2;
614
+ }
615
+ .flex-shrink-0 {
616
+ flex-shrink: 0;
617
+ }
618
+ .shrink {
619
+ flex-shrink: 1;
620
+ }
621
+ .shrink-0 {
622
+ flex-shrink: 0;
623
+ }
624
+ .-translate-x-1\\/2 {
625
+ --tw-translate-x: calc(calc(1/2 * 100%) * -1);
626
+ translate: var(--tw-translate-x) var(--tw-translate-y);
627
+ }
628
+ .translate-x-\\[1px\\] {
629
+ --tw-translate-x: 1px;
630
+ translate: var(--tw-translate-x) var(--tw-translate-y);
631
+ }
632
+ .-translate-y-1\\/2 {
633
+ --tw-translate-y: calc(calc(1/2 * 100%) * -1);
634
+ translate: var(--tw-translate-x) var(--tw-translate-y);
635
+ }
636
+ .translate-y-\\[1px\\] {
637
+ --tw-translate-y: 1px;
638
+ translate: var(--tw-translate-x) var(--tw-translate-y);
639
+ }
640
+ .scale-95 {
641
+ --tw-scale-x: 95%;
642
+ --tw-scale-y: 95%;
643
+ --tw-scale-z: 95%;
644
+ scale: var(--tw-scale-x) var(--tw-scale-y);
645
+ }
646
+ .scale-100 {
647
+ --tw-scale-x: 100%;
648
+ --tw-scale-y: 100%;
649
+ --tw-scale-z: 100%;
650
+ scale: var(--tw-scale-x) var(--tw-scale-y);
651
+ }
652
+ .scale-110 {
653
+ --tw-scale-x: 110%;
654
+ --tw-scale-y: 110%;
655
+ --tw-scale-z: 110%;
656
+ scale: var(--tw-scale-x) var(--tw-scale-y);
657
+ }
658
+ .rotate-45 {
659
+ rotate: 45deg;
660
+ }
661
+ .rotate-180 {
662
+ rotate: 180deg;
663
+ }
664
+ .transform {
665
+ transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
666
+ }
667
+ .animate-pulse {
668
+ animation: var(--animate-pulse);
669
+ }
670
+ .animate-spin {
671
+ animation: var(--animate-spin);
672
+ }
673
+ .cursor-default {
674
+ cursor: default;
675
+ }
676
+ .cursor-grab {
677
+ cursor: grab;
678
+ }
679
+ .cursor-not-allowed {
680
+ cursor: not-allowed;
681
+ }
682
+ .cursor-pointer {
683
+ cursor: pointer;
684
+ }
685
+ .touch-none {
686
+ touch-action: none;
687
+ }
688
+ .resize {
689
+ resize: both;
690
+ }
691
+ .appearance-none {
692
+ -webkit-appearance: none;
693
+ -moz-appearance: none;
694
+ appearance: none;
695
+ }
696
+ .grid-cols-1 {
697
+ grid-template-columns: repeat(1, minmax(0, 1fr));
698
+ }
699
+ .grid-cols-2 {
700
+ grid-template-columns: repeat(2, minmax(0, 1fr));
701
+ }
702
+ .grid-cols-6 {
703
+ grid-template-columns: repeat(6, minmax(0, 1fr));
704
+ }
705
+ .flex-col {
706
+ flex-direction: column;
707
+ }
708
+ .flex-row {
709
+ flex-direction: row;
710
+ }
711
+ .flex-nowrap {
712
+ flex-wrap: nowrap;
713
+ }
714
+ .flex-wrap {
715
+ flex-wrap: wrap;
716
+ }
717
+ .items-center {
718
+ align-items: center;
719
+ }
720
+ .items-end {
721
+ align-items: flex-end;
722
+ }
723
+ .items-start {
724
+ align-items: flex-start;
725
+ }
726
+ .justify-between {
727
+ justify-content: space-between;
728
+ }
729
+ .justify-center {
730
+ justify-content: center;
731
+ }
732
+ .justify-end {
733
+ justify-content: flex-end;
734
+ }
735
+ .justify-start {
736
+ justify-content: flex-start;
737
+ }
738
+ .gap-1 {
739
+ gap: calc(var(--spacing) * 1);
740
+ }
741
+ .gap-1\\.5 {
742
+ gap: calc(var(--spacing) * 1.5);
743
+ }
744
+ .gap-2 {
745
+ gap: calc(var(--spacing) * 2);
746
+ }
747
+ .gap-3 {
748
+ gap: calc(var(--spacing) * 3);
749
+ }
750
+ .gap-4 {
751
+ gap: calc(var(--spacing) * 4);
752
+ }
753
+ .space-y-2 {
754
+ :where(& > :not(:last-child)) {
755
+ --tw-space-y-reverse: 0;
756
+ margin-block-start: calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));
757
+ margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)));
758
+ }
759
+ }
760
+ .space-y-3 {
761
+ :where(& > :not(:last-child)) {
762
+ --tw-space-y-reverse: 0;
763
+ margin-block-start: calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));
764
+ margin-block-end: calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)));
765
+ }
766
+ }
767
+ .space-y-4 {
768
+ :where(& > :not(:last-child)) {
769
+ --tw-space-y-reverse: 0;
770
+ margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));
771
+ margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));
772
+ }
773
+ }
774
+ .space-y-5 {
775
+ :where(& > :not(:last-child)) {
776
+ --tw-space-y-reverse: 0;
777
+ margin-block-start: calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));
778
+ margin-block-end: calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)));
779
+ }
780
+ }
781
+ .space-y-6 {
782
+ :where(& > :not(:last-child)) {
783
+ --tw-space-y-reverse: 0;
784
+ margin-block-start: calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));
785
+ margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)));
786
+ }
787
+ }
788
+ .gap-x-1 {
789
+ -moz-column-gap: calc(var(--spacing) * 1);
790
+ column-gap: calc(var(--spacing) * 1);
791
+ }
792
+ .space-x-2 {
793
+ :where(& > :not(:last-child)) {
794
+ --tw-space-x-reverse: 0;
795
+ margin-inline-start: calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));
796
+ margin-inline-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)));
797
+ }
798
+ }
799
+ .space-x-3 {
800
+ :where(& > :not(:last-child)) {
801
+ --tw-space-x-reverse: 0;
802
+ margin-inline-start: calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));
803
+ margin-inline-end: calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)));
804
+ }
805
+ }
806
+ .gap-y-4 {
807
+ row-gap: calc(var(--spacing) * 4);
808
+ }
809
+ .divide-y {
810
+ :where(& > :not(:last-child)) {
811
+ --tw-divide-y-reverse: 0;
812
+ border-bottom-style: var(--tw-border-style);
813
+ border-top-style: var(--tw-border-style);
814
+ border-top-width: calc(1px * var(--tw-divide-y-reverse));
815
+ border-bottom-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
816
+ }
817
+ }
818
+ .divide-border-subtle {
819
+ :where(& > :not(:last-child)) {
820
+ border-color: var(--color-border-subtle);
821
+ }
822
+ }
823
+ .truncate {
824
+ overflow: hidden;
825
+ text-overflow: ellipsis;
826
+ white-space: nowrap;
827
+ }
828
+ .overflow-auto {
829
+ overflow: auto;
830
+ }
831
+ .overflow-hidden {
832
+ overflow: hidden;
833
+ }
834
+ .overflow-x-auto {
835
+ overflow-x: auto;
836
+ }
837
+ .overflow-y-auto {
838
+ overflow-y: auto;
839
+ }
840
+ .rounded {
841
+ border-radius: 0.25rem;
842
+ }
843
+ .rounded-\\[3px\\] {
844
+ border-radius: 3px;
845
+ }
846
+ .rounded-full {
847
+ border-radius: calc(infinity * 1px);
848
+ }
849
+ .rounded-lg {
850
+ border-radius: var(--radius-lg);
851
+ }
852
+ .rounded-md {
853
+ border-radius: var(--radius-md);
854
+ }
855
+ .rounded-none {
856
+ border-radius: 0;
857
+ }
858
+ .rounded-xl {
859
+ border-radius: var(--radius-xl);
860
+ }
861
+ .rounded-t-2xl {
862
+ border-top-left-radius: var(--radius-2xl);
863
+ border-top-right-radius: var(--radius-2xl);
864
+ }
865
+ .rounded-t-lg {
866
+ border-top-left-radius: var(--radius-lg);
867
+ border-top-right-radius: var(--radius-lg);
868
+ }
869
+ .rounded-l-md {
870
+ border-top-left-radius: var(--radius-md);
871
+ border-bottom-left-radius: var(--radius-md);
872
+ }
873
+ .rounded-r-md {
874
+ border-top-right-radius: var(--radius-md);
875
+ border-bottom-right-radius: var(--radius-md);
876
+ }
877
+ .border {
878
+ border-style: var(--tw-border-style);
879
+ border-width: 1px;
880
+ }
881
+ .border-0 {
882
+ border-style: var(--tw-border-style);
883
+ border-width: 0px;
884
+ }
885
+ .border-2 {
886
+ border-style: var(--tw-border-style);
887
+ border-width: 2px;
888
+ }
889
+ .border-3 {
890
+ border-style: var(--tw-border-style);
891
+ border-width: 3px;
892
+ }
893
+ .border-4 {
894
+ border-style: var(--tw-border-style);
895
+ border-width: 4px;
896
+ }
897
+ .border-t {
898
+ border-top-style: var(--tw-border-style);
899
+ border-top-width: 1px;
900
+ }
901
+ .border-r {
902
+ border-right-style: var(--tw-border-style);
903
+ border-right-width: 1px;
904
+ }
905
+ .border-r-0 {
906
+ border-right-style: var(--tw-border-style);
907
+ border-right-width: 0px;
908
+ }
909
+ .border-b {
910
+ border-bottom-style: var(--tw-border-style);
911
+ border-bottom-width: 1px;
912
+ }
913
+ .border-b-2 {
914
+ border-bottom-style: var(--tw-border-style);
915
+ border-bottom-width: 2px;
916
+ }
917
+ .border-l {
918
+ border-left-style: var(--tw-border-style);
919
+ border-left-width: 1px;
920
+ }
921
+ .border-dashed {
922
+ --tw-border-style: dashed;
923
+ border-style: dashed;
924
+ }
925
+ .border-none {
926
+ --tw-border-style: none;
927
+ border-style: none;
928
+ }
929
+ .border-\\[\\#cfd4da\\] {
930
+ border-color: #cfd4da;
931
+ }
932
+ .border-accent {
933
+ border-color: var(--color-accent);
934
+ }
935
+ .border-border-default {
936
+ border-color: var(--color-border-default);
937
+ }
938
+ .border-border-strong {
939
+ border-color: var(--color-border-strong);
940
+ }
941
+ .border-border-subtle {
942
+ border-color: var(--color-border-subtle);
943
+ }
944
+ .border-gray-300 {
945
+ border-color: var(--color-gray-300);
946
+ }
947
+ .border-state-error {
948
+ border-color: var(--color-state-error);
949
+ }
950
+ .border-transparent {
951
+ border-color: transparent;
952
+ }
953
+ .border-t-accent {
954
+ border-top-color: var(--color-accent);
955
+ }
956
+ .border-r-accent {
957
+ border-right-color: var(--color-accent);
958
+ }
959
+ .border-b-accent {
960
+ border-bottom-color: var(--color-accent);
961
+ }
962
+ .border-b-transparent {
963
+ border-bottom-color: transparent;
964
+ }
965
+ .bg-\\[\\#f8f9fa\\] {
966
+ background-color: #f8f9fa;
967
+ }
968
+ .bg-accent {
969
+ background-color: var(--color-accent);
970
+ }
971
+ .bg-accent-light {
972
+ background-color: var(--color-accent-light);
973
+ }
974
+ .bg-accent\\/5 {
975
+ background-color: var(--color-accent);
976
+ @supports (color: color-mix(in lab, red, red)) {
977
+ background-color: color-mix(in oklab, var(--color-accent) 5%, transparent);
978
+ }
979
+ }
980
+ .bg-accent\\/10 {
981
+ background-color: var(--color-accent);
982
+ @supports (color: color-mix(in lab, red, red)) {
983
+ background-color: color-mix(in oklab, var(--color-accent) 10%, transparent);
984
+ }
985
+ }
986
+ .bg-bg-app {
987
+ background-color: var(--color-bg-app);
988
+ }
989
+ .bg-bg-elevated {
990
+ background-color: var(--color-bg-elevated);
991
+ }
992
+ .bg-bg-input {
993
+ background-color: var(--color-bg-input);
994
+ }
995
+ .bg-bg-overlay {
996
+ background-color: var(--color-bg-overlay);
997
+ }
998
+ .bg-bg-surface {
999
+ background-color: var(--color-bg-surface);
1000
+ }
1001
+ .bg-bg-surface-alt {
1002
+ background-color: var(--color-bg-surface-alt);
1003
+ }
1004
+ .bg-bg-surface\\/80 {
1005
+ background-color: var(--color-bg-surface);
1006
+ @supports (color: color-mix(in lab, red, red)) {
1007
+ background-color: color-mix(in oklab, var(--color-bg-surface) 80%, transparent);
1008
+ }
1009
+ }
1010
+ .bg-blue-500 {
1011
+ background-color: var(--color-blue-500);
1012
+ }
1013
+ .bg-border-default {
1014
+ background-color: var(--color-border-default);
1015
+ }
1016
+ .bg-border-subtle {
1017
+ background-color: var(--color-border-subtle);
1018
+ }
1019
+ .bg-green-500 {
1020
+ background-color: var(--color-green-500);
1021
+ }
1022
+ .bg-indigo-500 {
1023
+ background-color: var(--color-indigo-500);
1024
+ }
1025
+ .bg-inherit {
1026
+ background-color: inherit;
1027
+ }
1028
+ .bg-interactive-hover {
1029
+ background-color: var(--color-interactive-hover);
1030
+ }
1031
+ .bg-interactive-selected {
1032
+ background-color: var(--color-interactive-selected);
1033
+ }
1034
+ .bg-pink-500 {
1035
+ background-color: var(--color-pink-500);
1036
+ }
1037
+ .bg-purple-500 {
1038
+ background-color: var(--color-purple-500);
1039
+ }
1040
+ .bg-red-500 {
1041
+ background-color: var(--color-red-500);
1042
+ }
1043
+ .bg-state-error {
1044
+ background-color: var(--color-state-error);
1045
+ }
1046
+ .bg-state-error-light {
1047
+ background-color: var(--color-state-error-light);
1048
+ }
1049
+ .bg-state-info-light {
1050
+ background-color: var(--color-state-info-light);
1051
+ }
1052
+ .bg-state-success-light {
1053
+ background-color: var(--color-state-success-light);
1054
+ }
1055
+ .bg-state-warning-light {
1056
+ background-color: var(--color-state-warning-light);
1057
+ }
1058
+ .bg-teal-500 {
1059
+ background-color: var(--color-teal-500);
1060
+ }
1061
+ .bg-tooltip-bg {
1062
+ background-color: var(--color-tooltip-bg);
1063
+ }
1064
+ .bg-transparent {
1065
+ background-color: transparent;
1066
+ }
1067
+ .bg-white {
1068
+ background-color: var(--color-white);
1069
+ }
1070
+ .bg-yellow-500 {
1071
+ background-color: var(--color-yellow-500);
1072
+ }
1073
+ .object-contain {
1074
+ -o-object-fit: contain;
1075
+ object-fit: contain;
1076
+ }
1077
+ .p-0 {
1078
+ padding: calc(var(--spacing) * 0);
1079
+ }
1080
+ .p-0\\.5 {
1081
+ padding: calc(var(--spacing) * 0.5);
1082
+ }
1083
+ .p-1 {
1084
+ padding: calc(var(--spacing) * 1);
1085
+ }
1086
+ .p-1\\.5 {
1087
+ padding: calc(var(--spacing) * 1.5);
1088
+ }
1089
+ .p-2 {
1090
+ padding: calc(var(--spacing) * 2);
1091
+ }
1092
+ .p-3 {
1093
+ padding: calc(var(--spacing) * 3);
1094
+ }
1095
+ .p-4 {
1096
+ padding: calc(var(--spacing) * 4);
1097
+ }
1098
+ .p-5 {
1099
+ padding: calc(var(--spacing) * 5);
1100
+ }
1101
+ .p-6 {
1102
+ padding: calc(var(--spacing) * 6);
1103
+ }
1104
+ .p-8 {
1105
+ padding: calc(var(--spacing) * 8);
1106
+ }
1107
+ .p-\\[5px\\] {
1108
+ padding: 5px;
1109
+ }
1110
+ .px-1 {
1111
+ padding-inline: calc(var(--spacing) * 1);
1112
+ }
1113
+ .px-2 {
1114
+ padding-inline: calc(var(--spacing) * 2);
1115
+ }
1116
+ .px-3 {
1117
+ padding-inline: calc(var(--spacing) * 3);
1118
+ }
1119
+ .px-4 {
1120
+ padding-inline: calc(var(--spacing) * 4);
1121
+ }
1122
+ .px-5 {
1123
+ padding-inline: calc(var(--spacing) * 5);
1124
+ }
1125
+ .px-6 {
1126
+ padding-inline: calc(var(--spacing) * 6);
1127
+ }
1128
+ .py-1 {
1129
+ padding-block: calc(var(--spacing) * 1);
1130
+ }
1131
+ .py-1\\.5 {
1132
+ padding-block: calc(var(--spacing) * 1.5);
1133
+ }
1134
+ .py-2 {
1135
+ padding-block: calc(var(--spacing) * 2);
1136
+ }
1137
+ .py-2\\.5 {
1138
+ padding-block: calc(var(--spacing) * 2.5);
1139
+ }
1140
+ .py-3 {
1141
+ padding-block: calc(var(--spacing) * 3);
1142
+ }
1143
+ .py-4 {
1144
+ padding-block: calc(var(--spacing) * 4);
1145
+ }
1146
+ .pt-0\\.5 {
1147
+ padding-top: calc(var(--spacing) * 0.5);
1148
+ }
1149
+ .pt-2 {
1150
+ padding-top: calc(var(--spacing) * 2);
1151
+ }
1152
+ .pt-3 {
1153
+ padding-top: calc(var(--spacing) * 3);
1154
+ }
1155
+ .pt-4 {
1156
+ padding-top: calc(var(--spacing) * 4);
1157
+ }
1158
+ .pr-2 {
1159
+ padding-right: calc(var(--spacing) * 2);
1160
+ }
1161
+ .pr-3 {
1162
+ padding-right: calc(var(--spacing) * 3);
1163
+ }
1164
+ .pr-6 {
1165
+ padding-right: calc(var(--spacing) * 6);
1166
+ }
1167
+ .pr-7 {
1168
+ padding-right: calc(var(--spacing) * 7);
1169
+ }
1170
+ .pr-9 {
1171
+ padding-right: calc(var(--spacing) * 9);
1172
+ }
1173
+ .pr-10 {
1174
+ padding-right: calc(var(--spacing) * 10);
1175
+ }
1176
+ .pb-3 {
1177
+ padding-bottom: calc(var(--spacing) * 3);
1178
+ }
1179
+ .pb-4 {
1180
+ padding-bottom: calc(var(--spacing) * 4);
1181
+ }
1182
+ .pl-0\\.5 {
1183
+ padding-left: calc(var(--spacing) * 0.5);
1184
+ }
1185
+ .pl-2 {
1186
+ padding-left: calc(var(--spacing) * 2);
1187
+ }
1188
+ .pl-3 {
1189
+ padding-left: calc(var(--spacing) * 3);
1190
+ }
1191
+ .pl-4 {
1192
+ padding-left: calc(var(--spacing) * 4);
1193
+ }
1194
+ .pl-6 {
1195
+ padding-left: calc(var(--spacing) * 6);
1196
+ }
1197
+ .pl-8 {
1198
+ padding-left: calc(var(--spacing) * 8);
1199
+ }
1200
+ .text-center {
1201
+ text-align: center;
1202
+ }
1203
+ .text-left {
1204
+ text-align: left;
1205
+ }
1206
+ .text-right {
1207
+ text-align: right;
1208
+ }
1209
+ .text-base {
1210
+ font-size: var(--text-base);
1211
+ line-height: var(--tw-leading, var(--text-base--line-height));
1212
+ }
1213
+ .text-lg {
1214
+ font-size: var(--text-lg);
1215
+ line-height: var(--tw-leading, var(--text-lg--line-height));
1216
+ }
1217
+ .text-sm {
1218
+ font-size: var(--text-sm);
1219
+ line-height: var(--tw-leading, var(--text-sm--line-height));
1220
+ }
1221
+ .text-xl {
1222
+ font-size: var(--text-xl);
1223
+ line-height: var(--tw-leading, var(--text-xl--line-height));
1224
+ }
1225
+ .text-xs {
1226
+ font-size: var(--text-xs);
1227
+ line-height: var(--tw-leading, var(--text-xs--line-height));
1228
+ }
1229
+ .text-\\[10px\\] {
1230
+ font-size: 10px;
1231
+ }
1232
+ .text-\\[13px\\] {
1233
+ font-size: 13px;
1234
+ }
1235
+ .leading-none {
1236
+ --tw-leading: 1;
1237
+ line-height: 1;
1238
+ }
1239
+ .leading-relaxed {
1240
+ --tw-leading: var(--leading-relaxed);
1241
+ line-height: var(--leading-relaxed);
1242
+ }
1243
+ .font-bold {
1244
+ --tw-font-weight: var(--font-weight-bold);
1245
+ font-weight: var(--font-weight-bold);
1246
+ }
1247
+ .font-medium {
1248
+ --tw-font-weight: var(--font-weight-medium);
1249
+ font-weight: var(--font-weight-medium);
1250
+ }
1251
+ .font-semibold {
1252
+ --tw-font-weight: var(--font-weight-semibold);
1253
+ font-weight: var(--font-weight-semibold);
1254
+ }
1255
+ .tracking-widest {
1256
+ --tw-tracking: var(--tracking-widest);
1257
+ letter-spacing: var(--tracking-widest);
1258
+ }
1259
+ .whitespace-nowrap {
1260
+ white-space: nowrap;
1261
+ }
1262
+ .text-accent {
1263
+ color: var(--color-accent);
1264
+ }
1265
+ .text-accent-fg {
1266
+ color: var(--color-accent-fg);
1267
+ }
1268
+ .text-border-default {
1269
+ color: var(--color-border-default);
1270
+ }
1271
+ .text-fg-disabled {
1272
+ color: var(--color-fg-disabled);
1273
+ }
1274
+ .text-fg-muted {
1275
+ color: var(--color-fg-muted);
1276
+ }
1277
+ .text-fg-on-accent {
1278
+ color: var(--color-fg-on-accent);
1279
+ }
1280
+ .text-fg-primary {
1281
+ color: var(--color-fg-primary);
1282
+ }
1283
+ .text-fg-secondary {
1284
+ color: var(--color-fg-secondary);
1285
+ }
1286
+ .text-red-600 {
1287
+ color: var(--color-red-600);
1288
+ }
1289
+ .text-state-error {
1290
+ color: var(--color-state-error);
1291
+ }
1292
+ .text-state-success {
1293
+ color: var(--color-state-success);
1294
+ }
1295
+ .text-state-warning {
1296
+ color: var(--color-state-warning);
1297
+ }
1298
+ .text-tooltip-fg {
1299
+ color: var(--color-tooltip-fg);
1300
+ }
1301
+ .text-white {
1302
+ color: var(--color-white);
1303
+ }
1304
+ .uppercase {
1305
+ text-transform: uppercase;
1306
+ }
1307
+ .italic {
1308
+ font-style: italic;
1309
+ }
1310
+ .underline {
1311
+ text-decoration-line: underline;
1312
+ }
1313
+ .placeholder-fg-muted {
1314
+ &::-moz-placeholder {
1315
+ color: var(--color-fg-muted);
1316
+ }
1317
+ &::placeholder {
1318
+ color: var(--color-fg-muted);
1319
+ }
1320
+ }
1321
+ .accent-accent {
1322
+ accent-color: var(--color-accent);
1323
+ }
1324
+ .opacity-0 {
1325
+ opacity: 0%;
1326
+ }
1327
+ .opacity-50 {
1328
+ opacity: 50%;
1329
+ }
1330
+ .opacity-100 {
1331
+ opacity: 100%;
1332
+ }
1333
+ .shadow {
1334
+ --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1335
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1336
+ }
1337
+ .shadow-2xl {
1338
+ --tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, rgb(0 0 0 / 0.25));
1339
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1340
+ }
1341
+ .shadow-lg {
1342
+ --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1343
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1344
+ }
1345
+ .shadow-md {
1346
+ --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1347
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1348
+ }
1349
+ .shadow-sm {
1350
+ --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1351
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1352
+ }
1353
+ .ring {
1354
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1355
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1356
+ }
1357
+ .ring-1 {
1358
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1359
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1360
+ }
1361
+ .ring-2 {
1362
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1363
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1364
+ }
1365
+ .ring-accent {
1366
+ --tw-ring-color: var(--color-accent);
1367
+ }
1368
+ .ring-border-default {
1369
+ --tw-ring-color: var(--color-border-default);
1370
+ }
1371
+ .ring-interactive-focus-ring {
1372
+ --tw-ring-color: var(--color-interactive-focus-ring);
1373
+ }
1374
+ .ring-offset-1 {
1375
+ --tw-ring-offset-width: 1px;
1376
+ --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
1377
+ }
1378
+ .outline {
1379
+ outline-style: var(--tw-outline-style);
1380
+ outline-width: 1px;
1381
+ }
1382
+ .outline-1 {
1383
+ outline-style: var(--tw-outline-style);
1384
+ outline-width: 1px;
1385
+ }
1386
+ .outline-2 {
1387
+ outline-style: var(--tw-outline-style);
1388
+ outline-width: 2px;
1389
+ }
1390
+ .-outline-offset-1 {
1391
+ outline-offset: calc(1px * -1);
1392
+ }
1393
+ .outline-offset-2 {
1394
+ outline-offset: 2px;
1395
+ }
1396
+ .outline-accent {
1397
+ outline-color: var(--color-accent);
1398
+ }
1399
+ .outline-border-default {
1400
+ outline-color: var(--color-border-default);
1401
+ }
1402
+ .filter {
1403
+ filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
1404
+ }
1405
+ .backdrop-blur {
1406
+ --tw-backdrop-blur: blur(8px);
1407
+ backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
1408
+ }
1409
+ .transition {
1410
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
1411
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1412
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
1413
+ }
1414
+ .transition-\\[height\\] {
1415
+ transition-property: height;
1416
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1417
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
1418
+ }
1419
+ .transition-all {
1420
+ transition-property: all;
1421
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1422
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
1423
+ }
1424
+ .transition-colors {
1425
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
1426
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1427
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
1428
+ }
1429
+ .transition-opacity {
1430
+ transition-property: opacity;
1431
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1432
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
1433
+ }
1434
+ .transition-transform {
1435
+ transition-property: transform, translate, scale, rotate;
1436
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1437
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
1438
+ }
1439
+ .duration-150 {
1440
+ --tw-duration: 150ms;
1441
+ transition-duration: 150ms;
1442
+ }
1443
+ .duration-200 {
1444
+ --tw-duration: 200ms;
1445
+ transition-duration: 200ms;
1446
+ }
1447
+ .duration-300 {
1448
+ --tw-duration: 300ms;
1449
+ transition-duration: 300ms;
1450
+ }
1451
+ .ease-in-out {
1452
+ --tw-ease: var(--ease-in-out);
1453
+ transition-timing-function: var(--ease-in-out);
1454
+ }
1455
+ .ease-out {
1456
+ --tw-ease: var(--ease-out);
1457
+ transition-timing-function: var(--ease-out);
1458
+ }
1459
+ .outline-none {
1460
+ --tw-outline-style: none;
1461
+ outline-style: none;
1462
+ }
1463
+ .select-none {
1464
+ -webkit-user-select: none;
1465
+ -moz-user-select: none;
1466
+ user-select: none;
1467
+ }
1468
+ .group-hover\\:opacity-100 {
1469
+ &:is(:where(.group):hover *) {
1470
+ @media (hover: hover) {
1471
+ opacity: 100%;
1472
+ }
1473
+ }
1474
+ }
1475
+ .peer-checked\\:opacity-100 {
1476
+ &:is(:where(.peer):checked ~ *) {
1477
+ opacity: 100%;
1478
+ }
1479
+ }
1480
+ .placeholder\\:text-fg-muted {
1481
+ &::-moz-placeholder {
1482
+ color: var(--color-fg-muted);
1483
+ }
1484
+ &::placeholder {
1485
+ color: var(--color-fg-muted);
1486
+ }
1487
+ }
1488
+ .first\\:mt-0 {
1489
+ &:first-child {
1490
+ margin-top: calc(var(--spacing) * 0);
1491
+ }
1492
+ }
1493
+ .checked\\:border-accent {
1494
+ &:checked {
1495
+ border-color: var(--color-accent);
1496
+ }
1497
+ }
1498
+ .checked\\:bg-accent {
1499
+ &:checked {
1500
+ background-color: var(--color-accent);
1501
+ }
1502
+ }
1503
+ .hover\\:scale-105 {
1504
+ &:hover {
1505
+ @media (hover: hover) {
1506
+ --tw-scale-x: 105%;
1507
+ --tw-scale-y: 105%;
1508
+ --tw-scale-z: 105%;
1509
+ scale: var(--tw-scale-x) var(--tw-scale-y);
1510
+ }
1511
+ }
1512
+ }
1513
+ .hover\\:border-accent {
1514
+ &:hover {
1515
+ @media (hover: hover) {
1516
+ border-color: var(--color-accent);
1517
+ }
1518
+ }
1519
+ }
1520
+ .hover\\:border-border-default {
1521
+ &:hover {
1522
+ @media (hover: hover) {
1523
+ border-color: var(--color-border-default);
1524
+ }
1525
+ }
1526
+ }
1527
+ .hover\\:border-fg-muted {
1528
+ &:hover {
1529
+ @media (hover: hover) {
1530
+ border-color: var(--color-fg-muted);
1531
+ }
1532
+ }
1533
+ }
1534
+ .hover\\:border-fg-muted\\/30 {
1535
+ &:hover {
1536
+ @media (hover: hover) {
1537
+ border-color: var(--color-fg-muted);
1538
+ @supports (color: color-mix(in lab, red, red)) {
1539
+ border-color: color-mix(in oklab, var(--color-fg-muted) 30%, transparent);
1540
+ }
1541
+ }
1542
+ }
1543
+ }
1544
+ .hover\\:border-state-error {
1545
+ &:hover {
1546
+ @media (hover: hover) {
1547
+ border-color: var(--color-state-error);
1548
+ }
1549
+ }
1550
+ }
1551
+ .hover\\:border-b-accent {
1552
+ &:hover {
1553
+ @media (hover: hover) {
1554
+ border-bottom-color: var(--color-accent);
1555
+ }
1556
+ }
1557
+ }
1558
+ .hover\\:border-b-fg-muted {
1559
+ &:hover {
1560
+ @media (hover: hover) {
1561
+ border-bottom-color: var(--color-fg-muted);
1562
+ }
1563
+ }
1564
+ }
1565
+ .hover\\:\\!bg-accent-hover {
1566
+ &:hover {
1567
+ @media (hover: hover) {
1568
+ background-color: var(--color-accent-hover) !important;
1569
+ }
1570
+ }
1571
+ }
1572
+ .hover\\:bg-accent {
1573
+ &:hover {
1574
+ @media (hover: hover) {
1575
+ background-color: var(--color-accent);
1576
+ }
1577
+ }
1578
+ }
1579
+ .hover\\:bg-accent-hover {
1580
+ &:hover {
1581
+ @media (hover: hover) {
1582
+ background-color: var(--color-accent-hover);
1583
+ }
1584
+ }
1585
+ }
1586
+ .hover\\:bg-bg-surface {
1587
+ &:hover {
1588
+ @media (hover: hover) {
1589
+ background-color: var(--color-bg-surface);
1590
+ }
1591
+ }
1592
+ }
1593
+ .hover\\:bg-border-default {
1594
+ &:hover {
1595
+ @media (hover: hover) {
1596
+ background-color: var(--color-border-default);
1597
+ }
1598
+ }
1599
+ }
1600
+ .hover\\:bg-interactive-hover {
1601
+ &:hover {
1602
+ @media (hover: hover) {
1603
+ background-color: var(--color-interactive-hover);
1604
+ }
1605
+ }
1606
+ }
1607
+ .hover\\:bg-state-error-light {
1608
+ &:hover {
1609
+ @media (hover: hover) {
1610
+ background-color: var(--color-state-error-light);
1611
+ }
1612
+ }
1613
+ }
1614
+ .hover\\:bg-state-error\\/90 {
1615
+ &:hover {
1616
+ @media (hover: hover) {
1617
+ background-color: var(--color-state-error);
1618
+ @supports (color: color-mix(in lab, red, red)) {
1619
+ background-color: color-mix(in oklab, var(--color-state-error) 90%, transparent);
1620
+ }
1621
+ }
1622
+ }
1623
+ }
1624
+ .hover\\:bg-transparent {
1625
+ &:hover {
1626
+ @media (hover: hover) {
1627
+ background-color: transparent;
1628
+ }
1629
+ }
1630
+ }
1631
+ .hover\\:text-accent-hover {
1632
+ &:hover {
1633
+ @media (hover: hover) {
1634
+ color: var(--color-accent-hover);
1635
+ }
1636
+ }
1637
+ }
1638
+ .hover\\:text-fg-on-accent {
1639
+ &:hover {
1640
+ @media (hover: hover) {
1641
+ color: var(--color-fg-on-accent);
1642
+ }
1643
+ }
1644
+ }
1645
+ .hover\\:text-fg-primary {
1646
+ &:hover {
1647
+ @media (hover: hover) {
1648
+ color: var(--color-fg-primary);
1649
+ }
1650
+ }
1651
+ }
1652
+ .hover\\:text-fg-secondary {
1653
+ &:hover {
1654
+ @media (hover: hover) {
1655
+ color: var(--color-fg-secondary);
1656
+ }
1657
+ }
1658
+ }
1659
+ .hover\\:shadow-md {
1660
+ &:hover {
1661
+ @media (hover: hover) {
1662
+ --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1663
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1664
+ }
1665
+ }
1666
+ }
1667
+ .hover\\:ring {
1668
+ &:hover {
1669
+ @media (hover: hover) {
1670
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1671
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1672
+ }
1673
+ }
1674
+ }
1675
+ .hover\\:ring-0 {
1676
+ &:hover {
1677
+ @media (hover: hover) {
1678
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1679
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1680
+ }
1681
+ }
1682
+ }
1683
+ .hover\\:ring-accent {
1684
+ &:hover {
1685
+ @media (hover: hover) {
1686
+ --tw-ring-color: var(--color-accent);
1687
+ }
1688
+ }
1689
+ }
1690
+ .hover\\:ring-transparent {
1691
+ &:hover {
1692
+ @media (hover: hover) {
1693
+ --tw-ring-color: transparent;
1694
+ }
1695
+ }
1696
+ }
1697
+ .focus\\:border-accent {
1698
+ &:focus {
1699
+ border-color: var(--color-accent);
1700
+ }
1701
+ }
1702
+ .focus\\:border-blue-500 {
1703
+ &:focus {
1704
+ border-color: var(--color-blue-500);
1705
+ }
1706
+ }
1707
+ .focus\\:border-state-error {
1708
+ &:focus {
1709
+ border-color: var(--color-state-error);
1710
+ }
1711
+ }
1712
+ .focus\\:border-transparent {
1713
+ &:focus {
1714
+ border-color: transparent;
1715
+ }
1716
+ }
1717
+ .focus\\:ring-1 {
1718
+ &:focus {
1719
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1720
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1721
+ }
1722
+ }
1723
+ .focus\\:ring-2 {
1724
+ &:focus {
1725
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1726
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1727
+ }
1728
+ }
1729
+ .focus\\:ring-accent {
1730
+ &:focus {
1731
+ --tw-ring-color: var(--color-accent);
1732
+ }
1733
+ }
1734
+ .focus\\:ring-blue-500 {
1735
+ &:focus {
1736
+ --tw-ring-color: var(--color-blue-500);
1737
+ }
1738
+ }
1739
+ .focus\\:outline-none {
1740
+ &:focus {
1741
+ --tw-outline-style: none;
1742
+ outline-style: none;
1743
+ }
1744
+ }
1745
+ .active\\:cursor-grabbing {
1746
+ &:active {
1747
+ cursor: grabbing;
1748
+ }
1749
+ }
1750
+ .active\\:bg-interactive-active {
1751
+ &:active {
1752
+ background-color: var(--color-interactive-active);
1753
+ }
1754
+ }
1755
+ .disabled\\:cursor-not-allowed {
1756
+ &:disabled {
1757
+ cursor: not-allowed;
1758
+ }
1759
+ }
1760
+ .disabled\\:opacity-40 {
1761
+ &:disabled {
1762
+ opacity: 40%;
1763
+ }
1764
+ }
1765
+ .disabled\\:opacity-50 {
1766
+ &:disabled {
1767
+ opacity: 50%;
1768
+ }
1769
+ }
1770
+ .disabled\\:hover\\:bg-transparent {
1771
+ &:disabled {
1772
+ &:hover {
1773
+ @media (hover: hover) {
1774
+ background-color: transparent;
1775
+ }
1776
+ }
1777
+ }
1778
+ }
1779
+ .disabled\\:hover\\:ring-0 {
1780
+ &:disabled {
1781
+ &:hover {
1782
+ @media (hover: hover) {
1783
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1784
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1785
+ }
1786
+ }
1787
+ }
1788
+ }
1789
+ .sm\\:grid-cols-2 {
1790
+ @media (width >= 40rem) {
1791
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1792
+ }
1793
+ }
1794
+ .md\\:flex {
1795
+ @media (width >= 48rem) {
1796
+ display: flex;
1797
+ }
1798
+ }
1799
+ .md\\:h-auto {
1800
+ @media (width >= 48rem) {
1801
+ height: auto;
1802
+ }
1803
+ }
1804
+ .md\\:max-h-\\[80vh\\] {
1805
+ @media (width >= 48rem) {
1806
+ max-height: 80vh;
1807
+ }
1808
+ }
1809
+ .md\\:w-\\[28rem\\] {
1810
+ @media (width >= 48rem) {
1811
+ width: 28rem;
1812
+ }
1813
+ }
1814
+ .md\\:w-\\[32rem\\] {
1815
+ @media (width >= 48rem) {
1816
+ width: 32rem;
1817
+ }
1818
+ }
1819
+ .md\\:w-\\[36rem\\] {
1820
+ @media (width >= 48rem) {
1821
+ width: 36rem;
1822
+ }
1823
+ }
1824
+ .md\\:w-\\[42rem\\] {
1825
+ @media (width >= 48rem) {
1826
+ width: 42rem;
1827
+ }
1828
+ }
1829
+ .md\\:w-\\[48rem\\] {
1830
+ @media (width >= 48rem) {
1831
+ width: 48rem;
1832
+ }
1833
+ }
1834
+ .md\\:max-w-\\[90vw\\] {
1835
+ @media (width >= 48rem) {
1836
+ max-width: 90vw;
1837
+ }
1838
+ }
1839
+ .md\\:flex-none {
1840
+ @media (width >= 48rem) {
1841
+ flex: none;
1842
+ }
1843
+ }
1844
+ .md\\:items-center {
1845
+ @media (width >= 48rem) {
1846
+ align-items: center;
1847
+ }
1848
+ }
1849
+ .md\\:justify-center {
1850
+ @media (width >= 48rem) {
1851
+ justify-content: center;
1852
+ }
1853
+ }
1854
+ .md\\:rounded-lg {
1855
+ @media (width >= 48rem) {
1856
+ border-radius: var(--radius-lg);
1857
+ }
1858
+ }
1859
+ .md\\:border {
1860
+ @media (width >= 48rem) {
1861
+ border-style: var(--tw-border-style);
1862
+ border-width: 1px;
1863
+ }
1864
+ }
1865
+ .md\\:border-border-subtle {
1866
+ @media (width >= 48rem) {
1867
+ border-color: var(--color-border-subtle);
1868
+ }
1869
+ }
1870
+ .md\\:shadow-lg {
1871
+ @media (width >= 48rem) {
1872
+ --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1873
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1874
+ }
1875
+ }
1876
+ }
1877
+ :host {
1878
+ --tw-translate-x: 0;
1879
+ --tw-translate-y: 0;
1880
+ --tw-translate-z: 0;
1881
+ --tw-rotate-x: rotateX(0);
1882
+ --tw-rotate-y: rotateY(0);
1883
+ --tw-rotate-z: rotateZ(0);
1884
+ --tw-skew-x: skewX(0);
1885
+ --tw-skew-y: skewY(0);
1886
+ --tw-border-style: solid;
1887
+ --tw-gradient-from: #0000;
1888
+ --tw-gradient-via: #0000;
1889
+ --tw-gradient-to: #0000;
1890
+ --tw-gradient-from-position: 0%;
1891
+ --tw-gradient-via-position: 50%;
1892
+ --tw-gradient-to-position: 100%;
1893
+ --tw-shadow: 0 0 #0000;
1894
+ --tw-inset-shadow: 0 0 #0000;
1895
+ --tw-ring-shadow: 0 0 #0000;
1896
+ --tw-inset-ring-shadow: 0 0 #0000;
1897
+ --tw-ring-offset-width: 0px;
1898
+ --tw-ring-offset-color: #fff;
1899
+ --tw-ring-offset-shadow: 0 0 #0000;
1900
+ --tw-outline-style: solid;
1901
+ display: flex;
1902
+ flex-direction: column;
1903
+ overflow: hidden;
1904
+ width: 100%;
1905
+ height: 100%;
1906
+ --ep-font-family: 'Open Sans', system-ui, sans-serif;
1907
+ font-family: var(--ep-font-family);
1908
+ color: var(--ep-foreground-primary);
1909
+ background-color: var(--ep-background-surface);
1910
+ }
1911
+ .embedpdf-snippet-root {
1912
+ display: flex;
1913
+ flex-direction: column;
1914
+ width: 100%;
1915
+ height: 100%;
1916
+ font-family: var(--ep-font-family);
1917
+ }
1918
+ :host *::-webkit-scrollbar {
1919
+ width: 8px;
1920
+ height: 8px;
1921
+ }
1922
+ :host *::-webkit-scrollbar-track {
1923
+ background: var(--ep-scrollbar-track);
1924
+ }
1925
+ :host *::-webkit-scrollbar-thumb {
1926
+ background: var(--ep-scrollbar-thumb);
1927
+ border-radius: 4px;
1928
+ }
1929
+ :host *::-webkit-scrollbar-thumb:hover {
1930
+ background: var(--ep-scrollbar-thumb-hover);
1931
+ }
1932
+ @property --tw-translate-x {
1933
+ syntax: "*";
1934
+ inherits: false;
1935
+ initial-value: 0;
1936
+ }
1937
+ @property --tw-translate-y {
1938
+ syntax: "*";
1939
+ inherits: false;
1940
+ initial-value: 0;
1941
+ }
1942
+ @property --tw-translate-z {
1943
+ syntax: "*";
1944
+ inherits: false;
1945
+ initial-value: 0;
1946
+ }
1947
+ @property --tw-scale-x {
1948
+ syntax: "*";
1949
+ inherits: false;
1950
+ initial-value: 1;
1951
+ }
1952
+ @property --tw-scale-y {
1953
+ syntax: "*";
1954
+ inherits: false;
1955
+ initial-value: 1;
1956
+ }
1957
+ @property --tw-scale-z {
1958
+ syntax: "*";
1959
+ inherits: false;
1960
+ initial-value: 1;
1961
+ }
1962
+ @property --tw-rotate-x {
1963
+ syntax: "*";
1964
+ inherits: false;
1965
+ }
1966
+ @property --tw-rotate-y {
1967
+ syntax: "*";
1968
+ inherits: false;
1969
+ }
1970
+ @property --tw-rotate-z {
1971
+ syntax: "*";
1972
+ inherits: false;
1973
+ }
1974
+ @property --tw-skew-x {
1975
+ syntax: "*";
1976
+ inherits: false;
1977
+ }
1978
+ @property --tw-skew-y {
1979
+ syntax: "*";
1980
+ inherits: false;
1981
+ }
1982
+ @property --tw-space-y-reverse {
1983
+ syntax: "*";
1984
+ inherits: false;
1985
+ initial-value: 0;
1986
+ }
1987
+ @property --tw-space-x-reverse {
1988
+ syntax: "*";
1989
+ inherits: false;
1990
+ initial-value: 0;
1991
+ }
1992
+ @property --tw-divide-y-reverse {
1993
+ syntax: "*";
1994
+ inherits: false;
1995
+ initial-value: 0;
1996
+ }
1997
+ @property --tw-border-style {
1998
+ syntax: "*";
1999
+ inherits: false;
2000
+ initial-value: solid;
2001
+ }
2002
+ @property --tw-leading {
2003
+ syntax: "*";
2004
+ inherits: false;
2005
+ }
2006
+ @property --tw-font-weight {
2007
+ syntax: "*";
2008
+ inherits: false;
2009
+ }
2010
+ @property --tw-tracking {
2011
+ syntax: "*";
2012
+ inherits: false;
2013
+ }
2014
+ @property --tw-shadow {
2015
+ syntax: "*";
2016
+ inherits: false;
2017
+ initial-value: 0 0 #0000;
2018
+ }
2019
+ @property --tw-shadow-color {
2020
+ syntax: "*";
2021
+ inherits: false;
2022
+ }
2023
+ @property --tw-shadow-alpha {
2024
+ syntax: "<percentage>";
2025
+ inherits: false;
2026
+ initial-value: 100%;
2027
+ }
2028
+ @property --tw-inset-shadow {
2029
+ syntax: "*";
2030
+ inherits: false;
2031
+ initial-value: 0 0 #0000;
2032
+ }
2033
+ @property --tw-inset-shadow-color {
2034
+ syntax: "*";
2035
+ inherits: false;
2036
+ }
2037
+ @property --tw-inset-shadow-alpha {
2038
+ syntax: "<percentage>";
2039
+ inherits: false;
2040
+ initial-value: 100%;
2041
+ }
2042
+ @property --tw-ring-color {
2043
+ syntax: "*";
2044
+ inherits: false;
2045
+ }
2046
+ @property --tw-ring-shadow {
2047
+ syntax: "*";
2048
+ inherits: false;
2049
+ initial-value: 0 0 #0000;
2050
+ }
2051
+ @property --tw-inset-ring-color {
2052
+ syntax: "*";
2053
+ inherits: false;
2054
+ }
2055
+ @property --tw-inset-ring-shadow {
2056
+ syntax: "*";
2057
+ inherits: false;
2058
+ initial-value: 0 0 #0000;
2059
+ }
2060
+ @property --tw-ring-inset {
2061
+ syntax: "*";
2062
+ inherits: false;
2063
+ }
2064
+ @property --tw-ring-offset-width {
2065
+ syntax: "<length>";
2066
+ inherits: false;
2067
+ initial-value: 0px;
2068
+ }
2069
+ @property --tw-ring-offset-color {
2070
+ syntax: "*";
2071
+ inherits: false;
2072
+ initial-value: #fff;
2073
+ }
2074
+ @property --tw-ring-offset-shadow {
2075
+ syntax: "*";
2076
+ inherits: false;
2077
+ initial-value: 0 0 #0000;
2078
+ }
2079
+ @property --tw-outline-style {
2080
+ syntax: "*";
2081
+ inherits: false;
2082
+ initial-value: solid;
2083
+ }
2084
+ @property --tw-blur {
2085
+ syntax: "*";
2086
+ inherits: false;
2087
+ }
2088
+ @property --tw-brightness {
2089
+ syntax: "*";
2090
+ inherits: false;
2091
+ }
2092
+ @property --tw-contrast {
2093
+ syntax: "*";
2094
+ inherits: false;
2095
+ }
2096
+ @property --tw-grayscale {
2097
+ syntax: "*";
2098
+ inherits: false;
2099
+ }
2100
+ @property --tw-hue-rotate {
2101
+ syntax: "*";
2102
+ inherits: false;
2103
+ }
2104
+ @property --tw-invert {
2105
+ syntax: "*";
2106
+ inherits: false;
2107
+ }
2108
+ @property --tw-opacity {
2109
+ syntax: "*";
2110
+ inherits: false;
2111
+ }
2112
+ @property --tw-saturate {
2113
+ syntax: "*";
2114
+ inherits: false;
2115
+ }
2116
+ @property --tw-sepia {
2117
+ syntax: "*";
2118
+ inherits: false;
2119
+ }
2120
+ @property --tw-drop-shadow {
2121
+ syntax: "*";
2122
+ inherits: false;
2123
+ }
2124
+ @property --tw-drop-shadow-color {
2125
+ syntax: "*";
2126
+ inherits: false;
2127
+ }
2128
+ @property --tw-drop-shadow-alpha {
2129
+ syntax: "<percentage>";
2130
+ inherits: false;
2131
+ initial-value: 100%;
2132
+ }
2133
+ @property --tw-drop-shadow-size {
2134
+ syntax: "*";
2135
+ inherits: false;
2136
+ }
2137
+ @property --tw-backdrop-blur {
2138
+ syntax: "*";
2139
+ inherits: false;
2140
+ }
2141
+ @property --tw-backdrop-brightness {
2142
+ syntax: "*";
2143
+ inherits: false;
2144
+ }
2145
+ @property --tw-backdrop-contrast {
2146
+ syntax: "*";
2147
+ inherits: false;
2148
+ }
2149
+ @property --tw-backdrop-grayscale {
2150
+ syntax: "*";
2151
+ inherits: false;
2152
+ }
2153
+ @property --tw-backdrop-hue-rotate {
2154
+ syntax: "*";
2155
+ inherits: false;
2156
+ }
2157
+ @property --tw-backdrop-invert {
2158
+ syntax: "*";
2159
+ inherits: false;
2160
+ }
2161
+ @property --tw-backdrop-opacity {
2162
+ syntax: "*";
2163
+ inherits: false;
2164
+ }
2165
+ @property --tw-backdrop-saturate {
2166
+ syntax: "*";
2167
+ inherits: false;
2168
+ }
2169
+ @property --tw-backdrop-sepia {
2170
+ syntax: "*";
2171
+ inherits: false;
2172
+ }
2173
+ @property --tw-duration {
2174
+ syntax: "*";
2175
+ inherits: false;
2176
+ }
2177
+ @property --tw-ease {
2178
+ syntax: "*";
2179
+ inherits: false;
2180
+ }
2181
+ @keyframes spin {
2182
+ to {
2183
+ transform: rotate(360deg);
2184
+ }
2185
+ }
2186
+ @keyframes pulse {
2187
+ 50% {
2188
+ opacity: 0.5;
2189
+ }
2190
+ }
2191
+ @layer properties {
2192
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
2193
+ *, ::before, ::after, ::backdrop {
2194
+ --tw-translate-x: 0;
2195
+ --tw-translate-y: 0;
2196
+ --tw-translate-z: 0;
2197
+ --tw-scale-x: 1;
2198
+ --tw-scale-y: 1;
2199
+ --tw-scale-z: 1;
2200
+ --tw-rotate-x: initial;
2201
+ --tw-rotate-y: initial;
2202
+ --tw-rotate-z: initial;
2203
+ --tw-skew-x: initial;
2204
+ --tw-skew-y: initial;
2205
+ --tw-space-y-reverse: 0;
2206
+ --tw-space-x-reverse: 0;
2207
+ --tw-divide-y-reverse: 0;
2208
+ --tw-border-style: solid;
2209
+ --tw-leading: initial;
2210
+ --tw-font-weight: initial;
2211
+ --tw-tracking: initial;
2212
+ --tw-shadow: 0 0 #0000;
2213
+ --tw-shadow-color: initial;
2214
+ --tw-shadow-alpha: 100%;
2215
+ --tw-inset-shadow: 0 0 #0000;
2216
+ --tw-inset-shadow-color: initial;
2217
+ --tw-inset-shadow-alpha: 100%;
2218
+ --tw-ring-color: initial;
2219
+ --tw-ring-shadow: 0 0 #0000;
2220
+ --tw-inset-ring-color: initial;
2221
+ --tw-inset-ring-shadow: 0 0 #0000;
2222
+ --tw-ring-inset: initial;
2223
+ --tw-ring-offset-width: 0px;
2224
+ --tw-ring-offset-color: #fff;
2225
+ --tw-ring-offset-shadow: 0 0 #0000;
2226
+ --tw-outline-style: solid;
2227
+ --tw-blur: initial;
2228
+ --tw-brightness: initial;
2229
+ --tw-contrast: initial;
2230
+ --tw-grayscale: initial;
2231
+ --tw-hue-rotate: initial;
2232
+ --tw-invert: initial;
2233
+ --tw-opacity: initial;
2234
+ --tw-saturate: initial;
2235
+ --tw-sepia: initial;
2236
+ --tw-drop-shadow: initial;
2237
+ --tw-drop-shadow-color: initial;
2238
+ --tw-drop-shadow-alpha: 100%;
2239
+ --tw-drop-shadow-size: initial;
2240
+ --tw-backdrop-blur: initial;
2241
+ --tw-backdrop-brightness: initial;
2242
+ --tw-backdrop-contrast: initial;
2243
+ --tw-backdrop-grayscale: initial;
2244
+ --tw-backdrop-hue-rotate: initial;
2245
+ --tw-backdrop-invert: initial;
2246
+ --tw-backdrop-opacity: initial;
2247
+ --tw-backdrop-saturate: initial;
2248
+ --tw-backdrop-sepia: initial;
2249
+ --tw-duration: initial;
2250
+ --tw-ease: initial;
2251
+ }
2252
+ }
2253
+ }
2254
+ `,lt=0;function I(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--lt,__i:-1,__u:0,__source:i,__self:a};if(typeof e==`function`&&(o=e.defaultProps))for(s in o)c[s]===void 0&&(c[s]=o[s]);return D.vnode&&D.vnode(l),l}var ut=(e=>(e[e.Degree0=0]=`Degree0`,e[e.Degree90=1]=`Degree90`,e[e.Degree180=2]=`Degree180`,e[e.Degree270=3]=`Degree270`,e))(ut||{});function dt(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function ft(e){return{width:Math.ceil(e.width),height:Math.ceil(e.height)}}function pt(e){return{origin:dt(e.origin),size:ft(e.size)}}function mt(e){let{width:t,height:n}=e;return{width:n,height:t}}function ht(e,t,n){return{width:(e=t%2==0?e:mt(e)).width*n,height:e.height*n}}function gt(e){let t=[e.p1.x,e.p2.x,e.p3.x,e.p4.x],n=[e.p1.y,e.p2.y,e.p3.y,e.p4.y];return{origin:{x:Math.min(...t),y:Math.min(...n)},size:{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}}}function _t(e){return{p1:{x:e.origin.x,y:e.origin.y},p2:{x:e.origin.x+e.size.width,y:e.origin.y},p3:{x:e.origin.x+e.size.width,y:e.origin.y+e.size.height},p4:{x:e.origin.x,y:e.origin.y+e.size.height}}}function vt(e,t,n){let r=t.x,i=t.y;switch(n){case 0:r=t.x,i=t.y;break;case 1:r=e.height-t.y,i=t.x;break;case 2:r=e.width-t.x,i=e.height-t.y;break;case 3:r=t.y,i=e.width-t.x}return{x:r,y:i}}function yt(e,t){return{x:e.x*t,y:e.y*t}}function bt(e){if(e.length===0)return{origin:{x:0,y:0},size:{width:0,height:0}};let t=e.map(e=>e.x),n=e.map(e=>e.y),r=Math.min(...t),i=Math.min(...n);return{origin:{x:r,y:i},size:{width:Math.max(...t)-r,height:Math.max(...n)-i}}}function xt(e,t,n){let r=Math.cos(t),i=Math.sin(t),a=e.x*r-e.y*i,o=e.x*i+e.y*r;return{x:a+n.x,y:o+n.y}}function St(e,t){return{origin:{x:e.origin.x-t,y:e.origin.y-t},size:{width:e.size.width+2*t,height:e.size.height+2*t}}}function Ct(e,t,n){let r=t.origin.x,i=t.origin.y,a=t.size;switch(n){case 0:break;case 1:r=e.height-t.origin.y-t.size.height,i=t.origin.x,a=mt(t.size);break;case 2:r=e.width-t.origin.x-t.size.width,i=e.height-t.origin.y-t.size.height;break;case 3:r=t.origin.y,i=e.width-t.origin.x-t.size.width,a=mt(t.size)}return{origin:{x:r,y:i},size:{width:a.width,height:a.height}}}function wt(e,t){return{origin:{x:e.origin.x*t,y:e.origin.y*t},size:{width:e.size.width*t,height:e.size.height*t}}}function Tt(e,t,n,r){return wt(Ct(e,t,n),r)}var Et={origin:{x:0,y:0},size:{width:0,height:0}};function Dt(e){if(e.length===0)return null;let t=e[0].origin.x,n=e[0].origin.y,r=e[0].origin.x+e[0].size.width,i=e[0].origin.y+e[0].size.height;for(let a of e)t=Math.min(t,a.origin.x),n=Math.min(n,a.origin.y),r=Math.max(r,a.origin.x+a.size.width),i=Math.max(i,a.origin.y+a.size.height);return{origin:{x:t,y:n},size:{width:r-t,height:i-n}}}function Ot(e){let t=e%360;return t<0?t+360:t}function kt(e){return{x:e.origin.x+e.size.width/2,y:e.origin.y+e.size.height/2}}function At(e,t,n){let r=n*Math.PI/180,i=Math.cos(r),a=Math.sin(r),o=e.x-t.x,s=e.y-t.y;return{x:t.x+o*i-s*a,y:t.y+o*a+s*i}}function jt(e,t,n){return e.map(e=>At(e,t,n))}function Mt(e,t,n){return bt(jt([{x:e.origin.x,y:e.origin.y},{x:e.origin.x+e.size.width,y:e.origin.y},{x:e.origin.x+e.size.width,y:e.origin.y+e.size.height},{x:e.origin.x,y:e.origin.y+e.size.height}],n,t))}function Nt(e,t){return Mt(e,t,kt(e))}function Pt(e,t,n){let r=n*Math.PI/180,i=Math.cos(r),a=Math.sin(r),o=1-i,s=a,c=-a,l=1-i,u=o*l-s*c,d=kt(e);if(Math.abs(u)<1e-10)return d;let f=kt(t),p=f.x-(i*d.x-a*d.y),m=f.y-(a*d.x+i*d.y);return{x:(l*p-s*m)/u,y:(-c*p+o*m)/u}}function Ft(e,t,n,r){let i=e.origin.x,a=e.origin.y,o=e.size.width,s=e.size.height,c=n/o,l=r/s,u=n/s,d=r/o;switch(t){case 0:return{a:c,b:0,c:0,d:l,e:-c*i,f:-l*a};case 3:return{a:0,b:-d,c:u,d:0,e:-u*a,f:d*(i+o)};case 2:return{a:-c,b:0,c:0,d:-l,e:c*(i+o),f:l*(a+s)};case 1:return{a:0,b:d,c:-u,d:0,e:u*(a+s),f:-d*i}}}function It(e,t){let n=Math.min(t.width/e.width,t.height/e.height,1);return{width:e.width*n,height:e.height*n}}var Lt=class{isEnabled(){return!1}debug(){}info(){}warn(){}error(){}perf(){}},Rt=class{isEnabled(){return!0}debug(e,t,...n){console.debug(`${e}.${t}`,...n)}info(e,t,...n){console.info(`${e}.${t}`,...n)}warn(e,t,...n){console.warn(`${e}.${t}`,...n)}error(e,t,...n){console.error(`${e}.${t}`,...n)}perf(e,t,n,r,...i){console.info(`${e}.${t}.${n}.${r}`,...i)}},zt=class{constructor(e,t){this.logger=e,this.level=t}isEnabled(e){return this.level<={debug:0,info:1,warn:2,error:3}[e]}debug(e,t,...n){this.level<=0&&this.logger.debug(e,t,...n)}info(e,t,...n){this.level<=1&&this.logger.info(e,t,...n)}warn(e,t,...n){this.level<=2&&this.logger.warn(e,t,...n)}error(e,t,...n){this.level<=3&&this.logger.error(e,t,...n)}perf(e,t,n,r,...i){this.logger.perf(e,t,n,r,...i)}},Bt=class{constructor(){this.marks=new Map}isEnabled(){return!1}debug(e,t,...n){}info(e,t,...n){}warn(e,t,...n){}error(e,t,...n){}perf(e,t,n,r,i,...a){let o=`${e}.${t}.${n}.${r}.${i}`;switch(r){case`Begin`:globalThis.performance.mark(o,{detail:a}),this.marks.set(`${e}.${t}.${n}.${i}`,Date.now());break;case`End`:globalThis.performance.mark(o,{detail:a});let r=`${e}.${t}.${n}.Measure.${i}`,s=`${e}.${t}.${n}.Begin.${i}`;globalThis.performance.measure(r,s,o);let c=this.marks.get(`${e}.${t}.${n}.${i}`);if(c){let r=Date.now()-c;console.info(`⏱️ ${e}.${t}.${n}.${i}: ${r}ms`),this.marks.delete(`${e}.${t}.${n}.${i}`)}}}},Vt=class{constructor(e){this.loggers=e}isEnabled(e){return this.loggers.some(t=>t.isEnabled(e))}debug(e,t,...n){for(let r of this.loggers)r.debug(e,t,...n)}info(e,t,...n){for(let r of this.loggers)r.info(e,t,...n)}warn(e,t,...n){for(let r of this.loggers)r.warn(e,t,...n)}error(e,t,...n){for(let r of this.loggers)r.error(e,t,...n)}perf(e,t,n,r,...i){for(let a of this.loggers)a.perf(e,t,n,r,...i)}},Ht=(e=>(e[e.Pending=0]=`Pending`,e[e.Resolved=1]=`Resolved`,e[e.Rejected=2]=`Rejected`,e[e.Aborted=3]=`Aborted`,e))(Ht||{}),Ut=class extends Error{constructor(e){super(`Task aborted: ${JSON.stringify(e)}`),this.name=`TaskAbortedError`,this.reason=e}},Wt=class extends Error{constructor(e){super(`Task rejected: ${JSON.stringify(e)}`),this.name=`TaskRejectedError`,this.reason=e}},L=class e{constructor(){this.state={stage:0},this.resolvedCallbacks=[],this.rejectedCallbacks=[],this._promise=null,this.progressCbs=[]}toPromise(){return this._promise||=new Promise((e,t)=>{this.wait(t=>e(t),e=>{e.type===`abort`?t(new Ut(e.reason)):t(new Wt(e.reason))})}),this._promise}wait(e,t){switch(this.state.stage){case 0:this.resolvedCallbacks.push(e),this.rejectedCallbacks.push(t);break;case 1:e(this.state.result);break;case 2:t({type:`reject`,reason:this.state.reason});break;case 3:t({type:`abort`,reason:this.state.reason})}}resolve(e){if(this.state.stage===0){this.state={stage:1,result:e};for(let t of this.resolvedCallbacks)try{t(e)}catch{}this.resolvedCallbacks=[],this.rejectedCallbacks=[]}}reject(e){if(this.state.stage===0){this.state={stage:2,reason:e};for(let t of this.rejectedCallbacks)try{t({type:`reject`,reason:e})}catch{}this.resolvedCallbacks=[],this.rejectedCallbacks=[]}}abort(e){if(this.state.stage===0){this.state={stage:3,reason:e};for(let t of this.rejectedCallbacks)try{t({type:`abort`,reason:e})}catch{}this.resolvedCallbacks=[],this.rejectedCallbacks=[]}}fail(e){e.type===`abort`?this.abort(e.reason):this.reject(e.reason)}onProgress(e){this.progressCbs.push(e)}progress(e){for(let t of this.progressCbs)t(e)}static all(t){let n=new e;if(t.length===0)return n.resolve([]),n;let r=Array(t.length),i=0,a=!1;return t.forEach((e,o)=>{e.wait(e=>{a||(r[o]=e,i++,i===t.length&&(a=!0,n.resolve(r)))},e=>{a||(a=!0,e.type===`abort`?n.abort(e.reason):n.reject(e.reason))})}),n}static allSettled(t){let n=new e;if(t.length===0)return n.resolve([]),n;let r=Array(t.length),i=0;return t.forEach((e,a)=>{e.wait(e=>{r[a]={status:`resolved`,value:e},i++,i===t.length&&n.resolve(r)},e=>{r[a]={status:e.type===`abort`?`aborted`:`rejected`,reason:e.reason},i++,i===t.length&&n.resolve(r)})}),n}static race(t){let n=new e;if(t.length===0)return n.reject(`No tasks provided`),n;let r=!1;return t.forEach(e=>{e.wait(e=>{r||(r=!0,n.resolve(e))},e=>{r||(r=!0,e.type===`abort`?n.abort(e.reason):n.reject(e.reason))})}),n}static withProgress(t,n){let r=e.all(t);if(n){let e=0;t.forEach(r=>{r.wait(()=>{e++,n(e,t.length)},()=>{e++,n(e,t.length)})})}return r}},Gt=Object.freeze([`­`,`​`,`⁠`,``,`￾`,`￿`]),Kt=RegExp(`[${Gt.join(``)}]`,`g`);function qt(e){return e.replace(Kt,``)}var Jt=(e=>(e[e.Unknown=0]=`Unknown`,e[e.XYZ=1]=`XYZ`,e[e.FitPage=2]=`FitPage`,e[e.FitHorizontal=3]=`FitHorizontal`,e[e.FitVertical=4]=`FitVertical`,e[e.FitRectangle=5]=`FitRectangle`,e[e.FitBoundingBox=6]=`FitBoundingBox`,e[e.FitBoundingBoxHorizontal=7]=`FitBoundingBoxHorizontal`,e[e.FitBoundingBoxVertical=8]=`FitBoundingBoxVertical`,e))(Jt||{}),Yt=(e=>(e[e.NotSet=0]=`NotSet`,e[e.True=1]=`True`,e[e.False=2]=`False`,e[e.Unknown=3]=`Unknown`,e))(Yt||{}),Xt=(e=>(e[e.Unknown=-1]=`Unknown`,e[e.Courier=0]=`Courier`,e[e.Courier_Bold=1]=`Courier_Bold`,e[e.Courier_BoldOblique=2]=`Courier_BoldOblique`,e[e.Courier_Oblique=3]=`Courier_Oblique`,e[e.Helvetica=4]=`Helvetica`,e[e.Helvetica_Bold=5]=`Helvetica_Bold`,e[e.Helvetica_BoldOblique=6]=`Helvetica_BoldOblique`,e[e.Helvetica_Oblique=7]=`Helvetica_Oblique`,e[e.Times_Roman=8]=`Times_Roman`,e[e.Times_Bold=9]=`Times_Bold`,e[e.Times_BoldItalic=10]=`Times_BoldItalic`,e[e.Times_Italic=11]=`Times_Italic`,e[e.Symbol=12]=`Symbol`,e[e.ZapfDingbats=13]=`ZapfDingbats`,e))(Xt||{}),Zt=(e=>(e[e.Left=0]=`Left`,e[e.Center=1]=`Center`,e[e.Right=2]=`Right`,e))(Zt||{}),Qt=(e=>(e[e.Top=0]=`Top`,e[e.Middle=1]=`Middle`,e[e.Bottom=2]=`Bottom`,e))(Qt||{}),R=(e=>(e[e.Normal=0]=`Normal`,e[e.Multiply=1]=`Multiply`,e[e.Screen=2]=`Screen`,e[e.Overlay=3]=`Overlay`,e[e.Darken=4]=`Darken`,e[e.Lighten=5]=`Lighten`,e[e.ColorDodge=6]=`ColorDodge`,e[e.ColorBurn=7]=`ColorBurn`,e[e.HardLight=8]=`HardLight`,e[e.SoftLight=9]=`SoftLight`,e[e.Difference=10]=`Difference`,e[e.Exclusion=11]=`Exclusion`,e[e.Hue=12]=`Hue`,e[e.Saturation=13]=`Saturation`,e[e.Color=14]=`Color`,e[e.Luminosity=15]=`Luminosity`,e))(R||{}),$t=(e=>(e[e.Contain=0]=`Contain`,e[e.Cover=1]=`Cover`,e[e.Stretch=2]=`Stretch`,e))($t||{}),en=(e=>(e[e.Unsupported=0]=`Unsupported`,e[e.Goto=1]=`Goto`,e[e.RemoteGoto=2]=`RemoteGoto`,e[e.URI=3]=`URI`,e[e.LaunchAppOrOpenFile=4]=`LaunchAppOrOpenFile`,e))(en||{}),z=(e=>(e[e.UNKNOWN=0]=`UNKNOWN`,e[e.TEXT=1]=`TEXT`,e[e.LINK=2]=`LINK`,e[e.FREETEXT=3]=`FREETEXT`,e[e.LINE=4]=`LINE`,e[e.SQUARE=5]=`SQUARE`,e[e.CIRCLE=6]=`CIRCLE`,e[e.POLYGON=7]=`POLYGON`,e[e.POLYLINE=8]=`POLYLINE`,e[e.HIGHLIGHT=9]=`HIGHLIGHT`,e[e.UNDERLINE=10]=`UNDERLINE`,e[e.SQUIGGLY=11]=`SQUIGGLY`,e[e.STRIKEOUT=12]=`STRIKEOUT`,e[e.STAMP=13]=`STAMP`,e[e.CARET=14]=`CARET`,e[e.INK=15]=`INK`,e[e.POPUP=16]=`POPUP`,e[e.FILEATTACHMENT=17]=`FILEATTACHMENT`,e[e.SOUND=18]=`SOUND`,e[e.MOVIE=19]=`MOVIE`,e[e.WIDGET=20]=`WIDGET`,e[e.SCREEN=21]=`SCREEN`,e[e.PRINTERMARK=22]=`PRINTERMARK`,e[e.TRAPNET=23]=`TRAPNET`,e[e.WATERMARK=24]=`WATERMARK`,e[e.THREED=25]=`THREED`,e[e.RICHMEDIA=26]=`RICHMEDIA`,e[e.XFAWIDGET=27]=`XFAWIDGET`,e[e.REDACT=28]=`REDACT`,e))(z||{}),tn=(e=>(e[e.Created=0]=`Created`,e[e.Committed=1]=`Committed`,e))(tn||{}),nn=(e=>(e[e.Normal=0]=`Normal`,e[e.Rollover=1]=`Rollover`,e[e.Down=2]=`Down`,e))(nn||{}),rn=(e=>(e.Marked=`Marked`,e.Unmarked=`Unmarked`,e.Accepted=`Accepted`,e.Rejected=`Rejected`,e.Completed=`Completed`,e.Cancelled=`Cancelled`,e.None=`None`,e))(rn||{}),an=(e=>(e.Marked=`Marked`,e.Review=`Review`,e))(an||{}),on=(e=>(e[e.Unknown=-1]=`Unknown`,e[e.Comment=0]=`Comment`,e[e.Key=1]=`Key`,e[e.Note=2]=`Note`,e[e.Help=3]=`Help`,e[e.NewParagraph=4]=`NewParagraph`,e[e.Paragraph=5]=`Paragraph`,e[e.Insert=6]=`Insert`,e[e.Graph=7]=`Graph`,e[e.PushPin=8]=`PushPin`,e[e.Paperclip=9]=`Paperclip`,e[e.Tag=10]=`Tag`,e[e.Speaker=11]=`Speaker`,e[e.Mic=12]=`Mic`,e[e.Approved=13]=`Approved`,e[e.Experimental=14]=`Experimental`,e[e.NotApproved=15]=`NotApproved`,e[e.AsIs=16]=`AsIs`,e[e.Expired=17]=`Expired`,e[e.NotForPublicRelease=18]=`NotForPublicRelease`,e[e.Confidential=19]=`Confidential`,e[e.Final=20]=`Final`,e[e.Sold=21]=`Sold`,e[e.Departmental=22]=`Departmental`,e[e.ForComment=23]=`ForComment`,e[e.TopSecret=24]=`TopSecret`,e[e.Draft=25]=`Draft`,e[e.ForPublicRelease=26]=`ForPublicRelease`,e[e.Completed=27]=`Completed`,e[e.Void=28]=`Void`,e[e.PreliminaryResults=29]=`PreliminaryResults`,e[e.InformationOnly=30]=`InformationOnly`,e[e.Rejected=31]=`Rejected`,e[e.Witness=32]=`Witness`,e[e.InitialHere=33]=`InitialHere`,e[e.SignHere=34]=`SignHere`,e[e.Accepted=35]=`Accepted`,e[e.Custom=36]=`Custom`,e[e.Image=37]=`Image`,e))(on||{}),sn=on,B=(e=>(e[e.None=0]=`None`,e[e.Square=1]=`Square`,e[e.Circle=2]=`Circle`,e[e.Diamond=3]=`Diamond`,e[e.OpenArrow=4]=`OpenArrow`,e[e.ClosedArrow=5]=`ClosedArrow`,e[e.Butt=6]=`Butt`,e[e.ROpenArrow=7]=`ROpenArrow`,e[e.RClosedArrow=8]=`RClosedArrow`,e[e.Slash=9]=`Slash`,e[e.Unknown=10]=`Unknown`,e))(B||{}),cn=(e=>(e[e.Unknown=0]=`Unknown`,e[e.Reply=1]=`Reply`,e[e.Group=2]=`Group`,e))(cn||{}),V=(e=>(e[e.UNKNOWN=0]=`UNKNOWN`,e[e.PUSHBUTTON=1]=`PUSHBUTTON`,e[e.CHECKBOX=2]=`CHECKBOX`,e[e.RADIOBUTTON=3]=`RADIOBUTTON`,e[e.COMBOBOX=4]=`COMBOBOX`,e[e.LISTBOX=5]=`LISTBOX`,e[e.TEXTFIELD=6]=`TEXTFIELD`,e[e.SIGNATURE=7]=`SIGNATURE`,e[e.XFA=8]=`XFA`,e[e.XFA_CHECKBOX=9]=`XFA_CHECKBOX`,e[e.XFA_COMBOBOX=10]=`XFA_COMBOBOX`,e[e.XFA_IMAGEFIELD=11]=`XFA_IMAGEFIELD`,e[e.XFA_LISTBOX=12]=`XFA_LISTBOX`,e[e.XFA_PUSHBUTTON=13]=`XFA_PUSHBUTTON`,e[e.XFA_SIGNATURE=14]=`XFA_SIGNATURE`,e[e.XFA_TEXTFIELD=15]=`XFA_TEXTFIELD`,e))(V||{}),ln=(e=>(e[e.Color=0]=`Color`,e[e.InteriorColor=1]=`InteriorColor`,e[e.OverlayColor=2]=`OverlayColor`,e[e.TextColor=3]=`TextColor`,e))(ln||{}),un=(e=>(e[e.UNKNOWN=0]=`UNKNOWN`,e[e.SOLID=1]=`SOLID`,e[e.DASHED=2]=`DASHED`,e[e.BEVELED=3]=`BEVELED`,e[e.INSET=4]=`INSET`,e[e.UNDERLINE=5]=`UNDERLINE`,e[e.CLOUDY=6]=`CLOUDY`,e))(un||{}),dn=(e=>(e[e.NONE=0]=`NONE`,e[e.INVISIBLE=1]=`INVISIBLE`,e[e.HIDDEN=2]=`HIDDEN`,e[e.PRINT=4]=`PRINT`,e[e.NO_ZOOM=8]=`NO_ZOOM`,e[e.NO_ROTATE=16]=`NO_ROTATE`,e[e.NO_VIEW=32]=`NO_VIEW`,e[e.READ_ONLY=64]=`READ_ONLY`,e[e.LOCKED=128]=`LOCKED`,e[e.TOGGLE_NOVIEW=256]=`TOGGLE_NOVIEW`,e[e.LOCKED_CONTENTS=512]=`LOCKED_CONTENTS`,e))(dn||{}),H=(e=>(e[e.NONE=0]=`NONE`,e[e.READONLY=1]=`READONLY`,e[e.REQUIRED=2]=`REQUIRED`,e[e.NOEXPORT=4]=`NOEXPORT`,e[e.TEXT_MULTIPLINE=4096]=`TEXT_MULTIPLINE`,e[e.TEXT_PASSWORD=8192]=`TEXT_PASSWORD`,e[e.TEXT_FILESELECT=1048576]=`TEXT_FILESELECT`,e[e.TEXT_DONOTSPELLCHECK=4194304]=`TEXT_DONOTSPELLCHECK`,e[e.TEXT_DONOTSCROLL=8388608]=`TEXT_DONOTSCROLL`,e[e.TEXT_COMB=16777216]=`TEXT_COMB`,e[e.TEXT_RICHTEXT=33554432]=`TEXT_RICHTEXT`,e[e.BUTTON_NOTOGGLETOOFF=16384]=`BUTTON_NOTOGGLETOOFF`,e[e.BUTTON_RADIO=32768]=`BUTTON_RADIO`,e[e.BUTTON_PUSHBUTTON=65536]=`BUTTON_PUSHBUTTON`,e[e.BUTTON_RADIOSINUNISON=33554432]=`BUTTON_RADIOSINUNISON`,e[e.CHOICE_COMBO=131072]=`CHOICE_COMBO`,e[e.CHOICE_EDIT=262144]=`CHOICE_EDIT`,e[e.CHOICE_SORT=524288]=`CHOICE_SORT`,e[e.CHOICE_MULTL_SELECT=2097152]=`CHOICE_MULTL_SELECT`,e[e.CHOICE_DONOTSPELLCHECK=4194304]=`CHOICE_DONOTSPELLCHECK`,e[e.CHOICE_COMMITONSELCHANGE=67108864]=`CHOICE_COMMITONSELCHANGE`,e))(H||{}),fn=(e=>(e[e.UNKNOWN=0]=`UNKNOWN`,e[e.TEXT=1]=`TEXT`,e[e.PATH=2]=`PATH`,e[e.IMAGE=3]=`IMAGE`,e[e.SHADING=4]=`SHADING`,e[e.FORM=5]=`FORM`,e))(fn||{}),pn=Object.freeze({1:`invisible`,2:`hidden`,4:`print`,8:`noZoom`,16:`noRotate`,32:`noView`,64:`readOnly`,128:`locked`,256:`toggleNoView`,512:`lockedContents`}),mn=Object.entries(pn).reduce((e,[t,n])=>(e[n]=Number(t),e),{});function hn(e){return Object.keys(pn).filter(t=>(e&t)!==0).map(e=>pn[e])}function gn(e){return e.reduce((e,t)=>e|mn[t],0)}function _n(e){return e.exportValue!=null&&e.field.value===e.exportValue}var vn=(e=>(e[e.KEY_STROKE=12]=`KEY_STROKE`,e[e.FORMAT=13]=`FORMAT`,e[e.VALIDATE=14]=`VALIDATE`,e[e.CALCULATE=15]=`CALCULATE`,e))(vn||{}),yn=(e=>(e.Keystroke=`keystroke`,e.Format=`format`,e.Validate=`validate`,e.Calculate=`calculate`,e))(yn||{}),bn=(e=>(e.DocumentNamed=`document_named`,e.WidgetKeystroke=`widget_keystroke`,e.WidgetFormat=`widget_format`,e.WidgetValidate=`widget_validate`,e.WidgetCalculate=`widget_calculate`,e))(bn||{}),xn=(e=>(e[e.Create=0]=`Create`,e[e.Read=1]=`Read`,e[e.Update=2]=`Update`,e[e.Delete=3]=`Delete`,e))(xn||{}),Sn=(e=>(e[e.None=0]=`None`,e[e.MatchCase=1]=`MatchCase`,e[e.MatchWholeWord=2]=`MatchWholeWord`,e[e.MatchConsecutive=4]=`MatchConsecutive`,e))(Sn||{}),U=(e=>(e[e.Print=4]=`Print`,e[e.ModifyContents=8]=`ModifyContents`,e[e.CopyContents=16]=`CopyContents`,e[e.ModifyAnnotations=32]=`ModifyAnnotations`,e[e.FillForms=256]=`FillForms`,e[e.ExtractForAccessibility=512]=`ExtractForAccessibility`,e[e.AssembleDocument=1024]=`AssembleDocument`,e[e.PrintHighQuality=2048]=`PrintHighQuality`,e[e.AllowAll=3900]=`AllowAll`,e))(U||{}),Cn=class extends Error{constructor(e,t){let n=e.map(e=>U[e]).join(`, `);super(`Permission denied. Required: ${n}`),this.requiredFlags=e,this.currentPermissions=t,this.name=`PermissionDeniedError`}},wn=(e=>(e[e.Display=0]=`Display`,e[e.Print=1]=`Print`,e))(wn||{}),W=(e=>(e[e.Ok=0]=`Ok`,e[e.Unknown=1]=`Unknown`,e[e.NotFound=2]=`NotFound`,e[e.WrongFormat=3]=`WrongFormat`,e[e.Password=4]=`Password`,e[e.Security=5]=`Security`,e[e.PageError=6]=`PageError`,e[e.XFALoad=7]=`XFALoad`,e[e.XFALayout=8]=`XFALayout`,e[e.Cancelled=9]=`Cancelled`,e[e.Initialization=10]=`Initialization`,e[e.NotReady=11]=`NotReady`,e[e.NotSupport=12]=`NotSupport`,e[e.LoadDoc=13]=`LoadDoc`,e[e.DocNotOpen=14]=`DocNotOpen`,e[e.CantCloseDoc=15]=`CantCloseDoc`,e[e.CantCreateNewDoc=16]=`CantCreateNewDoc`,e[e.CantImportPages=17]=`CantImportPages`,e[e.CantCreateAnnot=18]=`CantCreateAnnot`,e[e.CantSetAnnotRect=19]=`CantSetAnnotRect`,e[e.CantSetAnnotContent=20]=`CantSetAnnotContent`,e[e.CantRemoveInkList=21]=`CantRemoveInkList`,e[e.CantAddInkStoke=22]=`CantAddInkStoke`,e[e.CantReadAttachmentSize=23]=`CantReadAttachmentSize`,e[e.CantReadAttachmentContent=24]=`CantReadAttachmentContent`,e[e.CantFocusAnnot=25]=`CantFocusAnnot`,e[e.CantSelectText=26]=`CantSelectText`,e[e.CantSelectOption=27]=`CantSelectOption`,e[e.CantCheckField=28]=`CantCheckField`,e[e.CantSetAnnotString=29]=`CantSetAnnotString`,e[e.CantDeletePage=30]=`CantDeletePage`,e))(W||{}),G=class{static create(){return new L}static resolve(e){let t=new L;return t.resolve(e),t}static reject(e){let t=new L;return t.reject(e),t}static abort(e){let t=new L;return t.reject(e),t}};function Tn(e){let t=e=>(e=>Math.max(0,Math.min(255,e)))(e).toString(16).padStart(2,`0`);return`#${t(e.red)}${t(e.green)}${t(e.blue)}`}function En(e){/^#?[0-9a-f]{3}$/i.test(e)&&(e=e.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,`#$1$1$2$2$3$3`).toLowerCase());let[,t,n,r]=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e)??(()=>{throw Error(`Invalid hex colour: "${e}"`)})();return{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16)}}function Dn(e){return(e=>Math.max(0,Math.min(255,e)))(e)/255}function On(e){return((e,t=255)=>Math.max(0,Math.min(t,e)))(Math.round(255*e))}function kn(e){if(!e?.startsWith(`D:`)||e.length<16)return;let t=+e.slice(2,6),n=e.slice(6,8)-1,r=+e.slice(8,10),i=+e.slice(10,12),a=+e.slice(12,14),o=+e.slice(14,16);return new Date(Date.UTC(t,n,r,i,a,o))}function An(e=new Date){let t=(e,t=2)=>e.toString().padStart(t,`0`);return`D:${e.getUTCFullYear()}${t(e.getUTCMonth()+1)}${t(e.getUTCDate())}${t(e.getUTCHours())}${t(e.getUTCMinutes())}${t(e.getUTCSeconds())}`}var jn=Object.freeze([{id:Zt.Left,label:`Left`,css:`left`},{id:Zt.Center,label:`Center`,css:`center`},{id:Zt.Right,label:`Right`,css:`right`}]),Mn=jn.reduce((e,t)=>(e[t.id]=t,e),{});function Nn(e){return function(e){return Mn[e]??Mn[Zt.Left]}(e).css}jn.reduce((e,t)=>(e[t.css]=t.id,e),{}),jn.map(e=>({value:e.id,label:e.label}));var Pn=(e=>(e.Courier=`Courier`,e.Helvetica=`Helvetica`,e.Times=`Times`,e.Symbol=`Symbol`,e.ZapfDingbats=`ZapfDingbats`,e.Unknown=`Unknown`,e))(Pn||{}),Fn=Xt.Helvetica,In={id:Xt.Helvetica,family:`Helvetica`,bold:!1,italic:!1,label:`Helvetica`,css:`Helvetica, Arial, sans-serif`},Ln=Object.freeze([{id:Xt.Courier,family:`Courier`,bold:!1,italic:!1,label:`Courier`,css:`Courier, monospace`},{id:Xt.Courier_Bold,family:`Courier`,bold:!0,italic:!1,label:`Courier Bold`,css:`Courier, monospace`},{id:Xt.Courier_BoldOblique,family:`Courier`,bold:!0,italic:!0,label:`Courier Bold Oblique`,css:`Courier, monospace`},{id:Xt.Courier_Oblique,family:`Courier`,bold:!1,italic:!0,label:`Courier Oblique`,css:`Courier, monospace`},In,{id:Xt.Helvetica_Bold,family:`Helvetica`,bold:!0,italic:!1,label:`Helvetica Bold`,css:`Helvetica, Arial, sans-serif`},{id:Xt.Helvetica_BoldOblique,family:`Helvetica`,bold:!0,italic:!0,label:`Helvetica Bold Oblique`,css:`Helvetica, Arial, sans-serif`},{id:Xt.Helvetica_Oblique,family:`Helvetica`,bold:!1,italic:!0,label:`Helvetica Oblique`,css:`Helvetica, Arial, sans-serif`},{id:Xt.Times_Roman,family:`Times`,bold:!1,italic:!1,label:`Times Roman`,css:`"Times New Roman", Times, serif`},{id:Xt.Times_Bold,family:`Times`,bold:!0,italic:!1,label:`Times Bold`,css:`"Times New Roman", Times, serif`},{id:Xt.Times_BoldItalic,family:`Times`,bold:!0,italic:!0,label:`Times Bold Italic`,css:`"Times New Roman", Times, serif`},{id:Xt.Times_Italic,family:`Times`,bold:!1,italic:!0,label:`Times Italic`,css:`"Times New Roman", Times, serif`},{id:Xt.Symbol,family:`Symbol`,bold:!1,italic:!1,label:`Symbol`,css:`Symbol, serif`},{id:Xt.ZapfDingbats,family:`ZapfDingbats`,bold:!1,italic:!1,label:`Zapf Dingbats`,css:`ZapfDingbats, serif`}]),Rn=Ln.reduce((e,t)=>(e[t.id]=t,e),{}),zn=new Map;for(let e of Ln)zn.set(`${e.family}_${e.bold}_${e.italic}`,e.id);function Bn(e){return Rn[e]??In}function Vn(e){return Bn(e).family}function Hn(e){return Bn(e).bold}function Un(e){return Bn(e).italic}function Wn(e,{bold:t,italic:n}){return zn.get(`${e}_${t}_${n}`)??Fn}function Gn(e){let t=Bn(e);return{fontFamily:t.css,fontWeight:t.bold?`bold`:`normal`,fontStyle:t.italic?`italic`:`normal`}}Object.values(Pn).filter(e=>e!==`Unknown`).map(e=>({value:e,label:e}));var Kn=[...new Set(Ln.map(e=>e.family))];function qn(e){switch(e){case`Courier`:return`Courier`;case`Helvetica`:default:return`Helvetica`;case`Times`:return`Times`;case`Symbol`:return`Symbol`;case`ZapfDingbats`:return`ZapfDingbats`}}var Jn=Object.freeze([{id:R.Normal,label:`Normal`,css:`normal`},{id:R.Multiply,label:`Multiply`,css:`multiply`},{id:R.Screen,label:`Screen`,css:`screen`},{id:R.Overlay,label:`Overlay`,css:`overlay`},{id:R.Darken,label:`Darken`,css:`darken`},{id:R.Lighten,label:`Lighten`,css:`lighten`},{id:R.ColorDodge,label:`Color Dodge`,css:`color-dodge`},{id:R.ColorBurn,label:`Color Burn`,css:`color-burn`},{id:R.HardLight,label:`Hard Light`,css:`hard-light`},{id:R.SoftLight,label:`Soft Light`,css:`soft-light`},{id:R.Difference,label:`Difference`,css:`difference`},{id:R.Exclusion,label:`Exclusion`,css:`exclusion`},{id:R.Hue,label:`Hue`,css:`hue`},{id:R.Saturation,label:`Saturation`,css:`saturation`},{id:R.Color,label:`Color`,css:`color`},{id:R.Luminosity,label:`Luminosity`,css:`luminosity`}]),Yn=Jn.reduce((e,t)=>(e[t.id]=t,e),{});function Xn(e){return function(e){return Yn[e]??Yn[R.Normal]}(e).css}Jn.reduce((e,t)=>(e[t.css]=t.id,e),{}),Jn.map(e=>({value:e.id,label:e.label}));var Zn=Jn.map(e=>e.id);function Qn(e){if(e instanceof Lt)return{type:`noop`};if(e instanceof Rt)return{type:`console`};if(e instanceof Bt)return{type:`perf`};if(e instanceof zt){let t=e;return{type:`level`,config:{level:t.level,logger:Qn(t.logger)}}}return e instanceof Vt?{type:`all`,config:{loggers:e.loggers.map(Qn)}}:{type:`noop`}}function K(){if(typeof globalThis.crypto?.randomUUID==`function`)return globalThis.crypto.randomUUID();let t=function(t){if(typeof globalThis.crypto?.getRandomValues==`function`)return globalThis.crypto.getRandomValues(new Uint8Array(t));if(typeof e==`function`)try{let{randomBytes:e}=r();return e(t)}catch{}let n=new Uint8Array(t);for(let e=0;e<t;e++)n[e]=Math.floor(256*Math.random());return n}(16);t[6]=15&t[6]|64,t[8]=63&t[8]|128;let n=Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}var $n=class e extends L{constructor(e={}){super(),this.children=new Map,this.childResults=[],this.completedCount=0,this.expectedCount=0,this.isFinalized=!1,this.config={aggregate:e.aggregate??(e=>e),onChildComplete:e.onChildComplete??(()=>{}),failFast:e.failFast??!0}}addChild(e,t){if(this.state.stage!==Ht.Pending)return this.state.stage===Ht.Aborted&&e.abort(this.state.reason),this;let n=t??this.expectedCount;return this.expectedCount=Math.max(this.expectedCount,n+1),this.children.set(e,n),e.wait(t=>this.handleChildSuccess(e,t,n),t=>this.handleChildError(e,t,n)),this}finalize(){return this.isFinalized||(this.isFinalized=!0,this.expectedCount===0&&this.resolve(this.config.aggregate([]))),this}handleChildSuccess(e,t,n){if(this.state.stage!==Ht.Pending)return;this.childResults[n]=t,this.completedCount++,this.children.delete(e);let r=this.config.onChildComplete(this.completedCount,this.expectedCount,t,n);if(r!==void 0&&this.progress(r),this.completedCount===this.expectedCount){let e=this.config.aggregate(this.childResults);this.resolve(e)}}handleChildError(e,t,n){if(this.state.stage===Ht.Pending){if(this.children.delete(e),this.config.failFast){for(let[e]of this.children)e.abort(`Sibling task failed`);this.children.clear(),this.fail(t)}else if(this.childResults[n]=void 0,this.completedCount++,this.completedCount===this.expectedCount){let e=this.config.aggregate(this.childResults);this.resolve(e)}}}abort(e){for(let[t]of this.children)t.abort(e);this.children.clear(),super.abort(e)}reject(e){for(let[t]of this.children)t.abort(e);this.children.clear(),super.reject(e)}getPendingCount(){return this.children.size}getCompletedCount(){return this.completedCount}static gather(t){let n=new e({aggregate:e=>e,onChildComplete:(e,t)=>({completed:e,total:t})});return t.forEach((e,t)=>n.addChild(e,t)),n.finalize(),n}static gatherIndexed(t){let n=new e({aggregate:e=>{let t={};return e.forEach((e,n)=>{t[n]=e}),t},onChildComplete:(e,t,n,r)=>({page:r,result:n})});return t.forEach((e,t)=>n.addChild(e,t)),n.finalize(),n}static gatherFrom(t,n){let r=new e(n);return t.forEach((e,t)=>r.addChild(e,t)),r.finalize(),r}static first(t){let n=!1,r=new e({aggregate:e=>e[0],failFast:!1});return r.handleChildSuccess=(e,t)=>{if(!n){n=!0;for(let[t]of r.children)t!==e&&t.abort(`Race won by sibling`);r.resolve(t)}},t.forEach((e,t)=>r.addChild(e,t)),r.finalize(),r}},er=class{constructor(e){this.parentTask=e,this.activeChild=null,this.disposed=!1;let t=e.abort.bind(e);e.abort=e=>{var n;this.disposed=!0,(n=this.activeChild)==null||n.abort(e),t(e)}}run(e){return new Promise((t,n)=>{if(this.disposed||this.parentTask.state.stage!==Ht.Pending)return void n(new Ut(`Sequence aborted`));let r=e();this.activeChild=r,r.wait(e=>{this.activeChild=null,t(e)},e=>{this.activeChild=null,e.type===`abort`?n(new Ut(e.reason)):n(new Wt(e.reason))})})}runWithProgress(e,t){return new Promise((n,r)=>{if(this.disposed||this.parentTask.state.stage!==Ht.Pending)return void r(new Ut(`Sequence aborted`));let i=e();this.activeChild=i,i.onProgress(e=>{this.parentTask.progress(t(e))}),i.wait(e=>{this.activeChild=null,n(e)},e=>{this.activeChild=null,e.type===`abort`?r(new Ut(e.reason)):r(new Wt(e.reason))})})}execute(e,t){e().catch(e=>{e instanceof Ut||(e instanceof Wt?this.parentTask.reject(e.reason):this.parentTask.reject(t(e)))})}};function tr(e){if(e.byteLength<4)return null;let t=new Uint8Array(e);return t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71?function(e){if(e.byteLength<24)return null;let t=new DataView(e),n=t.getUint32(16),r=t.getUint32(20);return n===0||r===0?null:{mimeType:`image/png`,width:n,height:r}}(e):t[0]===255&&t[1]===216&&t[2]===255?function(e){let t=new Uint8Array(e),n=2;for(;n+4<t.byteLength;){if(t[n]!==255)return null;let r=t[n+1];if(r>=192&&r<=195){if(n+9>t.byteLength)return null;let r=new DataView(e,n+5),i=r.getUint16(0),a=r.getUint16(2);return a===0||i===0?null:{mimeType:`image/jpeg`,width:a,height:i}}n+=r===216||r===217?2:r===255?1:2+(t[n+2]<<8|t[n+3])}return null}(e):t[0]===37&&t[1]===80&&t[2]===68&&t[3]===70?{mimeType:`application/pdf`}:null}function nr(){}var rr=class{constructor(){this.dependencyGraph=new Map}addNode(e,t=[]){this.dependencyGraph.set(e,new Set(t))}hasCircularDependencies(){let e=new Set,t=new Set,n=r=>{e.add(r),t.add(r);let i=this.dependencyGraph.get(r)||new Set;for(let r of i)if(e.has(r)){if(t.has(r))return!0}else if(n(r))return!0;return t.delete(r),!1};for(let t of this.dependencyGraph.keys())if(!e.has(t)&&n(t))return!0;return!1}resolveLoadOrder(){if(this.hasCircularDependencies())throw Error(`Circular dependencies detected`);let e=[],t=new Set,n=new Set,r=i=>{if(n.has(i))throw Error(`Circular dependency`);if(t.has(i))return;n.add(i);let a=this.dependencyGraph.get(i)||new Set;for(let e of a)r(e);n.delete(i),t.add(i),e.push(i)};for(let e of this.dependencyGraph.keys())t.has(e)||r(e);return e}},ir=class extends Error{constructor(e){super(e),this.name=`PluginRegistrationError`}},ar=class extends Error{constructor(e){super(e),this.name=`PluginNotFoundError`}},or=class extends Error{constructor(e){super(e),this.name=`CircularDependencyError`}},sr=class extends Error{constructor(e){super(e),this.name=`PluginConfigurationError`}},cr=class{constructor(e,t){this.store=e,this.pluginId=t}getState(){return this.store.getState().plugins[this.pluginId]}dispatch(e){return this.store.dispatchToPlugin(this.pluginId,e)}subscribeToState(e){return this.store.subscribeToPlugin(this.pluginId,(t,n,r)=>{e(t,n,r)})}onAction(e,t){return this.store.onAction(e,(e,n,r)=>{t(e,n.plugins[this.pluginId],r.plugins[this.pluginId])})}},lr=`START_LOADING_DOCUMENT`,ur=`UPDATE_DOCUMENT_LOADING_PROGRESS`,dr=`SET_DOCUMENT_LOADED`,fr=`SET_DOCUMENT_ERROR`,pr=`RETRY_LOADING_DOCUMENT`,mr=`CLOSE_DOCUMENT`,hr=`SET_ACTIVE_DOCUMENT`,gr=`REORDER_DOCUMENTS`,_r=`MOVE_DOCUMENT`,vr=`UPDATE_DOCUMENT_SECURITY`,yr=`REFRESH_PAGES`,br=`SET_SCALE`,xr=`SET_ROTATION`,Sr=[lr,ur,dr,mr,hr,fr,pr,`REFRESH_DOCUMENT`,yr,`SET_PAGES`,br,xr,`SET_DEFAULT_SCALE`,`SET_DEFAULT_ROTATION`,gr,_r,vr],Cr=(e,t,n,r,i,a,o)=>({type:lr,payload:{documentId:e,name:t,scale:n,rotation:r,passwordProvided:i,autoActivate:a,permissions:o}}),wr=(e,t)=>({type:mr,payload:{documentId:e,nextActiveDocumentId:t}}),Tr=(e,t)=>({type:yr,payload:{documentId:e,pageIndexes:t}}),Er=(e,t)=>({type:xr,payload:{rotation:e,documentId:t}}),Dr=class{constructor(e,t){this.initialCoreState=t,this.pluginReducers={},this.listeners=[],this.pluginListeners={},this.isDispatching=!1,this.state={core:t,plugins:{}},this.coreReducer=e}addPluginReducer(e,t,n){this.state.plugins[e]=n,this.pluginReducers[e]=t}dispatchToCore(e){if(!this.coreReducer)return this.getState();if(this.isDispatching)throw Error(`Reducers may not dispatch actions. To trigger cascading actions, dispatch from a listener callback instead.`);let t=this.getState();try{this.isDispatching=!0,this.state.core=this.coreReducer(this.state.core,e)}finally{this.isDispatching=!1}return this.listeners.forEach(n=>{n(e,this.getState(),t)}),this.getState()}dispatchToPlugin(e,t,n=!0){if(this.isDispatching)throw Error(`Reducers may not dispatch actions. To trigger cascading actions, dispatch from a listener callback instead.`);let r=this.getState(),i=this.pluginReducers[e];if(!i)return r.plugins[e];let a=r.plugins[e];try{this.isDispatching=!0;let n=i(a,t);this.state.plugins[e]=n}finally{this.isDispatching=!1}return n&&this.listeners.forEach(e=>{e(t,this.getState(),r)}),this.pluginListeners[e]&&this.pluginListeners[e].forEach(n=>{let r=this.getState().plugins[e];n(t,r,a)}),this.getState().plugins[e]}dispatch(e){if(this.isDispatching)throw Error(`Reducers may not dispatch actions. To trigger cascading actions, dispatch from a listener callback instead.`);let t=this.getState();try{this.isDispatching=!0,this.isCoreAction(e)&&(this.state.core=this.coreReducer(this.state.core,e));for(let n in this.pluginReducers){let r=this.pluginReducers[n],i=t.plugins[n];r&&(this.state.plugins[n]=r(i,e))}}finally{this.isDispatching=!1}return this.listeners.forEach(n=>{n(e,this.getState(),t)}),this.getState()}getState(){if(this.isDispatching)throw Error(`You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.`);return{core:{...this.state.core},plugins:{...this.state.plugins}}}subscribe(e){if(this.isDispatching)throw Error(`You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state.`);return this.listeners.push(e),()=>{if(this.isDispatching)throw Error(`You may not unsubscribe from a store listener while the reducer is executing.`);this.listeners=this.listeners.filter(t=>t!==e)}}subscribeToPlugin(e,t){if(!(e in this.state.plugins))throw Error(`Plugin state not found for plugin "${e}". Did you forget to call addPluginReducer?`);if(this.isDispatching)throw Error(`You may not call store.subscribeToPlugin() while the reducer is executing.`);return this.pluginListeners[e]||(this.pluginListeners[e]=[]),this.pluginListeners[e].push(t),()=>{if(this.isDispatching)throw Error(`You may not unsubscribe from a store listener while the reducer is executing.`);this.pluginListeners[e]=this.pluginListeners[e].filter(e=>e!==t),this.pluginListeners[e].length===0&&delete this.pluginListeners[e]}}onAction(e,t){return this.subscribe((n,r,i)=>{n.type===e&&t(n,r,i)})}getPluginStore(e){if(!(e in this.state.plugins))throw Error(`Plugin state not found for plugin "${e}". Did you forget to call addPluginReducer?`);return new cr(this,e)}isCoreAction(e){return Sr.includes(e.type)}destroy(){var e,t;this.listeners.length=0;for(let n in this.pluginListeners)(t=(e=this.pluginListeners[n])?.splice)==null||t.call(e,0);this.pluginListeners={},this.pluginReducers={},this.state.plugins={},this.state.core={...this.initialCoreState}}};U.Print,U.ModifyContents,U.CopyContents,U.ModifyAnnotations,U.FillForms,U.ExtractForAccessibility,U.AssembleDocument,U.PrintHighQuality;var Or=[U.Print,U.ModifyContents,U.CopyContents,U.ModifyAnnotations,U.FillForms,U.ExtractForAccessibility,U.AssembleDocument,U.PrintHighQuality],kr={[U.Print]:`print`,[U.ModifyContents]:`modifyContents`,[U.CopyContents]:`copyContents`,[U.ModifyAnnotations]:`modifyAnnotations`,[U.FillForms]:`fillForms`,[U.ExtractForAccessibility]:`extractForAccessibility`,[U.AssembleDocument]:`assembleDocument`,[U.PrintHighQuality]:`printHighQuality`};function Ar(e,t){if(!e)return;if(t in e)return e[t];let n=kr[t];return n&&n in e?e[n]:void 0}function jr(e,t,n){let r=e.documents[t],i=r?.permissions,a=e.globalPermissions,o=r?.document?.permissions??U.AllowAll,s=Ar(i?.overrides,n);if(s!==void 0)return s;let c=Ar(a?.overrides,n);return c===void 0?!(i?.enforceDocumentPermissions??a?.enforceDocumentPermissions??!0)||(o&n)!==0:c}function Mr(e,t){return Or.reduce((n,r)=>jr(e,t,r)?n|r:n,0)}function Nr(e,t,n){let r=e.activeDocumentId;if(r!==t)return r;if(n!==void 0)return n&&e.documents[n]?n:null;let i=e.documentOrder.indexOf(t);return i===-1?null:i>0?e.documentOrder[i-1]:i<e.documentOrder.length-1?e.documentOrder[i+1]:null}var Pr=(e,t)=>{switch(t.type){case lr:{let{documentId:n,name:r,scale:i,rotation:a,passwordProvided:o,autoActivate:s=!0,permissions:c}=t.payload,l={id:n,name:r,status:`loading`,loadingProgress:0,error:null,document:null,scale:i??e.defaultScale,rotation:a??e.defaultRotation,passwordProvided:o??!1,pageRefreshVersions:{},permissions:c,loadStartedAt:Date.now()};return{...e,documents:{...e.documents,[n]:l},documentOrder:[...e.documentOrder,n],activeDocumentId:s||!e.activeDocumentId?n:e.activeDocumentId}}case ur:{let{documentId:n,progress:r}=t.payload,i=e.documents[n];return i&&i.status===`loading`?{...e,documents:{...e.documents,[n]:{...i,loadingProgress:r}}}:e}case dr:{let{documentId:n,document:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,status:`loaded`,document:r,error:null,errorCode:void 0,errorDetails:void 0,passwordProvided:void 0,loadedAt:Date.now()}}}:e}case fr:{let{documentId:n,error:r,errorCode:i,errorDetails:a}=t.payload,o=e.documents[n];return o?{...e,documents:{...e.documents,[n]:{...o,status:`error`,error:r,errorCode:i,errorDetails:a}}}:e}case pr:{let{documentId:n,passwordProvided:r}=t.payload,i=e.documents[n];return i&&i.status===`error`?{...e,documents:{...e.documents,[n]:{...i,status:`loading`,loadingProgress:0,error:null,errorCode:void 0,errorDetails:void 0,passwordProvided:r??!1,loadStartedAt:Date.now()}}}:e}case mr:{let{documentId:n,nextActiveDocumentId:r}=t.payload,{[n]:i,...a}=e.documents;return{...e,documents:a,documentOrder:e.documentOrder.filter(e=>e!==n),activeDocumentId:Nr(e,n,r)}}case _r:{let{documentId:n,toIndex:r}=t.payload,i=function(e,t,n){let r=e.indexOf(t);if(r===-1||n<0||n>=e.length||r===n)return null;let i=[...e];return i.splice(r,1),i.splice(n,0,t),i}(e.documentOrder,n,r);return i?{...e,documentOrder:i}:e}case gr:return{...e,documentOrder:t.payload};case hr:return{...e,activeDocumentId:t.payload};case br:{let{scale:n,documentId:r}=t.payload,i=r??e.activeDocumentId;if(!i)return e;let a=e.documents[i];return a?{...e,documents:{...e.documents,[i]:{...a,scale:n}}}:e}case xr:{let{rotation:n,documentId:r}=t.payload,i=r??e.activeDocumentId;if(!i)return e;let a=e.documents[i];return a?{...e,documents:{...e.documents,[i]:{...a,rotation:n}}}:e}case yr:{let{documentId:n,pageIndexes:r}=t.payload,i=e.documents[n];if(!i)return e;let a={...i.pageRefreshVersions};for(let e of r)a[e]=(a[e]||0)+1;return{...e,documents:{...e.documents,[n]:{...i,pageRefreshVersions:a}}}}case vr:{let{documentId:n,permissions:r,isOwnerUnlocked:i}=t.payload,a=e.documents[n];return a?.document?{...e,documents:{...e.documents,[n]:{...a,document:{...a.document,permissions:r,isOwnerUnlocked:i}}}}:e}default:return e}},Fr=class{constructor(e,t){this.plugins=new Map,this.manifests=new Map,this.capabilities=new Map,this.status=new Map,this.configurations=new Map,this.initPromise=null,this.pendingRegistrations=[],this.processingRegistrations=[],this.initialized=!1,this.isInitializing=!1,this.pluginsReadyPromise=null,this.destroyed=!1,this.resolver=new rr,this.engine=e,this.initialCoreState=(e=>({documents:{},documentOrder:[],activeDocumentId:null,defaultScale:e?.defaultScale??1,defaultRotation:e?.defaultRotation??ut.Degree0,globalPermissions:e?.permissions}))(t),this.store=new Dr(Pr,this.initialCoreState),this.logger=t?.logger??new Lt}getLogger(){return this.logger}registerPlugin(e,t){if(this.initialized&&!this.isInitializing)throw new ir(`Cannot register plugins after initialization`);this.validateManifest(e.manifest),this.store.addPluginReducer(e.manifest.id,e.reducer,typeof e.initialState==`function`?e.initialState(this.initialCoreState,{...e.manifest.defaultConfig,...t}):e.initialState),this.pendingRegistrations.push({package:e,config:t})}getStore(){return this.store}getEngine(){return this.engine}pluginsReady(){return this.pluginsReadyPromise||=(async()=>{this.initialized||await this.initialize();let e=Array.from(this.plugins.values()).map(e=>typeof e.ready==`function`?e.ready():Promise.resolve());await Promise.all(e)})(),this.pluginsReadyPromise}async initialize(){if(this.destroyed)throw new ir(`Registry has been destroyed`);return this.initPromise||=(async()=>{if(this.initialized)throw new ir(`Registry is already initialized`);this.isInitializing=!0;try{if(this.destroyed)return;for(;this.pendingRegistrations.length>0;){if(this.destroyed)return;this.processingRegistrations=[...this.pendingRegistrations],this.pendingRegistrations=[];for(let e of this.processingRegistrations){let t=new Set,n=[...e.package.manifest.requires,...e.package.manifest.optional];for(let e of n){let n=this.processingRegistrations.find(t=>t.package.manifest.provides.includes(e));n&&t.add(n.package.manifest.id)}this.resolver.addNode(e.package.manifest.id,[...t])}let e=this.resolver.resolveLoadOrder();for(let t of e){let e=this.processingRegistrations.find(e=>e.package.manifest.id===t);this.instantiatePlugin(e.package.manifest,e.package.create,e.config)}for(let t of e)await this.runPluginInitialization(t);this.processingRegistrations=[],this.resolver=new rr}this.initialized=!0}catch(e){throw e instanceof Error?new or(`Failed to resolve plugin dependencies: ${e.message}`):e}finally{this.isInitializing=!1}})(),this.initPromise}instantiatePlugin(e,t,n){let r={...e.defaultConfig,...n};this.validateConfig(e.id,r,e.defaultConfig);let i=t(this,r);this.validatePlugin(i);for(let t of e.provides){if(this.capabilities.has(t))throw new ir(`Capability ${t} is already provided by plugin ${this.capabilities.get(t)}`);this.capabilities.set(t,e.id)}this.plugins.set(e.id,i),this.manifests.set(e.id,e),this.status.set(e.id,`registered`),this.configurations.set(e.id,r)}async runPluginInitialization(e){let t=this.plugins.get(e);if(!t)return;let n=this.manifests.get(e),r=this.configurations.get(e);for(let t of n.requires)if(!this.capabilities.has(t))throw new ir(`Missing required capability: ${t} for plugin ${e}`);this.logger.debug(`PluginRegistry`,`InitializePlugin`,`Initializing plugin ${e}`);try{t.initialize&&await t.initialize(r),this.status.set(e,`active`),this.logger.info(`PluginRegistry`,`PluginInitialized`,`Plugin ${e} initialized successfully`)}catch(t){throw this.status.set(e,`error`),this.logger.error(`PluginRegistry`,`InitializationFailed`,`Plugin ${e} initialization failed`,{error:t}),t}}getPluginConfig(e){let t=this.configurations.get(e);if(!t)throw new ar(`Configuration for plugin ${e} not found`);return t}validateConfig(e,t,n){let r=Object.keys(n).filter(e=>!t.hasOwnProperty(e));if(r.length>0)throw new sr(`Missing required configuration keys for plugin ${e}: ${r.join(`, `)}`)}async updatePluginConfig(e,t){let n=this.getPlugin(e);if(!n)throw new ar(`Plugin ${e} not found`);let r=this.manifests.get(e),i=this.configurations.get(e);if(!r||!i)throw new ar(`Plugin ${e} not found`);let a={...i,...t};this.validateConfig(e,a,r.defaultConfig),this.configurations.set(e,a),n.initialize&&await n.initialize(a)}registerPluginBatch(e){for(let t of e)this.registerPlugin(t.package,t.config)}async unregisterPlugin(e){let t=this.plugins.get(e);if(!t)throw new ar(`Plugin ${e} is not registered`);let n=this.manifests.get(e);if(!n)throw new ar(`Manifest for plugin ${e} not found`);for(let[t,r]of this.manifests.entries())if(t!==e&&[...r.requires,...r.optional].some(e=>n.provides.includes(e)))throw new ir(`Cannot unregister plugin ${e}: plugin ${t} depends on it`);try{t.destroy&&await t.destroy();for(let e of n.provides)this.capabilities.delete(e);this.plugins.delete(e),this.manifests.delete(e),this.status.delete(e)}catch(t){throw t instanceof Error?Error(`Failed to unregister plugin ${e}: ${t.message}`):t}}getPlugin(e){return this.plugins.get(e)||null}getCapabilityProvider(e){let t=this.capabilities.get(e);return t?this.getPlugin(t):null}hasCapability(e){return this.capabilities.has(e)}getAllPlugins(){return Array.from(this.plugins.values())}getPluginStatus(e){let t=this.status.get(e);if(!t)throw new ar(`Plugin ${e} not found`);return t}validatePlugin(e){if(!e.id)throw new ir(`Plugin must have an id`)}validateManifest(e){if(!e.id)throw new ir(`Manifest must have an id`);if(!e.name)throw new ir(`Manifest must have a name`);if(!e.version)throw new ir(`Manifest must have a version`);if(!Array.isArray(e.provides))throw new ir(`Manifest must have a provides array`);if(!Array.isArray(e.requires))throw new ir(`Manifest must have a requires array`);if(!Array.isArray(e.optional))throw new ir(`Manifest must have an optional array`)}isDestroyed(){return this.destroyed}async destroy(){if(this.destroyed)throw new ir(`Registry has already been destroyed`);this.destroyed=!0;try{await this.initPromise}catch{}for(let e of Array.from(this.plugins.values()).reverse())await e.destroy?.call(e);this.store.destroy(),this.plugins.clear(),this.manifests.clear(),this.capabilities.clear(),this.status.clear(),this.pendingRegistrations.length=0,this.processingRegistrations.length=0}};function Ir(e,t){return{package:e,config:t}}function Lr(e){return`autoMountElements`in e&&typeof e.autoMountElements==`function`}var Rr=class{constructor(e,t){if(this.id=e,this.registry=t,this.cooldownActions={},this.debouncedTimeouts={},this.unsubscribeFromState=null,this.unsubscribeFromCoreStore=null,this.unsubscribeFromStartLoadingDocument=null,this.unsubscribeFromSetDocumentLoaded=null,this.unsubscribeFromCloseDocument=null,this.unsubscribeFromSetScale=null,this.unsubscribeFromSetRotation=null,e!==this.constructor.id)throw Error(`Plugin ID mismatch: ${e} !== ${this.constructor.id}`);this.engine=this.registry.getEngine(),this.logger=this.registry.getLogger(),this.coreStore=this.registry.getStore(),this.pluginStore=this.coreStore.getPluginStore(this.id),this.unsubscribeFromState=this.pluginStore.subscribeToState((e,t,n)=>{this.onStoreUpdated(n,t)}),this.unsubscribeFromCoreStore=this.coreStore.subscribe((e,t,n)=>{this.onCoreStoreUpdated(n,t),t.core.activeDocumentId!==n.core.activeDocumentId&&this.onActiveDocumentChanged(n.core.activeDocumentId,t.core.activeDocumentId)}),this.unsubscribeFromStartLoadingDocument=this.coreStore.onAction(lr,e=>{this.onDocumentLoadingStarted(e.payload.documentId)}),this.unsubscribeFromSetDocumentLoaded=this.coreStore.onAction(dr,e=>{this.onDocumentLoaded(e.payload.documentId)}),this.unsubscribeFromCloseDocument=this.coreStore.onAction(mr,e=>{this.onDocumentClosed(e.payload.documentId)}),this.unsubscribeFromSetScale=this.coreStore.onAction(br,(e,t)=>{let n=e.payload.documentId??t.core.activeDocumentId;n&&this.onScaleChanged(n,e.payload.scale)}),this.unsubscribeFromSetRotation=this.coreStore.onAction(xr,(e,t)=>{let n=e.payload.documentId??t.core.activeDocumentId;n&&this.onRotationChanged(n,e.payload.rotation)}),this.readyPromise=new Promise(e=>{this.readyResolve=e}),this.readyResolve()}provides(){if(!this._capability){let e=this.buildCapability();this._capability=Object.freeze(e)}return this._capability}get state(){return this.pluginStore.getState()}get coreState(){return this.coreStore.getState()}getState(){return this.pluginStore.getState()}getCoreState(){return this.coreStore.getState()}dispatchCoreAction(e){return this.coreStore.dispatchToCore(e)}dispatchToAllPlugins(e){return this.coreStore.dispatch(e)}dispatch(e){return this.pluginStore.dispatch(e)}cooldownDispatch(e,t=100){let n=Date.now();return n-(this.cooldownActions[e.type]||0)>=t&&(this.cooldownActions[e.type]=n,this.dispatch(e),!0)}debouncedDispatch(e,t=100){let n=e.type;this.debouncedTimeouts[n]&&clearTimeout(this.debouncedTimeouts[n]),this.debouncedTimeouts[n]=setTimeout(()=>{this.dispatch(e),delete this.debouncedTimeouts[n]},t)}cancelDebouncedDispatch(e){this.debouncedTimeouts[e]&&(clearTimeout(this.debouncedTimeouts[e]),delete this.debouncedTimeouts[e])}subscribe(e){return this.pluginStore.subscribeToState(e)}subscribeToCoreStore(e){return this.coreStore.subscribe(e)}onStoreUpdated(e,t){}onCoreStoreUpdated(e,t){}onDocumentLoadingStarted(e){}onDocumentLoaded(e){}onDocumentClosed(e){}onActiveDocumentChanged(e,t){}onScaleChanged(e,t){}onRotationChanged(e,t){}destroy(){Object.values(this.debouncedTimeouts).forEach(e=>{clearTimeout(e)}),this.debouncedTimeouts={},this.unsubscribeFromState&&=(this.unsubscribeFromState(),null),this.unsubscribeFromCoreStore&&=(this.unsubscribeFromCoreStore(),null),this.unsubscribeFromStartLoadingDocument&&=(this.unsubscribeFromStartLoadingDocument(),null),this.unsubscribeFromSetDocumentLoaded&&=(this.unsubscribeFromSetDocumentLoaded(),null),this.unsubscribeFromCloseDocument&&=(this.unsubscribeFromCloseDocument(),null),this.unsubscribeFromSetScale&&=(this.unsubscribeFromSetScale(),null),this.unsubscribeFromSetRotation&&=(this.unsubscribeFromSetRotation(),null)}ready(){return this.readyPromise}markReady(){this.readyResolve()}resetReady(){this.readyPromise=new Promise(e=>{this.readyResolve=e})}getActiveDocumentId(){let e=this.coreState.core.activeDocumentId;if(!e)throw Error(`No active document`);return e}getActiveDocumentIdOrNull(){return this.coreState.core.activeDocumentId}getCoreDocument(e){let t=e??this.getActiveDocumentIdOrNull();return t?this.coreState.core.documents[t]??null:null}getCoreDocumentOrThrow(e){let t=this.getCoreDocument(e);if(!t)throw Error(`Document not found: ${e??`active`}`);return t}getDocumentPermissions(e){let t=e??this.coreState.core.activeDocumentId;return t?Mr(this.coreState.core,t):U.AllowAll}checkPermission(e,...t){let n=e??this.coreState.core.activeDocumentId;return!n||t.every(e=>jr(this.coreState.core,n,e))}requirePermission(e,...t){let n=e??this.coreState.core.activeDocumentId;if(!n)return;let r=[];for(let e of t)jr(this.coreState.core,n,e)||r.push(e);if(r.length>0)throw new Cn(r,Mr(this.coreState.core,n))}},zr=class{constructor(e,t){this.handler=e,this.options=t,this.lastRun=0,this.handle=e=>{this.options.mode===`debounce`?this.debounce(e):this.throttle(e)}}debounce(e){this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.handler(e),this.timeoutId=void 0},this.options.wait)}throttle(e){if(this.options.mode===`debounce`)return;let t=Date.now(),n=this.options.throttleMode||`leading-trailing`;t-this.lastRun>=this.options.wait&&(n===`leading-trailing`&&this.handler(e),this.lastRun=t),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.handler(e),this.lastRun=Date.now(),this.timeoutId=void 0},this.options.wait-(t-this.lastRun))}destroy(){this.timeoutId&&window.clearTimeout(this.timeoutId)}},Br=class{constructor(e,t){this.handler=e,this.options=t,this.controls=new Map,this.handle=e=>{let t=String(this.options.keyExtractor(e)),n=this.controls.get(t);n||(n=new zr(this.handler,this.baseOptions),this.controls.set(t,n)),n.handle(e)},this.baseOptions={mode:t.mode,wait:t.wait,...t.mode===`throttle`&&`throttleMode`in t?{throttleMode:t.throttleMode}:{}}}destroy(){for(let e of this.controls.values())e.destroy();this.controls.clear()}};function Vr(e){return`keyExtractor`in e}function q(e,t,n){return e<t?t:e>n?n:e}function Hr(e,t,n){if(e===t)return!0;if(e==null||t==null)return e===t;let r=typeof e;if(r!==typeof t)return!1;if(r===`object`){n||=new Set;let r=function(e,t){return`${Gr(e)}__${Gr(t)}`}(e,t);if(n.has(r))return!0;n.add(r);let i=Array.isArray(e),a=Array.isArray(t);return i&&a?function(e,t,n){if(e.length!==t.length)return!1;let r=Array(t.length).fill(!1);e:for(let i=0;i<e.length;i++){let a=e[i];for(let e=0;e<t.length;e++)if(!r[e]&&Hr(a,t[e],n)){r[e]=!0;continue e}return!1}return!0}(e,t,n):!i&&!a&&function(e,t,n){let r=Object.keys(e).sort(),i=Object.keys(t).sort();if(r.length!==i.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==i[e])return!1;for(let i of r)if(!Hr(e[i],t[i],n))return!1;return!0}(e,t,n)}return!1}var Ur=0,Wr=new WeakMap;function Gr(e){return Wr.has(e)||Wr.set(e,++Ur),Wr.get(e)}function Kr(){let e=new Set;return{emit:(t=void 0)=>e.forEach(e=>e(t)),on:t=>(e.add(t),()=>e.delete(t)),off:t=>e.delete(t),clear:()=>e.clear()}}function J(e,t=Hr){let n=new Set,r=new Map,i=e,a=(e,t)=>{let a=e,o=()=>{};if(t){if(Vr(t)){let n=new Br(e,t);a=n.handle,o=()=>n.destroy()}else{let n=new zr(e,t);a=n.handle,o=()=>n.destroy()}r.set(e,{wrapped:a,destroy:o})}return i!==void 0&&a(i),n.add(a),()=>{n.delete(a),o(),r.delete(e)}};return{get value(){return i},emit(e=void 0){i!==void 0&&t(i,e)||(i=e,(e=>{n.forEach(t=>t(e))})(e))},on:a,off(e){let t=r.get(e);t?(n.delete(t.wrapped),t.destroy(),r.delete(e)):n.delete(e)},clear(){n.clear(),r.forEach(e=>e.destroy()),r.clear()},select:(e,t=Hr)=>(n,r)=>{let o;if(i!==void 0){let t=e(i);o=t,n(t)}return a(r=>{let i=e(r);o!==void 0&&t(o,i)||(o=i,n(i))},r)}}}function qr(e,t){let n=t?.cache??!0,r=t?.equality??Hr,i=new Map,a=new Map,o=new Map,s=new Set,c=new Map,l=e=>String(e);return{emit(t,o){let c=l(t);if(n){let e=i.get(c);if(e!==void 0&&r(e,o))return;i.set(c,o)}let u=a.get(c);u&&u.forEach(e=>e(o));let d=e(t,o);s.forEach(e=>e(d))},forScope(e){let t=l(e);return(e,r)=>{let s=(e=>{let t=a.get(e);return t||(t=new Set,a.set(e,t)),t})(t),c=(e=>{let t=o.get(e);return t||(t=new Map,o.set(e,t)),t})(t),l=e,u=()=>{};if(r){if(Vr(r)){let t=new Br(e,r);l=t.handle,u=()=>t.destroy()}else{let t=new zr(e,r);l=t.handle,u=()=>t.destroy()}c.set(e,{wrapped:l,destroy:u})}if(n){let e=i.get(t);e!==void 0&&l(e)}return s.add(l),()=>{s.delete(l),u(),c.delete(e),s.size===0&&a.delete(t),c.size===0&&o.delete(t)}}},onGlobal:(e,t)=>{let n=e,r=()=>{};if(t){if(Vr(t)){let i=new Br(e,t);n=i.handle,r=()=>i.destroy()}else{let i=new zr(e,t);n=i.handle,r=()=>i.destroy()}c.set(e,{wrapped:n,destroy:r})}return s.add(n),()=>{s.delete(n),r(),c.delete(e)}},getValue:e=>n?i.get(l(e)):void 0,getScopes:()=>n?Array.from(i.keys()):Array.from(a.keys()),clearScope(e){let t=l(e);n&&i.delete(t);let r=a.get(t);r&&(r.clear(),a.delete(t));let s=o.get(t);s&&(s.forEach(e=>e.destroy()),s.clear(),o.delete(t))},clear(){n&&i.clear(),a.forEach(e=>e.clear()),a.clear(),o.forEach(e=>{e.forEach(e=>e.destroy()),e.clear()}),o.clear(),s.clear(),c.forEach(e=>e.destroy()),c.clear()}}}var Jr=class{constructor(e){this.autoMountElements=[],this.package=e}addUtility(e){return this.autoMountElements.push({component:e,type:`utility`}),this}addWrapper(e){return this.autoMountElements.push({component:e,type:`wrapper`}),this}build(){return{...this.package,autoMountElements:()=>this.autoMountElements}}};function Yr(e){return new Jr(e)}var Xr=Le({registry:null,coreState:null,isInitializing:!0,pluginsReady:!1,activeDocumentId:null,activeDocument:null,documents:{},documentStates:[]});function Zr({plugins:e,children:t}){let{utilities:n,wrappers:r}=P(()=>{let t=[],n=[];for(let r of e){let e=r.package;if(Lr(e)){let r=e.autoMountElements()||[];for(let e of r)e.type===`utility`?t.push(e.component):e.type===`wrapper`&&n.push(e.component)}}return{utilities:t,wrappers:n}},[e]),i=I(A,{children:[t,n.map((e,t)=>I(e,{},`utility-${t}`))]});return I(A,{children:r.reduce((e,t)=>I(t,{children:e}),i)})}function Qr({engine:e,config:t,logger:n,onInitialized:r,plugins:i,children:a,autoMountDomElements:o=!0}){let[s,c]=j(null),[l,u]=j(null),[d,f]=j(!0),[p,m]=j(!1),h=N(r);M(()=>{h.current=r},[r]),M(()=>{let r=new Fr(e,{...t,logger:t?.logger??n});r.registerPluginBatch(i);let a;return(async()=>{if(await r.initialize(),r.isDestroyed())return;let e=r.getStore();u(e.getState().core);let t=e.subscribe((t,n,r)=>{e.isCoreAction(t)&&n.core!==r.core&&u(n.core)});if(await h.current?.call(h,r),!r.isDestroyed())return r.pluginsReady().then(()=>{r.isDestroyed()||m(!0)}),c(r),f(!1),t;t()})().then(e=>{a=e}).catch(console.error),()=>{a?.(),r.destroy(),c(null),u(null),f(!0),m(!1)}},[e,i]);let g=P(()=>{let e=l?.activeDocumentId??null,t=l?.documents??{},n=l?.documentOrder??[],r=e&&t[e]?t[e]:null,i=n.map(e=>t[e]).filter(e=>e!=null);return{registry:s,coreState:l,isInitializing:d,pluginsReady:p,activeDocumentId:e,activeDocument:r,documents:t,documentStates:i}},[s,l,d,p]),_=typeof a==`function`?a(g):a;return I(Xr.Provider,{value:g,children:p&&o?I(Zr,{plugins:i,children:_}):_})}function $r(e){let{registry:t}=function(){let e=et(Xr);if(e===void 0)throw Error(`useCapability must be used within a PDFContext.Provider`);let{registry:t,isInitializing:n}=e;if(n)return e;if(t===null)throw Error(`PDF registry failed to initialize properly`);return e}();if(t===null)return{plugin:null,isLoading:!0,ready:new Promise(()=>{})};let n=t.getPlugin(e);if(!n)throw Error(`Plugin ${e} not found`);return{plugin:n,isLoading:!1,ready:n.ready()}}function ei(e){let{plugin:t,isLoading:n,ready:r}=$r(e);if(!t)return{provides:null,isLoading:n,ready:r};if(!t.provides)throw Error(`Plugin ${e} does not provide a capability`);return{provides:t.provides(),isLoading:n,ready:r}}function ti(){let{coreState:e}=et(Xr);return e}function ni(e){let t=ti();return P(()=>t&&e?t.documents[e]??null:null,[t,e])}U.Print,U.ModifyContents,U.CopyContents,U.ModifyAnnotations,U.FillForms,U.ExtractForAccessibility,U.AssembleDocument,U.PrintHighQuality;var ri=[U.Print,U.ModifyContents,U.CopyContents,U.ModifyAnnotations,U.FillForms,U.ExtractForAccessibility,U.AssembleDocument,U.PrintHighQuality],ii={[U.Print]:`print`,[U.ModifyContents]:`modifyContents`,[U.CopyContents]:`copyContents`,[U.ModifyAnnotations]:`modifyAnnotations`,[U.FillForms]:`fillForms`,[U.ExtractForAccessibility]:`extractForAccessibility`,[U.AssembleDocument]:`assembleDocument`,[U.PrintHighQuality]:`printHighQuality`};function ai(e,t){if(!e)return;if(t in e)return e[t];let n=ii[t];return n&&n in e?e[n]:void 0}function oi(e,t,n){let r=e.documents[t],i=r?.permissions,a=e.globalPermissions,o=r?.document?.permissions??U.AllowAll,s=ai(i?.overrides,n);if(s!==void 0)return s;let c=ai(a?.overrides,n);return c===void 0?!(i?.enforceDocumentPermissions??a?.enforceDocumentPermissions??!0)||(o&n)!==0:c}function si(e){let t=ti();return P(()=>{if(!t)return{permissions:U.AllowAll,pdfPermissions:U.AllowAll,hasPermission:()=>!0,hasAllPermissions:()=>!0,canPrint:!0,canModifyContents:!0,canCopyContents:!0,canModifyAnnotations:!0,canFillForms:!0,canExtractForAccessibility:!0,canAssembleDocument:!0,canPrintHighQuality:!0};let n=function(e,t){return ri.reduce((n,r)=>oi(e,t,r)?n|r:n,0)}(t,e),r=n=>oi(t,e,n);return{permissions:n,pdfPermissions:t.documents[e]?.document?.permissions??U.AllowAll,hasPermission:r,hasAllPermissions:(...n)=>n.every(n=>oi(t,e,n)),canPrint:r(U.Print),canModifyContents:r(U.ModifyContents),canCopyContents:r(U.CopyContents),canModifyAnnotations:r(U.ModifyAnnotations),canFillForms:r(U.FillForms),canExtractForAccessibility:r(U.ExtractForAccessibility),canAssembleDocument:r(U.AssembleDocument),canPrintHighQuality:r(U.PrintHighQuality)}},[t,e])}var ci=`https://cdn.jsdelivr.net/npm/@embedpdf/pdfium@2.15.0/dist/pdfium.wasm`;Le(void 0);var li=`viewport`,ui={id:li,name:`Viewport Plugin`,version:`1.0.0`,provides:[`viewport`],requires:[],optional:[],defaultConfig:{viewportGap:10,scrollEndDelay:300}},di=`INIT_VIEWPORT_STATE`,fi=`CLEANUP_VIEWPORT_STATE`,pi=`REGISTER_VIEWPORT`,mi=`UNREGISTER_VIEWPORT`,hi=`SET_VIEWPORT_METRICS`,gi=`SET_VIEWPORT_SCROLL_METRICS`,_i=`SET_VIEWPORT_GAP`,vi=`SET_SCROLL_ACTIVITY`,yi=`SET_SMOOTH_SCROLL_ACTIVITY`,bi=`ADD_VIEWPORT_GATE`,xi=`REMOVE_VIEWPORT_GATE`;function Si(e,t){return{type:yi,payload:{documentId:e,isSmoothScrolling:t}}}var Ci={viewportMetrics:{width:0,height:0,scrollTop:0,scrollLeft:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0,clientLeft:0,clientTop:0,relativePosition:{x:0,y:0}},isScrolling:!1,isSmoothScrolling:!1,gates:new Set},wi={viewportGap:0,documents:{},activeViewports:new Set,activeDocumentId:null},Ti=class extends Rr{constructor(e,t,n){var r;super(e,t),this.id=e,this.viewportResize$=J(),this.viewportMetrics$=J(),this.scrollMetrics$=J(),this.scrollActivity$=J(),this.gateState$=J(),this.scrollRequests$=new Map,n.viewportGap&&this.dispatch((r=n.viewportGap,{type:_i,payload:r})),this.scrollEndDelay=n.scrollEndDelay||100}onDocumentLoadingStarted(e){this.dispatch(function(e){return{type:di,payload:{documentId:e}}}(e)),this.scrollRequests$.set(e,Kr()),this.logger.debug(`ViewportPlugin`,`DocumentOpened`,`Initialized viewport state for document: ${e}`)}onDocumentClosed(e){var t;this.dispatch(function(e){return{type:fi,payload:{documentId:e}}}(e)),(t=this.scrollRequests$.get(e))==null||t.clear(),this.scrollRequests$.delete(e),this.logger.debug(`ViewportPlugin`,`DocumentClosed`,`Cleaned up viewport state for document: ${e}`)}buildCapability(){return{getViewportGap:()=>this.state.viewportGap,getMetrics:()=>this.getMetrics(),scrollTo:e=>this.scrollTo(e),isScrolling:()=>this.isScrolling(),isSmoothScrolling:()=>this.isSmoothScrolling(),isGated:e=>this.isGated(e),hasGate:(e,t)=>this.hasGate(e,t),getGates:e=>this.getGates(e),forDocument:e=>this.createViewportScope(e),gate:(e,t)=>this.gate(e,t),releaseGate:(e,t)=>this.releaseGate(e,t),isViewportMounted:e=>this.state.activeViewports.has(e),onViewportChange:this.viewportMetrics$.on,onViewportResize:this.viewportResize$.on,onScrollChange:this.scrollMetrics$.on,onScrollActivity:this.scrollActivity$.on,onGateChange:this.gateState$.on}}createViewportScope(e){return{getMetrics:()=>this.getMetrics(e),scrollTo:t=>this.scrollTo(t,e),isScrolling:()=>this.isScrolling(e),isSmoothScrolling:()=>this.isSmoothScrolling(e),isGated:()=>this.isGated(e),hasGate:t=>this.hasGate(t,e),getGates:()=>this.getGates(e),gate:t=>this.gate(t,e),releaseGate:t=>this.releaseGate(t,e),onViewportChange:t=>this.viewportMetrics$.on(n=>{n.documentId===e&&t(n.metrics)}),onScrollChange:t=>this.scrollMetrics$.on(n=>{n.documentId===e&&t(n.scrollMetrics)}),onScrollActivity:t=>this.scrollActivity$.on(n=>{n.documentId===e&&t(n.activity)}),onGateChange:t=>this.gateState$.on(n=>{n?.documentId===e&&t(n)})}}registerViewport(e){if(!this.state.documents[e])throw Error(`Cannot register viewport for ${e}: document state not found. Document must be opened before registering viewport.`);this.state.activeViewports.has(e)||(this.dispatch(function(e){return{type:pi,payload:{documentId:e}}}(e)),this.logger.debug(`ViewportPlugin`,`RegisterViewport`,`Registered viewport (DOM mounted) for document: ${e}`))}unregisterViewport(e){this.registry.isDestroyed()||this.state.activeViewports.has(e)&&(this.dispatch(function(e){return{type:mi,payload:{documentId:e}}}(e)),this.logger.debug(`ViewportPlugin`,`UnregisterViewport`,`Unregistered viewport (DOM unmounted) for document: ${e}. State preserved.`))}setViewportResizeMetrics(e,t){if(this.registry.isDestroyed())return;this.dispatch(function(e,t){return{type:hi,payload:{documentId:e,metrics:t}}}(e,t));let n=this.state.documents[e];n&&this.viewportResize$.emit({documentId:e,metrics:n.viewportMetrics})}setViewportScrollMetrics(e,t){if(this.registry.isDestroyed())return;let n=this.state.documents[e];n&&(t.scrollTop===n.viewportMetrics.scrollTop&&t.scrollLeft===n.viewportMetrics.scrollLeft||(this.dispatch(function(e,t){return{type:gi,payload:{documentId:e,scrollMetrics:t}}}(e,t)),this.bumpScrollActivity(e),this.scrollMetrics$.emit({documentId:e,scrollMetrics:t})))}onScrollRequest(e,t){let n=this.scrollRequests$.get(e);if(!n)throw Error(`Cannot subscribe to scroll requests for ${e}: document state not initialized`);return n.on(t)}gate(e,t){let n=this.state.documents[t];n?n.gates.has(e)||(this.dispatch(function(e,t){return{type:bi,payload:{documentId:e,key:t}}}(t,e)),this.logger.debug(`ViewportPlugin`,`GateAdded`,`Added gate '${e}' for document: ${t}. Total gates: ${n.gates.size+1}`)):this.logger.warn(`ViewportPlugin`,`GateViewport`,`Cannot gate viewport for ${t}: document not found`)}releaseGate(e,t){let n=this.state.documents[t];n?n.gates.has(e)&&(this.dispatch(function(e,t){return{type:xi,payload:{documentId:e,key:t}}}(t,e)),this.logger.debug(`ViewportPlugin`,`GateReleased`,`Released gate '${e}' for document: ${t}. Remaining gates: ${n.gates.size-1}`)):this.logger.warn(`ViewportPlugin`,`ReleaseGate`,`Cannot release gate for ${t}: document not found`)}getViewportState(e){let t=e??this.getActiveDocumentId(),n=this.state.documents[t];if(!n)throw Error(`Viewport state not found for document: ${t}`);return n}getMetrics(e){return this.getViewportState(e).viewportMetrics}isScrolling(e){return this.getViewportState(e).isScrolling}isSmoothScrolling(e){return this.getViewportState(e).isSmoothScrolling}isGated(e){return this.getViewportState(e).gates.size>0}hasGate(e,t){return this.getViewportState(t).gates.has(e)}getGates(e){let t=this.getViewportState(e);return Array.from(t.gates)}scrollTo(e,t){let n=t??this.getActiveDocumentId(),r=this.getViewportState(n),{x:i,y:a,alignX:o,alignY:s,behavior:c=`auto`}=e;c===`smooth`&&this.dispatch(Si(n,!0));let l=r.viewportMetrics,u=i,d=a;o!==void 0&&(u=i-l.clientWidth*(o/100)),s!==void 0&&(d=a-l.clientHeight*(s/100));let f=this.scrollRequests$.get(n);f&&f.emit({x:u,y:d,behavior:c})}bumpScrollActivity(e){this.debouncedDispatch(function(e,t){return{type:vi,payload:{documentId:e,isScrolling:t}}}(e,!1),this.scrollEndDelay),this.debouncedDispatch(Si(e,!1),this.scrollEndDelay)}onStoreUpdated(e,t){for(let n in t.documents){let r=e.documents[n],i=t.documents[n];if(r!==i&&(this.viewportMetrics$.emit({documentId:n,metrics:i.viewportMetrics}),!r||r.isScrolling===i.isScrolling&&r.isSmoothScrolling===i.isSmoothScrolling||this.scrollActivity$.emit({documentId:n,activity:{isScrolling:i.isScrolling,isSmoothScrolling:i.isSmoothScrolling}}),r&&r.gates!==i.gates)){let e=Array.from(r.gates),t=Array.from(i.gates),a=t.find(t=>!e.includes(t)),o=e.find(e=>!t.includes(e));this.gateState$.emit({documentId:n,isGated:i.gates.size>0,gates:t,addedGate:a,removedGate:o}),this.logger.debug(`ViewportPlugin`,`GateStateChanged`,`Gate state changed for document ${n}. Gates: [${t.join(`, `)}], Gated: ${i.gates.size>0}`)}}}async initialize(e){this.logger.info(`ViewportPlugin`,`Initialize`,`Viewport plugin initialized`)}async destroy(){this.viewportMetrics$.clear(),this.viewportResize$.clear(),this.scrollMetrics$.clear(),this.scrollActivity$.clear(),this.gateState$.clear(),this.scrollRequests$.forEach(e=>e.clear()),this.scrollRequests$.clear(),super.destroy()}};Ti.id=`viewport`;var Ei=Ti,Di={manifest:ui,create:(e,t)=>new Ei(li,e,t),reducer:(e=wi,t)=>{switch(t.type){case di:{let{documentId:n}=t.payload;return{...e,documents:{...e.documents,[n]:{...Ci,gates:new Set}}}}case fi:{let{documentId:n}=t.payload,{[n]:r,...i}=e.documents,a=new Set(e.activeViewports);return a.delete(n),{...e,documents:i,activeViewports:a,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case pi:{let{documentId:n}=t.payload,r=new Set(e.activeViewports);return r.add(n),{...e,activeViewports:r,activeDocumentId:e.activeDocumentId??n}}case mi:{let{documentId:n}=t.payload,r=new Set(e.activeViewports);return r.delete(n),{...e,activeViewports:r}}case`SET_ACTIVE_VIEWPORT_DOCUMENT`:return{...e,activeDocumentId:t.payload};case _i:return{...e,viewportGap:t.payload};case hi:{let{documentId:n,metrics:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,viewportMetrics:{width:r.width,height:r.height,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft,clientWidth:r.clientWidth,clientHeight:r.clientHeight,scrollWidth:r.scrollWidth,scrollHeight:r.scrollHeight,clientLeft:r.clientLeft,clientTop:r.clientTop,relativePosition:{x:r.scrollWidth<=r.clientWidth?0:r.scrollLeft/(r.scrollWidth-r.clientWidth),y:r.scrollHeight<=r.clientHeight?0:r.scrollTop/(r.scrollHeight-r.clientHeight)}}}}}:e}case gi:{let{documentId:n,scrollMetrics:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,viewportMetrics:{...i.viewportMetrics,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft},isScrolling:!0}}}:e}case vi:{let{documentId:n,isScrolling:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,isScrolling:r}}}:e}case yi:{let{documentId:n,isSmoothScrolling:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,isSmoothScrolling:r}}}:e}case bi:{let{documentId:n,key:r}=t.payload,i=e.documents[n];if(!i)return e;let a=new Set(i.gates);return a.add(r),{...e,documents:{...e.documents,[n]:{...i,gates:a}}}}case xi:{let{documentId:n,key:r}=t.payload,i=e.documents[n];if(!i)return e;let a=new Set(i.gates);return a.delete(r),{...e,documents:{...e.documents,[n]:{...i,gates:a}}}}default:return e}},initialState:wi},Oi=Le(null),ki=()=>ei(Ei.id);function Ai(e){let{plugin:t}=$r(Ei.id),n=N(null);return $e(()=>{if(!t)return;let r=n.current;if(!r)return;try{t.registerViewport(e)}catch(t){console.error(`Failed to register viewport for document ${e}:`,t);return}let i=()=>{t.setViewportScrollMetrics(e,{scrollTop:r.scrollTop,scrollLeft:r.scrollLeft})};r.addEventListener(`scroll`,i);let a=new ResizeObserver(()=>{t.setViewportResizeMetrics(e,{width:r.offsetWidth,height:r.offsetHeight,clientWidth:r.clientWidth,clientHeight:r.clientHeight,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft,scrollWidth:r.scrollWidth,scrollHeight:r.scrollHeight,clientLeft:r.clientLeft,clientTop:r.clientTop})});a.observe(r);let o=t.onScrollRequest(e,({x:e,y:t,behavior:n=`auto`})=>{requestAnimationFrame(()=>{r.scrollTo({left:e,top:t,behavior:n})})});return()=>{t.unregisterViewport(e),a.disconnect(),r.removeEventListener(`scroll`,i),o()}},[t,e]),n}function ji({children:e,documentId:t,...n}){let[r,i]=j(0),a=Ai(t),{provides:o}=ki(),s=(e=>{let{provides:t}=ki(),[n,r]=j(t?.isGated(e)??!1);return M(()=>{if(t)return r(t.isGated(e)),t.onGateChange(t=>{t.documentId===e&&r(t.isGated)})},[t,e]),n})(t);M(()=>{o&&i(o.getViewportGap())},[o]);let{style:c,...l}=n;return I(Oi.Provider,{value:a,children:I(`div`,{...l,ref:a,style:{width:`100%`,height:`100%`,overflow:`auto`,...typeof c==`object`?c:{},padding:`${r}px`},children:!s&&e})})}var Mi=(e=>(e.Vertical=`vertical`,e.Horizontal=`horizontal`,e))(Mi||{}),Ni=class{constructor(e){this.pageGap=e.pageGap??20,this.viewportGap=e.viewportGap??20,this.bufferSize=e.bufferSize??2}getCenteringOffsetX(e,t){return!t||e.width>=t.width?0:(t.width-e.width)/2}getCenteringOffsetY(e,t){return 0}getVisibleRange(e,t,n){let r=this.getScrollOffset(e),i=r,a=r+this.getClientSize(e),o=0;for(;o<t.length&&(t[o].offset+this.getItemSizeAlongScrollAxis(t[o]))*n<=i;)o++;let s=o;for(;s<t.length&&t[s].offset*n<=a;)s++;return{start:Math.max(0,o-this.bufferSize),end:Math.min(t.length-1,s+this.bufferSize-1)}}handleScroll(e,t,n){let r=this.getVisibleRange(e,t,n),i=t.slice(r.start,r.end+1),a=this.getTotalContentSize(t),o=this.calculatePageVisibility(i,e,n,a),s=o.map(e=>e.pageNumber),c=t.slice(r.start,r.end+1).flatMap(e=>e.index),l=this.determineCurrentPage(o),u=t[r.start],d=t[r.end],f=u?u.offset*n:0,p=t[t.length-1],m=d?(p.offset+this.getItemSizeAlongScrollAxis(p))*n-(d.offset+this.getItemSizeAlongScrollAxis(d))*n:0;return{currentPage:l,visiblePages:s,pageVisibilityMetrics:o,renderedPageIndexes:c,scrollOffset:{x:e.scrollLeft,y:e.scrollTop},startSpacing:f,endSpacing:m}}calculatePageVisibility(e,t,n,r){let i=[];return e.forEach(e=>{let a=this.getCenteringOffsetX(e,r),o=this.getCenteringOffsetY(e,r);e.pageLayouts.forEach(r=>{let s=(e.x+a)*n,c=(e.y+o)*n,l=s+r.x*n,u=c+r.y*n,d=r.rotatedWidth*n,f=r.rotatedHeight*n,p=t.scrollLeft,m=t.scrollTop,h=p+t.clientWidth,g=m+t.clientHeight,_=Math.max(l,p),v=Math.max(u,m),y=Math.min(l+d,h),b=Math.min(u+f,g);if(_<y&&v<b){let e=y-_,t=b-v,a=d*f,o=e*t;i.push({pageNumber:r.pageNumber,viewportX:_-p,viewportY:v-m,visiblePercentage:o/a*100,original:{pageX:(_-l)/n,pageY:(v-u)/n,visibleWidth:e/n,visibleHeight:t/n,scale:1},scaled:{pageX:_-l,pageY:v-u,visibleWidth:e,visibleHeight:t,scale:n}})}})}),i}determineCurrentPage(e){if(e.length===0)return 1;let t=Math.max(...e.map(e=>e.visiblePercentage)),n=e.filter(e=>e.visiblePercentage===t);return n.length===1?n[0].pageNumber:n.sort((e,t)=>e.pageNumber-t.pageNumber)[0].pageNumber}getRectLocationForPage(e,t,n){let r=t.find(t=>t.pageNumbers.includes(e));if(!r)return null;let i=r.pageLayouts.find(t=>t.pageNumber===e);if(!i)return null;let a=this.getCenteringOffsetX(r,n),o=this.getCenteringOffsetY(r,n);return{origin:{x:r.x+i.x+a,y:r.y+i.y+o},size:{width:i.width,height:i.height}}}getScrollPositionForPage(e,t,n,r,i){let a=this.getTotalContentSize(t),o=this.getRectLocationForPage(e,t,a);if(!o)return null;let s=yt(o.origin,n);if(i){let e=function(e,t,n,r){return yt(vt(e,t,n),r)}({width:o.size.width,height:o.size.height},{x:i.x,y:i.y},r,n);return{x:s.x+e.x+this.viewportGap,y:s.y+e.y+this.viewportGap}}return{x:s.x+this.viewportGap,y:s.y+this.viewportGap}}getRectPositionForPage(e,t,n,r,i){let a=this.getTotalContentSize(t),o=this.getRectLocationForPage(e,t,a);if(!o)return null;let s=yt(o.origin,n),c=Tt({width:o.size.width,height:o.size.height},i,r,n);return{origin:{x:s.x+c.origin.x,y:s.y+c.origin.y},size:c.size}}},Pi=class extends Ni{constructor(e){super(e)}createVirtualItems(e){let t=0;return e.map((e,n)=>{let r=0,i=e.map(e=>{let t={pageNumber:e.index+1,pageIndex:e.index,x:r,y:0,width:e.size.width,height:e.size.height,rotatedWidth:e.rotatedSize.width,rotatedHeight:e.rotatedSize.height,elevated:!1};return r+=e.rotatedSize.width+this.pageGap,t}),a=e.reduce((t,n,r)=>t+n.rotatedSize.width+(r<e.length-1?this.pageGap:0),0),o=Math.max(...e.map(e=>e.rotatedSize.height)),s={id:`item-${n}`,x:0,y:t,offset:t,width:a,height:o,pageLayouts:i,pageNumbers:e.map(e=>e.index+1),index:n};return t+=o+this.pageGap,s})}getTotalContentSize(e){return e.length===0?{width:0,height:0}:{width:Math.max(...e.map(e=>e.width)),height:e[e.length-1].y+e[e.length-1].height}}getScrollOffset(e){return e.scrollTop}getClientSize(e){return e.clientHeight}getItemSizeAlongScrollAxis(e){return e.height}},Fi=class extends Ni{constructor(e){super(e)}createVirtualItems(e){let t=0;return e.map((e,n)=>{let r=0,i=e.map(e=>{let t={pageNumber:e.index+1,pageIndex:e.index,x:r,y:0,width:e.size.width,height:e.size.height,rotatedWidth:e.rotatedSize.width,rotatedHeight:e.rotatedSize.height,elevated:!1};return r+=e.rotatedSize.width+this.pageGap,t}),a=e.reduce((t,n,r)=>t+n.rotatedSize.width+(r<e.length-1?this.pageGap:0),0),o=Math.max(...e.map(e=>e.rotatedSize.height)),s={id:`item-${n}`,x:t,y:0,offset:t,width:a,height:o,pageLayouts:i,pageNumbers:e.map(e=>e.index+1),index:n};return t+=a+this.pageGap,s})}getTotalContentSize(e){return e.length===0?{width:0,height:0}:{width:e[e.length-1].x+e[e.length-1].width,height:Math.max(...e.map(e=>e.height))}}getScrollOffset(e){return e.scrollLeft}getClientSize(e){return e.clientWidth}getItemSizeAlongScrollAxis(e){return e.width}getCenteringOffsetX(e,t){return 0}getCenteringOffsetY(e,t){return!t||e.height>=t.height?0:(t.height-e.height)/2}},Ii=`INIT_SCROLL_STATE`,Li=`CLEANUP_SCROLL_STATE`,Ri=`UPDATE_DOCUMENT_SCROLL_STATE`,zi=`SET_SCROLL_STRATEGY`;function Bi(e,t){return{type:Ri,payload:{documentId:e,state:t}}}var Vi={isChanging:!1,targetPage:1,fromPage:1,startTime:0},Hi=class extends Rr{constructor(e,t,n){var r;super(e,t),this.id=e,this.config=n,this.elevatedPages=new Map,this.strategies=new Map,this.layoutReady=new Set,this.initialLayoutFired=new Set,this.scrollerLayoutEmitters=new Map,this.pageChange$=J(),this.scroll$=J(),this.layoutChange$=J(),this.pageChangeState$=J(),this.layoutReady$=J(),this.state$=J(),this.viewport=this.registry.getPlugin(`viewport`).provides(),this.spread=this.registry.getPlugin(`spread`)?.provides()??null,this.viewport.onScrollActivity(e=>{let t=this.getDocumentState(e.documentId);t!=null&&t.pageChangeState.isChanging&&!e.activity.isSmoothScrolling&&this.completePageChange(e.documentId)}),(r=this.spread)==null||r.onSpreadChange(e=>{this.refreshDocumentLayout(e.documentId)});let i=this.registry.getPlugin(`interaction-manager`)?.provides();i&&i.onPageActivityChange(e=>{let t=this.elevatedPages.get(e.documentId);e.hasActivity?(t||(t=new Set,this.elevatedPages.set(e.documentId,t)),t.add(e.pageIndex)):t?.delete(e.pageIndex),this.pushScrollerLayout(e.documentId)}),this.viewport.onViewportChange(e=>{let t=this.getDocumentState(e.documentId);if(!t)return;let n=this.computeMetrics(e.documentId,e.metrics);this.layoutReady.has(e.documentId)?this.commitMetrics(e.documentId,n):this.commitMetrics(e.documentId,{...n,scrollOffset:t.scrollOffset})})}onDocumentLoadingStarted(e){let t=this.getCoreDocument(e);if(!t)return;let n=this.createDocumentState(t);this.dispatch(function(e,t){return{type:Ii,payload:{documentId:e,state:t}}}(e,n));let r=this.createStrategy(n.strategy);this.strategies.set(e,r),this.scrollerLayoutEmitters.set(e,J())}onDocumentLoaded(e){let t=this.getCoreDocument(e);t&&(this.dispatch(Bi(e,{totalPages:t.document?.pageCount??0})),this.refreshDocumentLayout(e),this.logger.debug(`ScrollPlugin`,`DocumentOpened`,`Initialized scroll state for document: ${e}`))}onDocumentClosed(e){this.strategies.delete(e),this.layoutReady.delete(e),this.initialLayoutFired.delete(e),this.elevatedPages.delete(e);let t=this.scrollerLayoutEmitters.get(e);t&&(t.clear(),this.scrollerLayoutEmitters.delete(e)),this.dispatch(function(e){return{type:Li,payload:e}}(e)),this.logger.debug(`ScrollPlugin`,`DocumentClosed`,`Cleaned up scroll state for document: ${e}`)}onScaleChanged(e){let t=this.coreState.core.documents[e];if(!t||t.status!==`loaded`)return;let n=this.viewport.forDocument(e),r=this.computeMetrics(e,n.getMetrics());this.commitMetrics(e,r)}onRotationChanged(e){this.refreshDocumentLayout(e)}onScrollerData(e,t){let n=this.scrollerLayoutEmitters.get(e);if(!n)throw Error(`No scroller layout emitter found for document: ${e}`);return n.on(t)}getScrollerLayout(e){let t=this.getDocumentState(e),n=this.getCoreDocumentOrThrow(e);if(!t||!n)throw Error(`Cannot get scroller layout for document: ${e}`);return r=t,i=n.scale,a=this.elevatedPages.get(e),{startSpacing:r.startSpacing,endSpacing:r.endSpacing,totalWidth:r.totalContentSize.width*i,totalHeight:r.totalContentSize.height*i,pageGap:r.pageGap*i,strategy:r.strategy,items:r.renderedPageIndexes.map(e=>({...r.virtualItems[e],pageLayouts:r.virtualItems[e].pageLayouts.map(e=>({...e,rotatedWidth:e.rotatedWidth*i,rotatedHeight:e.rotatedHeight*i,width:e.width*i,height:e.height*i,elevated:a?.has(e.pageIndex)??!1}))}))};var r,i,a}setLayoutReady(e){if(this.layoutReady.has(e))return;let t=this.getDocumentState(e);if(!t)return;this.layoutReady.add(e);let n=!this.initialLayoutFired.has(e);n&&this.initialLayoutFired.add(e),this.viewport.forDocument(e).scrollTo({...t.scrollOffset,behavior:`instant`}),this.layoutReady$.emit({documentId:e,isInitial:n,pageNumber:t.currentPage,totalPages:t.totalPages})}clearLayoutReady(e){this.layoutReady.delete(e)}buildCapability(){return{getCurrentPage:()=>this.getCurrentPage(),getTotalPages:()=>this.getTotalPages(),getPageChangeState:()=>this.getPageChangeState(),scrollToPage:e=>this.scrollToPage(e),scrollToNextPage:e=>this.scrollToNextPage(e),scrollToPreviousPage:e=>this.scrollToPreviousPage(e),getMetrics:e=>this.getMetrics(e),getLayout:()=>this.getLayout(),getRectPositionForPage:(e,t,n,r)=>this.getRectPositionForPage(e,t,n,r),forDocument:e=>this.createScrollScope(e),setScrollStrategy:(e,t)=>this.setScrollStrategyForDocument(e,t),getPageGap:()=>this.state.defaultPageGap,onPageChange:this.pageChange$.on,onScroll:this.scroll$.on,onLayoutChange:this.layoutChange$.on,onLayoutReady:this.layoutReady$.on,onPageChangeState:this.pageChangeState$.on,onStateChange:this.state$.on}}createScrollScope(e){return{getCurrentPage:()=>this.getCurrentPage(e),getTotalPages:()=>this.getTotalPages(e),getPageChangeState:()=>this.getPageChangeState(e),scrollToPage:t=>this.scrollToPage(t,e),scrollToNextPage:t=>this.scrollToNextPage(t,e),scrollToPreviousPage:t=>this.scrollToPreviousPage(t,e),getSpreadPagesWithRotatedSize:()=>this.getSpreadPagesWithRotatedSize(e),getMetrics:t=>this.getMetrics(t,e),getLayout:()=>this.getLayout(e),getRectPositionForPage:(t,n,r,i)=>this.getRectPositionForPage(t,n,r,i,e),setScrollStrategy:t=>this.setScrollStrategyForDocument(t,e),onPageChange:t=>this.pageChange$.on(n=>{n.documentId===e&&t(n)}),onScroll:t=>this.scroll$.on(n=>{n.documentId===e&&t(n.metrics)}),onLayoutChange:t=>this.layoutChange$.on(n=>{n.documentId===e&&t(n.layout)})}}getDocumentState(e){let t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){let t=this.getDocumentState(e);if(!t)throw Error(`Scroll state not found for document: ${e??`active`}`);return t}getStrategy(e){let t=e??this.getActiveDocumentId(),n=this.strategies.get(t);if(!n)throw Error(`Strategy not found for document: ${t}`);return n}createStrategy(e){let t={pageGap:this.state.defaultPageGap,viewportGap:this.viewport.getViewportGap(),bufferSize:this.state.defaultBufferSize};return e===Mi.Horizontal?new Fi(t):new Pi(t)}createDocumentState(e){return{virtualItems:[],totalPages:e.document?.pageCount??0,currentPage:1,totalContentSize:{width:0,height:0},strategy:this.state.defaultStrategy,pageGap:this.state.defaultPageGap,visiblePages:[],pageVisibilityMetrics:[],renderedPageIndexes:[],scrollOffset:{x:0,y:0},startSpacing:0,endSpacing:0,pageChangeState:Vi}}startPageChange(e,t,n=`smooth`){let r=this.getDocumentState(e);if(!r)return;let i={isChanging:!0,targetPage:t,fromPage:r.currentPage,startTime:Date.now()};this.dispatch(Bi(e,{pageChangeState:i,currentPage:t})),this.pageChange$.emit({documentId:e,pageNumber:t,totalPages:r.totalPages}),n===`instant`&&this.completePageChange(e)}completePageChange(e){let t=this.getDocumentState(e);if(!t||!t.pageChangeState.isChanging)return;let n={isChanging:!1,targetPage:t.pageChangeState.targetPage,fromPage:t.pageChangeState.fromPage,startTime:t.pageChangeState.startTime};this.dispatch(Bi(e,{pageChangeState:n}))}computeLayout(e,t){let n=this.getStrategy(e),r=n.createVirtualItems(t);return{virtualItems:r,totalContentSize:n.getTotalContentSize(r)}}computeMetrics(e,t,n){let r=this.getCoreDocumentOrThrow(e),i=this.getDocumentState(e),a=this.getStrategy(e);if(!i)throw Error(`Document state not found: ${e}`);return a.handleScroll(t,n??i.virtualItems,r.scale)}commitMetrics(e,t){let n=this.getDocumentState(e);if(!n)return;let r=n.pageChangeState.isChanging,i=r&&t.currentPage!==n.currentPage?{...t,currentPage:n.currentPage}:t;this.dispatch(Bi(e,i)),this.scroll$.emit({documentId:e,metrics:i}),r||t.currentPage===n.currentPage||this.pageChange$.emit({documentId:e,pageNumber:t.currentPage,totalPages:n.totalPages}),this.pushScrollerLayout(e)}pushScrollerLayout(e){let t=this.scrollerLayoutEmitters.get(e);if(t)try{let n=this.getScrollerLayout(e);t.emit(n)}catch{}}refreshDocumentLayout(e){let t=this.coreState.core.documents[e],n=this.getDocumentState(e);if(!t||!n||t.status!==`loaded`)return;let r=this.getSpreadPagesWithRotatedSize(e),i=this.computeLayout(e,r),a=this.viewport.forDocument(e),o=this.computeMetrics(e,a.getMetrics(),i.virtualItems);this.dispatch(Bi(e,{...i,...o})),this.layoutChange$.emit({documentId:e,layout:i}),this.pushScrollerLayout(e)}getSpreadPagesWithRotatedSize(e){let t=e??this.getActiveDocumentId(),n=this.coreState.core.documents[t];if(!n)throw Error(`Document ${t} not loaded`);return(this.spread?.forDocument(t).getSpreadPages()||n.document?.pages.map(e=>[e])||[]).map(e=>e.map(e=>{let t=((e.rotation??0)+n.rotation)%4;return{...e,rotatedSize:ht(e.size,t,1)}}))}getCurrentPage(e){return this.getDocumentStateOrThrow(e).currentPage}getTotalPages(e){return this.getDocumentStateOrThrow(e).totalPages}getPageChangeState(e){return this.getDocumentStateOrThrow(e).pageChangeState}scrollToPage(e,t){let n=t??this.getActiveDocumentId(),r=this.getDocumentStateOrThrow(n),i=this.getStrategy(n),a=this.getCoreDocumentOrThrow(n),{pageNumber:o,behavior:s=`smooth`,pageCoordinates:c,alignX:l,alignY:u}=e;this.startPageChange(n,o,s);let d=((a.document?.pages[o-1]?.rotation??0)+a.rotation)%4,f=i.getScrollPositionForPage(o,r.virtualItems,a.scale,d,c);f?this.viewport.forDocument(n).scrollTo({...f,behavior:s,alignX:l,alignY:u}):this.completePageChange(n)}scrollToNextPage(e=`smooth`,t){let n=t??this.getActiveDocumentId(),r=this.getDocumentStateOrThrow(n),i=this.getStrategy(n),a=this.getCoreDocumentOrThrow(n),o=r.virtualItems.findIndex(e=>e.pageNumbers.includes(r.currentPage));if(o>=0&&o<r.virtualItems.length-1){let t=r.virtualItems[o+1].pageNumbers[0];this.startPageChange(n,t,e);let s=i.getScrollPositionForPage(t,r.virtualItems,a.scale,a.rotation);s?this.viewport.forDocument(n).scrollTo({...s,behavior:e}):this.completePageChange(n)}}scrollToPreviousPage(e=`smooth`,t){let n=t??this.getActiveDocumentId(),r=this.getDocumentStateOrThrow(n),i=this.getStrategy(n),a=this.coreState.core.documents[n],o=r.virtualItems.findIndex(e=>e.pageNumbers.includes(r.currentPage));if(o>0){let t=r.virtualItems[o-1].pageNumbers[0];this.startPageChange(n,t,e);let s=i.getScrollPositionForPage(t,r.virtualItems,a.scale,a.rotation);s?this.viewport.forDocument(n).scrollTo({...s,behavior:e}):this.completePageChange(n)}}getMetrics(e,t){let n=t??this.getActiveDocumentId();if(e)return this.computeMetrics(n,e);let r=this.viewport.forDocument(n);return this.computeMetrics(n,r.getMetrics())}getLayout(e){let t=this.getDocumentStateOrThrow(e);return{virtualItems:t.virtualItems,totalContentSize:t.totalContentSize}}getRectPositionForPage(e,t,n,r,i){let a=i??this.getActiveDocumentId(),o=this.getDocumentStateOrThrow(a),s=this.getStrategy(a),c=this.getCoreDocumentOrThrow(a),l=r;return l===void 0&&(l=((c.document?.pages[e]?.rotation??0)+c.rotation)%4),s.getRectPositionForPage(e+1,o.virtualItems,n??c.scale,l,t)}setScrollStrategyForDocument(e,t){let n=t??this.getActiveDocumentId(),r=this.getDocumentState(n);if(!r||r.strategy===e)return;let i=this.createStrategy(e);this.strategies.set(n,i),this.dispatch(function(e,t){return{type:zi,payload:{documentId:e,strategy:t}}}(n,e)),this.refreshDocumentLayout(n)}onStoreUpdated(e,t){for(let n in t.documents){let r=e.documents[n],i=t.documents[n];r!==i&&(this.state$.emit(i),r?.pageChangeState!==i.pageChangeState&&this.pageChangeState$.emit({documentId:n,state:i.pageChangeState}),this.pushScrollerLayout(n))}}async initialize(){this.logger.info(`ScrollPlugin`,`Initialize`,`Scroll plugin initialized`)}async destroy(){this.strategies.clear(),this.layoutReady.clear(),this.initialLayoutFired.clear(),this.elevatedPages.clear();for(let e of this.scrollerLayoutEmitters.values())e.clear();this.scrollerLayoutEmitters.clear(),this.pageChange$.clear(),this.scroll$.clear(),this.layoutChange$.clear(),this.pageChangeState$.clear(),this.layoutReady$.clear(),this.state$.clear(),super.destroy()}};Hi.id=`scroll`;var Ui=Hi,Wi=`scroll`,Gi={manifest:{id:Wi,name:`Scroll Plugin`,version:`1.0.0`,provides:[`scroll`],requires:[`viewport`],optional:[`spread`,`interaction-manager`],defaultConfig:{defaultPageGap:10,defaultBufferSize:4,defaultStrategy:Mi.Vertical}},create:(e,t)=>new Ui(Wi,e,t),reducer:(e,t)=>{switch(t.type){case Ii:{let{documentId:n,state:r}=t.payload;return{...e,documents:{...e.documents,[n]:r}}}case Li:{let{[t.payload]:n,...r}=e.documents;return{...e,documents:r}}case Ri:{let{documentId:n,state:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,...r}}}:e}case zi:{let{documentId:n,strategy:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,strategy:r}}}:e}default:return e}},initialState:(e,t)=>((e,t)=>({defaultStrategy:t.defaultStrategy??Mi.Vertical,defaultPageGap:t.defaultPageGap??10,defaultBufferSize:t.defaultBufferSize??2,documents:{}}))(0,t)},Ki=()=>ei(Ui.id),qi=e=>{let{provides:t}=Ki(),[n,r]=j(1),[i,a]=j(1);return M(()=>{if(!t||!e)return;let n=t.forDocument(e);return r(n.getCurrentPage()),a(n.getTotalPages()),t.onPageChange(t=>{t.documentId===e&&(r(t.pageNumber),a(t.totalPages))})},[t,e]),{provides:t?.forDocument(e)??null,state:{currentPage:n,totalPages:i}}};function Ji({documentId:e,renderPage:t,...n}){let{plugin:r}=$r(Ui.id),[i,a]=j({layout:null,docId:null});M(()=>{if(!r||!e)return;let t=r.onScrollerData(e,t=>{a({layout:t,docId:e})});return()=>{t(),a({layout:null,docId:null}),r.clearLayoutReady(e)}},[r,e]);let o=i.docId===e?i.layout:null;return $e(()=>{r&&e&&o&&r.setLayoutReady(e)},[r,e,o]),o?I(`div`,{...n,style:{width:`${o.totalWidth}px`,height:`${o.totalHeight}px`,position:`relative`,boxSizing:`border-box`,margin:`0 auto`,...o.strategy===Mi.Horizontal&&{display:`flex`,flexDirection:`row`}},children:[I(`div`,{style:{...o.strategy===Mi.Horizontal?{width:o.startSpacing,height:`100%`,flexShrink:0}:{height:o.startSpacing,width:`100%`}}}),I(`div`,{style:{gap:o.pageGap,display:`flex`,alignItems:`center`,position:`relative`,boxSizing:`border-box`,...o.strategy===Mi.Horizontal?{flexDirection:`row`,minHeight:`100%`}:{flexDirection:`column`,minWidth:`fit-content`}},children:o.items.map(e=>I(`div`,{style:{display:`flex`,justifyContent:`center`,gap:o.pageGap},children:e.pageLayouts.map(e=>I(`div`,{style:{width:`${e.rotatedWidth}px`,height:`${e.rotatedHeight}px`,position:`relative`,zIndex:e.elevated?1:void 0},children:t({...e})},e.pageNumber))},e.pageNumbers[0]))}),I(`div`,{style:{...o.strategy===Mi.Horizontal?{width:o.endSpacing,height:`100%`,flexShrink:0}:{height:o.endSpacing,width:`100%`}}})]}):null}var Yi=(e=>(e.None=`none`,e.Odd=`odd`,e.Even=`even`,e))(Yi||{}),Xi=`SPREAD/INIT_STATE`,Zi=`SPREAD/CLEANUP_STATE`,Qi=`SPREAD/SET_SPREAD_MODE`,$i=`SPREAD/SET_PAGE_GROUPING`;function ea(e,t){return{type:$i,payload:{documentId:e,grouping:t}}}var ta=class extends Rr{constructor(e,t,n){super(e,t),this.spreadEmitter$=J(),this.defaultSpreadMode=n.defaultSpreadMode??Yi.None,this.viewport=t.getPlugin(`viewport`)?.provides()??null}onDocumentLoadingStarted(e){var t;let n={spreadMode:this.defaultSpreadMode};this.dispatch(function(e,t){return{type:Xi,payload:{documentId:e,state:t}}}(e,n)),(t=this.viewport)==null||t.gate(`spread`,e),this.logger.debug(`SpreadPlugin`,`DocumentOpened`,`Initialized spread state for document: ${e}`)}onDocumentLoaded(e){var t;let n=this.coreState.core.documents[e];if(n?.document){let t=this.calculatePageGrouping(e,n.document.pages.length);this.dispatch(ea(e,t))}(t=this.viewport)==null||t.releaseGate(`spread`,e)}onDocumentClosed(e){this.dispatch(function(e){return{type:Zi,payload:e}}(e)),this.logger.debug(`SpreadPlugin`,`DocumentClosed`,`Cleaned up spread state for document: ${e}`)}buildCapability(){return{setSpreadMode:e=>this.setSpreadModeForDocument(e),getSpreadMode:()=>this.getSpreadModeForDocument(),getSpreadPages:()=>this.getSpreadPages(),forDocument:e=>this.createSpreadScope(e),onSpreadChange:this.spreadEmitter$.on}}createSpreadScope(e){return{setSpreadMode:t=>this.setSpreadModeForDocument(t,e),getSpreadMode:()=>this.getSpreadModeForDocument(e),getSpreadPages:()=>this.getSpreadPages(e),onSpreadChange:t=>this.spreadEmitter$.on(n=>{n.documentId===e&&t(n.spreadMode)})}}getDocumentState(e){let t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){let t=this.getDocumentState(e);if(!t)throw Error(`Spread state not found for document: ${e??`active`}`);return t}setSpreadModeForDocument(e,t){let n=t??this.getActiveDocumentId(),r=this.getDocumentStateOrThrow(n),i=this.coreState.core.documents[n];if(!i?.document)throw Error(`Document ${n} not loaded`);if(r.spreadMode!==e){this.dispatch(function(e,t){return{type:Qi,payload:{documentId:e,spreadMode:t}}}(n,e));let t=this.calculatePageGrouping(n,i.document.pages.length);this.dispatch(ea(n,t)),this.spreadEmitter$.emit({documentId:n,spreadMode:e})}}getSpreadModeForDocument(e){return this.getDocumentStateOrThrow(e).spreadMode}calculatePageGrouping(e,t){switch(this.getDocumentStateOrThrow(e).spreadMode){case Yi.None:return Array.from({length:t},(e,t)=>[t]);case Yi.Odd:return Array.from({length:Math.ceil(t/2)},(e,n)=>{let r=[2*n];return 2*n+1<t&&r.push(2*n+1),r});case Yi.Even:return[[0],...Array.from({length:Math.ceil((t-1)/2)},(e,n)=>{let r=[1+2*n];return 1+2*n+1<t&&r.push(1+2*n+1),r})];default:return Array.from({length:t},(e,t)=>[t])}}getSpreadPages(e){let t=e??this.getActiveDocumentId(),n=this.coreState.core.documents[t],r=this.getDocumentStateOrThrow(t);if(!n?.document)throw Error(`Document ${t} not loaded`);let i=r.pageGrouping??[],a=n.document.pages;return i.map(e=>e.map(e=>a[e]).filter(Boolean))}onStoreUpdated(e,t){for(let n in t.documents){let r=e.documents[n],i=t.documents[n];r?.spreadMode!==i.spreadMode&&this.logger.debug(`SpreadPlugin`,`SpreadModeChanged`,`Spread mode changed for document ${n}: ${r?.spreadMode??Yi.None} -> ${i.spreadMode}`)}}async initialize(e){this.logger.info(`SpreadPlugin`,`Initialize`,`Spread plugin initialized`)}async destroy(){this.spreadEmitter$.clear(),super.destroy()}};ta.id=`spread`;var na=ta,ra=`spread`,ia={id:ra,name:`Spread Plugin`,version:`1.0.0`,provides:[`spread`],requires:[],optional:[`viewport`],defaultConfig:{}};Yi.None;var aa={documents:{},activeDocumentId:null},oa={manifest:ia,create:(e,t)=>new na(ra,e,t),reducer:(e=aa,t)=>{switch(t.type){case Xi:{let{documentId:n,state:r}=t.payload;return{...e,documents:{...e.documents,[n]:r},activeDocumentId:e.activeDocumentId??n}}case Zi:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case`SPREAD/SET_ACTIVE_DOCUMENT`:return{...e,activeDocumentId:t.payload};case Qi:{let{documentId:n,spreadMode:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,spreadMode:r}}}:e}case $i:{let{documentId:n,grouping:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,pageGrouping:r}}}:e}default:return e}},initialState:aa},sa=`ui`,ca={id:sa,name:`UI Plugin`,version:`1.0.0`,provides:[`ui`],requires:[],optional:[`i18n`],defaultConfig:{schema:{id:`empty`,version:`1.0.0`,toolbars:{},menus:{},sidebars:{},modals:{},selectionMenus:{}}}},la=`UI/INIT_STATE`,ua=`UI/CLEANUP_STATE`,da=`UI/SET_ACTIVE_TOOLBAR`,fa=`UI/CLOSE_TOOLBAR_SLOT`,pa=`UI/SET_ACTIVE_SIDEBAR`,ma=`UI/CLOSE_SIDEBAR_SLOT`,ha=`UI/SET_SIDEBAR_TAB`,ga=`UI/OPEN_MODAL`,_a=`UI/CLOSE_MODAL`,va=`UI/CLEAR_MODAL`,ya=`UI/OPEN_MENU`,ba=`UI/CLOSE_MENU`,xa=`UI/CLOSE_ALL_MENUS`,Sa=`UI/SET_OVERLAY_ENABLED`,Ca=`UI/SET_DISABLED_CATEGORIES`,wa=`UI/SET_HIDDEN_ITEMS`,Ta=(e,t,n,r,i,a)=>({type:pa,payload:{documentId:e,placement:t,slot:n,sidebarId:r,activeTab:i,props:a}}),Ea=(e,t,n)=>({type:ma,payload:{documentId:e,placement:t,slot:n}}),Da=(e,t)=>({type:ya,payload:{documentId:e,menuState:t}}),Oa=(e,t)=>({type:ba,payload:{documentId:e,menuId:t}}),ka=(e,t,n)=>({type:Sa,payload:{documentId:e,overlayId:t,enabled:n}}),Aa=e=>({type:Ca,payload:{categories:e}}),ja=e=>({type:wa,payload:{hiddenItems:e}});function Ma(e,t){if(!t)return e;let n={...e};for(let[e,r]of Object.entries(t))n[e]=n[e]?{...n[e],...r,items:r.items??n[e].items,responsive:r.responsive??n[e].responsive}:r;return n}function Na(e,t){if(!t)return e;let n={...e};for(let[e,r]of Object.entries(t))n[e]=n[e]?{...n[e],...r,items:r.items??n[e].items}:r;return n}function Pa(e,t){if(!t)return e;let n={...e};for(let[e,r]of Object.entries(t))n[e]=n[e]?{...n[e],...r,content:r.content??n[e].content}:r;return n}function Fa(e,t){if(!e.responsive?.breakpoints)return null;let n=function(e,t,n){if(!n||!t?.groups)return e;let r=t.groups.find(e=>e.locales.includes(n));if(!r)return e;let i={};for(let[t,n]of Object.entries(e)){let e=r.breakpoints[t];i[t]=e?{minWidth:n.minWidth,maxWidth:n.maxWidth,hide:e.replaceHide?e.replaceHide:[...n.hide||[],...e.hide||[]],show:e.replaceShow?e.replaceShow:[...n.show||[],...e.show||[]]}:n}return i}(e.responsive.breakpoints,e.responsive.localeOverrides,t),r=new Map,i=new Map;for(let[e,t]of Object.entries(n))i.set(e,{minWidth:t.minWidth,maxWidth:t.maxWidth});let a=new Set,o=e=>{e.forEach(e=>{a.add(e.id),e.type===`group`&&e.items&&o(e.items),e.type===`tab-group`&&e.tabs&&o(e.tabs),e.type===`section`&&e.items&&o(e.items)})};o(e.items);for(let e of a){let t=[],i=!0;Array.from(Object.entries(n)).sort((e,t)=>(e[1].minWidth??0)-(t[1].minWidth??0)).forEach(([n,r],a)=>{let o=r.hide?.includes(e),s=r.show?.includes(e);(o||s)&&(t.push({breakpointId:n,minWidth:r.minWidth,maxWidth:r.maxWidth,visible:s||!o,priority:a}),a===0&&(i=s||!o))}),t.length>0&&r.set(e,{itemId:e,shouldRender:!0,visibilityRules:t,defaultVisible:i})}return{items:r,breakpoints:i}}var Ia=`data-epdf`,La=`data-epdf-s`,Ra=`data-epdf-i`,za=`data-epdf-cat`,Ba=`data-epdf-dis`,Va=`data-epdf-hid`,Ha={ROOT:`[${Ia}]`,STYLES:`[${La}]`,ITEM:e=>`[${Ra}="${e}"]`,CATEGORIES:e=>`[${za}~="${e}"]`,DISABLED_CATEGORY:e=>`[${Ba}~="${e}"]`,HIDDEN_ITEM:e=>`[${Va}~="${e}"]`},Ua={useContainerQueries:!0};function Wa(e,t={}){let n={...Ua,...t.config},r=t.locale,i=Ka(e,r),a=[];a.push(function(e){return`/* ═══════════════════════════════════════════════════════════════════════════ */\n/* EmbedPDF UI Stylesheet - Auto-generated${e?` (locale: ${e})`:``} */\n/* DO NOT EDIT MANUALLY - This file is generated from your UI schema */\n/* ═══════════════════════════════════════════════════════════════════════════ */`}(r));let o=function(e,t){let n=[],r=t.useContainerQueries?`@container`:`@media`,i=new Set;return e.responsiveItems.forEach((e,t)=>{if(i.has(t))return;i.add(t);let a=function(e,t,n){if(t.visibilityRules.length===0)return null;let r=[],i=Ha.ITEM(e);t.defaultVisible||r.push(`${i} { display: none; }`);for(let e of t.visibilityRules){let t=[];if(e.minWidth!==void 0&&t.push(`(min-width: ${e.minWidth}px)`),e.maxWidth!==void 0&&t.push(`(max-width: ${e.maxWidth}px)`),t.length>0){let a=e.visible?`flex`:`none`;r.push(`${n} ${t.join(` and `)} {\n ${i} { display: ${a}; }\n}`)}}return r.length>0?r.join(`
2255
+ `):null}(t,e,r);a&&n.push(a)}),n.length===0?``:`/* ─── Responsive Visibility Rules ─── */\n/* Items show/hide based on container width */\n\n${n.join(`
2256
+
2257
+ `)}`}(i,n);o&&a.push(o);let s=function(e){if(e.categories.size===0)return``;let t=[],n=Array.from(e.categories).sort();for(let e of n)t.push(`${Ha.ROOT}[${Ba}~="${e}"] [${za}~="${e}"] {\n display: none !important;\n}`);return`/* ─── Category Visibility Rules ─── */\n/* Items hide when ANY of their categories is disabled */\n/* Use: data-disabled-categories="category1 category2" on root element */\n\n${t.join(`
2258
+
2259
+ `)}`}(i);s&&a.push(s);let c=function(e,t){if(e.dependencies.length===0)return``;let n=[],r=t.useContainerQueries?`@container`:`@media`;for(let t of e.dependencies){let i=io(t,e,r);i.length>0&&n.push(...i)}return n.length===0?``:`/* ─── Dependency Visibility Rules ─── */\n/* Container elements hide when all their dependencies are hidden */\n\n${n.join(`
2260
+
2261
+ `)}`}(i,n);return c&&a.push(c),a.filter(e=>e.trim()).join(`
2262
+
2263
+ `)}function Ga(e,t){let n=new Set(t),r=[];return e.forEach((e,t)=>{e.some(e=>n.has(e))&&r.push(t)}),r}function Ka(e,t){let n=new Set,r=new Map,i=[],a=new Map,o=new Map;for(let[s,c]of Object.entries(e.menus))qa(s,c,n,r,i,a,o,t);for(let[a,s]of Object.entries(e.toolbars))Za(a,s,n,r,i,o,t);for(let[t,a]of Object.entries(e.sidebars))eo(t,a,n,r,i);for(let[a,s]of Object.entries(e.selectionMenus||{}))to(a,s,n,r,i,o,t);for(let[t,a]of Object.entries(e.overlays||{}))ro(t,a.categories,a.visibilityDependsOn,n,r,i);return{categories:n,itemCategories:r,dependencies:i,menuBreakpoints:a,responsiveItems:o}}function qa(e,t,n,r,i,a,o,s){ro(e,t.categories,t.visibilityDependsOn,n,r,i),Ja(t.items,n,r,i);let c=Fa(t,s);c&&c.items.forEach((e,t)=>{o.set(t,e)});let l=function(e,t,n){let r=[],i=Fa(e,n);if(e.responsive?.breakpoints&&i){let e=Array.from(i.breakpoints.entries()).sort((e,t)=>(e[1].minWidth??0)-(t[1].minWidth??0));for(let[n,a]of e){let e=Xa(i,a),n=new Set;for(let r of e){let e=t.get(r);e&&e.forEach(e=>n.add(e))}r.push({minWidth:a.minWidth,maxWidth:a.maxWidth,visibleItemIds:e,visibleCategories:n})}}else{let n=[],i=new Set;Ya(e.items,t,n,i),r.push({visibleItemIds:n,visibleCategories:i})}return r}(t,r,s);a.set(e,l)}function Ja(e,t,n,r){for(let i of e)ro(i.id,i.categories,i.visibilityDependsOn,t,n,r),i.type===`section`&&Ja(i.items,t,n,r)}function Ya(e,t,n,r){for(let i of e){n.push(i.id);let e=t.get(i.id);e&&e.forEach(e=>r.add(e)),i.type===`section`&&Ya(i.items,t,n,r)}}function Xa(e,t){let n=[];return e.items.forEach((e,r)=>{let i=e.defaultVisible;for(let n of e.visibilityRules)(n.minWidth===void 0||t.minWidth!==void 0&&t.minWidth>=n.minWidth)&&(n.maxWidth===void 0||t.maxWidth!==void 0&&t.maxWidth<=n.maxWidth)&&(i=n.visible);i&&n.push(r)}),n}function Za(e,t,n,r,i,a,o){ro(e,t.categories,t.visibilityDependsOn,n,r,i);let s=Fa(t,o);s&&s.items.forEach((e,t)=>{a.set(t,e)}),Qa(t.items,n,r,i)}function Qa(e,t,n,r){for(let i of e)ro(i.id,i.categories,i.visibilityDependsOn,t,n,r),i.type===`group`&&i.items&&Qa(i.items,t,n,r),i.type===`tab-group`&&i.tabs&&$a(i.tabs,t,n,r)}function $a(e,t,n,r){for(let i of e)ro(i.id,i.categories,i.visibilityDependsOn,t,n,r)}function eo(e,t,n,r,i){if(ro(e,t.categories,t.visibilityDependsOn,n,r,i),t.content.type===`tabs`)for(let e of t.content.tabs)ro(e.id,e.categories,e.visibilityDependsOn,n,r,i)}function to(e,t,n,r,i,a,o){if(ro(e,t.categories,t.visibilityDependsOn,n,r,i),t.responsive){let e=Fa(t,o);e&&e.items.forEach((e,t)=>{a.set(t,e)})}no(t.items,n,r,i)}function no(e,t,n,r){for(let i of e)ro(i.id,i.categories,i.visibilityDependsOn,t,n,r),i.type===`group`&&i.items&&no(i.items,t,n,r)}function ro(e,t,n,r,i,a){var o;t!=null&&t.length&&(t.forEach(e=>r.add(e)),i.set(e,t)),n&&(n.menuId||(o=n.itemIds)!=null&&o.length)&&a.push({itemId:e,dependsOnMenuId:n.menuId,dependsOnItemIds:n.itemIds})}function io(e,t,n,r){let i=[];if(e.dependsOnMenuId){let r=t.menuBreakpoints.get(e.dependsOnMenuId);if(r&&r.length>0){i.push(`/* "${e.itemId}" depends on menu "${e.dependsOnMenuId}" */`);for(let t of r){if(t.visibleItemIds.length===0)continue;let r=t.visibleItemIds.sort().map(e=>Ha.HIDDEN_ITEM(e)).join(``),a=`${Ha.ROOT}${r} ${Ha.ITEM(e.itemId)} {\n display: none !important;\n}`,o=[];t.minWidth!==void 0&&o.push(`(min-width: ${t.minWidth}px)`),t.maxWidth!==void 0&&o.push(`(max-width: ${t.maxWidth}px)`),o.length>0?i.push(`${n} ${o.join(` and `)} {\n ${a}\n}`):i.push(a)}}}if(e.dependsOnItemIds?.length){i.push(`/* "${e.itemId}" depends on items: ${e.dependsOnItemIds.join(`, `)} */`);let t=e.dependsOnItemIds.sort().map(e=>Ha.HIDDEN_ITEM(e)).join(``);i.push(`${Ha.ROOT}${t} ${Ha.ITEM(e.itemId)} {\n display: none !important;\n}`)}return i}function ao(e,t){return{[Ra]:e.id,[za]:e.categories?.join(` `)||void 0,...t}}var oo=class extends Rr{constructor(e,t,n){if(super(e,t),this.cachedStylesheet=null,this.cachedLocale=null,this.i18n=null,this.i18nCleanup=null,this.categoryChanged$=J(),this.stylesheetInvalidated$=Kr(),this.toolbarChanged$=qr((e,t)=>({documentId:e,...t}),{cache:!1}),this.sidebarChanged$=qr((e,t)=>({documentId:e,...t}),{cache:!1}),this.modalChanged$=qr((e,t)=>({documentId:e,...t}),{cache:!1}),this.menuChanged$=qr((e,t)=>({documentId:e,...t}),{cache:!1}),this.overlayChanged$=qr((e,t)=>({documentId:e,...t}),{cache:!1}),this.schema=n.schema,this.stylesheetConfig=n.stylesheetConfig||{},this.itemCategories=Ka(this.schema).itemCategories,n.disabledCategories?.length){this.dispatch(Aa(n.disabledCategories));let e=Ga(this.itemCategories,n.disabledCategories);this.dispatch(ja(e))}this.i18n=t.getPlugin(`i18n`)?.provides()??null,this.i18n&&(this.i18nCleanup=this.i18n.onLocaleChange(({currentLocale:e})=>{this.handleLocaleChange(e)}),this.cachedLocale=this.i18n.getLocale())}async initialize(){this.logger.info(`UIPlugin`,`Initialize`,`UI plugin initialized`)}async destroy(){this.i18nCleanup&&=(this.i18nCleanup(),null),this.toolbarChanged$.clear(),this.sidebarChanged$.clear(),this.modalChanged$.clear(),this.menuChanged$.clear(),this.overlayChanged$.clear(),this.stylesheetInvalidated$.clear(),super.destroy()}onDocumentLoadingStarted(e){this.dispatch(((e,t)=>({type:la,payload:{documentId:e,schema:t}}))(e,this.schema))}onDocumentClosed(e){this.dispatch((e=>({type:ua,payload:{documentId:e}}))(e)),this.toolbarChanged$.clearScope(e),this.sidebarChanged$.clearScope(e),this.modalChanged$.clearScope(e),this.menuChanged$.clearScope(e),this.overlayChanged$.clearScope(e)}handleLocaleChange(e){this.cachedLocale!==e&&(this.logger.debug(`UIPlugin`,`LocaleChange`,`Locale changed: ${this.cachedLocale} -> ${e}`),this.cachedLocale=e,this.invalidateStylesheet(),this.stylesheetInvalidated$.emit())}getStylesheet(){let e=this.i18n?.getLocale()??null;return this.cachedStylesheet&&this.cachedLocale===e||(this.cachedStylesheet=Wa(this.schema,{config:this.stylesheetConfig,locale:e??void 0}),this.cachedLocale=e),this.cachedStylesheet}getLocale(){return this.i18n?.getLocale()??null}invalidateStylesheet(){this.cachedStylesheet=null}onStylesheetInvalidated(e){return this.stylesheetInvalidated$.on(e)}disableCategoryImpl(e){let t=new Set(this.state.disabledCategories);if(!t.has(e)){t.add(e);let n=Array.from(t);this.dispatch(Aa(n));let r=Ga(this.itemCategories,n);this.dispatch(ja(r)),this.categoryChanged$.emit({disabledCategories:n,hiddenItems:r})}}enableCategoryImpl(e){let t=new Set(this.state.disabledCategories);if(t.has(e)){t.delete(e);let n=Array.from(t);this.dispatch(Aa(n));let r=Ga(this.itemCategories,n);this.dispatch(ja(r)),this.categoryChanged$.emit({disabledCategories:n,hiddenItems:r})}}toggleCategoryImpl(e){this.state.disabledCategories.includes(e)?this.enableCategoryImpl(e):this.disableCategoryImpl(e)}setDisabledCategoriesImpl(e){this.dispatch(Aa(e));let t=Ga(this.itemCategories,e);this.dispatch(ja(t)),this.categoryChanged$.emit({disabledCategories:e,hiddenItems:t})}buildCapability(){return{setActiveToolbar:(e,t,n,r)=>this.setToolbarForDocument(e,t,n,r),setActiveSidebar:(e,t,n,r,i,a)=>this.setSidebarForDocument(e,t,n,r,i,a),toggleSidebar:(e,t,n,r,i,a)=>this.toggleSidebarForDocument(e,t,n,r,i,a),openModal:(e,t,n)=>this.openModalForDocument(e,t,n),openMenu:(e,t,n,r)=>this.openMenuForDocument(e,t,n,r),toggleMenu:(e,t,n,r)=>this.toggleMenuForDocument(e,t,n,r),enableOverlay:(e,t)=>this.enableOverlayForDocument(e,t),disableOverlay:(e,t)=>this.disableOverlayForDocument(e,t),toggleOverlay:(e,t)=>this.toggleOverlayForDocument(e,t),forDocument:e=>this.createUIScope(e),getSchema:()=>this.schema,mergeSchema:e=>{var t,n;this.schema=(t=this.schema,n=e,{...t,...n,toolbars:Ma(t.toolbars,n.toolbars),menus:Na(t.menus,n.menus),sidebars:Pa(t.sidebars,n.sidebars)})},disableCategory:e=>this.disableCategoryImpl(e),enableCategory:e=>this.enableCategoryImpl(e),toggleCategory:e=>this.toggleCategoryImpl(e),setDisabledCategories:e=>this.setDisabledCategoriesImpl(e),getDisabledCategories:()=>this.state.disabledCategories,isCategoryDisabled:e=>this.state.disabledCategories.includes(e),getHiddenItems:()=>this.state.hiddenItems,onToolbarChanged:this.toolbarChanged$.onGlobal,onSidebarChanged:this.sidebarChanged$.onGlobal,onModalChanged:this.modalChanged$.onGlobal,onMenuChanged:this.menuChanged$.onGlobal,onOverlayChanged:this.overlayChanged$.onGlobal,onCategoryChanged:this.categoryChanged$.on}}createUIScope(e){return{setActiveToolbar:(t,n,r)=>this.setToolbarForDocument(t,n,r,e),getActiveToolbar:(t,n)=>this.getToolbarForDocument(t,n,e),closeToolbarSlot:(t,n)=>this.closeToolbarForDocument(t,n,e),isToolbarOpen:(t,n,r)=>this.isToolbarOpenForDocument(t,n,r,e),setActiveSidebar:(t,n,r,i,a)=>this.setSidebarForDocument(t,n,r,e,i,a),getActiveSidebar:(t,n)=>this.getSidebarForDocument(t,n,e),closeSidebarSlot:(t,n)=>this.closeSidebarForDocument(t,n,e),toggleSidebar:(t,n,r,i,a)=>this.toggleSidebarForDocument(t,n,r,e,i,a),isSidebarOpen:(t,n,r)=>this.isSidebarOpenForDocument(t,n,r,e),setSidebarTab:(t,n)=>this.setSidebarTabForDocument(t,n,e),getSidebarTab:t=>this.getSidebarTabForDocument(t,e),openModal:(t,n)=>this.openModalForDocument(t,n,e),closeModal:()=>this.closeModalForDocument(e),clearModal:()=>this.clearModalForDocument(e),getActiveModal:()=>this.getActiveModalForDocument(e),isModalOpen:()=>this.isModalOpenForDocument(e),openMenu:(t,n,r)=>this.openMenuForDocument(t,n,r,e),closeMenu:t=>this.closeMenuForDocument(t,e),toggleMenu:(t,n,r)=>this.toggleMenuForDocument(t,n,r,e),closeAllMenus:()=>this.closeAllMenusForDocument(e),isMenuOpen:t=>this.isMenuOpenForDocument(t,e),getOpenMenus:()=>this.getOpenMenusForDocument(e),enableOverlay:t=>this.enableOverlayForDocument(t,e),disableOverlay:t=>this.disableOverlayForDocument(t,e),toggleOverlay:t=>this.toggleOverlayForDocument(t,e),isOverlayEnabled:t=>this.isOverlayEnabledForDocument(t,e),getEnabledOverlays:()=>this.getEnabledOverlaysForDocument(e),getSchema:()=>this.schema,getState:()=>this.getDocumentStateOrThrow(e),onToolbarChanged:this.toolbarChanged$.forScope(e),onSidebarChanged:this.sidebarChanged$.forScope(e),onModalChanged:this.modalChanged$.forScope(e),onMenuChanged:this.menuChanged$.forScope(e),onOverlayChanged:this.overlayChanged$.forScope(e)}}getDocumentState(e){let t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){let t=this.getDocumentState(e);if(!t)throw Error(`UI state not found for document: ${e??`active`}`);return t}setToolbarForDocument(e,t,n,r){let i=r??this.getActiveDocumentId();this.dispatch(((e,t,n,r)=>({type:da,payload:{documentId:e,placement:t,slot:n,toolbarId:r}}))(i,e,t,n)),this.toolbarChanged$.emit(i,{placement:e,slot:t,toolbarId:n})}getToolbarForDocument(e,t,n){let r=`${e}-${t}`,i=this.getDocumentStateOrThrow(n).activeToolbars[r];return i?.isOpen?i.toolbarId:null}closeToolbarForDocument(e,t,n){let r=n??this.getActiveDocumentId();this.dispatch(((e,t,n)=>({type:fa,payload:{documentId:e,placement:t,slot:n}}))(r,e,t)),this.toolbarChanged$.emit(r,{placement:e,slot:t,toolbarId:``})}isToolbarOpenForDocument(e,t,n,r){let i=`${e}-${t}`,a=this.getDocumentStateOrThrow(r).activeToolbars[i];return!(!a||!a.isOpen)&&(!n||a.toolbarId===n)}setSidebarForDocument(e,t,n,r,i,a){let o=r??this.getActiveDocumentId();this.dispatch(Ta(o,e,t,n,i,a)),this.sidebarChanged$.emit(o,{placement:e,slot:t,sidebarId:n})}getSidebarForDocument(e,t,n){let r=`${e}-${t}`,i=this.getDocumentStateOrThrow(n).activeSidebars[r];return i?.isOpen?i.sidebarId:null}closeSidebarForDocument(e,t,n){let r=n??this.getActiveDocumentId();this.dispatch(Ea(r,e,t)),this.sidebarChanged$.emit(r,{placement:e,slot:t,sidebarId:``})}toggleSidebarForDocument(e,t,n,r,i,a){let o=r??this.getActiveDocumentId(),s=`${e}-${t}`,c=this.getDocumentStateOrThrow(o).activeSidebars[s];c?.sidebarId===n&&c?.isOpen?(this.dispatch(Ea(o,e,t)),this.sidebarChanged$.emit(o,{placement:e,slot:t,sidebarId:``})):(this.dispatch(Ta(o,e,t,n,i,a)),this.sidebarChanged$.emit(o,{placement:e,slot:t,sidebarId:n}))}isSidebarOpenForDocument(e,t,n,r){let i=`${e}-${t}`,a=this.getDocumentStateOrThrow(r).activeSidebars[i];return!(!a||!a.isOpen)&&(!n||a.sidebarId===n)}setSidebarTabForDocument(e,t,n){let r=n??this.getActiveDocumentId();this.dispatch(((e,t,n)=>({type:ha,payload:{documentId:e,sidebarId:t,tabId:n}}))(r,e,t))}getSidebarTabForDocument(e,t){return this.getDocumentStateOrThrow(t).sidebarTabs[e]??null}openModalForDocument(e,t,n){let r=n??this.getActiveDocumentId();this.dispatch(((e,t,n)=>({type:ga,payload:{documentId:e,modalId:t,props:n}}))(r,e,t)),this.modalChanged$.emit(r,{modalId:e,isOpen:!0})}closeModalForDocument(e){let t=e??this.getActiveDocumentId(),n=this.getDocumentStateOrThrow(t).activeModal;this.dispatch((e=>({type:_a,payload:{documentId:e}}))(t)),this.modalChanged$.emit(t,{modalId:n?.modalId??null,isOpen:!1})}clearModalForDocument(e){let t=e??this.getActiveDocumentId();this.dispatch((e=>({type:va,payload:{documentId:e}}))(t))}getActiveModalForDocument(e){return this.getDocumentStateOrThrow(e).activeModal}isModalOpenForDocument(e){return this.getDocumentStateOrThrow(e).activeModal?.isOpen??!1}openMenuForDocument(e,t,n,r){let i=r??this.getActiveDocumentId();this.dispatch(Da(i,{menuId:e,triggeredByCommandId:t,triggeredByItemId:n})),this.menuChanged$.emit(i,{menuId:e,isOpen:!0})}closeMenuForDocument(e,t){let n=t??this.getActiveDocumentId();this.dispatch(Oa(n,e)),this.menuChanged$.emit(n,{menuId:e,isOpen:!1})}toggleMenuForDocument(e,t,n,r){let i=r??this.getActiveDocumentId();this.getDocumentStateOrThrow(i).openMenus[e]?(this.dispatch(Oa(i,e)),this.menuChanged$.emit(i,{menuId:e,isOpen:!1})):(this.dispatch(Da(i,{menuId:e,triggeredByCommandId:t,triggeredByItemId:n})),this.menuChanged$.emit(i,{menuId:e,isOpen:!0}))}closeAllMenusForDocument(e){let t=e??this.getActiveDocumentId();this.dispatch((e=>({type:xa,payload:{documentId:e}}))(t))}isMenuOpenForDocument(e,t){return!!this.getDocumentStateOrThrow(t).openMenus[e]}getOpenMenusForDocument(e){return Object.values(this.getDocumentStateOrThrow(e).openMenus)}enableOverlayForDocument(e,t){let n=t??this.getActiveDocumentId();this.dispatch(ka(n,e,!0)),this.overlayChanged$.emit(n,{overlayId:e,isEnabled:!0})}disableOverlayForDocument(e,t){let n=t??this.getActiveDocumentId();this.dispatch(ka(n,e,!1)),this.overlayChanged$.emit(n,{overlayId:e,isEnabled:!1})}toggleOverlayForDocument(e,t){let n=t??this.getActiveDocumentId();this.isOverlayEnabledForDocument(e,n)?this.disableOverlayForDocument(e,n):this.enableOverlayForDocument(e,n)}isOverlayEnabledForDocument(e,t){return this.getDocumentStateOrThrow(t).enabledOverlays[e]??!0}getEnabledOverlaysForDocument(e){let t=this.getDocumentStateOrThrow(e).enabledOverlays;return Object.entries(t).filter(([,e])=>e).map(([e])=>e)}};oo.id=`ui`;var so=oo,co={activeToolbars:{},activeSidebars:{},activeModal:null,openMenus:{},sidebarTabs:{},enabledOverlays:{}},lo={documents:{},disabledCategories:[],hiddenItems:[]};function uo(e,t){return function(e){return e.ui??null}(e)?.documents[t]??null}function fo(e,t){return`${e}-${t}`}function po(e,t,n,r,i){let a=function(e,t,n,r){let i=uo(e,t);return i?i.activeToolbars[fo(n,r)]??null:null}(e,t,n,r);return!(!a||!a.isOpen)&&(!i||a.toolbarId===i)}function mo(e,t,n,r,i){let a=function(e,t,n,r){let i=uo(e,t);return i?i.activeSidebars[fo(n,r)]??null:null}(e,t,n,r);return!(!a||!a.isOpen)&&(!i||a.sidebarId===i)}var ho={manifest:ca,create:(e,t)=>new so(sa,e,t),reducer:(e=lo,t)=>{switch(t.type){case la:{let{documentId:n,schema:r}=t.payload,i={};Object.values(r.toolbars).forEach(e=>{if(e.permanent&&e.position){let t=`${e.position.placement}-${e.position.slot}`;i[t]={toolbarId:e.id,isOpen:!0}}});let a={};return r.overlays&&Object.values(r.overlays).forEach(e=>{a[e.id]=e.defaultEnabled??!0}),{...e,documents:{...e.documents,[n]:{...co,activeToolbars:i,enabledOverlays:a}}}}case ua:{let{documentId:n}=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i}}case da:{let{documentId:n,placement:r,slot:i,toolbarId:a}=t.payload,o=e.documents[n]||co,s=`${r}-${i}`;return{...e,documents:{...e.documents,[n]:{...o,activeToolbars:{...o.activeToolbars,[s]:{toolbarId:a,isOpen:!0}}}}}}case fa:{let{documentId:n,placement:r,slot:i}=t.payload,a=e.documents[n];if(!a)return e;let o=`${r}-${i}`,s=a.activeToolbars[o];return s?{...e,documents:{...e.documents,[n]:{...a,activeToolbars:{...a.activeToolbars,[o]:{...s,isOpen:!1}}}}}:e}case pa:{let{documentId:n,placement:r,slot:i,sidebarId:a,activeTab:o,props:s}=t.payload,c=e.documents[n]||co,l=`${r}-${i}`;return{...e,documents:{...e.documents,[n]:{...c,activeSidebars:{...c.activeSidebars,[l]:{sidebarId:a,isOpen:!0,props:s}},...o&&{sidebarTabs:{...c.sidebarTabs,[a]:o}}}}}}case ma:{let{documentId:n,placement:r,slot:i}=t.payload,a=e.documents[n];if(!a)return e;let o=`${r}-${i}`,s=a.activeSidebars[o];return s?{...e,documents:{...e.documents,[n]:{...a,activeSidebars:{...a.activeSidebars,[o]:{...s,isOpen:!1}}}}}:e}case ha:{let{documentId:n,sidebarId:r,tabId:i}=t.payload,a=e.documents[n]||co;return{...e,documents:{...e.documents,[n]:{...a,sidebarTabs:{...a.sidebarTabs,[r]:i}}}}}case ga:{let{documentId:n,modalId:r,props:i}=t.payload,a=e.documents[n]||co;return{...e,documents:{...e.documents,[n]:{...a,activeModal:{modalId:r,isOpen:!0,props:i},openMenus:{}}}}}case _a:{let{documentId:n}=t.payload,r=e.documents[n];return r?.activeModal?{...e,documents:{...e.documents,[n]:{...r,activeModal:{...r.activeModal,isOpen:!1}}}}:e}case va:{let{documentId:n}=t.payload,r=e.documents[n];return r?r.activeModal?.isOpen?e:{...e,documents:{...e.documents,[n]:{...r,activeModal:null}}}:e}case ya:{let{documentId:n,menuState:r}=t.payload,i=e.documents[n]||co;return{...e,documents:{...e.documents,[n]:{...i,openMenus:{[r.menuId]:r}}}}}case ba:{let{documentId:n,menuId:r}=t.payload,i=e.documents[n];if(!i)return e;let{[r]:a,...o}=i.openMenus;return{...e,documents:{...e.documents,[n]:{...i,openMenus:o}}}}case xa:{let{documentId:n}=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:{...r,openMenus:{}}}}:e}case Sa:{let{documentId:n,overlayId:r,enabled:i}=t.payload,a=e.documents[n]||co;return{...e,documents:{...e.documents,[n]:{...a,enabledOverlays:{...a.enabledOverlays,[r]:i}}}}}case Ca:return{...e,disabledCategories:t.payload.categories};case wa:return{...e,hiddenItems:t.payload.hiddenItems};default:return e}},initialState:lo},go=()=>ei(so.id),_o=e=>{let{provides:t}=go(),[n,r]=j(null);return M(()=>{if(!t)return;let n=t.forDocument(e);r(n.getState());let i=n.onToolbarChanged(()=>r(n.getState())),a=n.onSidebarChanged(()=>r(n.getState())),o=n.onModalChanged(()=>r(n.getState())),s=n.onMenuChanged(()=>r(n.getState())),c=n.onOverlayChanged(()=>r(n.getState()));return()=>{i(),a(),o(),s(),c()}},[t,e]),n},vo=Le(null);function yo(){let e=et(vo);if(!e)throw Error(`useUIContainer must be used within a UIProvider`);return e}var bo=Le(null);function xo({children:e}){let t=N(new Map),n={register:F((e,n,r)=>{let i=`${e}:${n}`;t.current.set(i,r)},[]),unregister:F((e,n)=>{let r=`${e}:${n}`;t.current.delete(r)},[]),getAnchor:F((e,n)=>{let r=`${e}:${n}`;return t.current.get(r)||null},[])};return I(bo.Provider,{value:n,children:e})}function So(){let e=et(bo);if(!e)throw Error(`useAnchorRegistry must be used within UIProvider`);return e}function Co(e,t){let n=So(),r=N(null),i=N(e),a=N(t);return i.current=e,a.current=t,F(e=>{let t=r.current;r.current=e,e?e!==t&&n.register(i.current,a.current,e):t&&n.unregister(i.current,a.current)},[n])}var wo=Le(null);function To({children:e,initialComponents:t={}}){let n=N(new Map(Object.entries(t))),r={register:F((e,t)=>{n.current.set(e,t)},[]),unregister:F(e=>{n.current.delete(e)},[]),get:F(e=>n.current.get(e),[]),has:F(e=>n.current.has(e),[]),getRegisteredIds:F(()=>Array.from(n.current.keys()),[])};return I(wo.Provider,{value:r,children:e})}function Eo(){let e=function(){let e=et(wo);if(!e)throw Error(`useComponentRegistry must be used within UIProvider`);return e}();return{renderCustomComponent:(t,n,r)=>{let i=e.get(t);return i?I(i,{documentId:n,...r||{}}):(console.error(`Component "${t}" not found in registry`),null)}}}var Do=Le(null);function Oo({children:e,renderers:t}){return I(Do.Provider,{value:t,children:e})}function ko(){let e=et(Do);if(!e)throw Error(`useRenderers must be used within UIProvider`);return e}function Ao(e,t){let{provides:n}=go(),r=ko(),i=F(i=>{let a=(n?.getSchema())?.selectionMenus?.[e];return!a||!i.selected?null:I(r.selectionMenu,{schema:a,documentId:t,props:i})},[n,r,e,t]);if((n?.getSchema())?.selectionMenus?.[e])return i}function jo({container:e,documentId:t}){let n=_o(t),{provides:r}=go(),i=So(),a=ko(),[o,s]=j(null),c=n?.openMenus||{},l=r?.getSchema();if(M(()=>{let e=Object.keys(c);if(e.length>0){let n=e[0];if(!n)return void s(null);let r=c[n];if(r&&r.triggeredByItemId){let e=i.getAnchor(t,r.triggeredByItemId);s({menuId:n,anchorEl:e})}else s(null)}else s(null)},[c,i,t]),!o||!l)return null;let u=l.menus[o.menuId];return u?I(a.menu,{schema:u,documentId:t,anchorEl:o.anchorEl,onClose:()=>{o&&r?.forDocument(t).closeMenu(o.menuId)},container:e}):(console.warn(`Menu "${o.menuId}" not found in schema`),null)}function Mo({children:e,style:t,...n}){let{plugin:r}=$r(so.id),{provides:i}=go(),[a,o]=j([]),[s,c]=j([]),l=N(null),u=N(null),d=N(null),f=N(null),p=P(()=>({containerRef:f,getContainer:()=>f.current}),[]),m=F(e=>{let t=d.current;if(d.current=e,f.current=e,e&&e!==t&&r){let t=function(e){let t=e.getRootNode();return t instanceof ShadowRoot?t:document.head}(e);u.current=t;let n=t.querySelector(Ha.STYLES);if(n)return l.current=n,void(n.textContent=r.getStylesheet());let i=r.getStylesheet(),a=document.createElement(`style`);a.setAttribute(La,``),a.textContent=i,t instanceof ShadowRoot?t.insertBefore(a,t.firstChild):t.appendChild(a),l.current=a}},[r]);M(()=>()=>{var e;(e=l.current)!=null&&e.parentNode&&!d.current&&l.current.remove(),l.current=null,u.current=null},[]),M(()=>{if(r)return r.onStylesheetInvalidated(()=>{l.current&&(l.current.textContent=r.getStylesheet())})},[r]),M(()=>{if(i)return o(i.getDisabledCategories()),c(i.getHiddenItems()),i.onCategoryChanged(({disabledCategories:e,hiddenItems:t})=>{o(e),c(t)})},[i]);let h=P(()=>a.length>0?a.join(` `):void 0,[a]),g=P(()=>s.length>0?s.join(` `):void 0,[s]),_=P(()=>{let e={containerType:`inline-size`};return t&&typeof t==`object`?{...e,...t}:e},[t]),v={[Ia]:``,[Ba]:h,[Va]:g};return I(vo.Provider,{value:p,children:I(`div`,{ref:m,...v,...n,style:_,children:e})})}function No({children:e,documentId:t,components:n={},renderers:r,menuContainer:i,...a}){return I(xo,{children:I(To,{initialComponents:n,children:I(Oo,{renderers:r,children:I(Mo,{...a,children:[e,I(jo,{documentId:t,container:i})]})})})})}var Po=class extends Rr{constructor(e,t,n){super(e,t),this.id=e,this.documentOpened$=J(),this.documentClosed$=J(),this.activeDocumentChanged$=J(),this.documentError$=J(),this.documentOrderChanged$=J(),this.openFileRequest$=Kr(),this.loadOptions=new Map,this.maxDocuments=n?.maxDocuments}buildCapability(){return{openFileDialog:e=>this.openFileDialog(e),openDocumentUrl:e=>this.openDocumentUrl(e),openDocumentBuffer:e=>this.openDocumentBuffer(e),retryDocument:(e,t)=>this.retryDocument(e,t),closeDocument:e=>this.closeDocument(e),closeAllDocuments:()=>this.closeAllDocuments(),setActiveDocument:e=>{if(!this.isDocumentOpen(e))throw Error(`Cannot set active document: ${e} is not open`);this.dispatchCoreAction((e=>({type:hr,payload:e}))(e))},getActiveDocumentId:()=>this.coreState.core.activeDocumentId,getActiveDocument:()=>{let e=this.coreState.core.activeDocumentId;return e?this.coreState.core.documents[e]?.document??null:null},getDocumentOrder:()=>this.coreState.core.documentOrder,moveDocument:(e,t)=>{this.dispatchCoreAction(((e,t)=>({type:_r,payload:{documentId:e,toIndex:t}}))(e,t))},swapDocuments:(e,t)=>{let n=this.coreState.core.documentOrder,r=n.indexOf(e),i=n.indexOf(t);if(r===-1||i===-1)throw Error(`One or both documents not found in order`);let a=[...n];[a[r],a[i]]=[a[i],a[r]],this.dispatchCoreAction((e=>({type:gr,payload:e}))(a))},getDocument:e=>this.coreState.core.documents[e]?.document??null,getDocumentState:e=>this.coreState.core.documents[e]??null,getOpenDocuments:()=>this.coreState.core.documentOrder.map(e=>this.coreState.core.documents[e]).filter(e=>e!==null),isDocumentOpen:e=>this.isDocumentOpen(e),getDocumentCount:()=>Object.keys(this.coreState.core.documents).length,getDocumentIndex:e=>this.coreState.core.documentOrder.indexOf(e),setDocumentEncryption:(e,t)=>this.setDocumentEncryption(e,t),unlockOwnerPermissions:(e,t)=>this.unlockOwnerPermissions(e,t),removeEncryption:e=>this.removeEncryption(e),onDocumentOpened:this.documentOpened$.on,onDocumentClosed:this.documentClosed$.on,onDocumentError:this.documentError$.on,onActiveDocumentChanged:this.activeDocumentChanged$.on,onDocumentOrderChanged:this.documentOrderChanged$.on}}isDocumentOpen(e){return!!this.coreState.core.documents[e]}onDocumentLoaded(e){let t=this.coreState.core.documents[e];t&&t.status===`loaded`&&(this.loadOptions.delete(e),this.documentOpened$.emit(t),this.logger.info(`DocumentManagerPlugin`,`DocumentOpened`,`Document ${e} opened successfully`,{name:t.name}))}onDocumentClosed(e){this.loadOptions.delete(e),this.documentClosed$.emit(e),this.logger.info(`DocumentManagerPlugin`,`DocumentClosed`,`Document ${e} closed`)}onActiveDocumentChanged(e,t){this.activeDocumentChanged$.emit({previousDocumentId:e,currentDocumentId:t}),this.logger.info(`DocumentManagerPlugin`,`ActiveDocumentChanged`,`Active document changed from ${e} to ${t}`)}onCoreStoreUpdated(e,t){e.core.documentOrder!==t.core.documentOrder&&this.documentOrderChanged$.emit({order:t.core.documentOrder})}onOpenFileRequest(e){return this.openFileRequest$.on(e)}openDocumentUrl(e){let t=new L,n=e.documentId||this.generateDocumentId(),r=this.checkDocumentLimit();if(r)return t.reject(r),t;let i=e.name??this.extractNameFromUrl(e.url);this.loadOptions.set(n,e),this.dispatchCoreAction(Cr(n,i,e.scale,e.rotation,!!e.password,e.autoActivate,e.permissions)),this.logger.info(`DocumentManagerPlugin`,`OpenDocumentUrl`,`Starting to load document from URL: ${e.url}`,{documentId:n,passwordProvided:!!e.password});let a={id:n,url:e.url},o=this.engine.openDocumentUrl(a,{password:e.password,mode:e.mode,requestOptions:e.requestOptions,normalizeRotation:!0});return t.resolve({documentId:n,task:o}),this.handleLoadTask(n,o,`OpenDocumentUrl`),t}openDocumentBuffer(e){let t=new L,n=this.checkDocumentLimit();if(n)return t.reject(n),t;let r=e.documentId||this.generateDocumentId();this.loadOptions.set(r,e),this.dispatchCoreAction(Cr(r,e.name,e.scale,e.rotation,!!e.password,e.autoActivate,e.permissions)),this.logger.info(`DocumentManagerPlugin`,`OpenDocumentBuffer`,`Starting to load document from buffer: ${e.name}`,{documentId:r,passwordProvided:!!e.password});let i={id:r,content:e.buffer},a=this.engine.openDocumentBuffer(i,{password:e.password,normalizeRotation:!0});return t.resolve({documentId:r,task:a}),this.handleLoadTask(r,a,`OpenDocumentBuffer`),t}retryDocument(e,t){let n=new L,r=this.validateRetry(e);if(!r.valid)return n.reject(r.error),n;let i={...this.loadOptions.get(e),...t?.password&&{password:t.password}};this.loadOptions.set(e,i),this.dispatchCoreAction(((e,t)=>({type:pr,payload:{documentId:e,passwordProvided:t}}))(e,!!t?.password)),this.logger.info(`DocumentManagerPlugin`,`RetryDocument`,`Retrying to load document ${e}`,{passwordProvided:!!t?.password});let a=`url`in i?this.retryUrlDocument(e,i):this.retryBufferDocument(e,i);return n.resolve({documentId:e,task:a}),this.handleLoadTask(e,a,`RetryDocument`),n}openFileDialog(e){let t=new L;return this.openFileRequest$.emit({task:t,options:e}),t}closeDocument(e){let t=new L,n=this.coreState.core.documents[e];return n?(n.status===`loaded`&&n.document?this.engine.closeDocument(n.document).wait(()=>{this.dispatchCoreAction(wr(e)),t.resolve()},n=>{this.logger.error(`DocumentManagerPlugin`,`CloseDocument`,`Failed to close document ${e}`,n),t.fail(n)}):(this.logger.info(`DocumentManagerPlugin`,`CloseDocument`,`Closing document ${e} in ${n.status} state (skipping engine close)`),this.dispatchCoreAction(wr(e)),t.resolve()),t):(this.logger.warn(`DocumentManagerPlugin`,`CloseDocument`,`Cannot close document ${e}: not found in state`),t.resolve(),t)}closeAllDocuments(){let e=Object.keys(this.coreState.core.documents),t=e.map(e=>this.closeDocument(e));return this.logger.info(`DocumentManagerPlugin`,`CloseAllDocuments`,`Closing ${e.length} documents`),L.all(t)}setDocumentEncryption(e,t){let n=new L,r=this.coreState.core.documents[e];return r?.document?(this.logger.info(`DocumentManagerPlugin`,`SetDocumentEncryption`,`Setting encryption on document ${e}`,{hasUserPassword:!!t.userPassword,allowedFlags:t.allowedFlags}),this.engine.setDocumentEncryption(r.document,t.userPassword??``,t.ownerPassword,t.allowedFlags).wait(t=>{t&&this.logger.info(`DocumentManagerPlugin`,`SetDocumentEncryption`,`Encryption set successfully on document ${e}`),n.resolve(t)},t=>{this.logger.error(`DocumentManagerPlugin`,`SetDocumentEncryption`,`Failed to set encryption on document ${e}`,t),n.fail(t)}),n):(n.reject({code:W.DocNotOpen,message:`Document ${e} is not open`}),n)}unlockOwnerPermissions(e,t){let n=new L,r=this.coreState.core.documents[e];if(!r?.document)return n.reject({code:W.DocNotOpen,message:`Document ${e} is not open`}),n;let i=r.document;return this.logger.info(`DocumentManagerPlugin`,`UnlockOwnerPermissions`,`Attempting to unlock owner permissions on document ${e}`),this.engine.unlockOwnerPermissions(i,t).wait(t=>{t&&(this.logger.info(`DocumentManagerPlugin`,`UnlockOwnerPermissions`,`Owner permissions unlocked on document ${e}`),this.dispatchCoreAction(((e,t,n)=>({type:vr,payload:{documentId:e,permissions:t,isOwnerUnlocked:n}}))(e,4294967295,!0))),n.resolve(t)},t=>{this.logger.error(`DocumentManagerPlugin`,`UnlockOwnerPermissions`,`Failed to unlock owner permissions on document ${e}`,t),n.fail(t)}),n}removeEncryption(e){let t=new L,n=this.coreState.core.documents[e];return n?.document?(this.logger.info(`DocumentManagerPlugin`,`RemoveEncryption`,`Marking document ${e} for encryption removal on save`),this.engine.removeEncryption(n.document).wait(n=>{n&&this.logger.info(`DocumentManagerPlugin`,`RemoveEncryption`,`Document ${e} marked for encryption removal`),t.resolve(n)},n=>{this.logger.error(`DocumentManagerPlugin`,`RemoveEncryption`,`Failed to mark document ${e} for encryption removal`,n),t.fail(n)}),t):(t.reject({code:W.DocNotOpen,message:`Document ${e} is not open`}),t)}checkDocumentLimit(){return this.maxDocuments&&Object.keys(this.coreState.core.documents).length>=this.maxDocuments?{code:W.Unknown,message:`Maximum number of documents (${this.maxDocuments}) reached`}:null}validateRetry(e){let t=this.coreState.core.documents[e];return t?t.status===`loaded`?{valid:!1,error:{code:W.Unknown,message:`Document ${e} is already loaded successfully`}}:t.status===`error`?this.loadOptions.has(e)?{valid:!0}:{valid:!1,error:{code:W.Unknown,message:`No retry information available for document ${e}`}}:{valid:!1,error:{code:W.Unknown,message:`Document ${e} is not in error state (current state: ${t.status})`}}:{valid:!1,error:{code:W.NotFound,message:`Document ${e} not found`}}}retryUrlDocument(e,t){let n={id:e,url:t.url};return this.engine.openDocumentUrl(n,{password:t.password,mode:t.mode,requestOptions:t.requestOptions})}retryBufferDocument(e,t){let n={id:e,content:t.buffer};return this.engine.openDocumentBuffer(n,{password:t.password,normalizeRotation:!0})}handleLoadTask(e,t,n){t.wait(t=>{this.dispatchCoreAction(((e,t)=>({type:dr,payload:{documentId:e,document:t}}))(e,t))},t=>{this.handleLoadError(e,t,n)})}handleLoadError(e,t,n){let r=t.reason?.message||`Failed to load document`;this.logger.error(`DocumentManagerPlugin`,n,`Failed to load document`,t),this.dispatchCoreAction(((e,t,n,r)=>({type:fr,payload:{documentId:e,error:t,errorCode:n,errorDetails:r}}))(e,r,t.reason?.code,t.reason)),this.documentError$.emit({documentId:e,message:r,code:t.reason?.code,reason:t.reason})}generateDocumentId(){return`doc-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}extractNameFromUrl(e){try{let t=new URL(e).pathname.split(`/`).pop();if(!t)return;let n=decodeURIComponent(t);return n.toLowerCase().endsWith(`.pdf`)||(n+=`.pdf`),n}catch{return}}async initialize(e){if(this.logger.info(`DocumentManagerPlugin`,`Initialize`,`Document Manager Plugin initialized`,{maxDocuments:this.maxDocuments,initialDocumentsCount:e.initialDocuments?.length??0}),e.initialDocuments&&e.initialDocuments.length>0)for(let t of e.initialDocuments)try{`buffer`in t?this.openDocumentBuffer(t):`url`in t&&this.openDocumentUrl(t)}catch(e){this.logger.error(`DocumentManagerPlugin`,`Initialize`,`Failed to initiate initial document load`,e)}}async destroy(){await this.closeAllDocuments().toPromise(),this.loadOptions.clear(),this.documentOpened$.clear(),this.documentClosed$.clear(),this.activeDocumentChanged$.clear(),this.documentOrderChanged$.clear(),this.documentError$.clear(),super.destroy()}};Po.id=`document-manager`;var Fo=Po,Io=`document-manager`;function Lo({documentId:e,children:t}){let n=ni(e);return n?I(A,{children:t({documentState:n,isLoading:n.status===`loading`,isError:n.status===`error`,isLoaded:n.status===`loaded`})}):null}var Ro=()=>ei(Fo.id),zo=Yr({manifest:{id:Io,name:`Document Manager Plugin`,version:`1.0.0`,provides:[`document-manager`],requires:[],optional:[],defaultConfig:{maxDocuments:10}},create:(e,t)=>new Fo(Io,e,t),reducer:e=>e,initialState:{}}).addUtility(function(){let{plugin:e}=$r(Fo.id),{provides:t}=Ro(),n=N(null),r=N(null),i=N(void 0);return M(()=>{if(e?.onOpenFileRequest)return e.onOpenFileRequest(({task:e,options:t})=>{var a;r.current=e,i.current=t,(a=n.current)==null||a.click()})},[e]),I(`input`,{ref:n,type:`file`,accept:`application/pdf`,style:{display:`none`},onChange:async e=>{let n=e.currentTarget.files?.[0];if(!n||!t)return;let a=await n.arrayBuffer();t.openDocumentBuffer({name:n.name,buffer:a,documentId:i.current?.documentId,scale:i.current?.scale,rotation:i.current?.rotation,autoActivate:i.current?.autoActivate}).wait(e=>{var t;(t=r.current)==null||t.resolve(e)},e=>{var t;(t=r.current)==null||t.fail(e)})}})}).build(),Bo=`commands`,Vo={id:Bo,name:`Commands Plugin`,version:`1.0.0`,provides:[`commands`],requires:[],optional:[`i18n`,`ui`],defaultConfig:{commands:{}}},Ho=`COMMANDS/SET_DISABLED_CATEGORIES`,Uo=e=>({type:Ho,payload:e}),Wo=class extends Rr{constructor(e,t,n){var r;super(e,t),this.commands=new Map,this.i18n=null,this.shortcutMap=new Map,this.commandExecuted$=Kr(),this.commandStateChanged$=Kr(),this.shortcutExecuted$=Kr(),this.categoryChanged$=J(),this.previousStates=new Map;let i=t.getPlugin(`i18n`);this.i18n=i?.provides()??null,(r=n.disabledCategories)!=null&&r.length&&this.dispatch(Uo(n.disabledCategories)),Object.values(n.commands).forEach(e=>{this.registerCommand(e)}),this.registry.getStore().subscribe((e,t)=>{this.onGlobalStoreChange(t)})}onDocumentClosed(e){this.previousStates.delete(e),this.logger.debug(`CommandsPlugin`,`DocumentClosed`,`Cleaned up command state cache for document: ${e}`)}async initialize(){this.logger.info(`CommandsPlugin`,`Initialize`,`Commands plugin initialized`)}async destroy(){this.commandExecuted$.clear(),this.commandStateChanged$.clear(),this.shortcutExecuted$.clear(),this.categoryChanged$.clear(),this.commands.clear(),this.shortcutMap.clear(),this.previousStates.clear(),super.destroy()}disableCategoryImpl(e){let t=new Set(this.state.disabledCategories);t.has(e)||(t.add(e),this.dispatch(Uo(Array.from(t))),this.categoryChanged$.emit({disabledCategories:Array.from(t)}))}enableCategoryImpl(e){let t=new Set(this.state.disabledCategories);t.has(e)&&(t.delete(e),this.dispatch(Uo(Array.from(t))),this.categoryChanged$.emit({disabledCategories:Array.from(t)}))}toggleCategoryImpl(e){this.state.disabledCategories.includes(e)?this.enableCategoryImpl(e):this.disableCategoryImpl(e)}setDisabledCategoriesImpl(e){this.dispatch(Uo(e)),this.categoryChanged$.emit({disabledCategories:e})}isCommandCategoryDisabled(e){return!!e.categories?.length&&e.categories.some(e=>this.state.disabledCategories.includes(e))}buildCapability(){return{resolve:(e,t)=>this.resolve(e,t),execute:(e,t,n=`ui`)=>this.execute(e,t,n),getAllCommands:e=>this.getAllCommands(e),getCommandsByCategory:(e,t)=>this.getCommandsByCategory(e,t),getCommandByShortcut:e=>this.getCommandByShortcut(e),getAllShortcuts:()=>new Map(this.shortcutMap),forDocument:e=>this.createCommandScope(e),registerCommand:e=>this.registerCommand(e),unregisterCommand:e=>this.unregisterCommand(e),disableCategory:e=>this.disableCategoryImpl(e),enableCategory:e=>this.enableCategoryImpl(e),toggleCategory:e=>this.toggleCategoryImpl(e),setDisabledCategories:e=>this.setDisabledCategoriesImpl(e),getDisabledCategories:()=>this.state.disabledCategories,isCategoryDisabled:e=>this.state.disabledCategories.includes(e),onCommandExecuted:this.commandExecuted$.on,onCommandStateChanged:this.commandStateChanged$.on,onShortcutExecuted:this.shortcutExecuted$.on,onCategoryChanged:this.categoryChanged$.on}}createCommandScope(e){return{resolve:t=>this.resolve(t,e),execute:(t,n=`ui`)=>this.execute(t,e,n),getAllCommands:()=>this.getAllCommands(e),getCommandsByCategory:t=>this.getCommandsByCategory(t,e),onCommandStateChanged:t=>this.commandStateChanged$.on(n=>{if(n.documentId===e){let{documentId:e,...r}=n;t(r)}})}}resolve(e,t){let n=t??this.getActiveDocumentId(),r=this.commands.get(e);if(!r)throw Error(`Command not found: ${e}`);let i=this.registry.getStore().getState(),a=this.resolveLabel(r,i,n),o=r.shortcuts?Array.isArray(r.shortcuts)?r.shortcuts:[r.shortcuts]:void 0,s=this.resolveDynamic(r.disabled,i,n)??!1,c=this.isCommandCategoryDisabled(r),l=s||c;return{id:r.id,label:a,icon:this.resolveDynamic(r.icon,i,n),iconProps:this.resolveDynamic(r.iconProps,i,n),active:this.resolveDynamic(r.active,i,n)??!1,disabled:l,visible:this.resolveDynamic(r.visible,i,n)??!0,shortcuts:o,shortcutLabel:r.shortcutLabel,categories:r.categories,description:r.description,execute:()=>r.action({registry:this.registry,state:i,documentId:n,logger:this.logger})}}resolveLabel(e,t,n){let r=this.resolveDynamic(e.labelKey,t,n);if(r&&this.i18n){let i=this.resolveDynamic(e.labelParams,t,n);return this.i18n.t(r,{params:i,documentId:n})}return e.label?e.label:e.id}resolveDynamic(e,t,n){if(e!==void 0)return typeof e==`function`?e({registry:this.registry,state:t,documentId:n,logger:this.logger}):e}execute(e,t,n=`ui`){let r=t??this.getActiveDocumentId(),i=this.resolve(e,r);i.disabled?this.logger.warn(`CommandsPlugin`,`ExecutionBlocked`,`Command '${e}' is disabled for document '${r}'`):i.visible?(i.execute(),this.commandExecuted$.emit({commandId:e,documentId:r,source:n}),this.logger.debug(`CommandsPlugin`,`CommandExecuted`,`Command '${e}' executed for document '${r}' (source: ${n})`)):this.logger.warn(`CommandsPlugin`,`ExecutionBlocked`,`Command '${e}' is not visible for document '${r}'`)}registerCommand(e){this.commands.has(e.id)&&this.logger.warn(`CommandsPlugin`,`CommandOverwrite`,`Command '${e.id}' already exists and will be overwritten`),this.commands.set(e.id,e),e.shortcuts&&(Array.isArray(e.shortcuts)?e.shortcuts:[e.shortcuts]).forEach(t=>{let n=this.normalizeShortcut(t);this.shortcutMap.set(n,e.id)}),this.logger.debug(`CommandsPlugin`,`CommandRegistered`,`Command '${e.id}' registered`)}unregisterCommand(e){let t=this.commands.get(e);t&&(t.shortcuts&&(Array.isArray(t.shortcuts)?t.shortcuts:[t.shortcuts]).forEach(e=>{let t=this.normalizeShortcut(e);this.shortcutMap.delete(t)}),this.commands.delete(e),this.logger.debug(`CommandsPlugin`,`CommandUnregistered`,`Command '${e}' unregistered`))}getCommandByShortcut(e){let t=this.normalizeShortcut(e),n=this.shortcutMap.get(t);return n?this.commands.get(n)??null:null}normalizeShortcut(e){return e.toLowerCase().split(`+`).sort().join(`+`)}getAllCommands(e){let t=e??this.getActiveDocumentId();return Array.from(this.commands.keys()).map(e=>this.resolve(e,t))}getCommandsByCategory(e,t){let n=t??this.getActiveDocumentId();return Array.from(this.commands.values()).filter(t=>t.categories?.includes(e)).map(e=>this.resolve(e.id,n))}onGlobalStoreChange(e){Object.keys(e.core.documents).forEach(t=>{this.detectCommandChanges(t,e)})}detectCommandChanges(e,t){let n=t.core.documents[e];if(!n||n.status!==`loaded`)return;let r=this.previousStates.get(e)??new Map;this.commands.forEach((t,n)=>{let i=this.resolve(n,e),a=r.get(n);if(!a)return void r.set(n,i);let o={};a.active!==i.active&&(o.active=i.active),a.disabled!==i.disabled&&(o.disabled=i.disabled),a.visible!==i.visible&&(o.visible=i.visible),a.label!==i.label&&(o.label=i.label),a.icon!==i.icon&&(o.icon=i.icon),Hr(a.iconProps,i.iconProps)||(o.iconProps=i.iconProps),Object.keys(o).length>0&&(r.set(n,i),this.commandStateChanged$.emit({commandId:n,documentId:e,changes:o}))}),this.previousStates.set(e,r)}};Wo.id=`commands`;var Go=Wo,Ko={disabledCategories:[]},qo=()=>ei(Go.id),Jo=(e,t)=>{let{provides:n}=qo(),[r,i]=j(()=>n?n.resolve(e,t):null);return M(()=>n?(i(n.resolve(e,t)),n.onCommandStateChanged(r=>{r.commandId===e&&r.documentId===t&&i(n.resolve(e,t))})):void i(null),[n,e,t]),r},Yo=Yr({manifest:Vo,create:(e,t)=>new Go(Bo,e,t),reducer:(e=Ko,t)=>t.type===Ho?{...e,disabledCategories:t.payload}:e,initialState:Ko}).addUtility(function(){let{provides:e}=qo();return M(()=>{if(!e)return;let t=function(e){return t=>{let n=t.composedPath()[0]||t.target;if((n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable)&&t.key!==`Tab`)return;let r=function(e){let t=[];e.ctrlKey&&t.push(`ctrl`),e.shiftKey&&t.push(`shift`),e.altKey&&t.push(`alt`),e.metaKey&&t.push(`meta`);let n=e.key.toLowerCase();return n===` `&&(n=`space`),[`control`,`shift`,`alt`,`meta`].includes(n)?null:[...t,n].sort().join(`+`)}(t);if(!r)return;let i=e.getCommandByShortcut(r);if(!i)return;let a=e.resolve(i.id);!a.disabled&&a.visible&&(t.preventDefault(),t.stopPropagation(),e.execute(i.id,void 0,`keyboard`))}}(e);return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e]),null}).build(),Xo=`i18n`,Zo={id:Xo,name:`I18n Plugin`,version:`1.0.0`,provides:[`i18n`],requires:[],optional:[],defaultConfig:{defaultLocale:`en`,locales:[{code:`en`,name:`English`,translations:{commands:{zoom:{in:`Zoom In`,out:`Zoom Out`,fitWidth:`Fit to Width`,fitPage:`Fit to Page`,automatic:`Automatic`,level:`Zoom Level ({level}%)`,inArea:`Zoom In Area`},fullscreen:{enter:`Enter Full Screen`,exit:`Exit Full Screen`},rotate:{clockwise:`Rotate Clockwise`,counterclockwise:`Rotate Counter-Clockwise`},menu:`Menu`,sidebar:`Sidebar`,search:`Search`,comment:`Comment`,download:`Download`,print:`Print`,openFile:`Open PDF`,save:`Save`,settings:`Settings`,view:`View`,annotate:`Annotate`,shapes:`Shapes`,redact:`Redact`,fillAndSign:`Fill and Sign`,form:`Form`,pan:`Pan`,pointer:`Pointer`,undo:`Undo`,redo:`Redo`,copy:`Copy`,screenshot:`Screenshot`,nextPage:`Next Page`,previousPage:`Previous Page`}}},{code:`es`,name:`Español`,translations:{commands:{zoom:{in:`Acercar`,out:`Alejar`,fitWidth:`Ajustar al ancho`,fitPage:`Ajustar a la página`,automatic:`Automático`,level:`Nivel de zoom ({level}%)`,inArea:`Acercar área`},fullscreen:{enter:`Pantalla completa`,exit:`Salir de pantalla completa`},rotate:{clockwise:`Girar a la derecha`,counterclockwise:`Girar a la izquierda`},menu:`Menú`,sidebar:`Barra lateral`,search:`Buscar`,comment:`Comentario`,download:`Descargar`,print:`Imprimir`,openFile:`Abrir PDF`,save:`Guardar`,settings:`Configuración`,view:`Ver`,annotate:`Anotar`,shapes:`Formas`,redact:`Redactar`,fillAndSign:`Rellenar y firmar`,form:`Formulario`,pan:`Desplazar`,pointer:`Puntero`,undo:`Deshacer`,redo:`Rehacer`,copy:`Copiar`,screenshot:`Captura de pantalla`,nextPage:`Página siguiente`,previousPage:`Página anterior`}}}]}},Qo=`I18N/SET_LOCALE`,$o=`I18N/REGISTER_LOCALE`,es=e=>({type:Qo,payload:e}),ts=e=>({type:$o,payload:e}),ns=class extends Rr{constructor(e,t,n){super(e,t),this.locales=new Map,this.paramResolvers=new Map,this.paramsCache=new Map,this.localeChange$=Kr(),this.paramsChanged$=qr((e,t)=>({documentId:e,...t}),{cache:!1}),this.config=n,n.locales.forEach(e=>{this.locales.set(e.code,e),this.dispatch(ts(e.code))}),n.paramResolvers&&Object.entries(n.paramResolvers).forEach(([e,t])=>{this.paramResolvers.set(e,t)}),this.dispatch(es(n.defaultLocale)),this.registry.getStore().subscribe((e,t)=>{this.detectParamChanges(t)})}async initialize(){this.logger.info(`I18nPlugin`,`Initialize`,`I18n plugin initialized`)}async destroy(){this.localeChange$.clear(),this.paramsChanged$.clear(),this.paramResolvers.clear(),this.paramsCache.clear(),super.destroy()}onDocumentClosed(e){this.paramsCache.delete(e),this.paramsChanged$.clearScope(e),this.logger.debug(`I18nPlugin`,`DocumentClosed`,`Cleaned up params cache for document: ${e}`)}buildCapability(){return{t:(e,t)=>this.translate(e,t),forDocument:e=>this.createI18nScope(e),registerParamResolver:(e,t)=>this.registerParamResolver(e,t),unregisterParamResolver:e=>this.unregisterParamResolver(e),setLocale:e=>this.setLocale(e),getLocale:()=>this.state.currentLocale,getAvailableLocales:()=>[...this.state.availableLocales],getLocaleInfo:e=>this.locales.get(e)??null,registerLocale:e=>this.registerLocale(e),hasLocale:e=>this.locales.has(e),onLocaleChange:this.localeChange$.on,onParamsChanged:this.paramsChanged$.onGlobal}}createI18nScope(e){return{t:(t,n)=>this.translate(t,{documentId:e,...n}),onParamsChanged:this.paramsChanged$.forScope(e)}}translate(e,t){let n=this.locales.get(this.state.currentLocale),r=this.config.fallbackLocale?this.locales.get(this.config.fallbackLocale):null,i=this.getNestedValue(n?.translations,e);if(!i&&r&&(i=this.getNestedValue(r.translations,e)),!i){if(!t?.fallback)return this.logger.warn(`I18nPlugin`,`MissingTranslation`,`Translation not found for key: ${e}`),e;i=t.fallback}let a=t?.params;return!a&&this.paramResolvers.has(e)&&(a=this.resolveParams(e,t?.documentId)),this.interpolate(i,a)}resolveParams(e,t){let n=this.paramResolvers.get(e);if(!n)return;let r=this.registry.getStore().getState();try{return n({state:r,documentId:t})}catch(t){this.logger.error(`I18nPlugin`,`ParamResolverError`,`Error resolving params for key "${e}":`,t);return}}getNestedValue(e,t){if(!e)return;let n=t.split(`.`),r=e;for(let e of n){if(r==null)return;r=r[e]}return typeof r==`string`?r:void 0}interpolate(e,t){return t?e.replace(/\{(\w+)\}/g,(e,n)=>{let r=t[n];return r===void 0?e:String(r)}):e}detectParamChanges(e){Object.keys(e.core.documents).forEach(t=>{this.detectDocumentParamChanges(t,e)})}detectDocumentParamChanges(e,t){let n=this.paramsCache.get(e),r=[];this.paramResolvers.forEach((i,a)=>{try{let o=i({state:t,documentId:e});Hr(n?.get(a),o)||(r.push(a),this.paramsCache.has(e)||this.paramsCache.set(e,new Map),this.paramsCache.get(e).set(a,o))}catch(e){this.logger.error(`I18nPlugin`,`ParamDetectionError`,`Error detecting param changes for key "${a}":`,e)}}),r.length>0&&(this.paramsChanged$.emit(e,{changedKeys:r}),this.logger.debug(`I18nPlugin`,`ParamsChanged`,`Translation params changed for document ${e}:`,r))}registerParamResolver(e,t){this.paramResolvers.has(e)&&this.logger.warn(`I18nPlugin`,`ResolverOverwrite`,`Param resolver for "${e}" already exists and will be overwritten`),this.paramResolvers.set(e,t),this.paramsCache.forEach(t=>{t.delete(e)}),this.logger.debug(`I18nPlugin`,`ResolverRegistered`,`Param resolver registered for: ${e}`)}unregisterParamResolver(e){this.paramResolvers.delete(e)&&(this.paramsCache.forEach(t=>{t.delete(e)}),this.logger.debug(`I18nPlugin`,`ResolverUnregistered`,`Param resolver unregistered for: ${e}`))}setLocale(e){if(!this.locales.has(e))return void this.logger.warn(`I18nPlugin`,`LocaleNotFound`,`Locale '${e}' is not registered`);let t=this.state.currentLocale;t!==e&&(this.dispatch(es(e)),this.localeChange$.emit({previousLocale:t,currentLocale:e}),this.logger.info(`I18nPlugin`,`LocaleChanged`,`Locale changed to: ${e}`))}registerLocale(e){this.locales.has(e.code)?this.logger.warn(`I18nPlugin`,`LocaleAlreadyRegistered`,`Locale '${e.code}' is already registered`):(this.locales.set(e.code,e),this.dispatch(ts(e.code)),this.logger.info(`I18nPlugin`,`LocaleRegistered`,`Locale registered: ${e.code}`))}};ns.id=`i18n`;var rs=ns,is={currentLocale:`en`,availableLocales:[]},as={manifest:Zo,create:(e,t)=>new rs(Xo,e,t),reducer:(e=is,t)=>{switch(t.type){case Qo:{let n=t.payload;return e.availableLocales.includes(n)?{...e,currentLocale:n}:(console.warn(`I18nPlugin: Locale '${n}' not available`),e)}case $o:{let n=t.payload;return e.availableLocales.includes(n)?e:{...e,availableLocales:[...e.availableLocales,n]}}default:return e}},initialState:is},os=e=>{let{provides:t}=ei(rs.id),[,n]=Qe(e=>e+1,0),r=F((n,r)=>t?t.t(n,{documentId:e,params:r?.params,fallback:r?.fallback}):r?.fallback??n,[t,e]);return M(()=>{if(!t)return;let r=t.onLocaleChange(()=>{n()}),i=e?t.forDocument(e).onParamsChanged(()=>{n()}):t.onParamsChanged(()=>{n()});return()=>{r(),i()}},[t,e]),{translate:r,locale:t?.getLocale()??`en`}},ss=(e=>(e.Automatic=`automatic`,e.FitPage=`fit-page`,e.FitWidth=`fit-width`,e))(ss||{}),cs=(e=>(e[e.Center=0]=`Center`,e[e.Top=1]=`Top`,e))(cs||{}),ls=`zoom`,us={id:ls,name:`Zoom Plugin`,version:`1.0.0`,provides:[`zoom`],requires:[`viewport`,`scroll`],optional:[`interaction-manager`,`spread`],defaultConfig:{defaultZoomLevel:ss.Automatic,minZoom:.2,maxZoom:60,zoomStep:.1,zoomRanges:[{min:.2,max:.5,step:.05},{min:.5,max:1,step:.1},{min:1,max:2,step:.2},{min:2,max:4,step:.4},{min:4,max:10,step:.8},{min:10,max:20,step:1.6},{min:20,max:40,step:3.2},{min:40,max:60,step:6.4}],presets:[{name:`Fit Page`,value:ss.FitPage},{name:`Fit Width`,value:ss.FitWidth},{name:`Automatic`,value:ss.Automatic},{name:`25%`,value:.25},{name:`50%`,value:.5},{name:`100%`,value:1},{name:`125%`,value:1.25},{name:`150%`,value:1.5},{name:`200%`,value:2},{name:`400%`,value:4},{name:`800%`,value:8},{name:`1600%`,value:16}]}},ds=`ZOOM/INIT_STATE`,fs=`ZOOM/CLEANUP_STATE`,ps=`ZOOM/SET_ZOOM_LEVEL`,ms=`ZOOM/SET_MARQUEE_ZOOM_ACTIVE`,hs={zoomLevel:ss.Automatic,currentZoomLevel:1,isMarqueeZoomActive:!1},gs={documents:{},activeDocumentId:null},_s=class extends Rr{constructor(e,t,n){var r,i,a;super(e,t),this.zoom$=Kr(),this.state$=J(),this.viewportPlugin=t.getPlugin(`viewport`),this.viewport=this.viewportPlugin.provides(),this.scroll=t.getPlugin(`scroll`).provides();let o=t.getPlugin(`interaction-manager`);this.interactionManager=o?.provides()??null;let s=t.getPlugin(`spread`);this.spread=s?.provides()??null,this.minZoom=n.minZoom??.25,this.maxZoom=n.maxZoom??10,this.zoomStep=n.zoomStep??.1,this.defaultZoomLevel=n.defaultZoomLevel,this.presets=n.presets??[],this.zoomRanges=this.normalizeRanges(n.zoomRanges??[]),this.viewport.onViewportResize(e=>this.recalcAuto(e.documentId,cs.Top),{mode:`debounce`,wait:150,keyExtractor:e=>e.documentId}),(r=this.spread)==null||r.onSpreadChange(e=>{this.recalcAuto(e.documentId,cs.Top)}),(i=this.interactionManager)==null||i.registerMode({id:`marqueeZoom`,scope:`page`,exclusive:!0,cursor:`zoom-in`}),(a=this.interactionManager)==null||a.onModeChange(e=>{let t=e.activeMode===`marqueeZoom`,n=this.getDocumentState(e.documentId);var r;n&&n.isMarqueeZoomActive!==t&&this.dispatch((r=e.documentId,{type:ms,payload:{documentId:r,isActive:t}}))})}onDocumentLoadingStarted(e){this.viewport.gate(`zoom`,e);let t={...hs,zoomLevel:this.defaultZoomLevel};this.dispatch(function(e,t){return{type:ds,payload:{documentId:e,state:t}}}(e,t)),this.logger.debug(`ZoomPlugin`,`DocumentOpened`,`Initialized zoom state for document: ${e}`)}onDocumentLoaded(e){this.recalcAuto(e,cs.Top)}onDocumentClosed(e){this.dispatch(function(e){return{type:fs,payload:e}}(e)),this.logger.debug(`ZoomPlugin`,`DocumentClosed`,`Cleaned up zoom state for document: ${e}`)}onRotationChanged(e){this.recalcAuto(e,cs.Top)}buildCapability(){return{requestZoom:(e,t)=>this.requestZoom(e,t),requestZoomBy:(e,t)=>this.requestZoomBy(e,t),zoomIn:()=>this.zoomIn(),zoomOut:()=>this.zoomOut(),zoomToArea:(e,t)=>this.zoomToArea(e,t),enableMarqueeZoom:()=>this.enableMarqueeZoom(),disableMarqueeZoom:()=>this.disableMarqueeZoom(),toggleMarqueeZoom:()=>this.toggleMarqueeZoom(),isMarqueeZoomActive:()=>this.isMarqueeZoomActive(),getState:()=>this.getDocumentStateOrThrow(),forDocument:e=>this.createZoomScope(e),registerMarqueeOnPage:e=>this.registerMarqueeOnPage(e),getPresets:()=>this.presets,onZoomChange:this.zoom$.on,onStateChange:this.state$.on}}createZoomScope(e){return{requestZoom:(t,n)=>this.requestZoom(t,n,e),requestZoomBy:(t,n)=>this.requestZoomBy(t,n,e),zoomIn:()=>this.zoomIn(e),zoomOut:()=>this.zoomOut(e),zoomToArea:(t,n)=>this.zoomToArea(t,n,e),enableMarqueeZoom:()=>this.enableMarqueeZoom(e),disableMarqueeZoom:()=>this.disableMarqueeZoom(e),toggleMarqueeZoom:()=>this.toggleMarqueeZoom(e),isMarqueeZoomActive:()=>this.isMarqueeZoomActive(e),getState:()=>this.getDocumentStateOrThrow(e),onZoomChange:t=>this.zoom$.on(n=>{n.documentId===e&&t(n)}),onStateChange:t=>this.state$.on(n=>{n.documentId===e&&t(n.state)})}}getDocumentState(e){let t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){let t=this.getDocumentState(e);if(!t)throw Error(`Zoom state not found for document: ${e??`active`}`);return t}requestZoom(e,t,n){this.handleRequest({level:e,center:t},n)}requestZoomBy(e,t,n){let r=n??this.getActiveDocumentId(),i=this.getDocumentStateOrThrow(r).currentZoomLevel,a=this.toZoom(i+e);this.handleRequest({level:a,center:t},r)}zoomIn(e){let t=e??this.getActiveDocumentId(),n=this.getDocumentStateOrThrow(t).currentZoomLevel;this.handleRequest({level:n,delta:this.stepFor(n)},t)}zoomOut(e){let t=e??this.getActiveDocumentId(),n=this.getDocumentStateOrThrow(t).currentZoomLevel;this.handleRequest({level:n,delta:-this.stepFor(n)},t)}zoomToArea(e,t,n){let r=n??this.getActiveDocumentId();this.handleZoomToArea(r,e,t)}enableMarqueeZoom(e){var t;let n=e??this.getActiveDocumentId();(t=this.interactionManager)==null||t.forDocument(n).activate(`marqueeZoom`)}disableMarqueeZoom(e){var t;let n=e??this.getActiveDocumentId();(t=this.interactionManager)==null||t.forDocument(n).activateDefaultMode()}toggleMarqueeZoom(e){let t=e??this.getActiveDocumentId(),n=this.interactionManager?.forDocument(t);n?.getActiveMode()===`marqueeZoom`?n.activateDefaultMode():n?.activate(`marqueeZoom`)}isMarqueeZoomActive(e){let t=e??this.getActiveDocumentId();return this.interactionManager?.forDocument(t).getActiveMode()===`marqueeZoom`}handleRequest({level:e,delta:t=0,center:n,focus:r=cs.Center,align:i=`keep`},a){let o=a??this.getActiveDocumentId(),s=this.getDocumentStateOrThrow(o);if(!this.coreState.core.documents[o])return;let c=this.viewport.forDocument(o),l=c.getMetrics(),u=s.currentZoomLevel;if(l.clientWidth===0||l.clientHeight===0)return;let d=typeof e==`number`?e:this.computeZoomForMode(o,e,l);if(!1===d)return;let f=q(d+t,this.minZoom,this.maxZoom),p=Math.floor(1e3*f)/1e3,m=n??{vx:l.clientWidth/2,vy:r===cs.Top?0:l.clientHeight/2},{desiredScrollLeft:h,desiredScrollTop:g}=this.computeScrollForZoomChange(o,l,u,p,m,i);isNaN(h)||isNaN(g)||this.viewportPlugin.setViewportScrollMetrics(o,{scrollLeft:h,scrollTop:g}),this.dispatch(function(e,t,n){return{type:ps,payload:{documentId:e,zoomLevel:t,currentZoomLevel:n}}}(o,typeof e==`number`?p:e,p)),this.dispatchCoreAction(((e,t)=>({type:br,payload:{scale:e,documentId:t}}))(p,o)),this.viewport.isGated(o)&&this.viewport.releaseGate(`zoom`,o),c.scrollTo({x:h,y:g,behavior:`instant`});let _={documentId:o,oldZoom:u,newZoom:p,level:e,center:m,desiredScrollLeft:h,desiredScrollTop:g,viewport:l};this.zoom$.emit(_)}computeZoomForMode(e,t,n){if(!this.coreState.core.documents[e])return!1;let r=this.scroll.forDocument(e),i=r?this.scroll.getPageGap():0,a=this.viewport.getViewportGap(),o=r.getSpreadPagesWithRotatedSize();if(!o.length||n.clientWidth===0||n.clientHeight===0)return!1;let s=n.clientWidth-2*a,c=n.clientHeight-2*a;if(s<=0||c<=0)return!1;let l=0,u=0;switch(o.forEach(e=>{let t=e.reduce((e,t,n)=>e+t.rotatedSize.width+(n?i:0),0),n=Math.max(...e.map(e=>e.rotatedSize.height));l=Math.max(l,t),u=Math.max(u,n)}),t){case ss.FitWidth:return s/l;case ss.FitPage:return Math.min(s/l,c/u);case ss.Automatic:return Math.min(s/l,1);default:return 1}}computeScrollForZoomChange(e,t,n,r,i,a=`keep`){let o=this.scroll.forDocument(e).getLayout(),s=this.viewport.getViewportGap(),c=o.totalContentSize.width,l=o.totalContentSize.height,u=t.clientWidth-2*s,d=t.clientHeight-2*s,f=(e,t,n)=>t*n<e?(e-t*n)/2:0,p=f(u,c,n),m=f(d,l,n),h=f(u,c,r),g=f(d,l,r),_=(t.scrollLeft+i.vx-s-p)/n*r+s+h,v=(t.scrollTop+i.vy-s-m)/n*r+s+g,y=a===`center`?_-t.clientWidth/2:_-i.vx,b=a===`center`?v-t.clientHeight/2:v-i.vy;return{desiredScrollLeft:Math.max(0,y),desiredScrollTop:Math.max(0,b)}}handleZoomToArea(e,t,n){let r=this.coreState.core.documents[e];if(!r)return;let i=r.rotation,a=this.viewport.forDocument(e).getMetrics(),o=this.viewport.getViewportGap(),s=this.getDocumentStateOrThrow(e).currentZoomLevel,c=a.clientWidth-2*o,l=a.clientHeight-2*o,u=this.scroll.forDocument(e).getLayout(),d=u.virtualItems.find(e=>e.pageLayouts.some(e=>e.pageIndex===t));if(!d)return;let f=d.pageLayouts.find(e=>e.pageIndex===t),p=Ct({width:f.width,height:f.height},n,i),m=this.toZoom(Math.min(c/p.size.width,l/p.size.height)),h=d.x+f.x,g=d.y+f.y,_=h+p.origin.x+p.size.width/2,v=g+p.origin.y+p.size.height/2,y=(e,t,n)=>t*n<e?(e-t*n)/2:0,b=y(c,u.totalContentSize.width,s),x=y(l,u.totalContentSize.height,s),S=o+b+_*s-a.scrollLeft,C=o+x+v*s-a.scrollTop;this.handleRequest({level:m,center:{vx:S,vy:C},align:`center`},e)}recalcAuto(e,t){let n=this.getDocumentState(e);n&&(n.zoomLevel!==ss.Automatic&&n.zoomLevel!==ss.FitPage&&n.zoomLevel!==ss.FitWidth||this.handleRequest({level:n.zoomLevel,focus:t},e))}normalizeRanges(e){return[...e].filter(e=>e.step>0&&e.max>e.min).sort((e,t)=>e.min-t.min)}stepFor(e){let t=this.zoomRanges.find(t=>e>=t.min&&e<t.max);return t?t.step:this.zoomStep}toZoom(e){return parseFloat(q(e,this.minZoom,this.maxZoom).toFixed(2))}registerMarqueeOnPage(e){if(!this.interactionManager)return this.logger.warn(`ZoomPlugin`,`MissingDependency`,`Interaction manager plugin not loaded, marquee zoom disabled`),()=>{};let t=this.coreState.core.documents[e.documentId];if(!t||!t.document)return this.logger.warn(`ZoomPlugin`,`DocumentNotFound`,`Document not found`),()=>{};let n=t.document.pages[e.pageIndex];if(!n)return this.logger.warn(`ZoomPlugin`,`PageNotFound`,`Page ${e.pageIndex} not found`),()=>{};let r=function(e){let{pageSize:t,scale:n,minDragPx:r=5,onPreview:i,onCommit:a,onSmallDrag:o}=e,s=null,c=null;return{onPointerDown:(e,t)=>{var n;s=e,c={origin:{x:e.x,y:e.y},size:{width:0,height:0}},i?.(c),(n=t.setPointerCapture)==null||n.call(t)},onPointerMove:e=>{if(!s)return;let n=q(e.x,0,t.width),r=q(e.y,0,t.height);c={origin:{x:Math.min(s.x,n),y:Math.min(s.y,r)},size:{width:Math.abs(n-s.x),height:Math.abs(r-s.y)}},i?.(c)},onPointerUp:(e,t)=>{var l;c&&(Math.max(c.size.width,c.size.height)*n>r?a?.(c):o?.()),s=null,c=null,i?.(null),(l=t.releasePointerCapture)==null||l.call(t)},onPointerCancel:(e,t)=>{var n;s=null,c=null,i?.(null),(n=t.releasePointerCapture)==null||n.call(t)}}}({pageSize:n.size,scale:e.scale,onPreview:e.callback.onPreview,onCommit:t=>{var n,r;this.zoomToArea(e.pageIndex,t,e.documentId),(r=(n=e.callback).onCommit)==null||r.call(n,t)},onSmallDrag:()=>{var t,n;this.zoomIn(e.documentId),(n=(t=e.callback).onSmallDrag)==null||n.call(t)}});return this.interactionManager.registerHandlers({documentId:e.documentId,modeId:`marqueeZoom`,handlers:r,pageIndex:e.pageIndex})}onStoreUpdated(e,t){for(let n in t.documents){let r=e.documents[n],i=t.documents[n];r&&i&&(r.currentZoomLevel!==i.currentZoomLevel||r.zoomLevel!==i.zoomLevel||r.isMarqueeZoomActive!==i.isMarqueeZoomActive)&&this.state$.emit({documentId:n,state:i})}}async initialize(){this.logger.info(`ZoomPlugin`,`Initialize`,`Zoom plugin initialized`)}async destroy(){this.zoom$.clear(),this.state$.clear(),super.destroy()}};_s.id=`zoom`;var vs=_s,ys={manifest:us,create:(e,t)=>new vs(ls,e,t),reducer:(e=gs,t)=>{switch(t.type){case ds:{let{documentId:n,state:r}=t.payload;return{...e,documents:{...e.documents,[n]:r},activeDocumentId:e.activeDocumentId??n}}case fs:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case`ZOOM/SET_ACTIVE_DOCUMENT`:return{...e,activeDocumentId:t.payload};case ps:{let{documentId:n,zoomLevel:r,currentZoomLevel:i}=t.payload,a=e.documents[n];return a?{...e,documents:{...e.documents,[n]:{...a,zoomLevel:r,currentZoomLevel:i}}}:e}case ms:{let{documentId:n,isActive:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,isMarqueeZoomActive:r}}}:e}default:return e}},initialState:gs},bs=()=>ei(vs.id);function xs(e){let[t,n]=[e[0],e[1]],r=n.clientX-t.clientX,i=n.clientY-t.clientY;return Math.hypot(r,i)}function Ss(e,t={}){let{provides:n}=ei(`viewport`),{provides:r}=bs(),i=et(Oi),a=N(null);return $e(()=>{let o=a.current,s=i?.current;if(o&&s&&r)return function({element:e,container:t,documentId:n,zoomProvides:r,viewportGap:i=0,options:a={}}){let{enablePinch:o=!0,enableWheel:s=!0}=a;if(typeof window>`u`)return()=>{};let c=r.forDocument(n),l=()=>c.getState(),u=0,d=1,f=!1,p=0,m=null,h=1,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,ee=(e,t,n)=>Math.min(Math.max(e,t),n),te=()=>{let n=t.clientWidth-2*i,r=e.offsetWidth,a=r<n?(n-r)/2:0;e.style.marginLeft=`${a}px`},ne=e=>{let t=g*e,n=_*e,r=w*(1-e),i=C-t/2-v,a=T-O*e-v,o=Math.max(0,t-S),s=.3*S,c=Math.min(1,o/s),l=i+(a-i)*c;return n>x-2*D&&(r=ee(y+r,x-D-n,D)-y),t>b-2*D&&(l=ee(v+l,b-D-t,D)-v),{tx:l,ty:r,blend:c,finalWidth:t}},re=t=>{d=t;let{tx:n,ty:r}=ne(t);e.style.transformOrigin=`0 0`,e.style.transform=`translate(${n}px, ${r}px) scale(${t})`},ie=()=>{e.style.transform=`none`,e.style.transformOrigin=`0 0`,d=1},ae=()=>{let{tx:e,finalWidth:t}=ne(d),n=(d-1)*u,r,i=E;if(t<=S)r=C;else{let t=1-d;r=Math.abs(t)>.001?v+e/t:T}c.requestZoomBy(n,{vx:r,vy:i}),ie(),u=0},oe=(n,r)=>{let a=t.getBoundingClientRect(),o=e.getBoundingClientRect();D=i,g=o.width,_=o.height,v=o.left-a.left,y=o.top-a.top,b=a.width,x=a.height,S=t.clientWidth,C=t.clientLeft+S/2;let s=n-o.left;w=r-o.top,T=n-a.left,E=r-a.top,O=g<S?T*g/S:s},se=e=>{if(e.touches.length!==2)return;f=!0,u=l().currentZoomLevel,p=xs(e.touches);let t=function(e){let[t,n]=[e[0],e[1]];return{x:(t.clientX+n.clientX)/2,y:(t.clientY+n.clientY)/2}}(e.touches);oe(t.x,t.y),e.preventDefault()},ce=e=>{if(!f||e.touches.length!==2)return;let t=xs(e.touches);re(t/p),e.preventDefault()},le=e=>{f&&(e.touches.length>=2||(f=!1,ae()))},ue=e=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault(),m===null?(u=l().currentZoomLevel,h=1,oe(e.clientX,e.clientY)):clearTimeout(m);let t=1-.01*e.deltaY;h*=t,h=Math.max(.1,Math.min(10,h)),re(h),m=setTimeout(()=>{m=null,ae(),h=1},150)},de=c.onStateChange(()=>te()),fe=new ResizeObserver(()=>te());return fe.observe(e),fe.observe(t),te(),o&&(t.addEventListener(`touchstart`,se,{passive:!1}),t.addEventListener(`touchmove`,ce,{passive:!1}),t.addEventListener(`touchend`,le),t.addEventListener(`touchcancel`,le)),s&&t.addEventListener(`wheel`,ue,{passive:!1}),()=>{o&&(t.removeEventListener(`touchstart`,se),t.removeEventListener(`touchmove`,ce),t.removeEventListener(`touchend`,le),t.removeEventListener(`touchcancel`,le)),s&&t.removeEventListener(`wheel`,ue),m&&clearTimeout(m),de(),fe.disconnect(),ie(),e.style.marginLeft=``}}({element:o,container:s,documentId:e,zoomProvides:r,viewportGap:n?.getViewportGap()||0,options:t})},[n,r,e,i,t.enablePinch,t.enableWheel]),{elementRef:a}}function Cs({children:e,documentId:t,style:n,enablePinch:r=!0,enableWheel:i=!0,...a}){let{elementRef:o}=Ss(t,P(()=>({enablePinch:r,enableWheel:i}),[r,i]));return I(`div`,{ref:o,...a,style:{...n,display:`inline-block`,overflow:`visible`,boxSizing:`border-box`},children:e})}var ws=({documentId:e,pageIndex:t,scale:n,className:r,stroke:i=`rgba(33,150,243,0.8)`,fill:a=`rgba(33,150,243,0.15)`})=>{let{provides:o}=bs(),s=ni(e),[c,l]=j(null),u=P(()=>n===void 0?s?.scale??1:n,[n,s?.scale]);return M(()=>{if(o)return o.registerMarqueeOnPage({documentId:e,pageIndex:t,scale:u,callback:{onPreview:l}})},[o,e,t,u]),c?I(`div`,{style:{position:`absolute`,pointerEvents:`none`,left:c.origin.x*u,top:c.origin.y*u,width:c.size.width*u,height:c.size.height*u,border:`1px solid ${i}`,background:a,boxSizing:`border-box`},className:r}):null},Ts=class extends Rr{constructor(e,t,n){super(e,t),this.config=n}buildCapability(){return{renderPage:e=>this.renderPage(e),renderPageRect:e=>this.renderPageRect(e),renderPageRaw:e=>this.renderPageRaw(e),renderPageRectRaw:e=>this.renderPageRectRaw(e),forDocument:e=>this.createRenderScope(e)}}createRenderScope(e){return{renderPage:t=>this.renderPage(t,e),renderPageRect:t=>this.renderPageRect(t,e),renderPageRaw:t=>this.renderPageRaw(t,e),renderPageRectRaw:t=>this.renderPageRectRaw(t,e)}}renderPage({pageIndex:e,options:t},n){let r=n??this.getActiveDocumentId(),i=this.coreState.core.documents[r];if(!i?.document)throw Error(`Document ${r} not loaded`);let a=i.document.pages.find(t=>t.index===e);if(!a)throw Error(`Page ${e} not found in document ${r}`);let o={...t??{},withForms:t?.withForms??this.config.withForms??!1,withAnnotations:t?.withAnnotations??this.config.withAnnotations??!1,imageType:t?.imageType??this.config.defaultImageType??`image/png`,imageQuality:t?.imageQuality??this.config.defaultImageQuality??.92};return this.engine.renderPage(i.document,a,o)}renderPageRect({pageIndex:e,rect:t,options:n},r){let i=r??this.getActiveDocumentId(),a=this.coreState.core.documents[i];if(!a?.document)throw Error(`Document ${i} not loaded`);let o=a.document.pages.find(t=>t.index===e);if(!o)throw Error(`Page ${e} not found in document ${i}`);let s={...n??{},withForms:n?.withForms??this.config.withForms??!1,withAnnotations:n?.withAnnotations??this.config.withAnnotations??!1,imageType:n?.imageType??this.config.defaultImageType??`image/png`,imageQuality:n?.imageQuality??this.config.defaultImageQuality??.92};return this.engine.renderPageRect(a.document,o,t,s)}renderPageRaw({pageIndex:e,options:t},n){let r=n??this.getActiveDocumentId(),i=this.coreState.core.documents[r];if(!i?.document)throw Error(`Document ${r} not loaded`);let a=i.document.pages.find(t=>t.index===e);if(!a)throw Error(`Page ${e} not found in document ${r}`);let o={...t??{},withForms:t?.withForms??this.config.withForms??!1,withAnnotations:t?.withAnnotations??this.config.withAnnotations??!1};return this.engine.renderPageRaw(i.document,a,o)}renderPageRectRaw({pageIndex:e,rect:t,options:n},r){let i=r??this.getActiveDocumentId(),a=this.coreState.core.documents[i];if(!a?.document)throw Error(`Document ${i} not loaded`);let o=a.document.pages.find(t=>t.index===e);if(!o)throw Error(`Page ${e} not found in document ${i}`);let s={...n??{},withForms:n?.withForms??this.config.withForms??!1,withAnnotations:n?.withAnnotations??this.config.withAnnotations??!1};return this.engine.renderPageRectRaw(a.document,o,t,s)}async initialize(e){this.logger.info(`RenderPlugin`,`Initialize`,`Render plugin initialized`)}async destroy(){super.destroy()}};Ts.id=`render`;var Es=Ts,Ds=`render`,Os={manifest:{id:Ds,name:`Render Plugin`,version:`1.0.0`,provides:[`render`],requires:[],optional:[],defaultConfig:{}},create:(e,t)=>new Es(Ds,e,t),reducer:()=>{},initialState:{}};function ks({documentId:e,pageIndex:t,scale:n,dpr:r,style:i,...a}){let{provides:o}=ei(Es.id),s=ni(e),[c,l]=j(null),u=N(null),d=P(()=>s&&s.pageRefreshVersions[t]||0,[s,t]),f=P(()=>n===void 0?s?.scale??1:n,[n,s?.scale]),p=P(()=>r===void 0?window.devicePixelRatio:r,[r]);return M(()=>{if(!o)return;let n=o.forDocument(e).renderPage({pageIndex:t,options:{scaleFactor:f,dpr:p}});return n.wait(e=>{let t=URL.createObjectURL(e);l(t),u.current=t},nr),()=>{u.current?(URL.revokeObjectURL(u.current),u.current=null):n.abort({code:W.Cancelled,message:`canceled render task`})}},[e,t,f,p,o,d]),I(A,{children:c&&I(`img`,{src:c,onLoad:()=>{u.current&&=(URL.revokeObjectURL(u.current),null)},...a,style:{width:`100%`,height:`100%`,...i||{}}})})}var As=`rotate`,js={id:As,name:`Rotate Plugin`,version:`1.0.0`,provides:[`rotate`],requires:[],optional:[],defaultConfig:{}},Ms=`ROTATE/INIT_STATE`,Ns=`ROTATE/CLEANUP_STATE`,Ps=`ROTATE/SET_ROTATION`,Fs=class extends Rr{constructor(e,t,n){super(e,t),this.rotate$=J(),this.defaultRotation=n.defaultRotation??0}onDocumentLoadingStarted(e){let t={rotation:this.defaultRotation};this.dispatch(function(e,t){return{type:Ms,payload:{documentId:e,state:t}}}(e,t)),this.dispatchCoreAction(Er(this.defaultRotation,e)),this.logger.debug(`RotatePlugin`,`DocumentOpened`,`Initialized rotation state for document: ${e}`)}onDocumentClosed(e){this.dispatch(function(e){return{type:Ns,payload:e}}(e)),this.logger.debug(`RotatePlugin`,`DocumentClosed`,`Cleaned up rotation state for document: ${e}`)}buildCapability(){return{setRotation:e=>this.setRotationForDocument(e),getRotation:()=>this.getRotationForDocument(),rotateForward:()=>this.rotateForward(),rotateBackward:()=>this.rotateBackward(),forDocument:e=>this.createRotateScope(e),onRotateChange:this.rotate$.on}}createRotateScope(e){return{setRotation:t=>this.setRotationForDocument(t,e),getRotation:()=>this.getRotationForDocument(e),rotateForward:()=>this.rotateForward(e),rotateBackward:()=>this.rotateBackward(e),onRotateChange:t=>this.rotate$.on(n=>{n.documentId===e&&t(n.rotation)})}}getDocumentState(e){let t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){let t=this.getDocumentState(e);if(!t)throw Error(`Rotation state not found for document: ${e??`active`}`);return t}setRotationForDocument(e,t){let n=t??this.getActiveDocumentId();if(!this.coreState.core.documents[n]?.document)throw Error(`Document ${n} not loaded`);this.dispatch(function(e,t){return{type:Ps,payload:{documentId:e,rotation:t}}}(n,e)),this.dispatchCoreAction(Er(e,n)),this.rotate$.emit({documentId:n,rotation:e})}getRotationForDocument(e){return this.getDocumentStateOrThrow(e).rotation}rotateForward(e){let t=e??this.getActiveDocumentId(),n=(this.getRotationForDocument(t)+1)%4;this.setRotationForDocument(n,t)}rotateBackward(e){let t=e??this.getActiveDocumentId(),n=(this.getRotationForDocument(t)+3)%4;this.setRotationForDocument(n,t)}getMatrixAsString(e){return function(e,t,n){let[r,i,a,o,s,c]=function(e,t,n){let r=1,i=0,a=0,o=1,s=0,c=0;switch(e){case 1:r=0,i=1,a=-1,o=0,s=n;break;case 2:r=-1,i=0,a=0,o=-1,s=t,c=n;break;case 3:r=0,i=-1,a=1,o=0,c=t}return[r,i,a,o,s,c]}(e,t,n);return`matrix(${r},${i},${a},${o},${s},${c})`}(e.rotation,e.width,e.height)}onStoreUpdated(e,t){for(let n in t.documents){let r=e.documents[n],i=t.documents[n];r?.rotation!==i.rotation&&this.logger.debug(`RotatePlugin`,`RotationChanged`,`Rotation changed for document ${n}: ${r?.rotation??0} -> ${i.rotation}`)}}async initialize(e){this.logger.info(`RotatePlugin`,`Initialize`,`Rotate plugin initialized`)}async destroy(){this.rotate$.clear(),super.destroy()}};Fs.id=`rotate`;var Is=Fs,Ls={documents:{},activeDocumentId:null},Rs={manifest:js,create:(e,t)=>new Is(As,e,t),reducer:(e=Ls,t)=>{switch(t.type){case Ms:{let{documentId:n,state:r}=t.payload;return{...e,documents:{...e.documents,[n]:r},activeDocumentId:e.activeDocumentId??n}}case Ns:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case`ROTATE/SET_ACTIVE_DOCUMENT`:return{...e,activeDocumentId:t.payload};case Ps:{let{documentId:n,rotation:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,rotation:r}}}:e}default:return e}},initialState:Ls};function zs({children:e,documentId:t,pageIndex:n,rotation:r,scale:i,style:a,...o}){let{plugin:s}=$r(Is.id),c=ni(t),l=c?.document?.pages?.[n],u=l?.size?.width??0,d=l?.size?.height??0,f=l?.rotation??0,p=c?.rotation??0,m=r===void 0?(f+p)%4:r,h=i??c?.scale??1,g=s?.getMatrixAsString({width:u*h,height:d*h,rotation:m})??`matrix(1, 0, 0, 1, 0, 0)`;return l?I(`div`,{...o,style:{position:`absolute`,transformOrigin:`0 0`,transform:g,...a},children:e}):null}var Bs=`SEARCH/INIT_STATE`,Vs=`SEARCH/CLEANUP_STATE`,Hs=`SEARCH/START_SEARCH_SESSION`,Us=`SEARCH/STOP_SEARCH_SESSION`,Ws=`SEARCH/SET_SEARCH_FLAGS`,Gs=`SEARCH/SET_SHOW_ALL_RESULTS`,Ks=`SEARCH/START_SEARCH`,qs=`SEARCH/SET_SEARCH_RESULTS`,Js=`SEARCH/APPEND_SEARCH_RESULTS`,Ys=`SEARCH/SET_ACTIVE_RESULT_INDEX`;function Xs(e,t){return{type:Gs,payload:{documentId:e,showAll:t}}}function Zs(e,t,n,r){return{type:qs,payload:{documentId:e,results:t,total:n,activeResultIndex:r}}}function Qs(e,t){return{type:Ys,payload:{documentId:e,index:t}}}var $s={flags:[],results:[],total:0,activeResultIndex:-1,showAllResults:!0,query:``,loading:!1,active:!1},ec={documents:{}},tc=(e,t,n)=>{let r=e.documents[t]||$s;return{...e,documents:{...e.documents,[t]:{...r,...n}}}},nc=class extends Rr{constructor(e,t,n){super(e,t),this.searchStop$=J(),this.searchStart$=J(),this.searchResult$=J(),this.searchActiveResultChange$=J(),this.searchResultState$=J(),this.searchState$=J(),this.currentTask=new Map,this.pluginConfig=n}onDocumentLoadingStarted(e){let t={...$s,flags:this.pluginConfig.flags||[],showAllResults:this.pluginConfig.showAllResults??!0};this.dispatch(function(e,t){return{type:Bs,payload:{documentId:e,state:t}}}(e,t))}onDocumentClosed(e){this.stopSearchSession(e),this.dispatch(function(e){return{type:Vs,payload:e}}(e)),this.currentTask.delete(e)}async initialize(){}onStoreUpdated(e,t){for(let n in t.documents){let r=e.documents[n],i=t.documents[n];r!==i&&(this.searchState$.emit({documentId:n,state:i}),r&&r.results===i.results&&r.activeResultIndex===i.activeResultIndex&&r.showAllResults===i.showAllResults&&r.active===i.active||this.searchResultState$.emit({documentId:n,state:{results:i.results,activeResultIndex:i.activeResultIndex,showAllResults:i.showAllResults,active:i.active}}))}}buildCapability(){let e=e=>e??this.getActiveDocumentId(),t=t=>{let n=e(t),r=this.state.documents[n];if(!r)throw Error(`Search state not found for document ${n}`);return r};return{startSearch:t=>this.startSearchSession(e(t)),stopSearch:t=>this.stopSearchSession(e(t)),searchAllPages:(t,n)=>this.searchAllPages(t,e(n)),nextResult:t=>this.nextResult(e(t)),previousResult:t=>this.previousResult(e(t)),goToResult:(t,n)=>this.goToResult(t,e(n)),setShowAllResults:(t,n)=>this.dispatch(Xs(e(n),t)),getShowAllResults:e=>t(e).showAllResults,getFlags:e=>t(e).flags,setFlags:(t,n)=>this.setFlags(t,e(n)),getState:e=>t(e),forDocument:this.createSearchScope.bind(this),onSearchResult:this.searchResult$.on,onSearchStart:this.searchStart$.on,onSearchStop:this.searchStop$.on,onActiveResultChange:this.searchActiveResultChange$.on,onSearchResultStateChange:this.searchResultState$.on,onStateChange:this.searchState$.on}}createSearchScope(e){let t=()=>{let t=this.state.documents[e];if(!t)throw Error(`Search state not found for document ${e}`);return t};return{startSearch:()=>this.startSearchSession(e),stopSearch:()=>this.stopSearchSession(e),searchAllPages:t=>this.searchAllPages(t,e),nextResult:()=>this.nextResult(e),previousResult:()=>this.previousResult(e),goToResult:t=>this.goToResult(t,e),setShowAllResults:t=>this.dispatch(Xs(e,t)),getShowAllResults:()=>t().showAllResults,getFlags:()=>t().flags,setFlags:t=>this.setFlags(t,e),getState:t,onSearchResult:t=>this.searchResult$.on(n=>{n.documentId===e&&t(n.results)}),onSearchStart:t=>this.searchStart$.on(n=>{n.documentId===e&&t()}),onSearchStop:t=>this.searchStop$.on(n=>{n.documentId===e&&t()}),onActiveResultChange:t=>this.searchActiveResultChange$.on(n=>{n.documentId===e&&t(n.index)}),onSearchResultStateChange:t=>this.searchResultState$.on(n=>{n.documentId===e&&t(n.state)}),onStateChange:t=>this.searchState$.on(n=>{n.documentId===e&&t(n.state)})}}setFlags(e,t){this.dispatch(function(e,t){return{type:Ws,payload:{documentId:e,flags:t}}}(t,e));let n=this.state.documents[t];n!=null&&n.active&&this.searchAllPages(n.query,t,!0)}notifySearchStart(e){this.searchStart$.emit({documentId:e})}notifySearchStop(e){this.searchStop$.emit({documentId:e})}notifyActiveResultChange(e,t){this.searchActiveResultChange$.emit({documentId:e,index:t})}startSearchSession(e){this.getCoreDocument(e)&&(this.dispatch(function(e){return{type:Hs,payload:{documentId:e}}}(e)),this.notifySearchStart(e))}stopSearchSession(e){var t;if(!this.state.documents[e]?.active)return;let n=this.currentTask.get(e);if(n){try{(t=n.abort)==null||t.call(n,{code:W.Cancelled,message:`search stopped`})}catch{}this.currentTask.delete(e)}this.dispatch(function(e){return{type:Us,payload:{documentId:e}}}(e)),this.notifySearchStop(e)}searchAllPages(e,t,n=!1){var r;let i=this.state.documents[t];if(!i)return G.reject({code:W.NotFound,message:`Search state not initialized`});let a=this.getCoreDocument(t);if(!a?.document)return G.reject({code:W.NotFound,message:`Document not loaded`});let o=e.trim();if(i.query===o&&!n)return G.resolve({results:i.results,total:i.total});let s=this.currentTask.get(t);if(s){try{(r=s.abort)==null||r.call(s,{code:W.Cancelled,message:`new search`})}catch{}this.currentTask.delete(t)}if(this.dispatch(function(e,t){return{type:Ks,payload:{documentId:e,query:t}}}(t,o)),!o)return this.dispatch(Zs(t,[],0,-1)),G.resolve({results:[],total:0});i.active||this.startSearchSession(t);let c=this.engine.searchAllPages(a.document,o,{flags:i.flags});return this.currentTask.set(t,c),c.onProgress(e=>{var n;(n=e?.results)!=null&&n.length&&this.currentTask.get(t)===c&&(this.dispatch(function(e,t){return{type:Js,payload:{documentId:e,results:t}}}(t,e.results)),this.state.documents[t].activeResultIndex===-1&&(this.dispatch(Qs(t,0)),this.notifyActiveResultChange(t,0)))}),c.wait(e=>{this.currentTask.delete(t);let n=e.total>0?0:-1;this.dispatch(Zs(t,e.results,e.total,n)),this.searchResult$.emit({documentId:t,results:e}),e.total>0&&this.notifyActiveResultChange(t,0)},e=>{e?.reason?.code!==W.Cancelled&&(console.error(`Error during search:`,e),this.dispatch(Zs(t,[],0,-1))),this.currentTask.delete(t)}),c}nextResult(e){let t=this.state.documents[e];if(!t||t.results.length===0)return-1;let n=t.activeResultIndex>=t.results.length-1?0:t.activeResultIndex+1;return this.goToResult(n,e)}previousResult(e){let t=this.state.documents[e];if(!t||t.results.length===0)return-1;let n=t.activeResultIndex<=0?t.results.length-1:t.activeResultIndex-1;return this.goToResult(n,e)}goToResult(e,t){let n=this.state.documents[t];return!n||n.results.length===0||e<0||e>=n.results.length?-1:(this.dispatch(Qs(t,e)),this.notifyActiveResultChange(t,e),e)}async destroy(){for(let e of Object.keys(this.state.documents))this.stopSearchSession(e);this.searchResult$.clear(),this.searchStart$.clear(),this.searchStop$.clear(),this.searchActiveResultChange$.clear(),this.searchResultState$.clear(),this.searchState$.clear(),super.destroy()}};nc.id=`search`;var rc=nc,ic=`search`,ac={manifest:{id:ic,name:`Search Plugin`,version:`1.0.0`,provides:[`search`],requires:[],optional:[],defaultConfig:{flags:[]}},create:(e,t)=>new rc(ic,e,t),reducer:(e=ec,t)=>{switch(t.type){case Bs:return{...e,documents:{...e.documents,[t.payload.documentId]:t.payload.state}};case Vs:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i}}case Hs:return tc(e,t.payload.documentId,{active:!0});case Us:return tc(e,t.payload.documentId,{results:[],total:0,activeResultIndex:-1,query:``,loading:!1,active:!1});case Ws:return tc(e,t.payload.documentId,{flags:t.payload.flags});case Gs:return tc(e,t.payload.documentId,{showAllResults:t.payload.showAll});case Ks:return tc(e,t.payload.documentId,{loading:!0,query:t.payload.query,results:[],total:0,activeResultIndex:-1});case Js:{let{documentId:n,results:r}=t.payload,i=e.documents[n];if(!i)return e;let a=[...i.results,...r],o=i.activeResultIndex===-1&&a.length>0?0:i.activeResultIndex;return tc(e,n,{results:a,total:a.length,activeResultIndex:o,loading:!0})}case qs:{let{documentId:n,results:r,total:i,activeResultIndex:a}=t.payload;return tc(e,n,{results:r,total:i,activeResultIndex:a,loading:!1})}case Ys:return tc(e,t.payload.documentId,{activeResultIndex:t.payload.index});default:return e}},initialState:ec},oc=()=>ei(rc.id);function sc({documentId:e,pageIndex:t,scale:n,style:r,highlightColor:i=`#FFFF00`,activeHighlightColor:a=`#FFBF00`,...o}){let{provides:s}=oc(),[c,l]=j(null),u=ni(e),d=P(()=>s?.forDocument(e),[s,e]),f=P(()=>n===void 0?u?.scale??1:n,[n,u?.scale]);return M(()=>{if(!d)return void l(null);let e=d.getState();return l({results:e.results,activeResultIndex:e.activeResultIndex,showAllResults:e.showAllResults,active:e.active}),d.onSearchResultStateChange(e=>{l(e)})},[d]),!c||!c.active?null:I(`div`,{style:{...r,pointerEvents:`none`},...o,children:c.results.map((e,t)=>({result:e,originalIndex:t})).filter(({result:e})=>e.pageIndex===t).filter(({originalIndex:e})=>c.showAllResults||e===c.activeResultIndex).map(({result:e,originalIndex:t})=>e.rects.map((e,n)=>I(`div`,{style:{position:`absolute`,top:e.origin.y*f,left:e.origin.x*f,width:e.size.width*f,height:e.size.height*f,backgroundColor:t===c.activeResultIndex?a:i,mixBlendMode:`multiply`,transform:`scale(1.02)`,transformOrigin:`center`,transition:`opacity .3s ease-in-out`,opacity:1}},`${t}-${n}`)))})}var cc=`selection`,lc={id:cc,name:`Selection Plugin`,version:`1.0.0`,provides:[`selection`],requires:[`interaction-manager`],optional:[`viewport`,`scroll`],defaultConfig:{menuHeight:40}},uc=`SELECTION/INIT_STATE`,dc=`SELECTION/CLEANUP_STATE`,fc=`SELECTION/CACHE_PAGE_GEOMETRY`,pc=`SELECTION/SET_SELECTION`,mc=`SELECTION/START_SELECTION`,hc=`SELECTION/END_SELECTION`,gc=`SELECTION/CLEAR_SELECTION`,_c=`SELECTION/SET_RECTS`,vc=`SELECTION/SET_SLICES`,yc=`SELECTION/EVICT_PAGE_GEOMETRY`,bc=(e,t)=>({type:pc,payload:{documentId:e,selection:t}}),xc=e=>({type:mc,payload:{documentId:e}}),Sc=e=>({type:hc,payload:{documentId:e}}),Cc=(e,t)=>({type:_c,payload:{documentId:e,rects:t}}),wc=(e,t)=>({type:vc,payload:{documentId:e,slices:t}}),Tc={geometry:{},rects:{},slices:{},selection:null,active:!1,selecting:!1},Ec={documents:{}},Dc=(e,t,n)=>({...e,documents:{...e.documents,[t]:n}});function Oc(e,t){return e.rects[t]??[]}function kc(e,t){return Dt(Oc(e,t))}function Ac(e){let t=[],n=e.rects;for(let e in n){let r=Number(e),i=Dt(n[r]);i&&t.push({page:r,rect:i})}return t}function jc(e,t){let n=e.rects[t]||[];if(n.length===0)return null;let r=kc(e,t);return r?{pageIndex:t,rect:r,segmentRects:n}:null}function Mc(e){let t=[],n=Object.keys(e.rects).map(Number);for(let r of n){let n=e.rects[r]||[];if(n.length===0)continue;let i=kc(e,r);i&&t.push({pageIndex:r,rect:i,segmentRects:n})}return t}function Nc(e,t,n=1.5){for(let n of e.runs){if(!(t.y>=n.rect.y&&t.y<=n.rect.y+n.rect.height&&t.x>=n.rect.x&&t.x<=n.rect.x+n.rect.width))continue;let e=n.glyphs.findIndex(e=>{let n=e.tightX??e.x,r=e.tightY??e.y,i=e.tightWidth??e.width,a=e.tightHeight??e.height;return t.x>=n&&t.x<=n+i&&t.y>=r&&t.y<=r+a});if(e!==-1)return n.charStart+e}if(n<=0)return-1;let r=function(e,t){let n=0,r=0;for(let t of e.runs)for(let e of t.glyphs)e.flags!==2&&(n+=e.height,r++);return r===0?0:n/r*t}(e,n)/2,i=-1,a=1/0;for(let n of e.runs)if(!(t.y<n.rect.y-r||t.y>n.rect.y+n.rect.height+r||t.x<n.rect.x-r||t.x>n.rect.x+n.rect.width+r))for(let e=0;e<n.glyphs.length;e++){let o=n.glyphs[e];if(o.flags===2)continue;let s=o.tightX??o.x,c=o.tightY??o.y,l=o.tightWidth??o.width,u=o.tightHeight??o.height,d=s-r,f=s+l+r,p=c-r,m=c+u+r;if(t.x<d||t.x>f||t.y<p||t.y>m)continue;let h=Math.min(Math.abs(t.x-s),Math.abs(t.x-(s+l)))+Math.min(Math.abs(t.y-c),Math.abs(t.y-(c+u)));h<a&&(a=h,i=n.charStart+e)}return i}function Pc(e,t,n){if(!e||!t||n<e.start.page||n>e.end.page)return null;let r=n===e.start.page?e.start.index:0,i=t.runs[t.runs.length-1],a=i.charStart+i.glyphs.length-1;return{from:r,to:n===e.end.page?e.end.index:a}}function Fc(e,t,n,r=!0){let i=[];for(let r of e.runs){let e=r.charStart,a=e+r.glyphs.length-1;if(a<t||e>n)continue;let o=Math.max(t,e)-e,s=Math.min(n,a)-e,c=1/0,l=-1/0,u=1/0,d=-1/0,f=0,p=0,m=-1/0,h=()=>{c!==1/0&&f>0&&i.push({rect:{origin:{x:c,y:u},size:{width:l-c,height:d-u}},charCount:f,fontSize:r.fontSize}),c=1/0,l=-1/0,u=1/0,d=-1/0,f=0,p=0,m=-1/0};for(let e=o;e<=s;e++){let t=r.glyphs[e];if(t.flags!==2){if(f>0&&m>-1/0){let e=Math.abs(t.x-m),n=p/f;n>0&&e>2.5*n&&h()}c=Math.min(c,t.x),l=Math.max(l,t.x+t.width),u=Math.min(u,t.y),d=Math.max(d,t.y+t.height),f++,p+=t.width,m=t.x+t.width}}h()}return r?function(e){let t=[],n=null,r=null;for(let i of e)n&&r?zc(n,i)?r=Ic(r,i.rect):(t.push(r),r=i.rect):r=i.rect,n=i;return r&&!Lc(r)&&t.push(r),t}(i):i.map(e=>e.rect)}function Ic(e,t){let n=Math.min(e.origin.x,t.origin.x),r=Math.min(e.origin.y,t.origin.y);return{origin:{x:n,y:r},size:{width:Math.max(e.origin.x+e.size.width,t.origin.x+t.size.width)-n,height:Math.max(e.origin.y+e.size.height,t.origin.y+t.size.height)-r}}}function Lc(e){return e.size.width<=0||e.size.height<=0}function Rc(e,t){if(Lc(e)||Lc(t))return 0;let n=Ic(e,t);return n.size.height===e.size.height||n.size.height===t.size.height?1:function(e,t){let n=Math.max(e.origin.x,t.origin.x),r=Math.max(e.origin.y,t.origin.y),i=Math.min(e.origin.x+e.size.width,t.origin.x+t.size.width),a=Math.min(e.origin.y+e.size.height,t.origin.y+t.size.height);return{origin:{x:n,y:r},size:{width:Math.max(0,i-n),height:Math.max(0,a-r)}}}(e,t).size.height/n.size.height}function zc(e,t){if(e.fontSize!=null&&t.fontSize!=null&&e.fontSize>0&&t.fontSize>0&&Math.max(e.fontSize,t.fontSize)/Math.min(e.fontSize,t.fontSize)>1.5)return!1;let n=e.rect,r=t.rect;if(Rc(n,r)<.8)return!1;let i=1*n.size.width/e.charCount,a=1*r.size.width/t.charCount,o=n.origin.x-i,s=n.origin.x+n.size.width+i,c=r.origin.x-a;return o<r.origin.x+r.size.width+a&&s>c}function Bc(e,t){for(let n=0;n<e.runs.length;n++){let r=e.runs[n],i=t-r.charStart;if(i>=0&&i<r.glyphs.length)return{runIdx:n,localIdx:i}}return null}function Vc(e){return e===1||e===2}function Hc(e){return e.rect.width===0&&e.rect.height===0}function Uc(e,t,n,r){let i=Math.max(t,r)-Math.min(e,n),a=Math.max(0,Math.min(t,r)-Math.max(e,n));return i!==0&&a/i>=.5}var Wc=class extends Rr{constructor(e,t,n){var r;super(e,t),this.enabledModesPerDoc=new Map,this.selecting=new Map,this.anchor=new Map,this.hasTextAnchor=new Map,this.marqueePage=new Map,this.pageCallbacks=new Map,this.geoAccessOrder=new Map,this.menuPlacement$=qr((e,t)=>({documentId:e,placement:t})),this.selChange$=qr((e,t)=>({documentId:e,selection:t,modeId:this.interactionManagerCapability.forDocument(e).getActiveMode()})),this.textRetrieved$=qr((e,t)=>({documentId:e,text:t})),this.copyToClipboard$=qr((e,t)=>({documentId:e,text:t}),{cache:!1}),this.beginSelection$=qr((e,t)=>({documentId:e,page:t.page,index:t.index,modeId:t.modeId}),{cache:!1}),this.endSelection$=qr((e,t)=>({documentId:e,modeId:t.modeId}),{cache:!1}),this.marqueeChange$=qr((e,t)=>({documentId:e,pageIndex:t.pageIndex,rect:t.rect,modeId:t.modeId}),{cache:!1}),this.marqueeEnd$=qr((e,t)=>({documentId:e,pageIndex:t.pageIndex,rect:t.rect,modeId:t.modeId}),{cache:!1}),this.emptySpaceClick$=qr((e,t)=>({documentId:e,pageIndex:t.pageIndex,modeId:t.modeId}),{cache:!1}),this.viewportCapability=null,this.scrollCapability=null,this.config=n,this.menuHeight=n.menuHeight??40;let i=t.getPlugin(`interaction-manager`);if(!i)throw Error(`SelectionPlugin: InteractionManagerPlugin is required.`);this.interactionManagerCapability=i.provides(),this.viewportCapability=t.getPlugin(`viewport`)?.provides()??null,this.scrollCapability=t.getPlugin(`scroll`)?.provides()??null,this.coreStore.onAction(yr,e=>{let{documentId:t,pageIndexes:n}=e.payload,r=n.map(e=>this.getNewPageGeometryAndCache(t,e));L.all(r).wait(()=>{n.forEach(e=>{this.notifyPage(t,e)})},nr)}),(r=this.viewportCapability)==null||r.onViewportChange(e=>{this.recalculateMenuPlacement(e.documentId)},{mode:`throttle`,wait:100})}onDocumentLoadingStarted(e){this.dispatch(((e,t)=>({type:uc,payload:{documentId:e,state:t}}))(e,Tc));let t=!1!==this.config.marquee?.enabled;this.enabledModesPerDoc.set(e,new Map([[`pointerMode`,{enableSelection:!0,showSelectionRects:!0,enableMarquee:t,showMarqueeRects:!0}]])),this.pageCallbacks.set(e,new Map),this.geoAccessOrder.set(e,[]),this.selecting.set(e,!1),this.anchor.set(e,void 0),this.hasTextAnchor.set(e,!1)}onDocumentClosed(e){this.dispatch((e=>({type:dc,payload:e}))(e)),this.enabledModesPerDoc.delete(e),this.pageCallbacks.delete(e),this.geoAccessOrder.delete(e),this.selecting.delete(e),this.hasTextAnchor.delete(e),this.anchor.delete(e),this.marqueePage.delete(e),this.selChange$.clearScope(e),this.textRetrieved$.clearScope(e),this.copyToClipboard$.clearScope(e),this.beginSelection$.clearScope(e),this.endSelection$.clearScope(e),this.menuPlacement$.clearScope(e),this.marqueeChange$.clearScope(e),this.marqueeEnd$.clearScope(e),this.emptySpaceClick$.clearScope(e)}async initialize(){}async destroy(){this.selChange$.clear(),this.textRetrieved$.clear(),this.copyToClipboard$.clear(),this.beginSelection$.clear(),this.endSelection$.clear(),this.menuPlacement$.clear(),this.marqueeChange$.clear(),this.marqueeEnd$.clear(),this.emptySpaceClick$.clear(),super.destroy()}buildCapability(){let e=e=>e??this.getActiveDocumentId();return{getFormattedSelection:t=>Mc(this.getDocumentState(e(t))),getFormattedSelectionForPage:(t,n)=>jc(this.getDocumentState(e(n)),t),getHighlightRectsForPage:(t,n)=>Oc(this.getDocumentState(e(n)),t),getHighlightRects:t=>this.getDocumentState(e(t)).rects,getBoundingRectForPage:(t,n)=>kc(this.getDocumentState(e(n)),t),getBoundingRects:t=>Ac(this.getDocumentState(e(t))),getSelectedText:t=>this.getSelectedText(e(t)),setSelection:(t,n)=>this.applySelection(e(n),t),clear:t=>this.clearSelection(e(t)),copyToClipboard:t=>this.copyToClipboard(e(t)),getState:t=>this.getDocumentState(e(t)),enableForMode:(t,n,r)=>this.enabledModesPerDoc.get(e(r))?.set(t,{...n}),isEnabledForMode:(t,n)=>this.enabledModesPerDoc.get(e(n))?.has(t)??!1,setMarqueeEnabled:(t,n)=>this.setMarqueeEnabled(e(n),t),isMarqueeEnabled:t=>this.isMarqueeEnabled(e(t)),forDocument:this.createSelectionScope.bind(this),onCopyToClipboard:this.copyToClipboard$.onGlobal,onSelectionChange:this.selChange$.onGlobal,onTextRetrieved:this.textRetrieved$.onGlobal,onBeginSelection:this.beginSelection$.onGlobal,onEndSelection:this.endSelection$.onGlobal,onMarqueeChange:this.marqueeChange$.onGlobal,onMarqueeEnd:this.marqueeEnd$.onGlobal,onEmptySpaceClick:this.emptySpaceClick$.onGlobal}}createSelectionScope(e){return{getFormattedSelection:()=>Mc(this.getDocumentState(e)),getFormattedSelectionForPage:t=>jc(this.getDocumentState(e),t),getHighlightRectsForPage:t=>Oc(this.getDocumentState(e),t),getHighlightRects:()=>this.getDocumentState(e).rects,getBoundingRectForPage:t=>kc(this.getDocumentState(e),t),getBoundingRects:()=>Ac(this.getDocumentState(e)),getSelectedText:()=>this.getSelectedText(e),setSelection:t=>this.applySelection(e,t),clear:()=>this.clearSelection(e),copyToClipboard:()=>this.copyToClipboard(e),getState:()=>this.getDocumentState(e),setMarqueeEnabled:t=>this.setMarqueeEnabled(e,t),isMarqueeEnabled:()=>this.isMarqueeEnabled(e),onSelectionChange:this.selChange$.forScope(e),onTextRetrieved:this.textRetrieved$.forScope(e),onCopyToClipboard:this.copyToClipboard$.forScope(e),onBeginSelection:this.beginSelection$.forScope(e),onEndSelection:this.endSelection$.forScope(e),onMarqueeChange:this.marqueeChange$.forScope(e),onMarqueeEnd:this.marqueeEnd$.forScope(e),onEmptySpaceClick:this.emptySpaceClick$.forScope(e)}}getDocumentState(e){let t=this.state.documents[e];if(!t)throw Error(`Selection state not found for document: ${e}`);return t}onMenuPlacement(e,t){return this.menuPlacement$.forScope(e)(t)}registerSelectionOnPage(e){var t;let{documentId:n,pageIndex:r,onRectsChange:i}=e,a=this.state.documents[n];if(!a)return this.logger.warn(`SelectionPlugin`,`RegisterFailed`,`Cannot register selection on page ${r} for document ${n}: document state not initialized.`),()=>{};(t=this.pageCallbacks.get(n))==null||t.set(r,i);let o=this.getOrLoadGeometry(n,r),s=this.interactionManagerCapability.forDocument(n),c=this.enabledModesPerDoc.get(n);i({rects:Oc(a,r),boundingRect:kc(a,r)}),o.wait(e=>{let t=this.getDocumentState(n),i=t.selection;if(!i||r<i.start.page||r>i.end.page)return;let a=Pc(i,e,r);if(!a)return;let o=Fc(e,a.from,a.to);this.dispatch(Cc(n,{...t.rects,[r]:o})),this.dispatch(wc(n,{...t.slices,[r]:{start:a.from,count:a.to-a.from+1}})),this.notifyPage(n,r)},nr);let l=function(e){let t=e.minDragDistance??3,n=e.toleranceFactor??1.5,r=null,i=null,a=!1,o=0;function s(){var t;r=null,i=null,a=!1,(t=e.setHasTextAnchor)==null||t.call(e,!1)}return{onPointerDown:(t,s,c)=>{var l,u;if(s.target===s.currentTarget&&((l=e.onEmptySpaceClick)==null||l.call(e,c)),!e.isEnabled(c))return;(o===0||Date.now()-o>=500)&&e.onClear(c);let d=e.getGeometry();if(!d)return;let f=Nc(d,t,n);f!==-1&&(r=f,i=t,a=!1,(u=e.setHasTextAnchor)==null||u.call(e,!0))},onPointerMove:(o,s,c)=>{if(!e.isEnabled(c))return;let l=e.getGeometry();if(!l)return;let u=Nc(l,o,n);if(e.setCursor(u===-1?null:`text`),r!==null&&i&&!a){let n=o.x-i.x,s=o.y-i.y;Math.sqrt(n*n+s*s)>=t&&(a=!0,e.onBegin(r,c),u!==-1&&e.onUpdate(u,c));return}e.isSelecting()&&u!==-1&&e.onUpdate(u,c)},onPointerUp:(t,n,r)=>{e.isEnabled(r)&&a&&e.onEnd(r),s()},onDoubleClick:(t,r,i)=>{var a;if(!e.isEnabled(i))return;let s=e.getGeometry();if(!s)return;let c=Nc(s,t,n);c!==-1&&(o=Date.now(),(a=e.onWordSelect)==null||a.call(e,c,i))},onClick:(t,r,i)=>{var a;if(!e.isEnabled(i)||o===0)return;if(Date.now()-o>500)return void(o=0);o=0;let s=e.getGeometry();if(!s)return;let c=Nc(s,t,n);c!==-1&&((a=e.onLineSelect)==null||a.call(e,c,i))},onHandlerActiveEnd:t=>{s(),e.isEnabled(t)&&e.onClear(t)}}}({getGeometry:()=>this.getDocumentState(n).geometry[r],isEnabled:e=>{let t=c?.get(e);return!!t&&!1!==t.enableSelection},onBegin:(e,t)=>this.beginSelection(n,r,e,t),onUpdate:(e,t)=>this.updateSelection(n,r,e,t),onEnd:e=>this.endSelection(n,e),onClear:e=>this.clearSelection(n,e),isSelecting:()=>this.selecting.get(n)??!1,setCursor:e=>e?s.setCursor(`selection-text`,e,10):s.removeCursor(`selection-text`),onEmptySpaceClick:e=>this.emptySpaceClick$.emit(n,{pageIndex:r,modeId:e}),onWordSelect:(e,t)=>this.selectWord(n,r,e,t),onLineSelect:(e,t)=>this.selectLine(n,r,e,t),setHasTextAnchor:e=>this.hasTextAnchor.set(n,e),minDragDistance:this.config.minSelectionDragDistance,toleranceFactor:this.config.toleranceFactor}),u=this.interactionManagerCapability.registerAlways({scope:{type:`page`,documentId:n,pageIndex:r},handlers:l});return()=>{var e;u(),(e=this.pageCallbacks.get(n))==null||e.delete(r),o.abort({code:W.Cancelled,message:`Cleanup`})}}registerMarqueeOnPage(e){let{documentId:t,pageIndex:n,scale:r,onRectChange:i}=e;if(!this.state.documents[t])return this.logger.warn(`SelectionPlugin`,`RegisterMarqueeFailed`,`Cannot register marquee on page ${n} for document ${t}: document state not initialized.`),()=>{};let a=this.coreState.core.documents[t];if(!a||!a.document)return this.logger.warn(`SelectionPlugin`,`DocumentNotFound`,`Cannot register marquee on page ${n}: document not found`),()=>{};let o=a.document.pages[n];if(!o)return this.logger.warn(`SelectionPlugin`,`PageNotFound`,`Cannot register marquee on page ${n}: page not found`),()=>{};let s=o.size,c=this.config.marquee?.minDragPx??5,l=()=>{let e=this.interactionManagerCapability.forDocument(t).getActiveMode();return!1!==this.enabledModesPerDoc.get(t)?.get(e)?.showMarqueeRects},u=function(e){let{pageSize:t,scale:n,minDragPx:r=5}=e,i=null,a=null;return{onPointerDown:(t,n,r)=>{var o,s;e.isEnabled(r)&&((o=e.isTextSelecting)!=null&&o.call(e)||(i=t,a={origin:{x:t.x,y:t.y},size:{width:0,height:0}},e.onBegin(t,r),(s=n.setPointerCapture)==null||s.call(n)))},onPointerMove:(n,r,o)=>{if(!i||!e.isEnabled(o))return;let s=q(n.x,0,t.width),c=q(n.y,0,t.height);a={origin:{x:Math.min(i.x,s),y:Math.min(i.y,c)},size:{width:Math.abs(s-i.x),height:Math.abs(c-i.y)}},e.onChange(a,o)},onPointerUp:(t,o,s)=>{var c;e.isEnabled(s)&&(a&&i&&(Math.max(a.size.width,a.size.height)*n>r?e.onEnd(a,s):e.onCancel(s)),i=null,a=null,(c=o.releasePointerCapture)==null||c.call(o))},onPointerCancel:(t,n,r)=>{var o;e.isEnabled(r)&&(i=null,a=null,e.onCancel(r),(o=n.releasePointerCapture)==null||o.call(n))}}}({pageSize:s,scale:r,minDragPx:c,isEnabled:e=>!0===this.enabledModesPerDoc.get(t)?.get(e)?.enableMarquee,isTextSelecting:()=>(this.selecting.get(t)??!1)||(this.hasTextAnchor.get(t)??!1),onBegin:(e,r)=>this.beginMarquee(t,n,e,r),onChange:(e,r)=>{this.updateMarquee(t,n,e,r),i(l()?e:null)},onEnd:(e,r)=>{this.endMarquee(t,n,e,r),i(null)},onCancel:e=>{this.cancelMarquee(t,e),i(null)}});return this.interactionManagerCapability.registerAlways({scope:{type:`page`,documentId:t,pageIndex:n},handlers:u})}getPlacementMetrics(e,t,n,r){let i=(this.scrollCapability?.forDocument(e))?.getRectPositionForPage(t,n);if(!i)return null;let a=i.origin.y-r.scrollTop,o=i.origin.y+i.size.height-r.scrollTop;return{pageIndex:t,rect:n,spaceAbove:a,spaceBelow:r.clientHeight-o,isBottomVisible:o>0&&o<=r.clientHeight,isTopVisible:a>=0&&a<r.clientHeight}}emitMenuPlacement(e,t){this.menuPlacement$.emit(e,t),t?this.interactionManagerCapability.claimPageActivity(e,`selection-menu`,t.pageIndex):this.interactionManagerCapability.releasePageActivity(e,`selection-menu`)}recalculateMenuPlacement(e){let t=this.state.documents[e];if(!t)return;if(t.selecting||t.selection===null)return void this.emitMenuPlacement(e,null);let n=Ac(t);if(n.length===0)return void this.emitMenuPlacement(e,null);let r=n[n.length-1];if(!this.viewportCapability||!this.scrollCapability)return void this.emitMenuPlacement(e,{pageIndex:r.page,rect:r.rect,spaceAbove:0,spaceBelow:1/0,suggestTop:!1,isVisible:!0});let i=this.viewportCapability.forDocument(e).getMetrics(),a=n[0],o=this.getPlacementMetrics(e,r.page,r.rect,i),s=this.getPlacementMetrics(e,a.page,a.rect,i);o&&o.isBottomVisible&&o.spaceBelow>this.menuHeight?this.emitMenuPlacement(e,{...o,suggestTop:!1,isVisible:!0}):s&&s.isTopVisible?this.emitMenuPlacement(e,{...s,suggestTop:!0,isVisible:!0}):o&&o.isBottomVisible?this.emitMenuPlacement(e,{...o,suggestTop:!1,isVisible:!0}):this.emitMenuPlacement(e,null)}notifyPage(e,t){let n=this.pageCallbacks.get(e)?.get(t);if(n){let r=this.getDocumentState(e),i=this.interactionManagerCapability.forDocument(e).getActiveMode(),a=this.enabledModesPerDoc.get(e)?.get(i);n(a&&!1!==(a.showSelectionRects??a.showRects)?{rects:Oc(r,t),boundingRect:kc(r,t)}:{rects:[],boundingRect:null})}}notifyAllPages(e){var t;(t=this.pageCallbacks.get(e))==null||t.forEach((t,n)=>{this.notifyPage(e,n)})}getNewPageGeometryAndCache(e,t){let n=this.getCoreDocument(e);if(!n||!n.document)return G.reject({code:W.NotFound,message:`Doc Not Found`});let r=n.document.pages.find(e=>e.index===t),i=this.engine.getPageGeometry(n.document,r);return i.wait(n=>{this.dispatch(((e,t,n)=>({type:fc,payload:{documentId:e,page:t,geo:n}}))(e,t,n)),this.touchGeometry(e,t)},nr),i}getOrLoadGeometry(e,t){let n=this.getDocumentState(e).geometry[t];return n?(this.touchGeometry(e,t),G.resolve(n)):this.getNewPageGeometryAndCache(e,t)}touchGeometry(e,t){let n=this.geoAccessOrder.get(e);if(!n)return;let r=n.indexOf(t);r>-1&&n.splice(r,1),n.push(t),this.evictGeometryIfNeeded(e)}evictGeometryIfNeeded(e){let t=this.config.maxCachedGeometries??50,n=this.geoAccessOrder.get(e);if(!n||n.length<=t)return;let r=this.pageCallbacks.get(e),i=[];for(;n.length-i.length>t;){let e=n.find(e=>!i.includes(e)&&!r?.has(e));if(e===void 0)break;i.push(e)}if(i.length!==0){for(let e of i){let t=n.indexOf(e);t>-1&&n.splice(t,1)}this.dispatch(((e,t)=>({type:yc,payload:{documentId:e,pages:t}}))(e,i))}}beginSelection(e,t,n,r){this.selecting.set(e,!0),this.anchor.set(e,{page:t,index:n}),this.dispatch(xc(e)),this.beginSelection$.emit(e,{page:t,index:n,modeId:r}),this.recalculateMenuPlacement(e)}endSelection(e,t){this.selecting.set(e,!1),this.anchor.set(e,void 0),this.dispatch(Sc(e)),this.endSelection$.emit(e,{modeId:t}),this.recalculateMenuPlacement(e)}clearSelection(e,t){this.selecting.set(e,!1),this.anchor.set(e,void 0),this.dispatch((e=>({type:gc,payload:{documentId:e}}))(e)),this.selChange$.emit(e,null),this.emitMenuPlacement(e,null),this.notifyAllPages(e)}applySelection(e,t){if(!this.state.documents[e])return G.reject({code:W.NotFound,message:`Selection state not found for document: ${e}`});if(t===null)return this.clearSelection(e),G.resolve(void 0);let n=this.validateRange(e,t);if(n)return G.reject(n);let r=this.normalizeRange(t),i=[];for(let e=r.start.page;e<=r.end.page;e++)i.push(e);let a=i.map(t=>this.getOrLoadGeometry(e,t)),o=G.create();return L.all(a).wait(()=>{if(!this.state.documents[e])return void o.reject({code:W.NotFound,message:`Selection state not found for document: ${e}`});let t=this.clampRangeToGeometry(e,r);if(!t)return void o.reject({code:W.NotFound,message:`Cannot apply selection: page(s) ${r.start.page}-${r.end.page} have no text geometry`});this.selecting.set(e,!1),this.anchor.set(e,void 0);let n=Object.keys(this.getDocumentState(e).rects).map(Number);this.dispatch(xc(e)),this.dispatch(bc(e,t)),this.updateRectsAndSlices(e,t),this.dispatch(Sc(e)),this.selChange$.emit(e,t);let i=new Set(n);for(let e=t.start.page;e<=t.end.page;e++)i.add(e);i.forEach(t=>this.notifyPage(e,t)),this.recalculateMenuPlacement(e),o.resolve(void 0)},e=>o.reject(e.reason)),o}validateRange(e,t){let n=e=>!!e&&typeof e==`object`&&Number.isInteger(e.page)&&Number.isInteger(e.index);if(!t||typeof t!=`object`||!t.start||!t.end)return{code:W.Unknown,message:`Invalid selection range: expected { start, end }`};if(!n(t.start)||!n(t.end))return{code:W.Unknown,message:`Invalid selection range: start/end must have integer page and index`};if(t.start.index<0||t.end.index<0)return{code:W.Unknown,message:`Invalid selection range: glyph index cannot be negative`};let r=this.getCoreDocument(e)?.document?.pageCount??0,i=Math.min(t.start.page,t.end.page),a=Math.max(t.start.page,t.end.page);return i<0||a>=r?{code:W.NotFound,message:`Invalid selection range: page ${i<0?i:a} out of bounds [0, ${r})`}:null}clampRangeToGeometry(e,t){let n=this.getDocumentState(e),r=e=>{let t=n.geometry[e];if(!t||t.runs.length===0)return-1;let r=t.runs[t.runs.length-1];return r.charStart+r.glyphs.length-1},i=r(t.start.page),a=r(t.end.page);if(i<0&&a<0)return null;let o=(e,t)=>t<0?0:Math.min(Math.max(e,0),t);return{start:{page:t.start.page,index:o(t.start.index,i)},end:{page:t.end.page,index:o(t.end.index,a)}}}normalizeRange(e){let{start:t,end:n}=e;return n.page>t.page||n.page===t.page&&n.index>=t.index?{start:t,end:n}:{start:n,end:t}}selectWord(e,t,n,r){let i=this.getDocumentState(e).geometry[t];if(!i)return;let a=function(e,t){if(!Bc(e,t))return null;let n=function(e){if(e.runs.length===0)return 0;let t=e.runs[e.runs.length-1];return t.charStart+t.glyphs.length}(e);if(n===0)return null;let r=t;for(;r>0;){let t=Bc(e,r-1);if(!t||Vc(e.runs[t.runIdx].glyphs[t.localIdx].flags))break;r--}let i=t;for(;i<n-1;){let t=Bc(e,i+1);if(!t||Vc(e.runs[t.runIdx].glyphs[t.localIdx].flags))break;i++}return{from:r,to:i}}(i,n);a&&this.applyInstantSelection(e,t,a.from,a.to,r)}selectLine(e,t,n,r){let i=this.getDocumentState(e).geometry[t];if(!i)return;let a=function(e,t){let n=Bc(e,t);if(!n)return null;let r=e.runs[n.runIdx],i=r.rect.y,a=r.rect.y+r.rect.height,o=r.charStart,s=r.charStart+r.glyphs.length-1;for(let t=n.runIdx-1;t>=0;t--){let n=e.runs[t];if(!Hc(n)){if(!Uc(n.rect.y,n.rect.y+n.rect.height,i,a))break;o=n.charStart}}for(let t=n.runIdx+1;t<e.runs.length;t++){let n=e.runs[t];if(!Hc(n)){if(!Uc(n.rect.y,n.rect.y+n.rect.height,i,a))break;s=n.charStart+n.glyphs.length-1}}return{from:o,to:s}}(i,n);a&&this.applyInstantSelection(e,t,a.from,a.to,r)}applyInstantSelection(e,t,n,r,i){let a={start:{page:t,index:n},end:{page:t,index:r}};this.selecting.set(e,!1),this.anchor.set(e,void 0),this.dispatch(xc(e)),this.dispatch(bc(e,a)),this.updateRectsAndSlices(e,a),this.dispatch(Sc(e)),this.selChange$.emit(e,a),this.beginSelection$.emit(e,{page:t,index:n,modeId:i}),this.endSelection$.emit(e,{modeId:i});for(let t=a.start.page;t<=a.end.page;t++)this.notifyPage(e,t);this.recalculateMenuPlacement(e)}updateSelection(e,t,n,r){if(!this.selecting.get(e)||!this.anchor.get(e))return;let i=this.anchor.get(e),a=t>i.page||t===i.page&&n>=i.index,o={start:a?i:{page:t,index:n},end:a?{page:t,index:n}:i};this.dispatch(bc(e,o)),this.updateRectsAndSlices(e,o),this.selChange$.emit(e,o);for(let t=o.start.page;t<=o.end.page;t++)this.notifyPage(e,t)}updateRectsAndSlices(e,t){let n=this.getDocumentState(e),r={},i={};for(let e=t.start.page;e<=t.end.page;e++){let a=n.geometry[e],o=Pc(t,a,e);o&&(r[e]=Fc(a,o.from,o.to),i[e]={start:o.from,count:o.to-o.from+1})}this.dispatch(Cc(e,r)),this.dispatch(wc(e,i))}getSelectedText(e){if(!this.checkPermission(e,U.CopyContents))return this.logger.debug(`SelectionPlugin`,`GetSelectedText`,`Cannot get selected text: document ${e} lacks CopyContents permission`),G.reject({code:W.Security,message:`Document lacks CopyContents permission`});let t=this.getCoreDocument(e),n=this.getDocumentState(e);if(!t?.document||!n.selection)return G.reject({code:W.NotFound,message:`Doc Not Found or No Selection`});let r=n.selection,i=[];for(let e=r.start.page;e<=r.end.page;e++){let t=n.slices[e];t&&i.push({pageIndex:e,charIndex:t.start,charCount:t.count})}if(i.length===0)return G.resolve([]);let a=this.engine.getTextSlices(t.document,i);return a.wait(t=>{this.textRetrieved$.emit(e,t)},nr),a}copyToClipboard(e){if(!this.checkPermission(e,U.CopyContents))return void this.logger.debug(`SelectionPlugin`,`CopyToClipboard`,`Cannot copy to clipboard: document ${e} lacks CopyContents permission`);this.getSelectedText(e).wait(t=>{this.copyToClipboard$.emit(e,t.join(`
2264
+ `))},nr)}beginMarquee(e,t,n,r){this.marqueePage.set(e,t)}updateMarquee(e,t,n,r){this.marqueeChange$.emit(e,{pageIndex:t,rect:n,modeId:r})}endMarquee(e,t,n,r){this.marqueeEnd$.emit(e,{pageIndex:t,rect:n,modeId:r}),this.marqueeChange$.emit(e,{pageIndex:t,rect:null,modeId:r}),this.marqueePage.delete(e)}cancelMarquee(e,t){let n=this.marqueePage.get(e);n!==void 0&&(this.marqueeChange$.emit(e,{pageIndex:n,rect:null,modeId:t}),this.marqueePage.delete(e))}setMarqueeEnabled(e,t){let n=this.enabledModesPerDoc.get(e);if(!n)return;let r=n.get(`pointerMode`);r?r.enableMarquee=t:t&&n.set(`pointerMode`,{enableMarquee:!0})}isMarqueeEnabled(e){return!1!==this.enabledModesPerDoc.get(e)?.get(`pointerMode`)?.enableMarquee}};Wc.id=`selection`;var Gc=Wc,Kc={manifest:lc,create:(e,t)=>new Gc(cc,e,t),reducer:(e=Ec,t)=>{switch(t.type){case uc:{let{documentId:n,state:r}=t.payload;return Dc(e,n,r)}case dc:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i}}case fc:{let{documentId:n,page:r,geo:i}=t.payload,a=e.documents[n];return a?Dc(e,n,{...a,geometry:{...a.geometry,[r]:i}}):e}case pc:{let{documentId:n,selection:r}=t.payload,i=e.documents[n];return i?Dc(e,n,{...i,selection:r,active:!0}):e}case mc:{let{documentId:n}=t.payload,r=e.documents[n];return r?Dc(e,n,{...r,selecting:!0,selection:null,rects:{}}):e}case hc:{let{documentId:n}=t.payload,r=e.documents[n];return r?Dc(e,n,{...r,selecting:!1}):e}case gc:{let{documentId:n}=t.payload,r=e.documents[n];return r?Dc(e,n,{...r,selecting:!1,selection:null,rects:{},active:!1}):e}case _c:{let{documentId:n,rects:r}=t.payload,i=e.documents[n];return i?Dc(e,n,{...i,rects:r}):e}case vc:{let{documentId:n,slices:r}=t.payload,i=e.documents[n];return i?Dc(e,n,{...i,slices:r}):e}case yc:{let{documentId:n,pages:r}=t.payload,i=e.documents[n];if(!i)return e;let a={...i.geometry},o={...i.rects},s={...i.slices};for(let e of r)delete a[e],delete o[e],delete s[e];return Dc(e,n,{...i,geometry:a,rects:o,slices:s})}case`SELECTION/RESET`:{let{documentId:n}=t.payload;return e.documents[n]?Dc(e,n,Tc):e}default:return e}},initialState:Ec};function qc(e,t){let{width:n,height:r}=e.size;switch(t%4){case 1:return{matrix:`matrix(0, -1, 1, 0, 0, ${r})`,width:r,height:n};case 2:return{matrix:`matrix(-1, 0, 0, -1, ${n}, ${r})`,width:n,height:r};case 3:return{matrix:`matrix(0, 1, -1, 0, ${n}, 0)`,width:r,height:n};default:return{matrix:`matrix(1, 0, 0, 1, 0, 0)`,width:n,height:r}}}var Jc=`onDblClick`;function Yc({children:e,...t}){let{rect:n,rotation:r}=t,{matrix:i,width:a,height:o}=qc(n,r),s=N(null);return M(()=>{let e=s.current;if(!e)return;let t=e=>{e.stopPropagation()},n=e=>{e.stopPropagation()};return e.addEventListener(`pointerdown`,t,{capture:!0}),e.addEventListener(`touchstart`,n,{capture:!0,passive:!0}),()=>{e.removeEventListener(`pointerdown`,t,{capture:!0}),e.removeEventListener(`touchstart`,n,{capture:!0})}},[]),I(A,{children:e({menuWrapperProps:{style:{position:`absolute`,left:n.origin.x,top:n.origin.y,transform:i,transformOrigin:`0 0`,width:a,height:o,pointerEvents:`none`,zIndex:3},ref:e=>{s.current=e}},matrix:i,rect:{origin:{x:n.origin.x,y:n.origin.y},size:{width:a,height:o}}})})}function Xc(e,t,n,r=!1){if(!t)return e;let{origin:{x:i,y:a},size:{width:o,height:s}}=e,c=t.minWidth??1,l=t.minHeight??1,u=t.maxWidth,d=t.maxHeight;if(n&&o>0&&s>0){let e=o/s;o<c&&(o=c,s=o/e),s<l&&(s=l,o=s*e),u!==void 0&&o>u&&(o=u,s=o/e),d!==void 0&&s>d&&(s=d,o=s*e)}else o=Math.max(c,o),s=Math.max(l,s),u!==void 0&&(o=Math.min(u,o)),d!==void 0&&(s=Math.min(d,s));return t.boundingBox&&!r&&(i=Math.max(0,Math.min(i,t.boundingBox.width-o)),a=Math.max(0,Math.min(a,t.boundingBox.height-s))),{origin:{x:i,y:a},size:{width:o,height:s}}}function Zc(e,t,n){let r=1e-6,i=Nt(e,t);return i.origin.x>=-1e-6&&i.origin.y>=-1e-6&&i.origin.x+i.size.width<=n.width+r&&i.origin.y+i.size.height<=n.height+r}function Qc(e,t,n,r,i){let{startRect:a,maintainAspectRatio:o=!1,annotationRotation:s=0,constraints:c}=n,l=function(e){return{x:e.includes(`e`)?`left`:e.includes(`w`)?`right`:`center`,y:e.includes(`s`)?`top`:e.includes(`n`)?`bottom`:`center`}}(t),u=a.size.width/a.size.height||1,d=function(e,t,n){let r=e.origin.x,i=e.origin.y,a=e.size.width,o=e.size.height;return n.x===`left`?a+=t.x:n.x===`right`&&(r+=t.x,a-=t.x),n.y===`top`?o+=t.y:n.y===`bottom`&&(i+=t.y,o-=t.y),{origin:{x:r,y:i},size:{width:a,height:o}}}(a,e,l);if(o&&(d=function(e,t,n,r){let{x:i,y:a}=e.origin,{width:o,height:s}=e.size;if(n.x===`center`||n.y===`center`)n.y===`center`?(s=o/r,a=t.origin.y+(t.size.height-s)/2):(o=s*r,i=t.origin.x+(t.size.width-o)/2);else{let e=Math.abs(o-t.size.width),n=Math.abs(s-t.size.height),i=e+n;if(i===0)o=t.size.width,s=t.size.height;else{let t=e/i,a=n/i,c=o/r;o=t*o+s*r*a,s=t*c+a*s}}return n.x===`right`&&(i=t.origin.x+t.size.width-o),n.y===`bottom`&&(a=t.origin.y+t.size.height-s),{origin:{x:i,y:a},size:{width:o,height:s}}}(d,a,l,u)),r&&(d=function(e,t,n,r,i){if(!r)return e;let{x:a,y:o}=e.origin,{width:s,height:c}=e.size;s=Math.max(1,s),c=Math.max(1,c);let l=n.x===`left`?t.origin.x:t.origin.x+t.size.width,u=n.y===`top`?t.origin.y:t.origin.y+t.size.height,d=n.x===`left`?r.width-l:n.x===`right`?l:2*Math.min(t.origin.x,r.width-t.origin.x-t.size.width)+t.size.width,f=n.y===`top`?r.height-u:n.y===`bottom`?u:2*Math.min(t.origin.y,r.height-t.origin.y-t.size.height)+t.size.height;if(i){let e=s>d?d/s:1,t=c>f?f/c:1,n=Math.min(e,t);n<1&&(s*=n,c*=n)}else s=Math.min(s,d),c=Math.min(c,f);return a=n.x===`left`?l:n.x===`right`?l-s:t.origin.x+(t.size.width-s)/2,o=n.y===`top`?u:n.y===`bottom`?u-c:t.origin.y+(t.size.height-c)/2,a=Math.max(0,Math.min(a,r.width-s)),o=Math.max(0,Math.min(o,r.height-c)),{origin:{x:a,y:o},size:{width:s,height:c}}}(d,a,l,c?.boundingBox,o)),d=Xc(d,c,o,i),i&&(d=function(e,t,n){let r,i;return r=n.x===`left`?t.origin.x:n.x===`right`?t.origin.x+t.size.width-e.size.width:t.origin.x+(t.size.width-e.size.width)/2,i=n.y===`top`?t.origin.y:n.y===`bottom`?t.origin.y+t.size.height-e.size.height:t.origin.y+(t.size.height-e.size.height)/2,{origin:{x:r,y:i},size:e.size}}(d,a,l)),s!==0){let e=function(e,t){return{x:t.x===`left`?e.origin.x:t.x===`right`?e.origin.x+e.size.width:e.origin.x+e.size.width/2,y:t.y===`top`?e.origin.y:t.y===`bottom`?e.origin.y+e.size.height:e.origin.y+e.size.height/2}}(a,l),t={x:a.origin.x+a.size.width/2,y:a.origin.y+a.size.height/2},n={x:d.origin.x+d.size.width/2,y:d.origin.y+d.size.height/2},r=At(e,t,s),i=At(e,n,s);d={origin:{x:d.origin.x+(r.x-i.x),y:d.origin.y+(r.y-i.y)},size:d.size}}return d}var $c={n:0,ne:45,e:90,se:135,s:180,sw:225,w:270,nw:315},el=[`ns-resize`,`nesw-resize`,`ew-resize`,`nwse-resize`,`ns-resize`,`nesw-resize`,`ew-resize`,`nwse-resize`];function tl(e,t,n=0){let r=(($c[e]+90*t+n)%360+360)%360;return el[Math.round(r/45)%8]}function nl(e,t,n){let r=-e/2;return n===`center`?r:n===`outside`?r-t:r+t}var rl=class{constructor(e,t){this.config=e,this.onUpdate=t,this.state=`idle`,this.startPoint=null,this.startElement=null,this.startRotationElement=null,this.gestureRotationCenter=null,this.activeHandle=null,this.currentPosition=null,this.activeVertexIndex=null,this.startVertices=[],this.currentVertices=[],this.rotationCenter=null,this.centerScreen=null,this.initialRotation=0,this.lastComputedRotation=0,this.rotationDelta=0,this.rotationSnappedAngle=null,this.currentVertices=e.vertices||[]}updateConfig(e){this.config={...this.config,...e},this.state!==`vertex-editing`&&(this.currentVertices=e.vertices||[])}startDrag(e,t){this.state=`dragging`,this.startPoint={x:e,y:t},this.startElement={...this.config.element},this.startRotationElement=this.config.rotationElement?{...this.config.rotationElement}:null,this.currentPosition={...this.config.element},this.onUpdate({state:`start`,transformData:{type:`move`,changes:{rect:this.startElement}}})}startResize(e,t,n){this.state=`resizing`,this.activeHandle=e,this.startPoint={x:t,y:n},this.startElement={...this.config.element},this.currentPosition={...this.config.element},this.onUpdate({state:`start`,transformData:{type:`resize`,changes:{rect:this.startElement},metadata:{handle:this.activeHandle,maintainAspectRatio:this.config.maintainAspectRatio}}})}startVertexEdit(e,t,n){this.currentVertices=[...this.config.vertices??this.currentVertices],e<0||e>=this.currentVertices.length||(this.state=`vertex-editing`,this.activeVertexIndex=e,this.startPoint={x:t,y:n},this.startVertices=[...this.currentVertices],this.gestureRotationCenter=this.config.rotationCenter??{x:this.config.element.origin.x+this.config.element.size.width/2,y:this.config.element.origin.y+this.config.element.size.height/2},this.onUpdate({state:`start`,transformData:{type:`vertex-edit`,changes:{vertices:this.startVertices},metadata:{vertexIndex:e}}}))}startRotation(e,t,n=0,r){this.state=`rotating`,this.startPoint={x:e,y:t},this.startElement={...this.config.element},this.rotationCenter=this.config.rotationCenter??{x:this.config.element.origin.x+this.config.element.size.width/2,y:this.config.element.origin.y+this.config.element.size.height/2};let{scale:i=1}=this.config,a=this.config.rotationElement??this.config.element,o=a.size.width*i,s=a.size.height*i,c=r??Math.max(o,s)/2+35,l=(n+90*(this.config.pageRotation??0))*Math.PI/180;this.centerScreen={x:e-c*Math.sin(l),y:t+c*Math.cos(l)},this.initialRotation=n,this.lastComputedRotation=n,this.rotationDelta=0,this.rotationSnappedAngle=null,this.onUpdate({state:`start`,transformData:{type:`rotate`,changes:{rotation:n},metadata:{rotationAngle:n,rotationDelta:0,rotationCenter:this.rotationCenter,isSnapped:!1}}})}move(e,t,n,r){if(this.state!==`idle`&&this.startPoint){if(n===void 0||n!==0){if(this.state===`dragging`&&this.startElement){let n=this.calculateDelta(e,t),r=this.calculateDragPosition(n);this.currentPosition=r,this.onUpdate({state:`move`,transformData:{type:`move`,changes:{rect:r}}})}else if(this.state===`resizing`&&this.activeHandle&&this.startElement){let n=function(e,t,n){let{annotationRotation:r=0,constraints:i}=n,a=i?.boundingBox;if(r!==0&&a){let i=Qc(e,t,n,!1,!0);if(Zc(i,r,a))return i;let o=Qc({x:0,y:0},t,n,!1,!0),s=0,c=1;for(let i=0;i<20;i+=1){let i=(s+c)/2,l=Qc({x:e.x*i,y:e.y*i},t,n,!1,!0);Zc(l,r,a)?(o=l,s=i):c=i}return o}return Qc(e,t,n,!0,!1)}(this.calculateLocalDelta(e,t),this.activeHandle,{startRect:this.startElement,maintainAspectRatio:this.config.maintainAspectRatio||!!r,annotationRotation:this.config.annotationRotation,constraints:this.config.constraints});this.currentPosition=n,this.onUpdate({state:`move`,transformData:{type:`resize`,changes:{rect:n},metadata:{handle:this.activeHandle,maintainAspectRatio:this.config.maintainAspectRatio||!!r}}})}else if(this.state===`vertex-editing`&&this.activeVertexIndex!==null){let n=this.calculateVertexPosition(e,t);this.currentVertices=n,this.onUpdate({state:`move`,transformData:{type:`vertex-edit`,changes:{vertices:n},metadata:{vertexIndex:this.activeVertexIndex}}})}else if(this.state===`rotating`&&this.rotationCenter){let n=this.calculateAngleFromMouse(e,t),r=this.applyRotationSnapping(n),i=Ot(r.angle),a=i-this.lastComputedRotation,o=a>180?a-360:a<-180?a+360:a;this.rotationDelta+=o,this.lastComputedRotation=i,this.rotationSnappedAngle=r.isSnapped?i:null,this.onUpdate({state:`move`,transformData:{type:`rotate`,changes:{rotation:i},metadata:{rotationAngle:i,rotationDelta:this.rotationDelta,rotationCenter:this.rotationCenter,isSnapped:r.isSnapped,snappedAngle:this.rotationSnappedAngle??void 0,cursorPosition:{clientX:e,clientY:t}}}})}}else this.end()}}end(){if(this.state===`idle`)return;let e=this.state,t=this.activeHandle,n=this.activeVertexIndex;if(e===`vertex-editing`)this.onUpdate({state:`end`,transformData:{type:`vertex-edit`,changes:{vertices:this.currentVertices},metadata:{vertexIndex:n||void 0}}});else if(e===`rotating`)this.onUpdate({state:`end`,transformData:{type:`rotate`,changes:{rotation:this.lastComputedRotation},metadata:{rotationAngle:this.lastComputedRotation,rotationDelta:this.rotationDelta,rotationCenter:this.rotationCenter||void 0,isSnapped:this.rotationSnappedAngle!==null,snappedAngle:this.rotationSnappedAngle??void 0}}});else{let n=this.currentPosition||this.config.element;this.onUpdate({state:`end`,transformData:{type:e===`dragging`?`move`:`resize`,changes:{rect:n},metadata:e===`dragging`?void 0:{handle:t||void 0,maintainAspectRatio:this.config.maintainAspectRatio}}})}this.reset()}cancel(){this.state!==`idle`&&(this.state===`vertex-editing`?this.onUpdate({state:`end`,transformData:{type:`vertex-edit`,changes:{vertices:this.startVertices},metadata:{vertexIndex:this.activeVertexIndex||void 0}}}):this.state===`rotating`?this.onUpdate({state:`end`,transformData:{type:`rotate`,changes:{rotation:this.initialRotation},metadata:{rotationAngle:this.initialRotation,rotationDelta:0,rotationCenter:this.rotationCenter||void 0,isSnapped:!1}}}):this.startElement&&this.onUpdate({state:`end`,transformData:{type:this.state===`dragging`?`move`:`resize`,changes:{rect:this.startElement},metadata:this.state===`dragging`?void 0:{handle:this.activeHandle||void 0,maintainAspectRatio:this.config.maintainAspectRatio}}}),this.reset())}reset(){this.state=`idle`,this.startPoint=null,this.startElement=null,this.startRotationElement=null,this.gestureRotationCenter=null,this.activeHandle=null,this.currentPosition=null,this.activeVertexIndex=null,this.startVertices=[],this.rotationCenter=null,this.centerScreen=null,this.initialRotation=0,this.lastComputedRotation=0,this.rotationDelta=0,this.rotationSnappedAngle=null}calculateDelta(e,t){if(!this.startPoint)return{x:0,y:0};let n={x:e-this.startPoint.x,y:t-this.startPoint.y};return this.transformDelta(n)}transformDelta(e){let{pageRotation:t=0,scale:n=1}=this.config,r=t*Math.PI/2,i=Math.cos(r),a=Math.sin(r),o=e.x/n,s=e.y/n;return{x:i*o+a*s,y:-a*o+i*s}}calculateLocalDelta(e,t){let n=this.calculateDelta(e,t),{annotationRotation:r=0}=this.config;if(r===0)return n;let i=r*Math.PI/180,a=Math.cos(i),o=Math.sin(i);return{x:a*n.x+o*n.y,y:-o*n.x+a*n.y}}clampPoint(e){let t=this.config.constraints?.boundingBox;if(!t)return e;let{annotationRotation:n=0}=this.config;if(n===0)return{x:Math.max(0,Math.min(e.x,t.width)),y:Math.max(0,Math.min(e.y,t.height))};let r=this.gestureRotationCenter??this.config.rotationCenter??{x:this.config.element.origin.x+this.config.element.size.width/2,y:this.config.element.origin.y+this.config.element.size.height/2},i=At(e,r,n),a=Math.max(0,Math.min(i.x,t.width)),o=Math.max(0,Math.min(i.y,t.height));return a===i.x&&o===i.y?e:At({x:a,y:o},r,-n)}calculateVertexPosition(e,t){if(this.activeVertexIndex===null)return this.startVertices;let n=this.calculateLocalDelta(e,t),r=[...this.startVertices],i=r[this.activeVertexIndex],a={x:i.x+n.x,y:i.y+n.y};return r[this.activeVertexIndex]=this.clampPoint(a),r}calculateDragPosition(e){if(!this.startElement)return this.config.element;let t={origin:{x:this.startElement.origin.x+e.x,y:this.startElement.origin.y+e.y},size:{width:this.startElement.size.width,height:this.startElement.size.height}},{annotationRotation:n=0,constraints:r}=this.config,i=r?.boundingBox;if(n!==0&&i){let e,r,a,o;if(this.startRotationElement)e=this.startRotationElement.size.width,r=this.startRotationElement.size.height,a=this.startRotationElement.origin.x-this.startElement.origin.x,o=this.startRotationElement.origin.y-this.startElement.origin.y;else{let i=Math.abs(n*Math.PI/180),s=Math.abs(Math.cos(i)),c=Math.abs(Math.sin(i)),l=t.size.width,u=t.size.height;e=l*s+u*c,r=l*c+u*s,a=(l-e)/2,o=(u-r)/2}let{x:s,y:c}=t.origin;return s=Math.max(-a,Math.min(s,i.width-e-a)),c=Math.max(-o,Math.min(c,i.height-r-o)),{origin:{x:s,y:c},size:t.size}}return Xc(t,r,this.config.maintainAspectRatio??!1)}calculateAngleFromMouse(e,t){if(!this.centerScreen)return this.initialRotation;let n=e-this.centerScreen.x,r=t-this.centerScreen.y;if(Math.sqrt(n*n+r*r)<10)return this.lastComputedRotation;let i=90*(this.config.pageRotation??0),a=180/Math.PI*Math.atan2(r,n)+90-i;return Ot(Math.round(a))}applyRotationSnapping(e){let t=this.config.rotationSnapAngles??[0,90,180,270],n=this.config.rotationSnapThreshold??4,r=Ot(e);for(let e of t){let t=Ot(e),i=Math.abs(r-t);if(Math.min(i,360-i)<=n)return{angle:t,isSnapped:!0,snapTarget:t}}return{angle:r,isSnapped:!1}}};function il(e){let{controller:t,resizeUI:n,vertexUI:r,rotationUI:i,includeVertices:a=!1,includeRotation:o=!1,currentRotation:s=0,handleAttrs:c,vertexAttrs:l,rotationAttrs:u}=e,{dragProps:d,createResizeProps:f,createVertexProps:p,createRotationProps:m}=function(e){let{onUpdate:t,enabled:n=!0,...r}=e,i=N(null),a=N(t),o=N(null),s=N(null);M(()=>{a.current=t},[t]),M(()=>{i.current?i.current.updateConfig(r):i.current=new rl(r,e=>a.current?.call(a,e))},[r.element,r.rotationCenter,r.rotationElement,r.constraints,r.maintainAspectRatio,r.pageRotation,r.annotationRotation,r.scale,r.vertices]);let c=F(e=>{var t,n;let r=o.current,i=s.current,a=e??r;if(i&&a!==null)try{(t=i.hasPointerCapture)!=null&&t.call(i,a)&&((n=i.releasePointerCapture)==null||n.call(i,a))}catch{}o.current=null,s.current=null},[]),l=F(e=>{var t;o.current!==null&&o.current!==e.pointerId&&((t=i.current)==null||t.end(),c(o.current));let n=e.currentTarget;o.current=e.pointerId,s.current=n;try{n.setPointerCapture(e.pointerId)}catch{}},[c]);M(()=>{let e=globalThis,t=e=>{var t;let n=o.current;n!==null&&e.pointerId===n&&((t=i.current)==null||t.end(),c(e.pointerId))},n=()=>{var e;o.current!==null&&((e=i.current)==null||e.end(),c())};return e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`blur`,n,!0),()=>{e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`blur`,n,!0)}},[c]),M(()=>()=>{var e;o.current!==null&&((e=i.current)==null||e.end(),c())},[c]);let u=F(e=>{var t;n&&(e.preventDefault(),e.stopPropagation(),(t=i.current)==null||t.startDrag(e.clientX,e.clientY),l(e))},[n,l]),d=F(e=>{var t;e.preventDefault(),e.stopPropagation();let n=o.current;n!==null&&e.pointerId!==n||((t=i.current)==null||t.move(e.clientX,e.clientY,e.buttons,e.shiftKey),o.current===e.pointerId&&e.buttons===0&&c(e.pointerId))},[c]),f=F(e=>{var t;e.preventDefault(),e.stopPropagation();let n=o.current;n!==null&&e.pointerId!==n||((t=i.current)==null||t.end(),c(e.pointerId))},[c]),p=F(e=>{var t;let n=o.current;n!==null&&e.pointerId===n&&((t=i.current)==null||t.end(),c(e.pointerId))},[c]),m=F(e=>({onPointerDown:t=>{var r;n&&(t.preventDefault(),t.stopPropagation(),(r=i.current)==null||r.startResize(e,t.clientX,t.clientY),l(t))},onPointerMove:d,onPointerUp:f,onPointerCancel:f,onLostPointerCapture:p}),[n,d,f,p,l]),h=F(e=>({onPointerDown:t=>{var r;n&&(t.preventDefault(),t.stopPropagation(),(r=i.current)==null||r.startVertexEdit(e,t.clientX,t.clientY),l(t))},onPointerMove:d,onPointerUp:f,onPointerCancel:f,onLostPointerCapture:p}),[n,d,f,p,l]),g=F((e=0,t)=>({onPointerDown:r=>{var a;if(!n)return;r.preventDefault(),r.stopPropagation();let o=r.currentTarget.getBoundingClientRect(),s=o.left+o.width/2,c=o.top+o.height/2;(a=i.current)==null||a.startRotation(s,c,e,t),l(r)},onPointerMove:d,onPointerUp:f,onPointerCancel:f,onLostPointerCapture:p}),[n,d,f,p,l]);return{dragProps:n?{onPointerDown:u,onPointerMove:d,onPointerUp:f,onPointerCancel:f,onLostPointerCapture:p}:{},createResizeProps:m,createVertexProps:h,createRotationProps:g}}(t);return{dragProps:d,resize:P(()=>function(e,t={}){let{handleSize:n=8,spacing:r=1,offsetMode:i=`outside`,includeSides:a=!1,zIndex:o=3,rotationAwareCursor:s=!0}=t,c=(e.pageRotation??0)%4,l=e.annotationRotation??0,u=e=>({[e]:nl(n,r,i)+`px`});return[[`nw`,{...u(`top`),...u(`left`)}],[`ne`,{...u(`top`),...u(`right`)}],[`sw`,{...u(`bottom`),...u(`left`)}],[`se`,{...u(`bottom`),...u(`right`)}],...a?[[`n`,{...u(`top`),left:`calc(50% - ${n/2}px)`}],[`s`,{...u(`bottom`),left:`calc(50% - ${n/2}px)`}],[`w`,{...u(`left`),top:`calc(50% - ${n/2}px)`}],[`e`,{...u(`right`),top:`calc(50% - ${n/2}px)`}]]:[]].map(([e,t])=>({handle:e,style:{position:`absolute`,width:n+`px`,height:n+`px`,borderRadius:`50%`,zIndex:o,cursor:s?tl(e,c,l):`default`,pointerEvents:`auto`,touchAction:`none`,...t},attrs:{"data-epdf-handle":e}}))}(t,n).map(e=>({key:e.attrs?.[`data-epdf-handle`],style:e.style,...f(e.handle),...e.attrs??{},...c?.(e.handle)??{}})),[t.element.origin.x,t.element.origin.y,t.element.size.width,t.element.size.height,t.scale,t.pageRotation,t.annotationRotation,t.maintainAspectRatio,n?.handleSize,n?.spacing,n?.offsetMode,n?.includeSides,n?.zIndex,n?.rotationAwareCursor,f,c]),vertices:P(()=>a?function(e,t={},n){let{vertexSize:r=12,zIndex:i=4}=t,a=e.element,o=e.scale??1;return(n??e.vertices??[]).map((e,t)=>({handle:`nw`,style:{position:`absolute`,left:(e.x-a.origin.x)*o-r/2+`px`,top:(e.y-a.origin.y)*o-r/2+`px`,width:r+`px`,height:r+`px`,borderRadius:`50%`,cursor:`pointer`,zIndex:i,pointerEvents:`auto`,touchAction:`none`},attrs:{"data-epdf-vertex":t}}))}(t,r,t.vertices).map((e,t)=>({key:t,style:e.style,...p(t),...e.attrs??{},...l?.(t)??{}})):[],[a,t.element.origin.x,t.element.origin.y,t.element.size.width,t.element.size.height,t.scale,t.vertices,r?.vertexSize,r?.zIndex,p,l]),rotation:P(()=>{if(!o)return null;let e=function(e,t={},n=0){let{handleSize:r=16,zIndex:i=5,showConnector:a=!0,connectorWidth:o=1}=t,s=e.scale??1,c=e.element,l=e.rotationElement??c,u=e.rotationCenter??{x:c.origin.x+c.size.width/2,y:c.origin.y+c.size.height/2};l.size.width,l.size.height;let d=(u.x-l.origin.x)*s,f=(u.y-l.origin.y)*s,p=n*Math.PI/180,m=t.margin??35,h=c.size.height*s/2+m;return{handleStyle:{position:`absolute`,left:d+h*Math.sin(p)-r/2+`px`,top:f-h*Math.cos(p)-r/2+`px`,width:r+`px`,height:r+`px`,borderRadius:`50%`,cursor:`grab`,zIndex:i,pointerEvents:`auto`,touchAction:`none`},connectorStyle:a?{position:`absolute`,left:d-o/2+`px`,top:f-h+`px`,width:o+`px`,height:h+`px`,transformOrigin:`center bottom`,transform:`rotate(${n}deg)`,zIndex:i-1,pointerEvents:`none`}:{},radius:h,attrs:{"data-epdf-rotation-handle":!0}}}(t,i,s);return{handle:{style:e.handleStyle,...m(s,e.radius),...e.attrs??{},...u?.()??{}},connector:{style:e.connectorStyle,"data-epdf-rotation-connector":!0}}},[o,t.element.origin.x,t.element.origin.y,t.element.size.width,t.element.size.height,t.rotationCenter?.x,t.rotationCenter?.y,t.rotationElement?.origin.x,t.rotationElement?.origin.y,t.rotationElement?.size.width,t.rotationElement?.size.height,t.scale,s,i?.handleSize,i?.margin,i?.zIndex,i?.showConnector,i?.connectorWidth,m,u])}}var al=()=>ei(Gc.id),ol=()=>$r(Gc.id);function sl({documentId:e,pageIndex:t,scale:n,rotation:r,background:i=`rgba(33,150,243)`,selectionMenu:a}){let{plugin:o}=ol(),s=ni(e),c=s?.document?.pages?.[t],[l,u]=j([]),[d,f]=j(null),[p,m]=j(null);M(()=>{if(o&&e)return o.registerSelectionOnPage({documentId:e,pageIndex:t,onRectsChange:({rects:e,boundingRect:t})=>{u(e),f(t)}})},[o,e,t]),M(()=>{if(o&&e)return o.onMenuPlacement(e,e=>{m(e)})},[o,e]);let h=P(()=>n===void 0?s?.scale??1:n,[n,s?.scale]),g=P(()=>r===void 0?((c?.rotation??0)+(s?.rotation??0))%4:r,[r,c?.rotation,s?.rotation]),_=a&&p&&p.pageIndex===t&&p.isVisible;return d?I(A,{children:[I(`div`,{style:{position:`absolute`,left:d.origin.x*h,top:d.origin.y*h,width:d.size.width*h,height:d.size.height*h,mixBlendMode:`multiply`,isolation:`isolate`,pointerEvents:`none`},children:l.map((e,t)=>I(`div`,{style:{position:`absolute`,left:(e.origin.x-d.origin.x)*h,top:(e.origin.y-d.origin.y)*h,width:e.size.width*h,height:e.size.height*h,background:i}},t))}),_&&I(Yc,{rect:{origin:{x:p.rect.origin.x*h,y:p.rect.origin.y*h},size:{width:p.rect.size.width*h,height:p.rect.size.height*h}},rotation:g,children:e=>a({...e,context:{type:`selection`,pageIndex:t},selected:!0,placement:p})})]}):null}var cl=({documentId:e,pageIndex:t,scale:n,className:r,background:i,borderColor:a,borderStyle:o=`dashed`,stroke:s,fill:c})=>{let{plugin:l}=ol(),u=ni(e),[d,f]=j(null),p=a??s??`rgba(0,122,204,0.8)`,m=i??c??`rgba(0,122,204,0.15)`,h=P(()=>n===void 0?u?.scale??1:n,[n,u?.scale]);return M(()=>{if(l&&e)return l.registerMarqueeOnPage({documentId:e,pageIndex:t,scale:h,onRectChange:f})},[l,e,t,h]),d?I(`div`,{style:{position:`absolute`,pointerEvents:`none`,left:d.origin.x*h,top:d.origin.y*h,width:d.size.width*h,height:d.size.height*h,border:`1px ${o} ${p}`,background:m,boxSizing:`border-box`,zIndex:1e3},className:r}):null};function ll({documentId:e,pageIndex:t,scale:n,rotation:r,background:i,textStyle:a,marqueeStyle:o,marqueeClassName:s,selectionMenu:c}){return I(A,{children:[I(sl,{documentId:e,pageIndex:t,scale:n,rotation:r,background:a?.background??i,selectionMenu:c}),I(cl,{documentId:e,pageIndex:t,scale:n,background:o?.background,borderColor:o?.borderColor,borderStyle:o?.borderStyle,className:s})]})}var ul=Yr(Kc).addUtility(function(){let{provides:e}=al();return M(()=>{if(e)return e.onCopyToClipboard(({text:e})=>{navigator.clipboard.writeText(e)})},[e]),null}).build(),dl=`tiling`,fl={id:dl,name:`Tiling Plugin`,version:`1.0.0`,provides:[`tiling`],requires:[`render`,`scroll`,`viewport`],optional:[],defaultConfig:{tileSize:768,overlapPx:2.5,extraRings:0}},pl=`TILING/INIT_STATE`,ml=`TILING/CLEANUP_STATE`,hl=`TILING/UPDATE_VISIBLE_TILES`,gl=`TILING/MARK_TILE_STATUS`,_l=(e,t)=>({type:hl,payload:{documentId:e,tiles:t}}),vl=(e,t,n,r)=>({type:gl,payload:{documentId:e,pageIndex:t,tileId:n,status:r}}),yl={visibleTiles:{}};function bl({tileSize:e=768,overlapPx:t=2.5,extraRings:n=0,scale:r,rotation:i,page:a,metric:o}){let s=a.size.width*r,c=a.size.height*r,l=e-t,u=function(e,t,n,r){return wt(Ct(e,t,(4-n)%4),1/r)}(ht(a.size,i,r),{origin:{x:o.scaled.pageX,y:o.scaled.pageY},size:{width:o.scaled.visibleWidth,height:o.scaled.visibleHeight}},i,1),d=u.origin.x,f=u.origin.y,p=d+u.size.width,m=f+u.size.height,h=Math.floor((s-1)/l),g=Math.floor((c-1)/l),_=Math.max(0,Math.floor(d/l)-n),v=Math.min(h,Math.floor((p-1)/l)+n),y=Math.max(0,Math.floor(f/l)-n),b=Math.min(g,Math.floor((m-1)/l)+n),x=[];for(let t=_;t<=v;t++){let n=t*l,i=Math.min(e,s-n),o=n/r,u=i/r;for(let s=y;s<=b;s++){let d=s*l,f=Math.min(e,c-d),p=d/r,m=f/r;x.push({id:`p${a.index}-${r}-x${n}-y${d}-w${i}-h${f}`,col:t,row:s,pageRect:{origin:{x:o,y:p},size:{width:u,height:m}},screenRect:{origin:{x:n,y:d},size:{width:i,height:f}},status:`queued`,srcScale:r,isFallback:!1})}}return x}var xl=class extends Rr{constructor(e,t,n){super(e,t),this.tileRendering$=J(),this.config=n,this.renderCapability=this.registry.getPlugin(`render`).provides(),this.scrollCapability=this.registry.getPlugin(`scroll`).provides(),this.viewportCapability=this.registry.getPlugin(`viewport`).provides(),this.scrollCapability.onScroll(e=>this.calculateVisibleTiles(e.documentId,e.metrics),{mode:`throttle`,wait:50,throttleMode:`trailing`}),this.coreStore.onAction(yr,e=>this.recalculateTiles(e.payload))}onDocumentLoadingStarted(e){this.dispatch(((e,t)=>({type:pl,payload:{documentId:e,state:t}}))(e,yl))}onDocumentClosed(e){this.dispatch((e=>({type:ml,payload:e}))(e))}onScaleChanged(e){this.recalculateTilesForDocument(e)}onRotationChanged(e){this.recalculateTilesForDocument(e)}recalculateTilesForDocument(e){let t=this.scrollCapability.forDocument(e),n=this.viewportCapability.forDocument(e),r=t.getMetrics(n.getMetrics());this.calculateVisibleTiles(e,r)}async recalculateTiles(e){let{documentId:t,pageIndexes:n}=e,r=this.getCoreDocument(t);if(!r||!r.document)return;let i=this.scrollCapability.forDocument(t),a=this.viewportCapability.forDocument(t),o=i.getMetrics(a.getMetrics()),s={},c=Date.now(),l=r.scale;for(let e of n){let t=o.pageVisibilityMetrics.find(t=>t.pageNumber===e+1);if(!t)continue;let n=r.document.pages[e];n&&(s[e]=bl({page:n,metric:t,scale:l,rotation:((n.rotation??0)+r.rotation)%4,tileSize:this.config.tileSize,overlapPx:this.config.overlapPx,extraRings:this.config.extraRings}).map(e=>({...e,id:`${e.id}-r${c}`})))}Object.keys(s).length>0&&this.dispatch(_l(t,s))}async initialize(){}calculateVisibleTiles(e,t){let n=this.getCoreDocument(e);if(!n||!n.document)return;let r=n.scale,i={};for(let e of t.pageVisibilityMetrics){let t=e.pageNumber-1,a=n.document.pages[t];a&&(i[t]=bl({page:a,metric:e,scale:r,rotation:((a.rotation??0)+n.rotation)%4,tileSize:this.config.tileSize,overlapPx:this.config.overlapPx,extraRings:this.config.extraRings}))}this.dispatch(_l(e,i))}onStoreUpdated(e,t){for(let n in t.documents){let r=e.documents[n],i=t.documents[n];r!==i&&this.tileRendering$.emit({documentId:n,tiles:i.visibleTiles})}}buildCapability(){return{renderTile:this.renderTile.bind(this),forDocument:this.createTilingScope.bind(this),onTileRendering:this.tileRendering$.on}}createTilingScope(e){return{renderTile:t=>this.renderTile(t,e),onTileRendering:t=>this.tileRendering$.on(n=>{n.documentId===e&&t(n.tiles)})}}renderTile(e,t){let n=t??this.getActiveDocumentId();if(!this.renderCapability)throw Error(`Render capability not available.`);this.dispatch(vl(n,e.pageIndex,e.tile.id,`rendering`));let r=this.renderCapability.forDocument(n).renderPageRect({pageIndex:e.pageIndex,rect:e.tile.pageRect,options:{scaleFactor:e.tile.srcScale,dpr:e.dpr,...e.imageType||this.config.defaultImageType?{imageType:e.imageType??this.config.defaultImageType}:{}}});return r.wait(()=>{this.dispatch(vl(n,e.pageIndex,e.tile.id,`ready`))},nr),r}};xl.id=`tiling`;var Sl=xl,Cl={manifest:fl,create:(e,t)=>new Sl(dl,e,t),reducer:(e,t)=>((e,t)=>{switch(t.type){case pl:{let{documentId:n,state:r}=t.payload;return{...e,documents:{...e.documents,[n]:r}}}case ml:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i}}case hl:{let{documentId:n,tiles:r}=t.payload,i=e.documents[n];if(!i)return e;let a={...i.visibleTiles};for(let e in r){let t=Number(e),n=r[t],i=a[t]??[],o=i.find(e=>!e.isFallback)?.srcScale,s=n.length>0?n[0].srcScale:o;if(o!==void 0&&o!==s){let e=i.filter(e=>!e.isFallback&&e.status===`ready`).map(e=>({...e,isFallback:!0}));a[t]=[...e.length>0?[]:i.filter(e=>e.isFallback),...e,...n]}else{let e=new Set(n.map(e=>e.id)),r=[],o=new Set;for(let t of i)(t.isFallback||e.has(t.id))&&(r.push(t),o.add(t.id));for(let e of n)o.has(e.id)||r.push(e);a[t]=r}}return{...e,documents:{...e.documents,[n]:{...i,visibleTiles:a}}}}case gl:{let{documentId:n,pageIndex:r,tileId:i,status:a}=t.payload,o=e.documents[n];if(!o)return e;let s=o.visibleTiles[r]?.map(e=>e.id===i?{...e,status:a}:e)??[],c=s.filter(e=>!e.isFallback),l=c.length>0&&c.every(e=>e.status===`ready`)?c:s;return{...e,documents:{...e.documents,[n]:{...o,visibleTiles:{...o.visibleTiles,[r]:l}}}}}default:return e}})(e,t),initialState:{documents:{}}},wl=()=>ei(Sl.id);function Tl({documentId:e,pageIndex:t,tile:n,dpr:r,scale:i}){let{provides:a}=wl(),o=P(()=>a?.forDocument(e),[a,e]),[s,c]=j(),l=N(null),u=i/n.srcScale;return M(()=>{if(n.status===`ready`&&l.current||!o)return;let e=o.renderTile({pageIndex:t,tile:n,dpr:r});return e.wait(e=>{let t=URL.createObjectURL(e);l.current=t,c(t)},nr),()=>{l.current?(URL.revokeObjectURL(l.current),l.current=null):e.abort({code:W.Cancelled,message:`canceled render task`})}},[o,t,n.id]),s?I(`img`,{src:s,onLoad:()=>{l.current&&=(URL.revokeObjectURL(l.current),null)},style:{position:`absolute`,left:n.screenRect.origin.x*u,top:n.screenRect.origin.y*u,width:n.screenRect.size.width*u,height:n.screenRect.size.height*u,display:`block`}}):null}function El({documentId:e,pageIndex:t,scale:n,style:r,...i}){let{provides:a}=wl(),o=ni(e),[s,c]=j([]);M(()=>{if(a)return a.onTileRendering(n=>{n.documentId===e&&c(n.tiles[t]??[])})},[a,e,t]);let l=P(()=>n===void 0?o?.scale??1:n,[n,o?.scale]);return I(`div`,{style:{...r},...i,children:s?.map(n=>I(Tl,{documentId:e,pageIndex:t,tile:n,dpr:window.devicePixelRatio,scale:l},n.id))})}var Dl=`thumbnail`,Ol={id:Dl,name:`Thumbnail Plugin`,version:`1.0.0`,provides:[`thumbnail`],requires:[`render`],optional:[`scroll`],defaultConfig:{width:150,gap:10,buffer:3,labelHeight:16,autoScroll:!0,scrollBehavior:`smooth`,imagePadding:0,paddingY:0}},kl=`THUMBNAIL/INIT_STATE`,Al=`THUMBNAIL/CLEANUP_STATE`,jl=`THUMBNAIL/SET_WINDOW_STATE`,Ml=`THUMBNAIL/UPDATE_VIEWPORT_METRICS`;function Nl(e,t){return{type:kl,payload:{documentId:e,state:t}}}var Pl={thumbs:[],window:null,viewportH:0,scrollY:0},Fl={documents:{},activeDocumentId:null},Il=class extends Rr{constructor(e,t,n){super(e,t),this.cfg=n,this.scrollCapability=null,this.taskCaches=new Map,this.canAutoScroll=new Map,this.window$=qr((e,t)=>({documentId:e,window:t})),this.scrollTo$=qr((e,t)=>({documentId:e,options:t})),this.refreshPages$=qr((e,t)=>({documentId:e,pages:t}),{cache:!1}),this.renderCapability=this.registry.getPlugin(`render`).provides(),this.scrollCapability=this.registry.getPlugin(`scroll`)?.provides()??null,this.coreStore.onAction(yr,e=>{let t=e.payload.documentId??this.getActiveDocumentId(),n=e.payload.pageIndexes;this.refreshPages$.emit(t,n);let r=this.taskCaches.get(t);if(r)for(let e of n)r.delete(e)}),this.scrollCapability&&!1!==this.cfg.autoScroll&&(this.scrollCapability.onPageChangeState(({documentId:e,state:t})=>{this.canAutoScroll.set(e,!t.isChanging),t.isChanging||this.scrollToThumb(t.targetPage-1,e)}),this.scrollCapability.onPageChange(({documentId:e,pageNumber:t})=>{!1!==this.canAutoScroll.get(e)&&this.scrollToThumb(t-1,e)}))}onDocumentLoadingStarted(e){this.dispatch(Nl(e,{...Pl})),this.taskCaches.set(e,new Map),this.canAutoScroll.set(e,!0),this.logger.debug(`ThumbnailPlugin`,`DocumentOpened`,`Initialized thumbnail state for document: ${e}`)}onDocumentLoaded(e){this.calculateWindowState(e)}onDocumentClosed(e){this.dispatch(function(e){return{type:Al,payload:e}}(e));let t=this.taskCaches.get(e);t&&(t.forEach(e=>{e.abort({code:`cancelled`,message:`Document closed`})}),t.clear(),this.taskCaches.delete(e)),this.canAutoScroll.delete(e),this.window$.clearScope(e),this.scrollTo$.clearScope(e),this.refreshPages$.clearScope(e),this.logger.debug(`ThumbnailPlugin`,`DocumentClosed`,`Cleaned up thumbnail state for document: ${e}`)}onRotationChanged(e){this.calculateWindowState(e)}buildCapability(){return{scrollToThumb:e=>this.scrollToThumb(e),renderThumb:(e,t)=>this.renderThumb(e,t),updateWindow:(e,t)=>this.updateWindow(e,t),getWindow:()=>this.getWindow(),forDocument:e=>this.createThumbnailScope(e),onWindow:this.window$.onGlobal,onScrollTo:this.scrollTo$.onGlobal,onRefreshPages:this.refreshPages$.onGlobal}}createThumbnailScope(e){return{scrollToThumb:t=>this.scrollToThumb(t,e),renderThumb:(t,n)=>this.renderThumb(t,n,e),updateWindow:(t,n)=>this.updateWindow(t,n,e),getWindow:()=>this.getWindow(e),onWindow:this.window$.forScope(e),onScrollTo:this.scrollTo$.forScope(e),onRefreshPages:this.refreshPages$.forScope(e)}}getDocumentState(e){let t=e??this.getActiveDocumentId();return this.state.documents[t]??null}calculateWindowState(e){let t=this.coreState.core.documents[e];if(!t?.document)return;let n=this.cfg.width??120,r=this.cfg.labelHeight??16,i=this.cfg.gap??8,a=this.cfg.imagePadding??0,o=this.cfg.paddingY??0,s=Math.max(1,n-2*a),c=o,l=t.document.pages.map(e=>{let t=e.rotation%2==1,n=t?e.size.height:e.size.width,o=(t?e.size.width:e.size.height)/n,l=Math.round(s*o),u=a+l+a+r,d={pageIndex:e.index,width:s,height:l,wrapperHeight:u,top:c,labelHeight:r,padding:a};return c+=u+i,d}),u={start:-1,end:-1,items:[],totalHeight:c-i+o},d=this.getDocumentState(e);d&&(this.dispatch(Nl(e,{...d,thumbs:l,window:u})),d.viewportH>0?this.updateWindow(d.scrollY,d.viewportH,e):this.window$.emit(e,u))}updateWindow(e,t,n){let r=n??this.getActiveDocumentId(),i=this.getDocumentState(r);if(!i||!i.window||i.thumbs.length===0)return;let a=this.cfg.buffer??3;this.dispatch(function(e,t,n){return{type:Ml,payload:{documentId:e,scrollY:t,viewportH:n}}}(r,e,t));let o=0,s=i.thumbs.length-1,c=0;for(;o<=s;){let t=o+s>>1,n=i.thumbs[t];n.top+n.wrapperHeight<e?o=t+1:(c=t,s=t-1)}let l=c,u=e+t;for(;l+1<i.thumbs.length&&i.thumbs[l].top<u;)l++;l=Math.min(i.thumbs.length-1,l+a);let d=Math.max(0,c-a);if(d===i.window.start&&l===i.window.end)return;let f={start:d,end:l,items:i.thumbs.slice(d,l+1),totalHeight:i.window.totalHeight};this.dispatch(function(e,t){return{type:jl,payload:{documentId:e,window:t}}}(r,f)),this.window$.emit(r,f)}getWindow(e){return this.getDocumentState(e)?.window??null}scrollToThumb(e,t){let n=t??this.getActiveDocumentId(),r=this.getDocumentState(n);if(!r||!r.window)return;let i=r.thumbs[e];if(!i)return;let a=this.cfg.scrollBehavior??`smooth`,o=this.cfg.paddingY??0;if(r.viewportH<=0){let e=Math.max(o,i.top-i.wrapperHeight);this.scrollTo$.emit(n,{top:e,behavior:a});return}let s=i.top,c=i.top+i.wrapperHeight,l=s<r.scrollY+8+o,u=c>r.scrollY+r.viewportH-8;l?this.scrollTo$.emit(n,{top:Math.max(0,s-o),behavior:a}):u&&this.scrollTo$.emit(n,{top:Math.max(0,c-r.viewportH+o),behavior:a})}renderThumb(e,t,n){let r=n??this.getActiveDocumentId(),i=this.taskCaches.get(r);if(!i)throw Error(`Task cache not found for document: ${r}`);if(i.has(e))return i.get(e);let a=this.coreState.core.documents[r];if(!a?.document)throw Error(`Document not found: ${r}`);let o=a.document.pages[e];if(!o)throw Error(`Page ${e} not found in document: ${r}`);let s=this.cfg.width??120,c=this.cfg.imagePadding??0,l=Math.max(1,s-2*c)/o.size.width,u=this.renderCapability.forDocument(r).renderPageRect({pageIndex:e,rect:{origin:{x:0,y:0},size:o.size},options:{scaleFactor:l,dpr:t,rotation:o.rotation}});return i.set(e,u),u.wait(nr,()=>i.delete(e)),u}async initialize(){this.logger.info(`ThumbnailPlugin`,`Initialize`,`Thumbnail plugin initialized`)}async destroy(){this.window$.clear(),this.refreshPages$.clear(),this.scrollTo$.clear(),this.taskCaches.forEach(e=>{e.forEach(e=>{e.abort({code:`cancelled`,message:`Plugin destroyed`})}),e.clear()}),this.taskCaches.clear(),this.canAutoScroll.clear(),super.destroy()}};Il.id=`thumbnail`;var Ll=Il,Rl={manifest:Ol,create:(e,t)=>new Ll(Dl,e,t),reducer:(e=Fl,t)=>{switch(t.type){case kl:{let{documentId:n,state:r}=t.payload;return{...e,documents:{...e.documents,[n]:r},activeDocumentId:e.activeDocumentId??n}}case Al:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case`THUMBNAIL/SET_ACTIVE_DOCUMENT`:return{...e,activeDocumentId:t.payload};case jl:{let{documentId:n,window:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,window:r}}}:e}case Ml:{let{documentId:n,scrollY:r,viewportH:i}=t.payload,a=e.documents[n];return a?{...e,documents:{...e.documents,[n]:{...a,scrollY:r,viewportH:i}}}:e}default:return e}},initialState:Fl},zl=()=>$r(Ll.id);function Bl({documentId:e,style:t,children:n,...r}){let{plugin:i}=zl(),a=N(null),[o,s]=j({window:null,docId:null}),c=o.docId===e?o.window:null;M(()=>{if(!i)return;let t=i.provides().forDocument(e),n=t.getWindow();n&&s({window:n,docId:e});let r=t.onWindow(t=>{s({window:t,docId:e})});return()=>{r(),s({window:null,docId:null})}},[i,e]),M(()=>{let t=a.current;if(!t||!i)return;let n=i.provides().forDocument(e),r=()=>n.updateWindow(t.scrollTop,t.clientHeight);return t.addEventListener(`scroll`,r),()=>t.removeEventListener(`scroll`,r)},[i,e]),M(()=>{let t=a.current;if(!t||!i)return;let n=i.provides().forDocument(e),r=new ResizeObserver(()=>{n.updateWindow(t.scrollTop,t.clientHeight)});return r.observe(t),()=>r.disconnect()},[i,e]),M(()=>{let t=a.current;!t||!i||i.provides().forDocument(e).updateWindow(t.scrollTop,t.clientHeight)},[c,i,e]),M(()=>{let t=a.current;if(!(!t||!i||!c))return i.provides().forDocument(e).onScrollTo(({top:e,behavior:n})=>{t.scrollTo({top:e,behavior:n})})},[i,e,!!c]);let l=i?.cfg.paddingY??0;return I(`div`,{ref:a,style:{overflowY:`auto`,position:`relative`,paddingTop:l,paddingBottom:l,height:`100%`,...t},...r,children:I(`div`,{style:{height:c?.totalHeight??0,position:`relative`},children:c?.items.map(e=>n(e))})})}function Vl({documentId:e,meta:t,style:n,...r}){let{provides:i}=ei(Ll.id),{plugin:a}=zl(),[o,s]=j(),c=N(null),[l,u]=j(0);return M(()=>{if(a)return a.provides().forDocument(e).onRefreshPages(e=>{e.includes(t.pageIndex)&&u(e=>e+1)})},[a,e,t.pageIndex]),M(()=>{let n=(i?.forDocument(e))?.renderThumb(t.pageIndex,window.devicePixelRatio);return n?.wait(e=>{let t=URL.createObjectURL(e);c.current=t,s(t)},nr),()=>{c.current?(URL.revokeObjectURL(c.current),c.current=null):n?.abort({code:W.Cancelled,message:`canceled render task`})}},[i,e,t.pageIndex,l]),o?I(`img`,{src:o,onLoad:()=>{c.current&&=(URL.revokeObjectURL(c.current),null)},style:n,...r}):null}var Y=`annotation`,Hl={id:Y,name:`Annotation Plugin`,version:`1.0.0`,provides:[`annotation`],requires:[`interaction-manager`,`selection`],optional:[`history`,`scroll`],defaultConfig:{autoCommit:!0,annotationAuthor:`Guest`,deactivateToolAfterCreate:!1,selectAfterCreate:!0,autoOpenLinks:!0}},Ul=`ANNOTATION/INIT_STATE`,Wl=`ANNOTATION/CLEANUP_STATE`,Gl=`ANNOTATION/SET_ANNOTATIONS`,Kl=`ANNOTATION/SELECT_ANNOTATION`,ql=`ANNOTATION/DESELECT_ANNOTATION`,Jl=`ANNOTATION/ADD_TO_SELECTION`,Yl=`ANNOTATION/REMOVE_FROM_SELECTION`,Xl=`ANNOTATION/SET_SELECTION`,Zl=`ANNOTATION/SET_ACTIVE_TOOL_ID`,Ql=`ANNOTATION/CREATE_ANNOTATION`,$l=`ANNOTATION/PATCH_ANNOTATION`,eu=`ANNOTATION/MOVE_ANNOTATION`,tu=`ANNOTATION/DELETE_ANNOTATION`,nu=`ANNOTATION/COMMIT`,ru=`ANNOTATION/PURGE_ANNOTATION`,iu=`ANNOTATION/SET_LOCKED`,au=`ANNOTATION/SYNC_OBJECT`,ou=`ANNOTATION/ADD_COLOR_PRESET`,su=`ANNOTATION/SET_TOOL_DEFAULTS`,cu=`ANNOTATION/ADD_TOOL`,lu=e=>({type:ql,payload:{documentId:e}}),uu=(e,t,n)=>({type:Jl,payload:{documentId:e,pageIndex:t,id:n}}),du=(e,t)=>({type:Yl,payload:{documentId:e,id:t}}),fu=(e,t)=>({type:Xl,payload:{documentId:e,ids:t}}),pu=(e,t,n)=>({type:Zl,payload:{documentId:e,toolId:t,context:n}}),mu=(e,t,n)=>({type:Ql,payload:{documentId:e,pageIndex:t,annotation:n}}),hu=(e,t,n,r)=>({type:$l,payload:{documentId:e,pageIndex:t,id:n,patch:r}}),gu=(e,t,n,r)=>({type:eu,payload:{documentId:e,pageIndex:t,id:n,patch:r}}),_u=(e,t,n)=>({type:tu,payload:{documentId:e,pageIndex:t,id:n}}),vu=(e,t,n)=>({type:ru,payload:{documentId:e,pageIndex:t,uid:n}}),yu=(e=>(e.None=`none`,e.All=`all`,e.Include=`include`,e.Exclude=`exclude`,e))(yu||{});function bu(e){return function(e){return e.object.type===z.HIGHLIGHT}(e)||function(e){return e.object.type===z.UNDERLINE}(e)||function(e){return e.object.type===z.STRIKEOUT}(e)||function(e){return e.object.type===z.SQUIGGLY}(e)}function xu(e){return e.object.type===z.TEXT}function Su(e){return xu(e)&&!e.object.inReplyToId||bu(e)||function(e){return e.object.type===z.INK}(e)||function(e){return e.object.type===z.SQUARE}(e)||function(e){return e.object.type===z.CIRCLE}(e)||function(e){return e.object.type===z.POLYGON}(e)||function(e){return e.object.type===z.LINE}(e)||function(e){return e.object.type===z.POLYLINE}(e)||function(e){return e.object.type===z.FREETEXT}(e)||function(e){return e.object.type===z.STAMP}(e)||function(e){return e.object.type===z.REDACT}(e)||function(e){return e.object.type===z.CARET}(e)}function Cu(e){return Su(e)||function(e){return e.object.type===z.WIDGET}(e)}function wu(e){return e?.categories??[]}function Tu(e,t){switch(t.type){case yu.None:return!1;case yu.All:return!0;case yu.Include:return e.length!==0&&e.some(e=>t.categories.includes(e));case yu.Exclude:return e.length===0||!e.some(e=>t.categories.includes(e))}}function Eu(e){return e.flags?.includes(`locked`)??!1}function Du(e){return e.flags?.includes(`noView`)??!1}function Ou(e){return e.flags?.includes(`hidden`)??!1}var ku=(e,t)=>(e.pages[t]??[]).map(t=>e.byUid[t]),Au=e=>e.selectedUids.map(t=>e.byUid[t]).filter(e=>e!==void 0),ju=e=>e.selectedUids;function Mu(e,t){return e.tools.find(e=>e.id===t)?.defaults}var Nu=(e,t)=>((e,t,n)=>{let r=[];for(let i of Object.values(e.pages))for(let a of i){let i=e.byUid[a];i&&`inReplyToId`in i.object&&i.object.inReplyToId===t&&n.includes(i.object.type)&&r.push(i)}return r})(e,t,[z.LINK]),Pu=(e,t)=>{let n=e.byUid[t];if(n)return n.object.inReplyToId&&n.object.replyType===cn.Group?n.object.inReplyToId:t},Fu=(e,t)=>{let n=Pu(e,t);if(!n)return[];let r=[],i=e.byUid[n];i&&i.object.type!==z.LINK&&r.push(i);for(let t of Object.values(e.pages))for(let i of t){let t=e.byUid[i];t&&t.object.inReplyToId===n&&t.object.replyType===cn.Group&&t.object.type!==z.LINK&&r.push(t)}return r},Iu=(e,t)=>{let n=e.byUid[t];if(!n||n.object.type===z.LINK)return!1;if(n.object.inReplyToId&&n.object.replyType===cn.Group)return!0;for(let n of Object.values(e.pages))for(let r of n){let n=e.byUid[r];if(n&&n.object.inReplyToId===t&&n.object.replyType===cn.Group&&n.object.type!==z.LINK)return!0}return!1};function Lu(e){let t=e;return[()=>t,e=>{t=e}]}var Ru={annotationType:z.INK,create(e){let{onCommit:t,onPreview:n,getTool:r,pageSize:i}=e,[a,o]=Lu([]),[s,c]=Lu(!1),l={current:null},u=e=>({x:q(e.x,0,i.width),y:q(e.y,0,i.height)}),d=()=>{let e=r();return e?{...e.defaults,strokeWidth:e.defaults.strokeWidth??1,strokeColor:e.defaults.strokeColor??e.defaults.color??`#000000`,opacity:e.defaults.opacity??1,flags:e.defaults.flags??[`print`]}:null},f=()=>{let e=a();if(e.length===0||e[0].points.length===0)return null;let t=d();if(!t)return null;let n=St(bt(e.flatMap(e=>e.points)),t.strokeWidth/2);return{type:z.INK,bounds:n,data:{...t,rect:n,inkList:e,blendMode:t.blendMode}}};return{onPointerDown:(e,t)=>{var r;let i=u(e);c(!0),l.current&&clearTimeout(l.current);let s=[...a(),{points:[i]}];o(s),n(f()),(r=t.setPointerCapture)==null||r.call(t)},onPointerMove:e=>{if(!s())return;let t=a();if(t.length===0)return;let r=u(e);t[t.length-1].points.push(r),o(t),n(f())},onPointerUp:(i,s)=>{var u;c(!1),(u=s.releasePointerCapture)==null||u.call(s);let p=r()?.behavior;if(p?.smartLineRecognition){let e=p.smartLineThreshold??.15,t=a(),r=t[t.length-1];if(r&&r.points.length>1&&function(e,t){if(e.length<3)return!0;let n=e[0],r=e[e.length-1],i=Math.hypot(r.x-n.x,r.y-n.y);return i<5?!1:e.reduce((e,t)=>{let a=Math.abs((r.x-n.x)*(n.y-t.y)-(n.x-t.x)*(r.y-n.y))/i;return Math.max(e,a)},0)/i<t}(r.points,e)){let e=r.points[0],i=r.points[r.points.length-1],a=i.x-e.x,s=i.y-e.y,c=180/Math.PI*Math.atan2(Math.abs(s),Math.abs(a)),l=p.snapAngleDeg??15;if(c<=l){let t=r.points.reduce((e,t)=>e+t.y,0)/r.points.length;r.points=[{x:e.x,y:t},{x:i.x,y:t}]}else if(c>=90-l){let t=r.points.reduce((e,t)=>e+t.x,0)/r.points.length;r.points=[{x:t,y:e.y},{x:t,y:i.y}]}o([...t]),n(f())}}let m=p?.commitDelay??800;l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{let r=a();if(r.length>0&&r[0].points.length>1){let n=d();if(!n)return;let i=St(bt(r.flatMap(e=>e.points)),n.strokeWidth/2);t({...n,inkList:r,rect:i,type:z.INK,pageIndex:e.pageIndex,id:K(),created:new Date})}o([]),n(null)},m)},onPointerCancel:(e,t)=>{var r;o([]),c(!1),n(null),l.current&&clearTimeout(l.current),(r=t.releasePointerCapture)==null||r.call(t)}}}};function zu(e){let t=e=>{let t=9*e,n=Math.PI/6;return{x:-t*Math.cos(n),y:t*Math.sin(n)}};return{getSvgPath:n=>{let{x:r,y:i}=t(n);return e?`M 0 0 L ${r} ${i} L ${r} ${-i} Z`:`M ${r} ${i} L 0 0 L ${r} ${-i}`},getLocalPoints:e=>{let{x:n,y:r}=t(e);return[{x:0,y:0},{x:n,y:r},{x:n,y:-r}]},getRotation:e=>e,filled:e}}function Bu(e,t){let n=t=>t*e/2;return{getSvgPath:e=>{let t=n(e);return`M ${-t} 0 L ${t} 0`},getLocalPoints:e=>{let t=n(e);return[{x:-t,y:0},{x:t,y:0}]},getRotation:t,filled:!1}}var Vu=zu(!1),Hu=zu(!0),Uu={[B.OpenArrow]:Vu,[B.ClosedArrow]:Hu,[B.ROpenArrow]:{...Vu,getRotation:e=>e+Math.PI},[B.RClosedArrow]:{...Hu,getRotation:e=>e+Math.PI},[B.Circle]:{getSvgPath:e=>{let t=5*e/2;return`M ${t} 0 A ${t} ${t} 0 1 1 ${-t} 0 A ${t} ${t} 0 1 1 ${t} 0`},getLocalPoints:e=>{let t=5*e/2;return[{x:-t,y:-t},{x:t,y:t}]},getRotation:()=>0,filled:!0},[B.Square]:{getSvgPath:e=>{let t=6*e/2;return`M ${-t} ${-t} L ${t} ${-t} L ${t} ${t} L ${-t} ${t} Z`},getLocalPoints:e=>{let t=6*e/2;return[{x:-t,y:-t},{x:t,y:-t},{x:t,y:t},{x:-t,y:t}]},getRotation:e=>e,filled:!0},[B.Diamond]:{getSvgPath:e=>{let t=6*e/2;return`M 0 ${-t} L ${t} 0 L 0 ${t} L ${-t} 0 Z`},getLocalPoints:e=>{let t=6*e/2;return[{x:0,y:-t},{x:t,y:0},{x:0,y:t},{x:-t,y:0}]},getRotation:e=>e,filled:!0},[B.Butt]:Bu(6,e=>e+Math.PI/2),[B.Slash]:Bu(18,e=>e+Math.PI/1.5)};function Wu(e,t,n){if(!e||e.length===0)return{origin:{x:0,y:0},size:{width:0,height:0}};let r=[...e],i=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),a=(e,n,i)=>{if(!e)return;let a=Uu[e];if(!a)return;let o=a.getLocalPoints(t),s=a.getRotation(i),c=o.map(e=>xt(e,s,n));r.push(...c)};if(e.length>=2){let t=i(e[1],e[0]);a(n?.start,e[0],t);let r=e.length-1,o=i(e[r-1],e[r]);a(n?.end,e[r],o)}if(r.length<=1){let n=e[0]||{x:0,y:0},r=t;return{origin:{x:n.x-r,y:n.y-r},size:{width:2*r,height:2*r}}}return St(bt(r),t/2+1.2*t)}function Gu(e,t){if(!e.unrotatedRect)return{rect:t};let n=kt(t);return{rect:Mt(t,e.rotation??0,n),unrotatedRect:t}}function Ku(e){return e.unrotatedRect?Pt(e.unrotatedRect,e.rect,e.rotation??0):kt(e.rect)}function qu(e,t,n){let r=Ku(e),i=e.unrotatedRect??e.rect,a=t.origin.x-i.origin.x,o=t.origin.y-i.origin.y;return{rect:Mt(t,n,{x:r.x+a,y:r.y+o}),unrotatedRect:t}}function Ju(e,t,n){if(!e.unrotatedRect)return t;let r=e.rotation??0;if(Math.abs(r%360)<1e-8)return t;let i=Ku(e),a=kt(n),o=r*Math.PI/180,s=Math.cos(o),c=Math.sin(o),l=i.x-a.x,u=i.y-a.y,d=(1-s)*l+c*u,f=-c*l+(1-s)*u;return Math.abs(d)<1e-8&&Math.abs(f)<1e-8?t:t.map(e=>({x:e.x+d,y:e.y+f}))}function Yu(e,t){return t?{origin:{x:e.origin.x+t.left,y:e.origin.y+t.top},size:{width:Math.max(0,e.size.width-t.left-t.right),height:Math.max(0,e.size.height-t.top-t.bottom)}}:e}function Xu(e,t){return{left:t.origin.x-e.origin.x,top:t.origin.y-e.origin.y,right:e.origin.x+e.size.width-(t.origin.x+t.size.width),bottom:e.origin.y+e.size.height-(t.origin.y+t.size.height)}}function Zu(e,t){let n=t.origin.x+t.size.width/2,r=t.origin.y+t.size.height/2,i=e.x-n,a=e.y-r;return Math.abs(i)>=Math.abs(a)?i>0?{x:t.origin.x+t.size.width,y:r}:{x:t.origin.x,y:r}:a>0?{x:n,y:t.origin.y+t.size.height}:{x:n,y:t.origin.y}}function Qu(e,t,n,r){let i=[...t];if(n&&t.length>=2){let e=Uu[n];if(e){let n=Math.atan2(t[1].y-t[0].y,t[1].x-t[0].x),a=e.getLocalPoints(r),o=e.getRotation(n+Math.PI),s=a.map(e=>xt(e,o,t[0]));i.push(...s)}}let a=St(bt(i),r),o=e.origin.x+e.size.width,s=e.origin.y+e.size.height,c=a.origin.x+a.size.width,l=a.origin.y+a.size.height,u=Math.min(e.origin.x,a.origin.x),d=Math.min(e.origin.y,a.origin.y);return{origin:{x:u,y:d},size:{width:Math.max(o,c)-u,height:Math.max(s,l)-d}}}var $u={extractVertices:e=>{let t=Yu(e.rect,e.rectangleDifferences),n=e.calloutLine;return!n||n.length<3?[{x:e.rect.origin.x,y:e.rect.origin.y},{x:e.rect.origin.x,y:e.rect.origin.y},{x:t.origin.x,y:t.origin.y},{x:t.origin.x+t.size.width,y:t.origin.y+t.size.height}]:[n[0],n[1],{x:t.origin.x,y:t.origin.y},{x:t.origin.x+t.size.width,y:t.origin.y+t.size.height}]},transformAnnotation:(e,t)=>{if(t.length<4)return{};let[n,r,i,a]=t,o={origin:{x:Math.min(i.x,a.x),y:Math.min(i.y,a.y)},size:{width:Math.abs(a.x-i.x),height:Math.abs(a.y-i.y)}},s=[n,r,Zu(r,o)],c=Qu(o,s,e.lineEnding,e.strokeWidth??1);return{calloutLine:s,rect:c,rectangleDifferences:Xu(c,o)}}},ed=class{constructor(){this.patches=new Map}register(e,t){this.patches.set(e,t)}transform(e,t){let n=this.patches.get(e.type);return n?n(e,t):t.changes}},td=new ed;function nd(e,t){if(t.metadata?.rotationAngle===void 0)return null;let n=t.metadata.rotationAngle,r=t.changes.unrotatedRect??e.unrotatedRect??e.rect;return{...qu(e,{origin:{...r.origin},size:{...r.size}},n),rotation:n}}function rd(e,t){return{rotation:t,...qu(e,e.unrotatedRect??e.rect,t)}}function id(e,t){let n=t.origin.x-e.rect.origin.x,r=t.origin.y-e.rect.origin.y,i={rect:t};return e.unrotatedRect&&(i.unrotatedRect={origin:{x:e.unrotatedRect.origin.x+n,y:e.unrotatedRect.origin.y+r},size:{...e.unrotatedRect.size}}),{dx:n,dy:r,rects:i}}function ad(e,t,n){let r=e.unrotatedRect??e.rect,i=t.size.width/r.size.width,a=t.size.height/r.size.height;if((t.size.width<10||t.size.height<10)&&(i=Math.max(i,10/r.size.width),a=Math.max(a,10/r.size.height),t={origin:t.origin,size:{width:r.size.width*i,height:r.size.height*a}}),n?.maintainAspectRatio){let e=Math.min(i,a);i=e,a=e,t={origin:t.origin,size:{width:r.size.width*e,height:r.size.height*e}}}return{scaleX:i,scaleY:a,oldRect:r,resolvedRect:t,rects:e.unrotatedRect?{unrotatedRect:t,rect:Nt(t,e.rotation??0)}:{rect:t}}}function od(e,t){let n=e.unrotatedRect??e.rect,r=t.unrotatedRect??n;return{dx:r.origin.x-n.origin.x,dy:r.origin.y-n.origin.y}}function sd(e,t,n){if(t===0||e.rotation!==void 0)return e;let r=(4-t)%4*90,i=e;if(n&&(t===1||t===3)){let t=e.rect,n=t.origin.x+t.size.width/2,r=t.origin.y+t.size.height/2;i={...e,rect:{origin:{x:n-t.size.height/2,y:r-t.size.width/2},size:{width:t.size.height,height:t.size.width}}}}let{rotation:a,rect:o,unrotatedRect:s}=rd(i,r);return{...i,rotation:a,rect:o,unrotatedRect:s}}function cd(e,t){let n=q(e.rect.origin.x,0,t.width-e.rect.size.width),r=q(e.rect.origin.y,0,t.height-e.rect.size.height),i=n-e.rect.origin.x,a=r-e.rect.origin.y;return i===0&&a===0?e:{...e,rect:{origin:{x:n,y:r},size:e.rect.size},...e.unrotatedRect?{unrotatedRect:{origin:{x:e.unrotatedRect.origin.x+i,y:e.unrotatedRect.origin.y+a},size:e.unrotatedRect.size}}:{}}}var ld=(e,t)=>{switch(t.type){case`vertex-edit`:default:return t.changes;case`move`:{if(!t.changes.rect)return t.changes;let{dx:n,dy:r,rects:i}=id(e,t.changes.rect);return{...i,inkList:e.inkList.map(e=>({points:e.points.map(e=>({x:e.x+n,y:e.y+r}))}))}}case`resize`:{if(!t.changes.rect)return t.changes;let{scaleX:n,scaleY:r,oldRect:i,resolvedRect:a,rects:o}=ad(e,t.changes.rect,t.metadata),s=(e,t)=>({origin:{x:e.origin.x+t,y:e.origin.y+t},size:{width:Math.max(1,e.size.width-2*t),height:Math.max(1,e.size.height-2*t)}}),c=.001,l=Math.abs(n-1)>c,u=Math.abs(r-1)>c,d=l&&!u?n:!l&&u?r:Math.min(n,r),f=Math.max(1,e.strokeWidth*d),p=Math.max(1,Math.min(a.size.width,a.size.height)),m=Number(Math.min(f,p).toFixed(1)),h=s(i,e.strokeWidth/2),g=s(a,m/2),_=g.size.width/Math.max(h.size.width,1e-6),v=g.size.height/Math.max(h.size.height,1e-6);return{...o,inkList:e.inkList.map(e=>({points:e.points.map(e=>({x:g.origin.x+(e.x-h.origin.x)*_,y:g.origin.y+(e.y-h.origin.y)*v}))})),strokeWidth:m}}case`rotate`:{let n=nd(e,t);if(!n)return t.changes;let{dx:r,dy:i}=od(e,n);return{...n,inkList:e.inkList.map(e=>({points:e.points.map(e=>({x:e.x+r,y:e.y+i}))}))}}case`property-update`:{if(t.changes.strokeWidth===void 0&&t.changes.rotation===void 0)return t.changes;let n={...e,...t.changes},r=St(bt(n.inkList.flatMap(e=>e.points)),n.strokeWidth/2),i=t.changes.rotation??e.rotation??0;return e.unrotatedRect||t.changes.rotation!==void 0?{...t.changes,unrotatedRect:r,rect:Mt(r,i,Ku(e))}:{...t.changes,rect:r}}}},ud=(e,t)=>{switch(t.type){case`vertex-edit`:if(t.changes.linePoints){let{start:n,end:r}=t.changes.linePoints,i=[n,r],a=Ju(e,i,Wu(i,e.strokeWidth,e.lineEndings));return{...Gu(e,Wu(a,e.strokeWidth,e.lineEndings)),linePoints:{start:a[0],end:a[1]}}}return t.changes;case`move`:{if(!t.changes.rect)return t.changes;let{dx:n,dy:r,rects:i}=id(e,t.changes.rect);return{...i,linePoints:{start:{x:e.linePoints.start.x+n,y:e.linePoints.start.y+r},end:{x:e.linePoints.end.x+n,y:e.linePoints.end.y+r}}}}case`resize`:{if(!t.changes.rect)return t.changes;let{scaleX:n,scaleY:r,oldRect:i,resolvedRect:a,rects:o}=ad(e,t.changes.rect,t.metadata);return{...o,linePoints:{start:{x:a.origin.x+(e.linePoints.start.x-i.origin.x)*n,y:a.origin.y+(e.linePoints.start.y-i.origin.y)*r},end:{x:a.origin.x+(e.linePoints.end.x-i.origin.x)*n,y:a.origin.y+(e.linePoints.end.y-i.origin.y)*r}}}}case`rotate`:{let n=nd(e,t);if(!n)return t.changes;let{dx:r,dy:i}=od(e,n);return{...n,linePoints:{start:{x:e.linePoints.start.x+r,y:e.linePoints.start.y+i},end:{x:e.linePoints.end.x+r,y:e.linePoints.end.y+i}}}}case`property-update`:{if(t.changes.strokeWidth===void 0&&t.changes.lineEndings===void 0&&t.changes.rotation===void 0)return t.changes;let n={...e,...t.changes},r=Wu([n.linePoints.start,n.linePoints.end],n.strokeWidth,n.lineEndings),i=t.changes.rotation??e.rotation??0;return e.unrotatedRect||t.changes.rotation!==void 0?{...t.changes,unrotatedRect:r,rect:Mt(r,i,Ku(e))}:{...t.changes,rect:r}}default:return t.changes}},dd=(e,t)=>{switch(t.type){case`vertex-edit`:if(t.changes.vertices&&t.changes.vertices.length){let n=t.changes.vertices,r=Ju(e,n,Wu(n,e.strokeWidth,e.lineEndings));return{...Gu(e,Wu(r,e.strokeWidth,e.lineEndings)),vertices:r}}return t.changes;case`move`:{if(!t.changes.rect)return t.changes;let{dx:n,dy:r,rects:i}=id(e,t.changes.rect);return{...i,vertices:e.vertices.map(e=>({x:e.x+n,y:e.y+r}))}}case`resize`:{if(!t.changes.rect)return t.changes;let{scaleX:n,scaleY:r,oldRect:i,resolvedRect:a,rects:o}=ad(e,t.changes.rect,t.metadata);return{...o,vertices:e.vertices.map(e=>({x:a.origin.x+(e.x-i.origin.x)*n,y:a.origin.y+(e.y-i.origin.y)*r}))}}case`rotate`:{let n=nd(e,t);if(!n)return t.changes;let{dx:r,dy:i}=od(e,n);return{...n,vertices:e.vertices.map(e=>({x:e.x+r,y:e.y+i}))}}case`property-update`:{if(t.changes.strokeWidth===void 0&&t.changes.lineEndings===void 0&&t.changes.rotation===void 0)return t.changes;let n={...e,...t.changes},r=Wu(n.vertices,n.strokeWidth,n.lineEndings),i=t.changes.rotation??e.rotation??0;return e.unrotatedRect||t.changes.rotation!==void 0?{...t.changes,unrotatedRect:r,rect:Mt(r,i,Ku(e))}:{...t.changes,rect:r}}default:return t.changes}};function fd(e,t,n,r){let i=r*Math.PI/180,a=Math.abs(Math.cos(i)),o=Math.abs(Math.sin(i)),s=a*a-o*o,c=e.size.width,l=e.size.height,u,d;if(Math.abs(s)>1e-6)u=(a*c-o*l)/s,d=(a*l-o*c)/s,u=Math.max(u,1),d=Math.max(d,1);else{let e=t.size.width*t.size.height,r=c*l,i=e>0?Math.sqrt(r/e):1;u=n.size.width*i,d=n.size.height*i}return{origin:{x:e.origin.x+c/2-u/2,y:e.origin.y+l/2-d/2},size:{width:u,height:d}}}var pd=Math.PI,md=Math.PI/2,hd=34*Math.PI/180,gd=30*Math.PI/180,_d=12*Math.PI/180,vd=class{constructor(){this.parts=[],this.bbox={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},this.started=!1}moveTo(e,t){let n=-t;this.updateBBox(e,n),this.parts.push(`M ${yd(e)} ${yd(n)}`),this.started=!0}curveTo(e,t,n,r,i,a){let o=-t,s=-r,c=-a;this.updateBBox(e,o),this.updateBBox(n,s),this.updateBBox(i,c),this.parts.push(`C ${yd(e)} ${yd(o)}, ${yd(n)} ${yd(s)}, ${yd(i)} ${yd(c)}`)}close(){this.started&&this.parts.push(`Z`)}build(e){let t=e>0?e/2:0;return{path:this.parts.join(` `),bbox:{minX:this.bbox.minX-t,minY:this.bbox.minY-t,maxX:this.bbox.maxX+t,maxY:this.bbox.maxY+t}}}updateBBox(e,t){e<this.bbox.minX&&(this.bbox.minX=e),t<this.bbox.minY&&(this.bbox.minY=t),e>this.bbox.maxX&&(this.bbox.maxX=e),t>this.bbox.maxY&&(this.bbox.maxY=t)}};function yd(e){return Number(e.toFixed(4)).toString()}function bd(e,t){let n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function xd(e,t){return t===0?0:e/t}function Sd(e,t){return t===0?0:e/t}function Cd(e,t,n,r,i,a,o,s){let c=Math.cos(e),l=Math.sin(e),u=Math.cos(t),d=Math.sin(t),f=Math.sin((t-e)/2);if(f===0)return void(s&&o.moveTo(n+i*c,r+a*l));let p=4/3*(1-Math.cos((t-e)/2))/f,m=n+i*(c-p*l),h=r+a*(l+p*c),g=n+i*(u+p*d),_=r+a*(d-p*u),v=n+i*u,y=r+a*d;s&&o.moveTo(n+i*c,r+a*l),o.curveTo(m,h,g,_,v,y)}function wd(e,t,n,r,i,a){let o=Math.cos(e),s=Math.sin(e),c=Math.cos(t),l=Math.sin(t),u=Math.sin((t-e)/2);if(u===0)return[];let d=4/3*(1-Math.cos((t-e)/2))/u;return[{x:n+i*(o-d*s),y:r+a*(s+d*o)},{x:n+i*(c+d*l),y:r+a*(l-d*c)},{x:n+i*c,y:r+a*l}]}function Td(e,t,n,r,i,a,o,s){let c=md,l=t-e;for(;l<0;)l+=2*Math.PI;let u=l,d=0;for(s&&o.moveTo(i+n*Math.cos(e),a+r*Math.sin(e));l>c;)Cd(e+d,e+d+c,i,a,n,r,o,!1),d+=c,l-=c;l>0&&Cd(e+d,e+u,i,a,n,r,o,!1)}function Ed(e,t,n,r,i,a,o,s,c){let l=e+pd+o,u=e+pd+o-22*Math.PI/180;Cd(l,u,r,i,n,n,s,c),l=u,Td(l,t-a,n,n,r,i,s,!1)}function Dd(e,t,n,r,i,a){let o=e+pd;Cd(o+n,o+n-gd,r,i,t,t,a,!1),Cd(o+n-gd,o+md,r,i,t,t,a,!1),Cd(o+md,o+pd-hd,r,i,t,t,a,!1)}function Od(e,t){let n=[],r=e+pd;return n.push(...wd(r+hd,r+_d,0,0,t,t)),n.push(...wd(r+_d,r+md,0,0,t,t)),n.push(...wd(r+md,r+pd-hd,0,0,t,t)),n}function kd(e,t,n,r){for(let i=0;i+2<e.length;i+=3){let a=e[i],o=e[i+1],s=e[i+2];r.curveTo(a.x+t,a.y+n,o.x+t,o.y+n,s.x+t,s.y+n)}}function Ad(e,t,n){if(n===0)return{n:-1,adjustedRadius:e};let r=n-2*t*e;if(r<=0)return{n:0,adjustedRadius:e};let i=2*t*e,a=Math.max(1,Math.ceil(r/i));return{n:a,adjustedRadius:r/(2*a*t)}}function jd(e,t,n,r,i){let a=function(e){if(e.length<=2)return e;let t=[e[0]];for(let n=1;n<e.length;n++){let r=t[t.length-1],i=e[n];(Math.abs(i.x-r.x)>=.5||Math.abs(i.y-r.y)>=.5)&&t.push(i)}return t}(e);var o;(function(e){let t=0,n=e.length;for(let r=0;r<n;r++){let i=(r+1)%n;t+=e[r].x*e[i].y-e[r].y*e[i].x}return t})(o=a)<0&&o.reverse();let s=a.length;if(s<2)return;if(n<=0){i.moveTo(a[0].x,a[0].y);for(let e=1;e<s;e++)i.curveTo(a[e].x,a[e].y,a[e].x,a[e].y,a[e].x,a[e].y);return}let c=t?Md(n,r):Nd(n,r);c<.5&&(c=.5);let l=Math.cos(hd),u=[];for(let e=0;e+1<s;e++){let t=bd(a[e],a[e+1]);t<=0||t>=2*l*c?u.push(hd):u.push(Math.acos(Math.min(1,t/(2*c))))}let d=0,f=!1;for(let e=0;e+1<s;e++){let t=a[e],n=a[e+1],r=bd(t,n);if(r===0)continue;let o=Ad(c,l,r);if(o.n<0){f||=(i.moveTo(t.x,t.y),!0);continue}let p=Math.max(.5,o.adjustedRadius),m=2*l*p,h=l*c+l*p,g=Math.atan2(n.y-t.y,n.x-t.x);if(e===0){let e=a[s-2];d=Math.atan2(t.y-e.y,t.x-e.x)}let _=xd(n.x-t.x,r),v=Sd(n.y-t.y,r),y=t.x,b=t.y,x=u[e],S=u[e===0?s-2:e-1]??hd;if(Ed(d,g,c,t.x,t.y,x,S,i,!f),f=!0,o.n===0)y+=r*_,b+=r*v;else{y+=h*_,b+=h*v;let e=o.n;o.n>=1&&(Dd(g,p,hd,y,b,i),y+=m*_,b+=m*v,e=o.n-1);let t=Od(g,p);for(let n=0;n<e;n++)kd(t,y,b,i),y+=m*_,b+=m*v}d=g}}function Md(e,t){return 4.75*e+.5*t}function Nd(e,t){return 4*e+.5*t}function Pd(e,t,n,r,i,a,o){if(i<=0){let i=Math.abs(n-e)/2,a=Math.abs(r-t)/2,s=(e+n)/2,c=(t+r)/2;Td(0,2*Math.PI,i,a,s,c,o,!0);return}let s=n-e,c=r-t,l=Md(i,a),u=.5*l;if(s<u&&c<u){let i=Math.abs(n-e)/2,a=Math.abs(r-t)/2,s=(e+n)/2,c=(t+r)/2;Td(0,2*Math.PI,i,a,s,c,o,!0);return}if(s<5&&c>20||s>20&&c<5)return void jd([{x:e,y:t},{x:n,y:t},{x:n,y:r},{x:e,y:r},{x:e,y:t}],!0,i,a,o);let d=Math.sin(_d)*l-1.5,f=e,p=n,m=t,h=r;if(s>2*d)f+=d,p-=d;else{let t=(e+n)/2;f=t-.1,p=t+.1}if(c>2*d)m+=d,h-=d;else{let e=(r+t)/2;h=e+.1,m=e-.1}let g=function(e,t,n,r){let i=(e+n)/2,a=(t+r)/2,o=(n-e)/2,s=(r-t)/2;if(o<=0||s<=0)return[];let c=Math.max(32,Math.ceil(2*Math.max(o,s))),l=[];for(let e=0;e<=c;e++){let t=2*Math.PI*e/c;l.push({x:i+o*Math.cos(t),y:a+s*Math.sin(t)})}return l}(f,m,p,h),_=g.length;if(_<2)return;let v=0;for(let e=1;e<_;e++)v+=bd(g[e-1],g[e]);let y=Math.cos(hd),b=2*y*l,x=Math.ceil(v/b);if(x<2){let i=Math.abs(n-e)/2,a=Math.abs(r-t)/2,s=(e+n)/2,c=(t+r)/2;Td(0,2*Math.PI,i,a,s,c,o,!0);return}if(b=v/x,l=b/(2*y),l<.5)l=.5,b=2*y*l;else if(l<3){let i=Math.abs(n-e)/2,a=Math.abs(r-t)/2,s=(e+n)/2,c=(t+r)/2;Td(0,2*Math.PI,i,a,s,c,o,!0);return}let S=[],C=0,w=.1*a;for(let e=0;e+1<_;e++){let t=g[e],n=g[e+1],r=n.x-t.x,i=n.y-t.y,a=bd(t,n);if(a===0)continue;let o=a+C;if(o>=b-w||e===_-2){let e=xd(r,a),n=Sd(i,a),s=b-C;for(;o>=b-w;)S.push({x:t.x+s*e,y:t.y+s*n}),o-=b,s+=b;C=Math.max(0,o)}else C+=a}let T=S.length,E=0,D=0;for(let e=0;e<T;e++){let t=(e+1)%T,n=S[e],r=S[t];if(e===0){let e=S[T-1];E=Math.atan2(n.y-e.y,n.x-e.x),D=Fd(e,n,l,b)}let i=Math.atan2(r.y-n.y,r.x-n.x),a=Fd(n,r,l,b);Ed(E,i,l,n.x,n.y,a,D,o,e===0),E=i,D=a}}function Fd(e,t,n,r){let i=bd(e,t);if(i===0)return hd;let a=(r/2+(i-r)/2)/n;return a<-1||a>1?0:Math.acos(a)}function Id(e,t,n){return(n?Md(e,t):Nd(e,t))+t/2}function Ld(e,t){return(e??0)>0?Id(e,t,!1):t/2}var Rd=(e,t)=>{switch(t.type){case`vertex-edit`:if(t.changes.vertices&&t.changes.vertices.length){let n=Ld(e.cloudyBorderIntensity,e.strokeWidth),r=t.changes.vertices,i=Ju(e,r,St(bt(r),n));return{...Gu(e,St(bt(i),n)),vertices:i}}return t.changes;case`move`:{if(!t.changes.rect)return t.changes;let{dx:n,dy:r,rects:i}=id(e,t.changes.rect);return{...i,vertices:e.vertices.map(e=>({x:e.x+n,y:e.y+r}))}}case`resize`:{if(!t.changes.rect)return t.changes;let{scaleX:n,scaleY:r,oldRect:i,resolvedRect:a,rects:o}=ad(e,t.changes.rect,t.metadata);return{...o,vertices:e.vertices.map(e=>({x:a.origin.x+(e.x-i.origin.x)*n,y:a.origin.y+(e.y-i.origin.y)*r}))}}case`rotate`:{let n=nd(e,t);if(!n)return t.changes;let{dx:r,dy:i}=od(e,n);return{...n,vertices:e.vertices.map(e=>({x:e.x+r,y:e.y+i}))}}case`property-update`:{let n=t.changes.cloudyBorderIntensity!==void 0;if(!(t.changes.strokeWidth!==void 0||t.changes.rotation!==void 0||n))return t.changes;let r={...e,...t.changes},i=Ld(r.cloudyBorderIntensity,r.strokeWidth),a=St(bt(r.vertices),i),o=t.changes,s=(e.cloudyBorderIntensity??0)>0;if(n||t.changes.strokeWidth!==void 0&&s){let e=r.cloudyBorderIntensity??0;if(e>0){let t=Id(e,r.strokeWidth,!1);o={...o,rectangleDifferences:{left:t,top:t,right:t,bottom:t}}}else o={...o,rectangleDifferences:void 0}}let c=t.changes.rotation??e.rotation??0;return e.unrotatedRect||t.changes.rotation!==void 0?{...o,unrotatedRect:a,rect:Mt(a,c,Ku(e))}:{...o,rect:a}}default:return t.changes}},zd=(e,t)=>{switch(t.type){case`move`:return t.changes.rect?id(e,t.changes.rect).rects:t.changes;case`resize`:return t.changes.rect?ad(e,t.changes.rect,t.metadata).rects:t.changes;case`rotate`:return nd(e,t)??t.changes;case`property-update`:{let n=t.changes,r=t.changes.cloudyBorderIntensity!==void 0,i=t.changes.strokeWidth!==void 0,a=(e.cloudyBorderIntensity??0)>0;if(r||i&&a){let r={...e,...t.changes},i=r.cloudyBorderIntensity??0;if(i>0){let e=Id(i,r.strokeWidth,!0);n={...n,rectangleDifferences:{left:e,top:e,right:e,bottom:e}}}else n={...n,rectangleDifferences:void 0}}return t.changes.rotation!==void 0&&(n={...n,...rd(e,t.changes.rotation)}),n}default:return t.changes}},Bd=(e,t)=>{switch(t.type){case`move`:return t.changes.rect?id(e,t.changes.rect).rects:t.changes;case`resize`:return t.changes.rect?ad(e,t.changes.rect,t.metadata).rects:t.changes;case`rotate`:return nd(e,t)??t.changes;case`property-update`:{let n=t.changes,r=t.changes.cloudyBorderIntensity!==void 0,i=t.changes.strokeWidth!==void 0,a=(e.cloudyBorderIntensity??0)>0;if(r||i&&a){let r={...e,...t.changes},i=r.cloudyBorderIntensity??0;if(i>0){let e=Id(i,r.strokeWidth,!1);n={...n,rectangleDifferences:{left:e,top:e,right:e,bottom:e}}}else n={...n,rectangleDifferences:void 0}}return t.changes.rotation!==void 0&&(n={...n,...rd(e,t.changes.rotation)}),n}default:return t.changes}},Vd=(e,t)=>{switch(t.type){case`move`:return t.changes.rect?id(e,t.changes.rect).rects:t.changes;case`resize`:return t.changes.rect?ad(e,t.changes.rect,t.metadata).rects:t.changes;case`rotate`:return nd(e,t)??t.changes;case`property-update`:return t.changes.rotation===void 0?t.changes:{...t.changes,...rd(e,t.changes.rotation)};default:return t.changes}},Hd=(e,t)=>{switch(t.type){case`vertex-edit`:{if(!t.changes.calloutLine)return t.changes;let n=t.changes.calloutLine;return n.length<4?t.changes:function(e,t,n,r,i){let a={origin:{x:Math.min(r.x,i.x),y:Math.min(r.y,i.y)},size:{width:Math.abs(i.x-r.x),height:Math.abs(i.y-r.y)}},o=[t,n,Zu(n,a)],s=Qu(a,o,e.lineEnding,e.strokeWidth??1);return{calloutLine:o,rect:s,rectangleDifferences:Xu(s,a)}}(e,n[0],n[1],n[2],n[3])}case`move`:{if(!t.changes.rect)return t.changes;let{dx:n,dy:r,rects:i}=id(e,t.changes.rect),a=e.calloutLine?.map(e=>({x:e.x+n,y:e.y+r}));return{...i,...a&&{calloutLine:a}}}case`rotate`:{let n=nd(e,t);if(!n)return t.changes;let{dx:r,dy:i}=od(e,n),a=e.calloutLine?.map(e=>({x:e.x+r,y:e.y+i}));return{...n,...a&&{calloutLine:a}}}case`property-update`:if(t.changes.lineEnding!==void 0||t.changes.strokeWidth!==void 0){let n={...e,...t.changes};if(n.calloutLine&&n.calloutLine.length>=3){let r=Yu(e.rect,e.rectangleDifferences),i=Qu(r,n.calloutLine,n.lineEnding,n.strokeWidth??1);return{...t.changes,rect:i,rectangleDifferences:Xu(i,r)}}}return t.changes;default:return t.changes}},Ud=(e,t)=>{switch(t.type){case`move`:return t.changes.rect?id(e,t.changes.rect).rects:t.changes;case`resize`:return t.changes.rect?ad(e,t.changes.rect,t.metadata).rects:t.changes;case`rotate`:return nd(e,t)??t.changes;case`property-update`:return t.changes.rotation===void 0?t.changes:{...t.changes,...rd(e,t.changes.rotation)};default:return t.changes}},Wd=Object.freeze(Object.defineProperty({__proto__:null,LINE_ENDING_HANDLERS:Uu,PatchRegistry:ed,applyInsertUpright:sd,calculateAABBFromVertices:function(e,t=0){if(e.length===0)return{origin:{x:0,y:0},size:{width:0,height:0}};let n=bt(e);return t>0?St(n,t):n},calculateRotatedRectAABB:Nt,calculateRotatedRectAABBAroundPoint:Mt,calloutVertexConfig:$u,clampAnnotationToPage:cd,compensateRotatedVertexEdit:Ju,computeCalloutConnectionPoint:Zu,computeCalloutOverallRect:Qu,computeRDFromTextBox:Xu,computeTextBoxFromRD:Yu,createEnding:function(e,t,n,r,i){if(!e)return null;let a=Uu[e];if(!a)return null;let o=a.getRotation(n);return{d:a.getSvgPath(t),transform:`translate(${r} ${i}) rotate(${s=o,180*s/Math.PI})`,filled:a.filled};var s},getRectCenter:kt,lineRectWithEndings:Wu,patchCalloutFreeText:Hd,patchCircle:zd,patchFreeText:Vd,patchInk:ld,patchLine:ud,patchPolygon:Rd,patchPolyline:dd,patchRegistry:td,patchSquare:Bd,patchStamp:Ud,resolveAnnotationRotationCenter:Ku,resolveRotateRects:qu,resolveVertexEditRects:Gu,rotatePointAroundCenter:At,rotateVertices:jt},Symbol.toStringTag,{value:`Module`})),Gd={annotationType:z.TEXT,create(e){let{onCommit:t,getTool:n,pageSize:r}=e;return{onPointerDown:i=>{let a=n();if(!a)return;let o={origin:{x:i.x-12,y:i.y-12},size:{width:24,height:24}},s={...a.defaults,rect:o,type:z.TEXT,name:a.defaults.name??on.Comment,contents:a.defaults.contents??``,flags:a.defaults.flags??[`print`,`noRotate`,`noZoom`],pageIndex:e.pageIndex,id:K(),created:new Date};s=cd(s,r),t(s)}}}};function Kd({threshold:e=5,getTool:t,onClickDetected:n}){let[r,i]=Lu(null),[a,o]=Lu(!1);return{onStart:e=>{i(e),o(!1)},onMove:t=>{let n=r();!n||a()||Math.sqrt((t.x-n.x)**2+(t.y-n.y)**2)>e&&o(!0)},onEnd:e=>{var s;if(r()&&!a()){let r=t();r&&`clickBehavior`in r&&(s=r.clickBehavior)!=null&&s.enabled&&n(e,r)}i(null),o(!1)},hasMoved:a,reset:()=>{i(null),o(!1)}}}var qd={annotationType:z.FREETEXT,create(e){let{onCommit:t,onPreview:n,getTool:r,pageSize:i,pageIndex:a,pageRotation:o}=e,[s,c]=Lu(null),l=e=>({x:q(e.x,0,i.width),y:q(e.y,0,i.height)}),u=()=>{let e=r();return e?{...e.defaults,fontColor:e.defaults.fontColor??`#000000`,opacity:e.defaults.opacity??1,fontSize:e.defaults.fontSize??12,fontFamily:e.defaults.fontFamily??Xt.Helvetica,color:e.defaults.color??e.defaults.backgroundColor??`transparent`,textAlign:e.defaults.textAlign??Zt.Left,verticalAlign:e.defaults.verticalAlign??Qt.Top,contents:e.defaults.contents??`Insert text here`,flags:e.defaults.flags??[`print`]}:null},d=Kd({threshold:5,getTool:r,onClickDetected:(e,n)=>{var r;let s=u();if(!s)return;let c=n.clickBehavior;if(!c?.enabled)return;let{width:l,height:d}=c.defaultSize,f={origin:{x:e.x-l/2,y:e.y-d/2},size:{width:l,height:d}},p=c.defaultContent??s.contents,m={...s,contents:p,type:z.FREETEXT,rect:f,pageIndex:a,id:K(),created:new Date};(r=n.behavior)!=null&&r.insertUpright&&(m=sd(m,o,!1)),m=cd(m,i),t(m)}}),f=e=>{let t=s();if(!t)return null;let n=u();if(!n)return null;let r={origin:{x:Math.min(t.x,e.x),y:Math.min(t.y,e.y)},size:{width:Math.abs(t.x-e.x),height:Math.abs(t.y-e.y)}};return{type:z.FREETEXT,bounds:r,data:{...n,rect:r}}};return{onPointerDown:(e,t)=>{var r;let i=l(e);c(i),d.onStart(i),n(f(i)),(r=t.setPointerCapture)==null||r.call(t)},onPointerMove:e=>{let t=l(e);d.onMove(t),s()&&d.hasMoved()&&n(f(t))},onPointerUp:(i,a)=>{var f,p;let m=s();if(!m)return;let h=u();if(!h)return;let g=l(i);if(d.hasMoved()){let n={origin:{x:Math.min(m.x,g.x),y:Math.min(m.y,g.y)},size:{width:Math.abs(m.x-g.x),height:Math.abs(m.y-g.y)}},i=r(),a={...h,type:z.FREETEXT,rect:n,pageIndex:e.pageIndex,id:K(),created:new Date};(f=i?.behavior)!=null&&f.insertUpright&&(a=sd(a,o,!0)),t(a)}else d.onEnd(g);c(null),n(null),d.reset(),(p=a.releasePointerCapture)==null||p.call(a)},onPointerLeave:(e,t)=>{var r;c(null),n(null),d.reset(),(r=t.releasePointerCapture)==null||r.call(t)},onPointerCancel:(e,t)=>{var r;c(null),n(null),d.reset(),(r=t.releasePointerCapture)==null||r.call(t)}}}},Jd=150,Yd={annotationType:z.FREETEXT,create(e){let{onCommit:t,onPreview:n,getTool:r,pageSize:i,pageIndex:a}=e,[o,s]=Lu(`arrow`),[c,l]=Lu(null),[u,d]=Lu(null),[f,p]=Lu(null),[m,h]=Lu(null),[g,_]=Lu(!1),v=e=>({x:q(e.x,0,i.width),y:q(e.y,0,i.height)}),y=e=>({origin:{x:q(e.origin.x,0,i.width-e.size.width),y:q(e.origin.y,0,i.height-e.size.height)},size:e.size}),b=()=>{let e=r();return e?{...e.defaults,fontColor:e.defaults.fontColor??`#000000`,opacity:e.defaults.opacity??1,fontSize:e.defaults.fontSize??12,fontFamily:e.defaults.fontFamily??Xt.Helvetica,color:e.defaults.color??e.defaults.backgroundColor??`transparent`,textAlign:e.defaults.textAlign??Zt.Left,verticalAlign:e.defaults.verticalAlign??Qt.Top,contents:e.defaults.contents??`Insert text`,flags:e.defaults.flags??[`print`],lineEnding:e.defaults.lineEnding??B.OpenArrow,strokeColor:e.defaults.strokeColor??`#000000`,strokeWidth:e.defaults.strokeWidth??1}:null},x=(e,t)=>Math.abs(e.x-t.x)<5&&Math.abs(e.y-t.y)<5,S=e=>{let t=b();if(!t)return null;let n=c(),r=u(),i=o();if(i===`knee`&&n){let r=[n,e],i=Math.min(n.x,e.x),a=Math.min(n.y,e.y),o=Math.abs(n.x-e.x),s=Math.abs(n.y-e.y),c={origin:{x:i,y:a},size:{width:Math.max(o,1),height:Math.max(s,1)}};return{type:z.FREETEXT,bounds:c,data:{...t,rect:c,calloutLine:r}}}if(i===`textbox`&&n&&r){let i=m(),a;a=g()&&i?{origin:{x:Math.min(i.x,e.x),y:Math.min(i.y,e.y)},size:{width:Math.max(Math.abs(e.x-i.x),20),height:Math.max(Math.abs(e.y-i.y),14)}}:{origin:{x:e.x-75,y:e.y-20},size:{width:Jd,height:40}},a=y(a);let o=[n,r,Zu(r,a)],s=Qu(a,o,t.lineEnding,t.strokeWidth);return{type:z.FREETEXT,bounds:s,data:{...t,rect:s,calloutLine:o,textBox:a}}}return null},C=e=>{let n=b(),r=c(),i=u();if(!n||!r||!i)return;let o=y(e),s=[r,i,Zu(i,o)],l=Qu(o,s,n.lineEnding,n.strokeWidth),d=Xu(l,o),f={...n,type:z.FREETEXT,intent:`FreeTextCallout`,rect:l,rectangleDifferences:d,calloutLine:s,pageIndex:a,id:K(),created:new Date};t(f),w()},w=()=>{s(`arrow`),l(null),d(null),p(null),h(null),_(!1),n(null)};return{onPointerDown:(e,t)=>{var n,r;let i=v(e),a=o();a===`arrow`||a===`knee`?(p(i),(n=t.setPointerCapture)==null||n.call(t)):a===`textbox`&&(h(i),_(!0),(r=t.setPointerCapture)==null||r.call(t))},onPointerMove:e=>{let t=v(e),r=o();r===`textbox`&&g()?n(S(t)):r!==`knee`&&r!==`textbox`||n(S(t))},onPointerUp:(e,t)=>{var n,r,i,a;let c=v(e),u=o(),h=f();if(u===`arrow`&&h&&x(h,c))return l(c),s(`knee`),p(null),void((n=t.releasePointerCapture)==null||n.call(t));if(u===`knee`&&h&&x(h,c))return d(c),s(`textbox`),p(null),void((r=t.releasePointerCapture)==null||r.call(t));if(u===`textbox`&&g()){let e=m();if(e){let t=Math.min(e.x,c.x),n=Math.min(e.y,c.y),r=Math.abs(c.x-e.x),i=Math.abs(c.y-e.y);C(r>5||i>5?{origin:{x:t,y:n},size:{width:Math.max(r,20),height:Math.max(i,14)}}:{origin:{x:e.x-75,y:e.y-20},size:{width:Jd,height:40}})}(i=t.releasePointerCapture)==null||i.call(t);return}p(null),(a=t.releasePointerCapture)==null||a.call(t)},onPointerCancel:(e,t)=>{var n;w(),(n=t.releasePointerCapture)==null||n.call(t)}}}},Xd={annotationType:z.LINE,create(e){let{pageIndex:t,onCommit:n,onPreview:r,getTool:i,pageSize:a}=e,[o,s]=Lu(null),c=e=>({x:q(e.x,0,a.width),y:q(e.y,0,a.height)}),l=()=>{let e=i();return e?{...e.defaults,strokeWidth:e.defaults.strokeWidth??1,lineEndings:e.defaults.lineEndings??{start:B.None,end:B.None},color:e.defaults.color??`#000000`,opacity:e.defaults.opacity??1,strokeStyle:e.defaults.strokeStyle??un.SOLID,strokeDashArray:e.defaults.strokeDashArray??[],strokeColor:e.defaults.strokeColor??`#000000`,flags:e.defaults.flags??[`print`]}:null},u=Kd({threshold:5,getTool:i,onClickDetected:(e,r)=>{let i=l();if(!i)return;let a=r.clickBehavior;if(!a?.enabled)return;let o=a.defaultAngle??0,s=a.defaultLength/2,u=e.x-s*Math.cos(o),d=e.y-s*Math.sin(o),f=e.x+s*Math.cos(o),p=e.y+s*Math.sin(o),m=c({x:u,y:d}),h=c({x:f,y:p}),g=Wu([m,h],i.strokeWidth,i.lineEndings);n({...i,rect:g,linePoints:{start:m,end:h},pageIndex:t,id:K(),created:new Date,type:z.LINE})}}),d=e=>{let t=o();if(!t)return null;let n=l();if(!n)return null;let r=Wu([t,e],n.strokeWidth,n.lineEndings);return{type:z.LINE,bounds:r,data:{...n,rect:r,linePoints:{start:t,end:e}}}};return{onPointerDown:(e,t)=>{var n;let i=c(e);s(i),u.onStart(i),r(d(i)),(n=t.setPointerCapture)==null||n.call(t)},onPointerMove:e=>{let t=c(e);u.onMove(t),o()&&u.hasMoved()&&r(d(t))},onPointerUp:(e,i)=>{var a;let d=o();if(!d)return;let f=c(e);if(u.hasMoved()){let e=l();if(!e)return;if(Math.abs(f.x-d.x)>2||Math.abs(f.y-d.y)>2){let r=Wu([d,f],e.strokeWidth,e.lineEndings);n({...e,rect:r,linePoints:{start:d,end:f},pageIndex:t,id:K(),flags:[`print`],created:new Date,type:z.LINE})}}else u.onEnd(f);s(null),r(null),u.reset(),(a=i.releasePointerCapture)==null||a.call(i)},onPointerLeave:(e,t)=>{var n;s(null),r(null),u.reset(),(n=t.releasePointerCapture)==null||n.call(t)},onPointerCancel:(e,t)=>{var n;s(null),r(null),u.reset(),(n=t.releasePointerCapture)==null||n.call(t)}}}},Zd={annotationType:z.POLYLINE,create(e){let{onCommit:t,onPreview:n,getTool:r,pageSize:i}=e,[a,o]=Lu([]),[s,c]=Lu(null),l=e=>({x:q(e.x,0,i.width),y:q(e.y,0,i.height)}),u=()=>{let e=r();return e?{...e.defaults,strokeWidth:e.defaults.strokeWidth??1,lineEndings:e.defaults.lineEndings??{start:B.None,end:B.None},color:e.defaults.color??`#000000`,opacity:e.defaults.opacity??1,strokeColor:e.defaults.strokeColor??`#000000`,strokeStyle:e.defaults.strokeStyle??un.SOLID,strokeDashArray:e.defaults.strokeDashArray??[],flags:e.defaults.flags??[`print`]}:null},d=()=>{let e=a(),t=s();if(e.length===0||!t)return null;let n=u();if(!n)return null;let r=[...e,t],i=Wu(r,n.strokeWidth,n.lineEndings);return{type:z.POLYLINE,bounds:i,data:{...n,rect:i,vertices:r,currentVertex:t}}};return{onClick:(e,t)=>{if(t.metaKey||t.ctrlKey)return;let r=l(e),i=a(),s=i[i.length-1];s&&Math.abs(s.x-r.x)<1&&Math.abs(s.y-r.y)<1||(o([...i,r]),c(r),n(d()))},onDoubleClick:()=>{(()=>{let r=a();if(r.length<2)return;let i=u();if(!i)return;let s=Wu(r,i.strokeWidth,i.lineEndings),l={...i,vertices:r,rect:s,type:z.POLYLINE,pageIndex:e.pageIndex,id:K(),created:new Date};t(l),o([]),c(null),n(null)})()},onPointerMove:e=>{if(a().length>0){let t=l(e);c(t),n(d())}},onPointerCancel:()=>{o([]),c(null),n(null)}}}},Qd={annotationType:z.POLYGON,create(e){let{onCommit:t,onPreview:n,getTool:r,scale:i,pageSize:a}=e,[o,s]=Lu([]),[c,l]=Lu(null),u=e=>({x:q(e.x,0,a.width),y:q(e.y,0,a.height)}),d=()=>{let e=r();return e?{...e.defaults,color:e.defaults.color??`#000000`,opacity:e.defaults.opacity??1,strokeWidth:e.defaults.strokeWidth??1,strokeColor:e.defaults.strokeColor??`#000000`,strokeStyle:e.defaults.strokeStyle??un.SOLID,strokeDashArray:e.defaults.strokeDashArray??[],flags:e.defaults.flags??[`print`]}:null},f=()=>{let r=o();if(r.length<3)return;let i=d();if(!i)return;let a=i.cloudyBorderIntensity??0,c=a>0?Id(a,i.strokeWidth,!1):i.strokeWidth/2,u=St(bt(r),c),f={...i,vertices:r,rect:u,type:z.POLYGON,pageIndex:e.pageIndex,id:K(),created:new Date,...a>0&&{rectangleDifferences:{left:c,top:c,right:c,bottom:c}}};t(f),s([]),l(null),n(null)},p=()=>{let e=o(),t=c();if(e.length===0||!t)return null;let n=d();if(!n)return null;let r=n.cloudyBorderIntensity??0,i=r>0?Id(r,n.strokeWidth,!1):n.strokeWidth/2,a=St(bt([...e,t]),i);return{type:z.POLYGON,bounds:a,data:{...n,rect:a,vertices:e,currentVertex:t}}};return{onClick:(e,t)=>{if(t.metaKey||t.ctrlKey)return;let r=u(e);if((e=>{let t=o();if(t.length<2)return!1;let n=14/i/2,r=t[0];return e.x>=r.x-n&&e.x<=r.x+n&&e.y>=r.y-n&&e.y<=r.y+n})(r)&&o().length>=3)return void f();let a=o(),c=a[a.length-1];c&&Math.abs(c.x-r.x)<1&&Math.abs(c.y-r.y)<1||(s([...a,r]),l(r),n(p()))},onDoubleClick:e=>{f()},onPointerMove:e=>{if(o().length>0){let t=u(e);l(t),n(p())}},onPointerCancel:e=>{s([]),l(null),n(null)}}}},$d={annotationType:z.SQUARE,create(e){let{pageIndex:t,onCommit:n,onPreview:r,getTool:i,pageSize:a}=e,[o,s]=Lu(null),c=e=>({x:q(e.x,0,a.width),y:q(e.y,0,a.height)}),l=()=>{let e=i();return e?{...e.defaults,flags:e.defaults.flags??[`print`],strokeWidth:e.defaults.strokeWidth??2,strokeColor:e.defaults.strokeColor??`#000000`,strokeStyle:e.defaults.strokeStyle??un.SOLID,strokeDashArray:e.defaults.strokeDashArray??[],color:e.defaults.color??`#000000`,opacity:e.defaults.opacity??1}:null},u=Kd({threshold:5,getTool:i,onClickDetected:(e,r)=>{let i=l();if(!i)return;let o=r.clickBehavior;if(!o?.enabled)return;let{width:s,height:c}=o.defaultSize,u=s/2,d=c/2,f=q(e.x-u,0,a.width-s),p=q(e.y-d,0,a.height-c),m=i.strokeWidth,h=i.cloudyBorderIntensity??0,g=h>0?Id(h,m,!1):m/2,_={origin:{x:f-g,y:p-g},size:{width:s+2*g,height:c+2*g}},v={...i,type:z.SQUARE,created:new Date,id:K(),pageIndex:t,rect:_,...h>0&&{rectangleDifferences:{left:g,top:g,right:g,bottom:g}}};n(v)}}),d=e=>{let t=o();if(!t)return null;let n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),i=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y),s=l();if(!s)return null;let c=s.strokeWidth,u=s.cloudyBorderIntensity??0,d=u>0?Id(u,c,!1):c/2,f={origin:{x:n-d,y:r-d},size:{width:i+2*d,height:a+2*d}};return{type:z.SQUARE,bounds:f,data:{rect:f,...s,...u>0&&{rectangleDifferences:{left:d,top:d,right:d,bottom:d}}}}};return{onPointerDown:(e,t)=>{var n;let i=c(e);s(i),u.onStart(i),r(d(i)),(n=t.setPointerCapture)==null||n.call(t)},onPointerMove:e=>{let t=c(e);u.onMove(t),o()&&u.hasMoved()&&r(d(t))},onPointerUp:(e,i)=>{var a;if(!o()||!l())return;let f=c(e);if(u.hasMoved()){let e=l();if(!e)return;let r=d(f);if(r){let i=e.cloudyBorderIntensity??0,a=i>0?Id(i,e.strokeWidth,!1):void 0,o={...e,type:z.SQUARE,created:new Date,id:K(),pageIndex:t,rect:r.data.rect,...a!==void 0&&{rectangleDifferences:{left:a,top:a,right:a,bottom:a}}};n(o)}}else u.onEnd(f);s(null),r(null),u.reset(),(a=i.releasePointerCapture)==null||a.call(i)},onPointerLeave:(e,t)=>{var n;s(null),r(null),u.reset(),(n=t.releasePointerCapture)==null||n.call(t)},onPointerCancel:(e,t)=>{var n;s(null),r(null),u.reset(),(n=t.releasePointerCapture)==null||n.call(t)}}}},ef=new Map,tf={annotationType:z.STAMP,create(e){let{services:t,onCommit:n,onPreview:r,getTool:i,pageSize:a,pageRotation:o}=e,s=null,c=null,l=(t,r,s)=>{let c=tr(r);if(!c||c.mimeType===`application/pdf`)return!1;let l=It(c,a);return((t,r,s,c)=>{var l;let u=i();if(!u)return;let d={origin:{x:t.x-r/2,y:t.y-s/2},size:{width:r,height:s}},f={...u.defaults,rect:d,type:z.STAMP,name:u.defaults.name??on.Image,subject:u.defaults.subject??`Stamp`,flags:u.defaults.flags??[`print`],pageIndex:e.pageIndex,id:K(),created:new Date};(l=u.behavior)!=null&&l.insertUpright&&(f=sd(f,o,!1)),f=cd(f,a),n(f,c)})(t,s?.width??l.width,s?.height??l.height,{data:r}),!0};return{onHandlerActiveStart:()=>{let e=i(),t=e?.defaults.imageSrc;if(!t)return;let n=ef.get(t);n?n.refs++:(n={promise:fetch(t).then(e=>e.arrayBuffer()).then(t=>{let n=tr(t);if(!n||n.mimeType===`application/pdf`)return null;let r=It(n,a),i=e.defaults.imageSize;return{buffer:t,width:i?.width??r.width,height:i?.height??r.height}}).catch(()=>null),refs:1},ef.set(t,n)),n.promise.then(e=>{e&&(s=e.buffer,c={width:e.width,height:e.height})})},onHandlerActiveEnd:()=>{let e=i()?.defaults.imageSrc;if(e){let t=ef.get(e);t&&--t.refs<=0&&ef.delete(e)}s=null,c=null,r(null)},onPointerMove:e=>{let t=i();if(!t?.behavior?.showGhost||!c||!t.defaults.imageSrc)return;let n={origin:{x:e.x-c.width/2,y:e.y-c.height/2},size:c};r({type:z.STAMP,bounds:n,data:{rect:n,ghostUrl:t.defaults.imageSrc,pageRotation:o}})},onPointerDown:e=>{let n=i();if(!n)return;let{imageSrc:a,imageSize:o}=n.defaults;a?(r(null),s?l(e,s,o):fetch(a).then(e=>e.arrayBuffer()).then(t=>l(e,t,o))):t.requestFile({accept:`image/png,image/jpeg`,onFile:t=>{t.arrayBuffer().then(t=>l(e,t))}})},onPointerLeave:()=>{r(null)}}}},nf={annotationType:z.CIRCLE,create(e){let{pageIndex:t,onCommit:n,onPreview:r,getTool:i,pageSize:a}=e,[o,s]=Lu(null),c=e=>({x:q(e.x,0,a.width),y:q(e.y,0,a.height)}),l=()=>{let e=i();return e?{...e.defaults,strokeWidth:e.defaults.strokeWidth??2,strokeColor:e.defaults.strokeColor??`#000000`,strokeStyle:e.defaults.strokeStyle??un.SOLID,strokeDashArray:e.defaults.strokeDashArray??[],color:e.defaults.color??`#000000`,opacity:e.defaults.opacity??1,flags:e.defaults.flags??[`print`]}:null},u=Kd({threshold:5,getTool:i,onClickDetected:(e,r)=>{let i=l();if(!i)return;let o=r.clickBehavior;if(!o?.enabled)return;let{width:s,height:c}=o.defaultSize,u=s/2,d=c/2,f=q(e.x-u,0,a.width-s),p=q(e.y-d,0,a.height-c),m=i.strokeWidth,h=i.cloudyBorderIntensity??0,g=h>0?Id(h,m,!0):m/2,_={origin:{x:f-g,y:p-g},size:{width:s+2*g,height:c+2*g}},v={...i,type:z.CIRCLE,created:new Date,id:K(),pageIndex:t,rect:_,...h>0&&{rectangleDifferences:{left:g,top:g,right:g,bottom:g}}};n(v)}}),d=e=>{let t=o();if(!t)return null;let n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),i=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y),s=l();if(!s)return null;let c=s.strokeWidth,u=s.cloudyBorderIntensity??0,d=u>0?Id(u,c,!0):c/2,f={origin:{x:n-d,y:r-d},size:{width:i+2*d,height:a+2*d}};return{type:z.CIRCLE,bounds:f,data:{rect:f,...s,...u>0&&{rectangleDifferences:{left:d,top:d,right:d,bottom:d}}}}};return{onPointerDown:(e,t)=>{var n;let i=c(e);s(i),u.onStart(i),r(d(i)),(n=t.setPointerCapture)==null||n.call(t)},onPointerMove:e=>{let t=c(e);u.onMove(t),o()&&u.hasMoved()&&r(d(t))},onPointerUp:(e,i)=>{var a;if(!o()||!l())return;let f=c(e);if(u.hasMoved()){let e=l();if(!e)return;let r=d(f);if(r){let i=e.cloudyBorderIntensity??0,a=i>0?Id(i,e.strokeWidth,!0):void 0,o={...e,type:z.CIRCLE,flags:[`print`],created:new Date,id:K(),pageIndex:t,rect:r.data.rect,...a!==void 0&&{rectangleDifferences:{left:a,top:a,right:a,bottom:a}}};n(o)}}else u.onEnd(f);s(null),r(null),u.reset(),(a=i.releasePointerCapture)==null||a.call(i)},onPointerLeave:(e,t)=>{var n;s(null),r(null),u.reset(),(n=t.releasePointerCapture)==null||n.call(t)},onPointerCancel:(e,t)=>{var n;s(null),r(null),u.reset(),(n=t.releasePointerCapture)==null||n.call(t)}}}},rf={annotationType:z.LINK,create(e){let{pageIndex:t,onCommit:n,onPreview:r,getTool:i,pageSize:a}=e,[o,s]=Lu(null),c=e=>({x:q(e.x,0,a.width),y:q(e.y,0,a.height)}),l=()=>{let e=i();return e?{...e.defaults,flags:e.defaults.flags??[`print`],strokeWidth:e.defaults.strokeWidth??2,strokeColor:e.defaults.strokeColor??`#0000FF`,strokeStyle:e.defaults.strokeStyle??un.UNDERLINE,strokeDashArray:e.defaults.strokeDashArray??[]}:null},u=Kd({threshold:5,getTool:i,onClickDetected:(e,r)=>{let i=l();if(!i)return;let o=r.clickBehavior;if(!o?.enabled)return;let{width:s,height:c}=o.defaultSize,u=s/2,d=c/2,f={origin:{x:q(e.x-u,0,a.width-s),y:q(e.y-d,0,a.height-c)},size:{width:s,height:c}},p={...i,type:z.LINK,target:void 0,created:new Date,id:K(),pageIndex:t,rect:f};n(p)}}),d=e=>{let t=o();if(!t)return null;let n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),i=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y),s=l();if(!s)return null;let c={origin:{x:n,y:r},size:{width:i,height:a}};return{type:z.LINK,bounds:c,data:{rect:c,strokeColor:s.strokeColor,strokeWidth:s.strokeWidth,strokeStyle:s.strokeStyle,strokeDashArray:s.strokeDashArray}}};return{onPointerDown:(e,t)=>{var n;let i=c(e);s(i),u.onStart(i),r(d(i)),(n=t.setPointerCapture)==null||n.call(t)},onPointerMove:e=>{let t=c(e);u.onMove(t),o()&&u.hasMoved()&&r(d(t))},onPointerUp:(e,i)=>{var a;if(!o())return;let f=l();if(!f)return;let p=c(e);if(u.hasMoved()){let e=d(p);if(e){let r={...f,type:z.LINK,target:void 0,created:new Date,id:K(),pageIndex:t,rect:e.data.rect};n(r)}}else u.onEnd(p);s(null),r(null),u.reset(),(a=i.releasePointerCapture)==null||a.call(i)},onPointerLeave:(e,t)=>{var n;s(null),r(null),u.reset(),(n=t.releasePointerCapture)==null||n.call(t)},onPointerCancel:(e,t)=>{var n;s(null),r(null),u.reset(),(n=t.releasePointerCapture)==null||n.call(t)}}}},af={toolId:`__textMarkup__`,handle(e,t,n){let r=e.getTool();if(r)for(let i of t){let t=K();n().then(n=>{var a;e.createAnnotation(i.pageIndex,{...r.defaults,rect:i.rect,segmentRects:i.segmentRects,pageIndex:i.pageIndex,created:new Date,id:t,...n!=null&&{custom:{text:n}}}),(a=r.behavior)!=null&&a.selectAfterCreate&&e.selectAnnotation(i.pageIndex,t)})}}};function of(e){let t=e.size.height,n=t/2,r=n;return{origin:{x:e.origin.x+e.size.width-r/2,y:e.origin.y+t/2},size:{width:r,height:n}}}var sf={toolId:`insertText`,handle(e,t,n){let r=e.getTool();if(!r)return;let i=()=>({strokeColor:r.defaults.strokeColor??`#E44234`,opacity:r.defaults.opacity??1,flags:r.defaults.flags??[`print`]});for(let a of t){let t=a.segmentRects[a.segmentRects.length-1];if(!t)continue;let o=of(t),s=K(),c=i();n().then(t=>{var n;e.createAnnotation(a.pageIndex,{type:z.CARET,id:s,pageIndex:a.pageIndex,rect:o,strokeColor:c.strokeColor,opacity:c.opacity,intent:`Insert`,rectangleDifferences:{left:.5,top:.5,right:.5,bottom:.5},created:new Date,flags:c.flags,...t!=null&&{custom:{text:t}}}),(n=r.behavior)!=null&&n.selectAfterCreate&&e.selectAnnotation(a.pageIndex,s)})}}},cf={toolId:`replaceText`,handle(e,t,n){let r=e.getTool();if(!r)return;let i=()=>({strokeColor:r.defaults.strokeColor??`#E44234`,opacity:r.defaults.opacity??1,flags:r.defaults.flags??[`print`]});for(let a of t){let t=a.segmentRects[a.segmentRects.length-1];if(!t)continue;let o=of(t),s=K(),c=K(),l=i();n().then(t=>{var n;e.createAnnotation(a.pageIndex,{type:z.CARET,id:s,pageIndex:a.pageIndex,rect:o,strokeColor:l.strokeColor,opacity:l.opacity,intent:`Replace`,rectangleDifferences:{left:.5,top:.5,right:.5,bottom:.5},created:new Date,flags:l.flags}),e.createAnnotation(a.pageIndex,{type:z.STRIKEOUT,id:c,pageIndex:a.pageIndex,rect:a.rect,segmentRects:a.segmentRects,strokeColor:l.strokeColor,opacity:l.opacity,intent:`StrikeOutTextEdit`,inReplyToId:s,replyType:cn.Group,created:new Date,flags:l.flags,...t!=null&&{custom:{text:t}}}),(n=r.behavior)!=null&&n.selectAfterCreate&&e.selectAnnotation(a.pageIndex,s)})}}},lf=[{id:`highlight`,name:`Highlight`,labelKey:`annotation.highlight`,categories:[`annotation`,`markup`],matchScore:e=>+(e.type===z.HIGHLIGHT),interaction:{exclusive:!1,textSelection:!0,isDraggable:!1,isResizable:!1,isRotatable:!1,isGroupDraggable:!1,isGroupResizable:!1},defaults:{type:z.HIGHLIGHT,strokeColor:`#FFCD45`,color:`#FFCD45`,opacity:1,blendMode:R.Multiply}},{id:`underline`,name:`Underline`,labelKey:`annotation.underline`,categories:[`annotation`,`markup`],matchScore:e=>+(e.type===z.UNDERLINE),interaction:{exclusive:!1,textSelection:!0,isDraggable:!1,isResizable:!1,isRotatable:!1,isGroupDraggable:!1,isGroupResizable:!1},defaults:{type:z.UNDERLINE,strokeColor:`#E44234`,color:`#E44234`,opacity:1}},{id:`strikeout`,name:`Strikeout`,labelKey:`annotation.strikeout`,categories:[`annotation`,`markup`],matchScore:e=>+(e.type===z.STRIKEOUT),interaction:{exclusive:!1,textSelection:!0,isDraggable:!1,isResizable:!1,isRotatable:!1,isGroupDraggable:!1,isGroupResizable:!1},defaults:{type:z.STRIKEOUT,strokeColor:`#E44234`,color:`#E44234`,opacity:1}},{id:`squiggly`,name:`Squiggly`,labelKey:`annotation.squiggly`,categories:[`annotation`,`markup`],matchScore:e=>+(e.type===z.SQUIGGLY),interaction:{exclusive:!1,textSelection:!0,isDraggable:!1,isResizable:!1,isRotatable:!1,isGroupDraggable:!1,isGroupResizable:!1},defaults:{type:z.SQUIGGLY,strokeColor:`#E44234`,color:`#E44234`,opacity:1}}],uf=[{id:`insertText`,name:`Insert Text`,labelKey:`annotation.insertText`,categories:[`annotation`,`markup`],matchScore:e=>e.type===z.CARET?e.intent?.includes(`Insert`)?2:1:0,interaction:{exclusive:!1,textSelection:!0,showSelectionRects:!0,isDraggable:!1,isResizable:!1,isRotatable:!1,isGroupDraggable:!1,isGroupResizable:!1},defaults:{type:z.CARET,strokeColor:`#E44234`,opacity:1,intent:`Insert`},selectionHandler:sf}],df=[{id:`replaceText`,name:`Replace Text`,labelKey:`annotation.replaceText`,categories:[`annotation`,`markup`],matchScore:e=>e.type===z.STRIKEOUT&&e.intent?.includes(`StrikeOutTextEdit`)||e.type===z.CARET&&e.intent?.includes(`Replace`)?2:0,interaction:{exclusive:!1,textSelection:!0,isDraggable:!1,isResizable:!1,isRotatable:!1,isGroupDraggable:!1,isGroupResizable:!1},defaults:{type:z.STRIKEOUT,strokeColor:`#E44234`,opacity:1,intent:`StrikeOutTextEdit`},selectionHandler:cf}],ff=[{id:`ink`,name:`Pen`,labelKey:`annotation.ink`,categories:[`annotation`,`markup`],matchScore:e=>e.type===z.INK&&e.intent!==`InkHighlight`?5:0,interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!0,lockAspectRatio:!1},defaults:{type:z.INK,strokeColor:`#E44234`,color:`#E44234`,opacity:1,strokeWidth:6},behavior:{commitDelay:800},transform:ld,pointerHandler:Ru},{id:`inkHighlighter`,name:`Ink Highlighter`,labelKey:`annotation.inkHighlighter`,categories:[`annotation`,`markup`],matchScore:e=>e.type===z.INK&&e.intent===`InkHighlight`?10:0,interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!0,lockAspectRatio:!1,lockGroupAspectRatio:e=>{let t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:z.INK,intent:`InkHighlight`,strokeColor:`#FFCD45`,color:`#FFCD45`,opacity:1,strokeWidth:14,blendMode:R.Multiply},behavior:{commitDelay:800,smartLineRecognition:!0,smartLineThreshold:.15},transform:ld,pointerHandler:Ru}],pf=[{id:`circle`,name:`Circle`,labelKey:`annotation.circle`,categories:[`annotation`,`shape`],matchScore:e=>+(e.type===z.CIRCLE),interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!0,lockAspectRatio:!1,lockGroupAspectRatio:e=>{let t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:z.CIRCLE,color:`transparent`,opacity:1,strokeWidth:6,strokeColor:`#E44234`,strokeStyle:un.SOLID},clickBehavior:{enabled:!0,defaultSize:{width:100,height:100}},transform:zd,pointerHandler:nf}],mf=[{id:`square`,name:`Square`,labelKey:`annotation.square`,categories:[`annotation`,`shape`],matchScore:e=>+(e.type===z.SQUARE),interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!0,lockAspectRatio:!1,lockGroupAspectRatio:e=>{let t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:z.SQUARE,color:`transparent`,opacity:1,strokeWidth:6,strokeColor:`#E44234`,strokeStyle:un.SOLID},clickBehavior:{enabled:!0,defaultSize:{width:100,height:100}},transform:Bd,pointerHandler:$d}],hf=[{id:`line`,name:`Line`,labelKey:`annotation.line`,categories:[`annotation`,`shape`],matchScore:e=>e.type===z.LINE&&e.intent!==`LineArrow`?5:0,interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!1,lockAspectRatio:!1,isGroupResizable:!0,lockGroupAspectRatio:e=>{let t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:z.LINE,color:`transparent`,opacity:1,strokeWidth:6,strokeColor:`#E44234`},clickBehavior:{enabled:!0,defaultLength:100,defaultAngle:0},transform:ud,pointerHandler:Xd},{id:`lineArrow`,name:`Arrow`,labelKey:`annotation.arrow`,categories:[`annotation`,`shape`],matchScore:e=>e.type===z.LINE&&e.intent===`LineArrow`?10:0,interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!1,lockAspectRatio:!1,isGroupResizable:!0,lockGroupAspectRatio:e=>{let t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:z.LINE,intent:`LineArrow`,color:`transparent`,opacity:1,strokeWidth:6,strokeColor:`#E44234`,lineEndings:{start:B.None,end:B.OpenArrow}},clickBehavior:{enabled:!0,defaultLength:100,defaultAngle:0},transform:ud,pointerHandler:Xd}],gf=[{id:`polyline`,name:`Polyline`,labelKey:`annotation.polyline`,categories:[`annotation`,`shape`],matchScore:e=>+(e.type===z.POLYLINE),interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!1,lockAspectRatio:!1,isGroupResizable:!0,lockGroupAspectRatio:e=>{let t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:z.POLYLINE,color:`transparent`,opacity:1,strokeWidth:6,strokeColor:`#E44234`},transform:dd,pointerHandler:Zd}],_f=[{id:`polygon`,name:`Polygon`,labelKey:`annotation.polygon`,categories:[`annotation`,`shape`],matchScore:e=>+(e.type===z.POLYGON),interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!1,lockAspectRatio:!1,isGroupResizable:!0,lockGroupAspectRatio:e=>{let t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:z.POLYGON,color:`transparent`,opacity:1,strokeWidth:6,strokeColor:`#E44234`},transform:Rd,pointerHandler:Qd}],vf=[{id:`textComment`,name:`Comment`,labelKey:`annotation.text`,categories:[`annotation`,`markup`],matchScore:e=>e.type!==z.TEXT||e.inReplyToId?0:1,interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!1,isRotatable:!1},defaults:{type:z.TEXT,strokeColor:`#FFCD45`,opacity:1},behavior:{selectAfterCreate:!0},pointerHandler:Gd}],yf=[{id:`freeText`,name:`Free Text`,labelKey:`annotation.freeText`,categories:[`annotation`,`markup`],matchScore:e=>+(e.type===z.FREETEXT&&e.intent!==`FreeTextCallout`),interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!0,lockAspectRatio:!1,lockGroupAspectRatio:e=>{let t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:z.FREETEXT,contents:`Insert text`,fontSize:14,fontColor:`#E44234`,fontFamily:Xt.Helvetica,textAlign:Zt.Left,verticalAlign:Qt.Top,color:`transparent`,backgroundColor:`transparent`,opacity:1},clickBehavior:{enabled:!0,defaultSize:{width:100,height:20},defaultContent:`Insert text`},behavior:{insertUpright:!0,editAfterCreate:!0,selectAfterCreate:!0},transform:Vd,pointerHandler:qd}],bf=[{id:`freeTextCallout`,name:`Callout`,labelKey:`annotation.callout`,categories:[`annotation`,`markup`],matchScore:e=>e.type===z.FREETEXT&&e.intent===`FreeTextCallout`?10:0,interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!1,isRotatable:!1},defaults:{type:z.FREETEXT,intent:`FreeTextCallout`,contents:`Insert text`,fontSize:14,fontColor:`#E44234`,fontFamily:Xt.Helvetica,textAlign:Zt.Left,verticalAlign:Qt.Top,color:`transparent`,opacity:1,lineEnding:B.OpenArrow,strokeColor:`#E44234`,strokeWidth:1},behavior:{insertUpright:!0,editAfterCreate:!0,selectAfterCreate:!0},transform:Hd,pointerHandler:Yd}],xf=[{id:`stamp`,name:`Image`,labelKey:`annotation.stamp`,categories:[`annotation`,`markup`],matchScore:e=>+(e.type===z.STAMP),interaction:{exclusive:!1,cursor:`copy`,isDraggable:!0,isResizable:!0,lockAspectRatio:!0,lockGroupAspectRatio:!0},defaults:{type:z.STAMP},behavior:{insertUpright:!0,useAppearanceStream:!1},transform:Ud,pointerHandler:tf}],Sf=[{id:`link`,name:`Link`,labelKey:`annotation.link`,categories:[`annotation`,`markup`],matchScore:e=>+(e.type===z.LINK),interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!0,isRotatable:!1},defaults:{type:z.LINK,strokeColor:`#0000FF`,strokeWidth:2,strokeStyle:un.UNDERLINE},clickBehavior:{enabled:!0,defaultSize:{width:100,height:20}},pointerHandler:rf}],Cf=[...lf,...uf,...df,...ff,...pf,...mf,...hf,...gf,..._f,...vf,...yf,...bf,...xf,...Sf],wf=[`#E44234`,`#FF8D00`,`#FFCD45`,`#5CC96E`,`#25D2D1`,`#597CE2`,`#C544CE`,`#7D2E25`,`#000000`,`#FFFFFF`],Tf=e=>e.length===1?e[0]:null,Ef=e=>({pages:{},byUid:{},selectedUids:[],selectedUid:null,activeToolId:null,hasPendingChanges:!1,locked:e?.locked??{type:yu.None}}),Df=(e,t,n)=>{let r=e.byUid[t];return r?{...e,byUid:{...e.byUid,[t]:{...r,commitState:r.commitState===`synced`||r.commitState===`moved`?`dirty`:r.commitState,object:{...r.object,...n},dictMode:!0}},hasPendingChanges:!0}:e},Of=(e,t,n)=>{let r=e.byUid[t];return r?{...e,byUid:{...e.byUid,[t]:{...r,commitState:r.commitState===`synced`?`moved`:r.commitState,object:{...r.object,...n}}},hasPendingChanges:!0}:e},kf=class e extends Rr{constructor(e,t,n){super(e,t),this.ANNOTATION_HISTORY_TOPIC=`annotations`,this.state$=qr((e,t)=>({documentId:e,state:t})),this.pendingContexts=new Map,this.isInitialLoadComplete=new Map,this.importQueue=new Map,this.commitInProgress=new Map,this.activeTool$=qr((e,t)=>({documentId:e,tool:t})),this.events$=qr((e,t)=>t,{cache:!1}),this.toolsChange$=J(),this.appearanceCache=new Map,this.unifiedDragStates=new Map,this.unifiedDrag$=J(),this.unifiedResizeStates=new Map,this.unifiedResize$=J(),this.unifiedRotateStates=new Map,this.unifiedRotate$=J(),this.navigate$=qr((e,t)=>t,{cache:!1}),this.config=n,this.selection=t.getPlugin(`selection`)?.provides()??null,this.history=t.getPlugin(`history`)?.provides()??null,this.scroll=t.getPlugin(`scroll`)?.provides()??null,this.interactionManager=t.getPlugin(`interaction-manager`)?.provides()??null}onDocumentLoadingStarted(e){this.dispatch(function(e,t){return{type:Ul,payload:{documentId:e,state:t}}}(e,Ef(this.config))),this.pendingContexts.set(e,new Map),this.isInitialLoadComplete.set(e,!1),this.importQueue.set(e,[]),this.logger.debug(`AnnotationPlugin`,`DocumentOpened`,`Initialized annotation state for document: ${e}`)}onDocumentLoaded(e){let t=this.getCoreDocument(e);if(t!=null&&t.document&&this.getAllAnnotations(e,t.document),this.selection)for(let e of this.state.tools)e.interaction.textSelection&&this.selection.enableForMode(e.interaction.mode??e.id,{showSelectionRects:e.interaction.showSelectionRects??!1,enableSelection:!0,enableMarquee:!1})}onDocumentClosed(e){this.dispatch(function(e){return{type:Wl,payload:e}}(e)),this.pendingContexts.delete(e),this.isInitialLoadComplete.delete(e),this.importQueue.delete(e),this.appearanceCache.delete(e),this.state$.clearScope(e),this.activeTool$.clearScope(e),this.events$.clearScope(e),this.navigate$.clearScope(e),this.logger.debug(`AnnotationPlugin`,`DocumentClosed`,`Cleaned up annotation state for document: ${e}`)}async initialize(){var e,t,n;this.state.tools.forEach(e=>this.registerInteractionForTool(e)),this.history&&this.history.onHistoryChange(e=>{e.topic===this.ANNOTATION_HISTORY_TOPIC&&!1!==this.config.autoCommit&&this.commit(e.documentId)}),(e=this.interactionManager)==null||e.onModeChange(e=>{let t=this.state.tools.find(t=>(t.interaction.mode??t.id)===e.activeMode)?.id??null;t!==(this.state.documents[e.documentId]?.activeToolId??null)&&e.documentId&&this.dispatch(pu(e.documentId,t))}),(t=this.selection)==null||t.onMarqueeEnd(({documentId:e,pageIndex:t,rect:n,modeId:r})=>{if(r!==`pointerMode`)return;let i=this.state.documents[e];if(!i)return;let a=(i.pages[t]??[]).map(e=>i.byUid[e]).filter(e=>e!==void 0).filter(e=>Cu(e)).filter(e=>function(e,t){return!(e.origin.x+e.size.width<t.origin.x||t.origin.x+t.size.width<e.origin.x||e.origin.y+e.size.height<t.origin.y||t.origin.y+t.size.height<e.origin.y)}(n,e.object.rect)).filter(t=>this.isAnnotationSelectable(t.object,e)).map(e=>e.object.id);if(a.length>0){let t=new Set;for(let n of a)if(this.isInGroupMethod(n,e)){let r=this.getGroupMembersMethod(n,e);for(let e of r)t.add(e.object.id)}else t.add(n);this.setSelectionMethod([...t],e)}}),(n=this.selection)==null||n.onEndSelection(({documentId:e})=>{var t,n;if(!this.checkPermission(e,U.ModifyAnnotations))return;let r=this.getActiveTool(e);if(!r||!r.interaction.textSelection)return;let i=this.selection?.getFormattedSelection(),a=this.selection?.getSelectedText();if(!i||!a)return;let o={toolId:r.id,documentId:e,getTool:()=>this.getActiveTool(e)??null,createAnnotation:(t,n)=>this.createAnnotation(t,n,void 0,e),selectAnnotation:(t,n)=>this.selectAnnotation(t,n,e)};(r.selectionHandler??af).handle(o,i,()=>new Promise(e=>{a.wait(t=>e(t.join(`
2265
+ `)),()=>e(void 0))})),(t=r.behavior)!=null&&t.deactivateToolAfterCreate&&this.setActiveTool(null,e),(n=this.selection)==null||n.clear()})}registerInteractionForTool(e){var t;(t=this.interactionManager)==null||t.registerMode({id:e.interaction.mode??e.id,scope:`page`,exclusive:e.interaction.exclusive,cursor:e.interaction.cursor})}buildCapability(){return{getActiveTool:()=>this.getActiveTool(),setActiveTool:(e,t)=>this.setActiveTool(e,void 0,t),getState:()=>this.getDocumentState(),getPageAnnotations:e=>this.getPageAnnotations(e),getSelectedAnnotation:()=>this.getSelectedAnnotation(),getSelectedAnnotations:()=>this.getSelectedAnnotationsMethod(),getSelectedAnnotationIds:()=>this.getSelectedAnnotationIdsMethod(),getAnnotationById:e=>this.getAnnotationById(e),getAnnotations:e=>this.getAnnotationsMethod(e),selectAnnotation:(e,t)=>this.selectAnnotation(e,t),toggleSelection:(e,t)=>this.toggleSelectionMethod(e,t),addToSelection:(e,t)=>this.addToSelectionMethod(e,t),removeFromSelection:e=>this.removeFromSelectionMethod(e),setSelection:e=>this.setSelectionMethod(e),deselectAnnotation:()=>this.deselectAnnotation(),importAnnotations:e=>this.importAnnotations(e),exportAnnotations:(e,t)=>this.exportAnnotationsMethod(e,t),createAnnotation:(e,t,n)=>this.createAnnotation(e,t,n),updateAnnotation:(e,t,n)=>this.updateAnnotation(e,t,n),updateAnnotations:e=>this.updateAnnotationsMethod(e),moveAnnotation:(e,t,n,r,i)=>this.moveAnnotationMethod(e,t,n,r,i),deleteAnnotation:(e,t)=>this.deleteAnnotation(e,t),deleteAnnotations:(e,t)=>this.deleteAnnotationsMethod(e,t),deleteAllAnnotations:e=>this.deleteAllAnnotationsMethod(e),purgeAnnotation:(e,t,n)=>this.purgeAnnotationMethod(e,t,n),renderAnnotation:e=>this.renderAnnotation(e),getPageAppearances:(e,t,n)=>this.getPageAppearances(e,t,n),invalidatePageAppearances:(e,t)=>this.invalidatePageAppearances(e,t),commit:()=>this.commit(),getAttachedLinks:(e,t)=>this.getAttachedLinksMethod(e,t),hasAttachedLinks:(e,t)=>this.hasAttachedLinksMethod(e,t),deleteAttachedLinks:(e,t)=>this.deleteAttachedLinksMethod(e,t),groupAnnotations:e=>this.groupAnnotationsMethod(e),ungroupAnnotations:(e,t)=>this.ungroupAnnotationsMethod(e,t),getGroupMembers:(e,t)=>this.getGroupMembersMethod(e,t),isInGroup:(e,t)=>this.isInGroupMethod(e,t),setLocked:(e,t)=>this.setLocked(e,t),getLocked:e=>this.getLocked(e),isAnnotationLocked:(e,t)=>this.isAnnotationLocked(e,t),isAnnotationInteractive:(e,t)=>this.isAnnotationInteractive(e,t),isAnnotationStructurallyLocked:(e,t)=>this.isAnnotationStructurallyLocked(e,t),isAnnotationContentLocked:(e,t)=>this.isAnnotationContentLocked(e,t),isCategoryLocked:(e,t)=>this.isCategoryLockedMethod(e,t),isToolLocked:(e,t)=>this.isToolLockedMethod(e,t),syncAnnotationObject:(e,t,n)=>this.syncAnnotationObject(e,t,n),navigateTarget:(e,t)=>this.navigateTargetMethod(e,t),forDocument:e=>this.createAnnotationScope(e),getTools:()=>this.state.tools,getTool:e=>this.getTool(e),addTool:e=>{this.dispatch((e=>({type:cu,payload:e}))(e)),this.registerInteractionForTool(e)},findToolForAnnotation:e=>this.findToolForAnnotation(e),setToolDefaults:(e,t)=>this.dispatch(((e,t)=>({type:su,payload:{toolId:e,patch:t}}))(e,t)),getColorPresets:()=>[...this.state.colorPresets],addColorPreset:e=>this.dispatch((e=>({type:ou,payload:e}))(e)),transformAnnotation:(e,t)=>this.transformAnnotation(e,t),onStateChange:this.state$.onGlobal,onActiveToolChange:this.activeTool$.onGlobal,onAnnotationEvent:this.events$.onGlobal,onToolsChange:this.toolsChange$.on,onNavigate:this.navigate$.onGlobal}}createAnnotationScope(e){return{getState:()=>this.getDocumentState(e),getPageAnnotations:t=>this.getPageAnnotations(t,e),getSelectedAnnotation:()=>this.getSelectedAnnotation(e),getSelectedAnnotations:()=>this.getSelectedAnnotationsMethod(e),getSelectedAnnotationIds:()=>this.getSelectedAnnotationIdsMethod(e),getAnnotationById:t=>this.getAnnotationById(t,e),getAnnotations:t=>this.getAnnotationsMethod(t,e),selectAnnotation:(t,n)=>this.selectAnnotation(t,n,e),toggleSelection:(t,n)=>this.toggleSelectionMethod(t,n,e),addToSelection:(t,n)=>this.addToSelectionMethod(t,n,e),removeFromSelection:t=>this.removeFromSelectionMethod(t,e),setSelection:t=>this.setSelectionMethod(t,e),deselectAnnotation:()=>this.deselectAnnotation(e),getActiveTool:()=>this.getActiveTool(e),setActiveTool:(t,n)=>this.setActiveTool(t,e,n),findToolForAnnotation:e=>this.findToolForAnnotation(e),importAnnotations:t=>this.importAnnotations(t,e),exportAnnotations:t=>this.exportAnnotationsMethod(t,e),createAnnotation:(t,n,r)=>this.createAnnotation(t,n,r,e),updateAnnotation:(t,n,r)=>this.updateAnnotation(t,n,r,e),updateAnnotations:t=>this.updateAnnotationsMethod(t,e),moveAnnotation:(t,n,r,i)=>this.moveAnnotationMethod(t,n,r,i,e),deleteAnnotation:(t,n)=>this.deleteAnnotation(t,n,e),deleteAnnotations:t=>this.deleteAnnotationsMethod(t,e),deleteAllAnnotations:()=>this.deleteAllAnnotationsMethod(e),purgeAnnotation:(t,n)=>this.purgeAnnotationMethod(t,n,e),renderAnnotation:t=>this.renderAnnotation(t,e),getPageAppearances:(t,n)=>this.getPageAppearances(t,n,e),invalidatePageAppearances:t=>this.invalidatePageAppearances(t,e),commit:()=>this.commit(e),getAttachedLinks:t=>this.getAttachedLinksMethod(t,e),hasAttachedLinks:t=>this.hasAttachedLinksMethod(t,e),deleteAttachedLinks:t=>this.deleteAttachedLinksMethod(t,e),groupAnnotations:()=>this.groupAnnotationsMethod(e),ungroupAnnotations:t=>this.ungroupAnnotationsMethod(t,e),getGroupMembers:t=>this.getGroupMembersMethod(t,e),isInGroup:t=>this.isInGroupMethod(t,e),getGroupingAction:()=>this.getGroupingActionMethod(e),setLocked:t=>this.setLocked(t,e),getLocked:()=>this.getLocked(e),isAnnotationLocked:t=>this.isAnnotationLocked(t,e),isAnnotationInteractive:t=>this.isAnnotationInteractive(t,e),isAnnotationStructurallyLocked:t=>this.isAnnotationStructurallyLocked(t,e),isAnnotationContentLocked:t=>this.isAnnotationContentLocked(t,e),isCategoryLocked:t=>this.isCategoryLockedMethod(t,e),isToolLocked:t=>this.isToolLockedMethod(t,e),syncAnnotationObject:(t,n)=>this.syncAnnotationObject(t,n,e),navigateTarget:t=>this.navigateTargetMethod(t,e),onStateChange:this.state$.forScope(e),onAnnotationEvent:this.events$.forScope(e),onActiveToolChange:this.activeTool$.forScope(e),onNavigate:this.navigate$.forScope(e)}}onStoreUpdated(e,t){for(let n in t.documents){let r=e.documents[n],i=t.documents[n];r!==i&&(this.state$.emit(n,i),r&&r.activeToolId!==i.activeToolId&&this.activeTool$.emit(n,this.getActiveTool(n)),r?.selectedUids!==i.selectedUids&&this.updateAnnotationSelectionActivity(n,i))}if(e.tools!==t.tools){for(let e in t.documents)this.activeTool$.emit(e,this.getActiveTool(e));this.toolsChange$.emit({tools:t.tools})}}transformAnnotation(e,t){let n={type:t.type,changes:t.changes,metadata:t.metadata},r=this.findToolForAnnotation(e);return r?.transform?r.transform(e,n):n.changes}registerPageHandlers(t,n,r,i){let a=this.getCoreDocument(t),o=(a?.document)?.pages[n];if(!o||!this.interactionManager)return()=>{};let s=[],c=((o.rotation??0)+(a?.rotation??0))%4;for(let a of this.state.tools){let l=a.pointerHandler??(a.defaults?.type?e.defaultHandlerFactories.get(a.defaults.type):void 0);if(!l)continue;let u={pageIndex:n,pageSize:o.size,pageRotation:c,scale:r,services:i.services,onPreview:e=>i.onPreview(a.id,e),onCommit:(e,r)=>{var i,o;let s=a.behavior?.editAfterCreate??!1;this.createAnnotation(n,e,r,t,{editAfterCreate:s}),(i=a.behavior)!=null&&i.deactivateToolAfterCreate&&this.setActiveTool(null,t),((o=a.behavior)!=null&&o.selectAfterCreate||s)&&this.selectAnnotation(n,e.id,t)},getTool:()=>this.state.tools.find(e=>e.id===a.id),getToolContext:()=>this.state.documents[t]?.activeToolContext},d=this.interactionManager.registerHandlers({documentId:t,modeId:a.interaction.mode??a.id,handlers:l.create(u),pageIndex:n});s.push(d)}return()=>s.forEach(e=>e())}getDocumentState(e){let t=e??this.getActiveDocumentId(),n=this.state.documents[t];if(!n)throw Error(`Annotation state not found for document: ${t}`);return n}getAllAnnotations(e,t){this.engine.getAllAnnotations(t).wait(t=>{this.dispatch(((e,t)=>({type:Gl,payload:{documentId:e,annotations:t}}))(e,t)),this.isInitialLoadComplete.set(e,!0);let n=this.importQueue.get(e);n&&n.length>0&&this.processImportQueue(e),this.events$.emit(e,{type:`loaded`,documentId:e,total:Object.values(t).reduce((e,t)=>e+t.length,0)})},nr)}getPageAnnotations(e,t){let{pageIndex:n}=e,r=t??this.getActiveDocumentId(),i=this.getCoreDocument(r)?.document;if(!i)return G.reject({code:W.NotFound,message:`Document not found`});let a=i.pages.find(e=>e.index===n);return a?this.engine.getPageAnnotations(i,a):G.reject({code:W.NotFound,message:`Page not found`})}getSelectedAnnotation(e){return(e=>e.selectedUids.length>0?e.byUid[e.selectedUids[0]]??null:null)(this.getDocumentState(e))}getAnnotationById(e,t){return((e,t)=>e.byUid[t]??null)(this.getDocumentState(t),e)}getAnnotationsMethod(e,t){let n=this.getDocumentState(t);return e?.pageIndex===void 0?Object.values(n.byUid):ku(n,e.pageIndex).filter(e=>e!==void 0)}renderAnnotation({pageIndex:e,annotation:t,options:n},r){let i=r??this.getActiveDocumentId(),a=this.getCoreDocument(i)?.document;if(!a)return G.reject({code:W.NotFound,message:`Document not found`});let o=a.pages.find(t=>t.index===e);return o?this.engine.renderPageAnnotation(a,o,t,n):G.reject({code:W.NotFound,message:`Page not found`})}getPageAppearances(e,t,n){let r=n??this.getActiveDocumentId(),i=this.getCoreDocument(r)?.document;if(!i)return G.reject({code:W.NotFound,message:`Document not found`});let a=i.pages.find(t=>t.index===e);if(!a)return G.reject({code:W.NotFound,message:`Page not found`});let o=this.appearanceCache.get(r);o||(o=new Map,this.appearanceCache.set(r,o));let s=o.get(e);if(s&&!t){let e=new L;return e.resolve(s),e}let c=this.engine.renderPageAnnotations(i,a,t),l=new L;return c.wait(t=>{o.set(e,t),l.resolve(t)},e=>{l.fail(e)}),l}invalidatePageAppearances(e,t){let n=t??this.getActiveDocumentId(),r=this.appearanceCache.get(n);r&&r.delete(e)}invalidateAnnotationAppearance(e,t,n){let r=n??this.getActiveDocumentId(),i=this.appearanceCache.get(r);if(!i)return;let a=i.get(t);a&&delete a[e]}exportAnnotationsMethod(e,t){let n=t??this.getActiveDocumentId(),r=this.getDocumentState(n),i=this.getCoreDocument(n)?.document;if(!i)return G.reject({code:W.NotFound,message:`Document not found`});let a=e?.pageIndex===void 0?Object.keys(r.pages).map(Number):[e.pageIndex],o=[];for(let e of a){let t=r.pages[e]??[];for(let n of t){let t=r.byUid[n];t&&t.commitState!==`deleted`&&o.push({annotation:t.object,pageIndex:e,isStamp:t.object.type===z.STAMP})}}let s=o.filter(e=>e.isStamp);if(s.length===0)return G.resolve(o.map(e=>({annotation:e.annotation})));let c=G.create(),l=new Map,u=s.length,d=!1;for(let e of s){let t=i.pages.find(t=>t.index===e.pageIndex);if(!t){u--;continue}this.engine.exportAnnotationAppearanceAsPdf(i,t,e.annotation).wait(t=>{d||(l.set(e.annotation.id,t),u--,u===0&&c.resolve(o.map(e=>({annotation:e.annotation,...l.has(e.annotation.id)?{ctx:{data:l.get(e.annotation.id),mimeType:`application/pdf`}}:{}}))))},e=>{d||(d=!0,c.reject(e.reason))})}return u===0&&c.resolve(o.map(e=>({annotation:e.annotation}))),c}importAnnotations(e,t){let n=t??this.getActiveDocumentId();if(!this.isInitialLoadComplete.get(n)){let t=this.importQueue.get(n)||[];t.push(...e),this.importQueue.set(n,t);return}this.processImportItems(n,e)}processImportQueue(e){let t=this.importQueue.get(e);if(!t||t.length===0)return;let n=[...t];this.importQueue.set(e,[]),this.processImportItems(e,n)}processImportItems(e,t){let n=this.pendingContexts.get(e);if(n){for(let r of t){let{annotation:t,ctx:i}=r,a=t.pageIndex,o=t.id;this.dispatch(mu(e,a,t)),i&&n.set(o,i)}!1!==this.config.autoCommit&&this.commit(e)}}createAnnotation(e,t,n,r,i){let a=r??this.getActiveDocumentId();if(!this.checkPermission(a,U.ModifyAnnotations))return void this.logger.debug(`AnnotationPlugin`,`CreateAnnotation`,`Cannot create annotation: document ${a} lacks ModifyAnnotations permission`);let o=t.id,s=this.pendingContexts.get(a);if(!s)return;let c={...t,author:t.author??this.config.annotationAuthor},l=i?.editAfterCreate,u=()=>{this.dispatch(mu(a,e,c)),n&&s.set(o,n),this.events$.emit(a,{type:`create`,documentId:a,annotation:c,pageIndex:e,ctx:n,committed:!1,editAfterCreate:l})};if(!this.history)return u(),void(this.config.autoCommit&&this.commit(a));let d={execute:u,undo:()=>{s.delete(o),this.dispatch(lu(a)),this.dispatch(_u(a,e,o)),this.events$.emit(a,{type:`delete`,documentId:a,annotation:c,pageIndex:e,committed:!1})},metadata:{annotationIds:[o]}};this.history.forDocument(a).register(d,this.ANNOTATION_HISTORY_TOPIC)}buildPatch(e,t){return`rect`in t?t:this.transformAnnotation(e,{type:`property-update`,changes:t})}updateAnnotation(e,t,n,r){let i=r??this.getActiveDocumentId();if(!this.checkPermission(i,U.ModifyAnnotations))return void this.logger.debug(`AnnotationPlugin`,`UpdateAnnotation`,`Cannot update annotation: document ${i} lacks ModifyAnnotations permission`);let a=this.getDocumentState(i).byUid[t].object,o=this.buildPatch(a,{...n,author:n.author??this.config.annotationAuthor}),s=()=>{this.dispatch(hu(i,e,t,o)),this.events$.emit(i,{type:`update`,documentId:i,annotation:a,pageIndex:e,patch:o,committed:!1})};if(!this.history)return s(),void(!1!==this.config.autoCommit&&this.commit(i));let c=Object.fromEntries(Object.keys(n).map(e=>[e,a[e]])),l={execute:s,undo:()=>{this.dispatch(hu(i,e,t,c)),this.events$.emit(i,{type:`update`,documentId:i,annotation:a,pageIndex:e,patch:c,committed:!1})},metadata:{annotationIds:[t]}};this.history.forDocument(i).register(l,this.ANNOTATION_HISTORY_TOPIC)}deleteAnnotation(e,t,n){let r=n??this.getActiveDocumentId();if(!this.checkPermission(r,U.ModifyAnnotations))return void this.logger.debug(`AnnotationPlugin`,`DeleteAnnotation`,`Cannot delete annotation: document ${r} lacks ModifyAnnotations permission`);let i=this.getDocumentState(r),a=i.byUid[t]?.object;if(!a)return;let o=((e,t)=>{let n=[];for(let r of Object.values(e.pages))for(let i of r){let r=e.byUid[i];r&&`inReplyToId`in r.object&&r.object.inReplyToId===t&&n.push({id:r.object.id,pageIndex:r.object.pageIndex})}return n})(i,t),s=o.map(e=>i.byUid[e.id]?.object).filter(e=>e!==void 0),c=()=>{for(let e of o){let t=i.byUid[e.id]?.object;t&&(this.dispatch(_u(r,e.pageIndex,e.id)),this.events$.emit(r,{type:`delete`,documentId:r,annotation:t,pageIndex:e.pageIndex,committed:!1}))}this.dispatch(lu(r)),this.dispatch(_u(r,e,t)),this.events$.emit(r,{type:`delete`,documentId:r,annotation:a,pageIndex:e,committed:!1})};if(!this.history)return c(),void(!1!==this.config.autoCommit&&this.commit(r));let l={execute:c,undo:()=>{this.dispatch(mu(r,e,a)),this.events$.emit(r,{type:`create`,documentId:r,annotation:a,pageIndex:e,committed:!1});for(let e of s)this.dispatch(mu(r,e.pageIndex,e)),this.events$.emit(r,{type:`create`,documentId:r,annotation:e,pageIndex:e.pageIndex,committed:!1})},metadata:{annotationIds:[t,...o.map(e=>e.id)]}};this.history.forDocument(r).register(l,this.ANNOTATION_HISTORY_TOPIC)}deleteAnnotationsMethod(e,t){for(let{pageIndex:n,id:r}of e)this.deleteAnnotation(n,r,t)}deleteAllAnnotationsMethod(e){let t=e??this.getActiveDocumentId(),n=this.getDocumentState(t),r=[];for(let[e,t]of Object.entries(n.pages))for(let i of t){let t=n.byUid[i];t&&r.push({pageIndex:Number(e),id:t.object.id})}r.length>0&&this.deleteAnnotationsMethod(r,t)}purgeAnnotationMethod(e,t,n){let r=n??this.getActiveDocumentId();this.dispatch(vu(r,e,t))}selectAnnotation(e,t,n){let r=n??this.getActiveDocumentId(),i=this.getAnnotationById(t,r);if(!i||this.isAnnotationSelectable(i.object,r)){if(this.isInGroupMethod(t,r)){let e=this.getGroupMembersMethod(t,r).map(e=>e.object.id);this.dispatch(fu(r,e))}else this.dispatch(((e,t,n)=>({type:Kl,payload:{documentId:e,pageIndex:t,id:n}}))(r,e,t))}}deselectAnnotation(e){let t=e??this.getActiveDocumentId();this.dispatch(lu(t))}updateAnnotationSelectionActivity(e,t){var n,r;if(t.selectedUids.length===0)return void((n=this.interactionManager)==null||n.releasePageActivity(e,`annotation-selection`));let i=t.selectedUids[0],a=t.byUid[i];a&&((r=this.interactionManager)==null||r.claimPageActivity(e,`annotation-selection`,a.object.pageIndex))}getSelectedAnnotationsMethod(e){return Au(this.getDocumentState(e))}getSelectedAnnotationIdsMethod(e){return ju(this.getDocumentState(e))}toggleSelectionMethod(e,t,n){let r=n??this.getActiveDocumentId(),i=this.getAnnotationById(t,r);if(i&&!this.isAnnotationSelectable(i.object,r))return;let a=this.getDocumentState(r);if(a.selectedUids.includes(t))this.dispatch(du(r,t));else if(this.isInGroupMethod(t,r)){let e=this.getGroupMembersMethod(t,r);for(let t of e)a.selectedUids.includes(t.object.id)||this.dispatch(uu(r,t.object.pageIndex,t.object.id))}else this.dispatch(uu(r,e,t))}addToSelectionMethod(e,t,n){let r=n??this.getActiveDocumentId(),i=this.getAnnotationById(t,r);i&&!this.isAnnotationInteractive(i.object,r)||this.dispatch(uu(r,e,t))}removeFromSelectionMethod(e,t){let n=t??this.getActiveDocumentId();this.dispatch(du(n,e))}setSelectionMethod(e,t){let n=t??this.getActiveDocumentId(),r=this.getDocumentState(n),i=e.filter(e=>{let t=r.byUid[e];return!t||this.isAnnotationInteractive(t.object,n)});this.dispatch(fu(n,i))}getAttachedLinksMethod(e,t){return Nu(this.getDocumentState(t),e)}hasAttachedLinksMethod(e,t){return this.getAttachedLinksMethod(e,t).length>0}deleteAttachedLinksMethod(e,t){let n=this.getAttachedLinksMethod(e,t);for(let e of n)this.deleteAnnotation(e.object.pageIndex,e.object.id,t)}groupAnnotationsMethod(e){let t=e??this.getActiveDocumentId();if(!this.checkPermission(t,U.ModifyAnnotations))return void this.logger.debug(`AnnotationPlugin`,`GroupAnnotations`,`Cannot group annotations: document ${t} lacks ModifyAnnotations permission`);let n=this.getSelectedAnnotationsMethod(t);if(n.length<2)return void this.logger.debug(`AnnotationPlugin`,`GroupAnnotations`,`Need at least 2 annotations to group`);let r=n[0],i=n.slice(1).map(e=>({pageIndex:e.object.pageIndex,id:e.object.id,patch:{inReplyToId:r.object.id,replyType:cn.Group}}));this.updateAnnotationsMethod(i,t)}ungroupAnnotationsMethod(e,t){let n=t??this.getActiveDocumentId();if(!this.checkPermission(n,U.ModifyAnnotations))return void this.logger.debug(`AnnotationPlugin`,`UngroupAnnotations`,`Cannot ungroup annotations: document ${n} lacks ModifyAnnotations permission`);let r=this.getGroupMembersMethod(e,n).filter(e=>e.object.inReplyToId&&e.object.replyType===cn.Group).map(e=>({pageIndex:e.object.pageIndex,id:e.object.id,patch:{inReplyToId:void 0,replyType:void 0}}));r.length>0&&this.updateAnnotationsMethod(r,n)}getGroupMembersMethod(e,t){return Fu(this.getDocumentState(t),e)}isInGroupMethod(e,t){return Iu(this.getDocumentState(t),e)}getGroupingActionMethod(e){return(e=>{let t=Au(e);if(t.length===0)return`disabled`;let n=t[0].object.id;if(Iu(e,n)){let r=Fu(e,n),i=new Set(r.map(e=>e.object.id));if(t.every(e=>i.has(e.object.id)))return`ungroup`}return t.length>=2?`group`:`disabled`})(this.getDocumentState(e))}computeCombinedConstraints(e){let t=1/0,n=1/0,r=1/0,i=1/0;for(let a of e){let e=a.rect.origin.y,o=a.pageSize.height-(a.rect.origin.y+a.rect.size.height),s=a.rect.origin.x,c=a.pageSize.width-(a.rect.origin.x+a.rect.size.width);t=Math.min(t,e),n=Math.min(n,o),r=Math.min(r,s),i=Math.min(i,c)}return isFinite(t)||(t=0),isFinite(n)||(n=0),isFinite(r)||(r=0),isFinite(i)||(i=0),{maxUp:t,maxDown:n,maxLeft:r,maxRight:i}}clampDelta(e,t){return{x:Math.max(-t.maxLeft,Math.min(t.maxRight,e.x)),y:Math.max(-t.maxUp,Math.min(t.maxDown,e.y))}}startDrag(e,t){let{annotationIds:n,pageSize:r}=t,i=[];for(let t of n){let n=this.getAttachedLinksMethod(t,e);for(let e of n)i.includes(e.object.id)||i.push(e.object.id)}let a=[...n,...i],o=new Map,s=[];for(let t of a){let n=this.getAnnotationById(t,e);n&&(o.set(t,{...n.object.rect}),s.push({id:t,rect:n.object.rect,pageIndex:n.object.pageIndex,pageSize:r}))}let c={documentId:e,isDragging:!0,primaryIds:n,attachedLinkIds:i,allParticipantIds:a,originalRects:o,delta:{x:0,y:0},combinedConstraints:this.computeCombinedConstraints(s)};this.unifiedDragStates.set(e,c),this.unifiedDrag$.emit({documentId:e,type:`start`,state:c,previewPatches:{}})}computeDragPreviewPatches(e,t){let n={};for(let r of e.allParticipantIds){let i=this.getAnnotationById(r,t);if(!i)continue;let a=e.originalRects.get(r);if(!a)continue;let o={...a,origin:{x:a.origin.x+e.delta.x,y:a.origin.y+e.delta.y}};n[r]=this.transformAnnotation(i.object,{type:`move`,changes:{rect:o}})}return n}updateDrag(e,t){let n=this.unifiedDragStates.get(e);if(!n?.isDragging)return{x:0,y:0};let r=this.clampDelta(t,n.combinedConstraints),i={...n,delta:r};this.unifiedDragStates.set(e,i);let a=this.computeDragPreviewPatches(i,e);return this.unifiedDrag$.emit({documentId:e,type:`update`,state:i,previewPatches:a}),r}commitDrag(e){let t=this.unifiedDragStates.get(e);if(!t)return;let n=t.delta;if(n.x!==0||n.y!==0){let r=[];for(let i of t.allParticipantIds){let a=this.getAnnotationById(i,e);if(!a)continue;let o=t.originalRects.get(i)??a.object.rect,s={...o,origin:{x:o.origin.x+n.x,y:o.origin.y+n.y}},c=this.transformAnnotation(a.object,{type:`move`,changes:{rect:s}});r.push({pageIndex:a.object.pageIndex,id:i,patch:c})}r.length>0&&this.moveAnnotationsMethod(r,e)}let r=this.computeDragPreviewPatches(t,e);this.unifiedDrag$.emit({documentId:e,type:`end`,state:{...t,isDragging:!1},previewPatches:r}),this.unifiedDragStates.delete(e)}cancelDrag(e){let t=this.unifiedDragStates.get(e);t&&(this.unifiedDrag$.emit({documentId:e,type:`cancel`,state:{...t,isDragging:!1,delta:{x:0,y:0}},previewPatches:{}}),this.unifiedDragStates.delete(e))}getDragState(e){return this.unifiedDragStates.get(e)??null}get onDragChange(){return this.unifiedDrag$.on}computeUnifiedGroupBoundingBox(e){if(e.length===0)return{origin:{x:0,y:0},size:{width:0,height:0}};let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.origin.x),n=Math.min(n,a.origin.y),r=Math.max(r,a.origin.x+a.size.width),i=Math.max(i,a.origin.y+a.size.height);return{origin:{x:t,y:n},size:{width:r-t,height:i-n}}}computeUnifiedRelativePositions(e,t){return e.map(e=>({id:e.id,originalRect:e.rect,originalUnrotatedRect:e.unrotatedRect,pageIndex:e.pageIndex,isAttachedLink:e.isAttachedLink,parentId:e.parentId,relativeX:t.size.width>0?(e.rect.origin.x-t.origin.x)/t.size.width:0,relativeY:t.size.height>0?(e.rect.origin.y-t.origin.y)/t.size.height:0,relativeWidth:t.size.width>0?e.rect.size.width/t.size.width:1,relativeHeight:t.size.height>0?e.rect.size.height/t.size.height:1}))}computeUnifiedResizedRects(e,t,n=10){let r=new Map;for(let i of e){let e=Math.max(n,i.relativeWidth*t.size.width),a=Math.max(n,i.relativeHeight*t.size.height);r.set(i.id,{origin:{x:t.origin.x+i.relativeX*t.size.width,y:t.origin.y+i.relativeY*t.size.height},size:{width:e,height:a}})}return r}computeResizePreviewPatches(e,t){let n={},r=this.unifiedResizeStates.get(t),i=r?new Map(r.participatingAnnotations.map(e=>[e.id,e])):void 0;for(let[a,o]of e){let e=this.getAnnotationById(a,t);if(!e)continue;let s=o,c=i?.get(a);r!=null&&r.isGroupResize&&c!=null&&c.originalUnrotatedRect&&(s=fd(o,c.originalRect,c.originalUnrotatedRect,e.object.rotation??0)),n[a]=this.transformAnnotation(e.object,{type:`resize`,changes:{rect:s}})}return n}startResize(e,t){let{annotationIds:n,pageSize:r,resizeHandle:i}=t,a=[],o=[];for(let t of n){let n=this.getAnnotationById(t,e);if(n){o.push({id:t,rect:n.object.rect,unrotatedRect:n.object.unrotatedRect?this.cloneRect(n.object.unrotatedRect):void 0,pageIndex:n.object.pageIndex,isAttachedLink:!1});let r=this.getAttachedLinksMethod(t,e);for(let e of r)a.includes(e.object.id)||(a.push(e.object.id),o.push({id:e.object.id,rect:e.object.rect,unrotatedRect:e.object.unrotatedRect?this.cloneRect(e.object.unrotatedRect):void 0,pageIndex:e.object.pageIndex,isAttachedLink:!0,parentId:t}))}}let s=[...n,...a],c=o.map(e=>e.rect),l=this.computeUnifiedGroupBoundingBox(c),u=this.computeUnifiedRelativePositions(o,l),d=this.computeUnifiedResizedRects(u,l),f={documentId:e,isResizing:!0,isGroupResize:n.length>1,primaryIds:n,attachedLinkIds:a,allParticipantIds:s,originalGroupBox:l,currentGroupBox:l,participatingAnnotations:u,resizeHandle:i,computedRects:d};this.unifiedResizeStates.set(e,f);let p=this.computeResizePreviewPatches(d,e);this.unifiedResize$.emit({documentId:e,type:`start`,state:f,computedRects:Object.fromEntries(d),previewPatches:p})}updateResize(e,t){let n=this.unifiedResizeStates.get(e);if(!n?.isResizing)return{};let r=this.computeUnifiedResizedRects(n.participatingAnnotations,t),i={...n,currentGroupBox:t,computedRects:r};this.unifiedResizeStates.set(e,i);let a=Object.fromEntries(r),o=this.computeResizePreviewPatches(r,e);return this.unifiedResize$.emit({documentId:e,type:`update`,state:i,computedRects:a,previewPatches:o}),a}commitResize(e){let t=this.unifiedResizeStates.get(e);if(!t)return;let n=this.computeUnifiedResizedRects(t.participatingAnnotations,t.currentGroupBox),r=[],i=new Map(t.participatingAnnotations.map(e=>[e.id,e]));for(let[a,o]of n){let n=this.getAnnotationById(a,e);if(!n)continue;let s=o,c=i.get(a);t.isGroupResize&&c!=null&&c.originalUnrotatedRect&&(s=fd(o,c.originalRect,c.originalUnrotatedRect,n.object.rotation??0));let l=this.transformAnnotation(n.object,{type:`resize`,changes:{rect:s}});r.push({pageIndex:n.object.pageIndex,id:a,patch:l})}r.length>0&&this.updateAnnotationsMethod(r,e);let a=this.computeResizePreviewPatches(n,e);this.unifiedResize$.emit({documentId:e,type:`end`,state:{...t,isResizing:!1},computedRects:Object.fromEntries(n),previewPatches:a}),this.unifiedResizeStates.delete(e)}cancelResize(e){let t=this.unifiedResizeStates.get(e);if(!t)return;let n=this.computeUnifiedResizedRects(t.participatingAnnotations,t.originalGroupBox);this.unifiedResize$.emit({documentId:e,type:`cancel`,state:{...t,isResizing:!1,currentGroupBox:t.originalGroupBox},computedRects:Object.fromEntries(n),previewPatches:{}}),this.unifiedResizeStates.delete(e)}getResizeState(e){return this.unifiedResizeStates.get(e)??null}get onResizeChange(){return this.unifiedResize$.on}cloneRect(e){return{origin:{x:e.origin.x,y:e.origin.y},size:{width:e.size.width,height:e.size.height}}}translateRect(e,t){return{origin:{x:e.origin.x+t.x,y:e.origin.y+t.y},size:{...e.size}}}normalizeAngle(e){let t=e%360;return t<0?t+360:t}normalizeDelta(e){return(e+540)%360-180}buildRotationParticipants(e,t){let n=[],r=[];for(let i of e){let e=this.getAnnotationById(i,t);if(!e)continue;n.push({id:i,rect:this.cloneRect(e.object.rect),pageIndex:e.object.pageIndex,rotation:e.object.rotation??0,unrotatedRect:e.object.unrotatedRect?this.cloneRect(e.object.unrotatedRect):void 0,isAttachedLink:!1});let a=this.getAttachedLinksMethod(i,t);for(let e of a)r.includes(e.object.id)||(r.push(e.object.id),n.push({id:e.object.id,rect:this.cloneRect(e.object.rect),pageIndex:e.object.pageIndex,rotation:e.object.rotation??0,unrotatedRect:e.object.unrotatedRect?this.cloneRect(e.object.unrotatedRect):void 0,isAttachedLink:!0,parentId:i}))}return{participants:n,attachedLinkIds:r}}computeRotatePreviewPatches(e,t){let n={};for(let r of e.participants){let i=this.getAnnotationById(r.id,t);if(!i)continue;let a=Ku({rect:r.rect,unrotatedRect:r.unrotatedRect,rotation:r.rotation}),o=At(a,e.rotationCenter,e.delta),s={x:o.x-a.x,y:o.y-a.y},c=this.normalizeAngle(r.rotation+e.delta),l=this.transformAnnotation(i.object,{type:`rotate`,changes:{rotation:c,unrotatedRect:this.translateRect(r.unrotatedRect??r.rect,s)},metadata:{rotationAngle:c,rotationDelta:e.delta,rotationCenter:e.rotationCenter}});l.rect||s.x===0&&s.y===0||(l.rect={origin:{x:i.object.rect.origin.x+s.x,y:i.object.rect.origin.y+s.y},size:{...i.object.rect.size}}),n[r.id]=l}return n}startRotation(e,t){let{annotationIds:n,cursorAngle:r,rotationCenter:i}=t,{participants:a,attachedLinkIds:o}=this.buildRotationParticipants(n,e);if(a.length===0)return;let s=a.map(e=>e.rect),c=this.computeUnifiedGroupBoundingBox(s),l=i??{x:c.origin.x+c.size.width/2,y:c.origin.y+c.size.height/2},u={documentId:e,isRotating:!0,primaryIds:n,attachedLinkIds:o,allParticipantIds:a.map(e=>e.id),rotationCenter:l,cursorStartAngle:r,currentAngle:r,delta:0,participants:a};this.unifiedRotateStates.set(e,u);let d=this.computeRotatePreviewPatches(u,e);this.unifiedRotate$.emit({documentId:e,type:`start`,state:u,previewPatches:d})}updateRotation(e,t,n){let r=this.unifiedRotateStates.get(e);if(!r?.isRotating)return;let i=n===void 0?this.normalizeDelta(t-r.cursorStartAngle):n,a={...r,currentAngle:t,delta:i};this.unifiedRotateStates.set(e,a);let o=this.computeRotatePreviewPatches(a,e);this.unifiedRotate$.emit({documentId:e,type:`update`,state:a,previewPatches:o})}commitRotation(e){let t=this.unifiedRotateStates.get(e);if(!t)return;let n=this.computeRotatePreviewPatches(t,e),r=[];for(let[t,i]of Object.entries(n)){let n=this.getAnnotationById(t,e);n&&r.push({pageIndex:n.object.pageIndex,id:t,patch:i})}r.length>0&&this.updateAnnotationsMethod(r,e),this.unifiedRotate$.emit({documentId:e,type:`end`,state:{...t,isRotating:!1},previewPatches:n}),this.unifiedRotateStates.delete(e)}cancelRotation(e){let t=this.unifiedRotateStates.get(e);t&&(this.unifiedRotate$.emit({documentId:e,type:`cancel`,state:{...t,isRotating:!1,delta:0,currentAngle:t.cursorStartAngle},previewPatches:{}}),this.unifiedRotateStates.delete(e))}getRotateState(e){return this.unifiedRotateStates.get(e)??null}get onRotateChange(){return this.unifiedRotate$.on}updateAnnotationsMethod(e,t){let n=t??this.getActiveDocumentId();if(!this.checkPermission(n,U.ModifyAnnotations))return void this.logger.debug(`AnnotationPlugin`,`UpdateAnnotations`,`Cannot update annotations: document ${n} lacks ModifyAnnotations permission`);let r=this.getDocumentState(n),i=e.map(({pageIndex:e,id:t,patch:n})=>{let i=r.byUid[t]?.object;return i?{pageIndex:e,id:t,patch:this.buildPatch(i,{...n,author:n.author??this.config.annotationAuthor}),originalObject:i}:null}).filter(e=>e!==null);if(i.length===0)return;let a=()=>{for(let{pageIndex:e,id:t,patch:r,originalObject:a}of i)this.dispatch(hu(n,e,t,r)),this.events$.emit(n,{type:`update`,documentId:n,annotation:a,pageIndex:e,patch:r,committed:!1})};if(!this.history)return a(),void(!1!==this.config.autoCommit&&this.commit(n));let o=i.map(({pageIndex:e,id:t,patch:n,originalObject:r})=>({pageIndex:e,id:t,originalPatch:Object.fromEntries(Object.keys(n).map(e=>[e,r[e]])),originalObject:r})),s={execute:a,undo:()=>{for(let{pageIndex:e,id:t,originalPatch:r,originalObject:i}of o)this.dispatch(hu(n,e,t,r)),this.events$.emit(n,{type:`update`,documentId:n,annotation:i,pageIndex:e,patch:r,committed:!1})},metadata:{annotationIds:i.map(e=>e.id)}};this.history.forDocument(n).register(s,this.ANNOTATION_HISTORY_TOPIC)}moveAnnotationsMethod(e,t){let n=t??this.getActiveDocumentId();if(!this.checkPermission(n,U.ModifyAnnotations))return void this.logger.debug(`AnnotationPlugin`,`MoveAnnotations`,`Cannot move annotations: document ${n} lacks ModifyAnnotations permission`);let r=this.getDocumentState(n),i=e.map(({pageIndex:e,id:t,patch:n})=>{let i=r.byUid[t]?.object;return i?{pageIndex:e,id:t,patch:n,originalObject:i}:null}).filter(e=>e!==null);if(i.length===0)return;let a=()=>{for(let{pageIndex:e,id:t,patch:r,originalObject:a}of i)this.dispatch(gu(n,e,t,r)),this.events$.emit(n,{type:`update`,documentId:n,annotation:a,pageIndex:e,patch:r,committed:!1})};if(!this.history)return a(),void(!1!==this.config.autoCommit&&this.commit(n));let o=i.map(({pageIndex:e,id:t,patch:n,originalObject:r})=>({pageIndex:e,id:t,originalPatch:Object.fromEntries(Object.keys(n).map(e=>[e,r[e]])),originalObject:r})),s={execute:a,undo:()=>{for(let{pageIndex:e,id:t,originalPatch:r,originalObject:i}of o)this.dispatch(gu(n,e,t,r)),this.events$.emit(n,{type:`update`,documentId:n,annotation:i,pageIndex:e,patch:r,committed:!1})},metadata:{annotationIds:i.map(e=>e.id)}};this.history.forDocument(n).register(s,this.ANNOTATION_HISTORY_TOPIC)}moveAnnotationMethod(e,t,n,r=`delta`,i){let a=i??this.getActiveDocumentId(),o=this.getAnnotationById(t,a);if(!o)return;let s=o.object.rect,c={...s,origin:r===`absolute`?{x:n.x,y:n.y}:{x:s.origin.x+n.x,y:s.origin.y+n.y}},l=this.transformAnnotation(o.object,{type:`move`,changes:{rect:c}});this.moveAnnotationsMethod([{pageIndex:e,id:t,patch:l}],a)}getActiveTool(e){let t=this.getDocumentState(e);return t.activeToolId?this.state.tools.find(e=>e.id===t.activeToolId)??null:null}setActiveTool(e,t,n){var r,i;let a=t??this.getActiveDocumentId();if(e!==null&&!this.checkPermission(a,U.ModifyAnnotations))return void this.logger.debug(`AnnotationPlugin`,`SetActiveTool`,`Cannot activate tool: document ${a} lacks ModifyAnnotations permission`);if(e===this.getDocumentState(a).activeToolId&&!n)return;this.dispatch(pu(a,e,n));let o=this.state.tools.find(t=>t.id===e);o?(r=this.interactionManager)==null||r.forDocument(a).activate(o.interaction.mode??o.id):(i=this.interactionManager)==null||i.forDocument(a).activateDefaultMode()}getTool(e){return this.state.tools.find(t=>t.id===e)}findToolForAnnotation(e){let t=null,n=0;for(let r of this.state.tools){let i=r.matchScore(e);i>n&&(n=i,t=r)}return t}setLocked(e,t){let n=t??this.getActiveDocumentId();this.dispatch(((e,t)=>({type:iu,payload:{documentId:e,mode:t}}))(n,e));let r=this.getDocumentState(n),i=r.selectedUids.filter(e=>{let t=r.byUid[e];return!!t&&!this.isAnnotationInteractive(t.object,n)});if(i.length>0){let e=r.selectedUids.filter(e=>!i.includes(e));this.dispatch(fu(n,e))}}getLocked(e){return this.getDocumentState(e).locked}isAnnotationLocked(e,t){return Eu(e)?!0:Tu(wu(this.findToolForAnnotation(e)),this.getLocked(t))}isAnnotationInteractive(e,t){return Du(e)||Ou(e)||function(e){return e.flags?.includes(`readOnly`)??!1}(e)?!1:!Tu(wu(this.findToolForAnnotation(e)),this.getLocked(t))}isAnnotationStructurallyLocked(e,t){return!this.isAnnotationInteractive(e,t)||Eu(e)}isAnnotationContentLocked(e,t){return!this.isAnnotationInteractive(e,t)||function(e){return e.flags?.includes(`lockedContents`)??!1}(e)}isAnnotationSelectable(e,t){return this.isAnnotationInteractive(e,t)}isCategoryLockedMethod(e,t){return Tu([e],this.getLocked(t))}isToolLockedMethod(e,t){let n=this.getTool(e);return n?Tu(wu(n),this.getLocked(t)):!1}syncAnnotationObject(e,t,n){let r=n??this.getActiveDocumentId();this.dispatch(((e,t,n)=>({type:au,payload:{documentId:e,id:t,patch:n}}))(r,e,t))}navigateTargetMethod(e,t){let n=t??this.getActiveDocumentId(),r=t=>(this.navigate$.emit(n,{documentId:n,result:t,target:e}),G.resolve(t)),i;if(e.type===`destination`)i=e.destination;else if(e.type===`action`){let t=e.action;if(t.type!==en.Goto&&t.type!==en.RemoteGoto)return t.type===en.URI?r({outcome:`uri`,uri:t.uri}):r({outcome:`unsupported`});i=t.destination}if(!i)return r({outcome:`unsupported`});if(!this.scroll)return r({outcome:`destination`,destination:i});let a=this.scroll.forDocument(n);if(i.zoom.mode===Jt.XYZ){let e=(this.getCoreDocument(n)?.document)?.pages.find(e=>e.index===i.pageIndex);a.scrollToPage({pageNumber:i.pageIndex+1,pageCoordinates:e&&i.zoom.params?{x:i.zoom.params.x,y:e.size.height-i.zoom.params.y}:void 0,behavior:`smooth`})}else a.scrollToPage({pageNumber:i.pageIndex+1,behavior:`smooth`});return r({outcome:`navigated`})}collectPendingChanges(e,t){let n=this.getDocumentState(e),r=this.pendingContexts.get(e),i={creations:[],updates:[],deletions:[],committedUids:[],isEmpty:!0};for(let[e,a]of Object.entries(n.byUid))if(a.commitState!==`synced`&&t.pages.find(e=>e.index===a.object.pageIndex))switch(i.committedUids.push(e),i.isEmpty=!1,a.commitState){case`new`:i.creations.push({uid:e,ta:a,ctx:r?.get(a.object.id)});break;case`moved`:i.updates.push({uid:e,ta:a,moved:!0});break;case`dirty`:i.updates.push({uid:e,ta:a});break;case`deleted`:i.deletions.push({uid:e,ta:a})}return i}executeCommitBatch(e,t,n){let r=new L,i=this.pendingContexts.get(e),a=[];for(let{uid:e,ta:r,ctx:i}of n.creations){let n=t.pages.find(e=>e.index===r.object.pageIndex);if(!n)continue;let o=this.engine.createPageAnnotation(t,n,r.object,i);a.push({type:`create`,task:o,ta:r,uid:e,ctx:i})}for(let{uid:e,ta:r,moved:i}of n.updates){let n=t.pages.find(e=>e.index===r.object.pageIndex);if(!n)continue;let o=i?this.engine.updatePageAnnotation(t,n,r.object,{regenerateAppearance:!1}):this.engine.updatePageAnnotation(t,n,r.object);a.push({type:`update`,task:o,ta:r,uid:e,moved:i})}for(let{uid:r,ta:i}of n.deletions){let n=t.pages.find(e=>e.index===i.object.pageIndex);if(n){if(i.object.id){let e=new L;this.engine.removePageAnnotation(t,n,i.object).wait(()=>e.resolve(!0),e.fail),a.push({type:`delete`,task:e,ta:i,uid:r})}else this.dispatch(vu(e,i.object.pageIndex,r))}}let o=a.map(e=>e.task);return L.allSettled(o).wait(()=>{this.emitCommitEvents(e,a,i);for(let t of a)t.type===`update`&&t.moved||t.type!==`create`&&t.type!==`update`&&t.type!==`delete`||this.invalidateAnnotationAppearance(t.ta.object.id,t.ta.object.pageIndex,e);var t,o;this.dispatch((t=e,o=n.committedUids,{type:nu,payload:{documentId:t,committedUids:o}})),r.resolve(!0)},e=>r.fail(e)),r}emitCommitEvents(e,t,n){for(let r of t)if(r.task.state.stage===Ht.Resolved)switch(r.type){case`create`:this.events$.emit(e,{type:`create`,documentId:e,annotation:r.ta.object,pageIndex:r.ta.object.pageIndex,ctx:r.ctx,committed:!0}),n?.delete(r.ta.object.id);break;case`update`:this.events$.emit(e,{type:`update`,documentId:e,annotation:r.ta.object,pageIndex:r.ta.object.pageIndex,patch:r.ta.object,committed:!0});break;case`delete`:this.dispatch(vu(e,r.ta.object.pageIndex,r.uid)),this.events$.emit(e,{type:`delete`,documentId:e,annotation:r.ta.object,pageIndex:r.ta.object.pageIndex,committed:!0})}}acquireCommitLock(e){return!this.commitInProgress.get(e)&&(this.commitInProgress.set(e,!0),!0)}releaseCommitLock(e){this.commitInProgress.set(e,!1)}commit(e){let t=e??this.getActiveDocumentId();if(!this.getDocumentState(t).hasPendingChanges||!this.acquireCommitLock(t))return G.resolve(!0);let n=this.getCoreDocument(t)?.document;if(!n)return this.releaseCommitLock(t),G.reject({code:W.NotFound,message:`Document not found`});let r=this.collectPendingChanges(t,n);if(r.isEmpty)return this.releaseCommitLock(t),G.resolve(!0);let i=new L;return this.executeCommitBatch(t,n,r).wait(()=>{this.releaseCommitLock(t),this.getDocumentState(t).hasPendingChanges?this.commit(t).wait(e=>i.resolve(e),e=>i.fail(e)):i.resolve(!0)},e=>{this.releaseCommitLock(t),i.fail(e)}),i}};kf.id=`annotation`,kf.defaultHandlerFactories=new Map([[z.CIRCLE,nf],[z.SQUARE,$d],[z.STAMP,tf],[z.POLYGON,Qd],[z.POLYLINE,Zd],[z.LINE,Xd],[z.INK,Ru],[z.FREETEXT,qd],[z.TEXT,Gd],[z.LINK,rf]]);var Af=kf;function jf(e,t,n){return e===void 0?n:typeof e==`function`?e(t):e}function Mf(e){return t=>t?.id===e}var Nf=Mf(`highlight`),Pf=Mf(`squiggly`),Ff=Mf(`underline`),If=Mf(`strikeout`),Lf={manifest:Hl,create:(e,t)=>new Af(Y,e,t),reducer:(e,t)=>{switch(t.type){case Ul:{let{documentId:n,state:r}=t.payload;return{...e,documents:{...e.documents,[n]:r},activeDocumentId:e.activeDocumentId??n}}case Wl:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case`ANNOTATION/SET_ACTIVE_DOCUMENT`:return{...e,activeDocumentId:t.payload};case Gl:{let{documentId:n,annotations:r}=t.payload,i=e.documents[n];if(!i)return e;let a={},o={};for(let[e,t]of Object.entries(r)){let n=Number(e),r=i.pages[n]||[];for(let e of r)delete o[e];a[n]=t.map(e=>{let t=e.id;return o[t]={commitState:`synced`,object:e},t})}return{...e,documents:{...e.documents,[n]:{...i,pages:a,byUid:o}}}}case Kl:{let{documentId:n,id:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,selectedUids:[r],selectedUid:r}}}:e}case ql:{let{documentId:n}=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:{...r,selectedUids:[],selectedUid:null}}}:e}case Jl:{let{documentId:n,id:r}=t.payload,i=e.documents[n];if(!i||i.selectedUids.includes(r))return e;let a=[...i.selectedUids,r];return{...e,documents:{...e.documents,[n]:{...i,selectedUids:a,selectedUid:Tf(a)}}}}case Yl:{let{documentId:n,id:r}=t.payload,i=e.documents[n];if(!i)return e;let a=i.selectedUids.filter(e=>e!==r);return{...e,documents:{...e.documents,[n]:{...i,selectedUids:a,selectedUid:Tf(a)}}}}case Xl:{let{documentId:n,ids:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,selectedUids:r,selectedUid:Tf(r)}}}:e}case Zl:{let{documentId:n,toolId:r,context:i}=t.payload,a=e.documents[n];return a?{...e,documents:{...e.documents,[n]:{...a,activeToolId:r,activeToolContext:i}}}:e}case Ql:{let{documentId:n,pageIndex:r,annotation:i}=t.payload,a=e.documents[n];if(!a)return e;let o=i.id;return{...e,documents:{...e.documents,[n]:{...a,pages:{...a.pages,[r]:[...a.pages[r]??[],o]},byUid:{...a.byUid,[o]:{commitState:`new`,object:i,dictMode:!0}},hasPendingChanges:!0}}}}case tu:{let{documentId:n,pageIndex:r,id:i}=t.payload,a=e.documents[n];return a&&a.byUid[i]?{...e,documents:{...e.documents,[n]:{...a,pages:{...a.pages,[r]:(a.pages[r]??[]).filter(e=>e!==i)},byUid:{...a.byUid,[i]:{...a.byUid[i],commitState:`deleted`}},hasPendingChanges:!0}}}:e}case $l:{let{documentId:n,id:r,patch:i}=t.payload,a=e.documents[n];return a?{...e,documents:{...e.documents,[n]:Df(a,r,i)}}:e}case eu:{let{documentId:n,id:r,patch:i}=t.payload,a=e.documents[n];return a?{...e,documents:{...e.documents,[n]:Of(a,r,i)}}:e}case nu:{let{documentId:n,committedUids:r}=t.payload,i=e.documents[n];if(!i)return e;let a=new Set(r),o={},s=!1;for(let[e,t]of Object.entries(i.byUid))a.has(e)?o[e]={...t,commitState:t.commitState===`dirty`||t.commitState===`new`||t.commitState===`moved`?`synced`:t.commitState}:(o[e]=t,t.commitState!==`new`&&t.commitState!==`dirty`&&t.commitState!==`moved`&&t.commitState!==`deleted`||(s=!0));return{...e,documents:{...e.documents,[n]:{...i,byUid:o,hasPendingChanges:s}}}}case ru:{let{documentId:n,pageIndex:r,uid:i}=t.payload,a=e.documents[n];if(!a||!a.byUid[i])return e;let{[i]:o,...s}=a.byUid;return{...e,documents:{...e.documents,[n]:{...a,pages:{...a.pages,[r]:(a.pages[r]??[]).filter(e=>e!==i)},byUid:s}}}}case iu:{let{documentId:n,mode:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,locked:r}}}:e}case au:{let{documentId:n,id:r,patch:i}=t.payload,a=e.documents[n];if(!a)return e;let o=a.byUid[r];return o?{...e,documents:{...e.documents,[n]:{...a,byUid:{...a.byUid,[r]:{...o,object:{...o.object,...i}}}}}}:e}case cu:{let n=new Map(e.tools.map(e=>[e.id,e]));return n.set(t.payload.id,t.payload),{...e,tools:Array.from(n.values())}}case su:{let{toolId:n,patch:r}=t.payload;return{...e,tools:e.tools.map(e=>e.id===n?{...e,defaults:{...e.defaults,...r}}:e)}}case ou:return e.colorPresets.includes(t.payload)?e:{...e,colorPresets:[...e.colorPresets,t.payload]};default:return e}},initialState:(e,t)=>(e=>{let t=new Map;Cf.forEach(e=>t.set(e.id,e));let n=new Map(t);return(e.tools||[]).forEach(e=>{let r=t.get(e.id);r?n.set(e.id,{...r,...e,defaults:{...r.defaults,...e.defaults},interaction:{...r.interaction,...e.interaction},behavior:{...r.behavior,...e.behavior},...r.clickBehavior||e.clickBehavior?{clickBehavior:{...r.clickBehavior,...e.clickBehavior}}:{}}):n.set(e.id,e)}),{documents:{},activeDocumentId:null,tools:Array.from(n.values()).map(t=>({...t,behavior:{...t.behavior,deactivateToolAfterCreate:t.behavior?.deactivateToolAfterCreate??e.deactivateToolAfterCreate??!1,selectAfterCreate:t.behavior?.selectAfterCreate??e.selectAfterCreate??!0,editAfterCreate:t.behavior?.editAfterCreate??e.editAfterCreate??!1}})),colorPresets:e.colorPresets??wf}})(t)};function Rf(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}function zf(e,t){this.props=e,this.context=t}(zf.prototype=new ge).isPureReactComponent=!0,zf.prototype.shouldComponentUpdate=function(e,t){return Rf(this.props,e)||Rf(this.state,t)};var Bf=D.__b;D.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Bf&&Bf(e)};var Vf=D.__e;D.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e??(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}Vf(e,t,n,r)};var Hf=D.unmount;function Uf(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=function(e,t){for(var n in t)e[n]=t[n];return e}({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Uf(e,t,n)})),e}function Wf(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Wf(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Gf(){this.__u=0,this.o=null,this.__b=null}function Kf(e){if(!e.__)return null;var t=e.__.__c;return t&&t.__a&&t.__a(e)}function qf(){this.i=null,this.l=null}D.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Hf&&Hf(e)},(Gf.prototype=new ge).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=Kf(r.__v),a=!1,o=function(){a||r.__z||(a=!0,n.__R=null,i?i(c):c())};n.__R=o;var s=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Wf(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},Gf.prototype.componentWillUnmount=function(){this.o=[]},Gf.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(`div`),r=this.__v.__k[0].__c;this.__v.__k[0]=Uf(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&k(A,null,e.fallback);return i&&(i.__u&=-33),[k(A,null,t.__a?null:e.children),i]};var Jf=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==`t`||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function Yf(e){return this.getChildContext=function(){return e.context},e.children}function Xf(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){Ie(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;r!==null&&!r.__m&&r.__!==null;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}Ie(k(Yf,{context:t.context},e.__v),t.v)}function Zf(e,t){var n=k(Xf,{__v:e,h:t});return n.containerInfo=t,n}(qf.prototype=new ge).__a=function(e){var t=this,n=Kf(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),Jf(t,e,r)):i()};n?n(a):a()}},qf.prototype.render=function(e){this.i=null,this.l=new Map;var t=Ce(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},qf.prototype.componentDidUpdate=qf.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Jf(e,n,t)})};var Qf=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,$f=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ep=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,tp=/[A-Z0-9]/g,np=typeof document<`u`,rp=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};ge.prototype.isReactComponent={},[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(ge.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ip=D.event;function ap(){}function op(){return this.cancelBubble}function sp(){return this.defaultPrevented}D.event=function(e){return ip&&(e=ip(e)),e.persist=ap,e.isPropagationStopped=op,e.isDefaultPrevented=sp,e.nativeEvent=e};var cp={enumerable:!1,configurable:!0,get:function(){return this.class}},lp=D.vnode;D.vnode=function(e){typeof e.type==`string`&&function(e){var t=e.props,n=e.type,r={},i=n.indexOf(`-`)===-1;for(var a in t){var o=t[a];if(!(a===`value`&&`defaultValue`in t&&o==null||np&&a===`children`&&n===`noscript`||a===`class`||a===`className`)){var s=a.toLowerCase();a===`defaultValue`&&`value`in t&&t.value==null?a=`value`:a===`download`&&!0===o?o=``:s===`translate`&&o===`no`?o=!1:s[0]===`o`&&s[1]===`n`?s===`ondoubleclick`?a=`ondblclick`:s!==`onchange`||n!==`input`&&n!==`textarea`||rp(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:ep.test(a)&&(a=s):s=a=`oninput`:i&&$f.test(a)?a=a.replace(tp,`-$&`).toLowerCase():o===null&&(o=void 0),s===`oninput`&&r[a=s]&&(a=`oninputCapture`),r[a]=o}}n==`select`&&r.multiple&&Array.isArray(r.value)&&(r.value=Ce(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),n==`select`&&r.defaultValue!=null&&(r.value=Ce(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",cp)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=Qf,lp&&lp(e)};var up=D.__r;D.__r=function(e){up&&up(e),e.__c};var dp=D.diffed;D.diffed=function(e){dp&&dp(e);var t=e.props,n=e.__e;n!=null&&e.type===`textarea`&&`value`in t&&t.value!==n.value&&(n.value=t.value==null?``:t.value)};var fp=`INTERACTION/INIT_STATE`,pp=`INTERACTION/CLEANUP_STATE`,mp=`INTERACTION/ACTIVATE_MODE`,hp=`INTERACTION/PAUSE`,gp=`INTERACTION/RESUME`,_p=`INTERACTION/SET_CURSOR`,vp=`INTERACTION/SET_DEFAULT_MODE`,yp=`INTERACTION/SET_EXCLUSION_RULES`,bp=`INTERACTION/ADD_EXCLUSION_CLASS`,xp=`INTERACTION/REMOVE_EXCLUSION_CLASS`,Sp=`INTERACTION/ADD_EXCLUSION_ATTRIBUTE`,Cp=`INTERACTION/REMOVE_EXCLUSION_ATTRIBUTE`;function wp(e){return{type:vp,payload:{mode:e}}}function Tp(e){return{type:yp,payload:{rules:e}}}var Ep=`pointerMode`,Dp=class extends Rr{constructor(e,t,n){super(e,t),this.modes=new Map,this.cursorClaims=new Map,this.buckets=new Map,this.alwaysGlobal=new Map,this.alwaysPage=new Map,this.pageActivities=new Map,this.onModeChange$=Kr(),this.onHandlerChange$=Kr(),this.onCursorChange$=Kr(),this.onStateChange$=J(),this.onPageActivityChange$=Kr(),this.registerMode({id:Ep,scope:`page`,exclusive:!1,cursor:`auto`}),this.dispatch(wp(Ep)),n.exclusionRules&&this.dispatch(Tp(n.exclusionRules))}onDocumentLoadingStarted(e){let t={activeMode:this.state.defaultMode,cursor:`auto`,paused:!1};this.dispatch(function(e,t){return{type:fp,payload:{documentId:e,state:t}}}(e,t)),this.cursorClaims.set(e,new Map),this.buckets.set(e,new Map),this.alwaysGlobal.set(e,new Set),this.alwaysPage.set(e,new Map),this.pageActivities.set(e,new Map);let n=this.buckets.get(e);for(let e of this.modes.keys())n.set(e,{global:new Set,page:new Map});this.logger.debug(`InteractionManagerPlugin`,`DocumentOpened`,`Initialized interaction state for document: ${e}`)}onDocumentClosed(e){let t=this.pageActivities.get(e);if(t){let n=new Set(t.values());t.clear();for(let t of n)this.onPageActivityChange$.emit({documentId:e,pageIndex:t,hasActivity:!1})}this.cursorClaims.delete(e),this.buckets.delete(e),this.alwaysGlobal.delete(e),this.alwaysPage.delete(e),this.pageActivities.delete(e),this.dispatch(function(e){return{type:pp,payload:e}}(e)),this.logger.debug(`InteractionManagerPlugin`,`DocumentClosed`,`Cleaned up interaction state for document: ${e}`)}buildCapability(){return{getActiveMode:()=>this.getActiveMode(),getActiveInteractionMode:()=>this.getActiveInteractionMode(),activate:e=>this.activate(e),activateDefaultMode:()=>this.activateDefaultMode(),setCursor:(e,t,n)=>this.setCursor(e,t,n),getCurrentCursor:()=>this.getCurrentCursor(),removeCursor:e=>this.removeCursor(e),getHandlersForScope:e=>this.getHandlersForScope(e),activeModeIsExclusive:()=>this.activeModeIsExclusive(),pause:()=>this.pause(),resume:()=>this.resume(),isPaused:()=>this.registry.isDestroyed()||this.isPaused(),getState:()=>this.getDocumentStateOrThrow(),forDocument:e=>this.createInteractionScope(e),registerMode:e=>this.registerMode(e),registerHandlers:e=>this.registerHandlers(e),registerAlways:e=>this.registerAlways(e),setDefaultMode:e=>this.setDefaultMode(e),getDefaultMode:()=>this.state.defaultMode,getExclusionRules:()=>this.state.exclusionRules,setExclusionRules:e=>this.dispatch(Tp(e)),addExclusionClass:e=>this.dispatch(function(e){return{type:bp,payload:{className:e}}}(e)),removeExclusionClass:e=>this.dispatch(function(e){return{type:xp,payload:{className:e}}}(e)),addExclusionAttribute:e=>this.dispatch(function(e){return{type:Sp,payload:{attribute:e}}}(e)),removeExclusionAttribute:e=>this.dispatch(function(e){return{type:Cp,payload:{attribute:e}}}(e)),claimPageActivity:(e,t,n)=>this.claimPageActivity(e,t,n),releasePageActivity:(e,t)=>this.releasePageActivity(e,t),hasPageActivity:(e,t)=>this.hasPageActivity(e,t),onModeChange:this.onModeChange$.on,onCursorChange:this.onCursorChange$.on,onHandlerChange:this.onHandlerChange$.on,onStateChange:this.onStateChange$.on,onPageActivityChange:this.onPageActivityChange$.on}}createInteractionScope(e){return{getActiveMode:()=>this.getActiveMode(e),getActiveInteractionMode:()=>this.getActiveInteractionMode(e),activate:t=>this.activate(t,e),activateDefaultMode:()=>this.activateDefaultMode(e),setCursor:(t,n,r)=>this.setCursor(t,n,r,e),getCurrentCursor:()=>this.getCurrentCursor(e),removeCursor:t=>this.removeCursor(t,e),getHandlersForScope:e=>this.getHandlersForScope(e),activeModeIsExclusive:()=>this.activeModeIsExclusive(e),pause:()=>this.pause(e),resume:()=>this.resume(e),isPaused:()=>this.isPaused(e),getState:()=>this.getDocumentStateOrThrow(e),claimPageActivity:(t,n)=>this.claimPageActivity(e,t,n),releasePageActivity:t=>this.releasePageActivity(e,t),hasPageActivity:t=>this.hasPageActivity(e,t),onModeChange:t=>this.onModeChange$.on(n=>{n.documentId===e&&t(n.activeMode)}),onCursorChange:t=>this.onCursorChange$.on(n=>{n.documentId===e&&t(n.cursor)}),onStateChange:t=>this.onStateChange$.on(n=>{n.documentId===e&&t(n.state)}),onPageActivityChange:t=>this.onPageActivityChange$.on(n=>{n.documentId===e&&t({pageIndex:n.pageIndex,hasActivity:n.hasActivity})})}}getDocumentState(e){let t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){let t=this.getDocumentState(e);if(!t)throw Error(`Interaction state not found for document: ${e??`active`}`);return t}activate(e,t){var n;let r=t??this.getActiveDocumentId(),i=this.getDocumentStateOrThrow(r);if(!this.modes.has(e))throw Error(`[interaction] unknown mode '${e}'`);if(e===i.activeMode)return;let a=i.activeMode;(n=this.cursorClaims.get(r))==null||n.clear(),this.notifyHandlersInactive(r,a),this.dispatch(function(e,t){return{type:mp,payload:{documentId:e,mode:t}}}(r,e)),this.emitCursor(r),this.notifyHandlersActive(r,e),this.onModeChange$.emit({documentId:r,activeMode:e,previousMode:a})}activateDefaultMode(e){let t=e??this.getActiveDocumentIdOrNull();t&&this.activate(this.state.defaultMode,t)}setDefaultMode(e){if(!this.modes.has(e))throw Error(`[interaction] cannot set unknown mode '${e}' as default`);this.dispatch(wp(e))}getActiveMode(e){return this.getDocumentStateOrThrow(e).activeMode}getActiveInteractionMode(e){let t=this.getDocumentState(e);return t?this.modes.get(t.activeMode)??null:null}activeModeIsExclusive(e){return!!this.getActiveInteractionMode(e)?.exclusive}pause(e){let t=e??this.getActiveDocumentId();this.dispatch(function(e){return{type:hp,payload:e}}(t))}resume(e){let t=e??this.getActiveDocumentId();this.dispatch(function(e){return{type:gp,payload:e}}(t))}isPaused(e){return this.getDocumentStateOrThrow(e).paused}registerMode(e){this.modes.set(e.id,e);for(let t of this.buckets.keys()){let n=this.buckets.get(t);n.has(e.id)||n.set(e.id,{global:new Set,page:new Map})}}registerHandlers({documentId:e,modeId:t,handlers:n,pageIndex:r}){let i=Array.isArray(t)?t:[t],a=[],o=this.buckets.get(e);if(!o)throw Error(`No buckets found for document: ${e}`);for(let e of i){let t=o.get(e);if(!t)throw Error(`unknown mode '${e}'`);if(r==null)t.global.add(n);else{let e=t.page.get(r)??new Set;e.add(n),t.page.set(r,e)}a.push(()=>{if(r==null)t.global.delete(n);else{let e=t.page.get(r);e&&(e.delete(n),e.size===0&&t.page.delete(r))}})}return this.onHandlerChange$.emit({...this.state}),()=>{a.forEach(e=>e()),this.onHandlerChange$.emit({...this.state})}}registerAlways({scope:e,handlers:t}){if(e.type===`global`){let n=this.alwaysGlobal.get(e.documentId)??new Set;return n.add(t),this.alwaysGlobal.set(e.documentId,n),this.onHandlerChange$.emit({...this.state}),()=>{n.delete(t),this.onHandlerChange$.emit({...this.state})}}let n=this.alwaysPage.get(e.documentId)??new Map,r=n.get(e.pageIndex)??new Set;return r.add(t),n.set(e.pageIndex,r),this.alwaysPage.set(e.documentId,n),this.onHandlerChange$.emit({...this.state}),()=>{r.delete(t),this.onHandlerChange$.emit({...this.state})}}getHandlersForScope(e){let t=this.getDocumentState(e.documentId);if(!t)return null;let n=this.modes.get(t.activeMode);if(!n)return null;let r=this.buckets.get(e.documentId);if(!r)return null;let i=r.get(n.id);if(!i)return null;let a=(e,t)=>e.size||t.size?function(e){let t=[`onPointerDown`,`onPointerUp`,`onPointerMove`,`onPointerEnter`,`onPointerLeave`,`onPointerCancel`,`onMouseDown`,`onMouseUp`,`onMouseMove`,`onMouseEnter`,`onMouseLeave`,`onMouseCancel`,`onClick`,`onDoubleClick`],n={};for(let r of t)n[r]=(t,n,i)=>{var a;for(let o of e){if(n.isImmediatePropagationStopped())break;(a=o[r])==null||a.call(o,t,n,i)}};return n}([...e,...t]):null;return e.type===`global`?a(this.alwaysGlobal.get(e.documentId)??new Set,n.scope===`global`?i.global:new Set):a(this.alwaysPage.get(e.documentId)?.get(e.pageIndex)??new Set,n.scope===`page`?i.page.get(e.pageIndex)??new Set:new Set)}setCursor(e,t,n=0,r){let i=r??this.getActiveDocumentId(),a=this.cursorClaims.get(i);a&&(a.set(e,{cursor:t,priority:n}),this.emitCursor(i))}removeCursor(e,t){let n=t??this.getActiveDocumentId(),r=this.cursorClaims.get(n);r&&(r.delete(e),this.emitCursor(n))}getCurrentCursor(e){return this.getDocumentStateOrThrow(e).cursor}emitCursor(e){let t=this.cursorClaims.get(e);if(!t)return;let n=this.getDocumentState(e);if(!n)return;let r=[...t.values()].sort((e,t)=>t.priority-e.priority)[0]??{cursor:this.modes.get(n.activeMode)?.cursor??`auto`};r.cursor!==n.cursor&&(this.dispatch(function(e,t){return{type:_p,payload:{documentId:e,cursor:t}}}(e,r.cursor)),this.onCursorChange$.emit({documentId:e,cursor:r.cursor}))}claimPageActivity(e,t,n){let r=this.pageActivities.get(e);r||(r=new Map,this.pageActivities.set(e,r));let i=r.get(t);i!==n&&(r.set(t,n),i===void 0||this.pageHasAnyTopic(e,i)||this.onPageActivityChange$.emit({documentId:e,pageIndex:i,hasActivity:!1}),this.countTopicsOnPage(e,n)===1&&this.onPageActivityChange$.emit({documentId:e,pageIndex:n,hasActivity:!0}))}releasePageActivity(e,t){let n=this.pageActivities.get(e);if(!n)return;let r=n.get(t);r!==void 0&&(n.delete(t),this.pageHasAnyTopic(e,r)||this.onPageActivityChange$.emit({documentId:e,pageIndex:r,hasActivity:!1}))}hasPageActivity(e,t){return this.pageHasAnyTopic(e,t)}pageHasAnyTopic(e,t){let n=this.pageActivities.get(e);if(!n)return!1;for(let e of n.values())if(e===t)return!0;return!1}countTopicsOnPage(e,t){let n=this.pageActivities.get(e);if(!n)return 0;let r=0;for(let e of n.values())e===t&&r++;return r}notifyHandlersActive(e,t){var n,r;(n=this.alwaysGlobal.get(e))==null||n.forEach(e=>{var n;(n=e.onHandlerActiveStart)==null||n.call(e,t)}),(r=this.alwaysPage.get(e))==null||r.forEach(e=>{e.forEach(e=>{var n;(n=e.onHandlerActiveStart)==null||n.call(e,t)})});let i=this.modes.get(t);if(!i)return;let a=this.buckets.get(e);if(!a)return;let o=a.get(t);o&&(i.scope===`global`&&o.global.forEach(e=>{var n;(n=e.onHandlerActiveStart)==null||n.call(e,t)}),i.scope===`page`&&o.page.forEach(e=>{e.forEach(e=>{var n;(n=e.onHandlerActiveStart)==null||n.call(e,t)})}))}notifyHandlersInactive(e,t){var n,r;(n=this.alwaysGlobal.get(e))==null||n.forEach(e=>{var n;(n=e.onHandlerActiveEnd)==null||n.call(e,t)}),(r=this.alwaysPage.get(e))==null||r.forEach(e=>{e.forEach(e=>{var n;(n=e.onHandlerActiveEnd)==null||n.call(e,t)})});let i=this.modes.get(t);if(!i)return;let a=this.buckets.get(e);if(!a)return;let o=a.get(t);o&&(i.scope===`global`&&o.global.forEach(e=>{var n;(n=e.onHandlerActiveEnd)==null||n.call(e,t)}),i.scope===`page`&&o.page.forEach(e=>{e.forEach(e=>{var n;(n=e.onHandlerActiveEnd)==null||n.call(e,t)})}))}onStoreUpdated(e,t){for(let n in t.documents){let r=e.documents[n],i=t.documents[n];r!==i&&this.onStateChange$.emit({documentId:n,state:i})}}async initialize(e){this.logger.info(`InteractionManagerPlugin`,`Initialize`,`Interaction Manager Plugin initialized`)}async destroy(){this.pageActivities.clear(),this.onModeChange$.clear(),this.onCursorChange$.clear(),this.onHandlerChange$.clear(),this.onStateChange$.clear(),this.onPageActivityChange$.clear(),await super.destroy()}};Dp.id=`interaction-manager`;var Op=Dp,kp=`interaction-manager`,Ap={defaultMode:`pointerMode`,exclusionRules:{classes:[],dataAttributes:[`data-no-interaction`]},documents:{},activeDocumentId:null},jp={manifest:{id:kp,name:`Interaction Manager Plugin`,version:`1.0.0`,provides:[`interaction-manager`],requires:[],optional:[],defaultConfig:{exclusionRules:{classes:[],dataAttributes:[`data-no-interaction`]}}},create:(e,t)=>new Op(kp,e,t),reducer:(e=Ap,t)=>{switch(t.type){case fp:{let{documentId:n,state:r}=t.payload;return{...e,documents:{...e.documents,[n]:r},activeDocumentId:e.activeDocumentId??n}}case pp:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case`INTERACTION/SET_ACTIVE_DOCUMENT`:return{...e,activeDocumentId:t.payload};case mp:{let{documentId:n,mode:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,activeMode:r}}}:e}case _p:{let{documentId:n,cursor:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,cursor:r}}}:e}case hp:{let n=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:{...r,paused:!0}}}:e}case gp:{let n=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:{...r,paused:!1}}}:e}case vp:return{...e,defaultMode:t.payload.mode};case yp:return{...e,exclusionRules:t.payload.rules};case bp:return{...e,exclusionRules:{...e.exclusionRules,classes:[...e.exclusionRules.classes||[],t.payload.className].filter((e,t,n)=>n.indexOf(e)===t)}};case xp:return{...e,exclusionRules:{...e.exclusionRules,classes:(e.exclusionRules.classes||[]).filter(e=>e!==t.payload.className)}};case Sp:return{...e,exclusionRules:{...e.exclusionRules,dataAttributes:[...e.exclusionRules.dataAttributes||[],t.payload.attribute].filter((e,t,n)=>n.indexOf(e)===t)}};case Cp:return{...e,exclusionRules:{...e.exclusionRules,dataAttributes:(e.exclusionRules.dataAttributes||[]).filter(e=>e!==t.payload.attribute)}};default:return e}},initialState:Ap},Mp=()=>ei(Op.id),Np={pointerdown:`onPointerDown`,pointerup:`onPointerUp`,pointermove:`onPointerMove`,pointerenter:`onPointerEnter`,pointerleave:`onPointerLeave`,pointercancel:`onPointerCancel`,mousedown:`onMouseDown`,mouseup:`onMouseUp`,mousemove:`onMouseMove`,mouseenter:`onMouseEnter`,mouseleave:`onMouseLeave`,mousecancel:`onMouseCancel`,click:`onClick`,dblclick:`onDoubleClick`,touchstart:`onPointerDown`,touchend:`onPointerUp`,touchmove:`onPointerMove`,touchcancel:`onPointerCancel`},Pp=[`pointerdown`,`pointerup`,`pointermove`,`pointerenter`,`pointerleave`,`pointercancel`,`mousedown`,`mouseup`,`mousemove`,`mouseenter`,`mouseleave`,`mousecancel`,`click`,`dblclick`],Fp=typeof PointerEvent<`u`?Pp:[...Pp,`touchstart`,`touchend`,`touchmove`,`touchcancel`];function Ip(e){return typeof TouchEvent<`u`&&e instanceof TouchEvent}function Lp(e,t,n,r){let i=e.forDocument(t.documentId),a=e.getHandlersForScope(t),o=()=>!1!==i.getActiveInteractionMode()?.wantsRawTouch,s={},c=o(),l=e=>{Fp.forEach(t=>{let r=s[t]??(s[t]=_);var i;n.addEventListener(t,r,(i=e,t.startsWith(`touch`)?{passive:!i}:{passive:!1}))})},u=()=>{Fp.forEach(e=>{let t=s[e];t&&n.removeEventListener(e,t)})};l(c),n.style.touchAction=c?`none`:``;let d=i.onModeChange(()=>{if(t.type===`global`){let e=i.getActiveInteractionMode();n.style.cursor=e?.scope===`global`?e.cursor??`auto`:`auto`}a=e.getHandlersForScope(t);let r=o();r!==c&&(u(),l(r),c=r,n.style.touchAction=c?`none`:``)}),f=e.onHandlerChange(()=>{a=e.getHandlersForScope(t)}),p=i.getActiveInteractionMode(),m=i.getCurrentCursor();n.style.cursor=t.type===`global`&&p?.scope!==`global`?`auto`:m;let h=i.onCursorChange(e=>{t.type===`global`&&i.getActiveInteractionMode()?.scope!==`global`||(n.style.cursor=e)}),g=(e,t)=>{if(r)return r(e,t);let n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}};function _(t){var r;if(e.isPaused())return;let o=e.getExclusionRules();if(t.target&&function(e,t){if(!e)return!1;let n=e;for(;n;){if(t.classes?.length){for(let e of t.classes)if(n.classList?.contains(e))return!0}if(t.dataAttributes?.length){for(let e of t.dataAttributes)if(n.hasAttribute(e))return!0}n=n.parentElement}return!1}(t.target,o))return;let s=Np[t.type];if(!s||!a?.[s])return;let l,u;Ip(t)&&c&&(t.type===`touchmove`||t.type===`touchcancel`)&&t.preventDefault();let d=!1;if(Ip(t)){let e=t.type===`touchend`||t.type===`touchcancel`?t.changedTouches[0]:t.touches[0];if(!e)return;l=g(e,n),u={clientX:e.clientX,clientY:e.clientY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,target:t.target,currentTarget:t.currentTarget,setPointerCapture:()=>{},releasePointerCapture:()=>{},stopImmediatePropagation:()=>{d=!0},isImmediatePropagationStopped:()=>d}}else{let e=t;l=g(e,n),u={clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,target:e.target,currentTarget:e.currentTarget,setPointerCapture:()=>{var t,n;(n=(t=e.target)?.setPointerCapture)==null||n.call(t,e.pointerId)},releasePointerCapture:()=>{var t,n;(n=(t=e.target)?.releasePointerCapture)==null||n.call(t,e.pointerId)},stopImmediatePropagation:()=>{d=!0},isImmediatePropagationStopped:()=>d}}(r=a[s])==null||r.call(a,l,u,i.getActiveMode())}return()=>{u(),d(),h(),f()}}var Rp=({children:e,documentId:t,style:n,...r})=>{let i=N(null),{provides:a}=Mp();return M(()=>{if(a&&i.current)return Lp(a,{type:`global`,documentId:t},i.current)},[a,t]),I(`div`,{ref:i,style:{width:`100%`,height:`100%`,...n},...r,children:e})},zp=({documentId:e,pageIndex:t,children:n,rotation:r,scale:i,convertEventToPoint:a,style:o,...s})=>{let c=N(null),{provides:l}=Mp(),u=function(e){let{provides:t}=Mp(),[n,r]=j(()=>{if(!t)return!1;let n=t.forDocument(e).getActiveInteractionMode();return n?.scope===`page`&&!!n.exclusive});return M(()=>{if(!t)return;let n=t.forDocument(e);return n.onModeChange(()=>{let e=n.getActiveInteractionMode();r(e?.scope===`page`&&!!e?.exclusive)})},[t,e]),n}(e),d=ni(e),f=d?.document?.pages?.[t],p=f?.size??{width:0,height:0},m=f?.rotation??0,h=d?.rotation??0,g=r===void 0?(m+h)%4:r,_=i??d?.scale??1,v=ht(p,0,_),y=F((e,t)=>{let n=t.getBoundingClientRect(),r={x:e.clientX-n.left,y:e.clientY-n.top};return function(e,t,n,r){return yt(vt(e,t,(4-n)%4),1/r)}(ht({width:v.width,height:v.height},g,1),r,g,_)},[p,g,_]);return M(()=>{if(l&&c.current)return Lp(l,{type:`page`,documentId:e,pageIndex:t},c.current,a||y)},[l,e,t,a,y]),I(`div`,{ref:c,style:{position:`relative`,width:v.width,height:v.height,...o},...s,children:[n,u&&I(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,zIndex:10}})]})},Bp={},Vp=Le(null),Hp=Le([]);function Up(e){let t=et(Vp),n=N(e);M(()=>{if(t)return t(n.current)},[t])}function Wp(){return et(Hp)}var Gp=()=>$r(Af.id),Kp=()=>ei(Af.id),qp=e=>{let{provides:t}=Kp(),[n,r]=j((t?.forDocument(e))?.getState()??Ef());return M(()=>{if(!t)return;let n=t.forDocument(e);return r(n.getState()),n.onStateChange(e=>{r(e)})},[t,e]),{state:n,provides:t?.forDocument(e)??null}},Jp;function Yp(){return Jp===void 0&&(Jp=function(){try{let e=navigator;return/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&e?.maxTouchPoints>1}catch{return!1}}()),Jp}function Xp(e,t){let n=Yp();return P(()=>{let r=n&&t&&e>0&&e<16,i=r?e/16:1;return{needsComp:r,adjustedFontPx:r?16:e,scaleComp:i,wrapperStyle:r?{width:100/i+`%`,height:100/i+`%`,transform:`scale(${i})`,transformOrigin:`top left`}:void 0}},[n,t,e])}function Zp({appearance:e,style:t}){let[n,r]=j(null),i=N(null);return M(()=>{let t=URL.createObjectURL(e.data);return r(t),i.current=t,()=>{i.current&&=(URL.revokeObjectURL(i.current),null)}},[e.data]),n?I(`img`,{src:n,onLoad:()=>{i.current&&=(URL.revokeObjectURL(i.current),null)},style:{position:`absolute`,width:`100%`,height:`100%`,display:`block`,pointerEvents:`none`,userSelect:`none`,...t}}):null}function Qp({scale:e,documentId:t,pageIndex:n,rotation:r,pageWidth:i,pageHeight:a,trackedAnnotation:o,children:s,isSelected:c,isEditing:l=!1,isMultiSelected:u=!1,isDraggable:d,isResizable:f,isRotatable:p=!0,lockAspectRatio:m=!1,style:h={},blendMode:g,vertexConfig:_,selectionMenu:v,structurallyLocked:y=!1,contentLocked:b=!1,outlineOffset:x=1,onDoubleClick:S,onSelect:C,appearance:w,zIndex:T=1,resizeUI:E,vertexUI:D,rotationUI:O,selectionOutlineColor:ee,selectionOutline:te,customAnnotationRenderer:ne,groupSelectionMenu:re,groupSelectionOutline:ie,annotationRenderers:ae,...oe}){let[se,ce]=j(o.object),[le,ue]=j(null),[de,fe]=j(null),[pe,me]=j(!1),[k,he]=j(!1),{provides:ge}=Kp(),{plugin:_e}=Gp(),{canModifyAnnotations:ve}=si(t),ye=N(null),be=ve&&d&&!u,xe=ve&&f&&!u,Se=ve&&p&&!u,Ce=P(()=>ge?ge.forDocument(t):null,[ge,t]),we=se?{...o.object,...se}:o.object,Te=o.object.flags??[],Ee=Te.includes(`noZoom`),De=Te.includes(`noRotate`),Oe=Ee?1:e,ke=De?0:r,Ae=E?.color??`#007ACC`,je=D?.color??`#007ACC`,Me=O?.color??`white`,Ne=O?.connectorColor??`#007ACC`,Pe=E?.size??12,Fe=D?.size??12,Ie=O?.size??32,Le=O?.margin,Re=O?.iconColor??`#007ACC`,ze=O?.showConnector??!1,Be=O?.border?.color??`#007ACC`,Ve=O?.border?.width??1,He=O?.border?.style??`solid`,Ue=te?.color??ee??`#007ACC`,We=te?.style??`solid`,Ge=te?.width??1,Ke=te?.offset??x??1,qe=le??we.rotation??0,Je=le??we.rotation??0,Ye=Number.isFinite(Je)?Math.round(10*Je)/10:0,Xe=le!==null,Ze=N(null),Qe=F(e=>{if(!e.transformData?.type||u||!_e)return;let{type:r,changes:s,metadata:c}=e.transformData,l=o.object.id,d={width:i,height:a};if(e.state===`start`&&(Ze.current=o.object.unrotatedRect??o.object.rect,ye.current=o.object,r!==`resize`&&r!==`vertex-edit`||he(!0),r===`move`?_e.startDrag(t,{annotationIds:[l],pageSize:d}):r===`resize`&&_e.startResize(t,{annotationIds:[l],pageSize:d,resizeHandle:c?.handle??`se`})),s.rect&&Ze.current){if(r===`move`){let e={x:s.rect.origin.x-Ze.current.origin.x,y:s.rect.origin.y-Ze.current.origin.y};_e.updateDrag(t,e)}else r===`resize`&&_e.updateResize(t,s.rect)}if(r===`vertex-edit`&&s.vertices&&_){let t=ye.current??o.object,i=_.transformAnnotation(t,s.vertices),a=ge?.transformAnnotation(t,{type:r,changes:i,metadata:c});a&&(ce(e=>({...e,...a})),e.state===`end`&&Ce?.updateAnnotation(n,l,a))}if(r===`rotate`){let n=c?.rotationAngle??qe,r=c?.cursorPosition;r&&fe({x:r.clientX,y:r.clientY}),e.state===`start`?(ue(n),_e.startRotation(t,{annotationIds:[l],cursorAngle:n,rotationCenter:c?.rotationCenter})):e.state===`move`?(ue(n),_e.updateRotation(t,n,c?.rotationDelta)):e.state===`end`&&(ue(null),fe(null),_e.commitRotation(t));return}e.state===`end`&&(Ze.current=null,ye.current=null,he(!1),r===`move`?_e.commitDrag(t):r===`resize`&&_e.commitResize(t))},[_e,t,o.object,i,a,n,u,_,ge,Ce,qe]),$e=we.unrotatedRect,et=$e??we.rect,tt=$e&&qe!==0?Pt(et,we.rect,qe):void 0,{dragProps:nt,vertices:rt,resize:it,rotation:at}=il({controller:{element:et,vertices:_?.extractVertices(we),constraints:{minWidth:10,minHeight:10,boundingBox:{width:i,height:a}},maintainAspectRatio:m,pageRotation:r,annotationRotation:qe,rotationCenter:tt,rotationElement:we.rect,scale:e,enabled:c&&!u,onUpdate:Qe},resizeUI:{handleSize:Pe,spacing:Ke,offsetMode:`outside`,includeSides:!m,zIndex:T+1},vertexUI:{vertexSize:Fe,zIndex:T+2},rotationUI:{handleSize:Ie,margin:Le,zIndex:T+3,showConnector:ze},includeVertices:!!_,includeRotation:Se,currentRotation:qe}),ot=function(e,{delay:t=300,tolerancePx:n=18}={}){let r=N({t:0,x:0,y:0}),i=F(i=>{if(!e||i.pointerType===`mouse`||!1===i.isPrimary)return;let a=performance.now(),o=i.clientX,s=i.clientY,c=a-r.current.t<=t,l=o-r.current.x,u=s-r.current.y;c&&l*l+u*u<=n*n&&e?.(i),r.current={t:a,x:o,y:s}},[e,t,n]),a=F(t=>{e?.(t)},[e]);return e?{[Jc]:a,onPointerUpCapture:i}:{}}(P(()=>{if(ve&&S)return S},[ve,S]));M(()=>{ce(o.object)},[o.object]),M(()=>{if(!_e)return;let e=o.object.id,n=n=>{if(n.documentId!==t)return;n.type!==`end`&&n.type!==`cancel`||ue(null);let r=n.previewPatches?.[e];n.type===`update`&&r?ce(e=>({...e,...r})):n.type===`cancel`&&ce(o.object)},r=[_e.onDragChange(n),_e.onResizeChange(n),_e.onRotateChange(n)];return()=>r.forEach(e=>e())},[_e,t,o.object]);let st=c&&!u,ct=we.rect.size.width*Oe,lt=we.rect.size.height*Oe,ut=et.size.width*Oe,dt=et.size.height*Oe,ft=!!$e&&qe!==0,pt=ft?(et.origin.x-we.rect.origin.x)*Oe:(ct-ut)/2,mt=ft?(et.origin.y-we.rect.origin.y)*Oe:(lt-dt)/2,ht=ft&&tt?`${(tt.x-et.origin.x)*Oe}px ${(tt.y-et.origin.y)*Oe}px`:`center center`,gt=tt?(tt.x-we.rect.origin.x)*Oe:ct/2,_t=tt?(tt.y-we.rect.origin.y)*Oe:lt/2,vt=Math.max(300,Math.max(ct,lt)+80),yt=De?qc({size:{width:ct,height:lt}},r):null,bt=P(()=>$e?{...we,rect:$e}:we,[we,$e]),xt=!(!w?.normal||k||l||o.dictMode),St={position:`absolute`,left:we.rect.origin.x*e,top:we.rect.origin.y*e,width:yt?yt.width:ct,height:yt?yt.height:lt,pointerEvents:`none`,zIndex:T,...yt&&{transform:yt.matrix,transformOrigin:`0 0`}},Ct={position:`absolute`,left:pt,top:mt,width:ut,height:dt,transform:qe===0?void 0:`rotate(${qe}deg)`,transformOrigin:ht};return I(`div`,{"data-no-interaction":!0,children:[I(`div`,{style:{...St,...g&&{mixBlendMode:g},...h},children:I(`div`,{style:{...Ct,pointerEvents:l?`auto`:`none`},children:[(()=>{let t=typeof s==`function`?s(bt,{appearanceActive:xt}):s;return ne?.({annotation:bt,children:t,isSelected:c,scale:e,rotation:r,pageWidth:i,pageHeight:a,pageIndex:n,onSelect:C})??t})(),w?.normal&&I(Zp,{appearance:w.normal,style:{display:xt?`block`:`none`}})]})}),I(`div`,{style:St,...oe,children:[Xe&&I(A,{children:[I(`div`,{style:{position:`absolute`,left:gt-vt/2,top:_t,width:vt,height:1,backgroundColor:Ne,opacity:.35,pointerEvents:`none`}}),I(`div`,{style:{position:`absolute`,left:gt,top:_t-vt/2,width:1,height:vt,backgroundColor:Ne,opacity:.35,pointerEvents:`none`}}),I(`div`,{style:{position:`absolute`,left:gt-vt/2,top:_t,width:vt,height:1,transformOrigin:`center center`,transform:`rotate(${qe}deg)`,backgroundColor:Ne,opacity:.8,pointerEvents:`none`}})]}),c&&Se&&at&&(O?.component?I(`div`,{onPointerEnter:()=>me(!0),onPointerLeave:()=>{me(!1),fe(null)},onPointerMove:e=>{Xe||fe({x:e.clientX,y:e.clientY})},style:{display:`contents`},children:O.component({...at.handle,backgroundColor:Me,iconColor:Re,connectorStyle:{...at.connector.style,backgroundColor:Ne,opacity:+!Xe},showConnector:ze,opacity:+!Xe,border:{color:Be,width:Ve,style:He}})}):I(`div`,{onPointerEnter:()=>me(!0),onPointerLeave:()=>{me(!1),fe(null)},onPointerMove:e=>{Xe||fe({x:e.clientX,y:e.clientY})},style:{display:`contents`},children:[ze&&I(`div`,{style:{...at.connector.style,backgroundColor:Ne,opacity:+!Xe}}),I(`div`,{...at.handle,style:{...at.handle.style,backgroundColor:Me,border:`${Ve}px ${He} ${Be}`,boxSizing:`border-box`,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`auto`,opacity:+!Xe},children:I(`svg`,{width:Math.round(.6*Ie),height:Math.round(.6*Ie),viewBox:`0 0 24 24`,fill:`none`,stroke:Re,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[I(`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`}),I(`path`,{d:`M21 3v5h-5`})]})})]})),I(`div`,{...be&&c?nt:{},...ot,style:{...Ct,outline:st?`${Ge}px ${We} ${Ue}`:`none`,outlineOffset:st?`${Ke}px`:`0px`,pointerEvents:!c||u||l?`none`:`auto`,touchAction:`none`,cursor:c&&be?`move`:`default`},children:[c&&xe&&!Xe&&it.map(({key:e,...t})=>E?.component?E.component({key:e,...t,backgroundColor:Ae}):I(`div`,{...t,style:{...t.style,backgroundColor:Ae}},e)),c&&ve&&!u&&!Xe&&rt.map(({key:e,...t})=>D?.component?D.component({key:e,...t,backgroundColor:je}):I(`div`,{...t,style:{...t.style,backgroundColor:je}},e))]})]}),v&&!u&&!Xe&&I(Yc,{rect:{origin:{x:we.rect.origin.x*e,y:we.rect.origin.y*e},size:{width:we.rect.size.width*Oe,height:we.rect.size.height*Oe}},rotation:r,children:e=>{let t=((qe+90*ke)%360+360)%360;return v({...e,context:{type:`annotation`,annotation:o,pageIndex:n,structurallyLocked:y,contentLocked:b},selected:c,placement:{suggestTop:Se&&t>90&&t<270}})}}),(Xe||pe)&&de&&Zf(I(`div`,{style:{position:`fixed`,left:de.x+16,top:de.y-16,background:`rgba(0,0,0,0.8)`,color:`#fff`,padding:`4px 8px`,borderRadius:4,fontSize:12,fontFamily:`monospace`,pointerEvents:`none`,zIndex:1e4,whiteSpace:`nowrap`},children:[Ye.toFixed(0),`°`]}),document.body)]})}function $p(e,t,n,r,i){switch(i){case 1:return{x:t,y:r-e};case 2:return{x:n-e,y:r-t};case 3:return{x:n-t,y:e};default:return{x:e,y:t}}}function em(e,t,n){let r=e.object.flags??[],i=r.includes(`noZoom`),a=r.includes(`noRotate`),o=e.object.rect.origin.x*t,s=e.object.rect.origin.y*t,c=e.object.rect.size.width*(i?1:t),l=e.object.rect.size.height*(i?1:t);if(!a||n===0)return{left:o,top:s,right:o+c,bottom:s+l};let u=[$p(0,0,c,l,n),$p(c,0,c,l,n),$p(0,l,c,l,n),$p(c,l,c,l,n)],d=1/0,f=1/0,p=-1/0,m=-1/0;for(let e of u)e.x<d&&(d=e.x),e.y<f&&(f=e.y),e.x>p&&(p=e.x),e.y>m&&(m=e.y);return{left:o+d,top:s+f,right:o+p,bottom:s+m}}function tm({documentId:e,pageIndex:t,scale:n,rotation:r,pageWidth:i,pageHeight:a,selectedAnnotations:o,isDraggable:s,isResizable:c,isRotatable:l=!0,lockAspectRatio:u=!1,resizeUI:d,rotationUI:f,selectionOutlineColor:p,outlineOffset:m,selectionOutline:h,zIndex:g=2,groupSelectionMenu:_}){let{plugin:v}=Gp(),{canModifyAnnotations:y}=si(e),b=N(null),x=N(!1),S=N(!1),[C,w]=j(null),[T,E]=j(null),[D,O]=j(!1),ee=y&&s,te=y&&c,ne=y&&l,re=P(()=>function(e){return Dt(e)??Et}(o.map(e=>e.object.rect)),[o]),[ie,ae]=j(re);M(()=>{x.current||S.current||ae(re)},[re]),M(()=>{if(v)return v.onRotateChange(t=>{t.documentId===e&&(t.type!==`end`&&t.type!==`cancel`||w(null))})},[v,e]);let oe=F(t=>{if(!t.transformData?.type||!v)return;let n=t.transformData.type,r=n===`move`,s=n===`resize`;if(r&&!ee)return;if(t.state===`start`&&(b.current=re,r?(x.current=!0,v.startDrag(e,{annotationIds:o.map(e=>e.object.id),pageSize:{width:i,height:a}})):s&&(S.current=!0,v.startResize(e,{annotationIds:o.map(e=>e.object.id),pageSize:{width:i,height:a},resizeHandle:t.transformData.metadata?.handle??`se`}))),n===`rotate`){if(!l)return;let n=o.map(e=>e.object.id),r=t.transformData.metadata?.rotationAngle??0,i=t.transformData.metadata?.cursorPosition;i&&E({x:i.clientX,y:i.clientY}),t.state===`start`?(w(r),v.startRotation(e,{annotationIds:n,cursorAngle:r,rotationCenter:t.transformData.metadata?.rotationCenter})):t.state===`move`?(w(r),v.updateRotation(e,r,t.transformData.metadata?.rotationDelta)):t.state===`end`&&(w(null),E(null),v.commitRotation(e));return}let c=b.current??re;if(r&&t.transformData.changes.rect){let n=t.transformData.changes.rect,r={x:n.origin.x-c.origin.x,y:n.origin.y-c.origin.y},i=v.updateDrag(e,r);ae({...c,origin:{x:c.origin.x+i.x,y:c.origin.y+i.y}})}else if(s&&t.transformData.changes.rect){let n=t.transformData.changes.rect;v.updateResize(e,n),ae(n)}t.state===`end`&&(b.current=null,r&&x.current?(x.current=!1,v.commitDrag(e)):s&&S.current&&(S.current=!1,v.commitResize(e)))},[v,e,i,a,re,ee,o,l]),se=C??0,ce=C!==null,le=Number.isFinite(se)?Math.round(10*se)/10:0,ue=d?.color??`#007ACC`,de=d?.size??12,fe=f?.color??`white`,pe=f?.connectorColor??`#007ACC`,me=f?.size??32,k=f?.margin,he=f?.iconColor??`#007ACC`,ge=f?.showConnector??!1,_e=f?.border?.color??`#007ACC`,ve=f?.border?.width??1,ye=f?.border?.style??`solid`,be=h?.color??p??`#007ACC`,xe=h?.style??`dashed`,Se=h?.width??2,Ce=h?.offset??m??2,{dragProps:we,resize:Te,rotation:Ee}=il({controller:{element:ie,constraints:{minWidth:20,minHeight:20,boundingBox:{width:i,height:a}},maintainAspectRatio:u,pageRotation:r,scale:n,enabled:!0,onUpdate:oe},resizeUI:{handleSize:de,spacing:Ce,offsetMode:`outside`,includeSides:!u,zIndex:g+1},vertexUI:{vertexSize:0,zIndex:g},rotationUI:{handleSize:me,margin:k,zIndex:g+2,showConnector:ge},includeVertices:!1,includeRotation:ne,currentRotation:C??0});if(o.length<2)return null;let De=1/0,Oe=1/0,ke=-1/0,Ae=-1/0;for(let e of o){let t=em(e,n,r);De=Math.min(De,t.left),Oe=Math.min(Oe,t.top),ke=Math.max(ke,t.right),Ae=Math.max(Ae,t.bottom)}let je=De-re.origin.x*n,Me=Oe-re.origin.y*n,Ne=ke-(re.origin.x+re.size.width)*n,Pe=Ae-(re.origin.y+re.size.height)*n,Fe=ie.origin.x*n+je,Ie=ie.origin.y*n+Me,Le=ie.size.width*n+(Ne-je),Re=ie.size.height*n+(Pe-Me),ze=Le/2,Be=Re/2,Ve=Math.max(300,Math.max(Le,Re)+80);return I(`div`,{"data-group-selection-box":!0,"data-no-interaction":!0,children:[I(`div`,{style:{position:`absolute`,left:Fe,top:Ie,width:Le,height:Re,pointerEvents:`none`,zIndex:g},children:[ce&&I(A,{children:[I(`div`,{style:{position:`absolute`,left:ze-Ve/2,top:Be,width:Ve,height:1,backgroundColor:ue,opacity:.35,pointerEvents:`none`}}),I(`div`,{style:{position:`absolute`,left:ze,top:Be-Ve/2,width:1,height:Ve,backgroundColor:ue,opacity:.35,pointerEvents:`none`}}),I(`div`,{style:{position:`absolute`,left:ze-Ve/2,top:Be,width:Ve,height:1,transformOrigin:`center center`,transform:`rotate(${se}deg)`,backgroundColor:ue,opacity:.8,pointerEvents:`none`}})]}),ne&&Ee&&(f?.component?I(`div`,{onPointerEnter:()=>O(!0),onPointerLeave:()=>{O(!1),E(null)},onPointerMove:e=>{ce||E({x:e.clientX,y:e.clientY})},style:{display:`contents`},children:f.component({...Ee.handle,backgroundColor:fe,iconColor:he,connectorStyle:{...Ee.connector.style,backgroundColor:pe,opacity:+!ce},showConnector:ge,opacity:+!ce,border:{color:_e,width:ve,style:ye}})}):I(`div`,{onPointerEnter:()=>O(!0),onPointerLeave:()=>{O(!1),E(null)},onPointerMove:e=>{ce||E({x:e.clientX,y:e.clientY})},style:{display:`contents`},children:[ge&&I(`div`,{style:{...Ee.connector.style,backgroundColor:pe,opacity:+!ce}}),I(`div`,{...Ee.handle,style:{...Ee.handle.style,backgroundColor:fe,border:`${ve}px ${ye} ${_e}`,boxSizing:`border-box`,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`auto`,opacity:+!ce},children:I(`svg`,{width:Math.round(.6*me),height:Math.round(.6*me),viewBox:`0 0 24 24`,fill:`none`,stroke:he,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[I(`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`}),I(`path`,{d:`M21 3v5h-5`})]})})]})),I(`div`,{...ee?we:{onPointerDown:e=>e.stopPropagation()},style:{position:`absolute`,left:0,top:0,width:Le,height:Re,outline:ce?`none`:`${Se}px ${xe} ${be}`,outlineOffset:Ce-1,cursor:ee?`move`:`default`,touchAction:`none`,pointerEvents:`auto`},children:te&&!ce&&Te.map(({key:e,...t})=>d?.component?d.component({key:e,...t,backgroundColor:ue}):I(`div`,{...t,style:{...t.style,backgroundColor:ue}},e))})]}),(ce||D)&&T&&Zf(I(`div`,{style:{position:`fixed`,left:T.x+16,top:T.y-16,background:`rgba(0,0,0,0.8)`,color:`#fff`,padding:`4px 8px`,borderRadius:4,fontSize:12,fontFamily:`monospace`,pointerEvents:`none`,zIndex:1e4,whiteSpace:`nowrap`},children:[le.toFixed(0),`°`]}),document.body),_&&!ce&&I(Yc,{rect:{origin:{x:Fe,y:Ie},size:{width:Le,height:Re}},rotation:r,children:e=>{let n=((se+90*r)%360+360)%360;return _({...e,context:{type:`group`,annotations:o,pageIndex:t},selected:!0,placement:{suggestTop:ne&&n>90&&n<270}})}})]})}function nm(e){return{id:e.id,matches:e.matches?t=>e.matches(t):()=>!1,render:e.render?t=>e.render(t):()=>null,matchesPreview:e.matchesPreview,renderPreview:e.renderPreview?t=>e.renderPreview(t):void 0,previewContainerStyle:e.previewContainerStyle?t=>e.previewContainerStyle(t):void 0,vertexConfig:e.vertexConfig,zIndex:e.zIndex,defaultBlendMode:e.defaultBlendMode,containerStyle:e.containerStyle,interactionDefaults:e.interactionDefaults,useAppearanceStream:e.useAppearanceStream,isDraggable:e.isDraggable,onDoubleClick:e.onDoubleClick,selectOverride:e.selectOverride,hideSelectionMenu:e.hideSelectionMenu,hiddenWhenLocked:e.hiddenWhenLocked,renderLocked:e.renderLocked?t=>e.renderLocked(t):void 0}}function rm({isSelected:e,strokeColor:t,opacity:n=1,strokeWidth:r,inkList:i,rect:a,scale:o,onClick:s,appearanceActive:c=!1}){let l=t??`#000000`,u=P(()=>i.map(({points:e})=>{let t=``;return e.forEach(({x:e,y:n},r)=>{let i=e-a.origin.x,o=n-a.origin.y;t+=(r===0?`M`:`L`)+i+` `+o+` `}),t.trim()}),[i,a]),d=a.size.width*o,f=a.size.height*o,p=Math.max(r,20/o);return I(`svg`,{style:{position:`absolute`,width:d,height:f,pointerEvents:`none`,zIndex:2,overflow:`visible`},width:d,height:f,viewBox:`0 0 ${a.size.width} ${a.size.height}`,children:[u.map((t,n)=>I(`path`,{d:t,fill:`none`,stroke:`transparent`,strokeWidth:p,onPointerDown:s,style:{cursor:e?`move`:s?`pointer`:`default`,pointerEvents:s?e?`none`:`visibleStroke`:`none`,strokeLinecap:`round`,strokeLinejoin:`round`}},`hit-${n}`)),!c&&u.map((e,t)=>I(`path`,{d:e,fill:`none`,opacity:n,style:{pointerEvents:`none`,stroke:l,strokeWidth:r,strokeLinecap:`round`,strokeLinejoin:`round`}},`vis-${t}`))]})}function im({isSelected:e,color:t=`#000000`,strokeColor:n,opacity:r=1,strokeWidth:i,strokeStyle:a=un.SOLID,strokeDashArray:o,rect:s,scale:c,onClick:l,appearanceActive:u=!1,cloudyBorderIntensity:d,rectangleDifferences:f}){let p=(d??0)>0,{width:m,height:h,x:g,y:_}=P(()=>{let e=s.size.width,t=s.size.height;return{width:Math.max(e-i,0),height:Math.max(t-i,0),x:i/2,y:i/2}},[s,i]),v=P(()=>p?function(e,t,n,r){let i=new vd,a=0,o=0,s=e.width,c=e.height;return t?(a+=t.left,o+=t.top,s-=t.right,c-=t.bottom):(a+=r/2,o+=r/2,s-=r/2,c-=r/2),jd([{x:a,y:-o},{x:s,y:-o},{x:s,y:-c},{x:a,y:-c},{x:a,y:-o}],!1,n,r,i),i.close(),i.build(r)}({width:s.size.width,height:s.size.height},f,d,i):null,[p,s,f,d,i]),y=s.size.width*c,b=s.size.height*c,x=Math.max(i,20/c);return I(`svg`,{style:{position:`absolute`,width:y,height:b,pointerEvents:`none`,zIndex:2},width:y,height:b,viewBox:`0 0 ${s.size.width} ${s.size.height}`,overflow:`visible`,children:[p&&v?I(`path`,{d:v.path,fill:`transparent`,stroke:`transparent`,strokeWidth:x,onPointerDown:l,style:{cursor:e?`move`:l?`pointer`:`default`,pointerEvents:l?e?`none`:t===`transparent`?`visibleStroke`:`visible`:`none`}}):I(`rect`,{x:g,y:_,width:m,height:h,fill:`transparent`,stroke:`transparent`,strokeWidth:x,onPointerDown:l,style:{cursor:e?`move`:l?`pointer`:`default`,pointerEvents:l?e?`none`:t===`transparent`?`visibleStroke`:`visible`:`none`}}),!u&&(p&&v?I(`path`,{d:v.path,fill:t,opacity:r,style:{pointerEvents:`none`,stroke:n??t,strokeWidth:i,strokeLinejoin:`round`}}):I(`rect`,{x:g,y:_,width:m,height:h,fill:t,opacity:r,style:{pointerEvents:`none`,stroke:n??t,strokeWidth:i,...a===un.DASHED&&{strokeDasharray:o?.join(`,`)}}}))]})}function am({color:e=`#000000`,strokeColor:t,opacity:n=1,strokeWidth:r,strokeStyle:i=un.SOLID,strokeDashArray:a,rect:o,scale:s,onClick:c,isSelected:l,appearanceActive:u=!1,cloudyBorderIntensity:d,rectangleDifferences:f}){let p=(d??0)>0,{width:m,height:h,cx:g,cy:_,rx:v,ry:y}=P(()=>{let e=o.size.width,t=o.size.height,n=Math.max(e-r,0),i=Math.max(t-r,0);return{width:e,height:t,cx:r/2+n/2,cy:r/2+i/2,rx:n/2,ry:i/2}},[o,r]),b=P(()=>p?function(e,t,n,r){let i=new vd,a=0,o=0,s=e.width,c=e.height;return t&&(a+=t.left,o+=t.top,s-=t.right,c-=t.bottom),Pd(a,-c,s,-o,n,r,i),i.close(),i.build(r)}({width:o.size.width,height:o.size.height},f,d,r):null,[p,o,f,d,r]),x=m*s,S=h*s,C=Math.max(r,20/s);return I(`svg`,{style:{position:`absolute`,width:x,height:S,pointerEvents:`none`,zIndex:2},width:x,height:S,viewBox:`0 0 ${m} ${h}`,overflow:`visible`,children:[p&&b?I(`path`,{d:b.path,fill:`transparent`,stroke:`transparent`,strokeWidth:C,onPointerDown:c,style:{cursor:l?`move`:c?`pointer`:`default`,pointerEvents:c?l?`none`:e===`transparent`?`visibleStroke`:`visible`:`none`}}):I(`ellipse`,{cx:g,cy:_,rx:v,ry:y,fill:`transparent`,stroke:`transparent`,strokeWidth:C,onPointerDown:c,style:{cursor:l?`move`:c?`pointer`:`default`,pointerEvents:c?l?`none`:e===`transparent`?`visibleStroke`:`visible`:`none`}}),!u&&(p&&b?I(`path`,{d:b.path,fill:e,opacity:n,style:{pointerEvents:`none`,stroke:t??e,strokeWidth:r,strokeLinejoin:`round`}}):I(`ellipse`,{cx:g,cy:_,rx:v,ry:y,fill:e,opacity:n,style:{pointerEvents:`none`,stroke:t??e,strokeWidth:r,...i===un.DASHED&&{strokeDasharray:a?.join(`,`)}}}))]})}function om({color:e=`transparent`,opacity:t=1,strokeWidth:n,strokeColor:r=`#000000`,strokeStyle:i=un.SOLID,strokeDashArray:a,rect:o,linePoints:s,lineEndings:c,scale:l,onClick:u,isSelected:d,appearanceActive:f=!1}){let{x1:p,y1:m,x2:h,y2:g}=P(()=>({x1:s.start.x-o.origin.x,y1:s.start.y-o.origin.y,x2:s.end.x-o.origin.x,y2:s.end.y-o.origin.y}),[s,o]),_=P(()=>{let e=Math.atan2(g-m,h-p);return{start:Wd.createEnding(c?.start,n,e+Math.PI,p,m),end:Wd.createEnding(c?.end,n,e,h,g)}},[c,n,p,m,h,g]),v=o.size.width*l,y=o.size.height*l,b=Math.max(n,20/l);return I(`svg`,{style:{position:`absolute`,width:v,height:y,pointerEvents:`none`,zIndex:2,overflow:`visible`},width:v,height:y,viewBox:`0 0 ${o.size.width} ${o.size.height}`,children:[I(`line`,{x1:p,y1:m,x2:h,y2:g,stroke:`transparent`,strokeWidth:b,onPointerDown:u,style:{cursor:d?`move`:u?`pointer`:`default`,pointerEvents:u?d?`none`:`visibleStroke`:`none`,strokeLinecap:`butt`}}),_.start&&I(`path`,{d:_.start.d,transform:_.start.transform,fill:`transparent`,stroke:`transparent`,strokeWidth:b,onPointerDown:u,style:{cursor:d?`move`:u?`pointer`:`default`,pointerEvents:u?d?`none`:_.start.filled?`visible`:`visibleStroke`:`none`,strokeLinecap:`butt`}}),_.end&&I(`path`,{d:_.end.d,transform:_.end.transform,fill:`transparent`,stroke:`transparent`,strokeWidth:b,onPointerDown:u,style:{cursor:d?`move`:u?`pointer`:`default`,pointerEvents:u?d?`none`:_.end.filled?`visible`:`visibleStroke`:`none`,strokeLinecap:`butt`}}),!f&&I(A,{children:[I(`line`,{x1:p,y1:m,x2:h,y2:g,opacity:t,style:{pointerEvents:`none`,stroke:r,strokeWidth:n,strokeLinecap:`butt`,...i===un.DASHED&&{strokeDasharray:a?.join(`,`)}}}),_.start&&I(`path`,{d:_.start.d,transform:_.start.transform,stroke:r,fill:_.start.filled?e:`none`,style:{pointerEvents:`none`,strokeWidth:n,strokeLinecap:`butt`,...i===un.DASHED&&{strokeDasharray:a?.join(`,`)}}}),_.end&&I(`path`,{d:_.end.d,transform:_.end.transform,stroke:r,fill:_.end.filled?e:`none`,style:{pointerEvents:`none`,strokeWidth:n,strokeLinecap:`butt`,...i===un.DASHED&&{strokeDasharray:a?.join(`,`)}}})]})]})}function sm({rect:e,vertices:t,color:n=`transparent`,strokeColor:r=`#000000`,opacity:i=1,strokeWidth:a,strokeStyle:o=un.SOLID,strokeDashArray:s,scale:c,isSelected:l,onClick:u,lineEndings:d,appearanceActive:f=!1}){let p=P(()=>t.map(({x:t,y:n})=>({x:t-e.origin.x,y:n-e.origin.y})),[t,e]),m=P(()=>{if(!p.length)return``;let[e,...t]=p;return`M ${e.x} ${e.y} `+t.map(e=>`L ${e.x} ${e.y} `).join(``).trim()},[p]),h=P(()=>{if(p.length<2)return{start:null,end:null};let e=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),t=e(p[0],p[1]),n=e(p[p.length-2],p[p.length-1]);return{start:Wd.createEnding(d?.start,a,t+Math.PI,p[0].x,p[0].y),end:Wd.createEnding(d?.end,a,n,p[p.length-1].x,p[p.length-1].y)}},[p,d,a]),g=e.size.width*c,_=e.size.height*c,v=Math.max(a,20/c);return I(`svg`,{style:{position:`absolute`,width:g,height:_,pointerEvents:`none`,zIndex:2,overflow:`visible`},width:g,height:_,viewBox:`0 0 ${e.size.width} ${e.size.height}`,children:[I(`path`,{d:m,fill:`none`,stroke:`transparent`,strokeWidth:v,onPointerDown:u,style:{cursor:l?`move`:u?`pointer`:`default`,pointerEvents:u?l?`none`:`visibleStroke`:`none`,strokeLinecap:`butt`,strokeLinejoin:`miter`}}),h.start&&I(`path`,{d:h.start.d,transform:h.start.transform,fill:`transparent`,stroke:`transparent`,strokeWidth:v,onPointerDown:u,style:{cursor:l?`move`:u?`pointer`:`default`,pointerEvents:u?l?`none`:h.start.filled?`visible`:`visibleStroke`:`none`,strokeLinecap:`butt`}}),h.end&&I(`path`,{d:h.end.d,transform:h.end.transform,fill:`transparent`,stroke:`transparent`,strokeWidth:v,onPointerDown:u,style:{cursor:l?`move`:u?`pointer`:`default`,pointerEvents:u?l?`none`:h.end.filled?`visible`:`visibleStroke`:`none`,strokeLinecap:`butt`}}),!f&&I(A,{children:[I(`path`,{d:m,opacity:i,style:{fill:`none`,stroke:r??n,strokeWidth:a,pointerEvents:`none`,strokeLinecap:`butt`,strokeLinejoin:`miter`,...o===un.DASHED&&{strokeDasharray:s?.join(`,`)}}}),h.start&&I(`path`,{d:h.start.d,transform:h.start.transform,stroke:r,fill:h.start.filled?n:`none`,style:{pointerEvents:`none`,strokeWidth:a,strokeLinecap:`butt`,...o===un.DASHED&&{strokeDasharray:s?.join(`,`)}}}),h.end&&I(`path`,{d:h.end.d,transform:h.end.transform,stroke:r,fill:h.end.filled?n:`none`,style:{pointerEvents:`none`,strokeWidth:a,strokeLinecap:`butt`,...o===un.DASHED&&{strokeDasharray:s?.join(`,`)}}})]})]})}function cm({rect:e,vertices:t,color:n=`transparent`,strokeColor:r=`#000000`,opacity:i=1,strokeWidth:a,strokeStyle:o=un.SOLID,strokeDashArray:s,scale:c,isSelected:l,onClick:u,currentVertex:d,handleSize:f=14,appearanceActive:p=!1,cloudyBorderIntensity:m}){let h=(m??0)>0,g=d?[...t,d]:t,_=P(()=>g.map(({x:t,y:n})=>({x:t-e.origin.x,y:n-e.origin.y})),[g,e]),v=P(()=>{if(!_.length)return``;let[e,...t]=_,n=!!d;return(`M ${e.x} ${e.y} `+t.map(e=>`L ${e.x} ${e.y}`).join(` `)+(n?``:` Z`)).trim()},[_,d]),y=P(()=>!h||g.length<3?null:function(e,t,n,r){let i=new vd;if(e.length<3)return i.build(r);let a=e.map(e=>({x:e.x-t.x,y:-(e.y-t.y)})),o=a[0],s=a[a.length-1];return o.x===s.x&&o.y===s.y||a.push({x:o.x,y:o.y}),jd(a,!1,n,r,i),i.close(),i.build(r)}(g,e.origin,m,a),[h,g,e.origin,m,a]),b=d&&t.length>0,x=e.size.width*c,S=e.size.height*c,C=Math.max(a,20/c);return I(`svg`,{style:{position:`absolute`,width:x,height:S,pointerEvents:`none`,zIndex:2,overflow:`visible`},width:x,height:S,viewBox:`0 0 ${e.size.width} ${e.size.height}`,children:[I(`path`,{d:h&&y?y.path:v,fill:`transparent`,stroke:`transparent`,strokeWidth:C,onPointerDown:u,style:{cursor:l?`move`:u?`pointer`:`default`,pointerEvents:u?l?`none`:n===`transparent`?`visibleStroke`:`visible`:`none`,strokeLinecap:`butt`,strokeLinejoin:`miter`}}),!p&&I(A,{children:h&&y?I(`path`,{d:y.path,opacity:i,style:{fill:n,stroke:r??n,strokeWidth:a,pointerEvents:`none`,strokeLinejoin:`round`}}):I(A,{children:[I(`path`,{d:v,opacity:i,style:{fill:d?`none`:n,stroke:r??n,strokeWidth:a,pointerEvents:`none`,strokeLinecap:`butt`,strokeLinejoin:`miter`,...o===un.DASHED&&{strokeDasharray:s?.join(`,`)}}}),b&&t.length>1&&I(`path`,{d:`M ${_[_.length-1].x} ${_[_.length-1].y} L ${_[0].x} ${_[0].y}`,fill:`none`,style:{stroke:r,strokeWidth:a,strokeDasharray:`4,4`,opacity:.7,pointerEvents:`none`}}),b&&t.length>=2&&I(`rect`,{x:_[0].x-f/c/2,y:_[0].y-f/c/2,width:f/c,height:f/c,fill:r,opacity:.4,stroke:r,strokeWidth:a/2,style:{pointerEvents:`none`}})]})})]})}function lm({isSelected:e,color:t=`#facc15`,opacity:n=1,onClick:r,appearanceActive:i=!1}){let a=function(e){try{let{red:t,green:n,blue:r}=En(e);return(.299*t+.587*n+.114*r)/255<.45?`#fff`:`#000`}catch{return`#000`}}(t);return I(`div`,{style:{position:`absolute`,inset:0,zIndex:2,pointerEvents:r?e?`none`:`auto`:`none`,cursor:e?`move`:r?`pointer`:`default`},onPointerDown:r,children:!i&&I(`svg`,{style:{position:`absolute`,inset:0,pointerEvents:`none`},viewBox:`0 0 20 20`,width:`100%`,height:`100%`,children:[I(`path`,{d:`M 0.5 15.5 L 0.5 0.5 L 19.5 0.5 L 19.5 15.5 L 8.5 15.5 L 6.5 19.5 L 4.5 15.5 Z`,fill:t,opacity:n,stroke:a,strokeWidth:`1`,strokeLinejoin:`miter`}),I(`line`,{x1:`2.5`,y1:`4.25`,x2:`17.5`,y2:`4.25`,stroke:a,strokeWidth:`1`}),I(`line`,{x1:`2.5`,y1:`8`,x2:`17.5`,y2:`8`,stroke:a,strokeWidth:`1`}),I(`line`,{x1:`2.5`,y1:`11.75`,x2:`17.5`,y2:`11.75`,stroke:a,strokeWidth:`1`})]})})}function um({documentId:e,isSelected:t,isEditing:n,annotation:r,pageIndex:i,scale:a,onClick:o,appearanceActive:s=!1}){let c=N(null),l=N(!1),{provides:u}=Kp(),d=u?.forDocument(e)??null,{adjustedFontPx:f,wrapperStyle:p}=Xp(r.object.fontSize*a,n);return M(()=>{if(n&&c.current){l.current=!0;let e=c.current;e.focus();let t=d?.findToolForAnnotation(r.object),n=t?.defaults?.contents!=null&&r.object.contents===t.defaults.contents,i=window.getSelection();if(i){let t=document.createRange();t.selectNodeContents(e),n||t.collapse(!1),i.removeAllRanges(),i.addRange(t)}}},[n]),I(`div`,{style:{position:`absolute`,width:r.object.rect.size.width*a,height:r.object.rect.size.height*a,cursor:t&&!n?`move`:`default`,pointerEvents:o?t&&!n?`none`:`auto`:`none`,zIndex:2,opacity:+!s},onPointerDown:o,children:I(`span`,{ref:c,onBlur:()=>{l.current&&(l.current=!1,d&&c.current&&d.updateAnnotation(i,r.object.id,{contents:c.current.innerText.replace(/\u00A0/g,` `)}))},tabIndex:0,style:{color:r.object.fontColor,fontSize:f,...Gn(r.object.fontFamily),textAlign:Nn(r.object.textAlign),flexDirection:`column`,justifyContent:r.object.verticalAlign===Qt.Top?`flex-start`:r.object.verticalAlign===Qt.Middle?`center`:`flex-end`,display:`flex`,backgroundColor:r.object.color??r.object.backgroundColor,opacity:r.object.opacity,width:`100%`,height:`100%`,lineHeight:`1.18`,overflow:`hidden`,cursor:n?`text`:o?`pointer`:`default`,outline:`none`,...p},contentEditable:n,...Bp,children:r.object.contents})})}function dm({documentId:e,isSelected:t,isEditing:n,annotation:r,pageIndex:i,scale:a,onClick:o,appearanceActive:s=!1}){let c=N(null),l=N(!1),{provides:u}=Kp(),d=u?.forDocument(e)??null,f=r.object,p=f.rect,m=f.rectangleDifferences,h=f.calloutLine,g=f.strokeWidth??1,_=f.strokeColor??`#000000`,v=P(()=>Wd.computeTextBoxFromRD(p,m),[p,m]),y=P(()=>({left:(v.origin.x-p.origin.x+g/2)*a,top:(v.origin.y-p.origin.y+g/2)*a,width:(v.size.width-g)*a,height:(v.size.height-g)*a}),[v,p,a,g]),b=P(()=>!h||h.length<3?null:h.map(e=>({x:e.x-p.origin.x,y:e.y-p.origin.y})),[h,p]),x=P(()=>{if(!b||b.length<2)return null;let e=Math.atan2(b[1].y-b[0].y,b[1].x-b[0].x);return Wd.createEnding(f.lineEnding,g,e+Math.PI,b[0].x,b[0].y)},[b,f.lineEnding,g]),S=P(()=>{if(!b||b.length<2)return b;let e=b.map(e=>({...e})),t=e.length-1,n=t-1,r=e[t].x-e[n].x,i=e[t].y-e[n].y,a=Math.sqrt(r*r+i*i);if(a>0){let n=g/2;e[t].x+=r/a*n,e[t].y+=i/a*n}return e},[b,g]),{adjustedFontPx:C,wrapperStyle:w}=Xp(f.fontSize*a,n);M(()=>{if(n&&c.current){l.current=!0;let e=c.current;e.focus();let t=d?.findToolForAnnotation(f),n=t?.defaults?.contents!=null&&f.contents===t.defaults.contents,r=window.getSelection();if(r){let t=document.createRange();t.selectNodeContents(e),n||t.collapse(!1),r.removeAllRanges(),r.addRange(t)}}},[n]);let T=p.size.width*a,E=p.size.height*a,D=Math.max(g,20/a);return I(`div`,{style:{position:`absolute`,width:T,height:E,cursor:t&&!n?`move`:`default`,pointerEvents:`none`,zIndex:2,opacity:+!s},children:[I(`svg`,{style:{position:`absolute`,width:T,height:E,pointerEvents:`none`,overflow:`visible`},width:T,height:E,viewBox:`0 0 ${p.size.width} ${p.size.height}`,children:[b&&I(A,{children:[I(`polyline`,{points:b.map(e=>`${e.x},${e.y}`).join(` `),fill:`none`,stroke:`transparent`,strokeWidth:D,onPointerDown:o?e=>o(e):void 0,style:{cursor:t?`move`:o?`pointer`:`default`,pointerEvents:o?t?`none`:`visibleStroke`:`none`}}),x&&I(`path`,{d:x.d,transform:x.transform,fill:`transparent`,stroke:`transparent`,strokeWidth:D,onPointerDown:o?e=>o(e):void 0,style:{cursor:t?`move`:o?`pointer`:`default`,pointerEvents:o?t?`none`:x.filled?`visible`:`visibleStroke`:`none`}})]}),!s&&I(A,{children:[S&&I(A,{children:[I(`polyline`,{points:S.map(e=>`${e.x},${e.y}`).join(` `),fill:`none`,stroke:_,strokeWidth:g,opacity:f.opacity,style:{pointerEvents:`none`}}),x&&I(`path`,{d:x.d,transform:x.transform,stroke:_,fill:x.filled?f.color??`transparent`:`none`,strokeWidth:g,opacity:f.opacity,style:{pointerEvents:`none`}})]}),I(`rect`,{x:v.origin.x-p.origin.x+g/2,y:v.origin.y-p.origin.y+g/2,width:v.size.width-g,height:v.size.height-g,fill:f.color??f.backgroundColor??`transparent`,stroke:_,strokeWidth:g,opacity:f.opacity,style:{pointerEvents:`none`}})]})]}),I(`div`,{onPointerDown:o?e=>o(e):void 0,style:{position:`absolute`,left:(v.origin.x-p.origin.x)*a,top:(v.origin.y-p.origin.y)*a,width:v.size.width*a,height:v.size.height*a,cursor:t&&!n?`move`:o?`pointer`:`default`,pointerEvents:o?t&&!n?`none`:`auto`:`none`}}),I(`span`,{ref:c,onBlur:()=>{l.current&&(l.current=!1,d&&c.current&&d.updateAnnotation(i,f.id,{contents:c.current.innerText.replace(/\u00A0/g,` `)}))},tabIndex:0,style:{position:`absolute`,left:y.left,top:y.top,width:y.width,height:y.height,color:f.fontColor,fontSize:C,...Gn(f.fontFamily),textAlign:Nn(f.textAlign),flexDirection:`column`,justifyContent:f.verticalAlign===Qt.Top?`flex-start`:f.verticalAlign===Qt.Middle?`center`:`flex-end`,display:`flex`,padding:g*a/2+2*a,opacity:f.opacity,lineHeight:`1.18`,overflow:`hidden`,cursor:n?`text`:`default`,outline:`none`,pointerEvents:n?`auto`:`none`,...w},contentEditable:n,...Bp,children:f.contents})]})}function fm({calloutLine:e,textBox:t,bounds:n,scale:r,strokeColor:i,strokeWidth:a,color:o,backgroundColor:s,opacity:c,lineEnding:l}){if(!e||e.length<2)return I(A,{});let u=a??1,d=i??`#000000`,f=c??1,p=n.size.width,m=n.size.height,h=n.origin.x,g=n.origin.y,_=e.map(e=>({x:e.x-h,y:e.y-g})),v=Math.atan2(_[1].y-_[0].y,_[1].x-_[0].x),y=Wd.createEnding(l,u,v+Math.PI,_[0].x,_[0].y),b=u/2;return I(`svg`,{style:{position:`absolute`,width:p*r,height:m*r,pointerEvents:`none`,overflow:`visible`},width:p*r,height:m*r,viewBox:`0 0 ${p} ${m}`,children:[I(`polyline`,{points:_.map(e=>`${e.x},${e.y}`).join(` `),fill:`none`,stroke:d,strokeWidth:u,opacity:f}),y&&I(`path`,{d:y.d,transform:y.transform,stroke:d,fill:y.filled?o??`transparent`:`none`,strokeWidth:u,opacity:f}),t&&I(`rect`,{x:t.origin.x-h+b,y:t.origin.y-g+b,width:t.size.width-u,height:t.size.height-u,fill:o??s??`transparent`,stroke:d,strokeWidth:u,opacity:f})]})}function pm({documentId:e,pageIndex:t,annotation:n,scaleFactor:r=1,unrotated:i,style:a,...o}){let{provides:s}=Kp(),[c,l]=j(null),u=N(null),{width:d,height:f}=n.rect.size;return M(()=>{if(s){let a=s.forDocument(e).renderAnnotation({pageIndex:t,annotation:n,options:{scaleFactor:r,dpr:window.devicePixelRatio,unrotated:i}});return a.wait(e=>{let t=URL.createObjectURL(e);l(t),u.current=t},nr),()=>{u.current?(URL.revokeObjectURL(u.current),u.current=null):a.abort({code:W.Cancelled,message:`canceled render task`})}}},[t,r,i,s,e,n.id,d,f]),I(A,{children:c&&I(`img`,{src:c,onLoad:()=>{u.current&&=(URL.revokeObjectURL(u.current),null)},...o,style:{width:`100%`,height:`100%`,display:`block`,...a||{}}})})}function mm({isSelected:e,annotation:t,documentId:n,pageIndex:r,scale:i,onClick:a}){let o=!!t.object.rotation&&!!t.object.unrotatedRect;return I(`div`,{style:{position:`absolute`,width:`100%`,height:`100%`,zIndex:2,pointerEvents:a?e?`none`:`auto`:`none`,cursor:a?`pointer`:`default`},onPointerDown:a,children:I(pm,{documentId:n,pageIndex:r,annotation:{...t.object,id:t.object.id},scaleFactor:i,unrotated:o})})}function hm({isSelected:e,strokeColor:t=`#0000FF`,strokeWidth:n=2,strokeStyle:r=un.UNDERLINE,strokeDashArray:i,rect:a,scale:o,onClick:s,hasIRT:c=!1}){let{width:l,height:u}=P(()=>({width:a.size.width,height:a.size.height}),[a]),d=l*o,f=u*o,p=P(()=>{if(r===un.DASHED)return i?.join(`,`)??`${3*n},${n}`},[r,i,n]),m=r===un.UNDERLINE;return I(`svg`,{style:{position:`absolute`,width:d,height:f,pointerEvents:`none`,zIndex:2},width:d,height:f,viewBox:`0 0 ${l} ${u}`,children:[I(`rect`,{x:0,y:0,width:l,height:u,fill:`transparent`,onPointerDown:c?void 0:s,style:{cursor:c||!s?`default`:e?`move`:`pointer`,pointerEvents:c||!s||e?`none`:`visible`}}),m?I(`line`,{x1:1,y1:u-1,x2:l-1,y2:u-1,stroke:t,strokeWidth:n,strokeDasharray:p,style:{pointerEvents:`none`}}):I(`rect`,{x:n/2,y:n/2,width:Math.max(l-n,0),height:Math.max(u-n,0),fill:`transparent`,stroke:t,strokeWidth:n,strokeDasharray:p,style:{pointerEvents:`none`}})]})}function gm({strokeColor:e,opacity:t=.5,segmentRects:n,rect:r,scale:i,onClick:a,style:o,appearanceActive:s=!1}){let c=e??`#FFFF00`;return I(A,{children:n.map((e,n)=>I(`div`,{onPointerDown:a,style:{position:`absolute`,left:(r?e.origin.x-r.origin.x:e.origin.x)*i,top:(r?e.origin.y-r.origin.y:e.origin.y)*i,width:e.size.width*i,height:e.size.height*i,background:s?`transparent`:c,opacity:s?void 0:t,pointerEvents:a?`auto`:`none`,cursor:a?`pointer`:`default`,zIndex:a?1:void 0,...o}},n))})}function _m({strokeColor:e,opacity:t=.5,segmentRects:n,rect:r,scale:i,onClick:a,style:o,appearanceActive:s=!1}){let c=e??`#FFFF00`,l=2*i;return I(A,{children:n.map((e,n)=>I(`div`,{onPointerDown:a,style:{position:`absolute`,left:(r?e.origin.x-r.origin.x:e.origin.x)*i,top:(r?e.origin.y-r.origin.y:e.origin.y)*i,width:e.size.width*i,height:e.size.height*i,background:`transparent`,pointerEvents:a?`auto`:`none`,cursor:a?`pointer`:`default`,zIndex:+!!a,...o},children:!s&&I(`div`,{style:{position:`absolute`,left:0,bottom:0,width:`100%`,height:l,background:c,opacity:t,pointerEvents:`none`}})},n))})}function vm({strokeColor:e,opacity:t=.5,segmentRects:n,rect:r,scale:i,onClick:a,style:o,appearanceActive:s=!1}){let c=e??`#FFFF00`,l=2*i;return I(A,{children:n.map((e,n)=>I(`div`,{onPointerDown:a,style:{position:`absolute`,left:(r?e.origin.x-r.origin.x:e.origin.x)*i,top:(r?e.origin.y-r.origin.y:e.origin.y)*i,width:e.size.width*i,height:e.size.height*i,background:`transparent`,pointerEvents:a?`auto`:`none`,cursor:a?`pointer`:`default`,zIndex:+!!a,...o},children:!s&&I(`div`,{style:{position:`absolute`,left:0,top:`50%`,width:`100%`,height:l,background:c,opacity:t,transform:`translateY(-50%)`,pointerEvents:`none`}})},n))})}function ym({strokeColor:e,opacity:t=.5,segmentRects:n,rect:r,scale:i,onClick:a,style:o,appearanceActive:s=!1}){let c=2*i,l=6*i,u=`url("data:image/svg+xml;utf8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${2*c}" viewBox="0 0 ${l} ${2*c}">\n <path d="M0 ${c} Q ${l/4} 0 ${l/2} ${c} T ${l} ${c}"\n fill="none" stroke="${e??`#FFFF00`}" stroke-width="${c}" stroke-linecap="round"/>\n </svg>`)}")`;return I(A,{children:n.map((e,n)=>I(`div`,{onPointerDown:a,style:{position:`absolute`,left:(r?e.origin.x-r.origin.x:e.origin.x)*i,top:(r?e.origin.y-r.origin.y:e.origin.y)*i,width:e.size.width*i,height:e.size.height*i,background:`transparent`,pointerEvents:a?`auto`:`none`,cursor:a?`pointer`:`default`,zIndex:+!!a,...o},children:!s&&I(`div`,{style:{position:`absolute`,left:0,bottom:0,width:`100%`,height:2*c,backgroundImage:u,backgroundRepeat:`repeat-x`,backgroundSize:`${l}px ${2*c}px`,opacity:t,pointerEvents:`none`}})},n))})}function bm({isSelected:e,strokeColor:t=`#000000`,opacity:n=1,rect:r,scale:i,onClick:a,appearanceActive:o=!1}){let{width:s,height:c,path:l}=P(()=>{let e=r.size.width,t=r.size.height,n=e/2;return{width:e,height:t,path:[`M 0 ${t}`,`C ${.27*e} ${t} ${n} ${t-.44*t} ${n} 0`,`C ${n} ${t-.44*t} ${e-.27*e} ${t} ${e} ${t}`,`Z`].join(` `)}},[r]),u=s*i,d=c*i;return I(`svg`,{style:{position:`absolute`,width:u,height:d,pointerEvents:`none`,zIndex:2},width:u,height:d,viewBox:`0 0 ${s} ${c}`,overflow:`visible`,children:[I(`path`,{d:l,fill:`transparent`,stroke:`transparent`,strokeWidth:4,onPointerDown:a,style:{cursor:e?`move`:a?`pointer`:`default`,pointerEvents:a?e?`none`:`visible`:`none`}}),!o&&I(`path`,{d:l,fill:t,stroke:t,strokeWidth:.5,opacity:n,fillRule:`evenodd`,style:{pointerEvents:`none`}})]})}function xm({annotation:e,documentId:t}){let{provides:n}=Kp();return I(`div`,{onClick:F(()=>{let r=e.object.target;r&&n&&n.forDocument(t).navigateTarget(r)},[e.object.target,n,t]),style:{width:`100%`,height:`100%`,cursor:`pointer`,pointerEvents:`auto`}})}var Sm=[nm({id:`ink`,matches:e=>e.type===z.INK,matchesPreview:e=>e.type===z.INK,render:({currentObject:e,isSelected:t,scale:n,onClick:r,appearanceActive:i})=>I(rm,{...e,isSelected:t,scale:n,onClick:r,appearanceActive:i}),renderPreview:({data:e,scale:t})=>I(rm,{isSelected:!1,scale:t,...e}),previewContainerStyle:({data:e})=>({mixBlendMode:Xn(e.blendMode??R.Normal)}),interactionDefaults:{isDraggable:!0,isResizable:!0,isRotatable:!0}}),nm({id:`square`,matches:e=>e.type===z.SQUARE,matchesPreview:e=>e.type===z.SQUARE,render:({currentObject:e,isSelected:t,scale:n,onClick:r,appearanceActive:i})=>I(im,{...e,isSelected:t,scale:n,onClick:r,appearanceActive:i}),renderPreview:({data:e,scale:t})=>I(im,{isSelected:!1,scale:t,...e}),interactionDefaults:{isDraggable:!0,isResizable:!0,isRotatable:!0}}),nm({id:`circle`,matches:e=>e.type===z.CIRCLE,matchesPreview:e=>e.type===z.CIRCLE,render:({currentObject:e,isSelected:t,scale:n,onClick:r,appearanceActive:i})=>I(am,{...e,isSelected:t,scale:n,onClick:r,appearanceActive:i}),renderPreview:({data:e,scale:t})=>I(am,{isSelected:!1,scale:t,...e}),interactionDefaults:{isDraggable:!0,isResizable:!0,isRotatable:!0}}),nm({id:`line`,matches:e=>e.type===z.LINE,matchesPreview:e=>e.type===z.LINE,render:({currentObject:e,isSelected:t,scale:n,onClick:r,appearanceActive:i})=>I(A,{children:I(om,{...e,isSelected:t,scale:n,onClick:r,appearanceActive:i})}),renderPreview:({data:e,scale:t})=>I(om,{isSelected:!1,scale:t,...e}),vertexConfig:{extractVertices:e=>[e.linePoints.start,e.linePoints.end],transformAnnotation:(e,t)=>({...e,linePoints:{start:t[0],end:t[1]}})},interactionDefaults:{isDraggable:!0,isResizable:!1,isRotatable:!0}}),nm({id:`polyline`,matches:e=>e.type===z.POLYLINE,matchesPreview:e=>e.type===z.POLYLINE,render:({currentObject:e,isSelected:t,scale:n,onClick:r,appearanceActive:i})=>I(A,{children:I(sm,{...e,isSelected:t,scale:n,onClick:r,appearanceActive:i})}),renderPreview:({data:e,scale:t})=>I(sm,{isSelected:!1,scale:t,...e}),vertexConfig:{extractVertices:e=>e.vertices,transformAnnotation:(e,t)=>({...e,vertices:t})},interactionDefaults:{isDraggable:!0,isResizable:!1,isRotatable:!0}}),nm({id:`polygon`,matches:e=>e.type===z.POLYGON,matchesPreview:e=>e.type===z.POLYGON,render:({currentObject:e,isSelected:t,scale:n,onClick:r,appearanceActive:i})=>I(A,{children:I(cm,{...e,isSelected:t,scale:n,onClick:r,appearanceActive:i})}),renderPreview:({data:e,scale:t})=>I(cm,{isSelected:!1,scale:t,...e}),vertexConfig:{extractVertices:e=>e.vertices,transformAnnotation:(e,t)=>({...e,vertices:t})},interactionDefaults:{isDraggable:!0,isResizable:!1,isRotatable:!0}}),nm({id:`highlight`,matches:e=>e.type===z.HIGHLIGHT,render:({currentObject:e,scale:t,onClick:n,appearanceActive:r})=>I(gm,{...e,scale:t,onClick:n,appearanceActive:r}),zIndex:0,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},defaultBlendMode:R.Multiply}),nm({id:`underline`,matches:e=>e.type===z.UNDERLINE,render:({currentObject:e,scale:t,onClick:n,appearanceActive:r})=>I(_m,{...e,scale:t,onClick:n,appearanceActive:r}),zIndex:0,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1}}),nm({id:`strikeout`,matches:e=>e.type===z.STRIKEOUT,render:({currentObject:e,scale:t,onClick:n,appearanceActive:r})=>I(vm,{...e,scale:t,onClick:n,appearanceActive:r}),zIndex:0,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1}}),nm({id:`squiggly`,matches:e=>e.type===z.SQUIGGLY,render:({currentObject:e,scale:t,onClick:n,appearanceActive:r})=>I(ym,{...e,scale:t,onClick:n,appearanceActive:r}),zIndex:0,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1}}),nm({id:`text`,matches:e=>e.type===z.TEXT&&!e.inReplyToId,render:({currentObject:e,isSelected:t,onClick:n,appearanceActive:r})=>I(lm,{isSelected:t,color:e.strokeColor??e.color,opacity:e.opacity,onClick:n,appearanceActive:r}),interactionDefaults:{isDraggable:!0,isResizable:!1,isRotatable:!1}}),nm({id:`caret`,matches:e=>e.type===z.CARET,render:({currentObject:e,isSelected:t,scale:n,onClick:r,appearanceActive:i})=>I(bm,{...e,isSelected:t,scale:n,onClick:r,appearanceActive:i}),interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1}}),nm({id:`freeTextCallout`,matches:e=>e.type===z.FREETEXT&&e.intent===`FreeTextCallout`,matchesPreview:e=>e.type===z.FREETEXT&&!!e.data.calloutLine,render:({annotation:e,currentObject:t,isSelected:n,isEditing:r,scale:i,pageIndex:a,documentId:o,onClick:s,appearanceActive:c})=>I(dm,{documentId:o,isSelected:n,isEditing:r,annotation:{...e,object:t},pageIndex:a,scale:i,onClick:s,appearanceActive:c}),renderPreview:({data:e,bounds:t,scale:n})=>I(fm,{calloutLine:e.calloutLine,textBox:e.textBox,bounds:t,scale:n,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,color:e.color,backgroundColor:e.backgroundColor,opacity:e.opacity,lineEnding:e.lineEnding}),vertexConfig:Wd.calloutVertexConfig,interactionDefaults:{isDraggable:!0,isResizable:!1,isRotatable:!1},isDraggable:(e,{isEditing:t})=>e&&!t,onDoubleClick:(e,t)=>t(e)}),nm({id:`freeText`,matches:e=>e.type===z.FREETEXT&&e.intent!==`FreeTextCallout`,matchesPreview:e=>e.type===z.FREETEXT&&!e.data.calloutLine,render:({annotation:e,currentObject:t,isSelected:n,isEditing:r,scale:i,pageIndex:a,documentId:o,onClick:s,appearanceActive:c})=>I(um,{documentId:o,isSelected:n,isEditing:r,annotation:{...e,object:t},pageIndex:a,scale:i,onClick:s,appearanceActive:c}),renderPreview:({data:e})=>I(`div`,{style:{width:`100%`,height:`100%`,border:`1px dashed ${e.fontColor||`#000000`}`,backgroundColor:`transparent`}}),interactionDefaults:{isDraggable:!0,isResizable:!0,isRotatable:!0},isDraggable:(e,{isEditing:t})=>e&&!t,onDoubleClick:(e,t)=>t(e)}),nm({id:`stamp`,matches:e=>e.type===z.STAMP,matchesPreview:e=>e.type===z.STAMP,render:({annotation:e,isSelected:t,documentId:n,pageIndex:r,scale:i,onClick:a})=>I(mm,{isSelected:t,annotation:e,documentId:n,pageIndex:r,scale:i,onClick:a}),renderPreview:({data:e})=>{let t=(4-e.pageRotation)%4*90;return I(`img`,{src:e.ghostUrl,style:{width:`100%`,height:`100%`,opacity:.6,objectFit:`contain`,pointerEvents:`none`,transform:t?`rotate(${t}deg)`:void 0},alt:``})},useAppearanceStream:!1,interactionDefaults:{isDraggable:!0,isResizable:!0,isRotatable:!0}}),nm({id:`link`,matches:e=>e.type===z.LINK,matchesPreview:e=>e.type===z.LINK,render:({currentObject:e,isSelected:t,scale:n,onClick:r})=>I(hm,{...e,isSelected:t,scale:n,onClick:r,hasIRT:!!e.inReplyToId}),renderPreview:({data:e,bounds:t,scale:n})=>I(`div`,{style:{position:`absolute`,left:0,top:0,width:t.size.width*n,height:t.size.height*n,borderBottom:`${e.strokeWidth*n}px solid ${e.strokeColor}`,backgroundColor:`rgba(0, 0, 255, 0.05)`,boxSizing:`border-box`}}),interactionDefaults:{isDraggable:!0,isResizable:!0,isRotatable:!1},useAppearanceStream:!1,selectOverride:(e,t,n)=>{if(e.stopPropagation(),n.clearSelection(),t.object.inReplyToId){let e=n.allAnnotations.find(e=>e.object.id===t.object.inReplyToId);if(e)return void n.selectAnnotation(e.object.pageIndex,e.object.id)}n.selectAnnotation(n.pageIndex,t.object.id)},hideSelectionMenu:e=>!!e.inReplyToId,renderLocked:e=>I(xm,{...e})})];function Cm(e){let{documentId:t,pageIndex:n,scale:r,pageWidth:i,pageHeight:a,selectionMenu:o}=e,{provides:s}=Kp(),{provides:c}=al(),[l,u]=j([]),{register:d}=function({modeId:e,pageIndex:t,documentId:n}){let{provides:r}=Mp();return{register:(i,a)=>{let o=a?.modeId??e,s=a?.pageIndex??t,c=a?.documentId??n;return o?r?.registerHandlers({modeId:o,handlers:i,pageIndex:s,documentId:c}):r?.registerAlways({scope:s===void 0?{type:`global`,documentId:c}:{type:`page`,documentId:c,pageIndex:s},handlers:i})}}}({documentId:t,pageIndex:n}),[f,p]=j([]),[m,h]=j(null),[g,_]=j({}),[,v]=j({type:yu.None}),y=N(r),b=P(()=>s?s.forDocument(t):null,[s,t]),x=f.length>1;M(()=>{if(b){let e=b.getState();return u(ku(e,n)),p(ju(e)),v(e.locked),b.onStateChange(e=>{u(ku(e,n)),p(ju(e)),v(e.locked)})}},[b,n]),M(()=>{if(b)return b.onAnnotationEvent(e=>{e.type===`create`&&e.editAfterCreate&&h(e.annotation.id)})},[b]),M(()=>{b&&(y.current!==r&&(b.invalidatePageAppearances(n),y.current=r),b.getPageAppearances(n,{scaleFactor:r,dpr:typeof window<`u`?window.devicePixelRatio:1}).wait(e=>_(e),()=>_({})))},[b,n,r]);let S=P(()=>({onPointerDown:(e,t)=>{t.target===t.currentTarget&&b&&(m&&l.some(e=>e.object.id===m)&&t.stopImmediatePropagation(),b.deselectAnnotation(),h(null))}}),[b,m,l]),C=F((e,t)=>{e.stopPropagation(),b&&c&&(c.clear(),`metaKey`in e&&(e.metaKey||e.ctrlKey)?b.toggleSelection(n,t.object.id):b.selectAnnotation(n,t.object.id),t.object.id!==m&&h(null))},[b,c,m,n]);M(()=>d(S,{documentId:t}),[d,S]);let w=P(()=>l.filter(e=>f.includes(e.object.id)),[l,f]),T=P(()=>!(w.length<2)&&w.every(e=>{let t=b?.findToolForAnnotation(e.object),n=jf(t?.interaction.isGroupDraggable,e.object,!0),r=jf(t?.interaction.isDraggable,e.object,!0);return t?.interaction.isGroupDraggable===void 0?r:n}),[w,b]),E=P(()=>!(w.length<2)&&w.every(e=>{let t=b?.findToolForAnnotation(e.object),n=jf(t?.interaction.isGroupResizable,e.object,!0),r=jf(t?.interaction.isResizable,e.object,!0);return t?.interaction.isGroupResizable===void 0?r:n}),[w,b]),D=P(()=>!(w.length<2)&&w.every(e=>{let t=b?.findToolForAnnotation(e.object),n=jf(t?.interaction.isGroupRotatable,e.object,!0),r=jf(t?.interaction.isRotatable,e.object,!0);return t?.interaction.isGroupRotatable===void 0?r:n}),[w,b]),O=P(()=>!(w.length<2)&&w.some(e=>{let t=b?.findToolForAnnotation(e.object),n=jf(t?.interaction.lockGroupAspectRatio,e.object,!1),r=jf(t?.interaction.lockAspectRatio,e.object,!1);return t?.interaction.lockGroupAspectRatio===void 0?r:n}),[w,b]),ee=P(()=>{if(!b)return!1;let e=b.getSelectedAnnotations();return e.length>1&&e.every(e=>e.object.pageIndex===n)},[b,n,f]),te=F(e=>{if(e.dictMode||e.object.rotation&&e.object.unrotatedRect)return null;let t=g[e.object.id];return t?.normal?t:null},[g]),ne=P(()=>{let t=e.annotationRenderers??[],n=new Set(t.map(e=>e.id));return[...t,...Sm.filter(e=>!n.has(e.id))]},[e.annotationRenderers]),re=F(e=>ne.find(t=>t.matches(e.object))??null,[ne]),ie=P(()=>({defaultSelect:C,selectAnnotation:(e,t)=>b?.selectAnnotation(e,t),clearSelection:()=>c?.clear(),allAnnotations:l,pageIndex:n}),[C,b,c,l,n]);return I(A,{children:[l.map(i=>{let a=re(i);if(!a||Du(i.object)||Ou(i.object))return null;let s=b?.findToolForAnnotation(i.object)??null,c=!!b&&!b.isAnnotationInteractive(i.object),l=!!b&&b.isAnnotationStructurallyLocked(i.object),u=!!b&&b.isAnnotationContentLocked(i.object);if(c&&a.hiddenWhenLocked)return null;let d=c&&!!a.renderLocked,p=!c&&f.includes(i.object.id),g=!c&&m===i.object.id,_=a.interactionDefaults,v=jf(s?.interaction.isDraggable,i.object,_?.isDraggable??!0),y=!l&&(a.isDraggable?a.isDraggable(v,{isEditing:g}):v),S=s?.behavior?.useAppearanceStream??a.useAppearanceStream??!0,w=d?void 0:S?te(i):void 0,T=c?e=>{e.stopPropagation()}:a.selectOverride?e=>a.selectOverride(e,i,ie):e=>C(e,i);return I(Qp,{trackedAnnotation:i,isSelected:p,isEditing:g,isMultiSelected:!c&&x,isDraggable:y,isResizable:!l&&jf(s?.interaction.isResizable,i.object,_?.isResizable??!1),lockAspectRatio:jf(s?.interaction.lockAspectRatio,i.object,_?.lockAspectRatio??!1),isRotatable:!l&&jf(s?.interaction.isRotatable,i.object,_?.isRotatable??!1),vertexConfig:l?void 0:a.vertexConfig,selectionMenu:c||a.hideSelectionMenu?.call(a,i.object)?void 0:o,structurallyLocked:l,contentLocked:u,onSelect:T,onDoubleClick:c||u?void 0:a.onDoubleClick?e=>{e.stopPropagation(),a.onDoubleClick(i.object.id,h)}:void 0,zIndex:a.zIndex,blendMode:Xn(i.object.blendMode??a.defaultBlendMode??R.Normal),style:a.containerStyle?.call(a,i.object),appearance:w,...e,children:(e,{appearanceActive:o})=>d?a.renderLocked({annotation:i,currentObject:e,isSelected:!1,isEditing:!1,scale:r,pageIndex:n,documentId:t,onClick:void 0,appearanceActive:o}):a.render({annotation:i,currentObject:e,isSelected:p,isEditing:g,scale:r,pageIndex:n,documentId:t,onClick:c?void 0:T,appearanceActive:o})},i.object.id)}),ee&&w.length>=2&&I(tm,{documentId:t,pageIndex:n,scale:r,rotation:e.rotation,pageWidth:i,pageHeight:a,selectedAnnotations:w,isDraggable:T,isResizable:E,isRotatable:D,lockAspectRatio:O,resizeUI:e.resizeUI,rotationUI:e.rotationUI,selectionOutlineColor:e.selectionOutlineColor,selectionOutline:e.groupSelectionOutline??e.selectionOutline,groupSelectionMenu:e.groupSelectionMenu})]})}function wm({documentId:e,pageIndex:t,scale:n}){let{provides:r}=al(),{provides:i}=Kp(),[a,o]=j([]),[s,c]=j(null),[l,u]=j(null);if(M(()=>{if(r)return r.forDocument(e).onSelectionChange(()=>{o(r.forDocument(e).getHighlightRectsForPage(t)),c(r.forDocument(e).getBoundingRectForPage(t))})},[r,e,t]),M(()=>{if(i)return u(i.forDocument(e).getActiveTool()),i.forDocument(e).onActiveToolChange(e=>u(e))},[i,e]),!s||!l||!l.defaults)return null;switch(l.defaults.type){case z.UNDERLINE:return I(`div`,{style:{mixBlendMode:Xn(l.defaults?.blendMode??R.Normal),pointerEvents:`none`,position:`absolute`,inset:0},children:I(_m,{strokeColor:l.defaults?.strokeColor,opacity:l.defaults?.opacity,segmentRects:a,scale:n})});case z.HIGHLIGHT:return I(`div`,{style:{mixBlendMode:Xn(l.defaults?.blendMode??R.Multiply),pointerEvents:`none`,position:`absolute`,inset:0},children:I(gm,{strokeColor:l.defaults?.strokeColor,opacity:l.defaults?.opacity,segmentRects:a,scale:n})});case z.STRIKEOUT:return I(`div`,{style:{mixBlendMode:Xn(l.defaults?.blendMode??R.Normal),pointerEvents:`none`,position:`absolute`,inset:0},children:I(vm,{strokeColor:l.defaults?.strokeColor,opacity:l.defaults?.opacity,segmentRects:a,scale:n})});case z.SQUIGGLY:return I(`div`,{style:{mixBlendMode:Xn(l.defaults?.blendMode??R.Normal),pointerEvents:`none`,position:`absolute`,inset:0},children:I(ym,{strokeColor:l.defaults?.strokeColor,opacity:l.defaults?.opacity,segmentRects:a,scale:n})});case z.CARET:default:return null}}function Tm({toolId:e,preview:t,scale:n}){let{bounds:r}=t,i=Wp(),a=P(()=>{let e=new Set(i.map(e=>e.id));return[...i,...Sm.filter(t=>!e.has(t.id))]},[i]),o={position:`absolute`,left:r.origin.x*n,top:r.origin.y*n,width:r.size.width*n,height:r.size.height*n,pointerEvents:`none`,zIndex:10},s=a.find(e=>e.matchesPreview?.call(e,t)&&e.renderPreview)??a.find(t=>t.id===e&&t.renderPreview);return s?.renderPreview?I(`div`,{style:{...o,...s.previewContainerStyle?.call(s,{data:t.data,bounds:t.bounds,scale:n})},children:s.renderPreview({data:t.data,bounds:t.bounds,scale:n})}):null}function Em({documentId:e,pageIndex:t,scale:n}){let{plugin:r}=Gp(),[i,a]=j(new Map),o=N(null),s=P(()=>({requestFile:({accept:e,onFile:t})=>{if(!o.current)return;let n=o.current;n.accept=e,n.onchange=e=>{let r=e.target.files?.[0];r&&(t(r),n.value=``)},n.click()}}),[]);return M(()=>{if(r)return r.registerPageHandlers(e,t,n,{services:s,onPreview:(e,t)=>{a(n=>{let r=new Map(n);return t?r.set(e,t):r.delete(e),r})}})},[e,t,n,r,s]),I(A,{children:[I(`input`,{ref:o,type:`file`,style:{display:`none`}}),Array.from(i.entries()).map(([e,t])=>I(Tm,{toolId:e,preview:t,scale:n},e))]})}function Dm({style:e,documentId:t,pageIndex:n,scale:r,rotation:i,selectionMenu:a,groupSelectionMenu:o,resizeUI:s,vertexUI:c,rotationUI:l,selectionOutlineColor:u,selectionOutline:d,groupSelectionOutline:f,customAnnotationRenderer:p,annotationRenderers:m,...h}){let g=ni(t),_=g?.document?.pages?.[n],v=_?.size?.width??0,y=_?.size?.height??0,b=Wp(),x=P(()=>{let e=[...b];for(let t of m??[]){let n=e.findIndex(e=>e.id===t.id);n>=0?e[n]=t:e.push(t)}return e},[b,m]),S=P(()=>r===void 0?g?.scale??1:r,[r,g?.scale]);return I(`div`,{style:{...e},...h,children:[I(Cm,{documentId:t,selectionMenu:a,groupSelectionMenu:o,pageIndex:n,scale:S,rotation:P(()=>i===void 0?((_?.rotation??0)+(g?.rotation??0))%4:i,[i,_?.rotation,g?.rotation]),pageWidth:v,pageHeight:y,resizeUI:s,vertexUI:c,rotationUI:l,selectionOutlineColor:u,selectionOutline:d,groupSelectionOutline:f,customAnnotationRenderer:p,annotationRenderers:x}),I(wm,{documentId:t,pageIndex:n,scale:S}),I(Em,{documentId:t,pageIndex:n,scale:S})]})}var Om=Yr(Lf).addWrapper(function({children:e}){let[t,n]=j([]),r=F(e=>(n(t=>{let n=new Set(e.map(e=>e.id));return[...t.filter(e=>!n.has(e.id)),...e]}),()=>n(t=>t.filter(t=>!e.some(e=>e.id===t.id)))),[]);return I(Vp.Provider,{value:r,children:I(Hp.Provider,{value:t,children:e})})}).addUtility(function(){let{plugin:e}=Gp(),{provides:t}=Kp();return M(()=>{if(t&&e)return t.onNavigate(t=>{t.result.outcome===`uri`&&!1!==e.config.autoOpenLinks&&window.open(t.result.uri,`_blank`,`noopener,noreferrer`)})},[t,e]),null}).build(),km=`print`,Am={id:km,name:`Print Plugin`,version:`1.0.0`,provides:[`print`],requires:[],optional:[],defaultConfig:{}},jm=class extends Rr{constructor(e,t,n){super(e,t),this.printReady$=Kr()}buildCapability(){return{print:e=>this.print(e),forDocument:e=>this.createPrintScope(e)}}createPrintScope(e){return{print:t=>this.print(t,e)}}print(e,t){let n=t??this.getActiveDocumentId();if(!this.checkPermission(n,U.Print))return this.logger.debug(`PrintPlugin`,`Print`,`Cannot print: document ${n} lacks Print permission`),G.reject({code:W.Security,message:`Document lacks Print permission`});let r=e??{},i=new L;return i.progress({stage:`preparing`,message:`Preparing document...`}),this.preparePrintDocument(r,n).wait(e=>{i.progress({stage:`document-ready`,message:`Document prepared successfully`}),this.printReady$.emit({documentId:n,options:r,buffer:e,task:i})},e=>i.fail(e)),i}preparePrintDocument(e,t){let n=this.coreState.core.documents[t];return n?.document?this.engine.preparePrintDocument(n.document,e):G.reject({code:W.DocNotOpen,message:`Document ${t} not found`})}onPrintRequest(e){return this.printReady$.on(e)}async initialize(e){this.logger.info(`PrintPlugin`,`Initialize`,`Print plugin initialized`)}async destroy(){this.printReady$.clear(),await super.destroy()}};jm.id=`print`;var Mm=jm,Nm=()=>ei(Mm.id),Pm=Yr({manifest:Am,create:(e,t)=>new Mm(km,e,t),reducer:()=>{},initialState:{}}).addUtility(function(){let{provides:e}=Nm(),{plugin:t}=$r(Mm.id),n=N(null),r=N(null);return M(()=>{if(!e||!t)return;let i=t.onPrintRequest(({buffer:e,task:t})=>{let i=n.current;if(!i)return;r.current&&=(URL.revokeObjectURL(r.current),null);let a=URL.createObjectURL(new Blob([e],{type:`application/pdf`}));r.current=a,i.onload=()=>{var n,r;i.src===a&&(t.progress({stage:`iframe-ready`,message:`Ready to print`}),(n=i.contentWindow)==null||n.focus(),(r=i.contentWindow)==null||r.print(),t.progress({stage:`printing`,message:`Print dialog opened`}),t.resolve(e))},i.src=a});return()=>{i(),r.current&&URL.revokeObjectURL(r.current)}},[e,t]),I(`iframe`,{ref:n,style:{position:`absolute`,display:`none`},title:`Print Document`,src:`about:blank`})}).build(),Fm=`fullscreen`,Im={id:Fm,name:`Fullscreen Plugin`,version:`1.0.0`,provides:[`fullscreen`],requires:[],optional:[],defaultConfig:{}},Lm=`SET_FULLSCREEN`,Rm=class extends Rr{constructor(e,t,n){super(e,t),this.onStateChange$=J(),this.fullscreenRequest$=Kr(),this.config=n}async initialize(e){}buildCapability(){return{isFullscreen:()=>this.state.isFullscreen,enableFullscreen:e=>this.enableFullscreen(e),exitFullscreen:()=>this.exitFullscreen(),toggleFullscreen:e=>this.toggleFullscreen(e),onRequest:this.fullscreenRequest$.on,onStateChange:this.onStateChange$.on}}getTargetSelector(){return this.currentTargetElement??this.config.targetElement}toggleFullscreen(e){this.state.isFullscreen?this.exitFullscreen():this.enableFullscreen(e)}enableFullscreen(e){this.currentTargetElement=e??this.config.targetElement,this.fullscreenRequest$.emit({action:`enter`,targetElement:this.currentTargetElement})}exitFullscreen(){this.fullscreenRequest$.emit({action:`exit`}),this.currentTargetElement=void 0}onStoreUpdated(e,t){this.onStateChange$.emit(t)}setFullscreenState(e){this.dispatch({type:Lm,payload:e})}async destroy(){this.fullscreenRequest$.clear(),super.destroy()}};Rm.id=`fullscreen`;var zm=Rm,Bm=()=>$r(zm.id);async function Vm(e,t,n){if(e.action===`enter`){let r=function(e,t,n){if(!t||e.action!==`enter`)return t;let r=null;return n&&(r=t.querySelector(n),r||console.warn(`Fullscreen: Could not find element with selector "${n}" within the wrapper. Falling back to wrapper element.`)),r||=t,r}(e,t,n);r&&!document.fullscreenElement&&await r.requestFullscreen()}else document.fullscreenElement&&await document.exitFullscreen()}var Hm=Yr({manifest:Im,create:(e,t)=>new zm(Fm,e,t),reducer:(e,t)=>t.type===Lm?{...e,isFullscreen:t.payload}:e,initialState:{isFullscreen:!1}}).addWrapper(function({children:e,...t}){let{provides:n}=ei(zm.id),{plugin:r}=Bm(),{plugin:i}=Bm(),a=N(null);return M(()=>{if(!(!n||!r))return n.onRequest(async e=>{let t=r.getTargetSelector();await Vm(e,a.current,t)})},[n,r]),M(()=>{if(!i)return;let e=()=>i.setFullscreenState(!!document.fullscreenElement);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[i]),I(`div`,{...t,style:{position:`relative`,width:`100%`,height:`100%`,...t.style},ref:a,children:e})}).build(),Um=`bookmark`,Wm={id:Um,name:`Bookmark Plugin`,version:`1.0.0`,provides:[`bookmark`],requires:[],optional:[],defaultConfig:{}},Gm=class extends Rr{constructor(e,t){super(e,t)}async initialize(e){}buildCapability(){return{getBookmarks:()=>this.getBookmarks(),forDocument:e=>this.createBookmarkScope(e)}}createBookmarkScope(e){return{getBookmarks:()=>this.getBookmarks(e)}}getBookmarks(e){let t=e??this.getActiveDocumentId(),n=this.coreState.core.documents[t];if(!n?.document)throw Error(`Document ${t} not loaded`);return this.engine.getBookmarks(n.document)}};Gm.id=`bookmark`;var Km=Gm,qm={manifest:Wm,create:e=>new Km(Um,e),reducer:()=>{},initialState:{}},Jm=class extends Rr{constructor(e,t,n){super(e,t),this.downloadRequest$=Kr(),this.config=n}buildCapability(){return{saveAsCopy:()=>this.saveAsCopy(),download:()=>this.download(),forDocument:e=>this.createExportScope(e)}}createExportScope(e){return{saveAsCopy:()=>this.saveAsCopy(e),download:()=>this.download(e)}}download(e){let t=e??this.getActiveDocumentId();this.downloadRequest$.emit({documentId:t})}saveAsCopy(e){let t=e??this.getActiveDocumentId(),n=this.coreState.core.documents[t];return n?.document?this.engine.saveAsCopy(n.document):G.reject({code:W.DocNotOpen,message:`Document ${t} not found`})}saveAsCopyAndGetBufferAndName(e){let t=new L,n=this.coreState.core.documents[e];return n?.document?(this.saveAsCopy(e).wait(e=>{t.resolve({buffer:e,name:n.name??this.config.defaultFileName})},e=>t.fail(e)),t):G.reject({code:W.DocNotOpen,message:`Document ${e} not found`})}onRequest(e){return this.downloadRequest$.on(e)}async initialize(e){this.logger.info(`ExportPlugin`,`Initialize`,`Export plugin initialized`)}async destroy(){this.downloadRequest$.clear(),await super.destroy()}};Jm.id=`export`;var Ym=Jm,Xm=`export`,Zm=Yr({manifest:{id:Xm,name:`Export Plugin`,version:`1.0.0`,provides:[`export`],requires:[],optional:[],defaultConfig:{defaultFileName:`document.pdf`}},create:(e,t)=>new Ym(Xm,e,t),reducer:()=>{},initialState:{}}).addUtility(function(){let{plugin:e}=$r(Ym.id),t=N(null);return M(()=>{if(e)return e.onRequest(n=>{let r=t.current;r&&e.saveAsCopyAndGetBufferAndName(n.documentId).wait(({buffer:e,name:t})=>{let n=URL.createObjectURL(new Blob([e]));r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)},nr)})},[e]),I(`a`,{style:{display:`none`},ref:t})}).build(),Qm=`PAN/INIT_STATE`,$m=`PAN/CLEANUP_STATE`,eh=`PAN/SET_PAN_MODE`,th=class extends Rr{constructor(e,t,n){var r;super(e,t),this.panMode$=J(),this.documentHandlers=new Map,this.config=n,this.interactionManager=t.getPlugin(Op.id)?.provides(),this.viewport=t.getPlugin(Ei.id)?.provides(),this.interactionManager&&(this.interactionManager.registerMode({id:`panMode`,scope:`global`,exclusive:!1,cursor:`grab`,wantsRawTouch:!1}),(r=this.interactionManager)==null||r.onModeChange(e=>{let t=e.activeMode===`panMode`,n=this.getDocumentState(e.documentId);n&&n.isPanMode!==t&&this.dispatch(function(e,t){return{type:eh,payload:{documentId:e,isPanMode:t}}}(e.documentId,t))}))}onDocumentLoadingStarted(e){this.dispatch(function(e,t){return{type:Qm,payload:{documentId:e,state:t}}}(e,{isPanMode:!1})),this.registerPanHandlersForDocument(e),this.config.defaultMode===`always`&&this.makePanDefault(!0),this.logger.debug(`PanPlugin`,`DocumentOpened`,`Initialized pan state for document: ${e}`)}onDocumentClosed(e){let t=this.documentHandlers.get(e);t&&(t(),this.documentHandlers.delete(e)),this.dispatch(function(e){return{type:$m,payload:e}}(e)),this.logger.debug(`PanPlugin`,`DocumentClosed`,`Cleaned up pan state for document: ${e}`)}buildCapability(){return{enablePan:()=>this.enablePan(),disablePan:()=>this.disablePan(),togglePan:()=>this.togglePan(),makePanDefault:e=>this.makePanDefault(e),isPanMode:()=>this.isPanMode(),forDocument:e=>this.createPanScope(e),onPanModeChange:this.panMode$.on}}createPanScope(e){return{enablePan:()=>this.enablePan(e),disablePan:()=>this.disablePan(e),togglePan:()=>this.togglePan(e),isPanMode:()=>this.isPanMode(e),onPanModeChange:t=>this.panMode$.on(n=>{n.documentId===e&&t(n.isPanMode)})}}getDocumentState(e){let t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){let t=this.getDocumentState(e);if(!t)throw Error(`Pan state not found for document: ${e??`active`}`);return t}enablePan(e){let t=e??this.getActiveDocumentId();this.interactionManager.forDocument(t).activate(`panMode`)}disablePan(e){let t=e??this.getActiveDocumentId();this.interactionManager.forDocument(t).activateDefaultMode()}togglePan(e){let t=e??this.getActiveDocumentId(),n=this.interactionManager.forDocument(t);n.getActiveMode()===`panMode`?n.activateDefaultMode():n.activate(`panMode`)}makePanDefault(e=!0){this.interactionManager&&(this.interactionManager.setDefaultMode(`panMode`),e&&this.interactionManager.activateDefaultMode())}isPanMode(e){return this.getDocumentStateOrThrow(e).isPanMode}registerPanHandlersForDocument(e){if(!this.interactionManager||!this.viewport)return;let t=null,n=this.interactionManager.forDocument(e),r=this.viewport.forDocument(e),i=this.interactionManager.registerHandlers({documentId:e,modeId:`panMode`,handlers:{onMouseDown:(e,i)=>{let a=r.getMetrics();t={startX:i.clientX,startY:i.clientY,startLeft:a.scrollLeft,startTop:a.scrollTop},n.setCursor(`panMode`,`grabbing`,10)},onMouseMove:(e,n)=>{if(!t)return;let i=n.clientX-t.startX,a=n.clientY-t.startY;r.scrollTo({x:t.startLeft-i,y:t.startTop-a})},onMouseUp:()=>{t&&(t=null,n.removeCursor(`panMode`))},onMouseLeave:()=>{t&&(t=null,n.removeCursor(`panMode`))},onMouseCancel:()=>{t&&(t=null,n.removeCursor(`panMode`))}}});this.documentHandlers.set(e,i)}onStoreUpdated(e,t){for(let n in t.documents){let r=e.documents[n],i=t.documents[n];r?.isPanMode!==i.isPanMode&&(this.panMode$.emit({documentId:n,isPanMode:i.isPanMode}),this.logger.debug(`PanPlugin`,`PanModeChanged`,`Pan mode changed for document ${n}: ${r?.isPanMode??!1} -> ${i.isPanMode}`))}}async initialize(e){this.logger.info(`PanPlugin`,`Initialize`,`Pan plugin initialized`)}async destroy(){this.documentHandlers.forEach(e=>e()),this.documentHandlers.clear(),this.panMode$.clear(),await super.destroy()}};th.id=`pan`;var nh=th,rh={documents:{},activeDocumentId:null},ih=Yr({manifest:{id:`pan`,name:`Pan Plugin`,version:`1.0.0`,provides:[`pan`],requires:[`interaction-manager`,`viewport`],optional:[],defaultConfig:{defaultMode:`mobile`}},create:(e,t)=>new nh(`pan`,e,t),reducer:(e=rh,t)=>{switch(t.type){case Qm:{let{documentId:n,state:r}=t.payload;return{...e,documents:{...e.documents,[n]:r},activeDocumentId:e.activeDocumentId??n}}case $m:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case`PAN/SET_ACTIVE_DOCUMENT`:return{...e,activeDocumentId:t.payload};case eh:{let{documentId:n,isPanMode:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,isPanMode:r}}}:e}default:return e}},initialState:rh}).addUtility(()=>{let{provides:e}=ei(nh.id),{plugin:t}=$r(nh.id);return M(()=>{if(!e||!t)return;let n=t.config?.defaultMode??`never`,r=typeof window<`u`&&(`ontouchstart`in window||navigator.maxTouchPoints>0);n===`mobile`&&r&&e.makePanDefault()},[e,t]),null}).build(),ah=`capture`,oh={id:ah,name:`Capture Plugin`,version:`1.0.0`,provides:[`capture`],requires:[`render`],optional:[`interaction-manager`],defaultConfig:{scale:1,imageType:`image/png`,withAnnotations:!1}},sh=`CAPTURE/INIT_STATE`,ch=`CAPTURE/CLEANUP_STATE`,lh=`CAPTURE/SET_MARQUEE_CAPTURE_ACTIVE`,uh={isMarqueeCaptureActive:!1},dh={documents:{},activeDocumentId:null},fh=class extends Rr{constructor(e,t,n){super(e,t),this.captureArea$=Kr(),this.state$=J(),this.config=n,this.renderCapability=this.registry.getPlugin(`render`).provides(),this.interactionManagerCapability=this.registry.getPlugin(`interaction-manager`)?.provides(),this.interactionManagerCapability&&(this.interactionManagerCapability.registerMode({id:`marqueeCapture`,scope:`page`,exclusive:!0,cursor:`crosshair`}),this.interactionManagerCapability.onModeChange(e=>{let t=e.activeMode===`marqueeCapture`,n=this.getDocumentState(e.documentId);var r;n&&n.isMarqueeCaptureActive!==t&&this.dispatch((r=e.documentId,{type:lh,payload:{documentId:r,isActive:t}}))}))}onDocumentLoadingStarted(e){let t={...uh};this.dispatch(function(e,t){return{type:sh,payload:{documentId:e,state:t}}}(e,t)),this.logger.debug(`CapturePlugin`,`DocumentOpened`,`Initialized capture state for document: ${e}`)}onDocumentClosed(e){this.dispatch(function(e){return{type:ch,payload:e}}(e)),this.logger.debug(`CapturePlugin`,`DocumentClosed`,`Cleaned up capture state for document: ${e}`)}async initialize(e){}buildCapability(){return{captureArea:(e,t)=>this.captureArea(e,t),enableMarqueeCapture:()=>this.enableMarqueeCapture(),disableMarqueeCapture:()=>this.disableMarqueeCapture(),toggleMarqueeCapture:()=>this.toggleMarqueeCapture(),isMarqueeCaptureActive:()=>this.isMarqueeCaptureActive(),getState:()=>this.getDocumentStateOrThrow(),forDocument:e=>this.createCaptureScope(e),registerMarqueeOnPage:e=>this.registerMarqueeOnPage(e),onCaptureArea:this.captureArea$.on,onStateChange:this.state$.on}}createCaptureScope(e){return{captureArea:(t,n)=>this.captureArea(t,n,e),enableMarqueeCapture:()=>this.enableMarqueeCapture(e),disableMarqueeCapture:()=>this.disableMarqueeCapture(e),toggleMarqueeCapture:()=>this.toggleMarqueeCapture(e),isMarqueeCaptureActive:()=>this.isMarqueeCaptureActive(e),getState:()=>this.getDocumentStateOrThrow(e),onCaptureArea:t=>this.captureArea$.on(n=>{n.documentId===e&&t(n)}),onStateChange:t=>this.state$.on(n=>{n.documentId===e&&t(n.state)})}}getDocumentState(e){let t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){let t=this.getDocumentState(e);if(!t)throw Error(`Capture state not found for document: ${e??`active`}`);return t}registerMarqueeOnPage(e){if(!this.interactionManagerCapability)return this.logger.warn(`CapturePlugin`,`MissingDependency`,`Interaction manager plugin not loaded, marquee capture disabled`),()=>{};let t=this.coreState.core.documents[e.documentId];if(!t||!t.document)return this.logger.warn(`CapturePlugin`,`DocumentNotFound`,`Document not found`),()=>{};let n=t.document.pages[e.pageIndex];if(!n)return this.logger.warn(`CapturePlugin`,`PageNotFound`,`Page ${e.pageIndex} not found`),()=>{};let r=function(e){let{pageSize:t,scale:n,minDragPx:r=5,onPreview:i,onCommit:a}=e,o=null,s=null;return{onPointerDown:(e,t)=>{var n;o=e,s={origin:{x:e.x,y:e.y},size:{width:0,height:0}},i?.(s),(n=t.setPointerCapture)==null||n.call(t)},onPointerMove:e=>{if(!o)return;let n=q(e.x,0,t.width),r=q(e.y,0,t.height);s={origin:{x:Math.min(o.x,n),y:Math.min(o.y,r)},size:{width:Math.abs(n-o.x),height:Math.abs(r-o.y)}},i?.(s)},onPointerUp:(e,t)=>{var c;s&&Math.max(s.size.width,s.size.height)*n>r&&a?.(s),o=null,s=null,i?.(null),(c=t.releasePointerCapture)==null||c.call(t)},onPointerCancel:(e,t)=>{var n;o=null,s=null,i?.(null),(n=t.releasePointerCapture)==null||n.call(t)}}}({pageSize:n.size,scale:e.scale,onPreview:e.callback.onPreview,onCommit:t=>{var n,r;this.captureArea(e.pageIndex,t,e.documentId),(r=(n=e.callback).onCommit)==null||r.call(n,t)}});return this.interactionManagerCapability.registerHandlers({documentId:e.documentId,modeId:`marqueeCapture`,handlers:r,pageIndex:e.pageIndex})}captureArea(e,t,n){let r=n??this.getActiveDocumentId();this.disableMarqueeCapture(r),this.renderCapability.forDocument(r).renderPageRect({pageIndex:e,rect:t,options:{imageType:this.config.imageType,scaleFactor:this.config.scale,withAnnotations:this.config.withAnnotations||!1}}).wait(n=>{this.captureArea$.emit({documentId:r,pageIndex:e,rect:t,blob:n,imageType:this.config.imageType||`image/png`,scale:this.config.scale||1,withAnnotations:this.config.withAnnotations||!1})},nr)}enableMarqueeCapture(e){var t;let n=e??this.getActiveDocumentId();(t=this.interactionManagerCapability)==null||t.forDocument(n).activate(`marqueeCapture`)}disableMarqueeCapture(e){var t;let n=e??this.getActiveDocumentId();(t=this.interactionManagerCapability)==null||t.forDocument(n).activateDefaultMode()}toggleMarqueeCapture(e){let t=e??this.getActiveDocumentId(),n=this.interactionManagerCapability?.forDocument(t);n?.getActiveMode()===`marqueeCapture`?n.activateDefaultMode():n?.activate(`marqueeCapture`)}isMarqueeCaptureActive(e){let t=e??this.getActiveDocumentId();return this.interactionManagerCapability?.forDocument(t).getActiveMode()===`marqueeCapture`}onStoreUpdated(e,t){for(let n in t.documents){let r=e.documents[n],i=t.documents[n];r&&i&&r.isMarqueeCaptureActive!==i.isMarqueeCaptureActive&&this.state$.emit({documentId:n,state:i})}}async destroy(){this.captureArea$.clear(),this.state$.clear(),super.destroy()}};fh.id=`capture`;var ph=fh,mh={manifest:oh,create:(e,t)=>new ph(ah,e,t),reducer:(e=dh,t)=>{switch(t.type){case sh:{let{documentId:n,state:r}=t.payload;return{...e,documents:{...e.documents,[n]:r},activeDocumentId:e.activeDocumentId??n}}case ch:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case`CAPTURE/SET_ACTIVE_DOCUMENT`:return{...e,activeDocumentId:t.payload};case lh:{let{documentId:n,isActive:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,isMarqueeCaptureActive:r}}}:e}default:return e}},initialState:dh},hh=()=>ei(ph.id),gh=({documentId:e,pageIndex:t,scale:n,className:r,stroke:i=`rgba(33,150,243,0.8)`,fill:a=`rgba(33,150,243,0.15)`})=>{let{provides:o}=hh(),s=ni(e),[c,l]=j(null),u=P(()=>n===void 0?s?.scale??1:n,[n,s?.scale]);return M(()=>{if(o)return o.registerMarqueeOnPage({documentId:e,pageIndex:t,scale:u,callback:{onPreview:l}})},[o,e,t,u]),c?I(`div`,{style:{position:`absolute`,pointerEvents:`none`,left:c.origin.x*u,top:c.origin.y*u,width:c.size.width*u,height:c.size.height*u,border:`1px solid ${i}`,background:a,boxSizing:`border-box`},className:r}):null},_h=`history`,vh={id:_h,name:`History Plugin`,version:`1.0.0`,provides:[`history`],requires:[],optional:[],defaultConfig:{}},yh=`HISTORY/INIT_STATE`,bh=`HISTORY/CLEANUP_STATE`,xh=`HISTORY/SET_DOCUMENT_STATE`,Sh=class extends Rr{constructor(e,t){super(e,t),this.documentHistories=new Map,this.historyChange$=Kr()}async initialize(e){this.logger.info(`HistoryPlugin`,`Initialize`,`History plugin initialized`)}onDocumentLoadingStarted(e){this.dispatch((e=>({type:yh,payload:{documentId:e}}))(e)),this.documentHistories.set(e,{topicHistories:new Map,globalTimeline:[],globalIndex:-1}),this.logger.debug(`HistoryPlugin`,`DocumentOpened`,`Initialized history state for document: ${e}`)}onDocumentClosed(e){this.dispatch((e=>({type:bh,payload:{documentId:e}}))(e)),this.documentHistories.delete(e),this.logger.debug(`HistoryPlugin`,`DocumentClosed`,`Cleaned up history state for document: ${e}`)}getDocumentHistoryData(e){let t=e??this.getActiveDocumentId(),n=this.documentHistories.get(t);if(!n)throw Error(`History data not found for document: ${t}`);return n}getDocumentHistoryState(e){let t=this.documentHistories.get(e);if(!t)throw Error(`History data not found for document: ${e}`);let n={};return Array.from(t.topicHistories.entries()).forEach(([e,t])=>{n[e]={canUndo:t.currentIndex>-1,canRedo:t.currentIndex<t.commands.length-1}}),{global:{canUndo:t.globalIndex>-1,canRedo:t.globalIndex<t.globalTimeline.length-1},topics:n}}emitHistoryChange(e,t){let n=this.getDocumentHistoryState(e);this.dispatch(((e,t)=>({type:xh,payload:{documentId:e,state:t}}))(e,n)),this.historyChange$.emit({documentId:e,topic:t,state:n})}register(e,t,n){let r=this.getDocumentHistoryData(n);r.topicHistories.has(t)||r.topicHistories.set(t,{commands:[],currentIndex:-1});let i=r.topicHistories.get(t);i.commands.splice(i.currentIndex+1),i.commands.push(e),i.currentIndex++;let a={command:e,topic:t};r.globalTimeline.splice(r.globalIndex+1),r.globalTimeline.push(a),r.globalIndex++,e.execute(),this.emitHistoryChange(n,t)}undo(e,t){let n=this.getDocumentHistoryData(t),r;if(e){let t=n.topicHistories.get(e);t&&t.currentIndex>-1&&(t.commands[t.currentIndex].undo(),t.currentIndex--,r=e)}else if(n.globalIndex>-1){let e=n.globalTimeline[n.globalIndex];e.command.undo(),n.topicHistories.get(e.topic).currentIndex--,n.globalIndex--,r=e.topic}r&&this.emitHistoryChange(t,r)}redo(e,t){let n=this.getDocumentHistoryData(t),r;if(e){let t=n.topicHistories.get(e);t&&t.currentIndex<t.commands.length-1&&(t.currentIndex++,t.commands[t.currentIndex].execute(),r=e)}else if(n.globalIndex<n.globalTimeline.length-1){n.globalIndex++;let e=n.globalTimeline[n.globalIndex];e.command.execute(),n.topicHistories.get(e.topic).currentIndex++,r=e.topic}r&&this.emitHistoryChange(t,r)}canUndo(e,t){let n=this.getDocumentHistoryData(t);if(e){let t=n.topicHistories.get(e);return!!t&&t.currentIndex>-1}return n.globalIndex>-1}canRedo(e,t){let n=this.getDocumentHistoryData(t);if(e){let t=n.topicHistories.get(e);return!!t&&t.currentIndex<t.commands.length-1}return n.globalIndex<n.globalTimeline.length-1}purgeByMetadata(e,t,n){let r=this.getDocumentHistoryData(n),i=0,a=t=>e(t.metadata),o=t?[t]:Array.from(r.topicHistories.keys());for(let e of o){let t=r.topicHistories.get(e);if(!t)continue;let n=[],o=0;for(let e=0;e<t.commands.length;e++){let r=t.commands[e];a(r)?(e<=t.currentIndex&&o++,i++):n.push(r)}t.commands=n,t.currentIndex=Math.max(-1,t.currentIndex-o)}let s=[],c=0;for(let e=0;e<r.globalTimeline.length;e++){let n=r.globalTimeline[e];(!t||n.topic===t)&&a(n.command)?e<=r.globalIndex&&c++:s.push(n)}return r.globalTimeline=s,r.globalIndex=Math.max(-1,r.globalIndex-c),i>0&&(this.emitHistoryChange(n,t),this.logger.debug(`HistoryPlugin`,`PurgeByMetadata`,`Purged ${i} history entries for document: ${n}${t?`, topic: ${t}`:``}`)),i}createHistoryScope(e){return{register:(t,n)=>this.register(t,n,e),undo:t=>this.undo(t,e),redo:t=>this.redo(t,e),canUndo:t=>this.canUndo(t,e),canRedo:t=>this.canRedo(t,e),getHistoryState:()=>this.getDocumentHistoryState(e),onHistoryChange:t=>this.historyChange$.on(n=>{n.documentId===e&&t(n.topic)}),purgeByMetadata:(t,n)=>this.purgeByMetadata(t,n,e)}}buildCapability(){return{register:(e,t)=>{let n=this.getActiveDocumentId();this.register(e,t,n)},undo:e=>{let t=this.getActiveDocumentId();this.undo(e,t)},redo:e=>{let t=this.getActiveDocumentId();this.redo(e,t)},canUndo:e=>{let t=this.getActiveDocumentId();return this.canUndo(e,t)},canRedo:e=>{let t=this.getActiveDocumentId();return this.canRedo(e,t)},getHistoryState:()=>{let e=this.getActiveDocumentId();return this.getDocumentHistoryState(e)},forDocument:e=>this.createHistoryScope(e),onHistoryChange:this.historyChange$.on,purgeByMetadata:(e,t)=>{let n=this.getActiveDocumentId();return this.purgeByMetadata(e,t,n)}}}async destroy(){this.historyChange$.clear(),this.documentHistories.clear(),super.destroy()}};Sh.id=`history`;var Ch=Sh,wh={global:{canUndo:!1,canRedo:!1},topics:{}},Th={documents:{},activeDocumentId:null},Eh={manifest:vh,create:e=>new Ch(_h,e),reducer:(e=Th,t)=>{switch(t.type){case yh:{let{documentId:n}=t.payload;return{...e,documents:{...e.documents,[n]:{...wh}}}}case bh:{let{documentId:n}=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case xh:{let{documentId:n,state:r}=t.payload;return e.documents[n]?{...e,documents:{...e.documents,[n]:r}}:e}case`HISTORY/SET_ACTIVE_DOCUMENT`:return{...e,activeDocumentId:t.payload};default:return e}},initialState:Th},Dh=(e=>(e.Redact=`redact`,e.MarqueeRedact=`marqueeRedact`,e.RedactSelection=`redactSelection`,e))(Dh||{}),Oh=`REDACTION/INIT_STATE`,kh=`REDACTION/CLEANUP_STATE`,Ah=`START_REDACTION`,jh=`END_REDACTION`,Mh=`ADD_PENDING`,Nh=`REMOVE_PENDING`,Ph=`UPDATE_PENDING`,Fh=`CLEAR_PENDING`,Ih=`SELECT_PENDING`,Lh=`DESELECT_PENDING`,Rh=(e,t)=>({type:Mh,payload:{documentId:e,items:t}}),zh=(e,t,n)=>({type:Nh,payload:{documentId:e,page:t,id:n}}),Bh=e=>({type:Fh,payload:e}),Vh=(e,t,n,r)=>({type:Ph,payload:{documentId:e,page:t,id:n,patch:r}}),Hh=(e,t,n)=>({type:Ih,payload:{documentId:e,page:t,id:n}}),Uh=e=>({type:Lh,payload:e}),Wh=e=>Object.values(e).reduce((e,t)=>e+t.length,0),Gh={isRedacting:!1,activeType:null,pending:{},pendingCount:0,selected:null},Kh={documents:{},activeDocumentId:null},qh={id:`redact`,name:`Redact`,categories:[`annotation`,`redaction`],matchScore:e=>e.type===z.REDACT?10:0,interaction:{mode:Dh.Redact,exclusive:!1,cursor:`crosshair`,textSelection:!0,isDraggable:e=>e.type!==z.REDACT||!e.segmentRects?.length,isResizable:e=>e.type!==z.REDACT||!e.segmentRects?.length,isRotatable:!1,lockAspectRatio:!1,isGroupDraggable:!1,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:z.REDACT,color:`#000000`,overlayColor:`#FFFFFF`,strokeColor:`#E44234`,opacity:1},behavior:{useAppearanceStream:!1}},Jh=[qh],Yh=class extends Rr{constructor(e,t,n){if(super(e,t),this.redactionSelection$=new Map,this.redactionMarquee$=new Map,this.pending$=J(),this.selected$=J(),this.state$=J(),this.events$=J(),this.documentUnsubscribers=new Map,this.config=n,this.selectionCapability=this.registry.getPlugin(`selection`)?.provides(),this.interactionManagerCapability=this.registry.getPlugin(`interaction-manager`)?.provides(),this.annotationCapability=this.registry.getPlugin(`annotation`)?.provides(),this.historyCapability=this.registry.getPlugin(`history`)?.provides(),this.config.useAnnotationMode?this.annotationCapability?this.useAnnotationMode=!0:(this.logger.warn(`RedactionPlugin`,`ConfigError`,`useAnnotationMode is enabled but annotation plugin is not available. Falling back to legacy mode.`),this.useAnnotationMode=!1):this.useAnnotationMode=!1,this.useAnnotationMode&&this.annotationCapability)for(let e of Jh)this.annotationCapability.addTool(e);this.setupRedactionModes(),!this.useAnnotationMode&&this.annotationCapability&&this.logger.info(`RedactionPlugin`,`LegacyMode`,`Using legacy redaction mode. Set useAnnotationMode: true in config to use annotation-based redactions.`),this.setupModeChangeListener()}setupRedactionModes(){this.interactionManagerCapability&&(this.interactionManagerCapability.registerMode({id:Dh.Redact,scope:`page`,exclusive:!1,cursor:`crosshair`}),this.interactionManagerCapability.registerMode({id:Dh.MarqueeRedact,scope:`page`,exclusive:!1,cursor:`crosshair`}),this.interactionManagerCapability.registerMode({id:Dh.RedactSelection,scope:`page`,exclusive:!1}))}setupModeChangeListener(){var e;(e=this.interactionManagerCapability)==null||e.onModeChange(e=>{let t=e.documentId;if(e.activeMode===Dh.Redact||e.activeMode===Dh.MarqueeRedact||e.activeMode===Dh.RedactSelection)this.dispatch(((e,t)=>({type:Ah,payload:{documentId:e,mode:t}}))(t,e.activeMode));else{let e=this.getDocumentState(t);e!=null&&e.isRedacting&&this.dispatch((e=>({type:jh,payload:e}))(t))}})}onDocumentLoadingStarted(e){this.dispatch(function(e,t){return{type:Oh,payload:{documentId:e,state:t}}}(e,{...Gh})),this.redactionSelection$.set(e,J()),this.redactionMarquee$.set(e,J());let t=[];if(this.selectionCapability){let n=this.selectionCapability.forDocument(e),r=n.onSelectionChange(()=>{if(!this.getDocumentState(e)?.isRedacting)return;let t=n.getFormattedSelection();this.redactionSelection$.get(e)?.emit(t)}),i=n.onEndSelection(()=>{if(!this.getDocumentState(e)?.isRedacting||!this.checkPermission(e,U.ModifyContents))return;let t=n.getFormattedSelection();if(!t.length)return;let r=n.getSelectedText();this.redactionSelection$.get(e)?.emit([]),n.clear(),r.wait(n=>{let r=n.join(` `);this.createRedactionsFromSelection(e,t,r)},()=>{this.createRedactionsFromSelection(e,t)})}),a=n.onMarqueeChange(t=>{var n;let r=this.getDocumentState(e);r!=null&&r.isRedacting&&((n=this.redactionMarquee$.get(e))==null||n.emit({pageIndex:t.pageIndex,rect:t.rect,modeId:t.modeId}))}),o=n.onMarqueeEnd(t=>{if(this.getDocumentState(e)?.isRedacting&&this.checkPermission(e,U.ModifyContents)){if(this.useAnnotationMode)this.createRedactAnnotationFromArea(e,t.pageIndex,t.rect);else{let n=this.config.drawBlackBoxes?`#000000`:`transparent`,r={id:K(),kind:`area`,page:t.pageIndex,rect:t.rect,source:`legacy`,markColor:`#FF0000`,redactionColor:n};this.dispatch(Rh(e,[r])),this.selectPending(t.pageIndex,r.id,e)}}}),s=n.onEmptySpaceClick(()=>{this.deselectPending(e)});t.push(r,i,a,o,s)}if(this.useAnnotationMode&&this.annotationCapability){let n=this.annotationCapability.forDocument(e),r=n.onAnnotationEvent(t=>{if(t.type===`loaded`)return void this.syncFromAnnotationLoad(e);if(t.annotation?.type!==z.REDACT)return;let n=t.annotation;t.type===`create`?(this.syncFromAnnotationCreate(e,n),this.events$.emit({type:`add`,documentId:e,items:[this.annotationToRedactionItem(n)]})):t.type===`update`?(this.logger.debug(`RedactionPlugin`,`AnnotationUpdated`,{documentId:e,redactAnno:n,patch:t.patch}),this.syncFromAnnotationUpdate(e,n,t.patch)):t.type===`delete`&&(this.syncFromAnnotationDelete(e,n),this.events$.emit({type:`remove`,documentId:e,page:n.pageIndex,id:n.id}))}),i=n.onStateChange(()=>{this.syncSelectionFromAnnotation(e)});t.push(r,i)}this.documentUnsubscribers.set(e,t),this.logger.debug(`RedactionPlugin`,`DocumentOpened`,`Initialized redaction state for document: ${e}`)}onDocumentLoaded(e){var t,n,r;(t=this.selectionCapability)==null||t.enableForMode(Dh.Redact,{enableSelection:!0,showSelectionRects:!1,enableMarquee:!0,showMarqueeRects:!1},e),(n=this.selectionCapability)==null||n.enableForMode(Dh.MarqueeRedact,{enableSelection:!1,enableMarquee:!0,showMarqueeRects:!1},e),(r=this.selectionCapability)==null||r.enableForMode(Dh.RedactSelection,{enableSelection:!0,showSelectionRects:!1},e)}onDocumentClosed(e){this.dispatch(function(e){return{type:kh,payload:e}}(e)),this.redactionSelection$.get(e)?.clear(),this.redactionSelection$.delete(e),this.redactionMarquee$.get(e)?.clear(),this.redactionMarquee$.delete(e);let t=this.documentUnsubscribers.get(e);t&&(t.forEach(e=>e()),this.documentUnsubscribers.delete(e)),this.logger.debug(`RedactionPlugin`,`DocumentClosed`,`Cleaned up redaction state for document: ${e}`)}async initialize(e){this.logger.info(`RedactionPlugin`,`Initialize`,`Redaction plugin initialized`)}buildCapability(){return{queueCurrentSelectionAsPending:()=>this.queueCurrentSelectionAsPending(),enableRedact:()=>this.enableRedact(),toggleRedact:()=>this.toggleRedact(),isRedactActive:()=>this.isRedactActive(),endRedact:()=>this.endRedact(),enableMarqueeRedact:()=>this.enableMarqueeRedact(),toggleMarqueeRedact:()=>this.toggleMarqueeRedact(),isMarqueeRedactActive:()=>this.isMarqueeRedactActive(),enableRedactSelection:()=>this.enableRedactSelection(),toggleRedactSelection:()=>this.toggleRedactSelection(),isRedactSelectionActive:()=>this.isRedactSelectionActive(),addPending:e=>this.addPendingItems(e),removePending:(e,t)=>this.removePendingItem(e,t),clearPending:()=>this.clearPendingItems(),commitAllPending:()=>this.commitAllPending(),commitPending:(e,t)=>this.commitPendingOne(e,t),selectPending:(e,t)=>this.selectPending(e,t),getSelectedPending:()=>this.getSelectedPending(),deselectPending:()=>this.deselectPending(),getState:()=>this.getDocumentStateOrThrow(),forDocument:e=>this.createRedactionScope(e),onPendingChange:this.pending$.on,onSelectedChange:this.selected$.on,onRedactionEvent:this.events$.on,onStateChange:this.state$.on}}createRedactionScope(e){return{queueCurrentSelectionAsPending:()=>this.queueCurrentSelectionAsPending(e),enableRedact:()=>this.enableRedact(e),toggleRedact:()=>this.toggleRedact(e),isRedactActive:()=>this.isRedactActive(e),endRedact:()=>this.endRedact(e),enableMarqueeRedact:()=>this.enableMarqueeRedact(e),toggleMarqueeRedact:()=>this.toggleMarqueeRedact(e),isMarqueeRedactActive:()=>this.isMarqueeRedactActive(e),enableRedactSelection:()=>this.enableRedactSelection(e),toggleRedactSelection:()=>this.toggleRedactSelection(e),isRedactSelectionActive:()=>this.isRedactSelectionActive(e),addPending:t=>this.addPendingItems(t,e),removePending:(t,n)=>this.removePendingItem(t,n,e),clearPending:()=>this.clearPendingItems(e),commitAllPending:()=>this.commitAllPending(e),commitPending:(t,n)=>this.commitPendingOne(t,n,e),selectPending:(t,n)=>this.selectPending(t,n,e),getSelectedPending:()=>this.getSelectedPending(e),deselectPending:()=>this.deselectPending(e),getState:()=>this.getDocumentStateOrThrow(e),onPendingChange:t=>this.pending$.on(n=>{n.documentId===e&&t(n.pending)}),onSelectedChange:t=>this.selected$.on(n=>{n.documentId===e&&t(n.selected)}),onRedactionEvent:t=>this.events$.on(n=>{n.documentId===e&&t(n)}),onStateChange:t=>this.state$.on(n=>{n.documentId===e&&t(n.state)})}}getPendingFromAnnotations(e){if(!this.annotationCapability)return{};try{let t=this.annotationCapability.forDocument(e).getState(),n={};for(let e of Object.values(t.byUid))if(e.object.type===z.REDACT){let t=this.annotationToRedactionItem(e.object),r=e.object.pageIndex;(n[r]??(n[r]=[])).push(t)}return n}catch{return{}}}getDocumentState(e){let t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){let t=this.getDocumentState(e);if(!t)throw Error(`Redaction state not found for document: ${e??`active`}`);return t}isRedactTool(e){return e?.id===qh.id&&e.defaults.type===z.REDACT}getRedactTool(){let e=this.annotationCapability?.getTool(`redact`);return this.isRedactTool(e)?e:void 0}syncFromAnnotationCreate(e,t){let n=this.annotationToRedactionItem(t);this.dispatch(Rh(e,[n]))}syncFromAnnotationUpdate(e,t,n){if(!(`rect`in n||`segmentRects`in n||`strokeColor`in n||`color`in n))return;let r={};n.rect&&(r.rect=n.rect),n.segmentRects&&(r.rects=n.segmentRects),n.strokeColor&&(r.markColor=n.strokeColor),n.color&&(r.redactionColor=n.color),this.logger.debug(`RedactionPlugin`,`AnnotationUpdated`,{documentId:e,annotation:t,patch:r}),this.dispatch(Vh(e,t.pageIndex,t.id,r))}syncFromAnnotationDelete(e,t){this.dispatch(zh(e,t.pageIndex,t.id))}syncFromAnnotationLoad(e){let t=this.getPendingFromAnnotations(e);this.dispatch(Bh(e));for(let[,n]of Object.entries(t))n.length>0&&this.dispatch(Rh(e,n))}syncSelectionFromAnnotation(e){let t=this.annotationCapability?.forDocument(e).getState();if(!t)return;let n=t.selectedUids.map(e=>t.byUid[e]).find(e=>e?.object.type===z.REDACT);if(n){let t=n.object;this.dispatch(Hh(e,t.pageIndex,t.id))}else{let t=this.getDocumentState(e);t!=null&&t.selected&&this.dispatch(Uh(e))}}addPendingItems(e,t){let n=t??this.getActiveDocumentId();if(this.checkPermission(n,U.ModifyContents)){if(this.useAnnotationMode){if(!this.annotationCapability)return;let t=this.annotationCapability.forDocument(n);for(let n of e){let e=this.redactionItemToAnnotation(n);t.createAnnotation(n.page,e)}if(e.length>0){let n=e[e.length-1];t.selectAnnotation(n.page,n.id)}}else this.dispatch(Rh(n,e));this.events$.emit({type:`add`,documentId:n,items:e})}else this.logger.debug(`RedactionPlugin`,`AddPendingItems`,`Cannot add redactions: document ${n} lacks ModifyContents permission`)}removePendingItem(e,t,n){var r;let i=n??this.getActiveDocumentId();this.useAnnotationMode?(r=this.annotationCapability)==null||r.forDocument(i).deleteAnnotation(e,t):this.dispatch(zh(i,e,t)),this.events$.emit({type:`remove`,documentId:i,page:e,id:t})}clearPendingItems(e){let t=e??this.getActiveDocumentId();if(this.useAnnotationMode){let e=this.getPendingFromAnnotations(t),n=this.annotationCapability?.forDocument(t);for(let[t,r]of Object.entries(e)){let e=Number(t);for(let t of r)n?.deleteAnnotation(e,t.id)}}else this.dispatch(Bh(t));this.events$.emit({type:`clear`,documentId:t})}selectPending(e,t,n){var r,i,a;let o=n??this.getActiveDocumentId();this.useAnnotationMode?(r=this.annotationCapability)==null||r.forDocument(o).selectAnnotation(e,t):(this.dispatch(Hh(o,e,t)),(i=this.interactionManagerCapability)==null||i.claimPageActivity(o,`redaction-selection`,e)),(a=this.selectionCapability)==null||a.forDocument(o).clear()}getSelectedPending(e){let t=e??this.getActiveDocumentId();return this.getDocumentState(t)?.selected??null}deselectPending(e){var t,n;let r=e??this.getActiveDocumentId();this.useAnnotationMode?(t=this.annotationCapability)==null||t.forDocument(r).deselectAnnotation():(this.dispatch(Uh(r)),(n=this.interactionManagerCapability)==null||n.releasePageActivity(r,`redaction-selection`))}enableRedactSelection(e){var t;let n=e??this.getActiveDocumentId();this.checkPermission(n,U.ModifyContents)?(t=this.interactionManagerCapability)==null||t.forDocument(n).activate(Dh.RedactSelection):this.logger.debug(`RedactionPlugin`,`EnableRedactSelection`,`Cannot enable redact selection: document ${n} lacks ModifyContents permission`)}toggleRedactSelection(e){let t=e??this.getActiveDocumentId(),n=this.interactionManagerCapability?.forDocument(t);if(n?.getActiveMode()===Dh.RedactSelection)n?.activateDefaultMode();else{if(!this.checkPermission(t,U.ModifyContents))return;n?.activate(Dh.RedactSelection)}}isRedactSelectionActive(e){let t=e??this.getActiveDocumentId(),n=this.interactionManagerCapability?.forDocument(t).getActiveMode();return n===Dh.Redact||n===Dh.RedactSelection}enableMarqueeRedact(e){var t;let n=e??this.getActiveDocumentId();this.checkPermission(n,U.ModifyContents)?(t=this.interactionManagerCapability)==null||t.forDocument(n).activate(Dh.MarqueeRedact):this.logger.debug(`RedactionPlugin`,`EnableMarqueeRedact`,`Cannot enable marquee redact: document ${n} lacks ModifyContents permission`)}toggleMarqueeRedact(e){let t=e??this.getActiveDocumentId(),n=this.interactionManagerCapability?.forDocument(t);if(n?.getActiveMode()===Dh.MarqueeRedact)n?.activateDefaultMode();else{if(!this.checkPermission(t,U.ModifyContents))return;n?.activate(Dh.MarqueeRedact)}}isMarqueeRedactActive(e){let t=e??this.getActiveDocumentId(),n=this.interactionManagerCapability?.forDocument(t).getActiveMode();return n===Dh.Redact||n===Dh.MarqueeRedact}enableRedact(e){var t;let n=e??this.getActiveDocumentId();this.checkPermission(n,U.ModifyContents)?(t=this.interactionManagerCapability)==null||t.forDocument(n).activate(Dh.Redact):this.logger.debug(`RedactionPlugin`,`EnableRedact`,`Cannot enable redact mode: document ${n} lacks ModifyContents permission`)}toggleRedact(e){let t=e??this.getActiveDocumentId(),n=this.interactionManagerCapability?.forDocument(t);if(n?.getActiveMode()===Dh.Redact)n?.activateDefaultMode();else{if(!this.checkPermission(t,U.ModifyContents))return;n?.activate(Dh.Redact)}}isRedactActive(e){let t=e??this.getActiveDocumentId();return this.interactionManagerCapability?.forDocument(t).getActiveMode()===Dh.Redact}endRedact(e){var t;let n=e??this.getActiveDocumentId();(t=this.interactionManagerCapability)==null||t.forDocument(n).activateDefaultMode()}onRedactionSelectionChange(e,t){return this.redactionSelection$.get(e)?.on(t)??(()=>{})}onRedactionMarqueeChange(e,t){return this.redactionMarquee$.get(e)?.on(t)??(()=>{})}getPreviewStrokeColor(){return this.useAnnotationMode?this.getRedactTool()?.defaults.strokeColor??`#FF0000`:`#FF0000`}queueCurrentSelectionAsPending(e){let t=e??this.getActiveDocumentId();if(!this.selectionCapability)return G.reject({code:W.NotFound,message:`[RedactionPlugin] selection plugin required`});if(!this.coreState.core.documents[t]?.document)return G.reject({code:W.NotFound,message:`Document not found`});let n=this.selectionCapability.forDocument(t),r=n.getFormattedSelection();if(!r.length)return G.resolve(!0);let i=n.getSelectedText();this.redactionSelection$.get(t)?.emit([]),n.clear(),this.useAnnotationMode||this.enableRedactSelection(t);let a=new L;return i.wait(e=>{let n=e.join(` `);this.createRedactionsFromSelection(t,r,n),a.resolve(!0)},()=>{this.createRedactionsFromSelection(t,r),a.resolve(!0)}),a}commitPendingOne(e,t,n){let r=n??this.getActiveDocumentId();if(!this.checkPermission(r,U.ModifyContents))return this.logger.debug(`RedactionPlugin`,`CommitPendingOne`,`Cannot commit redaction: document ${r} lacks ModifyContents permission`),G.reject({code:W.Security,message:`Document lacks ModifyContents permission`});let i=this.coreState.core.documents[r];if(!i?.document)return G.reject({code:W.NotFound,message:`Document not found`});let a=i.document.pages[e];if(!a)return G.reject({code:W.NotFound,message:`Page not found`});if(this.useAnnotationMode)return this.logger.debug(`RedactionPlugin`,`CommitPendingOne`,`Applying redaction in annotation mode: page ${e}, id ${t}`),this.applyRedactionAnnotationMode(r,i.document,a,t);let o=this.getDocumentState(r);if(!o)return G.reject({code:W.NotFound,message:`Document state not found`});let s=(o.pending[e]??[]).find(e=>e.id===t);return s?this.commitPendingOneLegacy(r,i.document,a,e,s):(this.logger.debug(`RedactionPlugin`,`CommitPendingOne`,`No pending item found for page ${e}, id ${t}`),G.resolve(!0))}commitPendingOneLegacy(e,t,n,r,i){let a=i.kind===`text`?i.rects:[i.rect],o=new L;return this.engine.redactTextInRects(t,n,a,{drawBlackBoxes:this.config.drawBlackBoxes}).wait(()=>{this.dispatch(zh(e,r,i.id)),this.dispatchCoreAction(Tr(e,[r])),this.events$.emit({type:`commit`,documentId:e,success:!0}),o.resolve(!0)},t=>{this.events$.emit({type:`commit`,documentId:e,success:!1,error:t.reason}),o.reject({code:W.Unknown,message:`Failed to commit redactions`})}),o}applyRedactionAnnotationMode(e,t,n,r){let i=new L,a=this.annotationCapability?.forDocument(e).getAnnotationById(r);return this.logger.debug(`RedactionPlugin`,`ApplyRedactionAnnotationMode`,`Looking for annotation ${r}, found: ${!!a}, type: ${a?.object.type}`),a&&a.object.type===z.REDACT?(this.logger.debug(`RedactionPlugin`,`ApplyRedactionAnnotationMode`,`Calling engine.applyRedaction for annotation ${r} on page ${n.index}`),this.engine.applyRedaction(t,n,a.object).wait(()=>{var t,a;this.logger.debug(`RedactionPlugin`,`ApplyRedactionAnnotationMode`,`Successfully applied redaction ${r} on page ${n.index}`),(t=this.annotationCapability)==null||t.forDocument(e).purgeAnnotation(n.index,r),this.dispatch(zh(e,n.index,r)),(a=this.historyCapability)==null||a.forDocument(e).purgeByMetadata(e=>(e?.annotationIds)?.includes(r)??!1,`annotations`),this.dispatchCoreAction(Tr(e,[n.index])),this.events$.emit({type:`commit`,documentId:e,success:!0}),i.resolve(!0)},t=>{this.logger.error(`RedactionPlugin`,`ApplyRedactionAnnotationMode`,`Failed to apply redaction ${r}: ${t.reason?.message??`Unknown error`}`),this.events$.emit({type:`commit`,documentId:e,success:!1,error:t.reason}),i.reject({code:W.Unknown,message:`Failed to apply redaction`})}),i):(this.logger.warn(`RedactionPlugin`,`ApplyRedactionAnnotationMode`,`Redaction annotation not found or wrong type: ${r}`),G.reject({code:W.NotFound,message:`Redaction annotation not found`}))}commitAllPending(e){let t=e??this.getActiveDocumentId();if(!this.checkPermission(t,U.ModifyContents))return this.logger.debug(`RedactionPlugin`,`CommitAllPending`,`Cannot commit redactions: document ${t} lacks ModifyContents permission`),G.reject({code:W.Security,message:`Document lacks ModifyContents permission`});let n=this.coreState.core.documents[t];if(!n?.document)return G.reject({code:W.NotFound,message:`Document not found`});let r=this.getDocumentState(t);return r?this.useAnnotationMode?this.applyAllRedactionsAnnotationMode(t,n.document):this.commitAllPendingLegacy(t,n.document,r):G.reject({code:W.NotFound,message:`Document state not found`})}commitAllPendingLegacy(e,t,n){let r=new Map;for(let[e,t]of Object.entries(n.pending)){let n=Number(e),i=r.get(n)??[];for(let e of t)e.kind===`text`?i.push(...e.rects):i.push(e.rect);r.set(n,i)}let i=Array.from(r.entries()).filter(([e,t])=>t.length>0).map(([e])=>e),a=[];for(let[e,n]of r){let r=t.pages[e];r&&n.length&&a.push(this.engine.redactTextInRects(t,r,n,{drawBlackBoxes:this.config.drawBlackBoxes}))}let o=new L;return L.all(a).wait(()=>{this.dispatch(Bh(e)),this.dispatchCoreAction(Tr(e,i)),this.events$.emit({type:`commit`,documentId:e,success:!0}),o.resolve(!0)},t=>{this.events$.emit({type:`commit`,documentId:e,success:!1,error:t.reason}),o.reject({code:W.Unknown,message:`Failed to commit redactions`})}),o}applyAllRedactionsAnnotationMode(e,t){let n=this.annotationCapability;if(!n)return G.reject({code:W.NotFound,message:`Annotation capability not found`});let r=n.forDocument(e).getState(),i=new Map;for(let e of Object.values(r.byUid))if(e.object.type===z.REDACT){let t=i.get(e.object.pageIndex)??[];t.push(e.object.id),i.set(e.object.pageIndex,t)}let a=Array.from(i.keys());if(a.length===0)return G.resolve(!0);let o=[];for(let e of a){let n=t.pages[e];n&&o.push(this.engine.applyAllRedactions(t,n))}let s=new L;return L.all(o).wait(()=>{var t;let r=n.forDocument(e),o=[];for(let[t,n]of i)for(let i of n)r.purgeAnnotation(t,i),this.dispatch(zh(e,t,i)),o.push(i);o.length>0&&((t=this.historyCapability)==null||t.forDocument(e).purgeByMetadata(e=>(e?.annotationIds)?.some(e=>o.includes(e))??!1,`annotations`)),this.dispatchCoreAction(Tr(e,a)),this.events$.emit({type:`commit`,documentId:e,success:!0}),s.resolve(!0)},t=>{this.events$.emit({type:`commit`,documentId:e,success:!1,error:t.reason}),s.reject({code:W.Unknown,message:`Failed to apply redactions`})}),s}createRedactAnnotationsFromSelection(e,t,n){if(!this.annotationCapability)return[];let r=this.annotationCapability.forDocument(e),i=this.getRedactTool()?.defaults,a=[];for(let e of t){let o=K();a.push(o);let s={...i,id:o,type:z.REDACT,pageIndex:e.pageIndex,rect:e.rect,segmentRects:e.segmentRects,...n?{custom:{text:n}}:{},created:new Date};r.createAnnotation(e.pageIndex,s),e===t[t.length-1]&&r.selectAnnotation(e.pageIndex,o)}if(n)for(let r=0;r<a.length;r++){let i=t[r].pageIndex;this.dispatch(Vh(e,i,a[r],{text:n}))}return a}createLegacyRedactionsFromSelection(e,t,n){let r=this.config.drawBlackBoxes?`#000000`:`transparent`,i=t.map(e=>({id:K(),kind:`text`,page:e.pageIndex,rect:e.rect,rects:e.segmentRects,source:`legacy`,markColor:`#FF0000`,redactionColor:r,text:n}));this.dispatch(Rh(e,i)),i.length&&this.selectPending(i[i.length-1].page,i[i.length-1].id,e)}createRedactionsFromSelection(e,t,n){this.useAnnotationMode?this.createRedactAnnotationsFromSelection(e,t,n):this.createLegacyRedactionsFromSelection(e,t,n)}createRedactAnnotationFromArea(e,t,n){if(!this.annotationCapability)return;let r=this.annotationCapability.forDocument(e),i=this.getRedactTool()?.defaults,a=K(),o={...i,id:a,type:z.REDACT,pageIndex:t,rect:n,segmentRects:[],created:new Date};r.createAnnotation(t,o),r.selectAnnotation(t,a)}redactionItemToAnnotation(e){return{...this.getRedactTool()?.defaults??{},id:e.id,type:z.REDACT,pageIndex:e.page,rect:e.rect,segmentRects:e.kind===`text`?e.rects:[],created:new Date}}annotationToRedactionItem(e){let t=e.strokeColor??`#FF0000`,n=e.color??`transparent`;return e.segmentRects&&e.segmentRects.length>0?{id:e.id,kind:`text`,page:e.pageIndex,rect:e.rect,rects:e.segmentRects,source:`annotation`,markColor:t,redactionColor:n,...e.custom?.text?{text:e.custom.text}:{}}:{id:e.id,kind:`area`,page:e.pageIndex,rect:e.rect,source:`annotation`,markColor:t,redactionColor:n}}emitPendingChange(e){let t=this.getDocumentState(e);t&&this.pending$.emit({documentId:e,pending:t.pending})}emitSelectedChange(e){let t=this.getDocumentState(e);t&&this.selected$.emit({documentId:e,selected:t.selected})}emitStateChange(e){let t=this.getDocumentState(e);t&&this.state$.emit({documentId:e,state:t})}onStoreUpdated(e,t){for(let e in t.documents)t.documents[e]&&(this.emitPendingChange(e),this.emitSelectedChange(e),this.emitStateChange(e))}async destroy(){this.pending$.clear(),this.selected$.clear(),this.state$.clear(),this.events$.clear(),this.redactionSelection$.forEach(e=>e.clear()),this.redactionSelection$.clear(),this.redactionMarquee$.forEach(e=>e.clear()),this.redactionMarquee$.clear(),this.documentUnsubscribers.forEach(e=>{e.forEach(e=>e())}),this.documentUnsubscribers.clear(),await super.destroy()}};Yh.id=`redaction`;var Xh=Yh,Zh=`redaction`,Qh={manifest:{id:Zh,name:`Redaction Plugin`,version:`1.0.0`,provides:[`redaction`],requires:[],optional:[`interaction-manager`,`selection`,`annotation`],defaultConfig:{drawBlackBoxes:!0}},create:(e,t)=>new Xh(Zh,e,t),reducer:(e=Kh,t)=>{switch(t.type){case Oh:{let{documentId:n,state:r}=t.payload;return{...e,documents:{...e.documents,[n]:r},activeDocumentId:e.activeDocumentId??n}}case kh:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case`REDACTION/SET_ACTIVE_DOCUMENT`:return{...e,activeDocumentId:t.payload};case Mh:{let{documentId:n,items:r}=t.payload,i=e.documents[n];if(!i)return e;let a={...i.pending};for(let e of r){let t=a[e.page]??[];t.some(t=>t.id===e.id)||(a[e.page]=t.concat(e))}return{...e,documents:{...e.documents,[n]:{...i,pending:a,pendingCount:Wh(a)}}}}case Nh:{let{documentId:n,page:r,id:i}=t.payload,a=e.documents[n];if(!a)return e;let o=(a.pending[r]??[]).filter(e=>e.id!==i),s={...a.pending,[r]:o},c=a.selected&&(a.selected.page!==r||a.selected.id!==i);return{...e,documents:{...e.documents,[n]:{...a,pending:s,pendingCount:Wh(s),selected:c?a.selected:null}}}}case Ph:{let{documentId:n,page:r,id:i,patch:a}=t.payload,o=e.documents[n];if(!o)return e;let s=(o.pending[r]??[]).map(e=>e.id===i?{...e,...a}:e);return{...e,documents:{...e.documents,[n]:{...o,pending:{...o.pending,[r]:s}}}}}case Fh:{let n=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:{...r,pending:{},pendingCount:0,selected:null}}}:e}case Ih:{let{documentId:n,page:r,id:i}=t.payload,a=e.documents[n];return a?{...e,documents:{...e.documents,[n]:{...a,selected:{page:r,id:i}}}}:e}case Lh:{let n=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:{...r,selected:null}}}:e}case Ah:{let{documentId:n,mode:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,isRedacting:!0,activeType:r}}}:e}case jh:{let n=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:{...r,isRedacting:!1,activeType:null}}}:e}case`SET_ACTIVE_TYPE`:{let{documentId:n,mode:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,activeType:r}}}:e}default:return e}},initialState:Kh};function $h({annotation:e,isSelected:t,scale:n,onClick:r,style:i}){let[a,o]=j(!1),{object:s}=e,c=s.segmentRects??[],l=s.rect,u=s.strokeColor??`#FF0000`,d=s.color??`#000000`,f=s.opacity??1,p=s.fontColor??s.overlayColor??`#FFFFFF`,m=s.overlayText,h=s.overlayTextRepeat??!1,g=s.fontSize??12,_=s.fontFamily??Xt.Helvetica,v=s.textAlign??Zt.Center,y=()=>m?h?Array(10).fill(m).join(` `):m:null;return I(`div`,{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{position:`absolute`,inset:0},children:c.map((e,t)=>I(`div`,{onPointerDown:r,style:{position:`absolute`,left:(l?e.origin.x-l.origin.x:e.origin.x)*n,top:(l?e.origin.y-l.origin.y:e.origin.y)*n,width:e.size.width*n,height:e.size.height*n,background:a?d:`transparent`,border:a?`none`:`2px solid ${u}`,opacity:a?f:1,boxSizing:`border-box`,pointerEvents:`auto`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:v===Zt.Left?`flex-start`:v===Zt.Right?`flex-end`:`center`,overflow:`hidden`,...i},children:a&&m&&I(`span`,{style:{color:p,fontSize:Math.min(g*n,e.size.height*n*.8),...Gn(_),textAlign:Nn(v),whiteSpace:h?`normal`:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,lineHeight:1},children:y()})},t))})}function eg({annotation:e,isSelected:t,scale:n,onClick:r,style:i}){let[a,o]=j(!1),{object:s}=e,c=s.strokeColor??`#FF0000`,l=s.color??`#000000`,u=s.opacity??1,d=s.fontColor??s.overlayColor??`#FFFFFF`,f=s.overlayText,p=s.overlayTextRepeat??!1,m=s.fontSize??12,h=s.fontFamily??Xt.Helvetica,g=s.textAlign??Zt.Center;return I(`div`,{onPointerDown:t?void 0:r,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{position:`absolute`,inset:0,background:a?l:`transparent`,border:a?`none`:`2px solid ${c}`,opacity:a?u:1,boxSizing:`border-box`,pointerEvents:`auto`,cursor:t?`move`:`pointer`,display:`flex`,alignItems:`center`,justifyContent:g===Zt.Left?`flex-start`:g===Zt.Right?`flex-end`:`center`,overflow:`hidden`,...i},children:a&&f&&I(`span`,{style:{color:d,fontSize:m*n,...Gn(h),textAlign:Nn(g),whiteSpace:p?`normal`:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,padding:`4px`},children:f?p?Array(10).fill(f).join(` `):f:null})})}var tg=[nm({id:`redactHighlight`,matches:e=>e.type===z.REDACT&&`segmentRects`in e&&(e.segmentRects?.length??0)>0,render:({annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i})=>I($h,{annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i}),interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1}),nm({id:`redactArea`,matches:e=>!(e.type!==z.REDACT||`segmentRects`in e&&e.segmentRects?.length),render:({annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i})=>I(eg,{annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i}),interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1})],ng=()=>$r(Xh.id),rg=()=>ei(Xh.id),ig=({documentId:e,pageIndex:t,scale:n,className:r,stroke:i,fill:a=`transparent`})=>{let{plugin:o}=ng(),s=ni(e),[c,l]=j(null),u=n??s?.scale??1,d=i??o?.getPreviewStrokeColor()??`red`;return M(()=>{if(o&&e)return o.onRedactionMarqueeChange(e,e=>{l(e.pageIndex===t?e.rect:null)})},[o,e,t]),c?I(`div`,{style:{position:`absolute`,pointerEvents:`none`,left:c.origin.x*u,top:c.origin.y*u,width:c.size.width*u,height:c.size.height*u,border:`1px solid ${d}`,background:a,boxSizing:`border-box`},className:r}):null};function ag({color:e=`#FFFF00`,opacity:t=1,border:n=`1px solid red`,rects:r,rect:i,scale:a,onClick:o,style:s,...c}){return I(A,{children:r.map((r,l)=>I(`div`,{onPointerDown:o,style:{position:`absolute`,border:n,left:(i?r.origin.x-i.origin.x:r.origin.x)*a,top:(i?r.origin.y-i.origin.y:r.origin.y)*a,width:r.size.width*a,height:r.size.height*a,background:e,opacity:t,pointerEvents:o?`auto`:`none`,cursor:o?`pointer`:`default`,zIndex:o?1:void 0,...s},...c},l))})}function og({documentId:e,pageIndex:t,scale:n}){let{plugin:r}=ng(),[i,a]=j([]),[o,s]=j(null),c=r?.getPreviewStrokeColor()??`red`;return M(()=>{if(r)return r.onRedactionSelectionChange(e,e=>{let n=e.find(e=>e.pageIndex===t);a(n?.segmentRects??[]),s(n?.rect??null)})},[r,e,t]),o?I(`div`,{style:{mixBlendMode:`normal`,pointerEvents:`none`,position:`absolute`,inset:0},children:I(ag,{color:`transparent`,opacity:1,rects:i,scale:n,border:`1px solid ${c}`})}):null}function sg({documentId:e,pageIndex:t,scale:n,bboxStroke:r=`rgba(0,0,0,0.8)`,rotation:i=ut.Degree0,selectionMenu:a}){let{provides:o}=rg(),[s,c]=j([]),[l,u]=j(null);M(()=>{if(!o)return;let n=o.forDocument(e),r=n.getState();c((r.pending[t]??[]).filter(e=>e.source===`legacy`)),u(r.selected&&r.selected.page===t?r.selected.id:null);let i=n.onPendingChange(e=>{c((e[t]??[]).filter(e=>e.source===`legacy`))}),a=n.onSelectedChange(e=>{u(e&&e.page===t?e.id:null)});return()=>{i?.(),a?.()}},[o,e,t]);let d=F((n,r)=>{n.stopPropagation(),o&&o.forDocument(e).selectPending(t,r)},[o,e,t]);return s.length?I(`div`,{style:{position:`absolute`,inset:0,pointerEvents:`none`},children:s.map(e=>{if(e.kind===`area`){let o=e.rect;return I(A,{children:[I(`div`,{style:{position:`absolute`,left:o.origin.x*n,top:o.origin.y*n,width:o.size.width*n,height:o.size.height*n,background:`transparent`,outline:l===e.id?`1px solid ${r}`:`none`,outlineOffset:`2px`,border:`1px solid ${e.markColor}`,pointerEvents:`auto`,cursor:`pointer`},onPointerDown:t=>d(t,e.id)}),a&&I(Yc,{rect:{origin:{x:o.origin.x*n,y:o.origin.y*n},size:{width:o.size.width*n,height:o.size.height*n}},rotation:i,children:n=>a({...n,context:{type:`redaction`,item:e,pageIndex:t},selected:l===e.id,placement:{suggestTop:!1}})})]},e.id)}let o=e.rect;return I(A,{children:[I(`div`,{style:{position:`absolute`,left:o.origin.x*n,top:o.origin.y*n,width:o.size.width*n,height:o.size.height*n,background:`transparent`,outline:l===e.id?`1px solid ${r}`:`none`,outlineOffset:`2px`,pointerEvents:`auto`,cursor:l===e.id?`pointer`:`default`},children:I(ag,{rect:o,rects:e.rects,color:`transparent`,border:`1px solid ${e.markColor}`,scale:n,onClick:t=>d(t,e.id)})}),a&&I(Yc,{rect:{origin:{x:o.origin.x*n,y:o.origin.y*n},size:{width:o.size.width*n,height:o.size.height*n}},rotation:i,children:n=>a({...n,context:{type:`redaction`,item:e,pageIndex:t},selected:l===e.id,placement:{suggestTop:!1}})})]},e.id)})}):null}var cg=({documentId:e,pageIndex:t,scale:n,rotation:r,selectionMenu:i})=>{let a=ni(e),o=a?.document?.pages?.[t],s=P(()=>n===void 0?a?.scale??1:n,[n,a?.scale]);return I(A,{children:[I(sg,{documentId:e,pageIndex:t,scale:s,rotation:P(()=>r===void 0?((o?.rotation??0)+(a?.rotation??0))%4:r,[r,o?.rotation,a?.rotation]),selectionMenu:i}),I(ig,{documentId:e,pageIndex:t,scale:s}),I(og,{documentId:e,pageIndex:t,scale:s})]})},lg=Yr(Qh).addUtility(function(){return Up(tg),null}).build(),ug=class extends Rr{constructor(e,t){super(e,t)}async initialize(e){}buildCapability(){return{getAttachments:()=>this.getAttachments(),downloadAttachment:e=>this.downloadAttachment(e),forDocument:e=>this.createAttachmentScope(e)}}createAttachmentScope(e){return{getAttachments:()=>this.getAttachments(e),downloadAttachment:t=>this.downloadAttachment(t,e)}}downloadAttachment(e,t){let n=t??this.getActiveDocumentId(),r=this.coreState.core.documents[n];return r?.document?this.engine.readAttachmentContent(r.document,e):G.reject({code:W.NotFound,message:`Document ${n} not found`})}getAttachments(e){let t=e??this.getActiveDocumentId(),n=this.coreState.core.documents[t];return n?.document?this.engine.getAttachments(n.document):G.reject({code:W.NotFound,message:`Document ${t} not found`})}};ug.id=`attachment`;var dg=ug,fg=`attachment`,pg={manifest:{id:fg,name:`Attachment Plugin`,version:`1.0.0`,provides:[`attachment`],requires:[],optional:[],defaultConfig:{}},create:e=>new dg(fg,e),reducer:()=>{},initialState:{}},mg=`form`,hg={id:mg,name:`Form Plugin`,version:`1.0.0`,provides:[`form`],requires:[`interaction-manager`],optional:[`history`,`annotation`],defaultConfig:{enabled:!0}},gg=`FORM/INIT_STATE`,_g=`FORM/CLEANUP_STATE`,vg=`FORM/SELECT_FIELD`,yg=`FORM/DESELECT_FIELD`;function bg(e,t){return{type:vg,payload:{documentId:e,annotationId:t}}}var xg={selectedFieldId:null},Sg={documents:{}},Cg={annotationType:z.WIDGET,create(e){let{pageIndex:t,onCommit:n,onPreview:r,getTool:i,pageSize:a}=e,[o,s]=Lu(null),c=e=>({x:q(e.x,0,a.width),y:q(e.y,0,a.height)}),l=()=>{let e=i();return e?{...e.defaults,fontFamily:e.defaults.fontFamily??Xt.Helvetica,fontSize:e.defaults.fontSize??12,fontColor:e.defaults.fontColor??`#000000`,strokeColor:e.defaults.strokeColor??`#000000`,color:e.defaults.color??`#FFFFFF`,strokeWidth:e.defaults.strokeWidth??1,field:e.defaults.field}:null},u=(e,t)=>({origin:{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},size:{width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}),d=e=>{let n=l(),r=`TextField_${K().slice(0,8)}`;return{...n,type:z.WIDGET,id:K(),pageIndex:t,rect:e,created:new Date,fontFamily:n.fontFamily,fontSize:n.fontSize,fontColor:n.fontColor,strokeColor:n.strokeColor,color:n.color,strokeWidth:n.strokeWidth,field:{type:V.TEXTFIELD,flag:n.field?.flag??H.NONE,name:r,alternateName:r,value:``}}},f=Kd({getTool:i,onClickDetected:e=>{if(!l())return;let t=i()?.clickBehavior;if(!t?.enabled)return;let{width:r,height:o}=t.defaultSize,s=q(e.x-r/2,0,a.width-r),c=q(e.y-o/2,0,a.height-o);n(d({origin:{x:s,y:c},size:{width:r,height:o}}))}}),p=e=>{let t=o();if(!t)return null;let n=l();if(!n)return null;let r=u(t,e);return{type:z.WIDGET,bounds:r,data:{rect:r,...n}}};return{onPointerDown:(e,t)=>{var n;let i=c(e);s(i),f.onStart(i),r(p(i)),(n=t.setPointerCapture)==null||n.call(t)},onPointerMove:e=>{let t=c(e);f.onMove(t),o()&&f.hasMoved()&&r(p(t))},onPointerUp:(e,t)=>{var i;let a=o();if(!a)return;let l=c(e);if(f.hasMoved()){let e=u(a,l);e.size.width>5&&e.size.height>5&&n(d(e))}else f.onEnd(l);s(null),r(null),f.reset(),(i=t.releasePointerCapture)==null||i.call(t)},onPointerLeave:(e,t)=>{var n;s(null),r(null),f.reset(),(n=t.releasePointerCapture)==null||n.call(t)},onPointerCancel:(e,t)=>{var n;s(null),r(null),f.reset(),(n=t.releasePointerCapture)==null||n.call(t)}}}},wg={annotationType:z.WIDGET,create(e){let{pageIndex:t,onCommit:n,onPreview:r,getTool:i,pageSize:a}=e,[o,s]=Lu(null),c=e=>({x:q(e.x,0,a.width),y:q(e.y,0,a.height)}),l=()=>{let e=i();return e?{...e.defaults,strokeColor:e.defaults.strokeColor??`#000000`,color:e.defaults.color??`#FFFFFF`,strokeWidth:e.defaults.strokeWidth??1,field:e.defaults.field}:null},u=(e,t)=>({origin:{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},size:{width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}),d=e=>{let n=l(),r=`Checkbox_${K().slice(0,8)}`;return{...n,type:z.WIDGET,id:K(),pageIndex:t,rect:e,created:new Date,strokeColor:n.strokeColor,color:n.color,strokeWidth:n.strokeWidth,exportValue:`Yes`,field:{type:V.CHECKBOX,flag:n.field?.flag??H.NONE,name:r,alternateName:r,value:`Off`}}},f=Kd({getTool:i,onClickDetected:e=>{if(!l())return;let t=i()?.clickBehavior;if(!t?.enabled)return;let{width:r,height:o}=t.defaultSize,s=q(e.x-r/2,0,a.width-r),c=q(e.y-o/2,0,a.height-o);n(d({origin:{x:s,y:c},size:{width:r,height:o}}))}}),p=e=>{let t=o();if(!t)return null;let n=l();if(!n)return null;let r=u(t,e);return{type:z.WIDGET,bounds:r,data:{rect:r,...n}}};return{onPointerDown:(e,t)=>{var n;let i=c(e);s(i),f.onStart(i),r(p(i)),(n=t.setPointerCapture)==null||n.call(t)},onPointerMove:e=>{let t=c(e);f.onMove(t),o()&&f.hasMoved()&&r(p(t))},onPointerUp:(e,t)=>{var i;let a=o();if(!a)return;let l=c(e);if(f.hasMoved()){let e=u(a,l);e.size.width>5&&e.size.height>5&&n(d(e))}else f.onEnd(l);s(null),r(null),f.reset(),(i=t.releasePointerCapture)==null||i.call(t)},onPointerLeave:(e,t)=>{var n;s(null),r(null),f.reset(),(n=t.releasePointerCapture)==null||n.call(t)},onPointerCancel:(e,t)=>{var n;s(null),r(null),f.reset(),(n=t.releasePointerCapture)==null||n.call(t)}}}},Tg={annotationType:z.WIDGET,create(e){let{pageIndex:t,onCommit:n,onPreview:r,getTool:i,pageSize:a}=e,[o,s]=Lu(null),c=e=>({x:q(e.x,0,a.width),y:q(e.y,0,a.height)}),l=()=>{let e=i();return e?{...e.defaults,strokeColor:e.defaults.strokeColor??`#000000`,color:e.defaults.color??`#FFFFFF`,strokeWidth:e.defaults.strokeWidth??1,field:e.defaults.field}:null},u=(e,t)=>{let n=t.x-e.x,r=t.y-e.y,i=Math.max(Math.abs(n),Math.abs(r)),a=n<0?-i:i,o=r<0?-i:i;return{origin:{x:Math.min(e.x,e.x+a),y:Math.min(e.y,e.y+o)},size:{width:i,height:i}}},d=e=>{let n=l(),r=`RadioButton_${K().slice(0,8)}`,i=K();return{...n,type:z.WIDGET,id:i,pageIndex:t,rect:e,created:new Date,strokeColor:n.strokeColor,color:n.color,strokeWidth:n.strokeWidth,exportValue:i,field:{type:V.RADIOBUTTON,flag:n.field?.flag??H.BUTTON_RADIO|H.BUTTON_NOTOGGLETOOFF,name:r,alternateName:r,value:`Off`,options:[]}}},f=Kd({getTool:i,onClickDetected:e=>{if(!l())return;let t=i()?.clickBehavior;if(!t?.enabled)return;let{width:r,height:o}=t.defaultSize,s=q(e.x-r/2,0,a.width-r),c=q(e.y-o/2,0,a.height-o);n(d({origin:{x:s,y:c},size:{width:r,height:o}}))}}),p=e=>{let t=o();if(!t)return null;let n=l();if(!n)return null;let r=u(t,e);return{type:z.WIDGET,bounds:r,data:{rect:r,...n}}};return{onPointerDown:(e,t)=>{var n;let i=c(e);s(i),f.onStart(i),r(p(i)),(n=t.setPointerCapture)==null||n.call(t)},onPointerMove:e=>{let t=c(e);f.onMove(t),o()&&f.hasMoved()&&r(p(t))},onPointerUp:(e,t)=>{var i;let a=o();if(!a)return;let l=c(e);if(f.hasMoved()){let e=u(a,l);e.size.width>5&&e.size.height>5&&n(d(e))}else f.onEnd(l);s(null),r(null),f.reset(),(i=t.releasePointerCapture)==null||i.call(t)},onPointerLeave:(e,t)=>{var n;s(null),r(null),f.reset(),(n=t.releasePointerCapture)==null||n.call(t)},onPointerCancel:(e,t)=>{var n;s(null),r(null),f.reset(),(n=t.releasePointerCapture)==null||n.call(t)}}}},Eg={annotationType:z.WIDGET,create(e){let{pageIndex:t,onCommit:n,onPreview:r,getTool:i,pageSize:a}=e,[o,s]=Lu(null),c=e=>({x:q(e.x,0,a.width),y:q(e.y,0,a.height)}),l=()=>{let e=i();return e?{...e.defaults,fontFamily:e.defaults.fontFamily??Xt.Helvetica,fontSize:e.defaults.fontSize??12,fontColor:e.defaults.fontColor??`#000000`,strokeColor:e.defaults.strokeColor??`#000000`,color:e.defaults.color??`#FFFFFF`,strokeWidth:e.defaults.strokeWidth??1,field:e.defaults.field}:null},u=(e,t)=>({origin:{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},size:{width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}),d=e=>{let n=l(),r=`Combobox_${K().slice(0,8)}`;return{...n,type:z.WIDGET,id:K(),pageIndex:t,rect:e,created:new Date,fontFamily:n.fontFamily,fontSize:n.fontSize,fontColor:n.fontColor,strokeColor:n.strokeColor,color:n.color,strokeWidth:n.strokeWidth,field:{type:V.COMBOBOX,flag:n.field?.flag??H.NONE,name:r,alternateName:r,value:``,options:[{label:`Option 1`,isSelected:!0},{label:`Option 2`,isSelected:!1},{label:`Option 3`,isSelected:!1}]}}},f=Kd({getTool:i,onClickDetected:e=>{if(!l())return;let t=i()?.clickBehavior;if(!t?.enabled)return;let{width:r,height:o}=t.defaultSize,s=q(e.x-r/2,0,a.width-r),c=q(e.y-o/2,0,a.height-o);n(d({origin:{x:s,y:c},size:{width:r,height:o}}))}}),p=e=>{let t=o();if(!t)return null;let n=l();if(!n)return null;let r=u(t,e);return{type:z.WIDGET,bounds:r,data:{rect:r,...n}}};return{onPointerDown:(e,t)=>{var n;let i=c(e);s(i),f.onStart(i),r(p(i)),(n=t.setPointerCapture)==null||n.call(t)},onPointerMove:e=>{let t=c(e);f.onMove(t),o()&&f.hasMoved()&&r(p(t))},onPointerUp:(e,t)=>{var i;let a=o();if(!a)return;let l=c(e);if(f.hasMoved()){let e=u(a,l);e.size.width>5&&e.size.height>5&&n(d(e))}else f.onEnd(l);s(null),r(null),f.reset(),(i=t.releasePointerCapture)==null||i.call(t)},onPointerLeave:(e,t)=>{var n;s(null),r(null),f.reset(),(n=t.releasePointerCapture)==null||n.call(t)},onPointerCancel:(e,t)=>{var n;s(null),r(null),f.reset(),(n=t.releasePointerCapture)==null||n.call(t)}}}},Dg={annotationType:z.WIDGET,create(e){let{pageIndex:t,onCommit:n,onPreview:r,getTool:i,pageSize:a}=e,[o,s]=Lu(null),c=e=>({x:q(e.x,0,a.width),y:q(e.y,0,a.height)}),l=()=>{let e=i();return e?{...e.defaults,fontFamily:e.defaults.fontFamily??Xt.Helvetica,fontSize:e.defaults.fontSize??12,fontColor:e.defaults.fontColor??`#000000`,strokeColor:e.defaults.strokeColor??`#000000`,color:e.defaults.color??`#FFFFFF`,strokeWidth:e.defaults.strokeWidth??1,field:e.defaults.field}:null},u=(e,t)=>({origin:{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},size:{width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}),d=e=>{let n=l(),r=`Listbox_${K().slice(0,8)}`;return{...n,type:z.WIDGET,id:K(),pageIndex:t,rect:e,created:new Date,fontFamily:n.fontFamily,fontSize:n.fontSize,fontColor:n.fontColor,strokeColor:n.strokeColor,color:n.color,strokeWidth:n.strokeWidth,field:{type:V.LISTBOX,flag:n.field?.flag??H.NONE,name:r,alternateName:r,value:``,options:[{label:`Option 1`,isSelected:!0},{label:`Option 2`,isSelected:!1},{label:`Option 3`,isSelected:!1}]}}},f=Kd({getTool:i,onClickDetected:e=>{if(!l())return;let t=i()?.clickBehavior;if(!t?.enabled)return;let{width:r,height:o}=t.defaultSize,s=q(e.x-r/2,0,a.width-r),c=q(e.y-o/2,0,a.height-o);n(d({origin:{x:s,y:c},size:{width:r,height:o}}))}}),p=e=>{let t=o();if(!t)return null;let n=l();if(!n)return null;let r=u(t,e);return{type:z.WIDGET,bounds:r,data:{rect:r,...n}}};return{onPointerDown:(e,t)=>{var n;let i=c(e);s(i),f.onStart(i),r(p(i)),(n=t.setPointerCapture)==null||n.call(t)},onPointerMove:e=>{let t=c(e);f.onMove(t),o()&&f.hasMoved()&&r(p(t))},onPointerUp:(e,t)=>{var i;let a=o();if(!a)return;let l=c(e);if(f.hasMoved()){let e=u(a,l);e.size.width>5&&e.size.height>5&&n(d(e))}else f.onEnd(l);s(null),r(null),f.reset(),(i=t.releasePointerCapture)==null||i.call(t)},onPointerLeave:(e,t)=>{var n;s(null),r(null),f.reset(),(n=t.releasePointerCapture)==null||n.call(t)},onPointerCancel:(e,t)=>{var n;s(null),r(null),f.reset(),(n=t.releasePointerCapture)==null||n.call(t)}}}},Og=[{id:`formTextField`,name:`Text Field`,labelKey:`form.textfield`,categories:[`annotation`,`form`],matchScore:e=>e.type===z.WIDGET&&e.field?.type===V.TEXTFIELD?10:0,interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!0,isRotatable:!1,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:z.WIDGET,fontFamily:Xt.Helvetica,fontSize:12,fontColor:`#000000`,strokeColor:`#000000`,color:`#FFFFFF`,strokeWidth:1,field:{flag:H.NONE,name:`TextField`,alternateName:`TextField`,value:``,type:V.TEXTFIELD}},behavior:{useAppearanceStream:!1},clickBehavior:{enabled:!0,defaultSize:{width:150,height:24}},pointerHandler:Cg},{id:`formCheckbox`,name:`Checkbox`,labelKey:`form.checkbox`,categories:[`annotation`,`form`],matchScore:e=>e.type===z.WIDGET&&e.field?.type===V.CHECKBOX?10:0,interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!0,isRotatable:!1,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:z.WIDGET,strokeColor:`#000000`,color:`#FFFFFF`,strokeWidth:1,field:{flag:H.NONE,name:`Checkbox`,alternateName:`Checkbox`,value:`Off`,type:V.CHECKBOX}},behavior:{useAppearanceStream:!1},clickBehavior:{enabled:!0,defaultSize:{width:20,height:20}},pointerHandler:wg},{id:`formRadioButton`,name:`Radio Button`,labelKey:`form.radiobutton`,categories:[`annotation`,`form`],matchScore:e=>e.type===z.WIDGET&&e.field?.type===V.RADIOBUTTON?10:0,interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!0,isRotatable:!1,lockAspectRatio:!0,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:z.WIDGET,strokeColor:`#000000`,color:`#FFFFFF`,strokeWidth:1,field:{flag:H.BUTTON_RADIO|H.BUTTON_NOTOGGLETOOFF,name:`RadioButton`,alternateName:`RadioButton`,value:`Off`,type:V.RADIOBUTTON,options:[]}},behavior:{useAppearanceStream:!1},clickBehavior:{enabled:!0,defaultSize:{width:20,height:20}},pointerHandler:Tg},{id:`formCombobox`,name:`Combo Box`,labelKey:`form.combobox`,categories:[`annotation`,`form`],matchScore:e=>e.type===z.WIDGET&&e.field?.type===V.COMBOBOX?10:0,interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!0,isRotatable:!1,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:z.WIDGET,fontFamily:Xt.Helvetica,fontSize:12,fontColor:`#000000`,strokeColor:`#000000`,color:`#FFFFFF`,strokeWidth:1,field:{flag:H.NONE,name:`ComboBox`,alternateName:`ComboBox`,value:``,type:V.COMBOBOX,options:[{label:`Option 1`,isSelected:!0},{label:`Option 2`,isSelected:!1},{label:`Option 3`,isSelected:!1}]}},behavior:{useAppearanceStream:!1},clickBehavior:{enabled:!0,defaultSize:{width:200,height:40}},pointerHandler:Eg},{id:`formListbox`,name:`List Box`,labelKey:`form.listbox`,categories:[`annotation`,`form`],matchScore:e=>e.type===z.WIDGET&&e.field?.type===V.LISTBOX?10:0,interaction:{exclusive:!1,cursor:`crosshair`,isDraggable:!0,isResizable:!0,isRotatable:!1,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:z.WIDGET,fontFamily:Xt.Helvetica,fontSize:12,fontColor:`#000000`,strokeColor:`#000000`,color:`#FFFFFF`,strokeWidth:1,field:{flag:H.NONE,name:`ListBox`,alternateName:`ListBox`,value:``,type:V.LISTBOX,options:[{label:`Option 1`,isSelected:!0},{label:`Option 2`,isSelected:!1},{label:`Option 3`,isSelected:!1}]}},behavior:{useAppearanceStream:!1},clickBehavior:{enabled:!0,defaultSize:{width:150,height:150}},pointerHandler:Dg}],kg=class extends Rr{constructor(e,t,n){if(super(e,t),this.FORM_HISTORY_TOPIC=`form-fields`,this.annotation=null,this.history=null,this.state$=qr((e,t)=>({documentId:e,state:t})),this.fieldValueChange$=qr((e,t)=>t,{cache:!1}),this.formReady$=qr((e,t)=>({documentId:e,fields:t}),{cache:!1}),this.fieldGroupIndex=new Map,this.fieldNameIndex=new Map,this.orderedFieldIndex=new Map,this.propagationInProgress=new Set,this.annotation=t.getPlugin(`annotation`)?.provides()??null,this.history=t.getPlugin(Ch.id)?.provides()??null,this.annotation){for(let e of Og)this.annotation.addTool(e);this.annotation.onAnnotationEvent(e=>this.handleAnnotationEvent(e))}}async initialize(){}onDocumentLoadingStarted(e){this.dispatch(function(e,t){return{type:gg,payload:{documentId:e,state:t}}}(e,{...xg}))}onDocumentClosed(e){this.dispatch(function(e){return{type:_g,payload:e}}(e)),this.fieldGroupIndex.delete(e),this.fieldNameIndex.delete(e),this.orderedFieldIndex.delete(e),this.state$.clearScope(e),this.fieldValueChange$.clearScope(e),this.formReady$.clearScope(e)}onStoreUpdated(e,t){for(let n in t.documents){let r=e.documents[n],i=t.documents[n];r!==i&&this.state$.emit(n,i)}}buildCapability(){return{getPageFormAnnoWidgets:(e,t)=>this.getPageFormAnnoWidgets(e,t),setFormFieldValues:(e,t,n,r)=>this.setFormFieldValues(e,t,n,r),renameField:(e,t,n)=>this.renameFieldMethod(e,t,n),shareField:(e,t,n)=>this.shareFieldMethod(e,t,n),renderWidget:(e,t)=>this.renderWidget(e,t),selectField:(e,t)=>this.selectFieldMethod(e,t),deselectField:e=>this.deselectFieldMethod(e),getSelectedFieldId:e=>this.getSelectedFieldId(e),selectNextField:e=>this.selectNextFieldMethod(e),selectPreviousField:e=>this.selectPreviousFieldMethod(e),activateField:e=>this.activateFieldMethod(e),getState:e=>this.getDocumentState(e),getFieldGroup:(e,t)=>this.getFieldGroup(e,t),getFieldSiblings:(e,t)=>this.getFieldSiblings(e,t),getFormValues:e=>this.getFormValuesMethod(e),getFormFields:e=>this.getFormFieldsMethod(e),setFormValues:(e,t)=>this.setFormValuesMethod(e,t),forDocument:e=>this.createFormScope(e),onStateChange:this.state$.onGlobal,onFieldValueChange:this.fieldValueChange$.onGlobal,onFormReady:this.formReady$.onGlobal}}createFormScope(e){return{getPageFormAnnoWidgets:t=>this.getPageFormAnnoWidgets(t,e),setFormFieldValues:(t,n,r)=>this.setFormFieldValues(t,n,r,e),renameField:(t,n)=>this.renameFieldMethod(t,n,e),shareField:(t,n)=>this.shareFieldMethod(t,n,e),renderWidget:t=>this.renderWidget(t,e),selectField:t=>this.selectFieldMethod(t,e),deselectField:()=>this.deselectFieldMethod(e),getSelectedFieldId:()=>this.getSelectedFieldId(e),selectNextField:()=>this.selectNextFieldMethod(e),selectPreviousField:()=>this.selectPreviousFieldMethod(e),activateField:()=>this.activateFieldMethod(e),getState:()=>this.getDocumentState(e),getFieldGroup:t=>this.getFieldGroup(t,e),getFieldSiblings:t=>this.getFieldSiblings(t,e),getFormValues:()=>this.getFormValuesMethod(e),getFormFields:()=>this.getFormFieldsMethod(e),setFormValues:t=>this.setFormValuesMethod(t,e),onStateChange:this.state$.forScope(e),onFieldValueChange:this.fieldValueChange$.forScope(e),onFormReady:this.formReady$.forScope(e)}}handleAnnotationEvent(e){switch(e.type){case`loaded`:this.buildFieldGroupIndex(e.documentId),this.formReady$.emit(e.documentId,this.getFormFieldsMethod(e.documentId));break;case`create`:case`delete`:if(e.annotation.type!==z.WIDGET)break;this.buildFieldGroupIndex(e.documentId);break;case`update`:{if(!e.committed)break;let t=e.annotation;if(t.type!==z.WIDGET)break;if(this.propagationInProgress.has(t.id)){this.propagationInProgress.delete(t.id);break}let n=e.patch;this.buildFieldGroupIndex(e.documentId),this.propagateFieldLevelChanges(e.documentId,t,n);break}}}propagateFieldLevelChanges(e,t,n){if(!this.annotation||!n.field)return;let r=n.field,i=this.getFieldSiblings(t.id,e);if(i.length===0)return;let a=[];for(let e of i)this.propagationInProgress.add(e.annotationId),a.push({pageIndex:e.pageIndex,id:e.annotationId,patch:{field:{...r}}});this.annotation.forDocument(e).updateAnnotations(a)}buildFieldGroupIndex(e){if(!this.annotation)return;let t=this.annotation.forDocument(e).getState();if(!t)return;let n=new Map,r=[];for(let[e,i]of Object.entries(t.pages)){let a=Number(e);for(let e of i){let i=t.byUid[e];if(!i||i.object.type!==z.WIDGET)continue;let o=i.object,s={annotationId:e,pageIndex:a};r.push({entry:s,widget:o});let c=this.getFieldKey(o.field);if(!c)continue;let l=n.get(c)??[];l.push(s),n.set(c,l)}}this.fieldGroupIndex.set(e,n);let i=new Map;for(let{entry:e,widget:t}of r){let n=t.field.name.trim();if(!n)continue;let r=i.get(n)??[];r.push(e),i.set(n,r)}this.fieldNameIndex.set(e,i);let a=r.filter(({widget:e})=>!(e.field.flag&H.READONLY));this.orderedFieldIndex.set(e,a.map(({entry:e})=>e))}getDocumentState(e){let t=e??this.getActiveDocumentId();return this.state.documents[t]??{...xg}}getDocIndex(e){let t=this.fieldGroupIndex.get(e);return t||(t=new Map,this.fieldGroupIndex.set(e,t)),t}getFieldKey(e){if(typeof e.fieldObjectId==`number`&&e.fieldObjectId>0)return`field:${e.fieldObjectId}`;let t=e.name.trim();return t?`legacy:${e.type}:${t}`:null}resolveWidgetAnnotation(e,t){if(!this.annotation)return null;let n=this.annotation.forDocument(t).getState()?.byUid[e];return n&&n.object.type===z.WIDGET?n.object:null}getFieldGroup(e,t){let n=t??this.getActiveDocumentId(),r=this.resolveWidgetAnnotation(e,n);if(!r)return[];let i=this.getFieldKey(r.field);return i?this.getDocIndex(n).get(i)??[{annotationId:r.id,pageIndex:r.pageIndex}]:[{annotationId:r.id,pageIndex:r.pageIndex}]}getFieldSiblings(e,t){return this.getFieldGroup(e,t).filter(t=>t.annotationId!==e)}getFormValuesMethod(e){let t=e??this.getActiveDocumentId(),n=this.fieldNameIndex.get(t);if(!n)return{};let r={};for(let[e,i]of n){let n=this.resolveWidgetAnnotation(i[0].annotationId,t);n&&(r[e]=n.field.value)}return r}getFormFieldsMethod(e){let t=e??this.getActiveDocumentId(),n=this.fieldNameIndex.get(t);if(!n)return[];let r=[];for(let[e,i]of n){let n=this.resolveWidgetAnnotation(i[0].annotationId,t);n&&r.push({name:e,type:n.field.type,value:n.field.value,readOnly:!!(n.field.flag&H.READONLY),...`options`in n.field&&n.field.options?{options:n.field.options}:{}})}return r}setFormValuesMethod(e,t){let n=t??this.getActiveDocumentId(),r=this.fieldNameIndex.get(n);if(!r)return G.reject({code:W.NotFound,message:`no form fields indexed for this document`});let i=Object.entries(e);if(i.length===0)return G.resolve(!0);let a=new L,o=i.length,s=!1,c=()=>{o--,o!==0||s||a.resolve(!0)};for(let[e,t]of i){let i=r.get(e);if(!i||i.length===0){c();continue}let o=i[0],l=this.resolveWidgetAnnotation(o.annotationId,n);if(l){if(l.field.type===V.RADIOBUTTON||l.field.type===V.CHECKBOX)for(let e of i){let r=this.resolveWidgetAnnotation(e.annotationId,n);if(r&&r.exportValue===t){l=r,o=e;break}}this.setFormFieldValues(o.pageIndex,l,this.buildImportField(l,t),n).wait(()=>c(),e=>{t=e.reason,s||(s=!0,a.reject(t));return;var t})}else c()}return a}buildImportField(e,t){let n=e.field;if((n.type===V.COMBOBOX||n.type===V.LISTBOX)&&`options`in n)return{...n,value:t,options:n.options.map(e=>({...e,isSelected:e.label===t}))};if(n.type===V.CHECKBOX){let r=t===`Off`?`Off`:e.exportValue??`Yes`;return{...n,value:r}}return{...n,value:t}}isToggleField(e){return e.type===V.CHECKBOX||e.type===V.RADIOBUTTON}shouldRegenerateWidgetAppearances(e){return!this.isToggleField(e)}getFieldBatchTarget(e){let t=[...e.values()];return t.find(e=>this.isToggleField(e.widget.field)&&_n(e.widget))??t[0]}async readFieldWidgets(e,t,n,r){let i=new Set(t.map(e=>e.pageIndex)),a=new Set(t.map(e=>e.annotationId)),o=new Map;for(let s of i){let i=e.pages.find(e=>e.index===s);if(!i)continue;let c=t.filter(e=>e.pageIndex===s).map(e=>e.annotationId);r&&await n.run(()=>this.engine.regenerateWidgetAppearances(e,i,c));let l=await n.run(()=>this.engine.getPageAnnoWidgets(e,i));for(let e of l)a.has(e.id)&&o.set(e.id,{widget:e,pageIndex:s})}return o}syncFieldBatch(e,t,n={}){if(this.annotation){for(let[r,{widget:i,pageIndex:a}]of t)this.annotation.syncAnnotationObject(r,i,e),this.annotation.invalidatePageAppearances(a,e),n.emitFieldValueChanges&&this.fieldValueChange$.emit(e,{documentId:e,pageIndex:a,annotationId:r,widget:i});this.buildFieldGroupIndex(e)}}resolveWidgetPage(e,t,n){let r=this.resolveWidgetAnnotation(e,t);if(!r)return null;let i=n.pages.find(e=>e.index===r.pageIndex);return i?{widget:r,page:i}:null}getPageFormAnnoWidgets(e,t){let n=this.getCoreDocumentOrThrow(t).document;if(!n)return G.reject({code:W.DocNotOpen,message:`document is not open`});let r=n.pages.find(t=>t.index===e);return r?this.engine.getPageAnnoWidgets(n,r):G.reject({code:W.NotFound,message:`page does not exist`})}setFormFieldValues(e,t,n,r){let i=r??this.getActiveDocumentId(),a=this.getCoreDocumentOrThrow(i).document;if(!a)return G.reject({code:W.DocNotOpen,message:`document is not open`});let o=a.pages.find(t=>t.index===e);if(!o)return G.reject({code:W.NotFound,message:`page does not exist`});let s=new L,c=new er(s);return c.execute(async()=>{let e=this.getFieldGroup(t.id,i),r=await this.readFieldWidgets(a,e,c,!1);await c.run(()=>this.engine.setFormFieldState(a,o,t,n));let l=await this.readFieldWidgets(a,e,c,this.shouldRegenerateWidgetAppearances(n)),u=!0,d=async e=>{let t=this.getFieldBatchTarget(e);if(!t)return;let n=a.pages.find(e=>e.index===t.pageIndex);if(n&&(await new Promise(e=>{this.engine.setFormFieldState(a,n,t.widget,t.widget.field).wait(()=>e(),()=>e())}),this.shouldRegenerateWidgetAppearances(t.widget.field)))for(let t of new Set([...e.values()].map(e=>e.pageIndex))){let n=a.pages.find(e=>e.index===t);if(!n)continue;let r=[...e.entries()].filter(([,e])=>e.pageIndex===t).map(([e])=>e);await new Promise(e=>{this.engine.regenerateWidgetAppearances(a,n,r).wait(()=>e(),()=>e())})}},f={execute:()=>{let e=u;u=!1,e?this.syncFieldBatch(i,l,{emitFieldValueChanges:!0}):d(l).then(()=>this.syncFieldBatch(i,l,{emitFieldValueChanges:!0}))},undo:()=>{d(r).then(()=>this.syncFieldBatch(i,r,{emitFieldValueChanges:!0}))}};this.history?this.history.forDocument(i).register(f,this.FORM_HISTORY_TOPIC):f.execute(),s.resolve(!0)},e=>({code:W.Unknown,message:String(e)})),s}findConflictingFieldGroups(e,t,n){let r=new Map;if(!this.annotation)return r;let i=this.annotation.forDocument(n).getState();if(!i)return r;let a=(()=>{let e=this.resolveWidgetAnnotation(t,n);return e?this.getFieldKey(e.field):null})();for(let[t,n]of Object.entries(i.pages)){let o=Number(t);for(let t of n){let n=i.byUid[t];if(!n||n.object.type!==z.WIDGET)continue;let s=n.object;if(s.field.name.trim()!==e)continue;let c=this.getFieldKey(s.field);c&&c!==a&&(r.has(c)||r.set(c,{entries:[],widget:s}),r.get(c).entries.push({annotationId:t,pageIndex:o}))}}return r}renameFieldMethod(e,t,n){let r=n??this.getActiveDocumentId(),i=t.trim();if(!i)return G.reject({code:W.Unknown,message:`Field name must not be empty.`});let a=this.getCoreDocumentOrThrow(r).document;if(!a)return G.reject({code:W.DocNotOpen,message:`document is not open`});let o=this.resolveWidgetPage(e,r,a);if(!o)return G.reject({code:W.NotFound,message:`widget annotation not found`});if(o.widget.field.name.trim()===i)return G.resolve({outcome:`no-op`});let s=this.findConflictingFieldGroups(i,e,r);if(s.size>0){if(s.size>1)return G.reject({code:W.Unknown,message:`That field name is used by multiple fields. Choose a unique name.`});let[,e]=[...s.entries()][0];return e.widget.field.type===o.widget.field.type?G.resolve({outcome:`conflict`,targetAnnotationId:e.entries[0].annotationId,fieldName:i}):G.reject({code:W.Unknown,message:`That field name is already used by a different widget type.`})}let c=new L,l=new er(c);return l.execute(async()=>{let t=this.getFieldGroup(e,r);await l.run(()=>this.engine.renameWidgetField(a,o.page,o.widget,i));let n=await this.readFieldWidgets(a,t,l,!1);this.syncFieldBatch(r,n),c.resolve({outcome:`renamed`})},e=>({code:W.Unknown,message:String(e)})),c}shareFieldMethod(e,t,n){let r=n??this.getActiveDocumentId();if(e===t)return G.resolve(!0);let i=this.getCoreDocumentOrThrow(r).document;if(!i)return G.reject({code:W.DocNotOpen,message:`document is not open`});let a=this.resolveWidgetPage(e,r,i),o=this.resolveWidgetPage(t,r,i);if(!a||!o)return G.reject({code:W.NotFound,message:`widget annotation not found`});if(a.widget.field.type!==o.widget.field.type)return G.reject({code:W.Unknown,message:`cannot share fields with different widget types`});if(a.widget.field.fieldObjectId&&o.widget.field.fieldObjectId&&a.widget.field.fieldObjectId===o.widget.field.fieldObjectId)return G.resolve(!0);let s=new Map;for(let t of this.getFieldGroup(e,r))s.set(t.annotationId,t);for(let e of this.getFieldGroup(t,r))s.set(e.annotationId,e);let c=[...s.values()],l=new L,u=new er(l);return u.execute(async()=>{await u.run(()=>this.engine.shareWidgetField(i,a.page,a.widget,o.page,o.widget));let e=await this.readFieldWidgets(i,c,u,this.shouldRegenerateWidgetAppearances(o.widget.field));this.syncFieldBatch(r,e),l.resolve(!0)},e=>({code:W.Unknown,message:String(e)})),l}selectFieldMethod(e,t){let n=t??this.getActiveDocumentId();this.dispatch(bg(n,e))}deselectFieldMethod(e){let t=e??this.getActiveDocumentId();this.dispatch(function(e){return{type:yg,payload:e}}(t))}getSelectedFieldId(e){return this.getDocumentState(e).selectedFieldId}selectNextFieldMethod(e){let t=e??this.getActiveDocumentId(),n=this.orderedFieldIndex.get(t);if(!n||n.length===0)return;let r=this.getSelectedFieldId(t),i=0;if(r){let e=n.findIndex(e=>e.annotationId===r);i=e>=0?(e+1)%n.length:0}let a=n[i];this.dispatch(bg(t,a.annotationId))}selectPreviousFieldMethod(e){let t=e??this.getActiveDocumentId(),n=this.orderedFieldIndex.get(t);if(!n||n.length===0)return;let r=this.getSelectedFieldId(t),i=n.length-1;if(r){let e=n.findIndex(e=>e.annotationId===r);i=e>=0?(e-1+n.length)%n.length:n.length-1}let a=n[i];this.dispatch(bg(t,a.annotationId))}activateFieldMethod(e){let t=e??this.getActiveDocumentId(),n=this.getSelectedFieldId(t);if(!n)return;let r=this.resolveWidgetAnnotation(n,t);if(!r)return;let i=r.field;if(i.type===V.CHECKBOX){let e=_n(r)?`Off`:r.exportValue??`Yes`;this.setFormFieldValues(r.pageIndex,r,{...i,value:e},t)}else i.type===V.RADIOBUTTON&&!_n(r)&&r.exportValue&&this.setFormFieldValues(r.pageIndex,r,{...i,value:r.exportValue},t)}renderWidget(e,t){if(!this.annotation)return G.reject({code:W.NotFound,message:`annotation plugin not found`});let n=t??this.getActiveDocumentId();return this.annotation.forDocument(n).renderAnnotation(e)}async destroy(){this.state$.clear(),this.fieldValueChange$.clear(),this.formReady$.clear(),super.destroy()}};kg.id=`form`;var Ag=kg,jg={manifest:hg,create:(e,t)=>new Ag(mg,e,t),reducer:(e=Sg,t)=>{switch(t.type){case gg:return{...e,documents:{...e.documents,[t.payload.documentId]:t.payload.state}};case _g:{let n=t.payload,{[n]:r,...i}=e.documents;return{...e,documents:i}}case vg:{let{documentId:n,annotationId:r}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,selectedFieldId:r}}}:e}case yg:{let n=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:{...r,selectedFieldId:null}}}:e}default:return e}},initialState:Sg},Mg=(e,t,n)=>({selected:e?t.includes(n):void 0});function Ng({annotation:e,isSelected:t,scale:n,onClick:r,style:i}){let[a,o]=j(!1),{object:s}=e,c=s.field,l=c.type===V.TEXTFIELD,u=l?c.value:``,d=l&&!!(c.flag&H.TEXT_COMB)&&!!c.maxLen,f=l&&!!(c.flag&H.TEXT_MULTIPLINE),p=l?c.maxLen:void 0,m=(s.strokeWidth??1)*n,h={fontSize:(s.fontSize??12)*n,...Gn(s.fontFamily),color:s.fontColor??`#000000`,lineHeight:1.2};return I(`div`,{onPointerDown:t?void 0:r,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{position:`absolute`,inset:0,background:s.color??`rgba(255, 255, 255, 0.9)`,border:`${m}px solid ${s.strokeColor??`rgba(0, 0, 0, 0.2)`}`,outline:a||t?`1px solid rgba(66, 133, 244, 0.5)`:`none`,outlineOffset:-1,boxSizing:`border-box`,pointerEvents:`auto`,cursor:t?`move`:`pointer`,display:`flex`,alignItems:f?`flex-start`:`center`,overflow:`hidden`,...d?{}:{padding:`${m}px ${m}px`},...i},children:d&&p?I(Pg,{value:u??``,maxLen:p,scale:n,width:s.rect.size.width,fontStyle:h,strokeColor:s.strokeColor??`rgba(0, 0, 0, 0.2)`}):I(`span`,{style:{...h,display:`block`,width:`100%`,whiteSpace:f?`pre-wrap`:`nowrap`,wordBreak:f?`break-word`:`normal`,overflowWrap:f?`break-word`:`normal`,overflow:`hidden`,textOverflow:f?`clip`:`ellipsis`},children:u})})}function Pg({value:e,maxLen:t,scale:n,width:r,fontStyle:i,strokeColor:a}){let o=r*n/t,s=e.split(``);return I(`div`,{style:{position:`relative`,width:`100%`,height:`100%`},children:Array.from({length:t}).map((e,n)=>I(`span`,{style:{position:`absolute`,top:0,left:n*o,width:o,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRight:n<t-1?`1px solid ${a}`:`none`,boxSizing:`border-box`,...i},children:s[n]||``},n))})}function Fg({annotation:e,isSelected:t,scale:n,onClick:r,style:i}){let[a,o]=j(!1),{object:s}=e,c=_n(s);return I(`div`,{onPointerDown:t?void 0:r,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{position:`absolute`,inset:0,background:s.color??`#FFFFFF`,border:`${(s.strokeWidth??1)*n}px solid ${s.strokeColor??`#000000`}`,outline:a||t?`1px solid rgba(66, 133, 244, 0.5)`:`none`,outlineOffset:-1,boxSizing:`border-box`,pointerEvents:`auto`,cursor:t?`move`:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,...i},children:c&&I(`svg`,{viewBox:`0 0 100 100`,style:{width:`100%`,height:`100%`},children:I(`path`,{d:`M28 48C27.45 50.21 29.45 63.13 30 67C30.55 69.21 34.58 72 39 72C44.52 71.45 76.55 32.55 76 32C77.1 31.45 76 25 76 25C74.34 22.24 68 25.45 68 26C68 26 43.55 53 43 53C41.34 53 40.55 41.1 40 40C33.37 36.69 29.1 45.79 28 48Z`,fill:`#000000`})})})}function Ig({annotation:e,isSelected:t,scale:n,onClick:r,style:i}){let[a,o]=j(!1),{object:s}=e,c=_n(s);return I(`div`,{onPointerDown:t?void 0:r,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{position:`absolute`,inset:0,background:s.color??`#FFFFFF`,border:`${(s.strokeWidth??1)*n}px solid ${s.strokeColor??`#000000`}`,borderRadius:`50%`,outline:a||t?`1px solid rgba(66, 133, 244, 0.5)`:`none`,outlineOffset:-1,boxSizing:`border-box`,pointerEvents:`auto`,cursor:t?`move`:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,...i},children:c&&I(`div`,{style:{width:`50%`,height:`50%`,borderRadius:`50%`,background:`#000000`}})})}function Lg({annotation:e,isSelected:t,scale:n,onClick:r,style:i}){let[a,o]=j(!1),{object:s}=e,c=s.field,l=(c.type===V.COMBOBOX?c.options:[]).find(e=>e.isSelected)?.label??``,u=(s.strokeWidth??1)*n,d=(s.fontSize??12)*n;return I(`div`,{onPointerDown:t?void 0:r,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{position:`absolute`,inset:0,background:s.color??`#FFFFFF`,border:`${u}px solid ${s.strokeColor??`#000000`}`,outline:a||t?`1px solid rgba(66, 133, 244, 0.5)`:`none`,outlineOffset:-1,boxSizing:`border-box`,pointerEvents:`auto`,cursor:t?`move`:`pointer`,display:`flex`,alignItems:`center`,overflow:`hidden`,...i},children:[I(`span`,{style:{flex:1,padding:`0 ${4*n}px`,fontSize:d,...Gn(s.fontFamily),color:s.fontColor??`#000000`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:l}),I(`div`,{style:{width:13*n,minWidth:13*n,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,borderLeft:`1px solid ${s.strokeColor??`#000000`}`},children:I(`svg`,{viewBox:`0 0 10 6`,style:{width:8*n,height:5*n},fill:`currentColor`,children:I(`path`,{d:`M0 0 L5 6 L10 0 Z`})})})]})}function Rg({annotation:e,isSelected:t,scale:n,onClick:r,style:i}){let[a,o]=j(!1),{object:s}=e,c=s.field,l=c.type===V.LISTBOX?c.options:[],u=(s.strokeWidth??1)*n,d=(s.fontSize??12)*n,f=1.2*d;return I(`div`,{onPointerDown:t?void 0:r,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{position:`absolute`,inset:0,background:s.color??`#FFFFFF`,border:`${u}px solid ${s.strokeColor??`#000000`}`,outline:a||t?`1px solid rgba(66, 133, 244, 0.5)`:`none`,outlineOffset:-1,boxSizing:`border-box`,pointerEvents:`auto`,cursor:t?`move`:`pointer`,overflow:`hidden`,display:`flex`,flexDirection:`column`,...i},children:l.map((e,t)=>I(`div`,{style:{padding:`0 ${4*n}px`,fontSize:d,lineHeight:`${f}px`,...Gn(s.fontFamily),color:e.isSelected?`#FFFFFF`:s.fontColor??`#000000`,background:e.isSelected?`rgba(0, 51, 113, 1)`:`transparent`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.label},t))})}var zg=()=>ei(Ag.id),Bg=e=>{let{provides:t}=zg(),[n,r]=j((t?.forDocument(e))?.getState()??{...xg});return M(()=>{if(!t)return;let n=t.forDocument(e);return r(n.getState()),n.onStateChange(e=>{r(e)})},[t,e]),n};function Vg(e){let{currentObject:t,scale:n,pageIndex:r}=e,i=t.field,{provides:a}=zg(),[o,s]=j(0),c=!!(i.flag&H.READONLY),l=P(()=>a?.forDocument(e.documentId),[a,e.documentId]);return M(()=>{if(l)return l.onFieldValueChange(e=>{e.annotationId===t.id&&s(e=>e+1)})},[l,t.id]),{annotation:t,field:i,scale:n,pageIndex:r,scope:l,handleChangeField:F(e=>{l&&l.setFormFieldValues(r,t,e)},[l,r,t]),renderKey:o,isReadOnly:c}}function Hg({pageIndex:e,annotation:t,scaleFactor:n=1,renderKey:r=0,style:i,...a}){let{provides:o}=zg(),[s,c]=j(null),l=N(null),{width:u,height:d}=t.rect.size;return M(()=>{if(!o)return;let r=o.renderWidget({pageIndex:e,annotation:t,options:{scaleFactor:n,dpr:window.devicePixelRatio}});return r.wait(e=>{let t=URL.createObjectURL(e);l.current&&URL.revokeObjectURL(l.current),l.current=t,c(t)},nr),()=>{r.abort({code:W.Cancelled,message:`canceled render task`})}},[e,n,o,t.id,u,d,r]),M(()=>()=>{l.current&&=(URL.revokeObjectURL(l.current),null)},[]),I(A,{children:s&&I(`img`,{src:s,...a,style:{width:`100%`,height:`100%`,display:`block`,...i||{}}})})}var Ug={position:`absolute`,top:0,left:0,padding:0,margin:0,width:`100%`,height:`100%`,borderRadius:0,outline:`none`,boxSizing:`border-box`},Wg=Ug,Gg={...Ug,cursor:`inherit`},Kg={...Ug,resize:`none`,lineHeight:1.14},qg={position:`relative`,width:`100%`,height:`100%`,borderRadius:0,boxSizing:`border-box`},Jg={position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,opacity:0,padding:0,margin:0,border:`none`,zIndex:1},Yg={position:`absolute`,top:0,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`},Xg={position:`absolute`,top:`15%`,height:`70%`,width:1,backgroundColor:`black`,pointerEvents:`none`};function Zg(e){let{inputRef:t,required:n,disabled:r,password:i,name:a,value:o,maxLen:s,cellWidth:c,chars:l,caretIndex:u,containerStyle:d,cellFontStyle:f,onFocus:p,onChange:m,onBlur:h}=e,[g,_]=j(!0);M(()=>{_(!0);let e=setInterval(()=>_(e=>!e),530);return()=>clearInterval(e)},[u]);let v=u<s;return I(`div`,{style:d,children:[I(`input`,{ref:t,required:n,disabled:r,type:i?`password`:`text`,name:a,"aria-label":a,value:o,maxLength:s,onFocus:p,onChange:m,onBlur:h,style:Jg}),Array.from({length:s}).map((e,t)=>I(`span`,{style:{...Yg,...f,left:t*c,width:c},children:l[t]||``},t)),v&&I(`span`,{style:{...Xg,left:u*c+c/2,opacity:+!!g}})]})}function Qg(e){let{annotation:t,isEditable:n,onChangeField:r,onFocus:i,onBlur:a,inputRef:o,scale:s,syncExternalValue:c=!0}=e,l=t.field,{flag:u}=l,d=l.name,f=l.value,[p,m]=j(f);M(()=>{c&&m(f)},[f,c]);let h=F(e=>{let t=e.target.value;m(t),r?.({...l,value:t})},[r,l]),g=(t.strokeWidth??0)*s,_=Gn(t.fontFamily),{adjustedFontPx:v,wrapperStyle:y}=Xp(t.fontSize*s,!0),b=P(()=>({backgroundColor:t.color??`transparent`,borderStyle:`solid`,borderColor:t.strokeColor??`transparent`,borderWidth:g,color:t.fontColor,..._,fontSize:v,padding:`${g}px ${g}px`}),[t.color,t.strokeColor,t.fontColor,v,g,_]),x=!n||!!(u&H.READONLY),S=!!(u&H.REQUIRED),C=!!(u&H.TEXT_PASSWORD),w=!!(u&H.TEXT_MULTIPLINE),T=!!(u&H.TEXT_COMB),E=l.maxLen;if(T&&E){let e=t.rect.size.width*s/E,n=(p||``).split(``),r=I(Zg,{inputRef:o,required:S,disabled:x,password:C,name:d,value:p,maxLen:E,cellWidth:e,chars:n,caretIndex:n.length,containerStyle:{...qg,backgroundColor:t.color??`transparent`,borderStyle:`solid`,borderColor:t.strokeColor??`transparent`,borderWidth:g},cellFontStyle:{color:t.fontColor,..._,fontSize:v},onFocus:i,onChange:h,onBlur:a});return y?I(`div`,{style:y,children:r}):r}let D=w?I(`textarea`,{ref:o,required:S,disabled:x,name:d,"aria-label":d,value:p,maxLength:E,onFocus:i,onChange:h,onBlur:a,style:{...Kg,...b}}):I(`input`,{ref:o,required:S,disabled:x,type:C?`password`:`text`,name:d,"aria-label":d,value:p,maxLength:E,onFocus:i,onChange:h,onBlur:a,style:{...Wg,...b}});return y?I(`div`,{style:y,children:D}):D}function $g(e){let{annotation:t,scale:n,pageIndex:r,scope:i,handleChangeField:a,renderKey:o,isReadOnly:s}=Vg(e),c=Bg(e.documentId),[l,u]=j(!1),d=N(null),f=c.selectedFieldId===t.id;M(()=>{f&&d.current&&document.activeElement!==d.current&&d.current.focus()},[f]);let p=F(()=>{s||(i?.selectField(t.id),u(!0))},[s,i,t.id]),m=F(()=>{u(!1),i?.getSelectedFieldId()===t.id&&i?.deselectField()},[i,t.id]),h=F(e=>{d.current=e},[]);return I(`div`,{style:{width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,pointerEvents:`auto`,outline:`none`},children:[I(Hg,{pageIndex:r,annotation:t,scaleFactor:n,renderKey:o,style:{position:`absolute`,inset:0,pointerEvents:`none`,visibility:l?`hidden`:`visible`}}),I(`div`,{style:{position:`absolute`,inset:0,zIndex:1,opacity:+!!l},children:I(Qg,{annotation:t,scale:n,pageIndex:r,isEditable:!0,onChangeField:a,syncExternalValue:!l,onFocus:p,onBlur:m,inputRef:h})})]})}function e_(e){let{annotation:t,field:n,scale:r,pageIndex:i,scope:a,handleChangeField:o,renderKey:s,isReadOnly:c}=Vg(e),l=Bg(e.documentId),u=N(null),d=l.selectedFieldId===t.id;M(()=>{d&&u.current&&document.activeElement!==u.current&&u.current.focus()},[d]);let f=F(()=>{if(c)return;let e=_n(t)?`Off`:t.exportValue??`Yes`;o({...n,value:e})},[c,t,n,o]),p=F(()=>{c||(a?.selectField(t.id),f())},[c,a,t.id,f]),m=F(()=>{c||a==null||a.selectField(t.id)},[c,a,t.id]),h=F(()=>{a?.getSelectedFieldId()===t.id&&a?.deselectField()},[a,t.id]),g=F(e=>{e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),f())},[f]);return I(`div`,{ref:u,tabIndex:c?-1:0,onClick:p,onFocus:m,onBlur:h,onKeyDown:g,style:{width:`100%`,height:`100%`,overflow:`hidden`,cursor:c?`default`:`pointer`,pointerEvents:`auto`,outline:d?`2px solid rgba(66, 133, 244, 0.8)`:`none`,outlineOffset:-2},children:I(Hg,{pageIndex:i,annotation:t,scaleFactor:r,renderKey:s,style:{pointerEvents:`none`}})})}function t_(e){let{annotation:t,field:n,scale:r,pageIndex:i,scope:a,handleChangeField:o,renderKey:s,isReadOnly:c}=Vg(e),l=Bg(e.documentId),u=N(null),d=l.selectedFieldId===t.id;M(()=>{d&&u.current&&document.activeElement!==u.current&&u.current.focus()},[d]);let f=F(()=>{c||!_n(t)&&t.exportValue&&o({...n,value:t.exportValue})},[c,t,n,o]),p=F(()=>{c||(a?.selectField(t.id),f())},[c,a,t.id,f]),m=F(()=>{c||a==null||a.selectField(t.id)},[c,a,t.id]),h=F(()=>{a?.getSelectedFieldId()===t.id&&a?.deselectField()},[a,t.id]),g=F(e=>{e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),f())},[f]);return I(`div`,{ref:u,tabIndex:c?-1:0,onClick:p,onFocus:m,onBlur:h,onKeyDown:g,style:{width:`100%`,height:`100%`,overflow:`hidden`,cursor:c?`default`:`pointer`,pointerEvents:`auto`,outline:d?`2px solid rgba(66, 133, 244, 0.8)`:`none`,outlineOffset:-2},children:I(Hg,{pageIndex:i,annotation:t,scaleFactor:r,renderKey:s,style:{pointerEvents:`none`}})})}function n_(e){let{annotation:t,isEditable:n,onChangeField:r,onBlur:i,inputRef:a}=e,o=t.field,{flag:s,options:c}=o,l=o.alternateName||o.name,u=!n||!!(s&H.READONLY),d=!!(s&H.REQUIRED),f=F(e=>{let t=e.target,n=c.map((e,n)=>({...e,isSelected:n===t.selectedIndex}));r?.({...o,options:n})},[r,o,c]),p=c.filter(e=>e.isSelected).map(e=>e.label);return I(`select`,{ref:a,required:d,disabled:u,name:l,"aria-label":l,...(m=!1,h=p,{value:m?void 0:h[0]||``}),onChange:f,onBlur:i,style:{...Gg,opacity:0},children:c.map((e,t)=>I(`option`,{value:e.label,...Mg(!1,p,e.label),children:e.label},t))});var m,h}function r_(e){let{annotation:t,scale:n,pageIndex:r,scope:i,handleChangeField:a,renderKey:o,isReadOnly:s}=Vg(e),c=Bg(e.documentId),l=N(null),u=N(null),d=c.selectedFieldId===t.id;M(()=>{d&&l.current&&!l.current.contains(document.activeElement)&&(u.current??l.current).focus()},[d]);let f=F(()=>{i?.selectField(t.id)},[i,t.id]),p=F(()=>{requestAnimationFrame(()=>{var e;(e=l.current)!=null&&e.contains(document.activeElement)||i?.getSelectedFieldId()===t.id&&i?.deselectField()})},[i,t.id]),m=F(e=>{u.current=e},[]);return I(`div`,{ref:l,onFocus:f,onBlur:p,style:{width:`100%`,height:`100%`,overflow:`hidden`,cursor:s?`default`:`pointer`,pointerEvents:`auto`,outline:d?`2px solid rgba(66, 133, 244, 0.8)`:`none`,outlineOffset:-2},children:[I(Hg,{pageIndex:r,annotation:t,scaleFactor:n,renderKey:o,style:{pointerEvents:`none`}}),I(n_,{annotation:t,scale:n,pageIndex:r,isEditable:!0,onChangeField:a,inputRef:m})]})}function i_(e){let{annotation:t,isEditable:n,onChangeField:r,onBlur:i,inputRef:a,scale:o}=e,s=t.field,{flag:c,options:l}=s,u=!n||!!(c&H.READONLY),d=!!(c&H.CHOICE_MULTL_SELECT),f=(t.strokeWidth??0)*o,p=(t.fontSize??12)*o,m=1.2*p,h=Gn(t.fontFamily),g=P(()=>({position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,background:t.color??`#FFFFFF`,borderStyle:`solid`,borderColor:t.strokeColor??`#000000`,borderWidth:f,boxSizing:`border-box`,overflow:`auto`,display:`flex`,flexDirection:`column`,outline:`none`}),[t.color,t.strokeColor,f]),_=F(e=>{if(u)return;let t=l.map((t,n)=>({...t,isSelected:d?n===e?!t.isSelected:t.isSelected:n===e}));r?.({...s,options:t})},[u,d,l,s,r]);return I(`div`,{ref:a,onBlur:i,style:g,children:l.map((e,n)=>I(`div`,{onClick:()=>_(n),style:{padding:`0 ${4*o}px`,fontSize:p,lineHeight:`${m}px`,...h,color:e.isSelected?`#FFFFFF`:t.fontColor??`#000000`,background:e.isSelected?`rgba(0, 51, 113, 1)`:`transparent`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,cursor:u?`default`:`pointer`},children:e.label},n))})}function a_(e){let{annotation:t,scale:n,pageIndex:r,scope:i,handleChangeField:a,renderKey:o,isReadOnly:s}=Vg(e),c=Bg(e.documentId),[l,u]=j(!1),d=N(null),f=c.selectedFieldId===t.id;M(()=>{f&&d.current&&!d.current.contains(document.activeElement)&&d.current.focus()},[f]);let p=F(()=>{s||(i?.selectField(t.id),u(!0))},[s,i,t.id]),m=F(()=>{requestAnimationFrame(()=>{var e;(e=d.current)!=null&&e.contains(document.activeElement)||(u(!1),i?.getSelectedFieldId()===t.id&&i?.deselectField())})},[i,t.id]);return I(`div`,{ref:d,tabIndex:s?-1:0,onFocus:p,onBlur:m,style:{width:`100%`,height:`100%`,overflow:`hidden`,cursor:s?`default`:`pointer`,pointerEvents:`auto`,outline:f&&!l?`2px solid rgba(66, 133, 244, 0.8)`:`none`,outlineOffset:-2},children:[I(i_,{annotation:t,scale:n,pageIndex:r,isEditable:!0,onChangeField:a}),!l&&I(Hg,{pageIndex:r,annotation:t,scaleFactor:n,renderKey:o,style:{pointerEvents:`none`}})]})}var o_=[nm({id:`formTextField`,matches:e=>e.type===z.WIDGET&&e.field?.type===V.TEXTFIELD,render:({annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i})=>I(Ng,{annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i}),renderPreview:({bounds:e,scale:t})=>I(`div`,{style:{position:`absolute`,left:0,top:0,width:e.size.width*t,height:e.size.height*t,border:`1px dashed rgba(66, 133, 244, 0.6)`,backgroundColor:`rgba(255, 255, 255, 0.9)`,boxSizing:`border-box`,display:`flex`,alignItems:`center`,padding:`0 ${2*t}px`,overflow:`hidden`}}),interactionDefaults:{isDraggable:!1,isResizable:!0,isRotatable:!1},useAppearanceStream:!1,renderLocked:e=>I($g,{...e})}),nm({id:`formCheckbox`,matches:e=>e.type===z.WIDGET&&e.field?.type===V.CHECKBOX,render:({annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i})=>I(Fg,{annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i}),renderPreview:({bounds:e,scale:t})=>I(`div`,{style:{position:`absolute`,left:0,top:0,width:e.size.width*t,height:e.size.height*t,border:`1px dashed rgba(66, 133, 244, 0.6)`,backgroundColor:`rgba(255, 255, 255, 0.9)`,boxSizing:`border-box`,display:`flex`,alignItems:`center`,justifyContent:`center`}}),interactionDefaults:{isDraggable:!1,isResizable:!0,isRotatable:!1},useAppearanceStream:!1,renderLocked:e=>I(e_,{...e})}),nm({id:`formRadioButton`,matches:e=>e.type===z.WIDGET&&e.field?.type===V.RADIOBUTTON,render:({annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i})=>I(Ig,{annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i}),renderPreview:({bounds:e,scale:t})=>I(`div`,{style:{position:`absolute`,left:0,top:0,width:e.size.width*t,height:e.size.height*t,border:`1px dashed rgba(66, 133, 244, 0.6)`,backgroundColor:`rgba(255, 255, 255, 0.9)`,borderRadius:`50%`,boxSizing:`border-box`,display:`flex`,alignItems:`center`,justifyContent:`center`}}),interactionDefaults:{isDraggable:!1,isResizable:!0,isRotatable:!1},useAppearanceStream:!1,renderLocked:e=>I(t_,{...e})}),nm({id:`formCombobox`,matches:e=>e.type===z.WIDGET&&e.field?.type===V.COMBOBOX,render:({annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i})=>I(Lg,{annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i}),renderPreview:({bounds:e,scale:t})=>I(`div`,{style:{position:`absolute`,left:0,top:0,width:e.size.width*t,height:e.size.height*t,border:`1px dashed rgba(66, 133, 244, 0.6)`,backgroundColor:`rgba(255, 255, 255, 0.9)`,boxSizing:`border-box`,display:`flex`,alignItems:`center`,padding:`0 ${2*t}px`,overflow:`hidden`}}),interactionDefaults:{isDraggable:!1,isResizable:!0,isRotatable:!1},useAppearanceStream:!1,renderLocked:e=>I(r_,{...e})}),nm({id:`formListbox`,matches:e=>e.type===z.WIDGET&&e.field?.type===V.LISTBOX,render:({annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i})=>I(Rg,{annotation:e,isSelected:t,scale:n,pageIndex:r,onClick:i}),renderPreview:({bounds:e,scale:t})=>I(`div`,{style:{position:`absolute`,left:0,top:0,width:e.size.width*t,height:e.size.height*t,border:`1px dashed rgba(66, 133, 244, 0.6)`,backgroundColor:`rgba(255, 255, 255, 0.9)`,boxSizing:`border-box`,display:`flex`,flexDirection:`column`,overflow:`hidden`}}),interactionDefaults:{isDraggable:!1,isResizable:!0,isRotatable:!1},useAppearanceStream:!1,renderLocked:e=>I(a_,{...e})})],s_=Yr(jg).addUtility(function(){return Up(o_),null}).build(),c_=`stamp`,l_={id:c_,name:`Stamp Plugin`,version:`1.0.0`,provides:[`stamp`],requires:[`annotation`],optional:[`i18n`],defaultConfig:{defaultLibrary:{id:`custom`,name:`Custom Stamps`,nameKey:`stamp.library.custom`,categories:[`custom`,`sidebar`]},manifests:[{url:`https://cdn.jsdelivr.net/npm/@embedpdf/default-stamps/{locale}/manifest.json`,fallbackLocale:`en`}]}},u_=`STAMP/ADD_LIBRARY`,d_=`STAMP/REMOVE_LIBRARY`;function f_(e){return{type:u_,payload:e}}function p_(e){return{type:d_,payload:e}}var m_={annotationType:z.STAMP,create(e){let{onPreview:t,onCommit:n,getTool:r,pageSize:i,pageRotation:a,getToolContext:o}=e;return{onPointerMove:e=>{let n=o();if(!n?.stampSize)return;let{width:r,height:i}=n.stampSize;t({type:z.STAMP,bounds:{origin:{x:e.x-r/2,y:e.y-i/2},size:{width:r,height:i}},data:{rect:{origin:{x:e.x-r/2,y:e.y-i/2},size:{width:r,height:i}},ghostUrl:n.ghostUrl,pageRotation:a}})},onPointerDown:s=>{var c;let l=r(),u=o();if(!l||!u?.stampSize)return;let{width:d,height:f}=u.stampSize,p={origin:{x:s.x-d/2,y:s.y-f/2},size:{width:d,height:f}},m={...l.defaults,rect:p,type:z.STAMP,name:u.stamp.name??l.defaults.name??on.Custom,subject:u.stamp.subject??l.defaults.subject??`Custom Stamp`,flags:l.defaults.flags??[`print`],pageIndex:e.pageIndex,id:K(),created:new Date};(c=l.behavior)!=null&&c.insertUpright&&(m=sd(m,a,!1)),m=cd(m,i),n(m,{appearance:u.appearance}),t(null)},onPointerLeave:()=>{t(null)}}}},h_=`rubberStamp`,g_=[{id:h_,name:`Rubber Stamp`,labelKey:`stamp.rubberStamp`,categories:[`annotation`,`stamp`,`insert`],matchScore:()=>0,interaction:{exclusive:!0,cursor:`copy`,isDraggable:!0,isResizable:!0,isRotatable:!1,lockAspectRatio:!0,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:z.STAMP},behavior:{deactivateToolAfterCreate:!0,selectAfterCreate:!0,insertUpright:!0,useAppearanceStream:!0},pointerHandler:m_}],__={Approved:on.Approved,Experimental:on.Experimental,NotApproved:on.NotApproved,AsIs:on.AsIs,Expired:on.Expired,NotForPublicRelease:on.NotForPublicRelease,Confidential:on.Confidential,Final:on.Final,Sold:on.Sold,Departmental:on.Departmental,ForComment:on.ForComment,TopSecret:on.TopSecret,Draft:on.Draft,ForPublicRelease:on.ForPublicRelease,Completed:on.Completed,Void:on.Void,PreliminaryResults:on.PreliminaryResults,InformationOnly:on.InformationOnly,Rejected:on.Rejected,Witness:on.Witness,InitialHere:on.InitialHere,SignHere:on.SignHere,Accepted:on.Accepted,Custom:on.Custom,Image:on.Image},v_=class extends Rr{constructor(e,t,n){if(super(e,t),this.config=n,this.instanceId=K(),this.libraries=new Map,this.libraryChange$=Kr(),this.activeStamp$=qr((e,t)=>({documentId:e,activeStamp:t})),this.managedManifests=[],this.annotation=null,this.i18n=null,this.localeUnsubscribe=null,this.toolChangeUnsubscribe=null,this.currentGhostUrl=null,this.annotation=t.getPlugin(`annotation`)?.provides()??null,this.annotation){for(let e of g_)this.annotation.addTool(e);this.toolChangeUnsubscribe=this.annotation.onActiveToolChange(({documentId:e,tool:t})=>{t?.id!==h_&&(this.currentGhostUrl&&=(URL.revokeObjectURL(this.currentGhostUrl),null),this.activeStamp$.emit(e,null))})}this.i18n=t.getPlugin(`i18n`)?.provides()??null}async initialize(){if(this.config.libraries)for(let e of this.config.libraries)await this.loadLibraryInternal(e).toPromise();this.config.manifests&&this.config.manifests.length>0&&await this.initializeManifests()}buildCapability(){return{getLibraries:()=>this.getLibraries(),getStampsByCategory:e=>this.getStampsByCategory(e),renderStamp:(e,t,n,r)=>this.renderStamp(e,t,n,r),loadLibrary:e=>this.loadLibrary(e),loadLibraryFromManifest:e=>this.loadLibraryFromManifest(e),createNewLibrary:(e,t)=>this.createNewLibrary(e,t),addStampToLibrary:(e,t,n)=>this.addStampToLibrary(e,t,n),removeStampFromLibrary:(e,t)=>this.removeStampFromLibrary(e,t),updateStamp:(e,t,n)=>this.updateStamp(e,t,n),updateLibrary:(e,t)=>this.updateLibrary(e,t),removeLibrary:e=>this.removeLibrary(e),exportLibrary:e=>this.exportLibrary(e),forDocument:e=>this.createStampScope(e),onActiveStampChange:this.activeStamp$.onGlobal,onLibraryChange:this.libraryChange$.on}}getLibraries(){return Array.from(this.libraries.values())}getStampsByCategory(e){let t=[];for(let n of this.libraries.values()){let r=n.categories?.includes(e)??!1;for(let i of n.stamps){let a=i.categories?.includes(e)??!1;(r||a)&&t.push({library:n,stamp:i})}}return t}renderStamp(e,t,n,r){let i=this.libraries.get(e);if(!i){let t=new L;return t.reject({code:W.NotFound,message:`Stamp library not found: ${e}`}),t}let a=i.document.pages[t];if(!a){let n=new L;return n.reject({code:W.NotFound,message:`Page ${t} not found in stamp library: ${e}`}),n}let o=n/a.size.width;return this.engine.renderPageRect(i.document,a,{origin:{x:0,y:0},size:a.size},{scaleFactor:o,dpr:r??1,withAnnotations:!0,rotation:a.rotation,transparentBackground:!0})}loadLibrary(e){return this.loadLibraryInternal(e)}createNewLibrary(e,t){let n=new L,r=t?.id??this.generateLibraryId(),i=this.getLibraryDocumentId(r);return this.engine.createDocument(i).wait(i=>{let a={id:r,name:e,nameKey:t?.nameKey,document:i,stamps:[],categories:t?.categories,readonly:t?.readonly??!1};this.libraries.set(r,a),this.dispatch(f_(r)),this.emitLibraryChange(),n.resolve(r)},t=>{this.logger.error(`StampPlugin`,`CreateNewLibrary`,`Failed to create library: ${e}`,t),n.fail(t)}),n}addStampToLibrary(e,t,n){let r=new L,i=this.libraries.get(e);if(!i)return r.reject({code:W.NotFound,message:`Stamp library not found: ${e}`}),r;if(i.readonly)return r.reject({code:W.NotSupport,message:`Cannot add stamps to readonly library: ${e}`}),r;let a=`stamp-temp-${Date.now()}`;return this.engine.openDocumentBuffer({id:a,content:n}).wait(e=>{this.engine.importPages(i.document,e,[0]).wait(n=>{let a=n[0];i.document.pages.push(a),i.document.pageCount=i.document.pages.length;let o={...t,id:K(),pageIndex:a.index};i.stamps.push(o),this.engine.closeDocument(e).wait(()=>{this.emitLibraryChange(),r.resolve()},()=>{this.emitLibraryChange(),r.resolve()})},t=>{this.logger.error(`StampPlugin`,`AddStampToLibrary`,`Failed to import page`,t),this.engine.closeDocument(e).wait(()=>r.fail(t),()=>r.fail(t))})},e=>{this.logger.error(`StampPlugin`,`AddStampToLibrary`,`Failed to open temp document`,e),r.fail(e)}),r}createStampScope(e){return{createStampFromAnnotation:(t,n,r)=>this.createStampFromAnnotation(e,t,n,r),createStampFromAnnotations:(t,n,r)=>this.createStampFromAnnotations(e,t,n,r),activateStampPlacement:(t,n)=>this.activateStampPlacement(e,t,n),activateStampPlacementById:(t,n)=>this.activateStampPlacementById(e,t,n),getActiveStamp:()=>this.getActiveStamp(e),onActiveStampChange:this.activeStamp$.forScope(e)}}activateStampPlacementById(e,t,n){let r=new L,i=this.libraries.get(t);if(!i)return r.reject({code:W.NotFound,message:`Stamp library not found: ${t}`}),r;let a=i.stamps.find(e=>e.id===n);return a?this.activateStampPlacement(e,t,a):(r.reject({code:W.NotFound,message:`Stamp ${n} not found in library: ${t}`}),r)}getActiveStamp(e){return this.activeStamp$.getValue(e)??null}activateStampPlacement(e,t,n){let r=new L,i=this.libraries.get(t);if(!i)return r.reject({code:W.NotFound,message:`Stamp library not found: ${t}`}),r;let a=i.document.pages[n.pageIndex];if(!a)return r.reject({code:W.NotFound,message:`Page ${n.pageIndex} not found in library`}),r;let o=a.size;return this.engine.extractPages(i.document,[n.pageIndex]).wait(i=>{this.renderStamp(t,n.pageIndex,o.width,2).wait(a=>{var s;this.currentGhostUrl&&URL.revokeObjectURL(this.currentGhostUrl);let c=URL.createObjectURL(a);this.currentGhostUrl=c,(s=this.annotation)==null||s.setActiveTool(h_,{appearance:i,ghostUrl:c,stampSize:o,libraryId:t,stamp:n}),this.activeStamp$.emit(e,{libraryId:t,stamp:n}),r.resolve()},e=>{this.logger.error(`StampPlugin`,`ActivateStampPlacement`,`Failed to render stamp preview`,e),r.fail(e)})},e=>{this.logger.error(`StampPlugin`,`ActivateStampPlacement`,`Failed to extract stamp page`,e),r.fail(e)}),r}createStampFromAnnotation(e,t,n,r){let i=new L,a=this.getCoreDocument(e);if(!a?.document)return i.reject({code:W.DocNotOpen,message:`document is not open`}),i;let o=a.document,s=o.pages[t.pageIndex];return s?(this.resolveTargetLibrary(r).wait(e=>{this.engine.exportAnnotationAppearanceAsPdf(o,s,t).wait(t=>{this.addStampToLibrary(e,n,t).wait(()=>i.resolve(),e=>i.fail(e))},e=>{this.logger.error(`StampPlugin`,`CreateStampFromAnnotation`,`Failed to export annotation`,e),i.fail(e)})},e=>i.fail(e)),i):(i.reject({code:W.NotFound,message:`page ${t.pageIndex} not found`}),i)}createStampFromAnnotations(e,t,n,r){let i=new L;if(t.length===0)return i.reject({code:W.NotFound,message:`no annotations provided`}),i;let a=this.getCoreDocument(e);if(!a?.document)return i.reject({code:W.DocNotOpen,message:`document is not open`}),i;let o=a.document,s=o.pages[t[0].pageIndex];return s?(this.resolveTargetLibrary(r).wait(e=>{this.engine.exportAnnotationsAppearanceAsPdf(o,s,t).wait(t=>{this.addStampToLibrary(e,n,t).wait(()=>i.resolve(),e=>i.fail(e))},e=>{this.logger.error(`StampPlugin`,`CreateStampFromAnnotations`,`Failed to export annotations`,e),i.fail(e)})},e=>i.fail(e)),i):(i.reject({code:W.NotFound,message:`page ${t[0].pageIndex} not found`}),i)}resolveTargetLibrary(e){if(e&&this.libraries.has(e)){let t=new L;return t.resolve(e),t}let t=this.config.defaultLibrary;if(!1===this.config.defaultLibrary||!t){let e=new L;return e.reject({code:W.NotSupport,message:`Default library creation is disabled`}),e}let n=t.id??`custom`;if(this.libraries.has(n)){let e=new L;return e.resolve(n),e}return this.createNewLibrary(t.name??`Custom Stamps`,{id:n,nameKey:t.nameKey,categories:t.categories})}removeLibrary(e){let t=new L,n=this.libraries.get(e);return n?(this.engine.closeDocument(n.document).wait(()=>{this.libraries.delete(e),this.dispatch(p_(e)),this.emitLibraryChange(),t.resolve()},()=>{this.logger.warn(`StampPlugin`,`RemoveLibrary`,`Failed to close document for library: ${e}`),this.libraries.delete(e),this.dispatch(p_(e)),this.emitLibraryChange(),t.resolve()}),t):(t.resolve(),t)}exportLibrary(e){let t=new L,n=this.libraries.get(e);return n?(this.engine.saveAsCopy(n.document).wait(e=>{t.resolve({name:n.name,pdf:e,stamps:n.stamps,categories:n.categories})},n=>{this.logger.error(`StampPlugin`,`ExportLibrary`,`Failed to export library: ${e}`,n),t.fail(n)}),t):(t.reject({code:W.NotFound,message:`Stamp library not found: ${e}`}),t)}loadLibraryInternal(e){let t=new L,n=e.id??this.generateLibraryId(),r=this.getLibraryDocumentId(n);return(typeof e.pdf==`string`?this.engine.openDocumentUrl({id:r,url:e.pdf}):this.engine.openDocumentBuffer({id:r,content:e.pdf})).wait(r=>{let i=e.stamps.map(e=>e.id?e:{...e,id:K()}),a={id:n,name:e.name,nameKey:e.nameKey,document:r,stamps:i,categories:e.categories,readonly:e.readonly??!1};this.libraries.set(n,a),this.dispatch(f_(n)),this.emitLibraryChange(),t.resolve(n)},n=>{this.logger.error(`StampPlugin`,`LoadLibrary`,`Failed to load stamp library: ${e.name}`,n),t.fail(n)}),t}removeStampFromLibrary(e,t){let n=new L,r=this.libraries.get(e);if(!r)return n.reject({code:W.NotFound,message:`Stamp library not found: ${e}`}),n;if(r.readonly)return n.reject({code:W.NotSupport,message:`Cannot remove stamps from readonly library: ${e}`}),n;let i=r.stamps.findIndex(e=>e.id===t);if(i===-1)return n.reject({code:W.NotFound,message:`Stamp ${t} not found in library: ${e}`}),n;let a=r.stamps[i].pageIndex;return this.engine.deletePage(r.document,a).wait(()=>{r.stamps.splice(i,1),r.document.pages.splice(a,1),r.document.pageCount=r.document.pages.length;for(let e of r.stamps)e.pageIndex>a&&e.pageIndex--;for(let e=0;e<r.document.pages.length;e++)r.document.pages[e].index=e;this.emitLibraryChange(),n.resolve()},e=>{this.logger.error(`StampPlugin`,`RemoveStampFromLibrary`,`Failed to delete page for stamp ${t}`,e),n.fail(e)}),n}updateStamp(e,t,n){let r=new L,i=this.libraries.get(e);if(!i)return r.reject({code:W.NotFound,message:`Stamp library not found: ${e}`}),r;if(i.readonly)return r.reject({code:W.NotSupport,message:`Cannot update stamps in readonly library: ${e}`}),r;let a=i.stamps.find(e=>e.id===t);return a?(Object.assign(a,n),this.emitLibraryChange(),r.resolve(),r):(r.reject({code:W.NotFound,message:`Stamp ${t} not found in library: ${e}`}),r)}updateLibrary(e,t){let n=new L,r=this.libraries.get(e);return r?r.readonly?(n.reject({code:W.NotSupport,message:`Cannot update readonly library: ${e}`}),n):(t.name!==void 0&&(r.name=t.name),t.nameKey!==void 0&&(r.nameKey=t.nameKey),t.categories!==void 0&&(r.categories=t.categories),t.readonly!==void 0&&(r.readonly=t.readonly),this.emitLibraryChange(),n.resolve(),n):(n.reject({code:W.NotFound,message:`Stamp library not found: ${e}`}),n)}loadLibraryFromManifest(e){return this.loadManifestUrl(e,!0)}async initializeManifests(){let e=this.i18n?.getLocale()??`en`;for(let t of this.config.manifests){let n=t.url.includes(`{locale}`),r=n?e:``,i=t.url.replace(`{locale}`,r||e),a={source:t,localeAware:n,currentLocale:n?e:``,libraryId:null};this.managedManifests.push(a);try{a.libraryId=await this.loadManifestUrl(i,!0).toPromise()}catch{if(n&&t.fallbackLocale&&t.fallbackLocale!==e){let e=t.url.replace(`{locale}`,t.fallbackLocale);try{a.libraryId=await this.loadManifestUrl(e,!0).toPromise(),a.currentLocale=t.fallbackLocale}catch{this.logger.warn(`StampPlugin`,`InitManifests`,`Failed to load manifest (including fallback): ${t.url}`)}}else this.logger.warn(`StampPlugin`,`InitManifests`,`Failed to load manifest: ${i}`)}}this.i18n&&(this.localeUnsubscribe=this.i18n.onLocaleChange(e=>{this.handleLocaleChange(e.currentLocale)}))}async handleLocaleChange(e){for(let t of this.managedManifests){if(!t.localeAware||t.currentLocale===e)continue;if(t.libraryId){try{await this.removeLibrary(t.libraryId).toPromise()}catch{}t.libraryId=null}let n=t.source.url.replace(`{locale}`,e);try{t.libraryId=await this.loadManifestUrl(n,!0).toPromise(),t.currentLocale=e}catch{let n=t.source.fallbackLocale??`en`;if(n!==e){let r=t.source.url.replace(`{locale}`,n);try{t.libraryId=await this.loadManifestUrl(r,!0).toPromise(),t.currentLocale=n}catch{this.logger.warn(`StampPlugin`,`LocaleChange`,`Failed to load manifest for locale ${e} (including fallback): ${t.source.url}`)}}else this.logger.warn(`StampPlugin`,`LocaleChange`,`Failed to load manifest for locale ${e}: ${t.source.url}`)}}}loadManifestUrl(e,t){let n=new L;return fetch(e).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}: ${e.statusText}`);return e.json()}).then(r=>{let i=this.resolveManifestPdfUrl(e,r.pdf),a=r.stamps.map(e=>{return{id:e.id??K(),pageIndex:e.pageIndex,name:(t=e.name,t?__[t]??on.Custom:on.Custom),subject:e.subject,subjectKey:e.subjectKey,label:e.label,categories:e.categories};var t}),o={id:r.id,name:r.name,nameKey:r.nameKey,pdf:i,stamps:a,categories:r.categories,readonly:t};this.loadLibraryInternal(o).wait(e=>n.resolve(e),e=>n.fail(e))}).catch(t=>{this.logger.error(`StampPlugin`,`LoadManifest`,`Failed to fetch manifest: ${e}`,t),n.reject({code:W.NotFound,message:`Failed to load stamp manifest: ${e}`})}),n}resolveManifestPdfUrl(e,t){return t.startsWith(`http://`)||t.startsWith(`https://`)||t.startsWith(`/`)?t:e.substring(0,e.lastIndexOf(`/`)+1)+t}generateLibraryId(){return K()}getLibraryDocumentId(e){return`stamp-doc-${this.instanceId}-${e}`}emitLibraryChange(){this.libraryChange$.emit(this.getLibraries())}async destroy(){this.currentGhostUrl&&=(URL.revokeObjectURL(this.currentGhostUrl),null),this.toolChangeUnsubscribe&&=(this.toolChangeUnsubscribe(),null),this.localeUnsubscribe&&=(this.localeUnsubscribe(),null),this.activeStamp$.clear();let e=Array.from(this.libraries.values());for(let t of e)try{await this.engine.closeDocument(t.document).toPromise()}catch{}this.libraries.clear(),this.managedManifests.length=0,super.destroy()}};v_.id=c_;var y_=v_,b_={libraryIds:[]},x_=()=>ei(y_.id);function S_({libraryId:e,pageIndex:t,width:n,dpr:r,style:i,...a}){let{provides:o}=x_(),[s,c]=j(),l=N(null);return M(()=>{if(!o)return;let i=o.renderStamp(e,t,n,r??window.devicePixelRatio);return i.wait(e=>{let t=URL.createObjectURL(e);l.current=t,c(t)},nr),()=>{l.current?(URL.revokeObjectURL(l.current),l.current=null):i.abort({code:W.Cancelled,message:`canceled stamp render task`})}},[o,e,t,n,r]),s?I(`img`,{src:s,onLoad:()=>{l.current&&=(URL.revokeObjectURL(l.current),null)},style:i,...a}):null}var C_=Yr({manifest:l_,create:(e,t)=>new y_(c_,e,t),reducer:(e=b_,t)=>{switch(t.type){case u_:return{...e,libraryIds:[...e.libraryIds,t.payload]};case d_:return{...e,libraryIds:e.libraryIds.filter(e=>e!==t.payload)};default:return e}},initialState:b_}).build(),w_=(e=>(e.SignatureOnly=`signature-only`,e.SignatureAndInitials=`signature-and-initials`,e))(w_||{}),T_=(e=>(e.Draw=`draw`,e.Type=`type`,e.Upload=`upload`,e))(T_||{}),E_=(e=>(e.Signature=`signature`,e.Initials=`initials`,e))(E_||{}),D_=`signature`,O_={id:D_,name:`Signature Plugin`,version:`1.0.0`,provides:[`signature`],requires:[`annotation`],optional:[],defaultConfig:{mode:w_.SignatureOnly}},k_=`SIGNATURE/ADD_ENTRY`,A_=`SIGNATURE/REMOVE_ENTRY`;function j_(e){return{type:k_,payload:e}}var M_={annotationType:z.STAMP,create(e){let{onPreview:t,onCommit:n,getTool:r,pageSize:i,pageRotation:a,getToolContext:o}=e;return{onPointerMove:e=>{let n=o();if(!n?.targetSize)return;let{width:r,height:i}=n.targetSize;t({type:z.STAMP,bounds:{origin:{x:e.x-r/2,y:e.y-i/2},size:{width:r,height:i}},data:{rect:{origin:{x:e.x-r/2,y:e.y-i/2},size:{width:r,height:i}},ghostUrl:n.ghostUrl,pageRotation:a}})},onPointerDown:s=>{var c;let l=r(),u=o();if(!l||!u?.targetSize)return;let{width:d,height:f}=u.targetSize,p={origin:{x:s.x-d/2,y:s.y-f/2},size:{width:d,height:f}},m={...l.defaults,rect:p,type:z.STAMP,name:on.Custom,subject:`Signature`,flags:l.defaults.flags??[`print`],pageIndex:e.pageIndex,id:K(),created:new Date};(c=l.behavior)!=null&&c.insertUpright&&(m=sd(m,a,!1)),m=cd(m,i),n(m,{data:u.imageData}),t(null)},onPointerLeave:()=>{t(null)}}}};function N_(e,t,n){let r=t.width/e.size.width,i=t.height/e.size.height,a=Math.min(r,i),o=e.size.width*a,s=e.size.height*a,c=n.x-o/2,l=n.y-s/2;return{inkList:e.inkList.map(e=>({points:e.points.map(e=>({x:e.x*a+c,y:e.y*a+l}))})),strokeWidth:Math.round(e.strokeWidth*a*10)/10}}var P_={annotationType:z.INK,create(e){let{onPreview:t,onCommit:n,getTool:r,pageSize:i,getToolContext:a}=e;return{onPointerMove:e=>{let n=a();if(!n?.inkData||!n?.targetSize)return;let{inkList:r,strokeWidth:i}=N_(n.inkData,n.targetSize,e),o=r.flatMap(e=>e.points);if(o.length===0)return;let s=St({origin:{x:Math.min(...o.map(e=>e.x)),y:Math.min(...o.map(e=>e.y))},size:{width:Math.max(...o.map(e=>e.x))-Math.min(...o.map(e=>e.x)),height:Math.max(...o.map(e=>e.y))-Math.min(...o.map(e=>e.y))}},i/2);t({type:z.INK,bounds:s,data:{rect:s,inkList:r,strokeWidth:i,strokeColor:n.inkData.strokeColor,opacity:.5}})},onPointerDown:o=>{let s=r(),c=a();if(!s||!c?.inkData||!c?.targetSize)return;let{inkList:l,strokeWidth:u}=N_(c.inkData,c.targetSize,o),d=l.flatMap(e=>e.points);if(d.length===0)return;let f=St({origin:{x:Math.min(...d.map(e=>e.x)),y:Math.min(...d.map(e=>e.y))},size:{width:Math.max(...d.map(e=>e.x))-Math.min(...d.map(e=>e.x)),height:Math.max(...d.map(e=>e.y))-Math.min(...d.map(e=>e.y))}},u/2),p={...s.defaults,inkList:l,rect:f,strokeWidth:u,strokeColor:c.inkData.strokeColor,opacity:1,type:z.INK,subject:`Signature`,flags:s.defaults.flags??[`print`],pageIndex:e.pageIndex,id:K(),created:new Date},m=p.rect;p=cd(p,i);let h=p.rect.origin.x-m.origin.x,g=p.rect.origin.y-m.origin.y;h===0&&g===0||(p={...p,inkList:p.inkList.map(e=>({points:e.points.map(e=>({x:e.x+h,y:e.y+g}))}))}),n(p),t(null)},onPointerLeave:()=>{t(null)}}}},F_=`signatureStamp`,I_=`signatureInk`,L_=[{id:F_,name:`Signature Stamp`,labelKey:`signature.stamp`,categories:[`annotation`,`signature`,`insert`],matchScore:()=>0,interaction:{exclusive:!0,cursor:`copy`,isDraggable:!0,isResizable:!0,isRotatable:!1,lockAspectRatio:!0,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:z.STAMP},behavior:{deactivateToolAfterCreate:!0,selectAfterCreate:!0,insertUpright:!0,useAppearanceStream:!0},pointerHandler:M_},{id:I_,name:`Signature Ink`,labelKey:`signature.ink`,categories:[`annotation`,`signature`,`insert`],matchScore:e=>e.type===z.INK&&e.subject===`Signature`?20:0,interaction:{exclusive:!0,cursor:`copy`,isDraggable:!0,isResizable:!0,isRotatable:!1,lockAspectRatio:!0,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:z.INK},behavior:{deactivateToolAfterCreate:!0,selectAfterCreate:!0},transform:Wd.patchInk,pointerHandler:P_}],R_=class extends Rr{constructor(e,t,n){if(super(e,t),this.config=n,this.entries=new Map,this.entriesChange$=Kr(),this.activePlacement$=qr((e,t)=>({documentId:e,activePlacement:t})),this.annotation=null,this.toolChangeUnsubscribe=null,this.currentGhostUrl=null,this.annotation=t.getPlugin(`annotation`)?.provides()??null,this.annotation){for(let e of L_)this.annotation.addTool(e);this.toolChangeUnsubscribe=this.annotation.onActiveToolChange(({documentId:e,tool:t})=>{t?.id!==F_&&t?.id!==I_&&(this.revokeGhostUrl(),this.activePlacement$.emit(e,null))})}}async initialize(){}buildCapability(){return{mode:this.config.mode,getEntries:()=>this.getEntries(),addEntry:e=>this.addEntry(e),removeEntry:e=>this.removeEntry(e),loadEntries:e=>this.loadEntries(e),exportEntries:()=>this.exportEntries(),onEntriesChange:this.entriesChange$.on,forDocument:e=>this.createSignatureScope(e),onActivePlacementChange:this.activePlacement$.onGlobal}}getEntries(){return Array.from(this.entries.values())}addEntry(e){let t=K(),n={...e,id:t,createdAt:Date.now()};return this.entries.set(t,n),this.dispatch(j_(t)),this.emitEntriesChange(),t}removeEntry(e){this.entries.has(e)&&(this.entries.delete(e),this.dispatch(function(e){return{type:A_,payload:e}}(e)),this.emitEntriesChange())}loadEntries(e){for(let t of e)this.entries.set(t.id,t),this.dispatch(j_(t.id));this.emitEntriesChange()}exportEntries(){return this.getEntries()}createSignatureScope(e){return{activateSignaturePlacement:t=>this.activatePlacement(e,t,E_.Signature),activateInitialsPlacement:t=>this.activatePlacement(e,t,E_.Initials),deactivatePlacement:()=>this.deactivatePlacement(e),getActivePlacement:()=>this.activePlacement$.getValue(e)??null,onActivePlacementChange:this.activePlacement$.forScope(e)}}activatePlacement(e,t,n){let r=this.entries.get(t);if(!r||!this.annotation)return;let i=n===E_.Initials?r.initials:r.signature;if(i){if(this.revokeGhostUrl(),i.creationType===T_.Draw){if(r.signature.creationType!==T_.Draw)return;let e=this.config.defaultSize??{width:150,height:50},a=r.signature.inkData.size,o=Math.min(e.width/a.width,e.height/a.height),s={width:i.inkData.size.width*o,height:i.inkData.size.height*o};this.annotation.setActiveTool(I_,{inkData:i.inkData,targetSize:s,entryId:t,kind:n})}else{if(!i.imageData)return;let e=URL.createObjectURL(new Blob([i.imageData],{type:i.imageMimeType??`image/png`}));this.currentGhostUrl=e;let a=this.config.defaultSize??{width:150,height:50},o=a;if(i.imageSize){let e=r.signature.creationType===T_.Draw?i.imageSize:r.signature.imageSize??i.imageSize,t=Math.min(a.width/e.width,a.height/e.height);o={width:i.imageSize.width*t,height:i.imageSize.height*t}}this.annotation.setActiveTool(F_,{imageData:i.imageData,ghostUrl:e,targetSize:o,entryId:t,kind:n})}this.activePlacement$.emit(e,{entryId:t,kind:n})}}deactivatePlacement(e){this.annotation&&(this.annotation.setActiveTool(null),this.revokeGhostUrl(),this.activePlacement$.emit(e,null))}revokeGhostUrl(){this.currentGhostUrl&&=(URL.revokeObjectURL(this.currentGhostUrl),null)}emitEntriesChange(){this.entriesChange$.emit(this.getEntries())}async destroy(){var e;this.revokeGhostUrl(),(e=this.toolChangeUnsubscribe)==null||e.call(this),this.entries.clear()}};R_.id=D_;var z_=R_,B_={entryIds:[]};function V_(e){let t=new Uint8Array(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function H_(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}function U_(e){if(e.creationType===T_.Draw)return e;let{imageData:t,...n}=e;return{...n,imageData:t?V_(t):void 0}}function W_(e){if(e.creationType===T_.Draw)return e;let{imageData:t,...n}=e;return{...n,imageData:t?H_(t):void 0}}function G_(e){return e.map(e=>({id:e.id,createdAt:e.createdAt,signature:U_(e.signature),...e.initials&&{initials:U_(e.initials)}}))}function K_(e){return e.map(e=>({id:e.id,createdAt:e.createdAt,signature:W_(e.signature),...e.initials&&{initials:W_(e.initials)}}))}var q_=()=>ei(z_.id);function J_({accept:e=`image/png,image/jpeg,image/svg+xml`,onResult:t}){let n=N(null),[r,i]=j(null),[a,o]=j(!1),s=F(e=>{let n=new FileReader;n.onload=()=>{let r=n.result,a=new Blob([r],{type:e.type}),o=URL.createObjectURL(a);i(e=>(e&&URL.revokeObjectURL(e),o));let s=new Image;s.onload=()=>{let n=document.createElement(`canvas`);n.width=s.width,n.height=s.height;let i=n.getContext(`2d`);i&&i.drawImage(s,0,0),t({creationType:T_.Upload,imageMimeType:e.type,imageSize:{width:s.width,height:s.height},previewDataUrl:n.toDataURL(`image/png`),imageData:r})},s.src=o},n.readAsArrayBuffer(e)},[t]),c=F(e=>{let t=e.target.files;t&&t[0]&&s(t[0])},[s]),l=F(e=>{e.preventDefault(),o(!1);let t=e.dataTransfer?.files;t&&t[0]&&s(t[0])},[s]),u=F(e=>{e.preventDefault(),o(!0)},[]),d=F(()=>{o(!1)},[]);return{inputRef:n,openFilePicker:F(()=>{var e;(e=n.current)==null||e.click()},[]),processFile:s,handleFileInputChange:c,handleDrop:l,handleDragOver:u,handleDragLeave:d,previewUrl:r,isDragging:a,clear:F(()=>{i(e=>(e&&URL.revokeObjectURL(e),null)),t(null),n.current&&(n.current.value=``)},[t]),accept:e}}function Y_(e,t=4){let n=e.getContext(`2d`);if(!n)return null;let{width:r,height:i}=e;if(r===0||i===0)return null;let{data:a}=n.getImageData(0,0,r,i),o=r,s=i,c=0,l=0;for(let e=0;e<i;e++)for(let t=0;t<r;t++)a[4*(e*r+t)+3]>0&&(t<o&&(o=t),t>c&&(c=t),e<s&&(s=e),e>l&&(l=e));if(c<o||l<s)return null;let u=Math.max(0,o-t),d=Math.max(0,s-t),f=Math.min(r,c+t+1)-u,p=Math.min(i,l+t+1)-d,m=document.createElement(`canvas`);m.width=f,m.height=p;let h=m.getContext(`2d`);return h?(h.drawImage(e,u,d,f,p,0,0,f,p),{canvas:m,bounds:{x:u,y:d,width:f,height:p}}):null}function X_({onResult:e,padRef:t,strokeColor:n=`#000000`,strokeWidth:r=4,className:i}){let a=N(null),[o,s]=j([]),c=N(!1),l=N({width:0,height:0}),u=N(o);u.current=o;let d=typeof window<`u`&&window.devicePixelRatio||1,f=F(e=>{let t=a.current;if(!t)return{x:0,y:0};let n=t.getBoundingClientRect();return{x:(e.clientX-n.left)*(t.width/d/n.width),y:(e.clientY-n.top)*(t.height/d/n.height)}},[d]),p=F(e=>{let t=a.current;if(!t)return;let i=t.getContext(`2d`);if(i){i.clearRect(0,0,t.width,t.height),i.save(),i.scale(d,d),i.strokeStyle=n,i.lineWidth=r,i.lineCap=`round`,i.lineJoin=`round`;for(let t of e)if(t.points.length!==0){i.beginPath(),i.moveTo(t.points[0].x,t.points[0].y);for(let e=1;e<t.points.length;e++)i.lineTo(t.points[e].x,t.points[e].y);i.stroke()}i.restore()}},[d,n,r]),m=N(p);m.current=p;let h=F(t=>{if(t.length===0||t.every(e=>e.points.length<2))return void e(null);let i=a.current;if(!i)return;let o=Y_(i,Math.ceil(r*d));if(!o)return void e(null);let s=o.bounds.x/d,c=o.bounds.y/d,l=Math.round(o.bounds.width/d),u=Math.round(o.bounds.height/d);e({creationType:T_.Draw,inkData:{inkList:t.filter(e=>e.points.length>=2).map(e=>({points:e.points.map(e=>({x:e.x-s,y:e.y-c}))})),strokeWidth:r,strokeColor:n,size:{width:l,height:u}},previewDataUrl:o.canvas.toDataURL(`image/png`)})},[e,r,n,d]);M(()=>{let e=a.current;if(!e)return;let t=new ResizeObserver(t=>{let{width:n,height:r}=t[0].contentRect;n>0&&r>0&&(l.current={width:Math.round(n),height:Math.round(r)},e.width=Math.round(n)*d,e.height=Math.round(r)*d,m.current(u.current))});return t.observe(e),()=>t.disconnect()},[d]),M(()=>{p(o),o.length>0&&o.some(e=>e.points.length>=2)&&h(o)},[n,r]);let g=F(()=>{s([]),p([]),e(null)},[p,e]);return M(()=>(t?.({clear:g}),()=>t?.(null)),[t,g]),I(`canvas`,{ref:a,className:i,style:{touchAction:`none`,width:`100%`,height:`100%`,display:`block`},onPointerDown:F(e=>{var t,n;c.current=!0;let r=f(e),i=[...o,{points:[r]}];s(i),p(i),(n=(t=e.target)?.setPointerCapture)==null||n.call(t,e.pointerId)},[o,f,p]),onPointerMove:F(e=>{if(!c.current)return;let t=f(e),n=[...o],r=n[n.length-1];r&&(r.points.push(t),s(n),p(n))},[o,f,p]),onPointerUp:F(e=>{var t,n;c.current=!1,(n=(t=e.target)?.releasePointerCapture)==null||n.call(t,e.pointerId),h(o)},[o,h])})}function Z_({onResult:e,padRef:t,fontFamily:n=`'Dancing Script', cursive`,fontSize:r=48,color:i=`#000000`,className:a,placeholder:o=`Type your signature...`}){let s=N(null),c=N(null),l=N(`sig-type-${Math.random().toString(36).slice(2,8)}`).current,u=N({width:0,height:0}),[d,f]=j(``),p=typeof window<`u`&&window.devicePixelRatio||1,m=F(t=>{let a=s.current;if(!a)return;let{width:o,height:c}=u.current;if(o===0||c===0)return;a.width=o*p,a.height=c*p;let l=a.getContext(`2d`);if(!l)return;if(l.clearRect(0,0,a.width,a.height),!t.trim())return void e(null);l.scale(p,p),l.fillStyle=i,l.font=`${r}px ${n}`,l.textBaseline=`middle`,l.textAlign=`center`,l.fillText(t,o/2,c/2,o-20);let d=Y_(a,Math.ceil(4*p));if(!d)return void e(null);let f=Math.round(d.bounds.width/p),m=Math.round(d.bounds.height/p);d.canvas.toBlob(n=>{n&&n.arrayBuffer().then(n=>{e({creationType:T_.Type,label:t,imageMimeType:`image/png`,imageSize:{width:f,height:m},previewDataUrl:d.canvas.toDataURL(`image/png`),imageData:n})})},`image/png`)},[e,i,r,n,p]),h=N(m);h.current=m;let g=N(d);g.current=d,M(()=>{let e=c.current;if(!e)return;let t=new ResizeObserver(e=>{let{width:t,height:n}=e[0].contentRect;t>0&&n>0&&(u.current={width:Math.round(t),height:Math.round(n)},h.current(g.current))});return t.observe(e),()=>t.disconnect()},[]),M(()=>{m(d)},[d,n,m]);let _=F(()=>{f(``),e(null)},[e]);M(()=>(t?.({clear:_}),()=>t?.(null)),[t,_]);let v=F(e=>{f(e.target.value)},[]);return I(`div`,{ref:c,className:a,style:{width:`100%`,height:`100%`},children:[I(`style`,{children:`#${l}::placeholder { color: ${i}; opacity: 0.5; }`}),I(`input`,{id:l,type:`text`,value:d,onInput:v,placeholder:o,style:{fontFamily:n,fontSize:`${Math.min(r,32)}px`,color:i,width:`100%`,height:`100%`,border:`none`,outline:`none`,background:`transparent`,textIndent:`8px`}}),I(`canvas`,{ref:s,style:{display:`none`}})]})}var Q_=Yr({manifest:O_,create:(e,t)=>new z_(D_,e,t),reducer:(e=B_,t)=>{switch(t.type){case k_:return{...e,entryIds:[...e.entryIds,t.payload]};case A_:return{...e,entryIds:e.entryIds.filter(e=>e!==t.payload)};default:return e}},initialState:B_}).build(),$_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ev=`-`,tv=[],nv=e=>{let t=av(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return iv(e);let n=e.split(ev);return rv(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?((e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(i,t):t:i||tv}return n[e]||tv}}},rv=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=rv(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(ev):e.slice(t).join(ev),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},iv=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?`arbitrary..`+r:void 0})(),av=e=>{let{theme:t,classGroups:n}=e;return ov(n,t)},ov=(e,t)=>{let n=$_();for(let r in e){let i=e[r];sv(i,n,r,t)}return n},sv=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];cv(i,t,n,r)}},cv=(e,t,n,r)=>{typeof e==`string`?lv(e,t,n):typeof e==`function`?uv(e,t,n,r):dv(e,t,n,r)},lv=(e,t,n)=>{(e===``?t:fv(t,e)).classGroupId=n},uv=(e,t,n,r)=>{pv(e)?sv(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},dv=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];sv(o,fv(t,a),n,r)}},fv=(e,t)=>{let n=e,r=t.split(ev),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=$_(),n.nextPart.set(t,i)),n=i}return n},pv=e=>`isThemeGetter`in e&&!0===e.isThemeGetter,mv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return t===void 0?(t=r[e])===void 0?void 0:(i(e,t),t):t},set(e,t){e in n?n[e]=t:i(e,t)}}},hv=[],gv=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),_v=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n,r=0,i=0,a=0,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(r===0&&i===0){if(o===`:`){t.push(e.slice(a,s)),a=s+1;continue}if(o===`/`){n=s;continue}}o===`[`?r++:o===`]`?r--:o===`(`?i++:o===`)`&&i--}let s=t.length===0?e:e.slice(a),c=s,l=!1;return s.endsWith(`!`)?(c=s.slice(0,-1),l=!0):s.startsWith(`!`)&&(c=s.slice(1),l=!0),gv(t,l,c,n&&n>a?n-a:void 0)};if(t){let e=t+`:`,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):gv(hv,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},vv=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},yv=/\s+/,bv=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=bv(e[r]))&&(n&&(n+=` `),n+=t);return n},xv=(e,...t)=>{let n,r,i,a,o=e=>{let t=r(e);if(t)return t;let a=((e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(yv),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+`!`:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c})(e,n);return i(e,a),a};return a=s=>(n=(e=>({cache:mv(e.cacheSize),parseClassName:_v(e),sortModifiers:vv(e),...nv(e)}))(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=o,o(s)),(...e)=>a(((...e)=>{let t,n,r=0,i=``;for(;r<e.length;)(t=e[r++])&&(n=bv(t))&&(i&&(i+=` `),i+=n);return i})(...e))},Sv=[],Cv=e=>{let t=t=>t[e]||Sv;return t.isThemeGetter=!0,t},wv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Tv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ev=/^\d+\/\d+$/,Dv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ov=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,kv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Av=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mv=e=>Ev.test(e),Nv=e=>!!e&&!Number.isNaN(Number(e)),Pv=e=>!!e&&Number.isInteger(Number(e)),Fv=e=>e.endsWith(`%`)&&Nv(e.slice(0,-1)),Iv=e=>Dv.test(e),Lv=()=>!0,Rv=e=>Ov.test(e)&&!kv.test(e),zv=()=>!1,Bv=e=>Av.test(e),Vv=e=>jv.test(e),Hv=e=>!X(e)&&!Z(e),Uv=e=>ty(e,ay,zv),X=e=>wv.test(e),Wv=e=>ty(e,oy,Rv),Gv=e=>ty(e,sy,Nv),Kv=e=>ty(e,ry,zv),qv=e=>ty(e,iy,Vv),Jv=e=>ty(e,ly,Bv),Z=e=>Tv.test(e),Yv=e=>ny(e,oy),Xv=e=>ny(e,cy),Zv=e=>ny(e,ry),Qv=e=>ny(e,ay),$v=e=>ny(e,iy),ey=e=>ny(e,ly,!0),ty=(e,t,n)=>{let r=wv.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ny=(e,t,n=!1)=>{let r=Tv.exec(e);return!!r&&(r[1]?t(r[1]):n)},ry=e=>e===`position`||e===`percentage`,iy=e=>e===`image`||e===`url`,ay=e=>e===`length`||e===`size`||e===`bg-size`,oy=e=>e===`length`,sy=e=>e===`number`,cy=e=>e===`family-name`,ly=e=>e===`shadow`,uy=xv(()=>{let e=Cv(`color`),t=Cv(`font`),n=Cv(`text`),r=Cv(`font-weight`),i=Cv(`tracking`),a=Cv(`leading`),o=Cv(`breakpoint`),s=Cv(`container`),c=Cv(`spacing`),l=Cv(`radius`),u=Cv(`shadow`),d=Cv(`inset-shadow`),f=Cv(`text-shadow`),p=Cv(`drop-shadow`),m=Cv(`blur`),h=Cv(`perspective`),g=Cv(`aspect`),_=Cv(`ease`),v=Cv(`animate`),y=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`,Z,X],b=()=>[Z,X,c],x=()=>[Mv,`full`,`auto`,...b()],S=()=>[Pv,`none`,`subgrid`,Z,X],C=()=>[`auto`,{span:[`full`,Pv,Z,X]},Pv,Z,X],w=()=>[Pv,`auto`,Z,X],T=()=>[`auto`,`min`,`max`,`fr`,Z,X],E=()=>[`auto`,...b()],D=()=>[Mv,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...b()],O=()=>[e,Z,X],ee=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`,Zv,Kv,{position:[Z,X]}],te=()=>[`auto`,`cover`,`contain`,Qv,Uv,{size:[Z,X]}],ne=()=>[Fv,Yv,Wv],re=()=>[``,`none`,`full`,l,Z,X],ie=()=>[``,Nv,Yv,Wv],ae=()=>[Nv,Fv,Zv,Kv],oe=()=>[``,`none`,m,Z,X],se=()=>[`none`,Nv,Z,X],ce=()=>[`none`,Nv,Z,X],le=()=>[Nv,Z,X],ue=()=>[Mv,`full`,...b()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Iv],breakpoint:[Iv],color:[Lv],container:[Iv],"drop-shadow":[Iv],ease:[`in`,`out`,`in-out`],font:[Hv],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Iv],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Iv],shadow:[Iv],spacing:[`px`,Nv],text:[Iv],"text-shadow":[Iv],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Mv,X,Z,g]}],container:[`container`],columns:[{columns:[Nv,X,Z,s]}],"break-after":[{"break-after":[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`]}],"break-before":[{"break-before":[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`]}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:y()}],overflow:[{overflow:[`auto`,`hidden`,`clip`,`visible`,`scroll`]}],"overflow-x":[{"overflow-x":[`auto`,`hidden`,`clip`,`visible`,`scroll`]}],"overflow-y":[{"overflow-y":[`auto`,`hidden`,`clip`,`visible`,`scroll`]}],overscroll:[{overscroll:[`auto`,`contain`,`none`]}],"overscroll-x":[{"overscroll-x":[`auto`,`contain`,`none`]}],"overscroll-y":[{"overscroll-y":[`auto`,`contain`,`none`]}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Pv,`auto`,Z,X]}],basis:[{basis:[Mv,`full`,`auto`,s,...b()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Nv,Mv,`auto`,`initial`,`none`,X]}],grow:[{grow:[``,Nv,Z,X]}],shrink:[{shrink:[``,Nv,Z,X]}],order:[{order:[Pv,`first`,`last`,`none`,Z,X]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":w()}],"col-end":[{"col-end":w()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":w()}],"row-end":[{"row-end":w()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`,`normal`]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`,`normal`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`]}],"align-content":[{content:[`normal`,`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`]}],"align-items":[{items:[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`,{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`,{baseline:[``,`last`]}]}],"place-content":[{"place-content":[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`,`baseline`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":b()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":b()}],"space-y-reverse":[`space-y-reverse`],size:[{size:D()}],w:[{w:[s,`screen`,...D()]}],"min-w":[{"min-w":[s,`screen`,`none`,...D()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...D()]}],h:[{h:[`screen`,`lh`,...D()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...D()]}],"max-h":[{"max-h":[`screen`,`lh`,...D()]}],"font-size":[{text:[`base`,n,Yv,Wv]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Z,Gv]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Fv,X]}],"font-family":[{font:[Xv,X,t]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Z,X]}],"line-clamp":[{"line-clamp":[Nv,`none`,Z,Gv]}],leading:[{leading:[a,...b()]}],"list-image":[{"list-image":[`none`,Z,X]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Z,X]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[`solid`,`dashed`,`dotted`,`double`,`wavy`]}],"text-decoration-thickness":[{decoration:[Nv,`from-font`,`auto`,Z,Wv]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[Nv,`auto`,Z,X]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:b()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Z,X]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Z,X]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}]}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Pv,Z,X],radial:[``,Z,X],conic:[Pv,Z,X]},$v,qv]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[`solid`,`dashed`,`dotted`,`double`,`hidden`,`none`]}],"divide-style":[{divide:[`solid`,`dashed`,`dotted`,`double`,`hidden`,`none`]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[`solid`,`dashed`,`dotted`,`double`,`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Nv,Z,X]}],"outline-w":[{outline:[``,Nv,Yv,Wv]}],"outline-color":[{outline:O()}],shadow:[{shadow:[``,`none`,u,ey,Jv]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":[`none`,d,ey,Jv]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:ie()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[Nv,Wv]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":[`none`,f,ey,Jv]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[Nv,Z,X]}],"mix-blend":[{"mix-blend":[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`,`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`]}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Nv]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[Z,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`]}],"mask-image-conic-pos":[{"mask-conic":[Nv]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}]}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Z,X]}],filter:[{filter:[``,`none`,Z,X]}],blur:[{blur:oe()}],brightness:[{brightness:[Nv,Z,X]}],contrast:[{contrast:[Nv,Z,X]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,ey,Jv]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:[``,Nv,Z,X]}],"hue-rotate":[{"hue-rotate":[Nv,Z,X]}],invert:[{invert:[``,Nv,Z,X]}],saturate:[{saturate:[Nv,Z,X]}],sepia:[{sepia:[``,Nv,Z,X]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Z,X]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[Nv,Z,X]}],"backdrop-contrast":[{"backdrop-contrast":[Nv,Z,X]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Nv,Z,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Nv,Z,X]}],"backdrop-invert":[{"backdrop-invert":[``,Nv,Z,X]}],"backdrop-opacity":[{"backdrop-opacity":[Nv,Z,X]}],"backdrop-saturate":[{"backdrop-saturate":[Nv,Z,X]}],"backdrop-sepia":[{"backdrop-sepia":[``,Nv,Z,X]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Z,X]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Nv,`initial`,Z,X]}],ease:[{ease:[`linear`,`initial`,_,Z,X]}],delay:[{delay:[Nv,Z,X]}],animate:[{animate:[`none`,v,Z,X]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Z,X]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[Z,X,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":[`translate-none`],accent:[{accent:O()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Z,X]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Z,X]}],fill:[{fill:[`none`,...O()]}],"stroke-w":[{stroke:[Nv,Yv,Wv,Gv]}],stroke:[{stroke:[`none`,...O()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),dy=[`children`,`onClick`,`active`,`disabled`,`className`,`anchorRef`];function fy(e){var t=e.children,n=e.onClick,r=e.active,i=r!==void 0&&r,a=e.disabled,o=a!==void 0&&a,s=e.className,c=s===void 0?``:s,l=e.anchorRef,u=_(e,dy);return k(`button`,g({type:`button`,ref:l,onClick:n,disabled:o,className:uy(`flex h-[32px] w-auto min-w-[32px] items-center justify-center rounded-md p-[5px] transition-colors hover:bg-interactive-hover hover:ring hover:ring-accent cursor-pointer rounded-none px-2 py-1 text-sm hover:bg-transparent border-b-2 hover:border-b-fg-muted hover:ring-transparent`,i?`border-b-accent text-accent hover:border-b-accent`:`border-b-transparent`,o?`cursor-not-allowed opacity-50`:``,c)},u),t)}var py=function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M9 6l6 6l-6 6`}))},my=function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M15 6l-6 6l6 6`}))},hy=function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M6 9l6 6l6 -6`}))},gy=function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0`}),k(`path`,{d:`M21 21l-6 -6`}))},_y=function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M18 6l-12 12`}),k(`path`,{d:`M6 6l12 12`}))},vy=function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a,s=e.secondaryColor,c=s===void 0?`currentColor`:s;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M7 4h10`}),k(`path`,{d:`M12 4v8`}),k(`defs`,null,k(`clipPath`,{id:`stripeClip`},k(`rect`,{x:`2`,y:`12`,width:`20`,height:`10`,rx:`2`}))),k(`rect`,{x:`2`,y:`12`,width:`20`,height:`10`,rx:`2`,fill:`none`,stroke:o}),k(`g`,{"clip-path":`url(#stripeClip)`,stroke:c},k(`path`,{d:`M-7 24l12 -12`}),k(`path`,{d:`M-3 24l12 -12`}),k(`path`,{d:`M1 24l12 -12`}),k(`path`,{d:`M5 24l12 -12`}),k(`path`,{d:`M9 24l12 -12`}),k(`path`,{d:`M13 24l12 -12`}),k(`path`,{d:`M17 24l12 -12`}),k(`path`,{d:`M21 24l12 -12`}),k(`path`,{d:`M25 24l12 -12`})))},yy=function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a,s=e.secondaryColor,c=s===void 0?`currentColor`:s;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:o,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M6 20h-1a2 2 0 0 1 -2 -2v-1`}),k(`path`,{d:`M3 13v-3`}),k(`path`,{d:`M3 6v-1a2 2 0 0 1 2 -2h1`}),k(`path`,{d:`M10 3h3`}),k(`path`,{d:`M17 3h1a2 2 0 0 1 2 2v1`}),k(`defs`,null,k(`clipPath`,{id:`redactClip`},k(`rect`,{x:`10`,y:`10`,width:`12`,height:`12`,rx:`2`}))),k(`rect`,{x:`10`,y:`10`,width:`12`,height:`12`,rx:`2`,fill:`none`}),k(`g`,{"clip-path":`url(#redactClip)`,stroke:c},k(`path`,{d:`M-2 24l14 -14`}),k(`path`,{d:`M2 24l14 -14`}),k(`path`,{d:`M6 24l14 -14`}),k(`path`,{d:`M10 24l15 -15`}),k(`path`,{d:`M14 24l15 -15`}),k(`path`,{d:`M18 24l15 -15`})))},by={download:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`}),k(`path`,{d:`M7 11l5 5l5 -5`}),k(`path`,{d:`M12 4l0 12`}))},menu:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 8l16 0`}),k(`path`,{d:`M4 16l16 0`}))},fullscreen:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 8v-2a2 2 0 0 1 2 -2h2`}),k(`path`,{d:`M4 16v2a2 2 0 0 0 2 2h2`}),k(`path`,{d:`M16 4h2a2 2 0 0 1 2 2v2`}),k(`path`,{d:`M16 20h2a2 2 0 0 0 2 -2v-2`}))},fullscreenExit:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 8v-2c0 -.551 .223 -1.05 .584 -1.412`}),k(`path`,{d:`M4 16v2a2 2 0 0 0 2 2h2`}),k(`path`,{d:`M16 4h2a2 2 0 0 1 2 2v2`}),k(`path`,{d:`M16 20h2c.545 0 1.04 -.218 1.4 -.572`}),k(`path`,{d:`M3 3l18 18`}))},save:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2`}),k(`path`,{d:`M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),k(`path`,{d:`M14 4l0 4l-6 0l0 -4`}))},print:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2`}),k(`path`,{d:`M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4`}),k(`path`,{d:`M7 13m0 2a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z`}))},settings:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z`}),k(`path`,{d:`M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0`}))},viewSettings:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),k(`path`,{d:`M12 10.5v1.5`}),k(`path`,{d:`M12 16v1.5`}),k(`path`,{d:`M15.031 12.25l-1.299 .75`}),k(`path`,{d:`M10.268 15l-1.3 .75`}),k(`path`,{d:`M15 15.803l-1.285 -.773`}),k(`path`,{d:`M10.285 12.97l-1.285 -.773`}),k(`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`}),k(`path`,{d:`M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z`}))},rotateClockwise:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4.05 11a8 8 0 1 1 .5 4m-.5 5v-5h5`}))},rotateCounterClockwise:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M19.95 11a8 8 0 1 0 -.5 4m.5 5v-5h-5`}))},singlePage:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M5 3m0 1a1 1 0 0 1 1 -1h12a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-12a1 1 0 0 1 -1 -1z`}))},doublePage:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 3m0 1a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1zm9 -1v18`}))},zoomIn:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0`}),k(`path`,{d:`M9 12h6`}),k(`path`,{d:`M12 9v6`}))},zoomOut:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`}),k(`path`,{d:`M9 12l6 0`}))},fitToWidth:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 12v-6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v6`}),k(`path`,{d:`M10 18h-7`}),k(`path`,{d:`M21 18h-7`}),k(`path`,{d:`M6 15l-3 3l3 3`}),k(`path`,{d:`M18 15l3 3l-3 3`}))},fitToPage:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M12 20h-6a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h6`}),k(`path`,{d:`M18 14v7`}),k(`path`,{d:`M18 3v7`}),k(`path`,{d:`M15 18l3 3l3 -3`}),k(`path`,{d:`M15 6l3 -3l3 3`}))},chevronRight:py,chevronLeft:my,chevronDown:hy,search:gy,callout:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a,s=e.secondaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:s===void 0?`none`:s,stroke:o,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1`}),k(`path`,{fill:`none`,d:`M17 11v6h-9`}),k(`path`,{fill:`none`,d:`M8 15l-2 2l2 2`}))},comment:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M12 11v.01`}),k(`path`,{d:`M8 11v.01`}),k(`path`,{d:`M16 11v.01`}),k(`path`,{d:`M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3z`}))},sidebar:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 18v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z`}),k(`path`,{d:`M10 18v-12a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z`}))},dots:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),k(`path`,{d:`M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),k(`path`,{d:`M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}))},vertical:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M8 7l4 -4l4 4`}),k(`path`,{d:`M8 17l4 4l4 -4`}),k(`path`,{d:`M12 3l0 18`}))},horizontal:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M7 8l-4 4l4 4`}),k(`path`,{d:`M17 8l4 4l-4 4`}),k(`path`,{d:`M3 12l18 0`}))},book:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0`}),k(`path`,{d:`M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0`}),k(`path`,{d:`M3 6l0 13`}),k(`path`,{d:`M12 6l0 13`}),k(`path`,{d:`M21 6l0 13`}))},book2:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M19 4v16h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12z`}),k(`path`,{d:`M19 16h-12a2 2 0 0 0 -2 2`}),k(`path`,{d:`M9 8h6`}))},squares:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M8 10a2 2 0 0 1 2 -2h9a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-9a2 2 0 0 1 -2 -2z`}),k(`path`,{d:`M16 8v-3a2 2 0 0 0 -2 -2h-9a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h3`}))},listTree:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M9 6h11`}),k(`path`,{d:`M12 12h8`}),k(`path`,{d:`M15 18h5`}),k(`path`,{d:`M5 6v.01`}),k(`path`,{d:`M8 12v.01`}),k(`path`,{d:`M11 18v.01`}))},paperclip:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5`}))},rubberStamp:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M21 17.85h-18c0 -4.05 1.421 -4.05 3.79 -4.05c5.21 0 1.21 -4.59 1.21 -6.8a4 4 0 1 1 8 0c0 2.21 -4 6.8 1.21 6.8c2.369 0 3.79 0 3.79 4.05`}),k(`path`,{d:`M5 21h14`}))},rubberStampPlus:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M21 17.85h-18c0 -4.05 1.421 -4.05 3.79 -4.05c5.21 0 1.21 -4.59 1.21 -6.8a4 4 0 0 1 4.9 -4.1`}),k(`path`,{d:`M16 10c0 1.2 -4 3.8 1.21 3.8c2.369 0 3.79 0 3.79 4.05`}),k(`path`,{d:`M5 21h14`}),k(`path`,{d:`M16 5h6`}),k(`path`,{d:`M19 2v6`}))},copy:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z`}),k(`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`}))},underline:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 20h16`,stroke:o}),k(`path`,{d:`M8 16v-8a4 4 0 1 1 8 0v8`,stroke:`currentColor`}),k(`path`,{d:`M8 10h8`,stroke:`currentColor`}))},squiggly:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M8 16v-8a4 4 0 1 1 8 0v8`,stroke:`currentColor`}),k(`path`,{d:`M8 10h8`,stroke:`currentColor`}),k(`path`,{d:`M4 20c1.5 -1.5 3.5 -1.5 5 0s3.5 1.5 5 0 3.5 -1.5 5 0`,stroke:o}))},strikethrough:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M8 16v-8a4 4 0 1 1 8 0v8`,stroke:`currentColor`}),k(`path`,{d:`M4 10h16`,stroke:o}))},highlight:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`rect`,{x:`2`,y:`6`,width:`20`,height:`16`,rx:`2`,fill:o,stroke:`none`}),k(`path`,{d:`M8 16v-8a4 4 0 1 1 8 0v8`,stroke:`currentColor`}),k(`path`,{d:`M8 10h8`,stroke:`currentColor`}))},palette:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25`}),k(`path`,{d:`M8.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),k(`path`,{d:`M12.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}),k(`path`,{d:`M16.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`}))},x:_y,fileImport:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`}),k(`path`,{d:`M5 13v-8a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-5.5m-9.5 -2h7m-3 -3l3 3l-3 3`}))},hand:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5`}),k(`path`,{d:`M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5`}),k(`path`,{d:`M14 5.5a1.5 1.5 0 0 1 3 0v6.5`}),k(`path`,{d:`M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47`}))},zoomInArea:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M15 13v4`}),k(`path`,{d:`M13 15h4`}),k(`path`,{d:`M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0`}),k(`path`,{d:`M22 22l-3 -3`}),k(`path`,{d:`M6 18h-1a2 2 0 0 1 -2 -2v-1`}),k(`path`,{d:`M3 11v-1`}),k(`path`,{d:`M3 6v-1a2 2 0 0 1 2 -2h1`}),k(`path`,{d:`M10 3h1`}),k(`path`,{d:`M15 3h1a2 2 0 0 1 2 2v1`}))},screenshot:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M7 19a2 2 0 0 1 -2 -2`}),k(`path`,{d:`M5 13v-2`}),k(`path`,{d:`M5 7a2 2 0 0 1 2 -2`}),k(`path`,{d:`M11 5h2`}),k(`path`,{d:`M17 5a2 2 0 0 1 2 2`}),k(`path`,{d:`M19 11v2`}),k(`path`,{d:`M19 17v4`}),k(`path`,{d:`M21 19h-4`}),k(`path`,{d:`M13 19h-2`}))},arrowBackUp:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M9 14l-4 -4l4 -4`}),k(`path`,{d:`M5 10h11a4 4 0 1 1 0 8h-1`}))},arrowForwardUp:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M15 14l4 -4l-4 -4`}),k(`path`,{d:`M19 10h-11a4 4 0 1 0 0 8h1`}))},trash:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 7l16 0`}),k(`path`,{d:`M10 11l0 6`}),k(`path`,{d:`M14 11l0 6`}),k(`path`,{d:`M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12`}),k(`path`,{d:`M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3`}))},deviceFloppy:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2`}),k(`path`,{d:`M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),k(`path`,{d:`M14 4l0 4l-6 0l0 -4`}))},pencilMarker:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,"stroke-linejoin":`round`,"stroke-linecap":`round`,"stroke-width":i,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{d:`m9.109 16.275 8.856-8.097c.812-.743.87-2.014.127-2.826s-2.014-.869-2.826-.127L6.41 13.322l-.127 2.826zM13.79 6.575l2.7 2.952`,stroke:`currentColor`}),k(`path`,{stroke:o,d:`M19.375 20.125c.569.063-4.05-.562-6.412-.437s-4.759 1.229-6.857 1.625c-1.764.687-3.404-.938-1.981-2.5`}))},circle:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a,s=e.secondaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:s===void 0?`none`:s,stroke:o,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`}))},square:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a,s=e.secondaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:s===void 0?`none`:s,stroke:o,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z`}))},line:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2.2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M20 4l-16 16`}))},lineArrow:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2.2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M20 4l-16 16`}),k(`path`,{d:`M16 3h5v5`}))},polygon:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a,s=e.secondaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:s===void 0?`none`:s,stroke:o,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M13.163 2.168l8.021 5.828c.694 .504 .984 1.397 .719 2.212l-3.064 9.43a1.978 1.978 0 0 1 -1.881 1.367h-9.916a1.978 1.978 0 0 1 -1.881 -1.367l-3.064 -9.43a1.978 1.978 0 0 1 .719 -2.212l8.021 -5.828a1.978 1.978 0 0 1 2.326 0z`}))},zigzag:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{d:`M12 2.4L21.36 11.76L2.64 12.24L12 21.6`}))},text:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M6.5 15.5m-3.5 0a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0`}),k(`path`,{d:`M14 19v-10.5a3.5 3.5 0 0 1 7 0v10.5`}),k(`path`,{d:`M14 13h7`}),k(`path`,{d:`M10 12v7`}))},italic:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M11 5l6 0`}),k(`path`,{d:`M7 19l6 0`}),k(`path`,{d:`M14 5l-4 14`}))},bold:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M7 5h6a3.5 3.5 0 0 1 0 7h-6z`}),k(`path`,{d:`M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7`}))},alignLeft:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 6l16 0`}),k(`path`,{d:`M4 12l10 0`}),k(`path`,{d:`M4 18l14 0`}))},alignCenter:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 6l16 0`}),k(`path`,{d:`M8 12l8 0`}),k(`path`,{d:`M6 18l12 0`}))},alignRight:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 6l16 0`}),k(`path`,{d:`M10 12l10 0`}),k(`path`,{d:`M6 18l14 0`}))},alignTop:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z`}),k(`path`,{d:`M11 13h2`}),k(`path`,{d:`M9 10h6`}),k(`path`,{d:`M10 7h4`}))},alignMiddle:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z`}),k(`path`,{d:`M11 15h2`}),k(`path`,{d:`M9 12h6`}),k(`path`,{d:`M10 9h4`}))},alignBottom:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z`}),k(`path`,{d:`M11 17h2`}),k(`path`,{d:`M9 14h6`}),k(`path`,{d:`M10 11h4`}))},photo:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M15 8h.01`}),k(`path`,{d:`M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z`}),k(`path`,{d:`M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5`}),k(`path`,{d:`M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3`}))},pointer:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M7.904 17.563a1.2 1.2 0 0 0 2.228 .308l2.09 -3.093l4.907 4.907a1.067 1.067 0 0 0 1.509 0l1.047 -1.047a1.067 1.067 0 0 0 0 -1.509l-4.907 -4.907l3.113 -2.09a1.2 1.2 0 0 0 -.309 -2.228l-13.582 -3.904l3.904 13.563z`}))},redact:vy,redactArea:yy,redactCombined:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a,s=e.secondaryColor,c=s===void 0?`currentColor`:s;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:o,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M6 20h-1a2 2 0 0 1 -2 -2v-1`}),k(`path`,{d:`M3 13v-3`}),k(`path`,{d:`M20 13v-3`}),k(`path`,{d:`M3 6v-1a2 2 0 0 1 2 -2h1`}),k(`path`,{d:`M10 3h3`}),k(`path`,{d:`M17 3h1a2 2 0 0 1 2 2v1`}),k(`path`,{d:`M8 8h8`}),k(`path`,{d:`M12 8v7`}),k(`defs`,null,k(`clipPath`,{id:`redactCombinedClip`},k(`rect`,{x:`10`,y:`18`,width:`13`,height:`6`,rx:`2`}))),k(`rect`,{x:`10`,y:`17`,width:`13`,height:`6`,rx:`2`,fill:`none`}),k(`g`,{"clip-path":`url(#redactCombinedClip)`,stroke:c},k(`path`,{d:`M6 19l12 -12`}),k(`path`,{d:`M6 23l12 -12`}),k(`path`,{d:`M10 23l12 -12`}),k(`path`,{d:`M14 27l12 -12`}),k(`path`,{d:`M14 23l12 -12`})))},check:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M5 12l5 5l10 -10`}))},file:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a,s=e.className,c=e.title;return k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:o,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:s,"aria-hidden":!c,role:c?`img`:`presentation`},c&&k(`title`,null,c),k(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),k(`polyline`,{points:`14 2 14 8 20 8`}))},plus:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a,s=e.className,c=e.title;return k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:o,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:s,"aria-hidden":!c,role:c?`img`:`presentation`},c&&k(`title`,null,c),k(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),k(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}))},lock:function(e){var t=e.size,n=t===void 0?24:t,r=e.className;return k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:r===void 0?``:r,style:e.style},k(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),k(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`}))},unlock:function(e){var t=e.size,n=t===void 0?24:t,r=e.className;return k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:r===void 0?``:r,style:e.style},k(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),k(`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`}))},alertTriangle:function(e){var t=e.size,n=t===void 0?24:t,r=e.className;return k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:r===void 0?``:r,style:e.style},k(`path`,{d:`M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z`}),k(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),k(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`}))},eye:function(e){var t=e.size,n=t===void 0?24:t,r=e.className;return k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:r===void 0?``:r,style:e.style},k(`path`,{d:`M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z`}),k(`circle`,{cx:`12`,cy:`12`,r:`3`}))},"eye-off":function(e){var t=e.size,n=t===void 0?24:t,r=e.className;return k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:r===void 0?``:r,style:e.style},k(`path`,{d:`M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24`}),k(`line`,{x1:`1`,y1:`1`,x2:`23`,y2:`23`}))},info:function(e){var t=e.size,n=t===void 0?24:t,r=e.className;return k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:r===void 0?``:r,style:e.style},k(`circle`,{cx:`12`,cy:`12`,r:`10`}),k(`line`,{x1:`12`,y1:`16`,x2:`12`,y2:`12`}),k(`line`,{x1:`12`,y1:`8`,x2:`12.01`,y2:`8`}))},link:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M9 15l6 -6`}),k(`path`,{d:`M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464`}),k(`path`,{d:`M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463`}))},linkOff:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M9 15l3 -3m2 -2l1 -1`}),k(`path`,{d:`M11 6l.463 -.536a5 5 0 0 1 7.072 7.071l-.534 .464`}),k(`path`,{d:`M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463`}),k(`path`,{d:`M3 3l18 18`}))},externalLink:function(e){return k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:e.className},k(`path`,{d:`M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6`}),k(`path`,{d:`M11 13l9 -9`}),k(`path`,{d:`M15 4h5v5`}))},marqueeSelect:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M17 20h6`}),k(`path`,{d:`M20 17v6`}),k(`path`,{d:`M4 13v-2`}),k(`path`,{d:`M4 6v-1a1 1 0 0 1 1 -1h1`}),k(`path`,{d:`M6 20h-1a1 1 0 0 1 -1 -1v-1`}),k(`path`,{d:`M11 4h2`}),k(`path`,{d:`M11 20h2`}),k(`path`,{d:`M18 4h1a1 1 0 0 1 1 1v1`}),k(`path`,{d:`M20 11v2`}))},group:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),k(`path`,{d:`M17 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),k(`path`,{d:`M3 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),k(`path`,{d:`M17 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),k(`path`,{d:`M5 7v10`}),k(`path`,{d:`M19 7v10`}),k(`path`,{d:`M7 5h10`}),k(`path`,{d:`M7 19h10`}),k(`path`,{d:`M8 8H12.8V11.2H16V16H11.2V12.8H8V8Z`}))},ungroup:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`rect`,{x:`4`,y:`4`,width:`7`,height:`7`,rx:`1`}),k(`rect`,{x:`13`,y:`13`,width:`7`,height:`7`,rx:`1`}))},redactionSidebar:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z`}),k(`path`,{d:`M15 4v16`}),k(`path`,{d:`M7 8h5`}),k(`path`,{d:`M7 11h5`}),k(`path`,{d:`M7 14h4`}))},freeText:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M4 7v-2h12v2`}),k(`path`,{d:`M10 5v14`}),k(`path`,{d:`M12 19h-4`}),k(`path`,{d:`M15 13v-1h6v1`}),k(`path`,{d:`M18 12v7`}),k(`path`,{d:`M17 19h2`}))},insertText:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 7v-2h12v2`}),k(`path`,{d:`M9 5v14`}),k(`path`,{d:`M7 19h4`}),k(`path`,{d:`M18 15l2 2h-5`}),k(`path`,{d:`M18 19l2 -2`}))},replaceText:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 7v-2h12v2`}),k(`path`,{d:`M9 5v14`}),k(`path`,{d:`M7 19h4`}),k(`g`,{transform:`translate(-1, -3) rotate(180 19 18)`},k(`path`,{d:`M20 14l2 2h-3`}),k(`path`,{d:`M20 18l2 -2`}),k(`path`,{d:`M19 16a3 3 0 1 0 2 5.236`})))},message:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M8 9h8`,stroke:`currentColor`}),k(`path`,{d:`M8 13h6`,stroke:`currentColor`}),k(`path`,{d:`M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12`}))},inkHighlighter:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor,o=a===void 0?`currentColor`:a;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,"stroke-linejoin":`round`,"stroke-linecap":`round`,"stroke-width":i,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{stroke:`currentColor`,d:`M3 19h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4`}),k(`path`,{stroke:`currentColor`,d:`M12.5 5.5l4 4`}),k(`path`,{stroke:`currentColor`,d:`M4.5 13.5l4 4`}),k(`path`,{stroke:o,fill:o,d:`M21 15v4h-8l4 -4l4 0`}))},formCheckbox:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`}),k(`path`,{d:`M9 12l2 2l4 -4`}))},formRadio:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M9 12a2 2 0 1 0 6 0a2 2 0 1 0 -6 0`,fill:`currentColor`}),k(`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`}))},formSelect:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`}),k(`path`,{d:`M9 11l3 3l3 -3`}))},formListbox:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`}),k(`path`,{d:`M11 8h6`}),k(`path`,{d:`M11 12h6`}),k(`path`,{d:`M11 16h6`}),k(`path`,{d:`M7 8l0 .01`}),k(`path`,{d:`M7 12l0 .01`}),k(`path`,{d:`M7 16l0 .01`}))},formTextfield:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3`}),k(`path`,{d:`M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3`}),k(`path`,{d:`M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7`}),k(`path`,{d:`M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1`}),k(`path`,{d:`M17 12h.01`}),k(`path`,{d:`M13 12h.01`}))},widgetEdit:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1`}),k(`path`,{d:`M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415`}),k(`path`,{d:`M16 5l3 3`}))},signature:function(e){var t=e.size,n=t===void 0?24:t,r=e.strokeWidth,i=r===void 0?2:r,a=e.primaryColor;return k(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:a===void 0?`currentColor`:a,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:e.className,role:`img`,"aria-label":e.title},k(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),k(`path`,{d:`M3 17c3.333 -3.333 5 -6 5 -8c0 -3 -1 -3 -2 -3s-2.032 1.085 -2 3c.034 2.048 1.658 4.877 2.5 6c1.5 2 2.5 2.5 3.5 1l2 -3c.333 2.667 1.333 4 3 4c.53 0 2.639 -2 3 -2c.517 0 1.517 .667 3 2`}))}},xy=new Map,Sy=/^[MmZzLlHhVvCcSsQqTtAa0-9\s,.\-eE]+$/;function Cy(e){return Sy.test(e.trim())}function wy(e,t){for(var n=function(e){return`path`in e?{viewBox:e.viewBox||`0 0 24 24`,paths:[{d:e.path,stroke:e.stroke??`primary`,fill:e.fill??`none`,strokeWidth:e.strokeWidth}],strokeLinecap:e.strokeLinecap||`round`,strokeLinejoin:e.strokeLinejoin||`round`,strokeWidth:e.strokeWidth}:{viewBox:e.viewBox||`0 0 24 24`,paths:e.paths,strokeLinecap:e.strokeLinecap||`round`,strokeLinejoin:e.strokeLinejoin||`round`,strokeWidth:e.strokeWidth}}(t),r=0;r<n.paths.length;r++){var i=n.paths[r];if(!i.d||!Cy(i.d))throw Error(`Invalid path data for icon "${e}" at path index ${r}. Path must only contain valid SVG path commands.`)}xy.set(e,n)}function Ty(e){for(var t=0,n=Object.entries(e);t<n.length;t++){var r=x(n[t],2);wy(r[0],r[1])}}function Ey(e,t,n){return e&&e!==`none`?e===`primary`?t:e===`secondary`?n:e===`currentColor`?`currentColor`:e:`none`}function Q(e){var t,n=e.icon,r=e.title,i=e.size,a=i===void 0?24:i,o=e.strokeWidth,s=o===void 0?2:o,c=e.primaryColor,l=c===void 0?`currentColor`:c,u=e.secondaryColor,d=u===void 0?`currentColor`:u,f=e.className,p=by[n];return p?k(p,{size:a,strokeWidth:s,primaryColor:l,secondaryColor:d,className:f,title:r}):(t=n,xy.has(t)?function(e,t){var n=t.size,r=t.strokeWidth,i=t.primaryColor,a=t.secondaryColor,o=t.className,s=t.title,c=e.strokeWidth??r;return k(`svg`,{width:n,height:n,viewBox:e.viewBox,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin,class:o,role:`img`,"aria-label":s},e.paths.map(function(e,t){var n=Ey(e.stroke,i,a),r=Ey(e.fill,i,a),o=e.strokeWidth??c;return k(`path`,{key:t,d:e.d,stroke:n,fill:r,"stroke-width":n===`none`?void 0:o,opacity:e.opacity})}))}(function(e){return xy.get(e)}(n),{size:a,strokeWidth:s,primaryColor:l,secondaryColor:d,className:f,title:r}):(console.warn(`Icon not found: ${n}`),null))}var Dy=[`id`,`children`,`onClick`,`active`,`disabled`,`className`,`tooltip`,`elementRef`];function Oy(e){var t=e.id,n=e.children,r=e.onClick,i=e.active,a=i!==void 0&&i,o=e.disabled,s=o!==void 0&&o,c=e.className,l=c===void 0?``:c,u=e.tooltip,d=e.elementRef,f=_(e,Dy);return k(`button`,g({id:t,ref:d,onClick:r,className:`flex h-[32px] w-auto min-w-[32px] items-center justify-center rounded-md p-[5px] transition-colors ${a?`bg-interactive-selected text-accent ring-accent border-none shadow ring`:`hover:bg-interactive-hover hover:ring-accent hover:ring`} ${s?`cursor-not-allowed opacity-50 hover:bg-transparent hover:ring-0`:`cursor-pointer`} ${l}`,title:u},f),n)}var ky=Math.min,Ay=Math.max,jy=Math.round,My=Math.floor,Ny=e=>({x:e,y:e}),Py={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Fy={start:`end`,end:`start`};function Iy(e,t,n){return Ay(e,ky(t,n))}function Ly(e,t){return typeof e==`function`?e(t):e}function Ry(e){return e.split(`-`)[0]}function zy(e){return e.split(`-`)[1]}function By(e){return e===`x`?`y`:`x`}function Vy(e){return e===`y`?`height`:`width`}var Hy=new Set([`top`,`bottom`]);function Uy(e){return Hy.has(Ry(e))?`y`:`x`}function Wy(e){return By(Uy(e))}function Gy(e){return e.replace(/start|end/g,e=>Fy[e])}var Ky=[`left`,`right`],qy=[`right`,`left`],Jy=[`top`,`bottom`],Yy=[`bottom`,`top`];function Xy(e,t,n,r){let i=zy(e),a=function(e,t,n){switch(e){case`top`:case`bottom`:return n?t?qy:Ky:t?Ky:qy;case`left`:case`right`:return t?Jy:Yy;default:return[]}}(Ry(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Gy)))),a}function Zy(e){return e.replace(/left|right|bottom|top/g,e=>Py[e])}function Qy(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e)}function $y(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function eb(e,t,n){let{reference:r,floating:i}=e,a=Uy(t),o=Wy(t),s=Vy(o),c=Ry(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(zy(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function tb(e,t){var n;t===void 0&&(t={});let{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=Ly(t,e),m=Qy(p),h=s[f?d===`floating`?`reference`:`floating`:d],g=$y(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(h)))==null||n?h:h.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),y=await(a.isElement==null?void 0:a.isElement(v))&&await(a.getScale==null?void 0:a.getScale(v))||{x:1,y:1},b=$y(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}var nb=new Set([`left`,`top`]);function rb(){return typeof window<`u`}function ib(e){return sb(e)?(e.nodeName||``).toLowerCase():`#document`}function ab(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ob(e){return((sb(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function sb(e){return!!rb()&&(e instanceof Node||e instanceof ab(e).Node)}function cb(e){return!!rb()&&(e instanceof Element||e instanceof ab(e).Element)}function lb(e){return!!rb()&&(e instanceof HTMLElement||e instanceof ab(e).HTMLElement)}function ub(e){return!(!rb()||typeof ShadowRoot>`u`)&&(e instanceof ShadowRoot||e instanceof ab(e).ShadowRoot)}var db=new Set([`inline`,`contents`]);function fb(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=wb(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!db.has(i)}var pb=new Set([`table`,`td`,`th`]);function mb(e){return pb.has(ib(e))}var hb=[`:popover-open`,`:modal`];function gb(e){return hb.some(t=>{try{return e.matches(t)}catch{return!1}})}var _b=[`transform`,`translate`,`scale`,`rotate`,`perspective`],vb=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],yb=[`paint`,`layout`,`strict`,`content`];function bb(e){let t=xb(),n=cb(e)?wb(e):e;return _b.some(e=>!!n[e]&&n[e]!==`none`)||!!n.containerType&&n.containerType!==`normal`||!t&&!!n.backdropFilter&&n.backdropFilter!==`none`||!t&&!!n.filter&&n.filter!==`none`||vb.some(e=>(n.willChange||``).includes(e))||yb.some(e=>(n.contain||``).includes(e))}function xb(){return!(typeof CSS>`u`||!CSS.supports)&&CSS.supports(`-webkit-backdrop-filter`,`none`)}var Sb=new Set([`html`,`body`,`#document`]);function Cb(e){return Sb.has(ib(e))}function wb(e){return ab(e).getComputedStyle(e)}function Tb(e){return cb(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Eb(e){if(ib(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ub(e)&&e.host||ob(e);return ub(t)?t.host:t}function Db(e){let t=Eb(e);return Cb(t)?e.ownerDocument?e.ownerDocument.body:e.body:lb(t)&&fb(t)?t:Db(t)}function Ob(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Db(e),i=r===e.ownerDocument?.body,a=ab(r);if(i){let e=kb(a);return t.concat(a,a.visualViewport||[],fb(r)?r:[],e&&n?Ob(e):[])}return t.concat(r,Ob(r,[],n))}function kb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ab(e){let t=wb(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=lb(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=jy(n)!==a||jy(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function jb(e){return cb(e)?e:e.contextElement}function Mb(e){let t=jb(e);if(!lb(t))return Ny(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ab(t),o=(a?jy(n.width):n.width)/r,s=(a?jy(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Nb=Ny(0);function Pb(e){let t=ab(e);return xb()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Nb}function Fb(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=jb(e),o=Ny(1);t&&(r?cb(r)&&(o=Mb(r)):o=Mb(e));let s=function(e,t,n){return t===void 0&&(t=!1),!(!n||t&&n!==ab(e))&&t}(a,n,r)?Pb(a):Ny(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=ab(a),t=r&&cb(r)?ab(r):r,n=e,i=kb(n);for(;i&&r&&t!==n;){let e=Mb(i),t=i.getBoundingClientRect(),r=wb(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ab(i),i=kb(n)}}return $y({width:u,height:d,x:c,y:l})}function Ib(e,t){let n=Tb(e).scrollLeft;return t?t.left+n:Fb(ob(e)).left+n}function Lb(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ib(e,n),y:n.top+t.scrollTop}}var Rb=new Set([`absolute`,`fixed`]);function zb(e,t,n){let r;if(t===`viewport`)r=function(e,t){let n=ab(e),r=ob(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=xb();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ib(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else l<=25&&(a+=l);return{width:a,height:o,x:s,y:c}}(e,n);else if(t===`document`)r=function(e){let t=ob(e),n=Tb(e),r=e.ownerDocument.body,i=Ay(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ay(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ib(e),s=-n.scrollTop;return wb(r).direction===`rtl`&&(o+=Ay(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(ob(e));else if(cb(t))r=function(e,t){let n=Fb(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=lb(e)?Mb(e):Ny(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n);else{let n=Pb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $y(r)}function Bb(e,t){let n=Eb(e);return!(n===t||!cb(n)||Cb(n))&&(wb(n).position===`fixed`||Bb(n,t))}function Vb(e,t,n){let r=lb(t),i=ob(t),a=n===`fixed`,o=Fb(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ny(0);function l(){c.x=Ib(i)}if(r||!r&&!a){if((ib(t)!==`body`||fb(i))&&(s=Tb(t)),r){let e=Fb(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=!i||r||a?Ny(0):Lb(i,s);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Hb(e){return wb(e).position===`static`}function Ub(e,t){if(!lb(e)||wb(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ob(e)===n&&(n=n.ownerDocument.body),n}function Wb(e,t){let n=ab(e);if(gb(e))return n;if(!lb(e)){let t=Eb(e);for(;t&&!Cb(t);){if(cb(t)&&!Hb(t))return t;t=Eb(t)}return n}let r=Ub(e,t);for(;r&&mb(r)&&Hb(r);)r=Ub(r,t);return r&&Cb(r)&&Hb(r)&&!bb(r)?n:r||function(e){let t=Eb(e);for(;lb(t)&&!Cb(t);){if(bb(t))return t;if(gb(t))return null;t=Eb(t)}return null}(e)||n}var Gb={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ob(r),s=!!t&&gb(t.floating);if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ny(1),u=Ny(0),d=lb(r);if((d||!d&&!a)&&((ib(r)!==`body`||fb(o))&&(c=Tb(r)),lb(r))){let e=Fb(r);l=Mb(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=!o||d||a?Ny(0):Lb(o,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}},getDocumentElement:ob,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?gb(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=Ob(e,[],!1).filter(e=>cb(e)&&ib(e)!==`body`),i=null,a=wb(e).position===`fixed`,o=a?Eb(e):e;for(;cb(o)&&!Cb(o);){let t=wb(o),n=bb(o);n||t.position!==`fixed`||(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Rb.has(i.position)||fb(o)&&!n&&Bb(e,o))?r=r.filter(e=>e!==o):i=t,o=Eb(o)}return t.set(e,r),r}(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=zb(t,n,i);return e.top=Ay(r.top,e.top),e.right=ky(r.right,e.right),e.bottom=ky(r.bottom,e.bottom),e.left=Ay(r.left,e.left),e},zb(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Wb,getElementRects:async function(e){let t=this.getOffsetParent||Wb,n=this.getDimensions,r=await n(e.floating);return{reference:Vb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=Ab(e);return{width:t,height:n}},getScale:Mb,isElement:cb,isRTL:function(e){return wb(e).direction===`rtl`}};function Kb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qb(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=jb(e),u=i||a?[...l?Ob(l):[],...Ob(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?function(e,t){let n,r=null,i=ob(e);function a(){var e;clearTimeout(n),(e=r)==null||e.disconnect(),r=null}return function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m={rootMargin:-My(d)+`px `+-My(i.clientWidth-(u+f))+`px `+-My(i.clientHeight-(d+p))+`px `+-My(u)+`px`,threshold:Ay(0,ky(1,c))||1},h=!0;function g(t){let r=t[0].intersectionRatio;if(r!==c){if(!h)return o();r?o(!1,r):n=setTimeout(()=>{o(!1,1e-7)},1e3)}r!==1||Kb(l,e.getBoundingClientRect())||o(),h=!1}try{r=new IntersectionObserver(g,{...m,root:i.ownerDocument})}catch{r=new IntersectionObserver(g,m)}r.observe(e)}(!0),a}(l,n):null,f,p=-1,m=null;o&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;(e=m)==null||e.observe(t)})),n()}),l&&!c&&m.observe(l),m.observe(t));let h=c?Fb(e):null;return c&&function t(){let r=Fb(e);h&&!Kb(h,r)&&n(),h=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=m)==null||e.disconnect(),m=null,c&&cancelAnimationFrame(f)}}var Jb=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await async function(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ry(n),s=zy(n),c=Uy(n)===`y`,l=nb.has(o)?-1:1,u=a&&c?-1:1,d=Ly(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?-1*m:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Yb=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ly(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Uy(Ry(i)),p=By(f),m=u[p],h=u[f];if(o){let e=p===`y`?`bottom`:`right`;m=Iy(m+d[p===`y`?`top`:`left`],m,m-d[e])}if(s){let e=f===`y`?`bottom`:`right`;h=Iy(h+d[f===`y`?`top`:`left`],h,h-d[e])}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Xb=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ly(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ry(r),_=Uy(o),v=Ry(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Zy(o)]:function(e){let t=Zy(e);return[Gy(e),t,Gy(t)]}(o)),x=p!==`none`;!d&&x&&b.push(...Xy(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=function(e,t,n){n===void 0&&(n=!1);let r=zy(e),i=Wy(e),a=Vy(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Zy(o)),[o,Zy(o)]}(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Uy(t)||T.every(e=>Uy(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Uy(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Zb=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Ly(e,t)||{};if(l==null)return{};let d=Qy(u),f={x:n,y:r},p=Wy(i),m=Vy(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=ky(d[_],T),D=ky(d[v],T),O=E,ee=C-h[m]-D,te=C/2-h[m]/2+w,ne=Iy(O,te,ee),re=!c.arrow&&zy(i)!=null&&te!==ne&&a.reference[m]/2-(te<O?E:D)-h[m]/2<0,ie=re?te<O?te-O:te-ee:0;return{[p]:f[p]+ie,data:{[p]:ne,centerOffset:te-ne-ie,...re&&{alignmentOffset:ie}},reset:re}}}),Qb=(e,t,n)=>{let r=new Map,i={platform:Gb,...n},a={...i.platform,_c:r};return(async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=eb(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:{...o,detectOverflow:o.detectOverflow??tb},elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=!0===y.rects?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=eb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}})(e,t,{...i,platform:a})},$b=function(){function e(){return c(this,e),s(this,e,arguments)}return p(e,ge),l(e,[{key:`render`,value:function(){return this.props.children}}])}();function ex(e){var t=e.children,n=e.content,r=e.position,i=r===void 0?`top`:r,a=e.className,o=a===void 0?``:a,s=e.delay,c=s===void 0?200:s,l=e.style,u=l===void 0?`dark`:l,f=e.trigger,p=f===void 0?`hover`:f,m=N(null),h=N(null),g=N(null),_=x(j(!1),2),v=_[0],y=_[1],b=N(null);return M(function(){var e;if((e=m.current)!=null&&e.base&&h.current)return qb(m.current.base,h.current,function(){Qb(m.current.base,h.current,{placement:i,middleware:[Jb(8),Xb(),Yb({padding:8}),Zb({element:g.current,padding:6})]}).then(function(e){var t=e.x,n=e.y,r=e.placement,i=e.middlewareData;Object.assign(h.current.style,{left:`${t}px`,top:`${n}px`});var a=i.arrow??{},o=a.x,s=a.y,c={top:`bottom`,bottom:`top`,left:`right`,right:`left`}[r.split(`-`)[0]];Object.assign(g.current.style,d({left:o==null?``:`${o}px`,top:s==null?``:`${s}px`,right:``,bottom:``},c,`-4px`))})})},[i,v]),M(function(){var e=m.current?.base,t=h.current;if(e&&t){var n=function(){b.current&&clearTimeout(b.current)},r=function(){n(),b.current=setTimeout(function(){return y(!0)},c)},i=function(){n(),y(!1)},a=function(){return y(function(e){return!e})};return p===`hover`?(e.addEventListener(`mouseenter`,r),e.addEventListener(`mouseleave`,i),t.addEventListener(`mouseenter`,r),t.addEventListener(`mouseleave`,i),e.addEventListener(`pointerdown`,i)):p===`click`&&e.addEventListener(`click`,a),p===`none`&&(b.current&&clearTimeout(b.current),y(!1)),function(){n(),p===`hover`?(e.removeEventListener(`mouseenter`,r),e.removeEventListener(`mouseleave`,i),t.removeEventListener(`mouseenter`,r),t.removeEventListener(`mouseleave`,i),e.removeEventListener(`pointerdown`,i)):p===`click`&&e.removeEventListener(`click`,a)}}},[p,c]),k(A,null,k(`div`,{ref:h,role:`tooltip`,className:`z-100 pointer-events-none absolute select-none whitespace-nowrap rounded-lg px-3 py-2 text-sm shadow-md transition-opacity duration-150 ${u===`dark`?`bg-tooltip-bg text-tooltip-fg`:`border-border-subtle bg-bg-elevated text-fg-primary border`} ${v?`opacity-100`:`opacity-0`} ${o} `,style:{visibility:v?`visible`:`hidden`}},n,k(`div`,{ref:g,className:`absolute h-2 w-2 rotate-45 bg-inherit ${u===`light`?`border-border-subtle border`:``} `})),k($b,{ref:m},t))}function tx(e){var t=e.commandId,n=e.documentId,r=e.variant,i=r===void 0?`icon`:r,a=e.itemId,o=e.className,s=Jo(t,n),c=Co(n,a||t);if(!s||!s.visible)return null;var l=s.iconProps||{};return k(ex,{content:s.label,position:`bottom`,delay:500,trigger:s.active||s.disabled?`none`:`hover`},k(Oy,{elementRef:c,onClick:function(){s.disabled||s.execute()},active:s.active,disabled:s.disabled,className:o||`p-1`,"aria-label":s.label},i===`text`?k(`span`,{className:`text-sm`},s.label):i===`icon-text`?k(`span`,{className:`flex items-center whitespace-nowrap`},s.icon&&k(Q,{icon:s.icon,className:`mr-1.5 h-5 w-5 flex-shrink-0`,primaryColor:l.primaryColor,secondaryColor:l.secondaryColor}),k(`span`,null,s.label)):i===`tab`?k(`span`,{className:`px-3 py-1`},s.label):s.icon?k(Q,{icon:s.icon,className:uy(`h-5 w-5`,l.className),primaryColor:l.primaryColor,secondaryColor:l.secondaryColor}):k(`span`,null,s.label)))}function nx(e){var t=e.schema,n=e.documentId,r=e.isOpen,i=e.className,a=i===void 0?``:i;if(!r)return null;var o=t.position.slot===`secondary`;return k(`div`,g({className:uy(`flex items-center gap-2`,function(e){switch(e){case`top`:return`border-b border-border-default bg-bg-surface px-4 py-2`;case`bottom`:return`border-t border-border-default bg-bg-surface px-4 py-2`;case`left`:return`border-r border-border-default bg-bg-surface px-2 py-3 flex-col`;case`right`:return`border-l border-border-default bg-bg-surface px-2 py-3 flex-col`}}(t.position.placement),o?`bg-bg-surface-alt`:``,a)},ao(t)),t.items.map(function(e){return k(rx,{key:e.id,item:e,documentId:n})}))}function rx(e){var t=e.item,n=e.documentId;switch(t.type){case`command-button`:return k(ix,{item:t,documentId:n});case`tab-group`:return k(ax,{item:t,documentId:n});case`divider`:return k(cx,{item:t});case`spacer`:return k(lx,{item:t});case`group`:return k(ux,{item:t,documentId:n});case`custom`:return k(dx,{item:t,documentId:n});default:return console.warn(`Unknown toolbar item type:`,t),null}}function ix(e){var t=e.item,n=e.documentId;return k(`div`,g({},ao(t)),k(tx,{commandId:t.commandId,documentId:n,itemId:t.id,variant:t.variant}))}function ax(e){var t=e.item,n=e.documentId;return k(`div`,g(g({className:`flex items-center gap-2`},ao(t)),{},{role:`tablist`}),t.tabs.map(function(e){return k(ox,{key:e.id,tab:e,documentId:n})}))}function ox(e){var t=e.tab,n=e.documentId,r=Jo(t.commandId,n),i=Co(n,t.id);return!r||!r.visible?null:k(`div`,g({},ao(t)),k(fy,{anchorRef:i,active:r.active,onClick:function(){r.disabled||r.execute()},disabled:r.disabled},t.variant===`text`&&r.label,t.variant===`icon`&&r.icon&&k(sx,{icon:r.icon,iconProps:r.iconProps}),t.variant===`icon-text`&&k(A,null,r.icon&&k(sx,{icon:r.icon,iconProps:r.iconProps}),r.label)))}function sx(e){var t=e.icon,n=e.iconProps;return k(Q,{icon:t,className:`h-5 w-5`,primaryColor:n?.primaryColor,secondaryColor:n?.secondaryColor})}function cx(e){var t=e.item;return k(`div`,g({},ao(t)),k(`div`,{className:t.orientation===`vertical`?`bg-border-default h-6 w-px`:`bg-border-default h-px w-6`,"aria-hidden":`true`}))}function lx(e){var t=e.item;return k(`div`,g(g({className:t.flex?`flex-1`:`w-4`},ao(t)),{},{"aria-hidden":`true`}))}function ux(e){var t=e.item,n=e.documentId;return k(`div`,g({className:uy(`flex items-center`,t.gap?`gap-${t.gap}`:`gap-2`,function(e){switch(e){case`start`:default:return`justify-start`;case`center`:return`justify-center`;case`end`:return`justify-end`}}(t.alignment))},ao(t)),t.items.map(function(e){return k(rx,{key:e.id,item:e,documentId:n})}))}function dx(e){var t=e.item,n=e.documentId,r=Eo().renderCustomComponent;return k(`div`,g({},ao(t)),r(t.componentId,n,t.props))}function fx(e){var t=e.schema,n=e.documentId,r=e.isOpen,i=e.onClose,a=e.sidebarProps,o=yo().getContainer,s=x(j(function(){var e=o();return!!e&&e.clientWidth<768}),2),c=s[0],l=s[1];M(function(){var e=o();if(e){var t=new ResizeObserver(function(){var t=e.clientWidth;l(t<768)});return t.observe(e),function(){return t.disconnect()}}},[o]);var u=t.position,d=t.content,f=t.width,p=Eo().renderCustomComponent,m=o();if(c&&m)return Zf(k(px,{schema:t,documentId:n,isOpen:r,onClose:i,renderCustomComponent:p,content:d,rootElement:m,sidebarProps:a}),m);if(!r)return null;var h=function(e){switch(e){case`left`:return`border-r`;case`right`:return`border-l`;case`top`:return`border-b`;case`bottom`:return`border-t`}}(u.placement),g=f?{width:f}:void 0;return k(`div`,{className:`${h} border-border-default bg-bg-surface flex flex-col shadow-lg`,style:g,"data-sidebar-id":t.id},k(`div`,{className:`min-h-0 flex-1`},d.type===`tabs`&&k(mx,{content:d,documentId:n,renderCustomComponent:p}),d.type===`component`&&k(A,null,p(d.componentId,n,a??{}))))}function px(e){var t=e.schema,n=e.documentId,r=e.isOpen,i=e.onClose,a=e.renderCustomComponent,o=e.content,s=e.rootElement,c=e.sidebarProps,l=x(j(`closed`),2),u=l[0],d=l[1],f=x(j(!1),2),p=f[0],m=f[1],h=x(j(0),2),g=h[0],_=h[1],v=x(j(!1),2),y=v[0],b=v[1],S=N(null),C=N({y:0,height:0,time:0,state:`half`}),w=N({y:0,time:0});M(function(){if(!r){d(`closed`);var e=setTimeout(function(){b(!1)},300);return function(){return clearTimeout(e)}}b(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){d(`half`)})})},[r]);var T=function(e){switch(e){case`closed`:return 0;case`half`:return 50;case`full`:return 100}},E=F(function(e){if(S.current){var t,n=s.clientHeight,r=S.current.offsetHeight/n*100;t=r>=75?`full`:r<=25?`closed`:`half`,C.current={y:e,height:r,time:Date.now(),state:t},w.current={y:e,time:Date.now()},_(0),t!==u&&d(t),m(!0)}},[s,u]),D=F(function(e){if(p){var t=s.clientHeight,n=(C.current.y-e)/t*100,r=Math.max(0,Math.min(100,C.current.height+n));w.current={y:e,time:Date.now()},_(r-T(C.current.state))}},[p,s]),O=F(function(){if(p){if(Math.abs(C.current.y-w.current.y)<5)return m(!1),void _(0);var e=T(C.current.state)+g,t=Date.now()-w.current.time,n=w.current.y-C.current.y,r=function(e,t){return Math.abs(t)>.5?t>0?e>50?`half`:`closed`:e<50?`half`:`full`:e>=75?`full`:e<=25?`closed`:`half`}(e,t>0?n/t:0);r===`closed`?(d(`closed`),m(!1),_(0),i()):(m(!1),_(0),d(r))}},[p,g,i]),ee=F(function(e){E(e.touches[0].clientY)},[E]),te=F(function(e){p&&(e.cancelable&&e.preventDefault(),D(e.touches[0].clientY))},[p,D]),ne=F(function(){O()},[O]),re=F(function(e){e.preventDefault(),E(e.clientY)},[E]);if(M(function(){if(p){var e=function(e){D(e.clientY)},t=function(){O()};return document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t),function(){document.removeEventListener(`mousemove`,e),document.removeEventListener(`mouseup`,t)}}},[p,D,O]),!y)return null;var ie=T(p?C.current.state:u),ae=p?Math.max(0,Math.min(100,ie+g)):ie,oe=.3*Math.min(ae/50,1);return k(A,null,k(`div`,{className:`bg-bg-overlay absolute inset-0 z-40 transition-opacity duration-300 ${ae===0?`pointer-events-none`:``}`,style:{opacity:oe},onClick:i}),k(`div`,{ref:S,className:`bg-bg-surface absolute inset-x-0 bottom-0 z-50 flex flex-col rounded-t-2xl shadow-2xl ${p?``:`transition-[height] duration-300 ease-out`}`,style:{height:`${ae}%`},"data-sidebar-id":t.id},k(`div`,{className:`flex flex-shrink-0 cursor-grab touch-none items-center justify-center py-3 active:cursor-grabbing`,onTouchStart:ee,onTouchMove:te,onTouchEnd:ne,onMouseDown:re},k(`div`,{className:`bg-border-default h-1.5 w-12 rounded-full`})),k(`div`,{className:`min-h-0 flex-1 overflow-hidden`},o.type===`tabs`&&k(mx,{content:o,documentId:n,renderCustomComponent:a}),o.type===`component`&&k(A,null,a(o.componentId,n,c??{})))))}function mx(e){var t=e.content,n=e.documentId,r=e.renderCustomComponent,i=x(j(t.tabs[0]?.id||``),2),a=i[0],o=i[1];return k(`div`,{className:`flex h-full flex-1 flex-col`},k(`div`,{role:`tablist`,className:`bg-bg-surface mx-4 my-4 flex flex-shrink-0 overflow-hidden`},t.tabs.map(function(e,t,n){var r=a===e.id,i=t===0,s=t===n.length-1;return k(`button`,{key:e.id,role:`tab`,"aria-selected":r,tabIndex:r?0:-1,onClick:function(){return o(e.id)},className:`relative flex h-7 flex-1 cursor-pointer items-center justify-center border outline-none transition-colors ${i?`rounded-l-md`:``} ${s?`rounded-r-md`:``} ${s?``:`border-r-0`} ${r?`border-accent bg-accent text-fg-on-accent`:`border-border-default text-fg-secondary hover:bg-interactive-hover`}`},e.icon&&k(Q,{icon:e.icon,className:`h-5 w-5`}))})),k(`div`,{className:`min-h-0 flex-1 overflow-auto`},t.tabs.filter(function(e){return e.id===a}).map(function(e){return k(A,{key:e.id},r(e.componentId,n,{}))})))}function hx(e){var t=e.schema,n=e.documentId,r=e.anchorEl,i=e.onClose,a=yo().getContainer,o=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:768,n=x(j(function(){var n=e();return!!n&&n.clientWidth<t}),2),r=n[0],i=n[1];return M(function(){var n=e();if(n){var r=new ResizeObserver(function(){i(n.clientWidth<t)});return r.observe(n),function(){return r.disconnect()}}},[e,t]),r}(a,768),s=a(),c=(()=>{let{provides:e}=go();return e?.getSchema()??null})(),l=x(j([{menuId:t.id,schema:t,title:void 0}]),2),u=l[0],d=l[1];M(function(){d([{menuId:t.id,schema:t,title:void 0}])},[t]);var f=u[u.length-1],p=F(function(e,t){if(c){var n=c.menus[e];n?d(function(r){return[].concat(S(r),[{menuId:e,schema:n,title:t}])}):console.warn(`Submenu schema not found: ${e}`)}},[c]),m=F(function(){u.length>1&&d(function(e){return e.slice(0,-1)})},[u.length]);return f?o&&s?Zf(k(gx,{currentMenu:f,menuStack:u,documentId:n,onClose:i,onNavigateBack:m,onNavigateToSubmenu:p,container:s}),s):k(_x,{currentMenu:f,documentId:n,anchorEl:r,onClose:i,onNavigateToSubmenu:p}):null}function gx(e){var t=e.currentMenu,n=e.menuStack,r=e.documentId,i=e.onClose,a=e.onNavigateBack,o=e.onNavigateToSubmenu,s=e.container,c=x(j(!1),2),l=c[0],u=c[1],d=x(j(!1),2),f=d[0],p=d[1],m=x(j(0),2),h=m[0],_=m[1],v=N(null),y=N(null),b=N({isDragging:!1,startY:0,currentY:0,startTime:0,sheetHeight:0});M(function(){u(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){p(!0)})})},[]);var S=x(j(null),2),C=S[0],w=S[1];M(function(){if(y.current){var e=(n.length>1?60:0)+y.current.scrollHeight+24,t=.8*s.clientHeight;w(Math.min(e,t))}},[t,n.length,s]);var T=F(function(){p(!1),setTimeout(function(){u(!1),i()},300)},[i]),E=F(function(e){v.current&&(b.current={isDragging:!0,startY:e,currentY:e,startTime:Date.now(),sheetHeight:v.current.offsetHeight})},[]),D=F(function(e){if(b.current.isDragging){var t=e-b.current.startY,n=Math.max(0,t);b.current.currentY=e,_(n)}},[]),O=F(function(){if(b.current.isDragging){var e=b.current,t=e.startY,n=e.currentY,r=e.startTime,i=e.sheetHeight,a=Math.abs(t-n);if(b.current.isDragging=!1,a<5)_(0);else{var o=n-t,s=o/i*100,c=Date.now()-r;s>30||(c>0?o/c:0)>.5?T():_(0)}}},[T]),ee=F(function(e){E(e.touches[0].clientY)},[E]),te=F(function(e){b.current.isDragging&&e.cancelable&&e.preventDefault(),D(e.touches[0].clientY)},[D]),ne=F(function(){O()},[O]),re=F(function(e){e.preventDefault(),E(e.clientY)},[E]);if(M(function(){if(b.current.isDragging){var e=function(e){return D(e.clientY)},t=function(){return O()};return document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t),function(){document.removeEventListener(`mousemove`,e),document.removeEventListener(`mouseup`,t)}}},[D,O]),M(function(){var e=function(e){e.key===`Escape`&&T()};return document.addEventListener(`keydown`,e),function(){return document.removeEventListener(`keydown`,e)}},[T]),!l)return null;var ie=f?h:C||400;return k(A,null,k(`div`,{className:`bg-bg-overlay absolute inset-0 z-40 transition-opacity duration-300 ${f?`opacity-100`:`opacity-0`}`,onClick:T}),k(`div`,g({ref:v,className:`bg-bg-surface absolute inset-x-0 bottom-0 z-50 flex flex-col rounded-t-2xl shadow-2xl ${b.current.isDragging?``:`transition-transform duration-300 ease-out`}`,style:{maxHeight:`80%`,transform:`translateY(${ie}px)`}},ao(t.schema)),k(`div`,{className:`flex flex-shrink-0 cursor-grab touch-none items-center justify-center py-3 active:cursor-grabbing`,onTouchStart:ee,onTouchMove:te,onTouchEnd:ne,onMouseDown:re},k(`div`,{className:`bg-border-default h-1.5 w-12 rounded-full`})),n.length>1&&k(`div`,{className:`border-border-subtle flex items-center gap-3 border-b px-4 pb-3`},k(`button`,{onClick:a,className:`hover:bg-interactive-hover rounded-full p-1`},k(my,{className:`h-5 w-5`})),k(`h3`,{className:`text-fg-primary font-semibold`},t.title||`Menu`)),k(`div`,{ref:y,className:`flex-1 overflow-y-auto py-2`},t.schema.items.map(function(e){return k(vx,{key:e.id,item:e,documentId:r,onClose:T,isMobile:!0,onNavigateToSubmenu:o})}))))}function _x(e){var t=e.currentMenu,n=e.documentId,r=e.anchorEl,i=e.onClose,a=e.onNavigateToSubmenu,o=N(null),s=x(j(null),2),c=s[0],l=s[1];M(function(){if(r){var e=function(){var e=r.getBoundingClientRect(),t=o.current?.offsetWidth||200,n=e.bottom+4,i=e.left;i+t>window.innerWidth&&(i=window.innerWidth-t-8),i<8&&(i=8),l({top:n,left:i})};return e(),window.addEventListener(`scroll`,e),window.addEventListener(`resize`,e),function(){window.removeEventListener(`scroll`,e),window.removeEventListener(`resize`,e)}}},[r]),M(function(){var e=function(e){if(o.current){var t=e.composedPath(),n=t.includes(o.current),a=r&&t.includes(r);n||a||i()}},t=setTimeout(function(){document.addEventListener(`mousedown`,e)},0);return function(){clearTimeout(t),document.removeEventListener(`mousedown`,e)}},[i,r]),M(function(){var e=function(e){e.key===`Escape`&&i()};return document.addEventListener(`keydown`,e),function(){return document.removeEventListener(`keydown`,e)}},[i]);var u=c?{position:`fixed`,top:`${c.top}px`,left:`${c.left}px`,zIndex:1e3}:{display:`none`};return k(`div`,g(g({ref:o},ao(t.schema)),{},{className:`border-border-default bg-bg-elevated min-w-[200px] rounded-lg border py-2 shadow-lg`,style:u}),t.schema.items.map(function(e){return k(vx,{key:e.id,item:e,documentId:n,onClose:i,isMobile:!1,onNavigateToSubmenu:a})}))}function vx(e){var t=e.item,n=e.documentId,r=e.onClose,i=e.isMobile,a=e.onNavigateToSubmenu;switch(t.type){case`command`:return k(yx,{item:t,documentId:n,onClose:r,isMobile:i});case`submenu`:return k(bx,{item:t,documentId:n,isMobile:i,onNavigateToSubmenu:a});case`divider`:return k(`div`,g({},ao(t)),k(`hr`,{className:`border-border-subtle my-2`}));case`section`:return k(xx,{item:t,documentId:n,onClose:r,isMobile:i,onNavigateToSubmenu:a});default:return null}}function yx(e){var t=e.item,n=e.documentId,r=e.onClose,i=e.isMobile,a=Jo(t.commandId,n);if(!a||!a.visible)return null;var o=function(){a.disabled||(a.execute(),r())};return i?k(`button`,g(g({},ao(t)),{},{onClick:o,disabled:a.disabled,className:`active:bg-interactive-active flex w-full items-center gap-3 px-4 py-3 text-left text-base transition-colors ${a.disabled?`cursor-not-allowed opacity-50`:`cursor-pointer`} ${a.active?`bg-interactive-selected text-accent`:`text-fg-secondary`}`,role:`menuitem`}),a.icon&&k(Q,{icon:a.icon,className:`h-5 w-5`,primaryColor:a.iconProps?.primaryColor,secondaryColor:a.iconProps?.secondaryColor}),k(`span`,{className:`flex-1`},a.label)):k(`button`,g(g({},ao(t)),{},{onClick:o,disabled:a.disabled,className:`flex w-full items-center justify-between gap-2 px-4 py-1 text-left ${a.disabled?`pointer-events-none cursor-not-allowed opacity-50`:`cursor-pointer`} ${a.active&&!a.disabled?`bg-accent text-fg-on-accent`:`text-fg-muted hover:bg-accent hover:text-fg-on-accent`}`,role:`menuitem`}),k(`div`,{className:`flex items-center gap-2`},k(`div`,{className:`flex h-6 w-6 items-center justify-center`},a.icon&&k(Q,{icon:a.icon,className:`h-6 w-6`,primaryColor:a.iconProps?.primaryColor,secondaryColor:a.iconProps?.secondaryColor})),k(`span`,{className:`text-sm`},a.label)))}function bx(e){var t=e.item,n=e.documentId,r=e.isMobile,i=e.onNavigateToSubmenu,a=os(n).translate,o=t.labelKey?a(t.labelKey):t.label||``,s=function(){return i(t.menuId,o)};return r?k(`button`,g(g({},ao(t)),{},{onClick:s,className:`text-fg-secondary active:bg-interactive-active flex w-full cursor-pointer items-center gap-3 px-4 py-3 text-left text-base transition-colors`,role:`menuitem`}),k(`span`,{className:`flex-1`},o),k(py,{className:`h-4 w-4`})):k(`button`,g(g({},ao(t)),{},{onClick:s,className:`text-fg-muted hover:bg-accent hover:text-fg-on-accent flex w-full cursor-pointer items-center justify-between gap-2 px-4 py-1 text-left`,role:`menuitem`}),k(`span`,{className:`text-sm`},o),k(py,{className:`h-6 w-6`}))}function xx(e){var t=e.item,n=e.documentId,r=e.onClose,i=e.isMobile,a=e.onNavigateToSubmenu,o=os(n).translate,s=t.labelKey?o(t.labelKey):t.label||``;return k(`div`,g({},ao(t)),k(`div`,{className:`text-fg-secondary px-4 py-3 text-xs font-medium uppercase`},s),t.items.map(function(e){return k(vx,{key:e.id,item:e,documentId:n,onClose:r,isMobile:i,onNavigateToSubmenu:a})}))}function Sx(e){var t=e.schema,n=e.documentId,r=e.isOpen,i=e.onClose,a=e.onExited,o=e.modalProps,s=t.content,c=Eo().renderCustomComponent;return s.type===`component`?k(A,null,c(s.componentId,n,g({isOpen:r,onClose:i,onExited:a},o))):(console.warn(`SchemaModal only supports component content type, got: ${s.type}`),null)}function Cx(e){var t=e.documentId;e.onClose;var n=qi(t),r=n.state,i=n.provides;return k(`div`,{className:`flex h-full flex-1 flex-col`},k(`div`,{className:`flex-1 overflow-hidden`},k(Bl,{documentId:t,style:{width:`100%`,height:`100%`}},function(e){return k(`div`,{key:e.pageIndex,style:{position:`absolute`,width:`100%`,height:e.wrapperHeight,top:e.top,display:`flex`,flexDirection:`column`,alignItems:`center`,cursor:`pointer`},onClick:function(){var t;i==null||(t=i.scrollToPage)==null||t.call(i,{pageNumber:e.pageIndex+1})}},k(`div`,{style:{width:e.width,height:e.height,border:`2px solid ${r.currentPage===e.pageIndex+1?`var(--ep-accent-primary)`:`var(--ep-border-default)`}`,borderRadius:`4px`,overflow:`hidden`,boxShadow:r.currentPage===e.pageIndex+1?`0 0 0 2px var(--ep-interactive-focus-ring)`:`none`}},k(Vl,{documentId:t,meta:e,style:{width:`100%`,height:`100%`}})),k(`div`,{style:{height:e.labelHeight,display:`flex`,alignItems:`center`,justifyContent:`center`,marginTop:`4px`}},k(`span`,{className:`text-fg-secondary text-xs`},e.pageIndex+1)))})))}function wx(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:300,n=x(j(e),2),r=n[0],i=n[1];return M(function(){var n=window.setTimeout(function(){return i(e)},t);return function(){return clearTimeout(n)}},[e,t]),r}var Tx=function(e){var t=e.label,n=e.checked,r=e.onChange,i=e.disabled;return k(`label`,{className:`text-fg-secondary inline-flex select-none items-center gap-2 text-xs font-medium ${i?`cursor-not-allowed opacity-50`:`cursor-pointer`}`},k(`input`,{type:`checkbox`,checked:n,disabled:i,onChange:function(e){return r(e.target.checked)},className:`border-border-default bg-bg-input checked:border-accent checked:bg-accent peer h-4 w-4 shrink-0 appearance-none rounded-[3px] border transition-all disabled:cursor-not-allowed`}),k(`svg`,{viewBox:`0 0 24 24`,className:`/* fine-tune centering */ text-fg-on-accent pointer-events-none absolute h-3.5 w-3.5 translate-x-[1px] translate-y-[1px] opacity-0 peer-checked:opacity-100`,fill:`none`,stroke:`currentColor`,strokeWidth:3,strokeLinecap:`round`,strokeLinejoin:`round`},k(`polyline`,{points:`20 6 9 17 4 12`})),t)},Ex=function(e){var t=e.hit,n=e.onClick,r=e.active,i=N(null);return M(function(){r&&i.current&&i.current.scrollIntoView({behavior:`smooth`,block:`nearest`})},[r]),k(`button`,{ref:i,onClick:n,className:`w-full rounded border p-2 text-left text-sm transition-colors ${r?`border-accent bg-accent-light text-fg-primary`:`border-border-subtle bg-bg-surface text-fg-secondary hover:bg-interactive-hover`}`},k(`span`,null,t.context.truncatedLeft&&`… `,t.context.before,k(`span`,{className:`text-accent font-bold`},t.context.match),t.context.after,t.context.truncatedRight&&` …`))};function Dx(e){var t=e.documentId;e.onClose;var n=(e=>{let{provides:t}=oc(),[n,r]=j($s),i=P(()=>t?.forDocument(e),[t,e]);return M(()=>{if(i)return r(i.getState()),i.onStateChange(e=>r(e));r($s)},[i]),{state:n,provides:i??null}})(t),r=n.state,i=n.provides,a=Ki().provides,o=os(t).translate,s=N(null),c=x(j(``),2),l=c[0],u=c[1];M(function(){},[]),M(function(){r.query&&!l&&u(r.query)},[r.query]),M(function(){r.activeResultIndex!==void 0&&r.activeResultIndex>=0&&p(r.activeResultIndex)},[r.activeResultIndex]);var d=wx(l,300);M(function(){d!==r.query&&i?.searchAllPages(d)},[d,i,r.query]);var f=function(e,t){t?i?.setFlags([].concat(S(r.flags),[e])):i?.setFlags(r.flags.filter(function(t){return t!==e}))},p=function(e){var n,i=r.results[e];if(i){var o=i.rects.reduce(function(e,t){return{x:Math.min(e.x,t.origin.x),y:Math.min(e.y,t.origin.y)}},{x:1/0,y:1/0});a==null||(n=a.forDocument(t))==null||n.scrollToPage({pageNumber:i.pageIndex+1,pageCoordinates:o,alignX:50,alignY:25})}},m=function(e){var t={};return e.forEach(function(e,n){t[e.pageIndex]||(t[e.pageIndex]=[]),t[e.pageIndex].push({hit:e,index:n})}),t}(r.results);return k(`div`,{className:`bg-bg-surface flex h-full flex-col`},k(`div`,{className:`p-4`},k(`div`,{className:`relative`},k(`div`,{className:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2`},k(gy,{className:`text-fg-muted h-4 w-4`})),k(`input`,{ref:s,type:`text`,placeholder:o(`search.placeholder`),value:l,onInput:function(e){var t=e.target;u(t.value)},className:`border-border-default bg-bg-input focus:border-accent focus:ring-accent w-full rounded-md border py-1 pl-8 pr-9 text-base focus:outline-none focus:ring-1`}),l&&k(`div`,{className:`absolute inset-y-0 right-0 flex cursor-pointer items-center pr-3`,onClick:function(){u(``),s.current&&s.current.focus()}},k(_y,{className:`text-fg-muted hover:text-fg-secondary h-4 w-4`}))),k(`div`,{className:`mt-3 flex flex-col gap-2`},k(Tx,{label:o(`search.caseSensitive`),checked:r.flags.includes(Sn.MatchCase),onChange:function(e){return f(Sn.MatchCase,e)}}),k(Tx,{label:o(`search.wholeWord`),checked:r.flags.includes(Sn.MatchWholeWord),onChange:function(e){return f(Sn.MatchWholeWord,e)}})),k(`hr`,{className:`border-border-subtle mb-2 mt-5`}),r.active&&k(`div`,{className:`flex h-[32px] flex-row items-center justify-between`},k(`div`,{className:`text-fg-muted text-xs`},o(`search.resultsFound`,{params:{count:r.total}})),r.total>1&&k(`div`,{className:`flex flex-row`},k(Oy,{onClick:function(){i?.previousResult()}},k(my,{className:`h-4 w-4`})),k(Oy,{onClick:function(){i?.nextResult()}},k(py,{className:`h-4 w-4`}))))),k(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-4`},Object.entries(m).map(function(e){var t=x(e,2),n=t[0],a=t[1];return k(`div`,{key:n,className:`mt-2 first:mt-0`},k(`div`,{className:`bg-bg-surface/80 text-fg-muted py-2 text-xs backdrop-blur`},o(`search.page`,{params:{page:Number(n)+1}})),k(`div`,{className:`flex flex-col gap-2`},a.map(function(e){var t=e.hit,n=e.index;return k(Ex,{key:n,hit:t,active:n===r.activeResultIndex,onClick:function(){i?.goToResult(n)}})})))}),k(`div`,null)))}function Ox(e){var t=e.documentId,n=ei(Km.id).provides,r=Ki().provides,i=os(t).translate,a=ni(t),o=x(j([]),2),s=o[0],c=o[1],l=x(j(new Set),2),u=l[0],d=l[1],f=x(j(!0),2),p=f[0],m=f[1];M(function(){if(n&&a!=null&&a.document){m(!0);var e=n.getBookmarks();return e.wait(function(e){var t=e.bookmarks;c(t);var n=t.map(function(e,t){return`bookmark-${t}`});d(new Set(n)),m(!1)},function(){m(!1)}),function(){e.abort({code:W.Cancelled,message:`Bookmark task cancelled`})}}},[n,a?.document]);var h=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=`bookmark-${t}`,o=e.children&&e.children.length>0,s=u.has(i);return k(`div`,{key:i,className:`select-none`},k(`div`,{className:`hover:bg-interactive-hover flex cursor-pointer items-center gap-1 px-2 py-1`,style:{paddingLeft:`${16*n+8}px`},onClick:function(){return function(e){if(r&&e.target){var t;if(e.target.type===`action`){var n=e.target.action;if(n.type===en.Goto||n.type===en.RemoteGoto)t=n.destination;else if(n.type===en.URI)return void window.open(n.uri,`_blank`)}else e.target.type===`destination`&&(t=e.target.destination);if(t){if(t.zoom.mode===Jt.XYZ){var i,o=a==null||(i=a.document)==null?void 0:i.pages.find(function(e){return e.index===t.pageIndex});if(!o)return;r.scrollToPage({pageNumber:t.pageIndex+1,pageCoordinates:t.zoom.params?{x:t.zoom.params.x,y:o.size.height-t.zoom.params.y}:void 0,behavior:`smooth`})}else r.scrollToPage({pageNumber:t.pageIndex+1,behavior:`smooth`})}}}(e)}},o&&k(`button`,{onClick:function(e){e.stopPropagation(),function(e){d(function(t){var n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}(i)},className:`flex h-4 w-4 items-center justify-center`},k(s?hy:py,{className:`h-3 w-3`})),!o&&k(`div`,{className:`w-4`}),k(`span`,{className:`text-fg-secondary text-sm`},e.title)),o&&s&&k(`div`,null,e.children?.map(function(e,t){return h(e,t,n+1)})))};return a==null||!a.document||p?k(`div`,{className:`text-fg-secondary flex h-full flex-col gap-3 p-4 text-sm`},k(`div`,{className:`text-fg-primary font-medium`},i(`outline.title`)),k(`p`,null,i(`outline.loading`))):s.length===0?k(`div`,{className:`flex h-full items-center justify-center p-6`},k(`div`,{className:`text-fg-muted text-center`},k(`div`,{className:`text-sm`},i(`outline.noOutline`)),k(`div`,{className:`mt-1 text-xs`},i(`outline.noBookmarks`)))):k(`div`,{className:`bg-bg-surface flex h-full flex-col`},k(`div`,{className:`flex-1 overflow-y-auto`},k(`div`,{className:`outline-tree`},s.map(function(e,t){return h(e,t)}))))}function kx(e){var t=e.size,n=t===void 0?`md`:t,r=e.text,i=e.className,a={sm:`w-6 h-6`,md:`w-10 h-10`,lg:`w-16 h-16`};return k(`div`,{className:`flex flex-col items-center justify-center gap-3 ${i===void 0?``:i}`},k(`div`,{className:`relative`},k(`div`,{className:`${a[n]} border-border-default animate-spin rounded-full border-4`}),k(`div`,{className:`${a[n]} border-r-accent border-t-accent absolute left-0 top-0 animate-spin rounded-full border-4 border-transparent`})),r&&k(`p`,{className:`${{sm:`text-sm`,md:`text-base`,lg:`text-lg`}[n]} text-fg-secondary animate-pulse font-medium`},r))}function Ax(e){var t=e.size,n=t===void 0?`md`:t,r=e.className,i=r===void 0?``:r;return k(`div`,{className:`${{sm:`w-4 h-4 border-2`,md:`w-6 h-6 border-2`,lg:`w-8 h-8 border-3`}[n]} border-border-default border-t-accent animate-spin rounded-full ${i}`})}var jx,Mx=function(e){var t=e.documentId,n=Mp().provides,r=x(j({show:!1,mode:null,isAnimating:!1}),2),i=r[0],a=r[1],o=os(t).translate;if(M(function(){if(n)return n.onModeChange(function(e){var t=e.activeMode;if(t===`marqueeZoom`||t===`marqueeCapture`){a({show:!0,mode:t,isAnimating:!0});var n=setTimeout(function(){a(function(e){return g(g({},e),{},{show:!1})})},3e3);return function(){return clearTimeout(n)}}a({show:!1,mode:null,isAnimating:!1})})},[n]),!i.show&&!i.isAnimating)return null;var s=i.mode===`marqueeZoom`?o(`zoom.dragTip`):o(`capture.dragTip`),c=i.mode===`marqueeZoom`?`rgba(33,150,243,0.8)`:`rgba(76,175,80,0.8)`;return k(`div`,{className:`hint-overlay ${i.show?`hint-show`:`hint-hide`}`,onAnimationEnd:function(){i.show||a(function(e){return g(g({},e),{},{isAnimating:!1,mode:null})})},style:{position:`absolute`,top:0,left:0,right:0,bottom:0,pointerEvents:`none`,zIndex:1e3,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:`20px`}},k(`div`,{className:`hint-text`,style:{background:`rgba(0, 0, 0, 0.8)`,color:`white`,padding:`12px 20px`,borderRadius:`8px`,fontSize:`14px`,fontWeight:`500`,textAlign:`center`,maxWidth:`250px`}},s),k(`div`,{className:`drag-demo`,style:{position:`relative`,width:`150px`,height:`100px`}},k(`div`,{style:{position:`absolute`,top:`20px`,left:`20px`,width:`110px`,height:`60px`,border:`2px dashed ${c}`,borderRadius:`4px`,opacity:.6}}),k(`div`,{className:`animated-rect`,style:{position:`absolute`,top:`20px`,left:`20px`,border:`2px solid ${c}`,backgroundColor:`${c.replace(`0.8`,`0.15`)}`,borderRadius:`4px`}}),k(`div`,{className:`cursor-demo`,style:{position:`absolute`,width:`20px`,height:`20px`}},k(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},k(`path`,{d:`M3.5 2.5L16.5 10L10 11.5L7.5 16.5L3.5 2.5Z`,fill:`rgba(0,0,0,0.3)`,transform:`translate(1,1)`}),k(`path`,{d:`M3 2L16 10L10 11.5L7.5 16L3 2Z`,fill:`white`,stroke:`black`,strokeWidth:`1`}),k(`path`,{d:`M4 3.5L13.5 9.5L9.5 10.5L7.5 14L4 3.5Z`,fill:`rgba(255,255,255,0.8)`})))),k(`style`,{jsx:!0},`
2266
+ .hint-overlay {
2267
+ animation-duration: 0.3s;
2268
+ animation-fill-mode: both;
2269
+ }
2270
+
2271
+ .hint-show {
2272
+ animation-name: hintFadeIn;
2273
+ }
2274
+
2275
+ .hint-hide {
2276
+ animation-name: hintFadeOut;
2277
+ }
2278
+
2279
+ @keyframes hintFadeIn {
2280
+ from {
2281
+ opacity: 0;
2282
+ transform: translateY(10px);
2283
+ }
2284
+ to {
2285
+ opacity: 1;
2286
+ transform: translateY(0);
2287
+ }
2288
+ }
2289
+
2290
+ @keyframes hintFadeOut {
2291
+ from {
2292
+ opacity: 1;
2293
+ transform: translateY(0);
2294
+ }
2295
+ to {
2296
+ opacity: 0;
2297
+ transform: translateY(-10px);
2298
+ }
2299
+ }
2300
+
2301
+ .animated-rect {
2302
+ animation: rectGrow 2s ease-in-out infinite;
2303
+ }
2304
+
2305
+ @keyframes rectGrow {
2306
+ 0% {
2307
+ width: 0;
2308
+ height: 0;
2309
+ }
2310
+ 50% {
2311
+ width: 110px;
2312
+ height: 60px;
2313
+ }
2314
+ 100% {
2315
+ width: 110px;
2316
+ height: 60px;
2317
+ opacity: 0.7;
2318
+ }
2319
+ }
2320
+
2321
+ .cursor-demo {
2322
+ animation: cursorMove 2s ease-in-out infinite;
2323
+ }
2324
+
2325
+ @keyframes cursorMove {
2326
+ 0% {
2327
+ top: 20px;
2328
+ left: 20px;
2329
+ }
2330
+ 50% {
2331
+ top: 50px;
2332
+ left: 80px;
2333
+ }
2334
+ 100% {
2335
+ top: 80px;
2336
+ left: 130px;
2337
+ }
2338
+ }
2339
+
2340
+ .hint-text {
2341
+ animation: textPulse 0.6s ease-in-out;
2342
+ }
2343
+
2344
+ @keyframes textPulse {
2345
+ 0% {
2346
+ transform: scale(0.9);
2347
+ }
2348
+ 50% {
2349
+ transform: scale(1.05);
2350
+ }
2351
+ 100% {
2352
+ transform: scale(1);
2353
+ }
2354
+ }
2355
+ `))},Nx=function(e){var t=e.placeholder,n=e.onSubmit,r=e.inputRef,i=e.isFocused,a=x(j(``),2),o=a[0],s=a[1],c=function(){o.trim()&&(n(o),s(``))};return k(`div`,{className:`border-border-subtle mt-4 flex items-end space-x-2 border-t pt-4`,onClick:function(e){return e.stopPropagation()}},k(`input`,{ref:r,type:`text`,placeholder:t,value:o,onInput:function(e){return s(e.currentTarget.value)},onKeyDown:function(e){e.key===`Enter`&&(e.preventDefault(),c())},className:`bg-bg-input text-fg-primary placeholder-fg-muted w-full rounded-lg border px-3 py-1 text-base transition-colors focus:border-transparent focus:outline-none focus:ring-2 ${i?`border-accent focus:ring-accent`:`border-border-default focus:ring-accent`}`}),k(`button`,{type:`button`,onClick:function(){return c()},disabled:!o.trim(),className:`bg-accent text-fg-on-accent hover:bg-accent-hover disabled:bg-interactive-disabled rounded-lg p-2 transition-colors disabled:cursor-not-allowed`},k(`svg`,{className:`h-5 w-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},k(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 19l9 2-9-18-9 18 9-2zm0 0v-8`}))))},Px=[`bg-red-500`,`bg-blue-500`,`bg-green-500`,`bg-yellow-500`,`bg-purple-500`,`bg-pink-500`,`bg-indigo-500`,`bg-teal-500`],Fx=function(e){return e?Px[e.length>0?e.charCodeAt(0)%Px.length:0]:Px[0]},Ix=function(e){var t=e.name,n=e.className,r=n===void 0?``:n;return k(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-full text-sm font-medium text-white ${Fx(t)} ${r}`},function(e){return e?e.split(` `).map(function(e){return e[0]}).join(``).toUpperCase().slice(0,2):`G`}(t))},Lx=function(e){var t,n,r=e.onEdit,i=e.onDelete,a=e.onClose,o=e.documentId,s=N(null),c=os(o).translate;return M(function(){var e=function(e){t.current&&!t.current.contains(e.target)&&n()};return document.addEventListener(`click`,e),function(){document.removeEventListener(`click`,e)}},[t=s,n=a]),k(`div`,{ref:s,className:`bg-bg-elevated ring-border-default absolute right-0 top-6 z-10 w-32 rounded-md shadow-lg ring-1`},k(`div`,{className:`py-1`},k(`button`,{onClick:function(e){e.preventDefault(),e.stopPropagation(),r(),a()},className:`text-fg-secondary hover:bg-interactive-hover block w-full px-4 py-2 text-left text-sm`},c(`comments.edit`)),k(`button`,{onClick:function(e){e.preventDefault(),e.stopPropagation(),i(),a()},className:`text-state-error hover:bg-interactive-hover block w-full px-4 py-2 text-left text-sm`},c(`comments.delete`))))},Rx=function(e){var t=e.initialText,n=e.onSave,r=e.onCancel,i=e.autoFocus,a=i!==void 0&&i,o=e.documentId,s=x(j(t),2),c=s[0],l=s[1],u=N(null),d=os(o).translate;return M(function(){a&&u.current&&(u.current.focus(),u.current.setSelectionRange(c.length,c.length))},[a,c.length]),k(`div`,{className:`flex-1 space-y-2`},k(`textarea`,{ref:u,value:c,onInput:function(e){return l(e.currentTarget.value)},className:`border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 text-base focus:outline-none focus:ring-1`,rows:3}),k(`div`,{className:`flex flex-wrap gap-2`},k(`button`,{onClick:function(e){e.stopPropagation(),n(c)},className:`bg-accent text-fg-on-accent hover:bg-accent-hover whitespace-nowrap rounded-md px-3 py-1 text-sm`},d(`comments.save`)),k(`button`,{onClick:function(e){e.stopPropagation(),r()},className:`bg-interactive-hover text-fg-secondary hover:bg-border-default whitespace-nowrap rounded-md px-3 py-1 text-sm`},d(`comments.cancel`))))},zx=function(e){if(!e)return`(no date)`;try{return(e instanceof Date?e:new Date(e)).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}catch{return typeof e==`string`?e:`(no date)`}},Bx=function(e){var t=e.annotation,n=e.onSave,r=e.onDelete,i=e.isReply,a=i!==void 0&&i,o=e.documentId,s=e.isReadOnly,c=s!==void 0&&s,l=x(j(!1),2),u=l[0],d=l[1],f=x(j(!1),2),p=f[0],m=f[1],h=t.author||`Guest`;return p?k(`div`,{className:`flex w-full items-start space-x-3`,onClick:function(e){return e.stopPropagation()}},a&&k(Ix,{name:h,className:`h-8 w-8`}),k(Rx,{initialText:t.contents||``,onSave:function(e){n(e),m(!1)},onCancel:function(){m(!1)},autoFocus:!0,documentId:o})):k(`div`,{className:`flex items-start space-x-3`},a&&k(Ix,{name:h,className:`h-8 w-8`}),k(`div`,{className:`min-w-0 flex-1`},a&&k(`div`,{className:`flex items-center justify-between`},k(`div`,{className:`leading-none`},k(`h5`,{className:`text-fg-primary text-sm font-medium`},h),k(`span`,{className:`text-fg-muted text-xs`},zx(t.modified||t.created))),!c&&k(`div`,{className:`relative`},k(`button`,{onClick:function(e){e.stopPropagation(),d(!0)},className:`text-fg-muted hover:bg-interactive-hover rounded-md p-1`},k(`svg`,{className:`h-4 w-4`,fill:`currentColor`,viewBox:`0 0 20 20`},k(`path`,{d:`M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z`}))),u&&k(Lx,{onEdit:function(){return m(!0)},onDelete:r,onClose:function(){return d(!1)},documentId:o}))),k(`p`,{className:`text-fg-primary mt-2 text-sm`},t.contents)))},Vx=(d(d(d(d(d(d(d(d(d(d(jx={},z.TEXT,{label:`Comment`,labelKey:`annotation.comment`,icon:`message`,iconProps:function(e){return{primaryColor:e.strokeColor||e.color||`#6b7280`}}}),z.HIGHLIGHT,{label:`Highlight`,labelKey:`annotation.highlight`,icon:`highlight`,iconProps:function(e){return{primaryColor:e.strokeColor||`#ffff00`}}}),z.CIRCLE,{label:`Circle`,labelKey:`annotation.circle`,icon:`circle`,iconProps:function(e){return{primaryColor:e.strokeColor||`#000000`,secondaryColor:e.color}}}),z.SQUARE,{label:`Square`,labelKey:`annotation.square`,icon:`square`,iconProps:function(e){return{primaryColor:e.strokeColor||`#000000`,secondaryColor:e.color}}}),z.LINE,{label:`Line`,labelKey:`annotation.line`,icon:`line`,iconProps:function(e){return{primaryColor:e.strokeColor||`#000000`}}}),z.UNDERLINE,{label:`Underline`,labelKey:`annotation.underline`,icon:`underline`,iconProps:function(e){return{primaryColor:e.strokeColor||`#000000`}}}),z.SQUIGGLY,{label:`Squiggly`,labelKey:`annotation.squiggly`,icon:`squiggly`,iconProps:function(e){return{primaryColor:e.strokeColor||`#000000`}}}),z.STRIKEOUT,{label:`Strikethrough`,labelKey:`annotation.strikeout`,icon:`strikethrough`,iconProps:function(e){return{primaryColor:e.strokeColor||`#000000`}}}),z.INK,{label:`Ink`,labelKey:`annotation.ink`,icon:`pencilMarker`,iconProps:function(e){return{primaryColor:e.strokeColor||`#000000`}}}),z.FREETEXT,{label:`Text`,labelKey:`annotation.freeText`,icon:`freeText`,iconProps:function(e){return{primaryColor:e.fontColor||`#000000`}}}),d(d(d(d(d(jx,z.POLYGON,{label:`Polygon`,labelKey:`annotation.polygon`,icon:`polygon`,iconProps:function(e){return{primaryColor:e.strokeColor||`#000000`,secondaryColor:e.color}}}),z.POLYLINE,{label:`Polyline`,labelKey:`annotation.polyline`,icon:`zigzag`,iconProps:function(e){return{primaryColor:e.strokeColor||`#000000`}}}),z.STAMP,{label:`Stamp`,labelKey:`annotation.stamp`,icon:`rubberStamp`,iconProps:function(){return{primaryColor:`#000000`}}}),z.CARET,{label:`Caret`,labelKey:`annotation.caret`,icon:`insertText`,iconProps:function(e){return{primaryColor:e.strokeColor||`#E44234`}}}),z.REDACT,{label:`Redact`,labelKey:`annotation.redact`,icon:`redact`,iconProps:function(e){return{primaryColor:e.strokeColor||`#000000`,secondaryColor:e.color||`#000000`}}})),Hx=function(e){return Su(e)?Vx[e.object.type]:null},Ux=function(e){var t=e.text,n=e.maxWords,r=n===void 0?16:n,i=e.className,a=i===void 0?``:i,o=e.documentId,s=x(j(!1),2),c=s[0],l=s[1],u=os(o).translate,d=t.split(` `);return d.length>r?k(`div`,{className:a},c?t:d.slice(0,r).join(` `)+`...`,` `,k(`button`,{onClick:function(e){e.stopPropagation(),l(!c)},className:`text-accent hover:text-accent-hover text-sm font-medium focus:outline-none`},u(c?`comments.showLess`:`comments.showMore`))):k(`div`,{className:a},t)},Wx=function(e){var t=e.annotation,n=e.config,r=e.className,i=r===void 0?``:r,a=e.title,o=n.iconProps(t.object);return k(`div`,{className:`bg-bg-surface-alt flex items-center justify-center rounded-full ${i}`,title:a},k(Q,g({icon:n.icon},o)))},Gx=function(e){var t=e.entry,n=e.isSelected,r=e.onSelect,i=e.onUpdate,a=e.onDelete,o=e.onReply,s=e.documentId,c=e.isReadOnly,l=c!==void 0&&c,u=t.annotation,d=t.replies,f=t.groupMembers,p=x(j(!1),2),m=p[0],h=p[1],g=x(j(!1),2),_=g[0],v=g[1],y=x(j(!1),2),b=y[0],S=y[1],C=os(s).translate,w=f!=null&&f.length>0,T=Hx(u),E=!!u.object.contents,D=d.length>0,O=!E&&!D,ee=N(null),te=N(!1),ne=u.object.author||`Guest`;return M(function(){var e;n&&!te.current&&((e=ee.current)==null||e.focus({preventScroll:!0})),te.current=n},[n]),T?k(`div`,{onClick:r,className:`bg-bg-surface cursor-pointer rounded-lg border shadow-sm transition-all hover:shadow-md ${n?`border-accent ring-interactive-focus-ring ring-2`:`border-border-subtle`}`},k(`div`,{className:`p-4`},k(`div`,{className:`flex items-start space-x-3`},k(Wx,{annotation:u,config:T,title:C(T.labelKey,{fallback:T.label}),className:`h-8 w-8`}),k(`div`,{className:`min-w-0 flex-1`},k(`div`,{className:`flex items-center justify-between`},k(`div`,{className:`leading-none`},k(`h4`,{className:`text-fg-primary text-sm font-medium`},ne),k(`span`,{className:`text-fg-disabled text-xs`},zx(u.object.modified||u.object.created))),!l&&k(`div`,{className:`relative`},k(`button`,{onClick:function(e){e.stopPropagation(),h(!0)},className:`text-fg-disabled hover:bg-interactive-hover hover:text-fg-secondary rounded-md p-1`},k(`svg`,{className:`h-4 w-4`,fill:`currentColor`,viewBox:`0 0 20 20`},k(`path`,{d:`M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z`}))),m&&k(Lx,{onEdit:function(){return v(!0)},onDelete:function(){return a(u)},onClose:function(){return h(!1)},documentId:s}))),u.object.custom?.text&&k(Ux,{text:u.object.custom.text,maxWords:14,className:`text-fg-muted mt-2 text-sm`,documentId:s}),_?k(`div`,{className:`mt-2`},k(Rx,{initialText:u.object.contents||``,onSave:function(e){i(u.object.id,e),v(!1)},onCancel:function(){v(!1)},autoFocus:!0,documentId:s})):E?k(`p`,{className:`text-fg-primary mt-2 text-sm`},u.object.contents):null)),D&&k(`div`,{className:`border-border-subtle mt-4 space-y-4 border-t pt-4`},d.map(function(e){return k(Bx,{key:e.object.id,annotation:e.object,onSave:function(t){return i(e.object.id,t)},onDelete:function(){return a(e)},isReply:!0,documentId:s,isReadOnly:l})})),w&&k(`div`,{className:`border-border-subtle mt-4 border-t pt-3`},k(`button`,{onClick:function(e){e.stopPropagation(),S(function(e){return!e})},className:`text-accent hover:text-accent-hover flex w-full items-center justify-center gap-1 text-sm font-medium`},b?C(`comments.closeAllAnnotations`,{fallback:`Close All Annotations`}):C(`comments.showAllAnnotations`,{fallback:`Show All Annotations`}),k(`svg`,{className:`h-4 w-4 transition-transform ${b?`rotate-180`:``}`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2},k(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`}))),b&&k(`div`,{className:`mt-3 space-y-3`},f.map(function(e){var t=Hx(e);if(!t)return null;var n=e.object.author||`Guest`;return k(`div`,{key:e.object.id,className:`flex items-start gap-2`},k(Wx,{annotation:e,config:t,title:C(t.labelKey,{fallback:t.label}),className:`h-6 w-6`}),k(`div`,{className:`min-w-0 flex-1`},k(`div`,{className:`leading-none`},k(`span`,{className:`text-fg-primary text-sm font-medium`},n),k(`span`,{className:`text-fg-disabled ml-2 text-xs`},zx(e.object.modified||e.object.created),` (${C(`comments.page`,{params:{page:e.object.pageIndex+1}})})`)),e.object.custom?.text&&k(Ux,{text:e.object.custom.text,maxWords:14,className:`text-fg-muted mt-1 text-sm`,documentId:s}),e.object.contents&&k(`p`,{className:`text-fg-primary mt-1 text-sm`},e.object.contents)))}))),!_&&!l&&k(Nx,{inputRef:ee,isFocused:n,placeholder:C(O?`comments.addComment`:`comments.addReply`),onSubmit:function(e){O?i(u.object.id,e):o(u.object.id,e)}}))):null},Kx=function(e){var t=e.documentId,n=os(t).translate;return k(`div`,{class:`text-fg-muted flex flex-col items-center gap-2 p-4`},k(Q,{icon:`comment`,className:`h-18 w-18 text-fg-muted`}),k(`div`,{className:`text-fg-muted max-w-[150px] text-center text-sm`},n(`comments.emptyState`)))},qx=function(e){var t=e.documentId,n=Kp().provides,r=qp(t).state,i=Ki().provides,a=os(t).translate,o=si(t).canModifyAnnotations,s=N({}),c=N(null),l=!o,d=Au(r),f=(e=>{let t={};for(let n of Object.values(e.pages))for(let r of n){let n=e.byUid[r];if(n&&xu(n)){let e=n.object.inReplyToId;e&&(t[e]||(t[e]=[])).push(n)}}let n={},r=new Set;for(let t of Object.values(e.pages))for(let i of t){let t=e.byUid[i];if(t&&t.object.inReplyToId&&t.object.replyType===cn.Group&&t.object.type!==z.LINK&&Su(t)){let e=t.object.inReplyToId;(n[e]||(n[e]=[])).push(t),r.add(t.object.id)}}let i={};for(let[a,o]of Object.entries(e.pages)){let s=Number(a),c=[];for(let i of o){let a=e.byUid[i];if(!a||!Su(a)||r.has(a.object.id))continue;let o=n[a.object.id];c.push({page:s,annotation:a,replies:t[a.object.id]??[],...o&&o.length>0?{groupMembers:o}:{}})}c.length>0&&(i[s]=c)}return i})(r),p=new Set(d.map(function(e){return Pu(r,e.object.id)??e.object.id}));M(function(){var e=p.values().next().value;if(e&&c.current){var t=s.current[e];if(t){var n=c.current,r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.top-r.top+n.scrollTop-n.clientHeight/2+i.height/2;n.scrollTo({top:a,behavior:`smooth`})}}},[r.selectedUids]);var m=function(e,t){var r=v(e);r&&n?.updateAnnotation(r.object.pageIndex,e,{contents:t,modified:new Date})},h=function(e){n?.deleteAnnotation(e.object.pageIndex,e.object.id)},g=function(e,t){var r=v(e);r&&n?.createAnnotation(r.object.pageIndex,{id:K(),rect:{origin:{x:r.object.rect.origin.x,y:r.object.rect.origin.y},size:{width:24,height:24}},pageIndex:r.object.pageIndex,created:new Date,modified:new Date,type:z.TEXT,contents:t,inReplyToId:r.object.id,flags:[`noRotate`,`noZoom`,`print`],name:on.Comment})},_=Object.keys(f).map(Number).sort(function(e,t){return e-t}),v=function(e){var t,n=u(_);try{for(n.s();!(t=n.n()).done;){var r,i=t.value,a=u(f[i]);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(o.annotation.object.id===e)return o.annotation;var s=o.replies.find(function(t){return t.object.id===e});if(s)return s}}catch(e){a.e(e)}finally{a.f()}}}catch(e){n.e(e)}finally{n.f()}};return _.length===0?k(Kx,{documentId:t}):k(`div`,{ref:c,className:`h-full overflow-y-auto`},k(`div`,{className:`space-y-6 p-3`},_.map(function(e){return k(`div`,{key:e,className:`space-y-3`},k(`div`,{className:`bg-bg-surface sticky top-0 z-10 px-1`},k(`div`,{className:`border-border-subtle border-b py-2`},k(`h3`,{className:`text-md text-fg-primary font-semibold`},a(`comments.page`,{params:{page:e+1}})),k(`p`,{className:`text-fg-muted text-sm`},f[e].length===1?a(`comments.commentCount`,{params:{count:1}}):a(`comments.commentCountPlural`,{params:{count:f[e].length}})))),k(`div`,{className:`space-y-3 px-1`},f[e].map(function(e){return k(`div`,{key:e.annotation.object.id,ref:function(t){t&&(s.current[e.annotation.object.id]=t)}},k(Gx,{entry:e,isSelected:p.has(e.annotation.object.id),onSelect:function(){t=e.annotation,n?.selectAnnotation(t.object.pageIndex,t.object.id),i?.scrollToPage({pageNumber:t.object.pageIndex+1,pageCoordinates:{x:t.object.rect.origin.x,y:t.object.rect.origin.y},alignX:50,alignY:25,behavior:`smooth`});return;var t},onUpdate:m,onDelete:h,onReply:g,documentId:t,isReadOnly:l}))})))})))};function Jx(e){var t=e.documentId,n=(e=>{let{provides:t}=bs(),[n,r]=j(hs);return M(()=>{if(!t)return;let n=t.forDocument(e);return r(n.getState()),n.onStateChange(e=>{r(e)})},[t,e]),{state:n,provides:t?.forDocument(e)??null}})(t),r=n.state,i=n.provides,a=x(j(``),2),o=a[0],s=a[1];if(!i)return null;var c=Math.round(100*r.currentZoomLevel);return M(function(){s(c.toString())},[c]),k(`div`,{className:`relative`},k(`div`,{className:`bg-interactive-hover flex items-center rounded`},k(`div`,{className:`flex min-w-0 flex-nowrap items-center overflow-hidden whitespace-nowrap`},k(`input`,{name:`zoom`,type:`text`,inputMode:`numeric`,pattern:`\\d*`,className:`h-6 w-8 min-w-0 shrink border-0 bg-transparent p-0 text-right text-sm outline-none focus:outline-none`,"aria-label":`Set zoom`,autoFocus:!1,value:o,onInput:function(e){s(e.target.value.replace(/[^0-9]/g,``))},onBlur:function(){(!o||parseFloat(o)<=0)&&s(c.toString())},onKeyDown:function(e){var t;e.key===`Enter`&&(e.preventDefault(),t=parseFloat(o),!isNaN(t)&&t>0&&i.requestZoom(t/100))}}),k(`span`,{className:`shrink-0 text-sm`},`%`)),k(tx,{commandId:`zoom:toggle-menu`,documentId:t,itemId:`zoom-menu-button`}),k(tx,{commandId:`zoom:out`,documentId:t}),k(tx,{commandId:`zoom:in`,documentId:t})))}var Yx=function(e){var t=e.documentId,n=os(t).translate;return k(`div`,{class:`text-fg-muted flex flex-col items-center gap-2 p-4`},k(Q,{icon:`palette`,className:`h-18 w-18 text-fg-muted`}),k(`div`,{className:`text-fg-muted max-w-[150px] text-center text-sm`},n(`annotation.selectAnnotation`)))},Xx={color:{key:`color`,type:`colorWithTransparent`,labelKey:`annotation.fillColor`},strokeColor:{key:`strokeColor`,type:`colorWithTransparent`,labelKey:`annotation.strokeColor`},strokeColorWithoutTransparent:{key:`strokeColor`,type:`color`,labelKey:`annotation.strokeColor`},opacity:{key:`opacity`,type:`opacity`,labelKey:`annotation.opacity`,min:.1,max:1,step:.05,debounce:!0},strokeWidth:{key:`strokeWidth`,type:`slider`,labelKey:`annotation.strokeWidth`,min:1,max:30,step:1,unit:`px`,debounce:!0},strokeStyle:{key:`strokeStyle`,type:`strokeStyle`,labelKey:`annotation.borderStyle`},strokeStyleWithCloudy:{key:`strokeStyle`,type:`strokeStyle`,labelKey:`annotation.borderStyle`,showCloudy:!0},lineEndings:{key:`lineEndings`,type:`lineEndings`,labelKey:`annotation.lineEndings`},fontFamily:{key:`fontFamily`,type:`fontFamily`,labelKey:`annotation.fontFamily`},fontSize:{key:`fontSize`,type:`fontSize`,labelKey:`annotation.fontSize`},fontColor:{key:`fontColor`,type:`fontColor`,labelKey:`annotation.fontColor`},textAlign:{key:`textAlign`,type:`textAlign`,labelKey:`annotation.textAlign`},verticalAlign:{key:`verticalAlign`,type:`verticalAlign`,labelKey:`annotation.verticalAlign`},blendMode:{key:`blendMode`,type:`blendMode`,labelKey:`annotation.blendMode`},rotation:{key:`rotation`,type:`rotation`,labelKey:`annotation.rotation`,debounce:!0,editOnly:!0},overlayText:{key:`overlayText`,type:`text`,labelKey:`annotation.overlayText`,placeholderKey:`annotation.overlayTextPlaceholder`}},Zx={highlight:[`strokeColor`,`opacity`,`blendMode`],underline:[`strokeColor`,`opacity`,`blendMode`],strikeout:[`strokeColor`,`opacity`,`blendMode`],squiggly:[`strokeColor`,`opacity`,`blendMode`],ink:[`strokeColor`,`opacity`,`strokeWidth`,`rotation`],inkHighlighter:[`strokeColor`,`opacity`,`strokeWidth`,`blendMode`,`rotation`],signatureInk:[`strokeColor`,`opacity`,`strokeWidth`,`rotation`],circle:[`color`,`opacity`,`strokeColor`,`strokeStyleWithCloudy`,`strokeWidth`,`rotation`],square:[`color`,`opacity`,`strokeColor`,`strokeStyleWithCloudy`,`strokeWidth`,`rotation`],polygon:[`strokeColor`,`opacity`,`strokeStyleWithCloudy`,`strokeWidth`,`color`,`rotation`],line:[`strokeColor`,`opacity`,`strokeStyle`,`strokeWidth`,`lineEndings`,`color`,`rotation`],lineArrow:[`strokeColor`,`opacity`,`strokeStyle`,`strokeWidth`,`lineEndings`,`color`,`rotation`],polyline:[`strokeColor`,`opacity`,`strokeStyle`,`strokeWidth`,`lineEndings`,`color`,`rotation`],textComment:[`strokeColor`,`opacity`],insertText:[`strokeColor`,`opacity`],replaceText:[`strokeColor`,`opacity`],freeText:[`fontFamily`,`fontSize`,`fontColor`,`textAlign`,`verticalAlign`,`opacity`,`color`,`rotation`],freeTextCallout:[`fontFamily`,`fontSize`,`fontColor`,`textAlign`,`verticalAlign`,`opacity`,`color`,`strokeColorWithoutTransparent`,`strokeWidth`],stamp:[`rotation`],redact:[`strokeColor`,`color`,`opacity`],formTextField:[`fontSize`,`fontColor`,`strokeColor`,`strokeWidth`,`color`],formCheckbox:[`strokeColor`,`color`,`strokeWidth`],formCombobox:[`fontSize`,`fontColor`,`strokeColor`,`strokeWidth`,`color`],formListbox:[`fontFamily`,`fontSize`,`fontColor`,`strokeColor`,`strokeWidth`,`color`],formRadioButton:[`strokeColor`,`color`,`strokeWidth`]},Qx=[`position`],$x=function(){var e=x(j(!1),2),t=e[0],n=e[1],r=N(null),i=N(null);return M(function(){if(t){var e=function(e){r.current&&!r.current.contains(e.target)&&n(!1)};return document.addEventListener(`click`,e),function(){return document.removeEventListener(`click`,e)}}},[t]),M(function(){t&&i.current&&i.current.scrollIntoView({block:`center`,inline:`start`})},[t]),{open:t,setOpen:n,rootRef:r,selectedItemRef:i}},eS=function(e){var t=e.value,n=e.onChange,r=e.options,i=e.getOptionKey,a=e.renderValue,o=e.renderOption,s=e.triggerClass,c=s===void 0?`px-3 py-2`:s,l=$x(),u=l.open,d=l.setOpen,f=l.rootRef,p=l.selectedItemRef;return k(`div`,{ref:f,class:`relative inline-block w-full`},k(`button`,{type:`button`,class:`border-border-default bg-bg-input flex w-full items-center justify-between gap-2 rounded border ${c}`,onClick:function(){return d(function(e){return!e})}},a(t),k(`svg`,{class:`text-fg-secondary h-4 w-4`,viewBox:`0 0 20 20`,fill:`currentColor`},k(`path`,{fillRule:`evenodd`,d:`M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z`,clipRule:`evenodd`}))),u&&k(`div`,{class:`border-border-default bg-bg-elevated absolute z-10 mt-1 max-h-60 w-full overflow-y-auto rounded border p-1 shadow-lg`},r.map(function(e){var r=i(e)===i(t);return k(`button`,{ref:r?p:null,key:i(e),class:`hover:bg-interactive-hover block w-full rounded text-left ${r?`bg-interactive-hover`:``}`,onClick:function(){n(e),d(!1)}},o(e,r))})))},tS=function(e){var t=e.children,n=e.className;return k(`label`,{class:`text-fg-primary mb-2 block text-sm font-medium ${n===void 0?``:n}`},t)},nS=function(e){var t=e.children,n=e.className;return k(`span`,{class:`text-fg-muted text-xs ${n===void 0?``:n}`},t)},rS=function(e){var t=e.children,n=e.className;return k(`section`,{class:`mb-6 ${n===void 0?``:n}`},t)},iS=function(e){var t=e.value,n=e.min,r=n===void 0?0:n,i=e.max,a=i===void 0?1:i,o=e.step,s=o===void 0?.1:o,c=e.onChange;return k(`input`,{type:`range`,class:`range-sm bg-border-subtle mb-2 h-1 w-full cursor-pointer appearance-none rounded-lg`,value:t,min:r,max:a,step:s,onInput:function(e){return c(parseFloat(e.target.value))}})},aS=function(e){var t=e.color,n=e.active,r=e.onSelect,i=function(e){return e===`transparent`||/^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*0\s*\)$/i.test(e)||/^#([0-9a-f]{8})$/i.test(e)&&e.slice(-2).toLowerCase()===`00`||/^#([0-9a-f]{4})$/i.test(e)&&e.slice(-1).toLowerCase()===`0`}(t)?{backgroundColor:`#fff`,backgroundImage:`linear-gradient(45deg, transparent 40%, red 40%, red 60%, transparent 60%)`,backgroundSize:`100% 100%`}:{backgroundColor:t};return k(`button`,{title:t,class:`border-border-strong h-5 w-5 rounded-full border ${n?`outline-accent outline outline-2 outline-offset-2`:``}`,style:i,onClick:function(){return r(t)}})},oS=[{id:un.SOLID},{id:un.DASHED,dash:[6,2]},{id:un.DASHED,dash:[8,4]},{id:un.DASHED,dash:[3,3]},{id:un.DASHED,dash:[1,2]},{id:un.DASHED,dash:[4,2,1,2]},{id:un.DASHED,dash:[8,4,1,4]},{id:un.SOLID,cloudyIntensity:1},{id:un.SOLID,cloudyIntensity:2}],sS=function(e){if(e.cloudyIntensity){for(var t=e.cloudyIntensity===1?3:5,n=Math.ceil(80/(2*t)),r=80/n,i=t+1,a=2*t+2,o=[`M 0 ${i}`],s=0;s<n;s++)o.push(`A ${t} ${t} 0 0 1 ${r*(s+1)} ${i}`);return k(`svg`,{width:`80`,height:a,viewBox:`0 0 80 ${a}`},k(`path`,{d:o.join(` `),fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linejoin":`round`,"stroke-linecap":`round`}))}return k(`svg`,{width:`80`,height:`8`,viewBox:`0 0 80 8`},k(`line`,{x1:`0`,y1:`4`,x2:`80`,y2:`4`,style:{strokeDasharray:e.dash?.join(` `),stroke:`currentColor`,strokeWidth:`2`}}))};function cS(e){return e.cloudyIntensity?`cloudy-${e.cloudyIntensity}`:e.id+(e.dash?.join(`-`)||``)}var lS,uS=function(e){var t=e.value,n=e.onChange;return k(eS,{value:t,onChange:n,options:e.showCloudy?oS:oS.filter(function(e){return!e.cloudyIntensity}),getOptionKey:cS,renderValue:function(e){return sS(e)},renderOption:function(e){return k(`div`,{class:`px-1 py-2`},sS(e))}})},dS=[B.None,B.Square,B.Circle,B.Diamond,B.OpenArrow,B.ClosedArrow,B.ROpenArrow,B.RClosedArrow,B.Butt,B.Slash],fS=function(e){var t=e.ending,n=e.position,r=d(d(d(d(d(d(d(d(d({},B.Square,k(`path`,{d:`M68 -4 L76 -4 L76 4 L68 4 Z`})),B.Circle,k(`circle`,{cx:`72`,cy:`0`,r:`4`})),B.Diamond,k(`path`,{d:`M72 -5 L77 0 L72 5 L67 0 Z`})),B.OpenArrow,k(`path`,{d:`M67 -5 L77 0 L67 5`,fill:`none`})),B.ClosedArrow,k(`path`,{d:`M67 -5 L77 0 L67 5 Z`})),B.ROpenArrow,k(`path`,{d:`M77 -5 L67 0 L77 5`,fill:`none`})),B.RClosedArrow,k(`path`,{d:`M77 -5 L67 0 L77 5 Z`})),B.Butt,k(`path`,{d:`M72 -5 L72 5`,fill:`none`})),B.Slash,k(`path`,{d:`M67 -5 L77 5`,fill:`none`})),i=d(d(d(d(d(d(d(d(d({},B.Square,68),B.Circle,68),B.Diamond,67),B.OpenArrow,76),B.ClosedArrow,67),B.ROpenArrow,67),B.RClosedArrow,67),B.Butt,72),B.Slash,72),a=r[t];return k(`svg`,{width:`80`,height:`20`,viewBox:`0 0 80 20`,class:`text-fg-primary`},k(`g`,{transform:n===`start`?`rotate(180 40 10)`:``},k(`line`,{x1:`4`,y1:`10`,x2:i[t]??77,y2:`10`,stroke:`currentColor`,"stroke-width":`1.5`}),a&&k(`g`,{transform:`translate(0, 10)`,fill:`currentColor`,stroke:`currentColor`,"stroke-width":`1.5`},a)))},pS=function(e){var t=e.position;return k(eS,g(g({},_(e,Qx)),{},{options:dS,getOptionKey:function(e){return e},triggerClass:`px-3 py-1`,renderValue:function(e){return k(fS,{ending:e,position:t})},renderOption:function(e){return k(`div`,{class:`px-1 py-1`},k(fS,{ending:e,position:t}))}}))},mS=function(e){return k(eS,g(g({},e),{},{options:Kn,getOptionKey:function(e){return e},triggerClass:`px-2 py-1 text-sm`,renderValue:function(e){return k(`span`,null,qn(e))},renderOption:function(e){return k(`div`,{class:`px-2 py-1`},qn(e))}}))},hS=function(e){var t=e.value,n=e.onChange,r=(t%360+360)%360,i=function(e){n(((r+e)%360+360)%360)};return k(`div`,{class:`flex items-center gap-1`},k(`button`,{type:`button`,title:`-90°`,class:`border-border-default bg-bg-input text-fg-primary hover:bg-interactive-hover flex h-8 w-8 shrink-0 items-center justify-center rounded border`,onClick:function(){return i(-90)}},k(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},k(`path`,{d:`M1 4v6h6`}),k(`path`,{d:`M3.51 15a9 9 0 1 0 2.13-9.36L1 10`}))),k(`div`,{class:`relative flex-1`},k(`input`,{type:`number`,min:`0`,max:`359`,class:`border-border-default bg-bg-input text-fg-primary h-8 w-full rounded border px-2 pr-6 text-center text-sm`,value:r,onInput:function(e){var t=parseInt(e.target.value,10);Number.isFinite(t)&&n((t%360+360)%360)}}),k(`span`,{class:`text-fg-muted pointer-events-none absolute inset-y-0 right-2 flex items-center text-xs`},`°`)),k(`button`,{type:`button`,title:`+90°`,class:`border-border-default bg-bg-input text-fg-primary hover:bg-interactive-hover flex h-8 w-8 shrink-0 items-center justify-center rounded border`,onClick:function(){return i(90)}},k(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},k(`path`,{d:`M23 4v6h-6`}),k(`path`,{d:`M20.49 15a9 9 0 1 1-2.12-9.36L23 10`}))))},gS=function(e){var t=e.value,n=e.onChange,r=e.options,i=r===void 0?[8,9,10,11,12,14,16,18,24,36,48,72]:r,a=$x(),o=a.open,s=a.setOpen,c=a.rootRef,l=a.selectedItemRef;return k(`div`,{ref:c,class:`relative w-full`},k(`input`,{type:`number`,min:`1`,class:`border-border-default bg-bg-input w-full rounded border px-2 py-1 pr-7 text-sm`,value:t,onInput:function(e){var t=parseInt(e.target.value,10);Number.isFinite(t)&&t>0&&n(t)},onClick:function(){return s(!0)}}),k(`button`,{type:`button`,class:`absolute inset-y-0 right-1 flex items-center`,onClick:function(){return s(function(e){return!e})},tabIndex:-1},k(`svg`,{class:`text-fg-secondary h-4 w-4`,viewBox:`0 0 20 20`,fill:`currentColor`},k(`path`,{"fill-rule":`evenodd`,d:`M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z`,"clip-rule":`evenodd`}))),o&&k(`div`,{class:`border-border-default bg-bg-elevated absolute z-10 mt-1 max-h-48 w-full overflow-y-auto rounded border shadow-lg`},i.map(function(e){var r=e===t;return k(`button`,{ref:r?l:null,key:e,class:`hover:bg-interactive-hover block w-full px-2 py-1 text-left text-sm ${r?`bg-interactive-hover`:``}`,onClick:function(){n(e),s(!1)}},e)})))};function _S(e){var t=e.active,n=t!==void 0&&t,r=e.disabled,i=r!==void 0&&r,a=e.onClick,o=e.title,s=e.children,c=e.className;return k(`button`,{type:`button`,title:o,disabled:i,onClick:a,className:`h-9 w-9 rounded border px-2 py-1 text-sm transition-colors ${n?`border-accent bg-accent text-fg-on-accent`:`border-border-default bg-bg-input text-fg-primary hover:bg-interactive-hover`} disabled:cursor-not-allowed disabled:opacity-40 ${c===void 0?``:c}`},s)}function vS(e){switch(e.config.type){case`color`:return I(yS,g(g({},e),{},{allowTransparent:!1}));case`colorWithTransparent`:return I(yS,g(g({},e),{},{allowTransparent:!0}));case`opacity`:return I(bS,g({},e));case`slider`:return I(xS,g({},e));case`strokeStyle`:return I(SS,g({},e));case`lineEndings`:return I(CS,g({},e));case`fontFamily`:return I(wS,g({},e));case`fontSize`:return I(TS,g({},e));case`fontColor`:return I(ES,g({},e));case`textAlign`:return I(DS,g({},e));case`verticalAlign`:return I(OS,g({},e));case`blendMode`:return I(AS,g({},e));case`text`:return I(jS,g({},e));case`rotation`:return I(MS,g({},e));default:return null}}function yS(e){var t=e.config,n=e.value,r=e.onChange,i=e.colorPresets,a=e.translate,o=e.allowTransparent,s=x(j(n??`#000000`),2),c=s[0],l=s[1];M(function(){return l(n??`#000000`)},[n]);var u=function(e){l(e),r(e)};return I(rS,{children:[I(tS,{className:`mb-3`,children:a(t.labelKey)}),I(`div`,{class:`grid grid-cols-6 gap-x-1 gap-y-4`,children:[i.map(function(e){return I(aS,{color:e,active:e.toLowerCase()===c?.toLowerCase(),onSelect:u},e)}),o&&I(aS,{color:`transparent`,active:c===`transparent`,onSelect:u})]})]})}function bS(e){var t=e.config,n=e.value,r=e.onChange,i=e.translate,a=x(j(n??1),2),o=a[0],s=a[1];M(function(){return s(n??1)},[n]);var c=wx(o,300);return M(function(){c!==n&&r(c)},[c]),I(rS,{children:[I(tS,{children:i(t.labelKey)}),I(iS,{value:o,min:t.min??.1,max:t.max??1,step:t.step??.05,onChange:s}),I(nS,{children:[Math.round(100*o),`%`]})]})}function xS(e){var t=e.config,n=e.value,r=e.onChange,i=e.translate,a=x(j(n??t.min??1),2),o=a[0],s=a[1];M(function(){return s(n??t.min??1)},[n]);var c=wx(o,300);return M(function(){c!==n&&r(c)},[c]),I(rS,{children:[I(tS,{children:i(t.labelKey)}),I(iS,{value:o,min:t.min??1,max:t.max??30,step:t.step??1,onChange:s}),I(nS,{children:[o,t.unit??``]})]})}function SS(e){var t=e.config,n=e.value,r=e.onChange,i=e.translate,a=x(j(w(n)===`object`&&n!==null?n:{id:n??un.SOLID}),2),o=a[0],s=a[1];return M(function(){s(w(n)===`object`&&n!==null?n:{id:n??un.SOLID})},[n]),I(rS,{children:[I(tS,{className:`mb-3`,children:i(t.labelKey)}),I(uS,{value:o,onChange:function(e){s(e),r({strokeStyle:e.id,strokeDashArray:e.dash,cloudyBorderIntensity:e.cloudyIntensity??0})},showCloudy:t.showCloudy})]})}function CS(e){e.config;var t=e.value,n=e.onChange,r=e.translate,i=t??{start:B.None,end:B.None},a=x(j(i.start),2),o=a[0],s=a[1],c=x(j(i.end),2),l=c[0],u=c[1];return M(function(){s(i.start),u(i.end)},[t]),I(rS,{children:I(`div`,{class:`grid grid-cols-2 gap-4`,children:[I(`div`,{children:[I(tS,{className:`mb-3`,children:r(`annotation.lineStart`)}),I(pS,{value:o,onChange:function(e){s(e),n({start:e,end:l})},position:`start`})]}),I(`div`,{children:[I(tS,{className:`mb-3`,children:r(`annotation.lineEnd`)}),I(pS,{value:l,onChange:function(e){u(e),n({start:o,end:e})},position:`end`})]})]})})}function wS(e){var t=e.config,n=e.value,r=e.onChange,i=e.translate,a=n??Xt.Helvetica,o=Vn(a),s=Hn(a),c=Un(a),l=x(j(o),2),u=l[0],d=l[1],f=x(j(s),2),p=f[0],m=f[1],h=x(j(c),2),g=h[0],_=h[1];M(function(){var e=n??Xt.Helvetica;d(Vn(e)),m(Hn(e)),_(Un(e))},[n]);var v=function(e,t,n){r(Wn(e,{bold:t,italic:n}))};return I(rS,{children:[I(tS,{children:i(t.labelKey)}),I(`div`,{class:`mb-3`,children:I(mS,{value:u,onChange:function(e){var t=Hn(Wn(e,{bold:!0,italic:!1})),n=Un(Wn(e,{bold:!1,italic:!0})),r=!!t&&p,i=!!n&&g;d(e),m(r),_(i),v(e,r,i)}})}),I(`div`,{class:`flex gap-2`,children:[I(_S,{title:`Bold`,active:p,disabled:!Hn(Wn(u,{bold:!0,italic:!1})),onClick:function(){if(Hn(Wn(u,{bold:!0,italic:!1}))){var e=!p;m(e),v(u,e,g)}},className:`font-bold`,children:I(Q,{icon:`bold`,size:18})}),I(_S,{title:`Italic`,active:g,disabled:!Un(Wn(u,{bold:!1,italic:!0})),onClick:function(){if(Un(Wn(u,{bold:!1,italic:!0}))){var e=!g;_(e),v(u,p,e)}},className:`italic`,children:I(Q,{icon:`italic`,size:18})})]})]})}function TS(e){var t=e.config,n=e.value,r=e.onChange,i=e.translate,a=x(j(n??12),2),o=a[0],s=a[1];return M(function(){return s(n??12)},[n]),I(rS,{children:[I(tS,{children:i(t.labelKey)}),I(gS,{value:o,onChange:function(e){!Number.isFinite(e)||e<=0||(s(e),r(e))}})]})}function ES(e){var t=e.config,n=e.value,r=e.onChange,i=e.colorPresets,a=e.translate,o=x(j(n??`#000000`),2),s=o[0],c=o[1];M(function(){return c(n??`#000000`)},[n]);var l=function(e){c(e),r(e)};return I(rS,{children:[I(tS,{className:`mb-3`,children:a(t.labelKey)}),I(`div`,{class:`grid grid-cols-6 gap-x-1 gap-y-4`,children:i.map(function(e){return I(aS,{color:e,active:e.toLowerCase()===s?.toLowerCase(),onSelect:l},e)})})]})}function DS(e){var t=e.config,n=e.value,r=e.onChange,i=e.translate,a=x(j(n??Zt.Left),2),o=a[0],s=a[1];M(function(){return s(n??Zt.Left)},[n]);var c=function(e){s(e),r(e)};return I(rS,{children:[I(tS,{children:i(t.labelKey)}),I(`div`,{class:`flex gap-2`,children:[I(_S,{title:`Align left`,active:o===Zt.Left,onClick:function(){return c(Zt.Left)},children:I(Q,{icon:`alignLeft`,size:18})}),I(_S,{title:`Align center`,active:o===Zt.Center,onClick:function(){return c(Zt.Center)},children:I(Q,{icon:`alignCenter`,size:18})}),I(_S,{title:`Align right`,active:o===Zt.Right,onClick:function(){return c(Zt.Right)},children:I(Q,{icon:`alignRight`,size:18})})]})]})}function OS(e){var t=e.config,n=e.value,r=e.onChange,i=e.translate,a=x(j(n??Qt.Top),2),o=a[0],s=a[1];M(function(){return s(n??Qt.Top)},[n]);var c=function(e){s(e),r(e)};return I(rS,{children:[I(tS,{children:i(t.labelKey)}),I(`div`,{class:`flex gap-2`,children:[I(_S,{title:`Align top`,active:o===Qt.Top,onClick:function(){return c(Qt.Top)},children:I(Q,{icon:`alignTop`,size:18})}),I(_S,{title:`Align middle`,active:o===Qt.Middle,onClick:function(){return c(Qt.Middle)},children:I(Q,{icon:`alignMiddle`,size:18})}),I(_S,{title:`Align bottom`,active:o===Qt.Bottom,onClick:function(){return c(Qt.Bottom)},children:I(Q,{icon:`alignBottom`,size:18})})]})]})}var kS=(d(d(d(d(d(d(d(d(d(d(lS={},R.Normal,`blendMode.normal`),R.Multiply,`blendMode.multiply`),R.Screen,`blendMode.screen`),R.Overlay,`blendMode.overlay`),R.Darken,`blendMode.darken`),R.Lighten,`blendMode.lighten`),R.ColorDodge,`blendMode.colorDodge`),R.ColorBurn,`blendMode.colorBurn`),R.HardLight,`blendMode.hardLight`),R.SoftLight,`blendMode.softLight`),d(d(d(d(d(d(lS,R.Difference,`blendMode.difference`),R.Exclusion,`blendMode.exclusion`),R.Hue,`blendMode.hue`),R.Saturation,`blendMode.saturation`),R.Color,`blendMode.color`),R.Luminosity,`blendMode.luminosity`));function AS(e){var t=e.config,n=e.value,r=e.onChange,i=e.translate,a=x(j(n??R.Normal),2),o=a[0],s=a[1];return M(function(){return s(n??R.Normal)},[n]),I(rS,{children:[I(tS,{children:i(t.labelKey)}),I(`select`,{class:`border-border-default bg-bg-input text-fg-primary w-full rounded border px-2 py-1 text-sm`,value:o,onChange:function(e){var t=parseInt(e.target.value,10);s(t),r(t)},children:Zn.map(function(e){return I(`option`,{value:e,children:i(kS[e])},e)})})]})}function jS(e){var t=e.config,n=e.value,r=e.onChange,i=e.translate,a=x(j(n??``),2),o=a[0],s=a[1];M(function(){return s(n??``)},[n]);var c=wx(o,300);return M(function(){c!==n&&r(c)},[c]),I(rS,{children:[I(tS,{children:i(t.labelKey)}),I(`input`,{type:`text`,class:`border-border-default bg-bg-input text-fg-primary w-full rounded border px-2 py-1 text-sm`,value:o,onInput:function(e){var t=e.target.value;s(t)},placeholder:t.placeholderKey?i(t.placeholderKey):void 0})]})}function MS(e){var t=e.config,n=e.value,r=e.onChange,i=e.translate,a=x(j(n??0),2),o=a[0],s=a[1];M(function(){return s(n??0)},[n]);var c=wx(o,300);return M(function(){c!==(n??0)&&r(c)},[c]),I(rS,{children:[I(tS,{children:i(t.labelKey)}),I(hS,{value:o,onChange:s})]})}function NS(e){var t=e.documentId,n=e.annotations,r=e.activeTool,i=e.colorPresets,a=Kp().provides,o=os(t).translate;if(!a)return null;var s=n.length>0,c=s?n.map(function(e){return a.findToolForAnnotation(e.object)?.id}).filter(function(e){return e!==void 0}):r?[r.id]:[];if(c.length===0)return null;var l=function(e){if(e.length===0)return[];for(var t=S(new Set(e)),n=t.map(function(e){return new Set(Zx[e]??[])}),r=n[0],i=1;i<n.length;i++){var a,o=u(r);try{for(o.s();!(a=o.n()).done;){var s=a.value;n[i].has(s)||r.delete(s)}}catch(e){o.e(e)}finally{o.f()}}return(Zx[t[0]]??[]).filter(function(e){return r.has(e)})}(c),f=s?l:l.filter(function(e){var t;return!((t=Xx[e])!=null&&t.editOnly)});if(f.length===0)return null;var p=s?n[0].object:r?.defaults,m=function(e){a&&(s?a.updateAnnotations(n.map(function(t){return{pageIndex:t.object.pageIndex,id:t.object.id,patch:e}})):r&&a.setToolDefaults(r.id,e))},h=function(e){if(p){var t=Xx[e];if(t){if(t.type===`strokeStyle`){var n=p;return g({id:n.strokeStyle,dash:n.strokeDashArray},t.showCloudy&&{cloudyIntensity:n.cloudyBorderIntensity})}return p[t.key]}}};return k(A,null,f.map(function(e){var t=Xx[e];return t?k(vS,{key:e,config:t,value:h(e),onChange:function(t){return function(e,t){var n=Xx[e];if(n){if(n.type!==`strokeStyle`||w(t)!==`object`)n.type===`lineEndings`?m({lineEndings:t}):m(d({},n.key,t));else{var r={strokeStyle:t.strokeStyle,strokeDashArray:t.strokeDashArray};n.showCloudy&&(r.cloudyBorderIntensity=t.cloudyBorderIntensity??0),m(r)}}}(e,t)},colorPresets:i,translate:o}):null}))}function PS(e){var t=e.documentId,n=Kp().provides,r=qp(t),i=r.provides,a=r.state,o=os(t).translate;if(!n||!i)return null;var s=n?.getColorPresets()??[],c=Au(a),l=i.getActiveTool(),u=c.length>0,d=c.length>1,f=u?i.findToolForAnnotation(c[0].object):l,p=o(f?.labelKey??``,{fallback:f?.name??``}),m=``;d?m=o(`annotation.multiSelect`,{params:{count:String(c.length)}}):u&&f?m=o(`annotation.styles`,{params:{type:p}}):l&&(m=o(`annotation.defaults`,{params:{type:p}}));var h=f?.id;return h!==void 0&&(Zx[h]?.length??0)>0||u||l?I(`div`,{class:`h-full overflow-y-auto p-4`,children:[m&&I(`h2`,{class:`text-md mb-4 font-medium`,children:m}),I(NS,{documentId:t,annotations:c,activeTool:l,colorPresets:s})]}):I(Yx,{documentId:t})}var FS=function(e){var t=e.item,n=e.pageNumber,r=e.isSelected,i=e.onSelect,a=t.kind===`text`?vy:yy;return k(`div`,{onClick:i,class:`border-border-subtle hover:bg-interactive-hover flex cursor-pointer items-start gap-3 rounded-lg border p-3 transition-colors ${r?`bg-interactive-selected ring-accent ring-1`:``}`},k(`div`,{class:`flex-shrink-0`},k(a,{size:20,primaryColor:t.markColor,secondaryColor:t.redactionColor})),k(`div`,{class:`min-w-0 flex-1`},k(`div`,{class:`text-fg-muted text-xs`},`Page `,n),k(`div`,{class:`text-fg-primary text-sm font-medium`},t.kind===`text`?`Text Redaction`:`Area Redaction`),t.kind===`text`&&t.text&&k(`div`,{class:`text-fg-muted mt-1 truncate text-xs italic`},`"`,t.text,`"`)))},IS=function(e){var t=e.documentId,n=os(t).translate;return k(`div`,{class:`text-fg-muted flex flex-col items-center gap-2 p-4`},k(Q,{icon:`redact`,className:`h-18 w-18 text-fg-muted`}),k(`div`,{className:`text-fg-muted max-w-[150px] text-center text-sm`},n(`redaction.emptyState`,{fallback:`No pending redactions`})))};function LS(e){var t=e.documentId,n=(e=>{let{provides:t}=rg(),[n,r]=j(Gh),i=P(()=>t?t.forDocument(e):null,[t,e]);return M(()=>{if(i){try{r(i.getState())}catch{r(Gh)}return i.onStateChange(e=>{r(e)})}r(Gh)},[i]),{state:n,provides:i}})(t),r=n.state,i=n.provides,a=si(t),o=a.canModifyAnnotations,s=a.canModifyContents,c=Ki().provides,l=os(t).translate,u=Object.entries(r.pending).flatMap(function(e){var t=x(e,2),n=t[0];return t[1].map(function(e){return{item:e,pageNumber:Number(n)+1}})}).sort(function(e,t){return e.pageNumber-t.pageNumber});return k(`div`,{class:`flex h-full flex-col`},k(`div`,{class:`border-border-subtle border-b p-3`},k(`h2`,{class:`text-fg-primary text-md font-semibold`},l(`redaction.panel.title`,{fallback:`Redactions`})),u.length>0&&k(`p`,{class:`text-fg-muted text-sm`},u.length===1?l(`redaction.panel.itemCount`,{fallback:`1 pending redaction`,params:{count:1}}):l(`redaction.panel.itemCountPlural`,{fallback:`${u.length} pending redactions`,params:{count:u.length}}))),k(`div`,{class:`flex-1 overflow-y-auto p-3`},u.length===0?k(IS,{documentId:t}):k(`div`,{class:`space-y-2`},u.map(function(e){var t=e.item,n=e.pageNumber;return k(FS,{key:t.id,item:t,pageNumber:n,onSelect:function(){return function(e){i?.selectPending(e.page,e.id),c?.scrollToPage({pageNumber:e.page+1,pageCoordinates:{x:e.rect.origin.x,y:e.rect.origin.y},alignX:50,alignY:25,behavior:`smooth`})}(t)},isSelected:r.selected?.id===t.id})}))),u.length>0&&k(`div`,{class:`border-border-subtle flex gap-2 border-t p-3`},k(Oy,{onClick:function(){i?.clearPending()},disabled:!o,className:`border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover flex-1 rounded-md border px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},l(`redaction.panel.clearAll`,{fallback:`Clear All`})),k(Oy,{onClick:function(){i?.commitAllPending()},disabled:!s,className:`bg-accent text-fg-on-accent hover:!bg-accent-hover flex-1 rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},l(`redaction.panel.redactAll`,{fallback:`Redact All`}))))}var RS=d(d(d(d(d({},V.TEXTFIELD,`form.textfield`),V.CHECKBOX,`form.checkbox`),V.RADIOBUTTON,`form.radiobutton`),V.COMBOBOX,`form.combobox`),V.LISTBOX,`form.listbox`),zS=d(d(d(d(d({},V.TEXTFIELD,`Text Field`),V.CHECKBOX,`Checkbox`),V.RADIOBUTTON,`Radio Button`),V.COMBOBOX,`Dropdown`),V.LISTBOX,`List Box`),BS=`border-border-default bg-bg-input text-fg-primary w-full rounded border px-2 py-1.5 text-sm`,VS=function(e){var t=e.documentId,n=qp(t),r=n.provides,i=n.state,a=zg().provides,o=os(t).translate,s=x(j(null),2),c=s[0],l=s[1];if(!r||!a)return null;var u=Au(i);if(u.length!==1)return null;var d=u[0].object;if(d.type!==z.WIDGET)return null;var f=d,p=o(RS[f.field.type]??``,{fallback:zS[f.field.type]??`Widget`}),m=o(`annotation.styles`,{params:{type:p}}),h=F(function(e){r.updateAnnotations([{pageIndex:f.pageIndex,id:f.id,patch:e}])},[r,f.pageIndex,f.id]),_=F(function(e){h({field:g(g({},f.field),e)})},[h,f.field]),v=F(function(e,n){a.renameField(f.id,e,t).wait(function(e){var r;l(null),e.outcome===`conflict`&&((r=globalThis.confirm?.call(globalThis,`Share this ${p} with the existing field "${e.fieldName}"?`))!=null&&r?a.shareField(f.id,e.targetAnnotationId,t).wait(function(){return l(null)},function(e){l(e.reason.message),n.value=f.field.name}):n.value=f.field.name)},function(e){l(e.reason.message),n.value=f.field.name})},[t,p,a,f.field.name,f.id]);return I(`div`,{class:`h-full overflow-y-auto p-4`,children:[I(`h2`,{class:`text-fg-secondary text-md mb-4 font-medium`,children:m}),f.field.type===V.TEXTFIELD&&I(US,{field:f.field,updateField:_,renameField:v,fieldNameError:c,translate:o}),f.field.type===V.RADIOBUTTON&&I(GS,{field:f.field,updateField:_,renameField:v,fieldNameError:c,translate:o}),f.field.type===V.CHECKBOX&&I(WS,{field:f.field,updateField:_,renameField:v,fieldNameError:c,translate:o}),(f.field.type===V.COMBOBOX||f.field.type===V.LISTBOX)&&I(KS,{field:f.field,updateField:_,renameField:v,fieldNameError:c,translate:o})]})};function HS(e,t){return F(function(n,r){var i=e.flag??H.NONE;t({flag:r?i|n:i&~n})},[e.flag,t])}function US(e){var t=e.field,n=e.updateField,r=e.renameField,i=e.fieldNameError,a=e.translate,o=HS(t,n),s=t.maxLen??0,c=!!(t.flag&H.TEXT_COMB);return I(`div`,{class:`space-y-4`,children:[I(`div`,{children:[I(`label`,{class:`text-fg-secondary mb-1 block text-xs font-medium`,children:[a(`form.fieldName`,{fallback:`Field Name`}),`*:`]}),I(`input`,{type:`text`,class:BS,value:t.name,onBlur:function(e){return r(e.target.value,e.target)},onKeyDown:function(e){e.key===`Enter`&&e.target.blur()}}),i&&I(`p`,{class:`mt-1 text-xs text-red-600`,children:i})]}),I(`div`,{children:[I(`label`,{class:`text-fg-secondary mb-1 block text-xs font-medium`,children:[a(`form.defaultValue`,{fallback:`Default Value`}),`:`]}),I(`input`,{type:`text`,class:BS,value:t.value??``,maxLength:s>0?s:void 0,onBlur:function(e){return n({value:e.target.value})},onKeyDown:function(e){e.key===`Enter`&&e.target.blur()}})]}),I(`div`,{children:[I(`label`,{class:`text-fg-secondary mb-1 block text-xs font-medium`,children:[a(`form.maxLength`,{fallback:`Max Length`}),`:`]}),I(`input`,{type:`number`,min:`0`,class:BS,value:s||``,placeholder:`0 (unlimited)`,onBlur:function(e){var t=parseInt(e.target.value,10),r=isNaN(t)||t<=0?void 0:t;n({maxLen:r}),!r&&c&&o(H.TEXT_COMB,!1)},onKeyDown:function(e){e.key===`Enter`&&e.target.blur()}})]}),I(`hr`,{class:`border-border-default`}),I(`div`,{children:[I(`h3`,{class:`text-fg-primary mb-3 text-sm font-medium`,children:a(`form.properties`,{fallback:`Properties`})}),I(`div`,{class:`flex flex-col gap-3`,children:[I(Tx,{label:a(`form.readOnly`,{fallback:`Read Only`}),checked:!!(t.flag&H.READONLY),onChange:function(e){return o(H.READONLY,e)}}),I(Tx,{label:a(`form.required`,{fallback:`Required`}),checked:!!(t.flag&H.REQUIRED),onChange:function(e){return o(H.REQUIRED,e)}}),I(Tx,{label:a(`form.multiline`,{fallback:`Multiline`}),checked:!!(t.flag&H.TEXT_MULTIPLINE),onChange:function(e){return o(H.TEXT_MULTIPLINE,e)}}),I(Tx,{label:a(`form.comb`,{fallback:`Comb`}),checked:c,disabled:s<=0,onChange:function(e){return o(H.TEXT_COMB,e)}})]})]})]})}function WS(e){var t=e.field,n=e.updateField,r=e.renameField,i=e.fieldNameError,a=e.translate,o=HS(t,n);return I(`div`,{class:`space-y-4`,children:[I(`div`,{children:[I(`label`,{class:`text-fg-secondary mb-1 block text-xs font-medium`,children:[a(`form.fieldName`,{fallback:`Field Name`}),`*:`]}),I(`input`,{type:`text`,class:BS,value:t.name,onBlur:function(e){return r(e.target.value,e.target)},onKeyDown:function(e){e.key===`Enter`&&e.target.blur()}}),i&&I(`p`,{class:`mt-1 text-xs text-red-600`,children:i})]}),I(`hr`,{class:`border-border-default`}),I(`div`,{children:[I(`h3`,{class:`text-fg-primary mb-3 text-sm font-medium`,children:a(`form.properties`,{fallback:`Properties`})}),I(`div`,{class:`flex flex-col gap-3`,children:[I(Tx,{label:a(`form.readOnly`,{fallback:`Read Only`}),checked:!!(t.flag&H.READONLY),onChange:function(e){return o(H.READONLY,e)}}),I(Tx,{label:a(`form.required`,{fallback:`Required`}),checked:!!(t.flag&H.REQUIRED),onChange:function(e){return o(H.REQUIRED,e)}})]})]})]})}function GS(e){var t=e.field,n=e.updateField,r=e.renameField,i=e.fieldNameError,a=e.translate,o=HS(t,n);return I(`div`,{class:`space-y-4`,children:[I(`div`,{children:[I(`label`,{class:`text-fg-secondary mb-1 block text-xs font-medium`,children:[a(`form.fieldName`,{fallback:`Field Name`}),`*:`]}),I(`input`,{type:`text`,class:BS,value:t.name,onBlur:function(e){return r(e.target.value,e.target)},onKeyDown:function(e){e.key===`Enter`&&e.target.blur()}}),i&&I(`p`,{class:`mt-1 text-xs text-red-600`,children:i})]}),I(`hr`,{class:`border-border-default`}),I(`div`,{children:[I(`h3`,{class:`text-fg-primary mb-3 text-sm font-medium`,children:a(`form.properties`,{fallback:`Properties`})}),I(`div`,{class:`flex flex-col gap-3`,children:[I(Tx,{label:a(`form.readOnly`,{fallback:`Read Only`}),checked:!!(t.flag&H.READONLY),onChange:function(e){return o(H.READONLY,e)}}),I(Tx,{label:a(`form.required`,{fallback:`Required`}),checked:!!(t.flag&H.REQUIRED),onChange:function(e){return o(H.REQUIRED,e)}})]})]})]})}function KS(e){var t=e.field,n=e.updateField,r=e.renameField,i=e.fieldNameError,a=e.translate,o=HS(t,n),s=t.type===V.COMBOBOX||t.type===V.LISTBOX?t.options:[],c=F(function(e){n({options:e})},[n]);return I(`div`,{class:`space-y-4`,children:[I(`div`,{children:[I(`label`,{class:`text-fg-secondary mb-1 block text-xs font-medium`,children:[a(`form.fieldName`,{fallback:`Field Name`}),`*:`]}),I(`input`,{type:`text`,class:BS,value:t.name,onBlur:function(e){return r(e.target.value,e.target)},onKeyDown:function(e){e.key===`Enter`&&e.target.blur()}}),i&&I(`p`,{class:`mt-1 text-xs text-red-600`,children:i})]}),I(`hr`,{class:`border-border-default`}),I(`div`,{children:[I(`h3`,{class:`text-fg-primary mb-3 text-sm font-medium`,children:a(`form.options`,{fallback:`Options`})}),I(`div`,{class:`flex flex-col gap-2`,children:[s.map(function(e,t){return I(`div`,{class:`flex items-center gap-2`,children:[I(`input`,{type:`text`,class:BS+` flex-1`,value:e.label,onBlur:function(n){var r=n.target.value;r!==e.label&&c(s.map(function(e,n){return n===t?g(g({},e),{},{label:r}):e}))},onKeyDown:function(e){e.key===`Enter`&&e.target.blur()}}),I(`button`,{type:`button`,class:`text-fg-secondary hover:text-fg-primary shrink-0 text-sm`,onClick:function(){c(s.filter(function(e,n){return n!==t}))},title:a(`form.removeOption`,{fallback:`Remove`}),children:`✕`})]},t)}),I(`button`,{type:`button`,class:`text-accent-primary hover:text-accent-primary-hover mt-1 text-left text-sm`,onClick:function(){c([].concat(S(s),[{label:`Option ${s.length+1}`,isSelected:!1}]))},children:[`+ `,a(`form.addOption`,{fallback:`Add Option`})]})]})]}),I(`hr`,{class:`border-border-default`}),I(`div`,{children:[I(`h3`,{class:`text-fg-primary mb-3 text-sm font-medium`,children:a(`form.properties`,{fallback:`Properties`})}),I(`div`,{class:`flex flex-col gap-3`,children:[I(Tx,{label:a(`form.readOnly`,{fallback:`Read Only`}),checked:!!(t.flag&H.READONLY),onChange:function(e){return o(H.READONLY,e)}}),I(Tx,{label:a(`form.required`,{fallback:`Required`}),checked:!!(t.flag&H.REQUIRED),onChange:function(e){return o(H.REQUIRED,e)}}),t.type===V.LISTBOX&&I(Tx,{label:a(`form.multiSelect`,{fallback:`Multi Select`}),checked:!!(t.flag&H.CHOICE_MULTL_SELECT),onChange:function(e){return o(H.CHOICE_MULTL_SELECT,e)}})]})]})]})}function qS(e){var t=e.documentId,n=e.selectedLibraryId,r=os(t).translate,i=x_().provides,a=(()=>{let{provides:e}=x_(),[t,n]=j(e?.getLibraries()??[]);return M(()=>{if(e)return n(e.getLibraries()),e.onLibraryChange(e=>{n(e)})},[e]),{libraries:t,provides:e}})().libraries,o=x(j(`all`),2),s=o[0],c=o[1],l=((e,t)=>{let{provides:n}=x_(),[r,i]=j([]);return M(()=>{if(!n)return;let r=()=>{let r=n.getLibraries(),a=[];for(let n of r)if(!e||e===`all`||n.id===e)for(let e of n.stamps){{let r=n.categories?.includes(t)??!1,i=e.categories?.includes(t)??!1;if(!r&&!i)continue}a.push({library:n,stamp:e})}i(a)};return r(),n.onLibraryChange(r)},[n,e,t]),r})(s,`sidebar`),d=(e=>{let{provides:t}=x_(),[n,r]=j(null);return M(()=>{if(!t)return;let n=t.forDocument(e);return r(n.getActiveStamp()),n.onActiveStampChange(r)},[t,e]),n})(t);M(function(){n&&c(n)},[n]);var f=F(function(e,n){i&&i.forDocument(t).activateStampPlacement(e,n)},[i,t]),p=F(function(e,t,n){e.stopPropagation(),i&&i.removeStampFromLibrary(t,n).wait(function(){},nr)},[i]);return F(function(){if(i){var e,t=u(S(new Set(l.map(function(e){return e.library.id}))));try{for(t.s();!(e=t.n()).done;){var n=e.value;i.exportLibrary(n).wait(function(e){var t=new Blob([e.pdf],{type:`application/pdf`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${e.name}.pdf`,r.click(),URL.revokeObjectURL(n)},nr)}}catch(e){t.e(e)}finally{t.f()}}},[i,l]),k(`div`,{class:`flex h-full flex-col`},k(`div`,{class:`border-border-subtle border-b p-4`},k(`div`,{class:`flex items-center justify-between`},k(`h2`,{class:`text-fg-primary text-md font-medium`},r(`stamp.title`,{fallback:`Rubber Stamps`}))),a.length>1&&k(`select`,{class:`border-border-default bg-bg-input focus:border-accent focus:ring-accent text-fg-primary mt-4 w-full rounded-md border px-3 py-1.5 text-sm focus:outline-none focus:ring-1`,value:s,onChange:function(e){return c(e.target.value)}},k(`option`,{value:`all`},r(`stamp.allStamps`,{fallback:`All Stamps`})),a.map(function(e){return k(`option`,{key:e.id,value:e.id},function(e){return r(e.nameKey??``,{fallback:e.name})}(e))}))),l.length>0?k(`div`,{class:`flex-1 overflow-y-auto p-4`},k(`div`,{class:`grid grid-cols-2 gap-3`},l.map(function(e){var t=e.library,n=e.stamp,r=d?.libraryId===t.id&&d?.stamp.id===n.id;return k(`div`,{key:`${t.id}-${n.id}`,class:`group relative flex cursor-pointer items-center justify-center overflow-hidden rounded-md border transition-colors ${r?`border-accent bg-accent-light ring-accent ring-2`:`border-border-subtle bg-bg-surface hover:bg-interactive-hover hover:border-border-default`}`,style:{aspectRatio:`1`},onClick:function(){return f(t.id,n)}},k(S_,{libraryId:t.id,pageIndex:n.pageIndex,width:120,style:{maxWidth:`80%`,maxHeight:`80%`,objectFit:`contain`}}),!t.readonly&&k(`button`,{class:`bg-bg-surface border-border-default text-fg-muted hover:text-fg-primary absolute right-1 top-1 flex rounded-full border p-0.5 opacity-0 shadow-sm transition-opacity group-hover:opacity-100`,onClick:function(e){return p(e,t.id,n.id)}},k(Q,{icon:`x`,className:`h-3 w-3`})))}))):k(`div`,{class:`text-fg-muted mt-8 flex flex-col items-center gap-2 p-4`},k(Q,{icon:`rubberStamp`,className:`h-18 w-18 text-fg-muted`}),k(`div`,{class:`text-fg-muted max-w-[150px] text-center text-sm`},r(`stamp.emptyState`,{fallback:`No stamps found in the selected library.`}))))}function JS(e){var t=e.documentId,n=os(t).translate,r=(()=>{let{provides:e}=q_(),[t,n]=j(e?.getEntries()??[]);return M(()=>{if(e)return n(e.getEntries()),e.onEntriesChange(e=>{n(e)})},[e]),{entries:t,provides:e}})(),i=r.entries,a=r.provides,o=(e=>{let{provides:t}=q_(),[n,r]=j(null);return M(()=>{if(!t)return;let n=t.forDocument(e);return r(n.getActivePlacement()),n.onActivePlacementChange(r)},[t,e]),n})(t),s=ei(`ui`).provides,c=(a?.mode??w_.SignatureOnly)===w_.SignatureAndInitials,l=F(function(){s&&s.forDocument(t).openModal(`signature-create-modal`)},[s,t]),u=F(function(e){a&&a.forDocument(t).activateSignaturePlacement(e)},[a,t]),d=F(function(e){a&&a.forDocument(t).activateInitialsPlacement(e)},[a,t]),f=F(function(e,t){e.stopPropagation(),a&&a.removeEntry(t)},[a]),p=function(e,t){return o?.entryId===e&&o?.kind===t};return k(`div`,{class:`flex h-full flex-col`},k(`div`,{class:`border-border-subtle border-b p-3`},k(`h2`,{class:`text-fg-primary text-md font-semibold`},n(`signature.title`,{fallback:`Signatures`})),k(`button`,{class:`bg-accent hover:bg-accent-hover text-fg-on-accent mt-3 w-full rounded-md px-3 py-2 text-sm font-medium transition-colors`,onClick:l},n(c?`signature.createNewWithInitials`:`signature.createNew`,{fallback:c?`Create Signature & Initials`:`Create New Signature`}))),i.length>0?k(`div`,{class:`flex-1 overflow-y-auto p-4`},k(`div`,{class:`flex flex-col gap-4`},i.map(function(e){return k(`div`,{key:e.id,class:`border-border-subtle bg-bg-surface hover:border-fg-muted/30 flex flex-col gap-2 rounded-lg border p-3 shadow-sm transition-all hover:shadow-md`},k(`div`,{class:`flex items-start justify-between`},k(`div`,{class:`flex flex-1 items-center gap-2 pl-0.5 pt-0.5`},k(`span`,{class:`text-fg-muted text-[10px] font-semibold uppercase tracking-widest`},n(`signature.placeSignature`,{fallback:`Signature`})),c&&e.initials&&k(`span`,{class:`text-border-default text-[10px]`},`•`),c&&e.initials&&k(`span`,{class:`text-fg-muted text-[10px] font-semibold uppercase tracking-widest`},n(`signature.placeInitials`,{fallback:`Initials`}))),k(`button`,{class:`text-fg-muted hover:text-fg-danger hover:bg-danger/10 -mr-1 -mt-1 flex rounded p-1.5 transition-colors`,onClick:function(t){return f(t,e.id)},title:n(`signature.remove`,{fallback:`Remove signature`})},k(Q,{icon:`trash`,className:`h-3.5 w-3.5`}))),k(`div`,{class:`flex gap-3`},k(`div`,{class:`flex h-16 cursor-pointer items-center justify-center rounded-md border border-dashed transition-all ${c&&e.initials?`flex-[2]`:`flex-1`} ${p(e.id,E_.Signature)?`border-accent bg-accent/5 ring-accent ring-2 ring-offset-1`:`border-border-default hover:border-fg-muted hover:bg-interactive-hover`}`,onClick:function(){return u(e.id)}},k(`img`,{src:e.signature.previewDataUrl,class:`h-12 max-w-[90%] object-contain`,alt:`Signature`})),c&&e.initials&&k(`div`,{class:`flex h-16 flex-1 cursor-pointer items-center justify-center rounded-md border border-dashed transition-all ${p(e.id,E_.Initials)?`border-accent bg-accent/5 ring-accent ring-2 ring-offset-1`:`border-border-default hover:border-fg-muted hover:bg-interactive-hover`}`,onClick:function(){return d(e.id)}},k(`img`,{src:e.initials.previewDataUrl,class:`h-10 max-w-[80%] object-contain`,alt:`Initials`}))))}))):k(`div`,{class:`text-fg-muted mt-8 flex flex-col items-center gap-2 p-4`},k(Q,{icon:`signature`,className:`h-18 w-18 text-fg-muted opacity-50`}),k(`div`,{class:`text-fg-muted max-w-[180px] text-center text-sm`},n(`signature.emptyState`,{fallback:`No signatures yet. Create one to get started.`}))))}function YS(e){var t=e.open,n=e.title,r=e.children,i=e.onClose,a=e.onExited,o=e.className,s=e.showCloseButton,c=s===void 0||s,l=N(null),u=x(j(t),2),d=u[0],f=u[1],p=x(j(!1),2),m=p[0],h=p[1];return M(function(){if(t)f(!0),requestAnimationFrame(function(){h(!0)});else if(d){h(!1);var e=setTimeout(function(){f(!1),a?.()},200);return function(){return clearTimeout(e)}}},[t,d,a]),M(function(){if(t){var e=function(e){e.key===`Escape`&&i?.()};return document.addEventListener(`keydown`,e),function(){return document.removeEventListener(`keydown`,e)}}},[t,i]),M(function(){return document.body.style.overflow=d?`hidden`:``,function(){document.body.style.overflow=``}},[d]),d?I(`div`,{ref:l,className:`fixed inset-0 z-50 transition-opacity duration-200 md:flex md:items-center md:justify-center ${m&&t?`bg-bg-overlay`:`bg-transparent`}`,onClick:function(e){e.target===l.current&&i?.()},children:I(`div`,{className:uy(`bg-bg-surface md:border-border-subtle relative flex h-full w-full flex-col transition-all duration-200 md:h-auto md:w-[28rem] md:max-w-[90vw] md:rounded-lg md:border md:shadow-lg`,m&&t?`scale-100 opacity-100`:`scale-95 opacity-0`,o),onClick:function(e){return e.stopPropagation()},children:[(n||c)&&I(`div`,{className:`border-border-subtle flex flex-shrink-0 items-center justify-between border-b px-6 py-4`,children:[n&&I(`h2`,{className:`text-fg-primary text-lg font-semibold`,children:n}),c&&I(Oy,{onClick:i,className:`hover:bg-interactive-hover p-1`,children:I(Q,{icon:`x`,className:`h-5 w-5`})})]}),I(`div`,{className:`flex-1 overflow-y-auto px-6 py-4 md:max-h-[80vh] md:flex-none`,children:r})]})}):null}var XS=Le({});function ZS(e){var t=e.config,n=e.children;return k(XS.Provider,{value:t},n)}var QS=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`,`emoji`,`math`,`fangsong`]);function $S(e){var t,n=[],r=``,i=null,a=u(e);try{for(a.s();!(t=a.n()).done;){var o=t.value;o!==`"`&&o!==`'`||i!==null?o===i?(i=null,r+=o):o!==`,`||i!==null?r+=o:(n.push(r.trim()),r=``):(i=o,r+=o)}}catch(e){a.e(e)}finally{a.f()}return r.trim()&&n.push(r.trim()),n}function eC(e){return e.trim().replace(/^['"]|['"]$/g,``).toLowerCase()}function tC(e){return Array.from(new Set(e.flatMap($S).map(function(e){return e.trim().replace(/^['"]|['"]$/g,``)}).filter(function(e){return e&&!QS.has(eC(e))})))}function nC(e){if(!e||e.length===0)return!1;var t=function(e){return tC(e).map(eC)}(e);if(t.length===0)return!1;var n=function(){if(typeof document>`u`||!(`fonts`in document))return new Set;for(var e=new Set,t=0,n=Array.from(document.fonts);t<n.length;t++){var r=n[t];e.add(eC(r.family))}return e}();return n.size!==0&&t.every(function(e){return n.has(e)})}function rC(e,t,n){if(typeof document>`u`||nC(n))return null;var r=function(e){if(typeof document>`u`)return null;try{return new URL(e,document.baseURI).href}catch{return null}}(t);if(!r)return null;var i=function(e){return Array.from(document.head.querySelectorAll(`link[rel~="stylesheet"][href]`)).find(function(t){return t.href===e})??null}(r);if(i)return i;var a=function(e){return document.head.querySelector(`link[data-embedpdf-fonts="${e}"][data-embedpdf-managed="true"]`)}(e);return a||((a=document.createElement(`link`)).rel=`stylesheet`,a.setAttribute(`data-embedpdf-fonts`,e),a.setAttribute(`data-embedpdf-managed`,`true`),document.head.appendChild(a)),a.href!==r&&(a.href=t),a}var iC=`'Open Sans', system-ui, sans-serif`,aC=[{name:`Dancing Script`,family:`'Dancing Script', cursive`},{name:`Great Vibes`,family:`'Great Vibes', cursive`},{name:`Pacifico`,family:`'Pacifico', cursive`},{name:`Caveat`,family:`'Caveat', cursive`}],oC=[{name:`Black`,value:`#000000`},{name:`Blue`,value:`#597ce2`},{name:`Red`,value:`#e44234`}];function sC(e){var t=e.documentId,n=e.isOpen,r=e.onClose,i=e.onExited,a=os(t).translate,o=q_().provides,s=et(XS).fonts?.signature,c=(o?.mode??w_.SignatureOnly)===w_.SignatureAndInitials,l=P(function(){return(e=s)===null?{fonts:aC,stylesheetUrl:null,enabled:!1}:e===void 0?{fonts:aC,stylesheetUrl:`https://fonts.googleapis.com/css2?family=Caveat&family=Dancing+Script&family=Great+Vibes&family=Pacifico&display=swap`,enabled:!0}:e.fonts&&e.fonts.length>0?{fonts:e.fonts,stylesheetUrl:(n=e.stylesheetUrl)??null,enabled:!0}:{fonts:aC,stylesheetUrl:(t=e.stylesheetUrl)??null,enabled:e.stylesheetUrl!=null};var e,t,n},[s]),u=l.fonts,d=l.stylesheetUrl,f=l.enabled;M(function(){if(n&&d){var e=u.map(function(e){return e.family});(function(e){return e?e.sheet?Promise.resolve():new Promise(function(t){var n=function(){e.removeEventListener(`load`,n),e.removeEventListener(`error`,n),t()};e.addEventListener(`load`,n,{once:!0}),e.addEventListener(`error`,n,{once:!0})}):Promise.resolve()})(rC(`signature`,d,e)).then(function(){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:48;if(typeof document>`u`||!(`fonts`in document))return Promise.resolve();var n=tC(e);return n.length===0?Promise.resolve():Promise.all(n.map(function(e){return document.fonts.load(`${t}px "${e}"`)}))}(e,48)})}},[u,d,n]);var p=x(j(`draw`),2),m=p[0],h=p[1],_=x(j(u[0].family),2),v=_[0],y=_[1],b=x(j(oC[0].value),2),C=b[0],w=b[1],T=x(j(null),2),E=T[0],D=T[1],O=x(j(null),2),ee=O[0],te=O[1];M(function(){f||m!==`type`||h(`draw`)},[f,m]);var ne=N(null),re=N(null),ie=N(null),ae=N(null),oe=F(function(e){D(e?{field:e}:null)},[]),se=F(function(e){te(e?{field:e}:null)},[]),ce=J_({onResult:oe}),le=J_({onResult:se}),ue=F(function(){var e,t,n,r;(e=ne.current)==null||e.clear(),(t=re.current)==null||t.clear(),(n=ie.current)==null||n.clear(),(r=ae.current)==null||r.clear(),ce.clear(),le.clear(),D(null),te(null)},[ce,le]),de=F(function(){h(`draw`),y(u[0].family),w(oC[0].value),ue()},[ue,u]),fe=F(function(e){ue(),h(e)},[ue]),pe=F(function(){E&&o&&(o.addEntry(g({signature:E.field},ee&&{initials:ee.field})),de(),r?.())},[E,ee,o,r,de]),me=F(function(){de(),r?.()},[de,r]),he=E&&(!c||ee),A=[{id:`draw`,label:a(`signature.create.draw`,{fallback:`Draw`})}].concat(S(f?[{id:`type`,label:a(`signature.create.type`,{fallback:`Type`})}]:[]),[{id:`upload`,label:a(`signature.create.upload`,{fallback:`Upload`})}]),ge=140;return k(YS,{open:!!n,title:a(`signature.create.title`,{fallback:`Create Signature`}),onClose:me,onExited:i,className:c?`md:w-[42rem]`:void 0},k(`div`,{class:`flex flex-col gap-4`},k(`div`,{class:`border-border-subtle flex gap-1 border-b`},A.map(function(e){return k(`button`,{key:e.id,class:`px-4 py-2 text-sm font-medium transition-colors ${m===e.id?`border-accent text-accent border-b-2`:`text-fg-muted hover:text-fg-primary`}`,onClick:function(){return fe(e.id)}},e.label)})),k(`div`,{class:`flex gap-4`},k(`div`,{class:`flex ${c?`flex-[2]`:`flex-1`} flex-col gap-2`},k(`div`,{class:`flex items-center justify-between`},k(`span`,{class:`text-fg-muted text-xs font-medium`},a(`signature.create.signatureLabel`,{fallback:`Signature`})),k(`button`,{class:`text-fg-muted hover:text-fg-primary text-xs underline`,onClick:function(){var e,t;m===`draw`?(e=ne.current)==null||e.clear():m===`type`?(t=ie.current)==null||t.clear():ce.clear()}},a(`signature.create.clear`,{fallback:`Clear`}))),k(`div`,{style:{height:`${ge}px`}},m===`draw`&&k(X_,{onResult:oe,padRef:function(e){ne.current=e},strokeColor:C,className:`border-border-default rounded border`}),m===`type`&&k(Z_,{onResult:oe,padRef:function(e){ie.current=e},fontFamily:v,color:C,className:`border-border-default text-fg-primary rounded border px-3 py-2`,placeholder:a(`signature.create.typePlaceholder`,{fallback:`e.g. John Smith`})}),m===`upload`&&k(cC,{upload:ce,height:ge,placeholder:a(`signature.create.uploadPlaceholder`,{fallback:`Click or drag an image here`})}))),c&&k(`div`,{class:`flex flex-1 flex-col gap-2`},k(`div`,{class:`flex items-center justify-between`},k(`span`,{class:`text-fg-muted text-xs font-medium`},a(`signature.create.initialsLabel`,{fallback:`Initials`})),k(`button`,{class:`text-fg-muted hover:text-fg-primary text-xs underline`,onClick:function(){var e,t;m===`draw`?(e=re.current)==null||e.clear():m===`type`?(t=ae.current)==null||t.clear():le.clear()}},a(`signature.create.clear`,{fallback:`Clear`}))),k(`div`,{style:{height:`${ge}px`}},m===`draw`&&k(X_,{onResult:se,padRef:function(e){re.current=e},strokeColor:C,className:`border-border-default rounded border`}),m===`type`&&k(Z_,{onResult:se,padRef:function(e){ae.current=e},fontFamily:v,color:C,className:`border-border-default text-fg-primary rounded border px-3 py-2`,placeholder:a(`signature.create.initialsPlaceholder`,{fallback:`e.g. JS`})}),m===`upload`&&k(cC,{upload:le,height:ge,placeholder:a(`signature.create.uploadPlaceholder`,{fallback:`Click or drag an image here`})})))),(m===`draw`||m===`type`)&&k(`div`,{class:`flex items-center gap-4`},m===`type`&&k(`div`,{class:`flex items-center gap-2`},k(`label`,{class:`text-fg-muted text-xs`},a(`signature.create.font`,{fallback:`Font`})),k(`select`,{class:`border-border-default bg-bg-surface text-fg-primary rounded border px-2 py-1 text-sm`,value:v,onChange:function(e){y(e.target.value)}},u.map(function(e){return k(`option`,{key:e.family,value:e.family,style:{fontFamily:e.family}},e.name)}))),k(`div`,{class:`flex items-center gap-2`},k(`label`,{class:`text-fg-muted text-xs`},a(`signature.create.color`,{fallback:`Color`})),k(`div`,{class:`flex gap-1.5`},oC.map(function(e){return k(`button`,{key:e.value,title:e.name,class:`h-6 w-6 rounded-full border-2 transition-all ${C===e.value?`border-accent scale-110`:`border-border-default hover:scale-105`}`,style:{backgroundColor:e.value},onClick:function(){return w(e.value)}})})))),k(`div`,{class:`flex justify-end gap-2`},k(`button`,{class:`text-fg-muted hover:text-fg-primary rounded-md px-3 py-1.5 text-sm transition-colors`,onClick:me},a(`signature.create.cancel`,{fallback:`Cancel`})),k(`button`,{class:`bg-accent hover:bg-accent-hover text-fg-on-accent rounded-md px-4 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50`,disabled:!he,onClick:pe},a(`signature.create.save`,{fallback:`Save`})))))}function cC(e){var t=e.upload,n=e.height,r=e.placeholder;return k(A,null,k(`input`,{ref:t.inputRef,type:`file`,accept:t.accept,onChange:t.handleFileInputChange,style:{display:`none`}}),k(`div`,{onClick:t.openFilePicker,onDrop:t.handleDrop,onDragOver:t.handleDragOver,onDragLeave:t.handleDragLeave,class:`border-border-default flex w-full cursor-pointer items-center justify-center rounded border-2 border-dashed transition-colors ${t.isDragging?`border-accent bg-accent/5`:`hover:border-fg-muted`}`,style:{height:`${n}px`}},t.previewUrl?k(`img`,{src:t.previewUrl,style:{maxWidth:`90%`,maxHeight:`90%`,objectFit:`contain`}}):k(`span`,{class:`text-fg-muted px-4 text-center text-xs`},r)))}function lC(e){var t=e.schema,n=e.documentId,r=e.props,i=r.menuWrapperProps,a=r.rect,o=r.placement,s={position:`absolute`,pointerEvents:`auto`,cursor:`default`,left:`50%`,transform:`translateX(-50%)`};return s.top=o!=null&&o.suggestTop?-50:a.size.height+8,k(`div`,g(g({},i),ao(t)),k(`div`,{style:s,className:`border-border-subtle bg-bg-elevated rounded-lg border shadow-lg`},k(`div`,{className:`flex items-center gap-1 p-1`},t.items.map(function(e){return k(dC,{key:e.id,item:e,documentId:n,props:r})}))))}function uC(e){var t=e.item,n=e.documentId,r=Jo(t.commandId,n);return r!=null&&r.visible?k(`div`,g({},ao(t)),k(tx,{commandId:t.commandId,documentId:n,variant:t.variant})):null}function dC(e){var t=e.item,n=e.documentId,r=e.props;switch(t.type){case`command-button`:return k(uC,{item:t,documentId:n});case`divider`:return k(`div`,g({},ao(t)),k(`div`,{className:`bg-border-default h-6 w-px`,"aria-hidden":`true`}));case`group`:return k(`div`,g({className:`flex items-center gap-${t.gap??1}`},ao(t)),t.items.map(function(e){return k(dC,{key:e.id,item:e,documentId:n,props:r})}));default:return null}}function fC(e){var t,n,r,i=e.schema,a=e.documentId,o=e.className,s=i.content,c=i.position,l=Eo().renderCustomComponent,u=(n=c.anchor,(r={"top-left":`top-0 left-0`,"top-center":`top-0 left-1/2 -translate-x-1/2`,"top-right":`top-0 right-0`,"center-left":`top-1/2 left-0 -translate-y-1/2`,center:`top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2`,"center-right":`top-1/2 right-0 -translate-y-1/2`,"bottom-left":`bottom-0 left-0`,"bottom-center":`bottom-0 left-1/2 -translate-x-1/2`,"bottom-right":`bottom-0 right-0`})[n]||r[`bottom-center`]),f=function(e){if(e){var t={};return e.top&&(t.top=e.top),e.right&&(t.right=e.right),e.bottom&&(t.bottom=e.bottom),e.left&&(t.left=e.left),Object.keys(t).length>0?t:void 0}}(c.offset),p=(t=i.categories)!=null&&t.length?d({},za,i.categories.join(` `)):{};return k(`div`,g(d({className:`z-3 absolute ${u} ${o||``}`,style:f,"data-overlay-id":i.id},Ra,i.id),p),l(s.componentId,a))}function pC(e){var t=e.documentId,n=e.isOpen,r=e.onClose,i=e.onExited,a=Ki().provides,o=Nm().provides,s=os(t).translate,c=x(j(`all`),2),l=c[0],u=c[1],d=x(j(``),2),f=d[0],p=d[1],m=x(j(!0),2),h=m[0],g=m[1],_=x(j(!1),2),v=_[0],y=_[1],b=x(j(``),2),S=b[0],C=b[1],w=a?.forDocument(t).getMetrics()?.currentPage||1,T=a?.forDocument(t).getTotalPages()||0;M(function(){n&&(u(`all`),p(``),g(!0),y(!1),C(``))},[n]);var E=(l!==`custom`||f.trim().length>0)&&!v;return k(YS,{open:n!=null&&n,title:s(`print.title`),onClose:r,onExited:i,className:`md:w-[32rem]`},k(`div`,{className:`space-y-6`},k(`div`,null,k(`label`,{className:`text-fg-secondary mb-3 block text-sm font-medium`},s(`print.pages`)),k(`div`,{className:`space-y-2`},k(`label`,{className:`flex items-center`},k(`input`,{type:`radio`,name:`pageRange`,value:`all`,checked:l===`all`,onChange:function(){return u(`all`)},disabled:v,className:`accent-accent mr-2`}),k(`span`,{className:`text-fg-primary text-sm`},s(`print.all`))),k(`label`,{className:`flex items-center`},k(`input`,{type:`radio`,name:`pageRange`,value:`current`,checked:l===`current`,onChange:function(){return u(`current`)},disabled:v,className:`accent-accent mr-2`}),k(`span`,{className:`text-fg-primary text-sm`},s(`print.current`,{params:{currentPage:w}}))),k(`label`,{className:`flex items-start`},k(`input`,{type:`radio`,name:`pageRange`,value:`custom`,checked:l===`custom`,onChange:function(){return u(`custom`)},disabled:v,className:`accent-accent mr-2 mt-0.5`}),k(`div`,{className:`flex-1`},k(`span`,{className:`text-fg-primary mb-1 block text-sm`},s(`print.specify`)),k(`input`,{type:`text`,placeholder:s(`print.specifyEG`),value:f,onInput:function(e){return p(e.target.value)},disabled:l!==`custom`||v,className:`w-full rounded-md border px-3 py-1 text-base ${l!==`custom`||v?`bg-interactive-disabled text-fg-muted`:`border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent`} focus:outline-none focus:ring-1`}),l===`custom`&&f.trim()&&T>0&&k(`p`,{className:`text-fg-muted mt-1 text-xs`},s(`print.current`,{params:{totalPages:T}})))))),k(`div`,null,k(`label`,{className:`flex items-center`},k(`input`,{type:`checkbox`,checked:h,onChange:function(e){return g(e.target.checked)},disabled:v,className:`accent-accent mr-2`}),k(`span`,{className:`text-fg-secondary text-sm font-medium`},s(`print.annotation`)))),v&&k(`div`,{className:`bg-state-info-light flex items-center space-x-3 rounded-md p-3`},k(Ax,{className:`text-accent`}),k(`span`,{className:`text-accent text-sm`},S)),k(`div`,{className:`border-border-subtle flex justify-end space-x-3 border-t pt-4`},k(Oy,{onClick:r,disabled:v,className:`border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},s(`print.cancel`)),k(Oy,{onClick:function(){var e;l===`current`?e=String(w):l===`custom`&&(e=f.trim()||void 0);var n={includeAnnotations:h,pageRange:e};try{y(!0),C(s(`print.loading`));var i=o?.forDocument(t).print(n);i&&(i.onProgress(function(e){C(e.message)}),i.wait(function(){y(!1),C(``),r?.()},function(e){console.error(`Print failed:`,e),y(!1),C(``)}))}catch(e){console.error(`Print failed:`,e),y(!1),C(``)}},disabled:!E,className:`bg-accent text-fg-on-accent hover:!bg-accent-hover flex items-center space-x-2 rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},v&&k(Ax,{size:`sm`}),k(`span`,null,s(v?`print.printing`:`print.print`))))))}function mC(e){var t=e.documentId,n=e.isOpen,r=e.onClose,i=e.onExited,a=e.source,o=Ki().provides,s=Kp().provides,c=al().provides,l=os(t).translate,d=x(j(`url`),2),f=d[0],p=d[1],m=x(j(``),2),h=m[0],g=m[1],_=x(j(1),2),v=_[0],y=_[1],b=o?.forDocument(t).getTotalPages()||1,S=s?.forDocument(t),C=c?.forDocument(t),w=S?.getSelectedAnnotation(),T=C?.getFormattedSelection()??[];M(function(){n&&(p(`url`),g(``),y(1))},[n]);var E=function(){var e;if(f===`url`){if(!h.trim())return;e={type:`action`,action:{type:en.URI,uri:h.trim()}}}else e={type:`destination`,destination:{pageIndex:v-1,zoom:{mode:Jt.FitPage},view:[]}};var t=function(){if(!w)return!1;var t,n=u((`segmentRects`in w.object?w.object.segmentRects:[w.object.rect])??[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;S?.createAnnotation(w.object.pageIndex,{id:K(),type:z.LINK,pageIndex:w.object.pageIndex,rect:r,inReplyToId:w.object.id,replyType:cn.Group,target:e,strokeStyle:un.UNDERLINE,strokeColor:`#0000FF`,strokeWidth:2})}}catch(e){n.e(e)}finally{n.f()}return!0},n=function(){if(T.length===0)return!1;var t,n=C?.getSelectedText(),r=u(T);try{var i=function(){var r=t.value;n?.wait(function(t){var n=K();S?.createAnnotation(r.pageIndex,{id:n,created:new Date,flags:[`print`],type:z.HIGHLIGHT,blendMode:R.Multiply,pageIndex:r.pageIndex,rect:r.rect,segmentRects:r.segmentRects,strokeColor:`#FFFFFF`,opacity:0,custom:{text:t.join(`
2356
+ `)}});var i,a=u(r.segmentRects??[r.rect]);try{for(a.s();!(i=a.n()).done;){var o=i.value;S?.createAnnotation(r.pageIndex,{id:K(),type:z.LINK,pageIndex:r.pageIndex,rect:o,inReplyToId:n,replyType:cn.Group,target:e,strokeStyle:un.UNDERLINE,strokeColor:`#0000FF`,strokeWidth:2})}}catch(e){a.e(e)}finally{a.f()}S?.selectAnnotation(r.pageIndex,n)},nr)};for(r.s();!(t=r.n()).done;)i()}catch(e){r.e(e)}finally{r.f()}return C?.clear(),!0};a===`annotation`?t():a===`selection`?n():t()||n(),r?.()},D=f===`page`||h.trim().length>0,O=function(e){e.key===`Enter`&&D&&(e.preventDefault(),E())};return k(YS,{open:n!=null&&n,title:l(`link.title`)||`Insert Link or Page`,onClose:r,onExited:i,className:`md:w-[28rem]`},k(`div`,{className:`space-y-6`},k(`div`,{className:`border-border-subtle flex border-b`},k(fy,{active:f===`url`,onClick:function(){return p(`url`)}},l(`link.url`)||`URL`),k(fy,{active:f===`page`,onClick:function(){return p(`page`)}},l(`link.page`)||`Page`)),k(`div`,{className:`bg-bg-muted rounded-lg`},f===`url`?k(`div`,null,k(`label`,{className:`text-fg-secondary mb-2 block text-sm font-medium`},l(`link.enterUrl`)||`Enter URL`),k(`input`,{type:`url`,value:h,onInput:function(e){return g(e.target.value)},onKeyDown:O,placeholder:`https://example.com`,className:`border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 text-base focus:outline-none focus:ring-1`,autoFocus:!0})):k(`div`,null,k(`label`,{className:`text-fg-secondary mb-2 block text-sm font-medium`},l(`link.enterPage`)||`Enter Page Number`),k(`input`,{type:`number`,min:1,max:b,value:v,onInput:function(e){var t=parseInt(e.target.value,10);isNaN(t)||y(Math.max(1,Math.min(b,t)))},onKeyDown:O,className:`border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 text-base focus:outline-none focus:ring-1`,autoFocus:!0}),k(`p`,{className:`text-fg-muted mt-1 text-xs`},l(`link.pageRange`,{params:{totalPages:b}})||`Page 1 to ${b}`))),k(`div`,{className:`border-border-subtle flex justify-end space-x-3 border-t pt-4`},k(Oy,{type:`button`,onClick:r,className:`border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm`},l(`common.cancel`)||`Cancel`),k(Oy,{type:`button`,onClick:E,disabled:!D,className:`bg-accent text-fg-on-accent hover:!bg-accent-hover rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},l(`link.link`)||`Link`))))}function hC(e){var t=e.documentId,n=ki().provides,r=qi(t),i=r.provides,a=r.state,o=a.currentPage,s=a.totalPages,c=x(j(!1),2),l=c[0],u=c[1],d=x(j(!1),2),f=d[0],p=d[1],m=N(null),h=x(j(o.toString()),2),g=h[0],_=h[1],v=N(null);M(function(){_(o.toString())},[o]);var y=F(function(){m.current&&clearTimeout(m.current),m.current=setTimeout(function(){f||u(!1)},4e3)},[f]);return M(function(){if(n)return n.onScrollActivity(function(e){e.documentId===t&&(u(!0),y())})},[n,t,y]),M(function(){return function(){m.current&&clearTimeout(m.current)}},[]),s<=1?null:k(`div`,{onMouseEnter:function(){p(!0),u(!0),m.current&&clearTimeout(m.current)},onMouseLeave:function(){p(!1),y()},className:`pointer-events-auto`},k(`div`,{className:`border-border-default bg-bg-surface flex items-center gap-1 rounded-lg border p-1 shadow-lg transition-opacity duration-300 ${l?`opacity-100`:`opacity-0`}`},k(tx,{commandId:`scroll:previous-page`,documentId:t,variant:`icon`}),k(`div`,{className:`flex items-center gap-1 px-1`},k(`input`,{ref:v,type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,value:g,onChange:function(e){_(e.target.value.replace(/[^0-9]/g,``))},onFocus:function(){setTimeout(function(){return v.current?.select()},0)},onBlur:function(){var e,t=parseInt(g,10);!isNaN(t)&&t>=1&&t<=s?i==null||(e=i.scrollToPage)==null||e.call(i,{pageNumber:t}):_(o.toString())},onKeyDown:function(e){e.key===`Enter`?e.target.blur():e.key===`Escape`&&(_(o.toString()),e.target.blur())},className:`border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent h-7 w-10 rounded border px-1 text-center text-base focus:outline-none focus:ring-1`}),k(`span`,{className:`text-fg-secondary text-sm`},`\xA0 `,s)),k(tx,{commandId:`scroll:next-page`,documentId:t,variant:`icon`})))}var $=function(e,t,n){return!function(e,t,n){return jr(e.core,t,n)}(e,t,n)},gC={"zoom:in":{id:`zoom:in`,labelKey:`zoom.in`,icon:`zoomIn`,shortcuts:[`Ctrl+=`,`Meta+=`,`Ctrl+NumpadAdd`,`Meta+NumpadAdd`],categories:[`zoom`,`zoom-in`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).zoomIn()}},"zoom:out":{id:`zoom:out`,labelKey:`zoom.out`,icon:`zoomOut`,shortcuts:[`Ctrl+-`,`Meta+-`,`Ctrl+NumpadSubtract`,`Meta+NumpadSubtract`],categories:[`zoom`,`zoom-out`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).zoomOut()}},"zoom:fit-page":{id:`zoom:fit-page`,labelKey:`zoom.fitPage`,icon:`fitToPage`,shortcuts:[`Ctrl+0`,`Meta+0`],categories:[`zoom`,`zoom-fit-page`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).requestZoom(ss.FitPage)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.zoom)==null||(t=t.documents[r])==null?void 0:t.zoomLevel)===ss.FitPage}},"zoom:fit-width":{id:`zoom:fit-width`,labelKey:`zoom.fitWidth`,icon:`fitToWidth`,shortcuts:[`Ctrl+1`,`Meta+1`],categories:[`zoom`,`zoom-fit-width`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).requestZoom(ss.FitWidth)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.zoom)==null||(t=t.documents[r])==null?void 0:t.zoomLevel)===ss.FitWidth}},"zoom:marquee":{id:`zoom:marquee`,labelKey:`zoom.marquee`,icon:`zoomInArea`,shortcuts:[`Ctrl+M`,`Meta+M`],categories:[`zoom`,`zoom-marquee`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).toggleMarqueeZoom()},active:function(e){var t,n,r=e.state,i=e.documentId;return(t=(n=r.plugins.zoom)==null||(n=n.documents[i])==null?void 0:n.isMarqueeZoomActive)!=null&&t}},"zoom:25":{id:`zoom:25`,label:`25%`,categories:[`zoom`,`zoom-level`,`zoom-level-25`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).requestZoom(.25)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.zoom)==null||(t=t.documents[r])==null?void 0:t.zoomLevel)===.25}},"zoom:50":{id:`zoom:50`,label:`50%`,categories:[`zoom`,`zoom-level`,`zoom-level-50`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).requestZoom(.5)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.zoom)==null||(t=t.documents[r])==null?void 0:t.zoomLevel)===.5}},"zoom:100":{id:`zoom:100`,label:`100%`,categories:[`zoom`,`zoom-level`,`zoom-level-100`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).requestZoom(1)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.zoom)==null||(t=t.documents[r])==null?void 0:t.zoomLevel)===1}},"zoom:125":{id:`zoom:125`,label:`125%`,categories:[`zoom`,`zoom-level`,`zoom-level-125`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).requestZoom(1.25)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.zoom)==null||(t=t.documents[r])==null?void 0:t.zoomLevel)===1.25}},"zoom:150":{id:`zoom:150`,label:`150%`,categories:[`zoom`,`zoom-level`,`zoom-level-150`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).requestZoom(1.5)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.zoom)==null||(t=t.documents[r])==null?void 0:t.zoomLevel)===1.5}},"zoom:200":{id:`zoom:200`,label:`200%`,categories:[`zoom`,`zoom-level`,`zoom-level-200`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).requestZoom(2)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.zoom)==null||(t=t.documents[r])==null?void 0:t.zoomLevel)===2}},"zoom:400":{id:`zoom:400`,label:`400%`,categories:[`zoom`,`zoom-level`,`zoom-level-400`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).requestZoom(4)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.zoom)==null||(t=t.documents[r])==null?void 0:t.zoomLevel)===4}},"zoom:800":{id:`zoom:800`,label:`800%`,categories:[`zoom`,`zoom-level`,`zoom-level-800`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).requestZoom(8)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.zoom)==null||(t=t.documents[r])==null?void 0:t.zoomLevel)===8}},"zoom:1600":{id:`zoom:1600`,label:`1600%`,categories:[`zoom`,`zoom-level`,`zoom-level-1600`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`zoom`)?.provides();r&&r.forDocument(n).requestZoom(16)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.zoom)==null||(t=t.documents[r])==null?void 0:t.zoomLevel)===16}},"zoom:toggle-menu":{id:`zoom:toggle-menu`,labelKey:`zoom.menu`,icon:`chevronDown`,iconProps:{className:`h-3.5 w-3.5`},categories:[`zoom`,`zoom-menu`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`ui`)?.provides();r&&r.forDocument(n).toggleMenu(`zoom-menu`,`zoom:toggle-menu`,`zoom-menu-button`)},active:function(e){var t=e.state,n=e.documentId;return(t.plugins.ui?.documents[n])?.openMenus[`zoom-menu`]!==void 0}},"zoom:toggle-menu-mobile":{id:`zoom:toggle-menu-mobile`,labelKey:`zoom.menu`,icon:`zoomIn`,categories:[`zoom`,`zoom-menu`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`ui`)?.provides();r&&r.forDocument(n).toggleMenu(`zoom-menu`,`zoom:toggle-menu-mobile`,`zoom-menu-button`)},active:function(e){var t=e.state,n=e.documentId;return(t.plugins.ui?.documents[n])?.openMenus[`zoom-menu`]!==void 0}},"pan:toggle":{id:`pan:toggle`,labelKey:`pan.toggle`,icon:`hand`,shortcuts:[`h`],categories:[`tools`,`pan`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`pan`)?.provides();r&&r.forDocument(n).togglePan()},active:function(e){var t,n,r=e.state,i=e.documentId;return(t=(n=r.plugins.pan)==null||(n=n.documents[i])==null?void 0:n.isPanMode)!=null&&t}},"pointer:toggle":{id:`pointer:toggle`,labelKey:`pointer.toggle`,icon:`pointer`,shortcuts:[`p`],categories:[`tools`,`pointer`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`interaction-manager`)?.provides();if(r){var i=r.forDocument(n);i.getActiveMode()===`pointerMode`?i.activateDefaultMode():i.activate(`pointerMode`)}},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins[`interaction-manager`])==null||(t=t.documents[r])==null?void 0:t.activeMode)===`pointerMode`}},"left-action-menu:overflow-menu":{id:`left-action-menu:overflow-menu`,labelKey:`menu.moreOptions`,icon:`dots`,categories:[`ui`,`ui-menu`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`ui`)?.provides();r&&r.toggleMenu(`left-action-menu`,`left-action-menu:overflow-menu`,`overflow-left-action-menu-button`,n)},active:function(e){var t=e.state,n=e.documentId;return(t.plugins.ui?.documents[n])?.openMenus[`left-action-menu`]!==void 0}},"capture:screenshot":{id:`capture:screenshot`,labelKey:`capture.screenshot`,icon:`screenshot`,shortcuts:[`Ctrl+Shift+S`,`Meta+Shift+S`],categories:[`tools`,`capture`,`capture-screenshot`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`capture`)?.provides();if(r){var i=r.forDocument(n);i.isMarqueeCaptureActive()?i.disableMarqueeCapture():i.enableMarqueeCapture()}},active:function(e){var t=e.state,n=e.documentId;return t.plugins[`interaction-manager`].documents[n]?.activeMode===`marqueeCapture`}},"document:menu":{id:`document:menu`,labelKey:`document.menu`,icon:`menu`,categories:[`document`,`document-menu`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa);if(r&&r.provides){var i=r.provides();i&&i.forDocument(n).toggleMenu(`document-menu`,`document:menu`,`document-menu-button`)}},active:function(e){var t=e.state,n=e.documentId;return(t.plugins.ui?.documents[n])?.openMenus[`document-menu`]!==void 0}},"document:open":{id:`document:open`,labelKey:`document.open`,icon:`fileImport`,shortcuts:[`Ctrl+O`,`Meta+O`],categories:[`document`,`document-open`],action:function(e){(e.registry.getPlugin(`document-manager`)?.provides())?.openFileDialog()}},"document:close":{id:`document:close`,labelKey:`document.close`,icon:`x`,shortcuts:[`Ctrl+W`,`Meta+W`],categories:[`document`,`document-close`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`document-manager`)?.provides())?.closeDocument(n)}},"document:print":{id:`document:print`,labelKey:`document.print`,icon:`print`,shortcuts:[`Ctrl+P`,`Meta+P`],categories:[`document`,`document-print`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa);if(r&&r.provides){var i=r.provides();i&&i.forDocument(n).openModal(`print-modal`)}},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.Print)}},"document:protect":{id:`document:protect`,labelKey:`document.protect`,icon:`lock`,categories:[`document`,`document-protect`,`security`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`ui`)?.provides();r&&r.forDocument(n).openModal(`protect-modal`)}},"document:export":{id:`document:export`,labelKey:`document.export`,icon:`download`,categories:[`document`,`document-export`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`export`)?.provides())?.forDocument(n).download()}},"document:capture":{id:`document:capture`,labelKey:`capture.screenshot`,icon:`screenshot`,categories:[`document`,`document-capture`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`capture`)?.provides())?.forDocument(n).toggleMarqueeCapture()},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins[`interaction-manager`])==null||(t=t.documents[r])==null?void 0:t.activeMode)===`marqueeCapture`}},"document:fullscreen":{id:`document:fullscreen`,labelKey:`document.fullscreen`,icon:function(e){var t;return(t=e.state.plugins.fullscreen)!=null&&t.isFullscreen?`fullscreenExit`:`fullscreen`},shortcuts:[`F11`],categories:[`document`,`document-fullscreen`],action:function(e){var t=e.registry.getPlugin(`fullscreen`)?.provides();t&&(t.isFullscreen()?t.exitFullscreen():t.enableFullscreen())},active:function(e){var t;return(t=e.state.plugins.fullscreen?.isFullscreen)!=null&&t}},"panel:toggle-sidebar":{id:`panel:toggle-sidebar`,labelKey:`panel.sidebar`,icon:`sidebar`,categories:[`panel`,`panel-sidebar`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa);if(r&&r.provides){var i=r.provides();i&&i.forDocument(n).toggleSidebar(`left`,`main`,`sidebar-panel`)}},active:function(e){var t=e.state,n=e.documentId;return mo(t.plugins,n,`left`,`main`,`sidebar-panel`)}},"panel:toggle-search":{id:`panel:toggle-search`,labelKey:`panel.search`,icon:`search`,shortcuts:[`Ctrl+F`,`Meta+F`],categories:[`panel`,`panel-search`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa);if(r&&r.provides){var i=r.provides();i&&i.forDocument(n).toggleSidebar(`right`,`main`,`search-panel`)}},active:function(e){var t=e.state,n=e.documentId;return mo(t.plugins,n,`right`,`main`,`search-panel`)}},"panel:toggle-comment":{id:`panel:toggle-comment`,labelKey:`panel.comment`,icon:`comment`,categories:[`panel`,`panel-comment`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa);if(r&&r.provides){var i=r.provides();i&&i.forDocument(n).toggleSidebar(`right`,`main`,`comment-panel`)}},active:function(e){var t=e.state,n=e.documentId;return mo(t.plugins,n,`right`,`main`,`comment-panel`)}},"panel:toggle-redaction":{id:`panel:toggle-redaction`,labelKey:`panel.redaction`,icon:`redactionSidebar`,categories:[`panel`,`panel-redaction`,`redaction`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa);if(r&&r.provides){var i=r.provides();i&&i.forDocument(n).toggleSidebar(`right`,`main`,`redaction-panel`)}},active:function(e){var t=e.state,n=e.documentId;return mo(t.plugins,n,`right`,`main`,`redaction-panel`)}},"panel:toggle-annotation-style":{id:`panel:toggle-annotation-style`,labelKey:`panel.annotationStyle`,icon:`palette`,categories:[`panel`,`panel-annotation-style`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa);if(r&&r.provides){var i=r.provides();i&&i.forDocument(n).toggleSidebar(`left`,`main`,`annotation-panel`)}},active:function(e){var t=e.state,n=e.documentId;return mo(t.plugins,n,`left`,`main`,`annotation-panel`)},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"page:settings":{id:`page:settings`,labelKey:`page.settings`,icon:`viewSettings`,categories:[`page`,`page-settings`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa);if(r&&r.provides){var i=r.provides();i&&i.forDocument(n).toggleMenu(`page-settings-menu`,`page:settings`,`page-settings-button`)}},active:function(e){var t=e.state,n=e.documentId;return(t.plugins.ui?.documents[n])?.openMenus[`page-settings-menu`]!==void 0}},"spread:none":{id:`spread:none`,labelKey:`page.single`,icon:`singlePage`,categories:[`page`,`spread`,`spread-none`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`spread`)?.provides())?.forDocument(n).setSpreadMode(Yi.None)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.spread)==null||(t=t.documents[r])==null?void 0:t.spreadMode)===Yi.None}},"spread:odd":{id:`spread:odd`,labelKey:`page.twoOdd`,icon:`doublePage`,categories:[`page`,`spread`,`spread-odd`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`spread`)?.provides())?.forDocument(n).setSpreadMode(Yi.Odd)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.spread)==null||(t=t.documents[r])==null?void 0:t.spreadMode)===Yi.Odd}},"spread:even":{id:`spread:even`,labelKey:`page.twoEven`,icon:`book2`,categories:[`page`,`spread`,`spread-even`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`spread`)?.provides())?.forDocument(n).setSpreadMode(Yi.Even)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.spread)==null||(t=t.documents[r])==null?void 0:t.spreadMode)===Yi.Even}},"rotate:clockwise":{id:`rotate:clockwise`,labelKey:`rotate.clockwise`,icon:`rotateClockwise`,shortcuts:[`Ctrl+]`,`Meta+]`],categories:[`page`,`rotate`,`rotate-clockwise`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`rotate`)?.provides())?.forDocument(n).rotateForward()}},"rotate:counter-clockwise":{id:`rotate:counter-clockwise`,labelKey:`rotate.counterClockwise`,icon:`rotateCounterClockwise`,shortcuts:[`Ctrl+[`,`Meta+[`],categories:[`page`,`rotate`,`rotate-counter-clockwise`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`rotate`)?.provides())?.forDocument(n).rotateBackward()}},"scroll:vertical":{id:`scroll:vertical`,labelKey:`page.vertical`,icon:`vertical`,categories:[`page`,`scroll`,`scroll-vertical`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`scroll`)?.provides())?.forDocument(n).setScrollStrategy(Mi.Vertical)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.scroll)==null||(t=t.documents[r])==null?void 0:t.strategy)===Mi.Vertical}},"scroll:horizontal":{id:`scroll:horizontal`,labelKey:`page.horizontal`,icon:`horizontal`,categories:[`page`,`scroll`,`scroll-horizontal`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`scroll`)?.provides())?.forDocument(n).setScrollStrategy(Mi.Horizontal)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.scroll)==null||(t=t.documents[r])==null?void 0:t.strategy)===Mi.Horizontal}},"scroll:next-page":{id:`scroll:next-page`,labelKey:`page.next`,icon:`chevronRight`,categories:[`page`,`navigation`,`navigation-next`],shortcuts:[`Ctrl+]`,`Meta+]`,`ArrowRight`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`scroll`)?.provides())?.forDocument(n).scrollToNextPage()},disabled:function(e){var t,n,r=e.state,i=e.documentId;return((t=r.plugins.scroll)==null||(t=t.documents[i])==null?void 0:t.currentPage)>=((n=r.plugins.scroll)==null||(n=n.documents[i])==null?void 0:n.totalPages)}},"scroll:previous-page":{id:`scroll:previous-page`,labelKey:`page.previous`,icon:`chevronLeft`,categories:[`page`,`navigation`,`navigation-previous`],shortcuts:[`Ctrl+[`,`Meta+[`,`ArrowLeft`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`scroll`)?.provides())?.forDocument(n).scrollToPreviousPage()},disabled:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.scroll)==null||(t=t.documents[r])==null?void 0:t.currentPage)<=1}},"mode:view":{id:`mode:view`,labelKey:`mode.view`,categories:[`mode`,`mode-view`],action:function(e){var t,n=e.registry,r=e.documentId,i=n.getPlugin(`ui`)?.provides(),a=n.getPlugin(`interaction-manager`)?.provides();if(i&&a){var o=a.forDocument(r);o&&(o.activateDefaultMode(),i.forDocument(r).closeToolbarSlot(`top`,`secondary`),(t=n.getPlugin(Y))==null||t.provides().forDocument(r).setLocked(function(e){return e.getPluginConfig(Y).locked??{type:yu.None}}(n)))}},active:function(e){var t=e.state,n=e.documentId;return!po(t.plugins,n,`top`,`secondary`)}},"mode:annotate":{id:`mode:annotate`,labelKey:`mode.annotate`,categories:[`mode`,`mode-annotate`,`annotation`],action:function(e){var t,n=e.registry,r=e.documentId,i=n.getPlugin(`ui`)?.provides();i&&(i.setActiveToolbar(`top`,`secondary`,`annotation-toolbar`,r),(t=n.getPlugin(Y))==null||t.provides().forDocument(r).setLocked({type:yu.Include,categories:[`form`]}))},active:function(e){var t=e.state,n=e.documentId;return po(t.plugins,n,`top`,`secondary`,`annotation-toolbar`)}},"mode:shapes":{id:`mode:shapes`,labelKey:`mode.shapes`,categories:[`mode`,`mode-shapes`,`annotation`,`annotation-shape`],action:function(e){var t,n=e.registry,r=e.documentId,i=n.getPlugin(`ui`)?.provides();i&&(i.setActiveToolbar(`top`,`secondary`,`shapes-toolbar`,r),(t=n.getPlugin(Y))==null||t.provides().forDocument(r).setLocked({type:yu.Include,categories:[`form`]}))},active:function(e){var t=e.state,n=e.documentId;return po(t.plugins,n,`top`,`secondary`,`shapes-toolbar`)}},"mode:insert":{id:`mode:insert`,labelKey:`mode.insert`,categories:[`mode`,`mode-insert`,`insert`],action:function(e){var t,n=e.registry,r=e.documentId,i=n.getPlugin(`ui`)?.provides();i&&(i.setActiveToolbar(`top`,`secondary`,`insert-toolbar`,r),(t=n.getPlugin(Y))==null||t.provides().forDocument(r).setLocked({type:yu.Include,categories:[`form`]}))},active:function(e){var t=e.state,n=e.documentId;return po(t.plugins,n,`top`,`secondary`,`insert-toolbar`)}},"mode:form":{id:`mode:form`,labelKey:`mode.form`,categories:[`mode`,`mode-form`,`form`],action:function(e){var t,n=e.registry,r=e.documentId,i=n.getPlugin(`ui`)?.provides();i&&(i.setActiveToolbar(`top`,`secondary`,`form-toolbar`,r),(t=n.getPlugin(Y))==null||t.provides().forDocument(r).setLocked({type:yu.None}))},active:function(e){var t=e.state,n=e.documentId;return po(t.plugins,n,`top`,`secondary`,`form-toolbar`)}},"form:add-textfield":{id:`form:add-textfield`,labelKey:`form.textfield`,icon:`formTextfield`,categories:[`form`,`form-textfield`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`formTextField`?r.setActiveTool(null):r.setActiveTool(`formTextField`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`formTextField`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"form:add-checkbox":{id:`form:add-checkbox`,labelKey:`form.checkbox`,icon:`formCheckbox`,categories:[`form`,`form-checkbox`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`formCheckbox`?r.setActiveTool(null):r.setActiveTool(`formCheckbox`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`formCheckbox`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"form:add-radio":{id:`form:add-radio`,labelKey:`form.radio`,icon:`formRadio`,categories:[`form`,`form-radio`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`formRadioButton`?r.setActiveTool(null):r.setActiveTool(`formRadioButton`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`formRadioButton`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"form:add-select":{id:`form:add-select`,labelKey:`form.select`,icon:`formSelect`,categories:[`form`,`form-select`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`formCombobox`?r.setActiveTool(null):r.setActiveTool(`formCombobox`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`formCombobox`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"form:add-listbox":{id:`form:add-listbox`,labelKey:`form.listbox`,icon:`formListbox`,categories:[`form`,`form-listbox`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`formListbox`?r.setActiveTool(null):r.setActiveTool(`formListbox`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`formListbox`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"form:toggle-fill-mode":{id:`form:toggle-fill-mode`,labelKey:`form.toggleFillMode`,icon:`widgetEdit`,categories:[`form`,`form-fill-mode`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides().forDocument(n);r&&(r.isCategoryLocked(`form`)?r.setLocked({type:yu.None}):r.setLocked({type:yu.Include,categories:[`form`]}))},active:function(e){var t,n=e.registry,r=e.documentId;return!((t=(n.getPlugin(Y)?.provides().forDocument(r))?.isCategoryLocked(`form`))==null||t)}},"mode:redact":{id:`mode:redact`,labelKey:`mode.redact`,categories:[`mode`,`mode-redact`,`redaction`],action:function(e){var t,n=e.registry,r=e.documentId,i=n.getPlugin(`ui`)?.provides();i&&(i.setActiveToolbar(`top`,`secondary`,`redaction-toolbar`,r),(t=n.getPlugin(Y))==null||t.provides().forDocument(r).setLocked({type:yu.Include,categories:[`form`]}))},active:function(e){var t=e.state,n=e.documentId;return po(t.plugins,n,`top`,`secondary`,`redaction-toolbar`)}},"insert:add-rubber-stamp":{id:`insert:add-rubber-stamp`,labelKey:`insert.rubberStamp`,icon:`rubberStamp`,categories:[`insert`,`insert-rubber-stamp`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa);if(r&&r.provides){var i=r.provides();i&&i.forDocument(n).toggleSidebar(`left`,`main`,`rubber-stamp-panel`)}},active:function(e){var t=e.state,n=e.documentId;return mo(t.plugins,n,`left`,`main`,`rubber-stamp-panel`)},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"insert:add-signature":{id:`insert:add-signature`,labelKey:`signature.title`,icon:`signature`,categories:[`insert`,`insert-signature`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa);if(r&&r.provides){var i=r.provides();i&&i.forDocument(n).toggleSidebar(`left`,`main`,`signature-panel`)}},active:function(e){var t=e.state,n=e.documentId;return mo(t.plugins,n,`left`,`main`,`signature-panel`)},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"signature:create":{id:`signature:create`,labelKey:`signature.create.title`,icon:`signature`,categories:[`insert`,`insert-signature`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa)?.provides();r&&r.forDocument(n).openModal(`signature-create-modal`)}},"insert:add-attachment":{id:`insert:add-attachment`,label:`Attachment`,icon:`paperclip`,categories:[`insert`,`insert-attachment`],action:function(){}},"insert:add-image":{id:`insert:add-image`,labelKey:`insert.image`,icon:`photo`,categories:[`insert`,`insert-image`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`stamp`?r.setActiveTool(null):r.setActiveTool(`stamp`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`stamp`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"tabs:overflow-menu":{id:`tabs:overflow-menu`,labelKey:`tabs.overflowMenu`,icon:`dots`,categories:[`ui`,`ui-menu`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`ui`)?.provides();r&&r.toggleMenu(`mode-tabs-overflow-menu`,`tabs:overflow-menu`,`overflow-tabs-button`,n)},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins.ui)==null||(t=t.documents[r])==null?void 0:t.openMenus[`mode-tabs-overflow-menu`])!==void 0}},"annotation:add-highlight":{id:`annotation:add-highlight`,labelKey:`annotation.highlight`,icon:`highlight`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`highlight`)?.strokeColor}},categories:[`annotation`,`annotation-markup`,`annotation-highlight`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides(),i=t.getPlugin(cc)?.provides(),a=t.getPlugin(`ui`)?.provides();if(i&&r&&a){var o=r?.forDocument(n),s=i?.forDocument(n);if(o&&s){var c=r.getTool(`highlight`);if(c&&Nf(c)){var l=c.defaults,d=s.getFormattedSelection(),f=s.getSelectedText();if(d.length>0){o.setLocked({type:yu.Exclude,categories:[`markup`,`shape`]});var p,m=u(d);try{var h=function(){var e=p.value,t=K(),n=function(n){o.createAnnotation(e.pageIndex,g({id:t,created:new Date,flags:[`print`],type:z.HIGHLIGHT,blendMode:R.Multiply,strokeColor:l.strokeColor,opacity:l.opacity,pageIndex:e.pageIndex,rect:e.rect,segmentRects:e.segmentRects},n!=null&&{custom:{text:n}})),o.selectAnnotation(e.pageIndex,t)};f.wait(function(e){return n(e.join(`
2357
+ `))},function(){return n()})};for(m.s();!(p=m.n()).done;)h()}catch(e){m.e(e)}finally{m.f()}s.clear(),o.setActiveTool(`highlight`),a.setActiveToolbar(`top`,`secondary`,`annotation-toolbar`,n)}else o.getActiveTool()?.id===`highlight`?o.setActiveTool(null):o.setActiveTool(`highlight`)}}}},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`highlight`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-underline":{id:`annotation:add-underline`,labelKey:`annotation.underline`,icon:`underline`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`underline`)?.strokeColor}},categories:[`annotation`,`annotation-markup`,`annotation-underline`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides(),i=t.getPlugin(cc)?.provides(),a=t.getPlugin(`ui`)?.provides();if(i&&r&&a){var o=r?.forDocument(n),s=i?.forDocument(n);if(o&&s){var c=r.getTool(`underline`);if(c&&Ff(c)){var l=c.defaults,d=s.getFormattedSelection(),f=s.getSelectedText();if(d.length>0){o.setLocked({type:yu.Exclude,categories:[`markup`,`shape`]});var p,m=u(d);try{var h=function(){var e=p.value,t=K(),n=function(n){o.createAnnotation(e.pageIndex,g({id:t,created:new Date,flags:[`print`],type:z.UNDERLINE,strokeColor:l.strokeColor,opacity:l.opacity,pageIndex:e.pageIndex,rect:e.rect,segmentRects:e.segmentRects},n!=null&&{custom:{text:n}})),o.selectAnnotation(e.pageIndex,t)};f.wait(function(e){return n(e.join(`
2358
+ `))},function(){return n()})};for(m.s();!(p=m.n()).done;)h()}catch(e){m.e(e)}finally{m.f()}s.clear(),o.setActiveTool(`underline`),a.setActiveToolbar(`top`,`secondary`,`annotation-toolbar`,n)}else o.getActiveTool()?.id===`underline`?o.setActiveTool(null):o.setActiveTool(`underline`)}}}},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`underline`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-strikeout":{id:`annotation:add-strikeout`,labelKey:`annotation.strikeout`,icon:`strikethrough`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`strikeout`)?.strokeColor}},categories:[`annotation`,`annotation-markup`,`annotation-strikeout`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides(),i=t.getPlugin(cc)?.provides(),a=t.getPlugin(`ui`)?.provides();if(i&&r&&a){var o=r?.forDocument(n),s=i?.forDocument(n);if(o&&s){var c=r.getTool(`strikeout`);if(c&&If(c)){var l=c.defaults,d=s.getFormattedSelection(),f=s.getSelectedText();if(d.length>0){o.setLocked({type:yu.Exclude,categories:[`markup`,`shape`]});var p,m=u(d);try{var h=function(){var e=p.value,t=K(),n=function(n){o.createAnnotation(e.pageIndex,g({id:t,created:new Date,flags:[`print`],type:z.STRIKEOUT,strokeColor:l.strokeColor,opacity:l.opacity,pageIndex:e.pageIndex,rect:e.rect,segmentRects:e.segmentRects},n!=null&&{custom:{text:n}})),o.selectAnnotation(e.pageIndex,t)};f.wait(function(e){return n(e.join(`
2359
+ `))},function(){return n()})};for(m.s();!(p=m.n()).done;)h()}catch(e){m.e(e)}finally{m.f()}s.clear(),o.setActiveTool(`strikeout`),a.setActiveToolbar(`top`,`secondary`,`annotation-toolbar`,n)}else o.getActiveTool()?.id===`strikeout`?o.setActiveTool(null):o.setActiveTool(`strikeout`)}}}},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`strikeout`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-squiggly":{id:`annotation:add-squiggly`,labelKey:`annotation.squiggly`,icon:`squiggly`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`squiggly`)?.strokeColor}},categories:[`annotation`,`annotation-markup`,`annotation-squiggly`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides(),i=t.getPlugin(cc)?.provides(),a=t.getPlugin(`ui`)?.provides();if(i&&r&&a){var o=r?.forDocument(n),s=i?.forDocument(n);if(o&&s){var c=r.getTool(`squiggly`);if(c&&Pf(c)){var l=c.defaults,d=s.getFormattedSelection(),f=s.getSelectedText();if(d.length>0){o.setLocked({type:yu.Exclude,categories:[`markup`,`shape`]});var p,m=u(d);try{var h=function(){var e=p.value,t=K(),n=function(n){o.createAnnotation(e.pageIndex,g({id:t,created:new Date,flags:[`print`],type:z.SQUIGGLY,strokeColor:l.strokeColor,opacity:l.opacity,pageIndex:e.pageIndex,rect:e.rect,segmentRects:e.segmentRects},n!=null&&{custom:{text:n}})),o.selectAnnotation(e.pageIndex,t)};f.wait(function(e){return n(e.join(`
2360
+ `))},function(){return n()})};for(m.s();!(p=m.n()).done;)h()}catch(e){m.e(e)}finally{m.f()}s.clear(),o.setActiveTool(`squiggly`),a.setActiveToolbar(`top`,`secondary`,`annotation-toolbar`,n)}else o.getActiveTool()?.id===`squiggly`?o.setActiveTool(null):o.setActiveTool(`squiggly`)}}}},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`squiggly`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-insert-text":{id:`annotation:add-insert-text`,labelKey:`annotation.insertText`,icon:`insertText`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`insertText`)?.strokeColor}},categories:[`annotation`,`annotation-markup`,`annotation-insert-text`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`insertText`?r.setActiveTool(null):r.setActiveTool(`insertText`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`insertText`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-replace-text":{id:`annotation:add-replace-text`,labelKey:`annotation.replaceText`,icon:`replaceText`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`replaceText`)?.strokeColor}},categories:[`annotation`,`annotation-markup`,`annotation-replace-text`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`replaceText`?r.setActiveTool(null):r.setActiveTool(`replaceText`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`replaceText`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-ink":{id:`annotation:add-ink`,labelKey:`annotation.ink`,icon:`pencilMarker`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`ink`)?.color}},categories:[`annotation`,`annotation-ink`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`ink`?r.setActiveTool(null):r.setActiveTool(`ink`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`ink`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-ink-highlighter":{id:`annotation:add-ink-highlighter`,labelKey:`annotation.inkHighlighter`,icon:`inkHighlighter`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`inkHighlighter`)?.strokeColor}},categories:[`annotation`,`annotation-ink`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`inkHighlighter`?r.setActiveTool(null):r.setActiveTool(`inkHighlighter`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`inkHighlighter`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-text":{id:`annotation:add-text`,labelKey:`annotation.text`,icon:`freeText`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`freeText`)?.fontColor}},categories:[`annotation`,`annotation-text`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`freeText`?r.setActiveTool(null):r.setActiveTool(`freeText`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`freeText`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-callout":{id:`annotation:add-callout`,labelKey:`annotation.callout`,icon:`callout`,iconProps:function(e){var t=e.state;return{primaryColor:Mu(t.plugins.annotation,`freeTextCallout`)?.strokeColor,secondaryColor:Mu(t.plugins.annotation,`freeTextCallout`)?.color}},categories:[`annotation`,`annotation-text`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`freeTextCallout`?r.setActiveTool(null):r.setActiveTool(`freeTextCallout`))},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins[Y])==null||(t=t.documents[r])==null?void 0:t.activeToolId)===`freeTextCallout`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-comment":{id:`annotation:add-comment`,labelKey:`annotation.comment`,icon:`message`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`textComment`)?.strokeColor}},categories:[`annotation`,`annotation-comment-tool`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`textComment`?r.setActiveTool(null):r.setActiveTool(`textComment`))},active:function(e){var t,n=e.state,r=e.documentId;return((t=n.plugins[Y])==null||(t=t.documents[r])==null?void 0:t.activeToolId)===`textComment`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-rectangle":{id:`annotation:add-rectangle`,labelKey:`annotation.rectangle`,icon:`square`,iconProps:function(e){var t=e.state;return{primaryColor:Mu(t.plugins.annotation,`square`)?.strokeColor,secondaryColor:Mu(t.plugins.annotation,`square`)?.color}},categories:[`annotation`,`annotation-shape`,`annotation-rectangle`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`square`?r.setActiveTool(null):r.setActiveTool(`square`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`square`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-circle":{id:`annotation:add-circle`,labelKey:`annotation.circle`,icon:`circle`,iconProps:function(e){var t=e.state;return{primaryColor:Mu(t.plugins.annotation,`circle`)?.strokeColor,secondaryColor:Mu(t.plugins.annotation,`circle`)?.color}},categories:[`annotation`,`annotation-shape`,`annotation-circle`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`circle`?r.setActiveTool(null):r.setActiveTool(`circle`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`circle`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-line":{id:`annotation:add-line`,labelKey:`annotation.line`,icon:`line`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`line`)?.strokeColor}},categories:[`annotation`,`annotation-shape`,`annotation-line`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`line`?r.setActiveTool(null):r.setActiveTool(`line`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`line`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-arrow":{id:`annotation:add-arrow`,labelKey:`annotation.arrow`,icon:`lineArrow`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`line`)?.strokeColor}},categories:[`annotation`,`annotation-shape`,`annotation-arrow`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`lineArrow`?r.setActiveTool(null):r.setActiveTool(`lineArrow`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`lineArrow`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-polygon":{id:`annotation:add-polygon`,labelKey:`annotation.polygon`,icon:`polygon`,iconProps:function(e){var t=e.state;return{primaryColor:Mu(t.plugins.annotation,`polygon`)?.strokeColor,secondaryColor:Mu(t.plugins.annotation,`polygon`)?.color}},categories:[`annotation`,`annotation-shape`,`annotation-polygon`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`polygon`?r.setActiveTool(null):r.setActiveTool(`polygon`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`polygon`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-polyline":{id:`annotation:add-polyline`,labelKey:`annotation.polyline`,icon:`zigzag`,iconProps:function(e){return{primaryColor:Mu(e.state.plugins.annotation,`polyline`)?.strokeColor}},categories:[`annotation`,`annotation-shape`,`annotation-polyline`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);r&&(r.getActiveTool()?.id===`polyline`?r.setActiveTool(null):r.setActiveTool(`polyline`))},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Y]?.documents[n]?.activeToolId===`polyline`},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:delete-selected":{id:`annotation:delete-selected`,labelKey:`annotation.deleteSelected`,icon:`trash`,categories:[`annotation`,`annotation-delete`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);if(r){var i=r.getSelectedAnnotation();i&&r.deleteAnnotation(i.object.pageIndex,i.object.id)}},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:delete-all-selected":{id:`annotation:delete-all-selected`,labelKey:`annotation.deleteAllSelected`,icon:`trash`,categories:[`annotation`,`annotation-delete`,`annotation-group`],action:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides())?.forDocument(n);if(r){var i=r.getSelectedAnnotations();i.length!==0&&(r.deleteAnnotations(i.map(function(e){return{pageIndex:e.object.pageIndex,id:e.object.id}})),r.deselectAnnotation())}},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:toggle-group":{id:`annotation:toggle-group`,labelKey:function(e){var t=e.registry,n=e.documentId;return t.getPlugin(Y)?.provides().forDocument(n).getGroupingAction()===`ungroup`?`annotation.ungroup`:`annotation.group`},icon:function(e){var t=e.registry,n=e.documentId;return t.getPlugin(Y)?.provides().forDocument(n).getGroupingAction()===`ungroup`?`ungroup`:`group`},categories:[`annotation`,`annotation-group`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides().forDocument(n);if(r){var i=r.getGroupingAction();if(i===`ungroup`){var a=r.getSelectedAnnotations();a.length>0&&r.ungroupAnnotations(a[0].object.id)}else i===`group`&&r.groupAnnotations()}},disabled:function(e){var t=e.registry,n=e.state,r=e.documentId;return!!$(n,r,U.ModifyAnnotations)||t.getPlugin(Y)?.provides().forDocument(r).getGroupingAction()===`disabled`}},"stamp:create-from-selected":{id:`stamp:create-from-selected`,labelKey:`stamp.createFromSelected`,icon:`rubberStampPlus`,categories:[`annotation`,`stamp`],action:function(e){var t,n=e.registry,r=e.documentId,i=n.getPlugin(Y)?.provides().forDocument(r);if(i){var a=i.getSelectedAnnotation();if(a){var o=n.getPlugin(c_)?.provides().forDocument(r);o&&(o.createStampFromAnnotation(a.object,{name:on.Custom,subject:`Custom Stamp ${Date.now()}`,categories:[`custom`,`sidebar`]}),((t=n.getPlugin(sa))==null||(t=t.provides())==null?void 0:t.forDocument(r))?.setActiveSidebar(`left`,`main`,`rubber-stamp-panel`,void 0,{selectedLibraryId:`custom`}))}}},visible:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides().forDocument(n);if(!r)return!1;var i=r.getSelectedAnnotation()?.object.type;return!!i&&![z.REDACT,z.HIGHLIGHT,z.SQUIGGLY,z.UNDERLINE,z.STRIKEOUT,z.CARET,z.WIDGET].includes(i)},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)||$(t,n,U.CopyContents)}},"stamp:create-from-group":{id:`stamp:create-from-group`,labelKey:`stamp.createFromGroup`,icon:`rubberStampPlus`,categories:[`annotation`,`stamp`,`annotation-group`],action:function(e){var t,n=e.registry,r=e.documentId,i=n.getPlugin(Y)?.provides().forDocument(r);if(i){var a=i.getSelectedAnnotations();if(a.length!==0){var o=n.getPlugin(c_)?.provides().forDocument(r);if(o){var s=a.map(function(e){return e.object});o.createStampFromAnnotations(s,{name:on.Custom,subject:`Custom Stamp ${Date.now()}`,categories:[`custom`,`sidebar`]}),((t=n.getPlugin(sa))==null||(t=t.provides())==null?void 0:t.forDocument(r))?.setActiveSidebar(`left`,`main`,`rubber-stamp-panel`,void 0,{selectedLibraryId:`custom`})}}}},visible:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides().forDocument(n);if(!r)return!1;var i=r.getSelectedAnnotations();if(i.length===0)return!1;var a=[z.REDACT,z.HIGHLIGHT,z.SQUIGGLY,z.UNDERLINE,z.STRIKEOUT,z.CARET,z.WIDGET];return i.every(function(e){return!a.includes(e.object.type)})},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)||$(t,n,U.CopyContents)}},"annotation:overflow-tools":{id:`annotation:overflow-tools`,labelKey:`annotation.moreTools`,icon:`dots`,categories:[`annotation`,`annotation-overflow`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`ui`)?.provides();if(r){var i=r.forDocument(n);i&&i.toggleMenu(`annotation-tools-menu`,`annotation:overflow-tools`,`overflow-annotation-tools`)}},active:function(e){var t=e.state,n=e.documentId;return(t.plugins.ui?.documents[n])?.openMenus[`annotation-tools-menu`]!==void 0},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:overflow-shapes":{id:`annotation:overflow-shapes`,labelKey:`annotation.moreTools`,icon:`dots`,categories:[`annotation`,`annotation-shape`,`annotation-overflow`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`ui`)?.provides();if(r){var i=r.forDocument(n);i&&i.toggleMenu(`shapes-tools-menu`,`annotation:overflow-shapes`,`overflow-shapes-tools`)}},active:function(e){var t=e.state,n=e.documentId;return(t.plugins.ui?.documents[n])?.openMenus[`shapes-tools-menu`]!==void 0},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"form:overflow-tools":{id:`form:overflow-tools`,labelKey:`annotation.moreTools`,icon:`dots`,categories:[`form`,`form-overflow`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`ui`)?.provides();if(r){var i=r.forDocument(n);i&&i.toggleMenu(`form-tools-menu`,`form:overflow-tools`,`overflow-forms-tools`)}},active:function(e){var t=e.state,n=e.documentId;return(t.plugins.ui?.documents[n])?.openMenus[`form-tools-menu`]!==void 0},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:add-link":{id:`annotation:add-link`,labelKey:`annotation.addLink`,icon:`link`,categories:[`annotation`,`annotation-link`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`ui`)?.provides();r&&r.forDocument(n).openModal(`link-modal`,{source:`selection`})},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:toggle-annotation-style":{id:`annotation:toggle-annotation-style`,labelKey:`annotation.style`,icon:`palette`,categories:[`annotation`,`annotation-style`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa);if(r&&r.provides){var i=r.provides();i&&i.forDocument(n).toggleSidebar(`left`,`main`,`annotation-panel`)}},active:function(e){var t=e.state,n=e.documentId;return mo(t.plugins,n,`left`,`main`,`annotation-panel`)},visible:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides().forDocument(n))?.getSelectedAnnotation();return!r||r.object.type!==z.LINK},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:toggle-link":{id:`annotation:toggle-link`,labelKey:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides().forDocument(n);if(!r)return`annotation.addLink`;var i=r.getSelectedAnnotation();return i&&r.hasAttachedLinks(i.object.id)?`annotation.removeLink`:`annotation.addLink`},icon:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides().forDocument(n);if(!r)return`link`;var i=r.getSelectedAnnotation();return i&&r.hasAttachedLinks(i.object.id)?`linkOff`:`link`},categories:[`annotation`,`annotation-link`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides(),i=t.getPlugin(`ui`)?.provides();if(r&&i){var a=r.forDocument(n),o=a.getSelectedAnnotation();o&&(a.hasAttachedLinks(o.object.id)?a.deleteAttachedLinks(o.object.id):i.forDocument(n).openModal(`link-modal`,{source:`annotation`}))}},visible:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides().forDocument(n))?.getSelectedAnnotation();return!r||r.object.type!==z.LINK&&r.object.type!==z.REDACT&&r.object.type!==z.WIDGET},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyAnnotations)}},"annotation:toggle-widget-edit":{id:`annotation:toggle-widget-edit`,labelKey:`annotation.widgetEdit`,icon:`widgetEdit`,categories:[`annotation`,`annotation-widget-edit`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides(),i=t.getPlugin(`ui`)?.provides();r&&i&&r.forDocument(n).getSelectedAnnotation()&&i.forDocument(n).toggleSidebar(`right`,`main`,`widget-edit-panel`)},active:function(e){var t=e.state,n=e.documentId;return mo(t.plugins,n,`right`,`main`,`widget-edit-panel`)},visible:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides().forDocument(n))?.getSelectedAnnotation();return!r||r.object.type===z.WIDGET}},"annotation:toggle-comment":{id:`annotation:toggle-comment`,labelKey:`annotation.comment`,icon:`comment`,categories:[`annotation`,`annotation-comment`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(sa);if(r&&r.provides){var i=r.provides();i&&i.forDocument(n).toggleSidebar(`right`,`main`,`comment-panel`)}},active:function(e){var t=e.state,n=e.documentId;return mo(t.plugins,n,`right`,`main`,`comment-panel`)},visible:function(e){var t=e.registry,n=e.documentId,r=(t.getPlugin(Y)?.provides().forDocument(n))?.getSelectedAnnotation();return!r||r.object.type!==z.LINK&&r.object.type!==z.WIDGET}},"annotation:goto-link":{id:`annotation:goto-link`,labelKey:`annotation.gotoLink`,icon:`externalLink`,categories:[`annotation`,`annotation-link`],action:function(e){var t,n=e.registry,r=e.documentId,i=n.getPlugin(Y)?.provides();if(i){var a=i.forDocument(r),o=a.getSelectedAnnotation();if(o){var s=null;if(function(e){return e.object.type===z.LINK}(o))s=o.object;else{var c=a.getAttachedLinks(o.object.id);c.length>0&&(s=c[0].object)}(t=s)!=null&&t.target&&a.navigateTarget(s.target)}}},visible:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(Y)?.provides();if(!r)return!1;var i=r.forDocument(n),a=i?.getSelectedAnnotation();return!!a&&(a.object.type===z.LINK||i.hasAttachedLinks(a.object.id))}},"redaction:redact":{id:`redaction:redact`,labelKey:`redaction.redact`,icon:`redactArea`,categories:[`redaction`,`redaction-combined`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`redaction`)?.provides())?.forDocument(n).toggleRedact()},active:function(e){var t,n=e.registry,r=e.documentId;return(t=(n.getPlugin(`redaction`)?.provides())?.forDocument(r).isRedactActive())!=null&&t},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyContents)}},"redaction:redact-area":{id:`redaction:redact-area`,labelKey:`redaction.area`,icon:`redactArea`,categories:[`redaction`,`redaction-area`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`redaction`)?.provides())?.forDocument(n).toggleMarqueeRedact()},active:function(e){var t,n=e.registry,r=e.documentId;return(t=(n.getPlugin(`redaction`)?.provides())?.forDocument(r).isMarqueeRedactActive())!=null&&t},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyContents)}},"redaction:redact-text":{id:`redaction:redact-text`,labelKey:`redaction.text`,icon:`redact`,categories:[`redaction`,`redaction-text`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`redaction`)?.provides(),i=t.getPlugin(cc)?.provides(),a=t.getPlugin(`ui`)?.provides();if(r&&i&&a){var o,s=r.forDocument(n);((i?.forDocument(n))?.getFormattedSelection()??[]).length>0?((o=t.getPlugin(Y))==null||o.provides().forDocument(n).setLocked({type:yu.Exclude,categories:[`redaction`]}),s.queueCurrentSelectionAsPending(),a.setActiveToolbar(`top`,`secondary`,`redaction-toolbar`,n)):s.toggleRedactSelection()}},active:function(e){var t=e.state,n=e.documentId;return t.plugins[Zh]?.documents[n]?.activeType===Dh.RedactSelection},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyContents)}},"redaction:apply-all":{id:`redaction:apply-all`,labelKey:`redaction.applyAll`,icon:`check`,categories:[`redaction`,`redaction-apply`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`redaction`)?.provides())?.forDocument(n).commitAllPending()},disabled:function(e){var t=e.state,n=e.documentId;return t.plugins[Zh]?.documents[n]?.pendingCount===0||$(t,n,U.ModifyContents)}},"redaction:clear-all":{id:`redaction:clear-all`,labelKey:`redaction.clearAll`,icon:`x`,categories:[`redaction`,`redaction-clear`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`redaction`)?.provides())?.forDocument(n).clearPending()},disabled:function(e){var t=e.state,n=e.documentId;return t.plugins[Zh]?.documents[n]?.pendingCount===0||$(t,n,U.ModifyContents)}},"redaction:delete-selected":{id:`redaction:delete-selected`,labelKey:`redaction.deleteSelected`,icon:`trash`,categories:[`redaction`,`redaction-delete`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`redaction`)?.provides(),i=r?.forDocument(n).getSelectedPending();i&&r?.forDocument(n).removePending(i.page,i.id)}},"redaction:commit-selected":{id:`redaction:commit-selected`,labelKey:`redaction.commitSelected`,icon:`check`,categories:[`redaction`,`redaction-commit`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`redaction`)?.provides(),i=r?.forDocument(n).getSelectedPending();i&&r?.forDocument(n).commitPending(i.page,i.id)}},"annotation:apply-redaction":{id:`annotation:apply-redaction`,labelKey:`redaction.apply`,icon:`check`,categories:[`annotation`,`annotation-redaction`,`redaction`],action:function(e){var t=e.registry,n=e.documentId,r=e.logger;r.debug(`Command`,`ApplyRedaction`,`Starting for document: ${n}`);var i=t.getPlugin(Y)?.provides(),a=t.getPlugin(Zh)?.provides();if(i&&a){var o=i.forDocument(n).getSelectedAnnotation();r.debug(`Command`,`ApplyRedaction`,`Selected annotation: ${o?JSON.stringify({id:o.object.id,type:o.object.type,pageIndex:o.object.pageIndex}):`none`}`),o&&o.object.type===z.REDACT?(r.debug(`Command`,`ApplyRedaction`,`Calling commitPending for page ${o.object.pageIndex}, id ${o.object.id}`),a.forDocument(n).commitPending(o.object.pageIndex,o.object.id),r.debug(`Command`,`ApplyRedaction`,`commitPending called successfully`)):r.warn(`Command`,`ApplyRedaction`,`No valid redaction selected - selected: ${!!o}, type: ${o?.object.type}`)}else r.warn(`Command`,`ApplyRedaction`,`Missing plugins - annotation: ${!!i}, redaction: ${!!a}`)},visible:function(e){var t=e.registry,n=e.documentId;return((t.getPlugin(Y)?.provides().forDocument(n))?.getSelectedAnnotation())?.object.type===z.REDACT},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.ModifyContents)}},"selection:copy-to-clipboard":{id:`selection:copy-to-clipboard`,labelKey:`selection.copyToClipboard`,icon:`copy`,shortcuts:[`Ctrl+C`,`Meta+C`],categories:[`selection`,`selection-copy-to-clipboard`],action:function(e){var t=e.registry,n=e.documentId;(t.getPlugin(`selection`)?.provides().forDocument(n))?.copyToClipboard()},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.CopyContents)}},"selection:copy":{id:`selection:copy`,labelKey:`selection.copy`,icon:`copy`,categories:[`selection`,`selection-copy`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(`selection`)?.provides().forDocument(n);r?.copyToClipboard(),r?.clear()},disabled:function(e){var t=e.state,n=e.documentId;return $(t,n,U.CopyContents)}},"history:undo":{id:`history:undo`,labelKey:`history.undo`,icon:`arrowBackUp`,shortcuts:[`Ctrl+Z`,`Meta+Z`],categories:[`history`,`history-undo`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(_h)?.provides();r&&r.forDocument(n).undo()},disabled:function(e){var t=e.state,n=e.documentId,r=t.plugins[_h]?.documents[n];return!(r!=null&&r.global.canUndo)}},"history:redo":{id:`history:redo`,labelKey:`history.redo`,icon:`arrowForwardUp`,shortcuts:[`Ctrl+Y`,`Meta+Shift+Z`],categories:[`history`,`history-redo`],action:function(e){var t=e.registry,n=e.documentId,r=t.getPlugin(_h)?.provides();r&&r.forDocument(n).redo()},disabled:function(e){var t=e.state,n=e.documentId,r=t.plugins[_h]?.documents[n];return!(r!=null&&r.global.canRedo)}}},_C={"zoom.level":function(e){var t,n,r=e.state,i=e.documentId,a=i&&(t=(n=r.plugins[ls])==null||(n=n.documents[i])==null?void 0:n.currentZoomLevel)!=null?t:1;return{level:Math.round(100*a)}}},vC={colors:{background:{app:`#f3f4f6`,surface:`#ffffff`,surfaceAlt:`#f1f3f5`,elevated:`#ffffff`,overlay:`rgba(0, 0, 0, 0.5)`,input:`#ffffff`},foreground:{primary:`#111827`,secondary:`#374151`,muted:`#6b7280`,disabled:`#9ca3af`,onAccent:`#ffffff`},border:{default:`#d1d5db`,subtle:`#e5e7eb`,strong:`#9ca3af`},accent:{primary:`#3b82f6`,primaryHover:`#2563eb`,primaryActive:`#1d4ed8`,primaryLight:`#eff6ff`,primaryForeground:`#ffffff`},interactive:{hover:`#f3f4f6`,active:`#e5e7eb`,selected:`#eff6ff`,focus:`#3b82f6`,focusRing:`#bfdbfe`},state:{error:`#ef4444`,errorLight:`#fef2f2`,warning:`#f59e0b`,warningLight:`#fffbeb`,success:`#22c55e`,successLight:`#f0fdf4`,info:`#3b82f6`,infoLight:`#eff6ff`},tooltip:{background:`#111827`,foreground:`#ffffff`},scrollbar:{track:`#f3f4f6`,thumb:`#d1d5db`,thumbHover:`#9ca3af`}}},yC={colors:{background:{app:`#111827`,surface:`#1f2937`,surfaceAlt:`#374151`,elevated:`#1f2937`,overlay:`rgba(0, 0, 0, 0.7)`,input:`#374151`},foreground:{primary:`#f9fafb`,secondary:`#e5e7eb`,muted:`#9ca3af`,disabled:`#6b7280`,onAccent:`#111827`},border:{default:`#4b5563`,subtle:`#374151`,strong:`#6b7280`},accent:{primary:`#60a5fa`,primaryHover:`#3b82f6`,primaryActive:`#2563eb`,primaryLight:`#1e3a5f`,primaryForeground:`#111827`},interactive:{hover:`#374151`,active:`#4b5563`,selected:`#1e3a5f`,focus:`#60a5fa`,focusRing:`#1e40af`},state:{error:`#f87171`,errorLight:`#7f1d1d`,warning:`#fbbf24`,warningLight:`#78350f`,success:`#4ade80`,successLight:`#14532d`,info:`#60a5fa`,infoLight:`#1e3a5f`},tooltip:{background:`#f9fafb`,foreground:`#111827`},scrollbar:{track:`#1f2937`,thumb:`#4b5563`,thumbHover:`#6b7280`}}};function bC(e,t){var n=g({},e);for(var r in t){var i=t[r];i&&w(i)===`object`&&!Array.isArray(i)?n[r]=bC(e[r]||{},i):i!==void 0&&(n[r]=i)}return n}function xC(e,t){return{colors:bC(e.colors,t)}}function SC(e){return e===`system`?typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e}function CC(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function wC(e){return`:host {
2361
+ ${function(e){var t=[];return function e(n,r){for(var i=0,a=Object.entries(n);i<a.length;i++){var o=x(a[i],2),s=o[0],c=o[1];c&&w(c)===`object`?e(c,`${r}-${CC(s)}`):c!==void 0&&t.push(` --ep${r}-${CC(s)}: ${c};`)}}(e.colors,``),t.join(`
2362
+ `)}(e)}
2363
+ }`}function TC(e){var t=e.documentStates,n=e.activeDocumentId,r=e.visibility,i=r===void 0?`multiple`:r,a=e.allowOpenFile,o=a===void 0||a,s=Ro().provides,c=F(function(e){s?.setActiveDocument(e)},[s]),l=F(function(e){s?.closeDocument(e)},[s]),u=F(function(){s?.openFileDialog()},[s]);return i===`always`||i===`multiple`&&t.length>1?k(`div`,{className:`bg-bg-surface-alt flex items-end pr-2 pt-2`},k(`div`,{className:`flex flex-1 items-end overflow-x-auto pl-4`},t.map(function(e){var t=n===e.id;return k(`div`,{key:e.id,onClick:function(){return c(e.id)},role:`tab`,tabIndex:0,"aria-selected":t,onKeyDown:function(t){t.key!==`Enter`&&t.key!==` `||(t.preventDefault(),c(e.id))},className:`group relative flex min-w-[120px] max-w-[240px] cursor-pointer items-center gap-2 rounded-t-lg px-4 py-2 text-sm font-medium transition-all ${t?`bg-bg-surface text-fg-primary z-10`:`bg-bg-surface-alt text-fg-secondary hover:bg-interactive-hover hover:text-fg-primary`}`},k(`span`,{className:`min-w-0 flex-1 truncate`},e.name??`Document ${e.id.slice(0,8)}`),t&&k(`button`,{onClick:function(t){t.stopPropagation(),l(e.id)},"aria-label":`Close ${e.name??`document`}`,className:`hover:bg-interactive-hover flex-shrink-0 cursor-pointer rounded-full p-1 transition-all ${t?`opacity-100`:`opacity-0 group-hover:opacity-100`}`},k(Q,{icon:`x`,size:14})))}),o&&k(`button`,{onClick:u,className:`text-fg-secondary hover:bg-interactive-hover hover:text-fg-primary mb-1.5 ml-1 flex-shrink-0 cursor-pointer rounded p-1.5 transition-colors`,"aria-label":`Open File`,title:`Open File`},k(Q,{icon:`plus`,size:14})))):null}function EC(){var e=Ro().provides,t=os().translate;return k(`div`,{className:`bg-bg-app flex h-full w-full items-center justify-center`},k(`div`,{className:`flex max-w-sm flex-col items-center text-center`},k(`div`,{className:`bg-accent-light mb-6 rounded-full p-5`},k(Q,{icon:`file`,size:48,className:`text-accent`})),k(`h2`,{className:`text-fg-primary mb-2 text-xl font-semibold`},t(`emptyState.title`)),k(`p`,{className:`text-fg-secondary mb-6 text-sm leading-relaxed`},t(`emptyState.description`),k(`br`,null),t(`emptyState.descriptionMulti`)),k(`button`,{onClick:function(){e?.openFileDialog()},className:`bg-accent hover:bg-accent-hover text-accent-fg inline-flex cursor-pointer items-center gap-2 rounded-md px-5 py-2.5 text-sm font-medium shadow-sm transition-all`},k(Q,{icon:`plus`,size:16}),t(`emptyState.openButton`)),k(`p`,{className:`text-fg-muted mt-4 text-xs`},t(`emptyState.supportedFormats`))))}function DC(e){var t=e.documentState,n=Ro().provides,r=os().translate,i=x(j(``),2),a=i[0],s=i[1],c=x(j(!1),2),l=c[0],u=c[1];if(!t)return null;var d=t.name,f=t.errorCode,p=t.passwordProvided,m=f===W.Password,h=m&&!p,g=m&&p;if(!m)return k(`div`,{className:`bg-bg-app flex h-full items-center justify-center p-8`},k(`div`,{className:`bg-bg-surface border-border-default flex max-w-sm flex-col items-center rounded-xl border p-6 text-center shadow-lg`},k(`div`,{className:`bg-state-error-light mb-4 rounded-full p-4`},k(Q,{icon:`alertTriangle`,size:28,className:`text-state-error`})),k(`h3`,{className:`text-fg-primary text-lg font-semibold`},r(`documentError.title`)),k(`p`,{className:`text-fg-secondary mt-2 text-sm`},t.error||r(`documentError.unknown`)),f&&k(`p`,{className:`text-fg-muted mt-1 text-xs`},r(`documentError.errorCode`,{params:{code:String(f)}})),k(`button`,{onClick:function(){return n?.closeDocument(t.id)},className:`bg-accent hover:bg-accent-hover text-accent-fg mt-5 w-full cursor-pointer rounded-md px-4 py-2.5 text-sm font-medium transition-colors`},r(`documentError.close`))));var _=function(){var e=o(v().m(function e(){return v().w(function(e){for(;;)switch(e.n){case 0:if(n&&a.trim()){e.n=1;break}return e.a(2);case 1:u(!0),n.retryDocument(t.id,{password:a}).wait(function(){s(``),u(!1)},function(e){console.error(`Retry failed:`,e),u(!1)});case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return k(`div`,{className:`bg-bg-app flex h-full items-center justify-center p-8`},k(`div`,{className:`bg-bg-surface border-border-default w-full max-w-sm rounded-xl border p-6 shadow-lg`},k(`div`,{className:`flex flex-col items-center text-center`},k(`div`,{className:`bg-accent-light mb-4 rounded-full p-4`},k(Q,{icon:`lock`,size:28,className:`text-accent`})),k(`h3`,{className:`text-fg-primary text-lg font-semibold`},r(`passwordPrompt.title`)),d&&k(`p`,{className:`text-fg-muted mt-1 text-sm`},d)),k(`p`,{className:`text-fg-secondary mt-4 text-center text-sm`},h&&r(`passwordPrompt.required`),g&&r(`passwordPrompt.incorrect`)),k(`div`,{className:`mt-5`},k(`label`,{className:`text-fg-primary mb-1.5 block text-sm font-medium`},r(`passwordPrompt.label`)),k(`input`,{type:`password`,value:a,onInput:function(e){return s(e.target.value)},onKeyDown:function(e){return e.key===`Enter`&&!l&&a.trim()&&_()},disabled:l,placeholder:r(`passwordPrompt.placeholder`),className:`bg-bg-input border-border-default focus:border-accent focus:ring-accent text-fg-primary placeholder:text-fg-muted block w-full rounded-md border px-3 py-2.5 text-sm focus:outline-none focus:ring-1 disabled:opacity-50`,autoFocus:!0})),g&&k(`div`,{className:`bg-state-error-light border-state-error mt-3 flex items-center gap-2 rounded-md border p-3`},k(Q,{icon:`alertTriangle`,size:16,className:`text-state-error flex-shrink-0`}),k(`p`,{className:`text-state-error text-sm`},r(`passwordPrompt.incorrectWarning`))),k(`div`,{className:`mt-6 flex gap-3`},k(`button`,{onClick:function(){return n?.closeDocument(t.id)},disabled:l,className:`border-border-default text-fg-secondary hover:bg-interactive-hover flex-1 cursor-pointer rounded-md border px-4 py-2.5 text-sm font-medium transition-colors disabled:opacity-50`},r(`passwordPrompt.cancel`)),k(`button`,{onClick:_,disabled:l||!a.trim(),className:`bg-accent hover:bg-accent-hover text-accent-fg flex-1 cursor-pointer rounded-md px-4 py-2.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50`},r(l?`passwordPrompt.opening`:`passwordPrompt.open`)))))}function OC(e){var t=e.documentId,n=e.className,r=Jo(`mode:view`,t),i=Jo(`mode:annotate`,t),a=Jo(`mode:shapes`,t),o=Jo(`mode:redact`,t),s=Jo(`mode:form`,t),c=Jo(`mode:insert`,t),l=Jo(`tabs:overflow-menu`,t),u=P(function(){return[r,i,a,s,c,o].find(function(e){return e?.active})||r},[r,i,a,s,c,o]),d=F(function(e){e.preventDefault(),e.stopPropagation(),l&&!l.disabled&&l.execute()},[l]);if(!l||!l.visible)return null;var f=l.active;return k(`div`,{style:{maxWidth:`100px`,width:`100px`},className:n},k(Oy,{className:`bg-bg-surface col-start-1 row-start-1 !w-full appearance-none rounded-md py-1.5 pl-3 pr-2 text-[13px] ${f?`bg-interactive-selected ring-accent border-none shadow ring`:`border-border-default outline-border-default hover:bg-interactive-hover hover:ring-accent outline outline-1 -outline-offset-1 hover:ring`} flex flex-row items-center justify-between gap-2`,onClick:d,disabled:l.disabled,style:{height:34}},k(`span`,{className:`min-w-0 flex-1 truncate text-left ${f?`text-accent`:`text-fg-primary`}`},u?.label),k(Q,{icon:`chevronDown`,className:`h-4 w-4 ${f?`text-accent`:`text-fg-secondary`}`})))}function kC(e){var t=e.documentId,n=hh().provides,r=x(j(!1),2),i=r[0],a=r[1],o=x(j(null),2),s=o[0],c=o[1],l=x(j(null),2),u=l[0],d=l[1],f=x(j(null),2),p=f[0],m=f[1],h=N(null),g=N(null),_=os(t).translate,v=function(){h.current&&=(URL.revokeObjectURL(h.current),null),p&&(URL.revokeObjectURL(p),m(null)),a(!1),c(null),d(null)};return M(function(){if(n)return n.onCaptureArea(function(e){var t=e.pageIndex,n=e.rect,r=e.blob;c({pageIndex:t,rect:n,blob:r});var i=URL.createObjectURL(r);h.current=i,d(i),a(!0)})},[n]),k(A,null,k(YS,{open:i,onClose:v,title:_(`capture.title`),className:`md:w-[48rem]`},k(`div`,{className:`space-y-6`},k(`div`,{className:`flex justify-center`},u&&k(`img`,{src:u,onLoad:function(){h.current&&=(URL.revokeObjectURL(h.current),null)},alt:`Captured PDF area`,style:{maxWidth:`100%`,maxHeight:`400px`,border:`1px solid #e5e7eb`,borderRadius:`4px`,display:`block`}})),k(`div`,{className:`border-border-subtle flex justify-end space-x-3 border-t pt-4`},k(Oy,{onClick:v,className:`border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},_(`capture.cancel`)),k(Oy,{onClick:function(){if(s&&g.current){var e=URL.createObjectURL(s.blob);m(e),g.current.href=e,g.current.download=`pdf-capture-page-${s.pageIndex+1}.png`,g.current.click(),v()}},disabled:!s,className:`bg-accent text-fg-on-accent hover:!bg-accent-hover flex items-center space-x-2 rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},_(`capture.download`))))),k(`a`,{ref:g,style:{display:`none`},href:``,download:``}))}var AC=[{flag:U.Print,labelKey:`protect.permissions.print`},{flag:U.PrintHighQuality,labelKey:`protect.permissions.printHighQuality`},{flag:U.CopyContents,labelKey:`protect.permissions.copy`},{flag:U.ExtractForAccessibility,labelKey:`protect.permissions.accessibility`},{flag:U.ModifyContents,labelKey:`protect.permissions.modify`},{flag:U.ModifyAnnotations,labelKey:`protect.permissions.annotations`},{flag:U.FillForms,labelKey:`protect.permissions.fillForms`},{flag:U.AssembleDocument,labelKey:`protect.permissions.assemble`}];function jC(e){var t=e.permissions,n=e.translate,r=e.label;return k(`div`,null,k(`label`,{className:`text-fg-secondary mb-2 block text-sm font-medium`},r??n(`security.viewPermissions.restrictedActions`)),k(`div`,{className:`grid grid-cols-1 gap-1 sm:grid-cols-2`},AC.map(function(e){var r,i=(r=e.flag,(t&r)!==0);return k(`div`,{key:e.flag,className:`flex items-center rounded-md p-2 ${i?`text-fg-primary`:`text-fg-muted`}`},k(Q,{icon:i?`check`:`x`,className:`mr-2 h-4 w-4 flex-shrink-0 ${i?`text-state-success`:`text-state-error`}`}),k(`span`,{className:`text-sm`},n(e.labelKey)))})))}function MC(e){var t,n,r=e.documentId,i=e.isOpen,a=e.onClose,o=e.onExited,s=os(r).translate,c=Ro().provides,l=ni(r)?.document,d=(t=l?.isEncrypted)!=null&&t,f=(n=l?.isOwnerUnlocked)!=null&&n,p=l?.permissions??0,m=x(j(`edit-protection`),2),h=m[0],g=m[1],_=x(j(``),2),v=_[0],y=_[1],b=x(j(!1),2),S=b[0],C=b[1],w=x(j(!1),2),T=w[0],E=w[1],D=x(j(null),2),O=D[0],ee=D[1],te=x(j(!1),2),ne=te[0],re=te[1],ie=x(j(``),2),ae=ie[0],oe=ie[1],se=x(j(``),2),ce=se[0],le=se[1],ue=x(j(!1),2),de=ue[0],fe=ue[1],pe=x(j(!1),2),me=pe[0],he=pe[1],A=x(j(``),2),ge=A[0],_e=A[1],ve=x(j(``),2),ye=ve[0],be=ve[1],xe=x(j(!1),2),Se=xe[0],Ce=xe[1],we=x(j(new Set(AC.map(function(e){return e.flag}))),2),Te=we[0],Ee=we[1],De=x(j(!1),2),Oe=De[0],ke=De[1],Ae=x(j(null),2),je=Ae[0],Me=Ae[1];M(function(){i&&(y(``),C(!1),E(!1),ee(null),re(!1),oe(``),le(``),fe(!1),he(!1),_e(``),be(``),Ce(!1),Ee(new Set(AC.map(function(e){return e.flag}))),ke(!1),Me(null),g(d&&!f?`unlock`:d&&f?`choose-action`:`edit-protection`))},[i,d,f]);var Ne=ae===ce,Pe=ge===ye,Fe=!ne||ae.length>0&&Ne,Ie=!me||ge.length>0&&Pe,Le=(ne||me)&&Fe&&Ie&&!Oe,Re=function(){c&&v&&(E(!0),ee(null),c.unlockOwnerPermissions(r,v).wait(function(e){E(!1),e?g(`choose-action`):ee(s(`security.unlock.invalidPassword`))},function(e){E(!1),ee(e.reason?.message??s(`security.unlock.failed`))}))},ze=function(){if(Le&&c){var e=0;if(me){var t,n=u(Te);try{for(n.s();!(t=n.n()).done;)e|=t.value}catch(e){n.e(e)}finally{n.f()}}else e=U.AllowAll;var i=ne?ae:``,o=me?ge:ne?ae:``;ke(!0),Me(null),c.setDocumentEncryption(r,{userPassword:i,ownerPassword:o,allowedFlags:e}).wait(function(e){ke(!1),e?a?.():Me(s(`protect.applyFailed`))},function(e){ke(!1),Me(e.reason?.message??s(`protect.applyFailed`))})}},Be=function(){c&&(ke(!0),Me(null),c.removeEncryption(r).wait(function(e){ke(!1),e?a?.():Me(s(`protect.removeFailed`))},function(e){ke(!1),Me(e.reason?.message??s(`protect.removeFailed`))}))},Ve=function(){return k(`div`,{className:`space-y-6`},k(`div`,{className:`bg-bg-subtle rounded-lg`},k(`label`,{className:`flex cursor-pointer items-start`},k(`input`,{type:`checkbox`,checked:ne,onChange:function(e){return re(e.target.checked)},className:`accent-accent mr-3 mt-0.5`}),k(`div`,{className:`flex-1`},k(`span`,{className:`text-fg-primary block font-medium`},s(`protect.openPassword.title`)),k(`span`,{className:`text-fg-muted text-sm`},s(`protect.openPassword.description`)))),ne&&k(`div`,{className:`mt-4 space-y-3 pl-6`},k(`div`,null,k(`label`,{className:`text-fg-secondary mb-1 block text-sm`},s(`protect.openPassword.label`)),k(`div`,{className:`relative`},k(`input`,{type:de?`text`:`password`,value:ae,onInput:function(e){return oe(e.target.value)},placeholder:s(`protect.openPassword.placeholder`),className:`border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 pr-10 text-sm focus:outline-none focus:ring-1`}),k(`button`,{type:`button`,onClick:function(){return fe(!de)},className:`text-fg-muted hover:text-fg-secondary absolute right-2 top-1/2 -translate-y-1/2`},k(Q,{icon:de?`eye-off`:`eye`,className:`h-4 w-4`})))),k(`div`,null,k(`label`,{className:`text-fg-secondary mb-1 block text-sm`},s(`protect.openPassword.confirm`)),k(`input`,{type:de?`text`:`password`,value:ce,onInput:function(e){return le(e.target.value)},placeholder:s(`protect.openPassword.confirmPlaceholder`),className:`border-border-default bg-bg-input text-fg-primary focus:ring-accent w-full rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-1 ${ce&&!Ne?`border-state-error focus:border-state-error`:`focus:border-accent`}`}),ce&&!Ne&&k(`p`,{className:`text-state-error mt-1 text-xs`},s(`protect.passwordMismatch`))))),k(`div`,{className:`bg-bg-subtle rounded-lg`},k(`label`,{className:`flex cursor-pointer items-start`},k(`input`,{type:`checkbox`,checked:me,onChange:function(e){return he(e.target.checked)},className:`accent-accent mr-3 mt-0.5`}),k(`div`,{className:`flex-1`},k(`span`,{className:`text-fg-primary block font-medium`},s(`protect.permissions.title`)),k(`span`,{className:`text-fg-muted text-sm`},s(`protect.permissions.description`)))),me&&k(`div`,{className:`mt-4 space-y-4 pl-6`},k(`div`,{className:`border-border-subtle border-b pb-4`},k(`div`,null,k(`label`,{className:`text-fg-secondary mb-1 block text-sm`},s(`protect.ownerPassword.label`)),k(`div`,{className:`relative`},k(`input`,{type:Se?`text`:`password`,value:ge,onInput:function(e){return _e(e.target.value)},placeholder:s(`protect.ownerPassword.placeholder`),className:`border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 pr-10 text-sm focus:outline-none focus:ring-1`}),k(`button`,{type:`button`,onClick:function(){return Ce(!Se)},className:`text-fg-muted hover:text-fg-secondary absolute right-2 top-1/2 -translate-y-1/2`},k(Q,{icon:Se?`eye-off`:`eye`,className:`h-4 w-4`})))),k(`div`,{className:`mt-3`},k(`label`,{className:`text-fg-secondary mb-1 block text-sm`},s(`protect.ownerPassword.confirm`)),k(`input`,{type:Se?`text`:`password`,value:ye,onInput:function(e){return be(e.target.value)},placeholder:s(`protect.ownerPassword.confirmPlaceholder`),className:`border-border-default bg-bg-input text-fg-primary focus:ring-accent w-full rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-1 ${ye&&!Pe?`border-state-error focus:border-state-error`:`focus:border-accent`}`}),ye&&!Pe&&k(`p`,{className:`text-state-error mt-1 text-xs`},s(`protect.passwordMismatch`)))),k(`div`,null,k(`label`,{className:`text-fg-secondary mb-2 block text-sm font-medium`},s(`protect.permissions.allowedActions`)),k(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2`},AC.map(function(e){return k(`label`,{key:e.flag,className:`hover:bg-bg-surface flex cursor-pointer items-center rounded-md p-2 transition-colors`},k(`input`,{type:`checkbox`,checked:Te.has(e.flag),onChange:function(){t=e.flag,Ee(function(e){var n=new Set(e);return n.has(t)?n.delete(t):(n.add(t),t===U.PrintHighQuality&&n.add(U.Print)),n});return;var t},className:`accent-accent mr-2`}),k(`span`,{className:`text-fg-primary text-sm`},s(e.labelKey)))}))))),ne&&me&&k(`div`,{className:`bg-state-info-light flex items-start space-x-2 rounded-md p-3`},k(Q,{icon:`info`,className:`text-accent mt-0.5 h-4 w-4 flex-shrink-0`}),k(`p`,{className:`text-fg-secondary text-sm`},s(`protect.bothPasswordsNote`))),!ne&&!me&&!je&&k(`div`,{className:`bg-state-warning-light flex items-start space-x-2 rounded-md p-3`},k(Q,{icon:`alertTriangle`,className:`text-state-warning mt-0.5 h-4 w-4 flex-shrink-0`}),k(`p`,{className:`text-fg-secondary text-sm`},s(`protect.noProtectionSelected`))),je&&k(`div`,{className:`bg-state-error-light flex items-start space-x-2 rounded-md p-3`},k(Q,{icon:`alertTriangle`,className:`text-state-error mt-0.5 h-4 w-4 flex-shrink-0`}),k(`p`,{className:`text-state-error text-sm`},je)),k(`div`,{className:`border-border-subtle flex justify-end space-x-3 border-t pt-4`},d&&f&&k(Oy,{onClick:function(){return g(`choose-action`)},disabled:Oe,className:`border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},s(`common.back`)),k(Oy,{onClick:ze,disabled:!Le,className:`bg-accent text-fg-on-accent hover:!bg-accent-hover flex items-center space-x-2 rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},Oe&&k(Ax,{size:`sm`}),k(`span`,null,s(Oe?`protect.applying`:`protect.apply`)))))};return k(YS,{open:i!=null&&i,title:function(){switch(h){case`unlock`:return s(`protect.encrypted.title`);case`choose-action`:return s(`protect.modifyProtection.title`);case`remove-protection`:return s(`protect.removeProtection.title`);default:return s(`protect.title`)}}(),onClose:a,onExited:o,className:`md:w-[36rem]`},function(){switch(h){case`unlock`:return k(`div`,{className:`space-y-5`},k(`p`,{className:`text-fg-secondary text-sm`},s(`protect.encrypted.description`)),k(`div`,null,k(`label`,{className:`text-fg-primary mb-2 block text-sm font-medium`},s(`protect.encrypted.enterOwnerPassword`)),k(`div`,{className:`relative`},k(`input`,{type:S?`text`:`password`,value:v,onInput:function(e){return y(e.target.value)},placeholder:s(`protect.ownerPassword.placeholder`),className:`border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 pr-10 text-sm focus:outline-none focus:ring-1`,onKeyDown:function(e){e.key===`Enter`&&v&&Re()}}),k(`button`,{type:`button`,onClick:function(){return C(!S)},className:`text-fg-muted hover:text-fg-secondary absolute right-2 top-1/2 -translate-y-1/2`},k(Q,{icon:S?`eye-off`:`eye`,className:`h-4 w-4`}))),O&&k(`p`,{className:`text-state-error mt-2 text-xs`},O)),k(jC,{permissions:p,translate:s}),k(`div`,{className:`border-border-subtle flex justify-end space-x-3 border-t pt-4`},k(Oy,{onClick:Re,disabled:!v||T,className:`bg-accent text-fg-on-accent hover:!bg-accent-hover flex items-center space-x-2 rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},T&&k(Ax,{size:`sm`}),k(`span`,null,s(`protect.encrypted.unlockAndEdit`)))));case`choose-action`:return k(`div`,{className:`space-y-5`},k(`p`,{className:`text-fg-secondary text-sm`},s(`protect.modifyProtection.description`)),k(`div`,{className:`space-y-3`},k(`button`,{type:`button`,onClick:function(){return g(`edit-protection`)},className:`border-border-default hover:border-accent hover:bg-bg-subtle flex w-full items-center rounded-lg border p-4 text-left transition-colors`},k(`div`,{className:`bg-accent/10 mr-4 rounded-full p-2`},k(Q,{icon:`lock`,size:20,className:`text-accent`})),k(`div`,null,k(`span`,{className:`text-fg-primary block font-medium`},s(`protect.modifyProtection.changeOption`)),k(`span`,{className:`text-fg-muted text-sm`},s(`protect.modifyProtection.changeDescription`)))),k(`button`,{type:`button`,onClick:function(){return g(`remove-protection`)},className:`border-border-default hover:border-state-error hover:bg-state-error-light flex w-full items-center rounded-lg border p-4 text-left transition-colors`},k(`div`,{className:`bg-state-error-light mr-4 rounded-full p-2`},k(Q,{icon:`unlock`,size:20,className:`text-state-error`})),k(`div`,null,k(`span`,{className:`text-fg-primary block font-medium`},s(`protect.modifyProtection.removeOption`)),k(`span`,{className:`text-fg-muted text-sm`},s(`protect.modifyProtection.removeDescription`))))),k(`div`,{className:`border-border-subtle flex justify-end border-t pt-4`},k(Oy,{onClick:a,className:`border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm`},s(`protect.cancel`))));case`remove-protection`:return k(`div`,{className:`space-y-5`},k(`div`,{className:`bg-state-warning-light flex items-start space-x-3 rounded-lg p-4`},k(Q,{icon:`alertTriangle`,className:`text-state-warning mt-0.5 h-5 w-5 flex-shrink-0`}),k(`div`,null,k(`p`,{className:`text-fg-primary font-medium`},s(`protect.removeProtection.warning`)),k(`p`,{className:`text-fg-secondary mt-1 text-sm`},s(`protect.removeProtection.description`)))),je&&k(`div`,{className:`bg-state-error-light flex items-start space-x-2 rounded-md p-3`},k(Q,{icon:`alertTriangle`,className:`text-state-error mt-0.5 h-4 w-4 flex-shrink-0`}),k(`p`,{className:`text-state-error text-sm`},je)),k(`div`,{className:`border-border-subtle flex justify-end space-x-3 border-t pt-4`},k(Oy,{onClick:function(){return g(`choose-action`)},disabled:Oe,className:`border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},s(`common.back`)),k(Oy,{onClick:Be,disabled:Oe,className:`bg-state-error text-fg-on-accent hover:bg-state-error/90 flex items-center space-x-2 rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},Oe&&k(Ax,{size:`sm`}),k(`span`,null,s(`protect.removeProtection.confirm`)))));default:return Ve()}}())}function NC(e){var t,n,r=e.documentId,i=os(r).translate,a=go().provides,o=ni(r)?.document,s=(t=o?.isEncrypted)!=null&&t,c=(n=o?.isOwnerUnlocked)!=null&&n,l=((o?.permissions??U.AllowAll)&U.AllowAll)!==U.AllowAll,u=s&&!c&&l,d=F(function(){a?.forDocument(r).disableOverlay(`unlock-owner-overlay`)},[r,a]),f=F(function(){a?.forDocument(r).disableOverlay(`unlock-owner-overlay`),a?.forDocument(r).openModal(`view-permissions-modal`)},[r,a]);return u?k(`div`,{className:``},k(`div`,{className:`bg-bg-surface border-border-default flex max-w-sm items-start gap-3 rounded-lg border p-4 shadow-lg`},k(`div`,{className:`bg-accent/10 flex-shrink-0 rounded-full p-2`},k(Q,{icon:`lock`,size:20,className:`text-accent`})),k(`div`,{className:`min-w-0 flex-1`},k(`h3`,{className:`text-fg-primary text-sm font-semibold`},i(`security.protected.title`)),k(`p`,{className:`text-fg-secondary mt-1 text-xs leading-relaxed`},i(`security.protected.description`)),k(`button`,{type:`button`,onClick:f,className:`text-accent hover:text-accent-hover mt-2 text-xs font-medium`},i(`security.protected.viewPermissions`))),k(`button`,{type:`button`,onClick:d,className:`text-fg-muted hover:text-fg-secondary -mr-1 -mt-1 flex-shrink-0 p-1`,"aria-label":i(`common.close`)},k(Q,{icon:`x`,size:16})))):null}function PC(e){var t,n=e.documentId,r=e.isOpen,i=e.onClose,a=e.onExited,o=os(n).translate,s=ni(n),c=Ro().provides,l=x(j(``),2),u=l[0],d=l[1],f=x(j(!1),2),p=f[0],m=f[1],h=x(j(!1),2),g=h[0],_=h[1],v=x(j(null),2),y=v[0],b=v[1],S=s?.document,C=S?.permissions??0,w=(t=S?.isOwnerUnlocked)!=null&&t;M(function(){r&&(d(``),m(!1),_(!1),b(null))},[r]);var T=function(){c&&u&&(_(!0),b(null),c.unlockOwnerPermissions(n,u).wait(function(e){_(!1),e?d(``):b(o(`security.unlock.invalidPassword`))},function(e){_(!1),b(e.reason?.message??o(`security.unlock.failed`))}))};return k(YS,{open:r!=null&&r,title:o(`security.viewPermissions.title`),onClose:i,onExited:a,className:`md:w-[32rem]`},k(`div`,{className:`space-y-5`},k(`p`,{className:`text-fg-secondary text-sm`},o(`security.viewPermissions.description`)),!w&&k(`div`,null,k(`label`,{className:`text-fg-primary mb-2 block text-sm font-medium`},o(`security.unlock.label`)),k(`div`,{className:`relative`},k(`input`,{type:p?`text`:`password`,value:u,onInput:function(e){return d(e.target.value)},placeholder:o(`security.unlock.placeholder`),className:`border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 pr-10 text-sm focus:outline-none focus:ring-1`,onKeyDown:function(e){e.key===`Enter`&&u&&T()}}),k(`button`,{type:`button`,onClick:function(){return m(!p)},className:`text-fg-muted hover:text-fg-secondary absolute right-2 top-1/2 -translate-y-1/2`},k(Q,{icon:p?`eye-off`:`eye`,className:`h-4 w-4`}))),y&&k(`p`,{className:`text-state-error mt-2 text-xs`},y),k(Oy,{onClick:T,disabled:!u||g,className:`bg-accent text-fg-on-accent hover:!bg-accent-hover mt-3 flex items-center space-x-2 rounded-md px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50`},g&&k(Ax,{size:`sm`}),k(`span`,null,o(`security.unlock.button`)))),w&&k(`div`,{className:`bg-state-success-light flex items-center space-x-2 rounded-md p-3`},k(Q,{icon:`check`,className:`text-state-success h-4 w-4 flex-shrink-0`}),k(`p`,{className:`text-fg-secondary text-sm`},o(`security.unlock.success`))),k(jC,{permissions:C,translate:o}),k(`div`,{className:`border-border-subtle flex justify-end border-t pt-4`},k(Oy,{onClick:i,className:`border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm`},o(`common.close`)))))}var FC={documentManager:{},commands:{commands:gC},i18n:{defaultLocale:`en`,locales:[{code:`en`,name:`English`,translations:{search:{placeholder:`Search`,caseSensitive:`Case sensitive`,wholeWord:`Whole word`,resultsFound:`{count} results found`,page:`Page {page}`},zoom:{in:`Zoom In`,out:`Zoom Out`,fitWidth:`Fit to Width`,fitPage:`Fit to Page`,marquee:`Marquee Zoom`,menu:`Zoom Menu`,level:`Zoom Level ({level}%)`,dragTip:`Drag to select area to zoom`},pan:{toggle:`Toggle Pan Mode`},pointer:{toggle:`Toggle Pointer Mode`},capture:{screenshot:`Screenshot`,dragTip:`Drag to select area to capture`,title:`Screenshot Preview`,download:`Download`,cancel:`Cancel`},document:{menu:`Document Menu`,open:`Open`,close:`Close`,print:`Print`,protect:`Security`,export:`Export`,fullscreen:`Fullscreen`,loading:`Loading document...`},emptyState:{title:`No Documents Open`,description:`Open a PDF document to get started.`,descriptionMulti:`You can view multiple documents using tabs.`,openButton:`Open Document`,supportedFormats:`Supported format: PDF`},passwordPrompt:{title:`Password Required`,required:`This document is password protected. Please enter the password to open it.`,incorrect:`The password you entered was incorrect. Please try again.`,incorrectWarning:`Incorrect password. Please check and try again.`,label:`Password`,placeholder:`Enter document password`,open:`Open`,opening:`Opening...`,cancel:`Cancel`,close:`Close`},documentError:{title:`Error loading document`,unknown:`An unknown error occurred`,errorCode:`Error Code: {code}`,close:`Close Document`},panel:{sidebar:`Sidebar`,search:`Search`,comment:`Comment`,thumbnails:`Thumbnails`,outline:`Outline`,annotationStyle:`Annotation Style`,redaction:`Redaction Sidebar`},menu:{viewControls:`View Controls`,zoomControls:`Zoom Controls`,moreOptions:`More Options`},outline:{title:`Outline`,loading:`Loading outline...`,noOutline:`No outline available`,noBookmarks:`This document doesn't contain bookmarks`},page:{settings:`Page Settings`,single:`Single Page`,twoOdd:`Two Page (Odd)`,twoEven:`Two Page (Even)`,vertical:`Vertical`,horizontal:`Horizontal`,spreadMode:`Spread Mode`,scrollLayout:`Scroll Layout`,rotation:`Page Rotation`,next:`Next Page`,previous:`Previous Page`},rotate:{clockwise:`Rotate Clockwise`,counterClockwise:`Rotate Counter-Clockwise`},selection:{copy:`Copy Selection`},mode:{view:`View`,annotate:`Annotate`,shapes:`Shapes`,form:`Form`,redact:`Redact`,insert:`Insert`},form:{textfield:`Text Field`,checkbox:`Checkbox`,radio:`Radio Button`,select:`Dropdown`,listbox:`List Box`},annotation:{text:`Text`,highlight:`Highlight`,strikeout:`Strikethrough`,underline:`Underline`,squiggly:`Squiggly`,rectangle:`Rectangle`,circle:`Circle`,line:`Line`,arrow:`Arrow`,polygon:`Polygon`,polyline:`Polyline`,ink:`Ink`,inkHighlighter:`Ink Highlighter`,stamp:`Stamp`,caret:`Caret`,insertText:`Insert Text`,replaceText:`Replace Text`,freeText:`Free Text`,square:`Square`,style:`Annotation Style`,styles:`{type} Styles`,defaults:`{type} Defaults`,color:`Color`,opacity:`Opacity`,blendMode:`Blend mode`,strokeWidth:`Stroke width`,strokeColor:`Stroke color`,borderStyle:`Border style`,fillColor:`Fill color`,fontSize:`Font size`,fontFamily:`Font`,textAlign:`Text alignment`,verticalAlign:`Vertical alignment`,lineEnding:`Line ending`,lineStart:`Line start`,lineEnd:`Line end`,font:`Font`,fontColor:`Font color`,backgroundColor:`Background color`,noStyles:`There are no styles for this annotation.`,noStylesStamp:`There are no styles for stamps.`,selectAnnotation:`Select an annotation to see styles`,deleteSelected:`Delete selected annotation`,deleteAllSelected:`Delete Selected`,multiSelect:`{count} annotations selected`,group:`Group`,ungroup:`Ungroup`,moreTools:`More Tools`,addLink:`Add Link`,removeLink:`Remove Link`,gotoLink:`Go to Link`,comment:`Comment`,callout:`Callout`,redact:`Redact`,overlayText:`Overlay Text`,overlayTextPlaceholder:`e.g., REDACTED`,rotation:`Rotation`},insert:{image:`Image`,rubberStamp:`Rubber Stamp`},redaction:{redact:`Redact`,area:`Redact Area`,text:`Redact Text`,apply:`Apply Redaction`,applyAll:`Apply All`,clearAll:`Clear All`,deleteSelected:`Delete selected redaction`,commitSelected:`Apply selected redaction`,emptyState:`No pending redactions`,panel:{title:`Redactions`,itemCount:`{count} pending redaction`,itemCountPlural:`{count} pending redactions`,clearAll:`Clear All`,redactAll:`Redact All`}},history:{undo:`Undo`,redo:`Redo`},comments:{page:`Page {page}`,commentCount:`{count} comment`,commentCountPlural:`{count} comments`,addComment:`Add comment...`,addReply:`Add reply...`,showAllAnnotations:`Show All Annotations`,closeAllAnnotations:`Close All Annotations`,save:`Save`,cancel:`Cancel`,edit:`Edit`,delete:`Delete`,showMore:`more`,showLess:`less`,emptyState:`Add annotations to be able to comment on them.`},blendMode:{normal:`Normal`,multiply:`Multiply`,screen:`Screen`,overlay:`Overlay`,darken:`Darken`,lighten:`Lighten`,colorDodge:`Color Dodge`,colorBurn:`Color Burn`,hardLight:`Hard Light`,softLight:`Soft Light`,difference:`Difference`,exclusion:`Exclusion`,hue:`Hue`,saturation:`Saturation`,color:`Color`,luminosity:`Luminosity`},print:{title:`Print Settings`,loading:`Preparing document...`,pages:`Pages to print`,all:`All pages`,current:`Current page ({currentPage})`,specify:`Specify pages`,specifyEG:`e.g., 1-3, 5, 8-10`,total:`Total pages in document: {totalPages}`,annotation:`Include annotations`,printing:`Printing...`,print:`Print`,cancel:`Cancel`},protect:{title:`Protect Document`,cancel:`Cancel`,apply:`Apply Protection`,applying:`Applying...`,applyFailed:`Failed to apply protection. Please try again.`,removeFailed:`Failed to remove protection. Please try again.`,passwordMismatch:`Passwords do not match`,noProtectionSelected:`Select at least one protection option to apply.`,bothPasswordsNote:`Users who open with the document password will have restricted permissions. Use the owner password to unlock full access.`,openPassword:{title:`Require password to open`,description:`Users must enter a password to view this document.`,label:`Document Password`,placeholder:`Enter password`,confirm:`Confirm Password`,confirmPlaceholder:`Confirm password`},ownerPassword:{label:`Owner Password`,placeholder:`Enter owner password`,confirm:`Confirm Owner Password`,confirmPlaceholder:`Confirm owner password`},permissions:{title:`Restrict permissions`,description:`Limit what users can do with this document.`,allowedActions:`Allowed actions`,print:`Print`,printHighQuality:`Print high quality`,copy:`Copy content`,accessibility:`Extract for accessibility`,modify:`Modify content`,annotations:`Add/modify annotations & comments`,fillForms:`Fill forms & sign`,assemble:`Assemble & extract pages`},encrypted:{title:`Document is Protected`,description:`This document is protected by the owner. Enter the owner password to modify security settings.`,enterOwnerPassword:`Enter Owner Password to Modify`,unlockAndEdit:`Unlock & Edit`},modifyProtection:{title:`Modify Protection`,description:`Choose how you want to modify the document protection.`,changeOption:`Change Passwords or Permissions`,changeDescription:`Update the document password or permission settings.`,removeOption:`Remove All Protection`,removeDescription:`Remove password protection from this document.`},removeProtection:{title:`Remove Protection`,warning:`Are you sure you want to remove protection?`,description:`This will remove all password protection from the document. Anyone will be able to open and modify it.`,confirm:`Remove Protection`}},security:{protected:{title:`This Document is Protected`,description:`This file is protected and some features may be disabled. Go to Security in the document menu to view or unlock permissions.`,viewPermissions:`View permissions`},viewPermissions:{title:`Document Permissions`,description:`This file is restricted by the owner and requires a password to unlock certain actions.`,restrictedActions:`Restricted Actions`},unlock:{label:`Enter Owner Password to Unlock File`,placeholder:`Enter owner password`,button:`Unlock file`,invalidPassword:`Invalid password. Please try again.`,failed:`Failed to unlock. Please try again.`,success:`Owner permissions unlocked! You now have full access.`}},common:{close:`Close`,back:`Back`,cancel:`Cancel`},link:{title:`Insert Link`,url:`URL`,page:`Page`,enterUrl:`Enter URL`,enterPage:`Enter Page Number`,pageRange:`Page 1 to {totalPages}`,link:`Link`},stamp:{title:`Rubber Stamps`,allStamps:`All Stamps`,export:`Export Stamps`,emptyState:`No stamps found in the selected library.`,createFromSelected:`Create Stamp`,createFromGroup:`Create Stamp from Group`,library:{custom:`Custom Stamps`}},signature:{title:`Signatures`,createNew:`Create New Signature`,createNewWithInitials:`Create Signature & Initials`,placeSignature:`Signature`,placeInitials:`Initials`,remove:`Remove signature`,emptyState:`No signatures yet. Create one to get started.`,create:{title:`Create Signature`,draw:`Draw`,type:`Type`,upload:`Upload`,signatureLabel:`Signature`,initialsLabel:`Initials`,clear:`Clear`,typePlaceholder:`e.g. John Smith`,initialsPlaceholder:`e.g. JS`,uploadPlaceholder:`Click or drag an image here`,font:`Font`,color:`Color`,cancel:`Cancel`,save:`Save`}}}},{code:`nl`,name:`Nederlands`,translations:{search:{placeholder:`Zoeken`,caseSensitive:`Hoofdlettergevoelig`,wholeWord:`Heel woord`,resultsFound:`{count} resultaten gevonden`,page:`Pagina {page}`},zoom:{in:`Inzoomen`,out:`Uitzoomen`,fitWidth:`Aanbreedte aanpassen`,fitPage:`Aan pagina aanpassen`,marquee:`Lijstzoom`,menu:`Zoommenu`,level:`Zoomniveau ({level}%)`,dragTip:`Drag to select area to zoom`},pan:{toggle:`Pan-modus wisselen`},pointer:{toggle:`Aanwijzermodus wisselen`},capture:{screenshot:`Schermafbeelding`,dragTip:`Sleep om een gebied te selecteren om vast te leggen`,title:`Screenshot voorbeeld`,download:`Downloaden`,cancel:`Annuleren`},document:{menu:`Documentmenu`,open:`Openen`,close:`Sluiten`,print:`Afdrukken`,protect:`Beveiliging`,export:`Exporteren`,fullscreen:`Volledig scherm`,loading:`Document laden...`},emptyState:{title:`Geen documenten geopend`,description:`Open een PDF-document om te beginnen.`,descriptionMulti:`U kunt meerdere documenten bekijken met tabs.`,openButton:`Document openen`,supportedFormats:`Ondersteund formaat: PDF`},passwordPrompt:{title:`Wachtwoord vereist`,required:`Dit document is beveiligd met een wachtwoord. Voer het wachtwoord in om te openen.`,incorrect:`Het ingevoerde wachtwoord was onjuist. Probeer het opnieuw.`,incorrectWarning:`Onjuist wachtwoord. Controleer en probeer opnieuw.`,label:`Wachtwoord`,placeholder:`Voer documentwachtwoord in`,open:`Openen`,opening:`Openen...`,cancel:`Annuleren`,close:`Sluiten`},documentError:{title:`Fout bij laden van document`,unknown:`Er is een onbekende fout opgetreden`,errorCode:`Foutcode: {code}`,close:`Document sluiten`},panel:{sidebar:`Zijbalk`,search:`Zoeken`,comment:`Opmerking`,thumbnails:`Miniaturen`,outline:`Overzicht`,annotationStyle:`Annotatiestijl`,redaction:`Redactie Zijbalk`},menu:{viewControls:`Weergave-instellingen`,zoomControls:`Zoom-instellingen`,moreOptions:`Meer opties`},outline:{title:`Overzicht`,loading:`Overzicht laden...`,noOutline:`Geen overzicht beschikbaar`,noBookmarks:`Dit document bevat geen bladwijzers`},page:{settings:`Pagina-instellingen`,single:`Enkele pagina`,twoOdd:`Twee pagina's (Oneven)`,twoEven:`Twee pagina's (Even)`,vertical:`Verticaal`,horizontal:`Horizontaal`,spreadMode:`Spreidingsmodus`,scrollLayout:`Scrollindeling`,rotation:`Paginarotatie`,next:`Volgende pagina`,previous:`Vorige pagina`},rotate:{clockwise:`Met de klok mee draaien`,counterClockwise:`Tegen de klok in draaien`},selection:{copy:`Selectie kopiëren`},mode:{view:`Weergave`,annotate:`Annoteren`,shapes:`Vormen`,form:`Formulier`,redact:`Redigeren`,insert:`Invoegen`},form:{textfield:`Tekstveld`,checkbox:`Selectievakje`,radio:`Keuzerondje`,select:`Dropdown`,listbox:`Keuzelijst`},annotation:{text:`Tekst`,highlight:`Markeren`,strikeout:`Doorhalen`,underline:`Onderstrepen`,squiggly:`Golflijn`,rectangle:`Rechthoek`,circle:`Cirkel`,line:`Lijn`,arrow:`Pijl`,polygon:`Veelhoek`,polyline:`Polylijn`,ink:`Inkt`,inkHighlighter:`Inktmarkeerstift`,stamp:`Stempel`,caret:`Invoegpunt`,insertText:`Tekst invoegen`,replaceText:`Tekst vervangen`,freeText:`Vrije tekst`,square:`Vierkant`,style:`Annotatiestijl`,styles:`{type} stijlen`,defaults:`{type} standaardwaarden`,color:`Kleur`,opacity:`Dekking`,blendMode:`Overvloeimodus`,strokeWidth:`Lijndikte`,strokeColor:`Lijnkleur`,borderStyle:`Randstijl`,fillColor:`Vulkleur`,fontSize:`Lettergrootte`,fontFamily:`Lettertype`,textAlign:`Tekstuitlijning`,verticalAlign:`Verticale uitlijning`,lineEnding:`Lijneinde`,lineStart:`Lijnbegin`,lineEnd:`Lijneinde`,font:`Lettertype`,fontColor:`Tekstkleur`,backgroundColor:`Achtergrondkleur`,noStyles:`Er zijn geen stijlen voor deze annotatie.`,noStylesStamp:`Er zijn geen stijlen voor stempels.`,selectAnnotation:`Selecteer een annotatie om stijlen te zien`,deleteSelected:`Geselecteerde annotatie verwijderen`,deleteAllSelected:`Selectie verwijderen`,multiSelect:`{count} annotaties geselecteerd`,group:`Groeperen`,ungroup:`Groepering opheffen`,moreTools:`Meer gereedschappen`,addLink:`Link toevoegen`,removeLink:`Link verwijderen`,gotoLink:`Ga naar link`,comment:`Opmerking`,callout:`Callout`,redact:`Redigeren`,overlayText:`Overlaytekst`,overlayTextPlaceholder:`bijv. GEREDIGEERD`,rotation:`Rotatie`},insert:{image:`Afbeelding`,rubberStamp:`Stempel`},redaction:{redact:`Redigeren`,area:`Gebied redigeren`,text:`Tekst redigeren`,apply:`Redactie toepassen`,applyAll:`Alles toepassen`,clearAll:`Alles wissen`,deleteSelected:`Geselecteerde redactie verwijderen`,commitSelected:`Geselecteerde redactie toepassen`,emptyState:`Geen openstaande redacties`,panel:{title:`Redacties`,itemCount:`{count} openstaande redactie`,itemCountPlural:`{count} openstaande redacties`,clearAll:`Alles wissen`,redactAll:`Alles redigeren`}},history:{undo:`Ongedaan maken`,redo:`Opnieuw doen`},comments:{page:`Pagina {page}`,commentCount:`{count} opmerking`,commentCountPlural:`{count} opmerkingen`,addComment:`Opmerking toevoegen...`,addReply:`Antwoord toevoegen...`,showAllAnnotations:`Alle annotaties tonen`,closeAllAnnotations:`Alle annotaties sluiten`,save:`Opslaan`,cancel:`Annuleren`,edit:`Bewerken`,delete:`Verwijderen`,showMore:`meer`,showLess:`minder`,emptyState:`Voeg annotaties toe om erop te kunnen reageren.`},blendMode:{normal:`Normaal`,multiply:`Vermenigvuldigen`,screen:`Bleken`,overlay:`Bedekken`,darken:`Donkerder`,lighten:`Lichter`,colorDodge:`Kleur tegenhouden`,colorBurn:`Kleur doordrukken`,hardLight:`Hard licht`,softLight:`Zacht licht`,difference:`Verschil`,exclusion:`Uitsluiting`,hue:`Kleurtoon`,saturation:`Verzadiging`,color:`Kleur`,luminosity:`Helderheid`},print:{title:`Afdrukinstellingen`,loading:`Document voorbereiden...`,pages:`Af te drukken pagina's`,all:`Alle pagina's`,current:`Huidige pagina ({currentPage})`,specify:`Pagina's`,specifyEG:`bijv. 1-3, 5, 8-10`,total:`Totaal aantal pagina's in document: {totalPages}`,annotation:`Inclusief annotaties`,printing:`Afdrukken...`,print:`Afdrukken`,cancel:`Annuleren`},protect:{title:`Document beveiligen`,cancel:`Annuleren`,apply:`Beveiliging toepassen`,applying:`Bezig met toepassen...`,applyFailed:`Beveiliging kon niet worden toegepast. Probeer het opnieuw.`,removeFailed:`Beveiliging kon niet worden verwijderd. Probeer het opnieuw.`,passwordMismatch:`Wachtwoorden komen niet overeen`,noProtectionSelected:`Selecteer minimaal één beveiligingsoptie.`,bothPasswordsNote:`Gebruikers die openen met het documentwachtwoord hebben beperkte rechten. Gebruik het eigenaarswachtwoord voor volledige toegang.`,openPassword:{title:`Wachtwoord vereist om te openen`,description:`Gebruikers moeten een wachtwoord invoeren om dit document te bekijken.`,label:`Documentwachtwoord`,placeholder:`Wachtwoord invoeren`,confirm:`Wachtwoord bevestigen`,confirmPlaceholder:`Wachtwoord bevestigen`},ownerPassword:{label:`Eigenaarswachtwoord`,placeholder:`Eigenaarswachtwoord invoeren`,confirm:`Eigenaarswachtwoord bevestigen`,confirmPlaceholder:`Eigenaarswachtwoord bevestigen`},permissions:{title:`Rechten beperken`,description:`Beperk wat gebruikers met dit document kunnen doen.`,allowedActions:`Toegestane acties`,print:`Afdrukken`,printHighQuality:`Hoge kwaliteit afdrukken`,copy:`Inhoud kopiëren`,accessibility:`Extraheren voor toegankelijkheid`,modify:`Inhoud wijzigen`,annotations:`Annotaties & opmerkingen toevoegen/wijzigen`,fillForms:`Formulieren invullen & ondertekenen`,assemble:`Document samenstellen & pagina's extraheren`},encrypted:{title:`Document is beveiligd`,description:`Dit document is beveiligd door de eigenaar. Voer het eigenaarswachtwoord in om beveiligingsinstellingen te wijzigen.`,enterOwnerPassword:`Voer eigenaarswachtwoord in om te wijzigen`,unlockAndEdit:`Ontgrendelen & Bewerken`},modifyProtection:{title:`Beveiliging wijzigen`,description:`Kies hoe u de documentbeveiliging wilt wijzigen.`,changeOption:`Wachtwoorden of rechten wijzigen`,changeDescription:`Update het documentwachtwoord of rechtinstellingen.`,removeOption:`Alle beveiliging verwijderen`,removeDescription:`Verwijder wachtwoordbeveiliging van dit document.`},removeProtection:{title:`Beveiliging verwijderen`,warning:`Weet u zeker dat u de beveiliging wilt verwijderen?`,description:`Dit verwijdert alle wachtwoordbeveiliging van het document. Iedereen kan het openen en wijzigen.`,confirm:`Beveiliging verwijderen`}},security:{protected:{title:`Dit document is beveiligd`,description:`Dit bestand is beveiligd en sommige functies zijn mogelijk uitgeschakeld. Ga naar Beveiliging in het documentmenu om rechten te bekijken of te ontgrendelen.`,viewPermissions:`Rechten bekijken`},viewPermissions:{title:`Documentrechten`,description:`Dit bestand is beperkt door de eigenaar en vereist een wachtwoord om bepaalde acties te ontgrendelen.`,restrictedActions:`Beperkte acties`},unlock:{label:`Voer eigenaarswachtwoord in om te ontgrendelen`,placeholder:`Eigenaarswachtwoord invoeren`,button:`Bestand ontgrendelen`,invalidPassword:`Ongeldig wachtwoord. Probeer het opnieuw.`,failed:`Ontgrendelen mislukt. Probeer het opnieuw.`,success:`Eigenaarrechten ontgrendeld! U heeft nu volledige toegang.`}},common:{close:`Sluiten`,back:`Terug`,cancel:`Annuleren`},link:{title:`Link invoegen`,url:`URL`,page:`Pagina`,enterUrl:`URL invoeren`,enterPage:`Paginanummer invoeren`,pageRange:`Pagina 1 tot {totalPages}`,link:`Koppelen`},stamp:{title:`Stempels`,allStamps:`Alle stempels`,export:`Stempels exporteren`,emptyState:`Geen stempels gevonden in de geselecteerde bibliotheek.`,createFromSelected:`Stempel maken`,createFromGroup:`Stempel maken van groep`,library:{custom:`Eigen stempels`}},signature:{title:`Handtekeningen`,createNew:`Nieuwe handtekening maken`,createNewWithInitials:`Handtekening & initialen maken`,placeSignature:`Handtekening`,placeInitials:`Initialen`,remove:`Handtekening verwijderen`,emptyState:`Nog geen handtekeningen. Maak er een om te beginnen.`,create:{title:`Handtekening maken`,draw:`Tekenen`,type:`Typen`,upload:`Uploaden`,signatureLabel:`Handtekening`,initialsLabel:`Initialen`,clear:`Wissen`,typePlaceholder:`bijv. Jan Jansen`,initialsPlaceholder:`bijv. JJ`,uploadPlaceholder:`Klik of sleep een afbeelding hierheen`,font:`Lettertype`,color:`Kleur`,cancel:`Annuleren`,save:`Opslaan`}}}},{code:`de`,name:`Deutsch`,translations:{search:{placeholder:`Suchen`,caseSensitive:`Groß-/Kleinschreibung`,wholeWord:`Ganzes Wort`,resultsFound:`{count} Ergebnisse gefunden`,page:`Seite {page}`},zoom:{in:`Vergrößern`,out:`Verkleinern`,fitWidth:`An Breite anpassen`,fitPage:`An Seite anpassen`,marquee:`Laufrahmen-Zoom`,menu:`Zoom-Menü`,level:`Zoomstufe ({level}%)`,dragTip:`Drag to select area to zoom`},pan:{toggle:`Verschieben-Modus umschalten`},pointer:{toggle:`Zeiger-Modus umschalten`},capture:{screenshot:`Screenshot`,dragTip:`Ziehen Sie, um den Bereich zum Erfassen auszuwählen`,title:`Screenshot-Vorschau`,download:`Herunterladen`,cancel:`Abbrechen`},document:{menu:`Dokument-Menü`,open:`Öffnen`,close:`Schließen`,print:`Drucken`,protect:`Sicherheit`,export:`Exportieren`,fullscreen:`Vollbild`,loading:`Dokument wird geladen...`},emptyState:{title:`Keine Dokumente geöffnet`,description:`Öffnen Sie ein PDF-Dokument, um zu beginnen.`,descriptionMulti:`Sie können mehrere Dokumente mit Tabs anzeigen.`,openButton:`Dokument öffnen`,supportedFormats:`Unterstütztes Format: PDF`},passwordPrompt:{title:`Passwort erforderlich`,required:`Dieses Dokument ist passwortgeschützt. Bitte geben Sie das Passwort ein.`,incorrect:`Das eingegebene Passwort war falsch. Bitte versuchen Sie es erneut.`,incorrectWarning:`Falsches Passwort. Bitte überprüfen und erneut versuchen.`,label:`Passwort`,placeholder:`Dokumentpasswort eingeben`,open:`Öffnen`,opening:`Öffnen...`,cancel:`Abbrechen`,close:`Schließen`},documentError:{title:`Fehler beim Laden des Dokuments`,unknown:`Ein unbekannter Fehler ist aufgetreten`,errorCode:`Fehlercode: {code}`,close:`Dokument schließen`},panel:{sidebar:`Seitenleiste`,search:`Suchen`,comment:`Kommentar`,thumbnails:`Miniaturansichten`,outline:`Gliederung`,annotationStyle:`Anmerkungsstil`,redaction:`Schwärzungs-Seitenleiste`},menu:{viewControls:`Ansichtseinstellungen`,zoomControls:`Zoom-Einstellungen`,moreOptions:`Weitere Optionen`},outline:{title:`Gliederung`,loading:`Gliederung wird geladen...`,noOutline:`Keine Gliederung verfügbar`,noBookmarks:`Dieses Dokument enthält keine Lesezeichen`},page:{settings:`Seiteneinstellungen`,single:`Einzelseite`,twoOdd:`Zwei Seiten (Ungerade)`,twoEven:`Zwei Seiten (Gerade)`,vertical:`Vertikal`,horizontal:`Horizontal`,spreadMode:`Doppelseiten-Modus`,scrollLayout:`Scroll-Layout`,rotation:`Seitendrehung`,next:`Nächste Seite`,previous:`Vorherige Seite`},rotate:{clockwise:`Im Uhrzeigersinn drehen`,counterClockwise:`Gegen den Uhrzeigersinn drehen`},selection:{copy:`Auswahl kopieren`},mode:{view:`Ansicht`,annotate:`Annotieren`,shapes:`Formen`,form:`Formular`,redact:`Schwärzen`,insert:`Einfügen`},form:{textfield:`Textfeld`,checkbox:`Kontrollkästchen`,radio:`Optionsfeld`,select:`Dropdown`,listbox:`Listenfeld`},annotation:{text:`Text`,highlight:`Markieren`,strikeout:`Durchstreichen`,underline:`Unterstreichen`,squiggly:`Wellenlinie`,rectangle:`Rechteck`,circle:`Kreis`,line:`Linie`,arrow:`Pfeil`,polygon:`Polygon`,polyline:`Polylinie`,ink:`Freihand`,inkHighlighter:`Freihand-Textmarker`,stamp:`Stempel`,caret:`Einfügemarke`,insertText:`Text einfügen`,replaceText:`Text ersetzen`,freeText:`Freitext`,square:`Quadrat`,style:`Anmerkungsstil`,styles:`{type}-Stile`,defaults:`{type}-Standardwerte`,color:`Farbe`,opacity:`Deckkraft`,blendMode:`Mischmodus`,strokeWidth:`Strichstärke`,strokeColor:`Strichfarbe`,borderStyle:`Rahmenstil`,fillColor:`Füllfarbe`,fontSize:`Schriftgröße`,fontFamily:`Schriftart`,textAlign:`Textausrichtung`,verticalAlign:`Vertikale Ausrichtung`,lineEnding:`Linienende`,lineStart:`Linienanfang`,lineEnd:`Linienende`,font:`Schriftart`,fontColor:`Schriftfarbe`,backgroundColor:`Hintergrundfarbe`,noStyles:`Für diese Anmerkung gibt es keine Stile.`,noStylesStamp:`Für Stempel gibt es keine Stile.`,selectAnnotation:`Wählen Sie eine Anmerkung aus, um Stile anzuzeigen`,deleteSelected:`Ausgewählte Anmerkung löschen`,deleteAllSelected:`Ausgewählte löschen`,multiSelect:`{count} Anmerkungen ausgewählt`,group:`Gruppieren`,ungroup:`Gruppierung aufheben`,moreTools:`Weitere Werkzeuge`,addLink:`Link hinzufügen`,removeLink:`Link entfernen`,gotoLink:`Zum Link gehen`,comment:`Kommentar`,callout:`Legende`,redact:`Schwärzen`,overlayText:`Überlagerungstext`,overlayTextPlaceholder:`z.B. GESCHWÄRZT`,rotation:`Drehung`},insert:{image:`Bild`,rubberStamp:`Stempel`},redaction:{redact:`Schwärzen`,area:`Bereich schwärzen`,text:`Text schwärzen`,apply:`Schwärzung anwenden`,applyAll:`Alle anwenden`,clearAll:`Alle löschen`,deleteSelected:`Ausgewählte Schwärzung löschen`,commitSelected:`Ausgewählte Schwärzung anwenden`,emptyState:`Keine ausstehenden Schwärzungen`,panel:{title:`Schwärzungen`,itemCount:`{count} ausstehende Schwärzung`,itemCountPlural:`{count} ausstehende Schwärzungen`,clearAll:`Alle löschen`,redactAll:`Alle schwärzen`}},history:{undo:`Rückgängig`,redo:`Wiederholen`},comments:{page:`Seite {page}`,commentCount:`{count} Kommentar`,commentCountPlural:`{count} Kommentare`,addComment:`Kommentar hinzufügen...`,addReply:`Antwort hinzufügen...`,showAllAnnotations:`Alle Anmerkungen anzeigen`,closeAllAnnotations:`Alle Anmerkungen schließen`,save:`Speichern`,cancel:`Abbrechen`,edit:`Bearbeiten`,delete:`Löschen`,showMore:`mehr`,showLess:`weniger`,emptyState:`Fügen Sie Anmerkungen hinzu, um sie kommentieren zu können.`},blendMode:{normal:`Normal`,multiply:`Multiplizieren`,screen:`Negativ multiplizieren`,overlay:`Ineinanderkopieren`,darken:`Abdunkeln`,lighten:`Aufhellen`,colorDodge:`Farbig abwedeln`,colorBurn:`Farbig nachbelichten`,hardLight:`Hartes Licht`,softLight:`Weiches Licht`,difference:`Differenz`,exclusion:`Ausschluss`,hue:`Farbton`,saturation:`Sättigung`,color:`Farbe`,luminosity:`Luminanz`},print:{title:`Druckeinstellungen`,loading:`Dokument wird vorbereitet...`,pages:`Zu druckende Seiten`,all:`Alle Seiten`,current:`Aktuelle Seite ({currentPage})`,specify:`Seiten angeben`,specifyEG:`z.B. 1-3, 5, 8-10`,total:`Gesamtseitenzahl im Dokument: {totalPages}`,annotation:`Anmerkungen einbeziehen`,printing:`Drucken...`,print:`Drucken`,cancel:`Abbrechen`},protect:{title:`Dokument schützen`,cancel:`Abbrechen`,apply:`Schutz anwenden`,applying:`Wird angewendet...`,applyFailed:`Schutz konnte nicht angewendet werden. Bitte versuchen Sie es erneut.`,removeFailed:`Schutz konnte nicht entfernt werden. Bitte versuchen Sie es erneut.`,passwordMismatch:`Passwörter stimmen nicht überein`,noProtectionSelected:`Wählen Sie mindestens eine Schutzoption aus.`,bothPasswordsNote:`Benutzer, die das Dokumentpasswort eingeben, haben eingeschränkte Berechtigungen. Verwenden Sie das Eigentümerpasswort für vollen Zugriff.`,openPassword:{title:`Passwort zum Öffnen erforderlich`,description:`Benutzer müssen ein Passwort eingeben, um dieses Dokument anzuzeigen.`,label:`Dokumentpasswort`,placeholder:`Passwort eingeben`,confirm:`Passwort bestätigen`,confirmPlaceholder:`Passwort bestätigen`},ownerPassword:{label:`Eigentümerpasswort`,placeholder:`Eigentümerpasswort eingeben`,confirm:`Eigentümerpasswort bestätigen`,confirmPlaceholder:`Eigentümerpasswort bestätigen`},permissions:{title:`Berechtigungen einschränken`,description:`Beschränken Sie, was Benutzer mit diesem Dokument tun können.`,allowedActions:`Erlaubte Aktionen`,print:`Drucken`,printHighQuality:`In hoher Qualität drucken`,copy:`Inhalt kopieren`,accessibility:`Für Barrierefreiheit extrahieren`,modify:`Inhalt ändern`,annotations:`Anmerkungen & Kommentare hinzufügen/ändern`,fillForms:`Formulare ausfüllen & unterschreiben`,assemble:`Dokument zusammenstellen & Seiten extrahieren`},encrypted:{title:`Dokument ist geschützt`,description:`Dieses Dokument ist vom Eigentümer geschützt. Geben Sie das Eigentümerpasswort ein, um die Sicherheitseinstellungen zu ändern.`,enterOwnerPassword:`Eigentümerpasswort eingeben zum Ändern`,unlockAndEdit:`Entsperren & Bearbeiten`},modifyProtection:{title:`Schutz ändern`,description:`Wählen Sie, wie Sie den Dokumentschutz ändern möchten.`,changeOption:`Passwörter oder Berechtigungen ändern`,changeDescription:`Aktualisieren Sie das Dokumentpasswort oder die Berechtigungseinstellungen.`,removeOption:`Gesamten Schutz entfernen`,removeDescription:`Passwortschutz von diesem Dokument entfernen.`},removeProtection:{title:`Schutz entfernen`,warning:`Sind Sie sicher, dass Sie den Schutz entfernen möchten?`,description:`Dadurch wird der gesamte Passwortschutz vom Dokument entfernt. Jeder kann es öffnen und bearbeiten.`,confirm:`Schutz entfernen`}},security:{protected:{title:`Dieses Dokument ist geschützt`,description:`Diese Datei ist geschützt und einige Funktionen sind möglicherweise deaktiviert. Gehen Sie zu Sicherheit im Dokumentmenü, um Berechtigungen anzuzeigen oder freizuschalten.`,viewPermissions:`Berechtigungen anzeigen`},viewPermissions:{title:`Dokumentberechtigungen`,description:`Diese Datei ist vom Eigentümer eingeschränkt und erfordert ein Passwort, um bestimmte Aktionen freizuschalten.`,restrictedActions:`Eingeschränkte Aktionen`},unlock:{label:`Eigentümerpasswort eingeben zum Entsperren`,placeholder:`Eigentümerpasswort eingeben`,button:`Datei entsperren`,invalidPassword:`Ungültiges Passwort. Bitte versuchen Sie es erneut.`,failed:`Entsperren fehlgeschlagen. Bitte versuchen Sie es erneut.`,success:`Eigentümerberechtigungen entsperrt! Sie haben jetzt vollen Zugriff.`}},common:{close:`Schließen`,back:`Zurück`,cancel:`Abbrechen`},link:{title:`Link einfügen`,url:`URL`,page:`Seite`,enterUrl:`URL eingeben`,enterPage:`Seitennummer eingeben`,pageRange:`Seite 1 bis {totalPages}`,link:`Verknüpfen`},stamp:{title:`Stempel`,allStamps:`Alle Stempel`,export:`Stempel exportieren`,emptyState:`Keine Stempel in der ausgewählten Bibliothek gefunden.`,createFromSelected:`Stempel erstellen`,createFromGroup:`Stempel aus Gruppe erstellen`,library:{custom:`Eigene Stempel`}},signature:{title:`Unterschriften`,createNew:`Neue Unterschrift erstellen`,createNewWithInitials:`Unterschrift & Initialen erstellen`,placeSignature:`Unterschrift`,placeInitials:`Initialen`,remove:`Unterschrift entfernen`,emptyState:`Noch keine Unterschriften. Erstellen Sie eine, um loszulegen.`,create:{title:`Unterschrift erstellen`,draw:`Zeichnen`,type:`Tippen`,upload:`Hochladen`,signatureLabel:`Unterschrift`,initialsLabel:`Initialen`,clear:`Löschen`,typePlaceholder:`z.B. Max Mustermann`,initialsPlaceholder:`z.B. MM`,uploadPlaceholder:`Klicken oder Bild hierher ziehen`,font:`Schriftart`,color:`Farbe`,cancel:`Abbrechen`,save:`Speichern`}}}},{code:`fr`,name:`Français`,translations:{search:{placeholder:`Rechercher`,caseSensitive:`Respecter la casse`,wholeWord:`Mot entier`,resultsFound:`{count} résultats trouvés`,page:`Page {page}`},zoom:{in:`Zoom avant`,out:`Zoom arrière`,fitWidth:`Ajuster à la largeur`,fitPage:`Ajuster à la page`,marquee:`Zoom de sélection`,menu:`Menu Zoom`,level:`Niveau de zoom ({level}%)`,dragTip:`Drag to select area to zoom`},pan:{toggle:`Basculer le mode déplacement`},pointer:{toggle:`Basculer le mode pointeur`},capture:{screenshot:`Capture d'écran`,dragTip:`Faites glisser pour sélectionner la zone à capturer`,title:`Aperçu de la capture`,download:`Télécharger`,cancel:`Annuler`},document:{menu:`Menu Document`,open:`Ouvrir`,close:`Fermer`,print:`Imprimer`,protect:`Sécurité`,export:`Exporter`,fullscreen:`Plein écran`,loading:`Chargement du document...`},emptyState:{title:`Aucun document ouvert`,description:`Ouvrez un document PDF pour commencer.`,descriptionMulti:`Vous pouvez afficher plusieurs documents avec des onglets.`,openButton:`Ouvrir un document`,supportedFormats:`Format pris en charge : PDF`},passwordPrompt:{title:`Mot de passe requis`,required:`Ce document est protégé par mot de passe. Veuillez entrer le mot de passe.`,incorrect:`Le mot de passe saisi est incorrect. Veuillez réessayer.`,incorrectWarning:`Mot de passe incorrect. Veuillez vérifier et réessayer.`,label:`Mot de passe`,placeholder:`Entrer le mot de passe du document`,open:`Ouvrir`,opening:`Ouverture...`,cancel:`Annuler`,close:`Fermer`},documentError:{title:`Erreur lors du chargement du document`,unknown:`Une erreur inconnue est survenue`,errorCode:`Code erreur : {code}`,close:`Fermer le document`},panel:{sidebar:`Barre latérale`,search:`Rechercher`,comment:`Commentaire`,thumbnails:`Miniatures`,outline:`Plan`,annotationStyle:`Style d'annotation`,redaction:`Barre latérale de caviardage`},menu:{viewControls:`Contrôles d'affichage`,zoomControls:`Contrôles de zoom`,moreOptions:`Plus d'options`},outline:{title:`Plan`,loading:`Chargement du plan...`,noOutline:`Aucun plan disponible`,noBookmarks:`Ce document ne contient pas de signets`},page:{settings:`Paramètres de page`,single:`Page unique`,twoOdd:`Deux pages (Impair)`,twoEven:`Deux pages (Pair)`,vertical:`Vertical`,horizontal:`Horizontal`,spreadMode:`Mode double page`,scrollLayout:`Disposition de défilement`,rotation:`Rotation de page`,next:`Page suivante`,previous:`Page précédente`},rotate:{clockwise:`Tourner dans le sens horaire`,counterClockwise:`Tourner dans le sens antihoraire`},selection:{copy:`Copier la sélection`},mode:{view:`Affichage`,annotate:`Annoter`,shapes:`Formes`,form:`Formulaire`,redact:`Caviarder`,insert:`Insérer`},form:{textfield:`Champ de texte`,checkbox:`Case à cocher`,radio:`Bouton radio`,select:`Liste déroulante`,listbox:`Zone de liste`},annotation:{text:`Texte`,highlight:`Surligner`,strikeout:`Barrer`,underline:`Souligner`,squiggly:`Ondulé`,rectangle:`Rectangle`,circle:`Cercle`,line:`Ligne`,arrow:`Flèche`,polygon:`Polygone`,polyline:`Polyligne`,ink:`Encre`,inkHighlighter:`Surligneur à encre`,stamp:`Tampon`,caret:`Curseur`,insertText:`Insérer du texte`,replaceText:`Remplacer le texte`,freeText:`Texte libre`,square:`Carré`,style:`Style d'annotation`,styles:`Styles de {type}`,defaults:`Valeurs par défaut de {type}`,color:`Couleur`,opacity:`Opacité`,blendMode:`Mode de fusion`,strokeWidth:`Épaisseur du trait`,strokeColor:`Couleur du trait`,borderStyle:`Style de bordure`,fillColor:`Couleur de remplissage`,fontSize:`Taille de police`,fontFamily:`Police`,textAlign:`Alignement du texte`,verticalAlign:`Alignement vertical`,lineEnding:`Fin de ligne`,lineStart:`Début de ligne`,lineEnd:`Fin de ligne`,font:`Police`,fontColor:`Couleur du texte`,backgroundColor:`Couleur de fond`,noStyles:`Il n'y a pas de styles pour cette annotation.`,noStylesStamp:`Il n'y a pas de styles pour les tampons.`,selectAnnotation:`Sélectionnez une annotation pour voir les styles`,deleteSelected:`Supprimer l'annotation sélectionnée`,deleteAllSelected:`Supprimer la sélection`,multiSelect:`{count} annotations sélectionnées`,group:`Grouper`,ungroup:`Dissocier`,moreTools:`Plus d'outils`,addLink:`Ajouter un lien`,removeLink:`Supprimer le lien`,gotoLink:`Aller au lien`,comment:`Commentaire`,callout:`Légende`,redact:`Caviarder`,overlayText:`Texte de superposition`,overlayTextPlaceholder:`ex: CAVIARDÉ`,rotation:`Rotation`},insert:{image:`Image`,rubberStamp:`Tampon`},redaction:{redact:`Caviarder`,area:`Caviarder la zone`,text:`Caviarder le texte`,apply:`Appliquer le caviardage`,applyAll:`Tout appliquer`,clearAll:`Tout effacer`,deleteSelected:`Supprimer la rédaction sélectionnée`,commitSelected:`Appliquer la rédaction sélectionnée`,emptyState:`Aucun caviardage en attente`,panel:{title:`Caviardages`,itemCount:`{count} caviardage en attente`,itemCountPlural:`{count} caviardages en attente`,clearAll:`Tout effacer`,redactAll:`Tout caviarder`}},history:{undo:`Annuler`,redo:`Refaire`},comments:{page:`Page {page}`,commentCount:`{count} commentaire`,commentCountPlural:`{count} commentaires`,addComment:`Ajouter un commentaire...`,addReply:`Ajouter une réponse...`,showAllAnnotations:`Afficher toutes les annotations`,closeAllAnnotations:`Fermer toutes les annotations`,save:`Enregistrer`,cancel:`Annuler`,edit:`Modifier`,delete:`Supprimer`,showMore:`plus`,showLess:`moins`,emptyState:`Ajoutez des annotations pour pouvoir les commenter.`},blendMode:{normal:`Normal`,multiply:`Produit`,screen:`Superposition`,overlay:`Incrustation`,darken:`Obscurcir`,lighten:`Éclaircir`,colorDodge:`Densité couleur -`,colorBurn:`Densité couleur +`,hardLight:`Lumière crue`,softLight:`Lumière tamisée`,difference:`Différence`,exclusion:`Exclusion`,hue:`Teinte`,saturation:`Saturation`,color:`Couleur`,luminosity:`Luminosité`},print:{title:`Paramètres d'impression`,loading:`Préparation du document...`,pages:`Pages à imprimer`,all:`Toutes les pages`,current:`Page actuelle ({currentPage})`,specify:`Spécifier les pages`,specifyEG:`ex : 1-3, 5, 8-10`,total:`Nombre total de pages dans le document : {totalPages}`,annotation:`Inclure les annotations`,printing:`Impression...`,print:`Imprimer`,cancel:`Annuler`},protect:{title:`Protéger le document`,cancel:`Annuler`,apply:`Appliquer la protection`,applying:`Application en cours...`,applyFailed:`Échec de l'application de la protection. Veuillez réessayer.`,removeFailed:`Échec de la suppression de la protection. Veuillez réessayer.`,passwordMismatch:`Les mots de passe ne correspondent pas`,noProtectionSelected:`Sélectionnez au moins une option de protection.`,bothPasswordsNote:`Les utilisateurs qui ouvrent avec le mot de passe du document auront des permissions limitées. Utilisez le mot de passe propriétaire pour un accès complet.`,openPassword:{title:`Mot de passe requis pour l'ouverture`,description:`Les utilisateurs doivent entrer un mot de passe pour voir ce document.`,label:`Mot de passe du document`,placeholder:`Entrer le mot de passe`,confirm:`Confirmer le mot de passe`,confirmPlaceholder:`Confirmer le mot de passe`},ownerPassword:{label:`Mot de passe propriétaire`,placeholder:`Entrer le mot de passe propriétaire`,confirm:`Confirmer le mot de passe propriétaire`,confirmPlaceholder:`Confirmer le mot de passe propriétaire`},permissions:{title:`Restreindre les permissions`,description:`Limitez ce que les utilisateurs peuvent faire avec ce document.`,allowedActions:`Actions autorisées`,print:`Imprimer`,printHighQuality:`Imprimer en haute qualité`,copy:`Copier le contenu`,accessibility:`Extraire pour l'accessibilité`,modify:`Modifier le contenu`,annotations:`Ajouter/modifier les annotations et commentaires`,fillForms:`Remplir les formulaires et signer`,assemble:`Assembler le document et extraire les pages`},encrypted:{title:`Document protégé`,description:`Ce document est protégé par le propriétaire. Entrez le mot de passe propriétaire pour modifier les paramètres de sécurité.`,enterOwnerPassword:`Entrer le mot de passe propriétaire pour modifier`,unlockAndEdit:`Déverrouiller & Modifier`},modifyProtection:{title:`Modifier la protection`,description:`Choisissez comment vous voulez modifier la protection du document.`,changeOption:`Modifier les mots de passe ou les permissions`,changeDescription:`Mettre à jour le mot de passe du document ou les paramètres de permissions.`,removeOption:`Supprimer toute la protection`,removeDescription:`Supprimer la protection par mot de passe de ce document.`},removeProtection:{title:`Supprimer la protection`,warning:`Êtes-vous sûr de vouloir supprimer la protection ?`,description:`Cela supprimera toute la protection par mot de passe du document. Tout le monde pourra l'ouvrir et le modifier.`,confirm:`Supprimer la protection`}},security:{protected:{title:`Ce document est protégé`,description:`Ce fichier est protégé et certaines fonctionnalités peuvent être désactivées. Allez dans Sécurité dans le menu document pour afficher ou déverrouiller les permissions.`,viewPermissions:`Voir les permissions`},viewPermissions:{title:`Permissions du document`,description:`Ce fichier est restreint par le propriétaire et nécessite un mot de passe pour débloquer certaines actions.`,restrictedActions:`Actions restreintes`},unlock:{label:`Entrer le mot de passe propriétaire pour déverrouiller`,placeholder:`Entrer le mot de passe propriétaire`,button:`Déverrouiller le fichier`,invalidPassword:`Mot de passe invalide. Veuillez réessayer.`,failed:`Échec du déverrouillage. Veuillez réessayer.`,success:`Permissions propriétaire déverrouillées ! Vous avez maintenant un accès complet.`}},common:{close:`Fermer`,back:`Retour`,cancel:`Annuler`},link:{title:`Insérer un lien`,url:`URL`,page:`Page`,enterUrl:`Entrer l'URL`,enterPage:`Entrer le numéro de page`,pageRange:`Page 1 à {totalPages}`,link:`Lier`},stamp:{title:`Tampons`,allStamps:`Tous les tampons`,export:`Exporter les tampons`,emptyState:`Aucun tampon trouvé dans la bibliothèque sélectionnée.`,createFromSelected:`Créer un tampon`,createFromGroup:`Créer un tampon à partir du groupe`,library:{custom:`Tampons personnalisés`}},signature:{title:`Signatures`,createNew:`Créer une nouvelle signature`,createNewWithInitials:`Créer signature & paraphe`,placeSignature:`Signature`,placeInitials:`Paraphe`,remove:`Supprimer la signature`,emptyState:`Aucune signature pour le moment. Créez-en une pour commencer.`,create:{title:`Créer une signature`,draw:`Dessiner`,type:`Saisir`,upload:`Télécharger`,signatureLabel:`Signature`,initialsLabel:`Paraphe`,clear:`Effacer`,typePlaceholder:`ex. Jean Dupont`,initialsPlaceholder:`ex. JD`,uploadPlaceholder:`Cliquez ou glissez une image ici`,font:`Police`,color:`Couleur`,cancel:`Annuler`,save:`Enregistrer`}}}},{code:`es`,name:`Español`,translations:{search:{placeholder:`Buscar`,caseSensitive:`Distinguir mayúsculas`,wholeWord:`Palabra completa`,resultsFound:`{count} resultados encontrados`,page:`Página {page}`},zoom:{in:`Acercar`,out:`Alejar`,fitWidth:`Ajustar al ancho`,fitPage:`Ajustar a la página`,marquee:`Zoom de selección`,menu:`Menú de zoom`,level:`Nivel de zoom ({level}%)`,dragTip:`Drag to select area to zoom`},pan:{toggle:`Alternar modo desplazamiento`},pointer:{toggle:`Alternar modo puntero`},capture:{screenshot:`Captura de pantalla`,dragTip:`Arrastre para seleccionar el área a capturar`,title:`Vista previa de la captura`,download:`Descargar`,cancel:`Cancelar`},document:{menu:`Menú del documento`,open:`Abrir`,close:`Cerrar`,print:`Imprimir`,protect:`Seguridad`,export:`Exportar`,fullscreen:`Pantalla completa`,loading:`Cargando documento...`},emptyState:{title:`No hay documentos abiertos`,description:`Abra un documento PDF para comenzar.`,descriptionMulti:`Puede ver varios documentos usando pestañas.`,openButton:`Abrir documento`,supportedFormats:`Formato compatible: PDF`},passwordPrompt:{title:`Contraseña requerida`,required:`Este documento está protegido con contraseña. Por favor, ingrese la contraseña para abrirlo.`,incorrect:`La contraseña ingresada es incorrecta. Por favor, inténtelo de nuevo.`,incorrectWarning:`Contraseña incorrecta. Por favor, verifique e inténtelo de nuevo.`,label:`Contraseña`,placeholder:`Ingrese la contraseña del documento`,open:`Abrir`,opening:`Abriendo...`,cancel:`Cancelar`,close:`Cerrar`},documentError:{title:`Error al cargar el documento`,unknown:`Ha ocurrido un error desconocido`,errorCode:`Código de error: {code}`,close:`Cerrar documento`},panel:{sidebar:`Barra lateral`,search:`Buscar`,comment:`Comentario`,thumbnails:`Miniaturas`,outline:`Esquema`,annotationStyle:`Estilo de anotación`,redaction:`Barra lateral de redacción`},menu:{viewControls:`Controles de vista`,zoomControls:`Controles de zoom`,moreOptions:`Más opciones`},outline:{title:`Esquema`,loading:`Cargando esquema...`,noOutline:`No hay esquema disponible`,noBookmarks:`Este documento no contiene marcadores`},page:{settings:`Configuración de página`,single:`Página única`,twoOdd:`Dos páginas (Impar)`,twoEven:`Dos páginas (Par)`,vertical:`Vertical`,horizontal:`Horizontal`,spreadMode:`Modo de doble página`,scrollLayout:`Diseño de desplazamiento`,rotation:`Rotación de página`,next:`Página siguiente`,previous:`Página anterior`},rotate:{clockwise:`Rotar en sentido horario`,counterClockwise:`Rotar en sentido antihorario`},selection:{copy:`Copiar selección`},mode:{view:`Ver`,annotate:`Anotar`,shapes:`Formas`,form:`Formulario`,redact:`Redactar`,insert:`Insertar`},form:{textfield:`Campo de texto`,checkbox:`Casilla`,radio:`Botón de radio`,select:`Desplegable`,listbox:`Cuadro de lista`},annotation:{text:`Texto`,highlight:`Resaltar`,strikeout:`Tachar`,underline:`Subrayar`,squiggly:`Ondulado`,rectangle:`Rectángulo`,circle:`Círculo`,line:`Línea`,arrow:`Flecha`,polygon:`Polígono`,polyline:`Polilínea`,ink:`Tinta`,inkHighlighter:`Resaltador de tinta`,stamp:`Sello`,caret:`Cursor`,insertText:`Insertar texto`,replaceText:`Reemplazar texto`,freeText:`Texto libre`,square:`Cuadrado`,style:`Estilo de anotación`,styles:`Estilos de {type}`,defaults:`Valores predeterminados de {type}`,color:`Color`,opacity:`Opacidad`,blendMode:`Modo de fusión`,strokeWidth:`Grosor del trazo`,strokeColor:`Color del trazo`,borderStyle:`Estilo del borde`,fillColor:`Color de relleno`,fontSize:`Tamaño de fuente`,fontFamily:`Fuente`,textAlign:`Alineación del texto`,verticalAlign:`Alineación vertical`,lineEnding:`Final de línea`,lineStart:`Inicio de línea`,lineEnd:`Final de línea`,font:`Fuente`,fontColor:`Color de fuente`,backgroundColor:`Color de fondo`,noStyles:`No hay estilos para esta anotación.`,noStylesStamp:`No hay estilos para los sellos.`,selectAnnotation:`Seleccione una anotación para ver los estilos`,deleteSelected:`Eliminar anotación seleccionada`,deleteAllSelected:`Eliminar selección`,multiSelect:`{count} anotaciones seleccionadas`,group:`Agrupar`,ungroup:`Desagrupar`,moreTools:`Más herramientas`,addLink:`Agregar enlace`,removeLink:`Eliminar enlace`,gotoLink:`Ir al enlace`,comment:`Comentario`,callout:`Llamada`,redact:`Redactar`,overlayText:`Texto superpuesto`,overlayTextPlaceholder:`ej: REDACTADO`,rotation:`Rotación`},insert:{image:`Imagen`,rubberStamp:`Sello`},redaction:{redact:`Redactar`,area:`Redactar área`,text:`Redactar texto`,apply:`Aplicar redacción`,applyAll:`Aplicar todo`,clearAll:`Borrar todo`,deleteSelected:`Eliminar redacción seleccionada`,commitSelected:`Aplicar redacción seleccionada`,emptyState:`No hay redacciones pendientes`,panel:{title:`Redacciones`,itemCount:`{count} redacción pendiente`,itemCountPlural:`{count} redacciones pendientes`,clearAll:`Borrar todo`,redactAll:`Redactar todo`}},history:{undo:`Deshacer`,redo:`Rehacer`},comments:{page:`Página {page}`,commentCount:`{count} comentario`,commentCountPlural:`{count} comentarios`,addComment:`Añadir comentario...`,addReply:`Añadir respuesta...`,showAllAnnotations:`Mostrar todas las anotaciones`,closeAllAnnotations:`Cerrar todas las anotaciones`,save:`Guardar`,cancel:`Cancelar`,edit:`Editar`,delete:`Eliminar`,showMore:`más`,showLess:`menos`,emptyState:`Añada anotaciones para poder comentarlas.`},blendMode:{normal:`Normal`,multiply:`Multiplicar`,screen:`Trama`,overlay:`Superponer`,darken:`Oscurecer`,lighten:`Aclarar`,colorDodge:`Sobreexponer color`,colorBurn:`Subexponer color`,hardLight:`Luz fuerte`,softLight:`Luz suave`,difference:`Diferencia`,exclusion:`Exclusión`,hue:`Tono`,saturation:`Saturación`,color:`Color`,luminosity:`Luminosidad`},print:{title:`Configuración de impresión`,loading:`Preparando documento...`,pages:`Páginas a imprimir`,all:`Todas las páginas`,current:`Página actual ({currentPage})`,specify:`Especificar páginas`,specifyEG:`ej: 1-3, 5, 8-10`,total:`Total de páginas en el documento: {totalPages}`,annotation:`Incluir anotaciones`,printing:`Imprimiendo...`,print:`Imprimir`,cancel:`Cancelar`},protect:{title:`Proteger documento`,cancel:`Cancelar`,apply:`Aplicar protección`,applying:`Aplicando...`,applyFailed:`No se pudo aplicar la protección. Por favor, inténtelo de nuevo.`,removeFailed:`No se pudo eliminar la protección. Por favor, inténtelo de nuevo.`,passwordMismatch:`Las contraseñas no coinciden`,noProtectionSelected:`Seleccione al menos una opción de protección.`,bothPasswordsNote:`Los usuarios que abran con la contraseña del documento tendrán permisos restringidos. Use la contraseña de propietario para acceso completo.`,openPassword:{title:`Contraseña requerida para abrir`,description:`Los usuarios deben ingresar una contraseña para ver este documento.`,label:`Contraseña del documento`,placeholder:`Ingresar contraseña`,confirm:`Confirmar contraseña`,confirmPlaceholder:`Confirmar contraseña`},ownerPassword:{label:`Contraseña de propietario`,placeholder:`Ingresar contraseña de propietario`,confirm:`Confirmar contraseña de propietario`,confirmPlaceholder:`Confirmar contraseña de propietario`},permissions:{title:`Restringir permisos`,description:`Limite lo que los usuarios pueden hacer con este documento.`,allowedActions:`Acciones permitidas`,print:`Imprimir`,printHighQuality:`Imprimir alta calidad`,copy:`Copiar contenido`,accessibility:`Extraer para accesibilidad`,modify:`Modificar contenido`,annotations:`Añadir/modificar anotaciones y comentarios`,fillForms:`Rellenar formularios y firmar`,assemble:`Ensamblar documento y extraer páginas`},encrypted:{title:`Documento protegido`,description:`Este documento está protegido por el propietario. Ingrese la contraseña de propietario para modificar la configuración de seguridad.`,enterOwnerPassword:`Ingrese la contraseña de propietario para modificar`,unlockAndEdit:`Desbloquear y Editar`},modifyProtection:{title:`Modificar protección`,description:`Elija cómo desea modificar la protección del documento.`,changeOption:`Cambiar contraseñas o permisos`,changeDescription:`Actualizar la contraseña del documento o la configuración de permisos.`,removeOption:`Eliminar toda la protección`,removeDescription:`Eliminar la protección por contraseña de este documento.`},removeProtection:{title:`Eliminar protección`,warning:`¿Está seguro de que desea eliminar la protección?`,description:`Esto eliminará toda la protección por contraseña del documento. Cualquiera podrá abrirlo y modificarlo.`,confirm:`Eliminar protección`}},security:{protected:{title:`Este documento está protegido`,description:`Este archivo está protegido y algunas funciones pueden estar deshabilitadas. Vaya a Seguridad en el menú del documento para ver o desbloquear los permisos.`,viewPermissions:`Ver permisos`},viewPermissions:{title:`Permisos del documento`,description:`Este archivo está restringido por el propietario y requiere una contraseña para desbloquear ciertas acciones.`,restrictedActions:`Acciones restringidas`},unlock:{label:`Ingrese la contraseña de propietario para desbloquear`,placeholder:`Ingresar contraseña de propietario`,button:`Desbloquear archivo`,invalidPassword:`Contraseña inválida. Por favor, inténtelo de nuevo.`,failed:`Error al desbloquear. Por favor, inténtelo de nuevo.`,success:`¡Permisos de propietario desbloqueados! Ahora tiene acceso completo.`}},common:{close:`Cerrar`,back:`Atrás`,cancel:`Cancelar`},link:{title:`Insertar enlace`,url:`URL`,page:`Página`,enterUrl:`Introducir URL`,enterPage:`Introducir número de página`,pageRange:`Página 1 a {totalPages}`,link:`Enlazar`},stamp:{title:`Sellos`,allStamps:`Todos los sellos`,export:`Exportar sellos`,emptyState:`No se encontraron sellos en la biblioteca seleccionada.`,createFromSelected:`Crear sello`,createFromGroup:`Crear sello del grupo`,library:{custom:`Sellos personalizados`}},signature:{title:`Firmas`,createNew:`Crear nueva firma`,createNewWithInitials:`Crear firma e iniciales`,placeSignature:`Firma`,placeInitials:`Iniciales`,remove:`Eliminar firma`,emptyState:`Aún no hay firmas. Crea una para empezar.`,create:{title:`Crear firma`,draw:`Dibujar`,type:`Escribir`,upload:`Subir`,signatureLabel:`Firma`,initialsLabel:`Iniciales`,clear:`Borrar`,typePlaceholder:`ej. Juan García`,initialsPlaceholder:`ej. JG`,uploadPlaceholder:`Haz clic o arrastra una imagen aquí`,font:`Fuente`,color:`Color`,cancel:`Cancelar`,save:`Guardar`}}}},{code:`zh-CN`,name:`简体中文`,translations:{search:{placeholder:`搜索`,caseSensitive:`大小写敏感`,wholeWord:`全词匹配`,resultsFound:`{count} 个结果`,page:`第{page}页`},zoom:{in:`放大`,out:`缩小`,fitWidth:`适合宽度`,fitPage:`适合页面`,marquee:`框选放大`,menu:`缩放菜单`,level:`缩放比例 ({level}%)`,dragTip:`拖动鼠标选择要放大的区域`},pan:{toggle:`拖动模式`},pointer:{toggle:`光标模式`},capture:{screenshot:`截图`,dragTip:`拖动鼠标选择要截取的区域`,title:`截取的PDF区域`,download:`下载`,cancel:`取消`},document:{menu:`文件选项`,open:`打开`,close:`关闭`,print:`打印`,protect:`安全`,export:`导出`,fullscreen:`全屏`,loading:`文件加载中...`},emptyState:{title:`尚无打开的文件`,description:`请点击“+ 打开文件”按钮选择并打开一个PDF文件。`,descriptionMulti:`您可以使用标签页同时打开多个文件。`,openButton:`打开文件`,supportedFormats:`支持的文件格式为: PDF`},passwordPrompt:{title:`请输入密码`,required:`该文件设置有密码保护,要打开文件请输入密码。`,incorrect:`你输入的密码错误,请重新输入。`,incorrectWarning:`密码错误,请检查后重新输入。`,label:`密码`,placeholder:`请输入文件密码`,open:`打开`,opening:`打开中...`,cancel:`取消`,close:`关闭`},documentError:{title:`文件加载出错`,unknown:`未知错误`,errorCode:`错误码: {code}`,close:`关闭文件`},panel:{sidebar:`大纲与书签`,search:`搜索`,comment:`评论`,thumbnails:`缩略图`,outline:`大纲`,annotationStyle:`批注样式`,redaction:`遮蔽侧边栏`},menu:{viewControls:`视图控件`,zoomControls:`缩放控件`,moreOptions:`更多选项`},outline:{title:`大纲`,loading:`大纲加载中...`,noOutline:`没有大纲`,noBookmarks:`该文件不含书签`},page:{settings:`页面设置`,single:`单页视图`,twoOdd:`双页视图`,twoEven:`书籍视图`,vertical:`垂直滚动`,horizontal:`水平滚动`,spreadMode:`跨页模式`,scrollLayout:`滚动布局`,rotation:`页面转向`,next:`下一页`,previous:`上一页`},rotate:{clockwise:`顺时针旋转`,counterClockwise:`逆时针旋转`},selection:{copy:`复制`},mode:{view:`阅读`,annotate:`批注`,shapes:`形状`,form:`表单`,redact:`遮蔽`,insert:`插入`},form:{textfield:`文本框`,checkbox:`复选框`,radio:`单选按钮`,select:`下拉列表`,listbox:`列表框`},annotation:{text:`任意文本`,highlight:`高亮`,strikeout:`删除线`,underline:`下划线`,squiggly:`下划曲线`,rectangle:`矩形`,circle:`圆形`,line:`直线`,arrow:`带箭头直线`,polygon:`多边形`,polyline:`多段线`,ink:`自由绘制`,inkHighlighter:`墨迹荧光笔`,stamp:`印章`,caret:`插入符号`,insertText:`插入文本`,replaceText:`替换文本`,freeText:`任意文本`,square:`矩形`,style:`批注样式`,styles:`{type} 样式`,defaults:`{type} 默认值`,color:`颜色`,opacity:`透明度`,blendMode:`混合模式`,strokeWidth:`线条宽度`,strokeColor:`线条颜色`,borderStyle:`线条样式`,fillColor:`填充色`,fontSize:`字号`,fontFamily:`字体`,textAlign:`左右对齐`,verticalAlign:`上下对齐`,lineEnding:`行尾`,lineStart:`线条起点`,lineEnd:`线条结尾`,font:`字体`,fontColor:`字色`,backgroundColor:`背景色`,noStyles:`该批注无需设置样式。`,noStylesStamp:`印章无需设置样式。`,selectAnnotation:`在此处查看选中批注的样式。`,deleteSelected:`删除选中的批注`,deleteAllSelected:`删除选中`,multiSelect:`已选择 {count} 个批注`,group:`分组`,ungroup:`取消分组`,moreTools:`更多工具`,addLink:`添加链接`,removeLink:`移除链接`,gotoLink:`跳转到链接`,comment:`评论`,callout:`标注`,redact:`遮蔽`,overlayText:`覆盖文字`,overlayTextPlaceholder:`例如:已遮蔽`,rotation:`旋转`},insert:{image:`图片`,rubberStamp:`印章`},redaction:{redact:`遮蔽`,area:`遮蔽区域`,text:`遮蔽文本`,apply:`应用遮蔽`,applyAll:`全部应用`,clearAll:`全部取消`,deleteSelected:`取消遮蔽`,commitSelected:`应用遮蔽`,emptyState:`暂无待处理的遮蔽`,panel:{title:`遮蔽`,itemCount:`{count} 个待处理遮蔽`,itemCountPlural:`{count} 个待处理遮蔽`,clearAll:`全部取消`,redactAll:`全部遮蔽`}},history:{undo:`撤销`,redo:`恢复`},comments:{page:`第{page}页`,commentCount:`{count}条评论`,commentCountPlural:`{count}条评论`,addComment:`新增评论...`,addReply:`新增回复...`,showAllAnnotations:`显示所有注释`,closeAllAnnotations:`关闭所有注释`,save:`保存`,cancel:`取消`,edit:`编辑`,delete:`删除`,showMore:`展开`,showLess:`收起`,emptyState:`添加批注后,可以在这里对批注进行评论。`},blendMode:{normal:`正常`,multiply:`正片`,screen:`屏幕`,overlay:`叠加`,darken:`变暗`,lighten:`变亮`,colorDodge:`色彩减淡`,colorBurn:`颜色加深`,hardLight:`强光`,softLight:`柔光`,difference:`差值`,exclusion:`排除`,hue:`色相`,saturation:`饱和度`,color:`颜色`,luminosity:`亮度`},print:{title:`打印设置`,loading:`正在处理...`,pages:`要打印的页码`,all:`所有页`,current:`当前页({currentPage})`,specify:`指定页`,specifyEG:`例如:1-3, 5, 8-10`,total:`文档总页数:{totalPages}`,annotation:`包含批注`,printing:`打印中...`,print:`打印`,cancel:`取消`},protect:{title:`文档保护`,cancel:`取消`,apply:`应用保护`,applying:`正在应用...`,applyFailed:`无法应用保护。请重试。`,removeFailed:`无法移除保护。请重试。`,passwordMismatch:`密码不匹配`,noProtectionSelected:`请至少选择一种保护方式。`,bothPasswordsNote:`使用文档密码打开的用户将受到权限限制。使用所有者密码可获得完全访问权限。`,openPassword:{title:`需要密码才能打开`,description:`用户必须输入密码才能查看此文档。`,label:`文档密码`,placeholder:`输入密码`,confirm:`确认密码`,confirmPlaceholder:`确认密码`},ownerPassword:{label:`所有者密码`,placeholder:`输入所有者密码`,confirm:`确认所有者密码`,confirmPlaceholder:`确认所有者密码`},permissions:{title:`限制权限`,description:`限制用户对此文档的操作。`,allowedActions:`允许的操作`,print:`打印`,printHighQuality:`高质量打印`,copy:`复制内容`,accessibility:`提取辅助功能`,modify:`修改内容`,annotations:`添加/修改批注和评论`,fillForms:`填写表单和签名`,assemble:`组装文档和提取页面`},encrypted:{title:`文档受保护`,description:`此文档已被所有者保护。请输入所有者密码以修改安全设置。`,enterOwnerPassword:`输入所有者密码以修改`,unlockAndEdit:`解锁并编辑`},modifyProtection:{title:`修改保护`,description:`选择如何修改文档保护。`,changeOption:`更改密码或权限`,changeDescription:`更新文档密码或权限设置。`,removeOption:`移除所有保护`,removeDescription:`移除此文档的密码保护。`},removeProtection:{title:`移除保护`,warning:`确定要移除保护吗?`,description:`这将移除文档的所有密码保护。任何人都可以打开和修改它。`,confirm:`移除保护`}},security:{protected:{title:`此文档受保护`,description:`此文件受保护,某些功能可能被禁用。请在文档菜单中点击"安全"以查看或解锁权限。`,viewPermissions:`查看权限`},viewPermissions:{title:`文档权限`,description:`此文件受所有者限制,需要密码才能解锁某些操作。`,restrictedActions:`受限操作`},unlock:{label:`输入所有者密码以解锁文件`,placeholder:`输入所有者密码`,button:`解锁文件`,invalidPassword:`密码无效。请重试。`,failed:`解锁失败。请重试。`,success:`所有者权限已解锁!您现在拥有完全访问权限。`}},common:{close:`关闭`,back:`返回`,cancel:`取消`},link:{title:`插入链接`,url:`网址`,page:`页面`,enterUrl:`输入网址`,enterPage:`输入页码`,pageRange:`第1页到第{totalPages}页`,link:`链接`},stamp:{title:`印章`,allStamps:`所有印章`,export:`导出印章`,emptyState:`所选库中没有找到印章。`,createFromSelected:`创建印章`,createFromGroup:`从组创建印章`,library:{custom:`自定义印章`}},signature:{title:`签名`,createNew:`创建新签名`,createNewWithInitials:`创建签名和首字母`,placeSignature:`签名`,placeInitials:`首字母`,remove:`删除签名`,emptyState:`还没有签名。创建一个来开始吧。`,create:{title:`创建签名`,draw:`绘制`,type:`输入`,upload:`上传`,signatureLabel:`签名`,initialsLabel:`首字母`,clear:`清除`,typePlaceholder:`例如 张三`,initialsPlaceholder:`例如 张`,uploadPlaceholder:`点击或拖放图片到此处`,font:`字体`,color:`颜色`,cancel:`取消`,save:`保存`}}}},{code:`zh-TW`,name:`繁體中文`,translations:{search:{placeholder:`搜尋`,caseSensitive:`區分大小寫`,wholeWord:`符合整個字`,resultsFound:`{count} 個結果`,page:`第{page}頁`},zoom:{in:`放大`,out:`縮小`,fitWidth:`頁面寬度`,fitPage:`縮放至頁面大小`,marquee:`框選放大`,menu:`縮放選單`,level:`縮放比例 ({level}%)`,dragTip:`拖曳滑鼠選擇要放大的範圍`},pan:{toggle:`頁面移動模式`},pointer:{toggle:`鼠標模式`},capture:{screenshot:`截圖`,dragTip:`拖曳滑鼠選擇要截取的範圍`,title:`截取的PDF範圍`,download:`下載`,cancel:`取消`},document:{menu:`文件選項`,open:`開啟`,close:`關閉`,print:`列印`,protect:`文件保護`,export:`匯出`,fullscreen:`全螢幕`,loading:`檔案載入中...`},emptyState:{title:`尚無檔案開啟`,description:`請點擊「+ 開啟檔案」按鈕選擇並開啟一個PDF檔案。`,descriptionMulti:`您可以使用分頁同時開啟多個檔案。`,openButton:`開啟檔案`,supportedFormats:`支援的檔案格式為:PDF`},passwordPrompt:{title:`請輸入密碼`,required:`該檔案設有密碼,請輸入密碼以開啟檔案。`,incorrect:`密碼不正確,請再試一次。`,incorrectWarning:`密碼錯誤,請重新輸入。`,label:`密碼`,placeholder:`請輸入檔案密碼`,open:`開啟`,opening:`開啟中...`,cancel:`取消`,close:`關閉`},documentError:{title:`檔案載入發生錯誤`,unknown:`未知錯誤`,errorCode:`錯誤碼:{code}`,close:`關閉檔案`},panel:{sidebar:`側邊欄`,search:`搜尋`,comment:`註解`,thumbnails:`縮圖`,outline:`文件大綱`,annotationStyle:`註解樣式`,redaction:`檢視遮蔽`},menu:{viewControls:`畫面控制`,zoomControls:`縮放控制`,moreOptions:`更多選項`},outline:{title:`文件大綱`,loading:`大綱載入中...`,noOutline:`沒有大綱`,noBookmarks:`該檔案不含書籤`},page:{settings:`頁面設定`,single:`單頁檢視`,twoOdd:`雙頁檢視`,twoEven:`書籍檢視`,vertical:`垂直捲動`,horizontal:`水平捲動`,spreadMode:`跨頁模式`,scrollLayout:`捲動版面`,rotation:`頁面旋轉`,next:`下一頁`,previous:`上一頁`},rotate:{clockwise:`順時針旋轉`,counterClockwise:`逆時針旋轉`},selection:{copy:`複製`},mode:{view:`檢視`,annotate:`註解`,shapes:`形狀`,form:`表單`,redact:`遮蔽`,insert:`插入`},form:{textfield:`文字方塊`,checkbox:`核取方塊`,radio:`單選按鈕`,select:`下拉式選單`,listbox:`清單方塊`},annotation:{text:`文字`,highlight:`強調`,strikeout:`刪除線`,underline:`底線`,squiggly:`波浪底線`,rectangle:`矩形`,circle:`圓形`,line:`直線`,arrow:`箭頭`,polygon:`多邊形`,polyline:`折線`,ink:`繪圖`,inkHighlighter:`螢光筆`,stamp:`印章`,caret:`插入符號`,insertText:`插入文字`,replaceText:`替換文字`,freeText:`文字`,square:`矩形`,style:`圖形樣式`,styles:`{type} 樣式`,defaults:`{type} 預設值`,color:`色彩`,opacity:`透明度`,blendMode:`混合模式`,strokeWidth:`線條粗細`,strokeColor:`線條色彩`,borderStyle:`線條樣式`,fillColor:`填入色彩`,fontSize:`大小`,fontFamily:`字型`,textAlign:`水平對齊`,verticalAlign:`垂直對齊`,lineEnding:`線條端點`,lineStart:`線條起點`,lineEnd:`線條終點`,font:`字體`,fontColor:`字型色彩`,backgroundColor:`背景色彩`,noStyles:`該註解無需設定樣式。`,noStylesStamp:`圖片無需設定樣式。`,selectAnnotation:`在此處查看選取註解的樣式。`,deleteSelected:`移除選取的註解`,deleteAllSelected:`移除選取項目`,multiSelect:`已選擇 {count} 筆註解`,group:`群組`,ungroup:`取消群組`,moreTools:`更多工具`,addLink:`新增連結`,removeLink:`移除連結`,gotoLink:`前往連結`,comment:`留言`,callout:`圖說`,redact:`遮蔽`,overlayText:`覆蓋文字`,overlayTextPlaceholder:`例如:已遮蔽`,rotation:`旋轉`},insert:{image:`圖片`,rubberStamp:`印章`},redaction:{redact:`遮蔽`,area:`遮蔽範圍`,text:`遮蔽文字`,apply:`套用遮蔽`,applyAll:`全部套用`,clearAll:`全部清除`,deleteSelected:`取消遮蔽`,commitSelected:`套用遮蔽`,emptyState:`暫無待處理的遮蔽`,panel:{title:`遮蔽`,itemCount:`{count} 個待處理遮蔽`,itemCountPlural:`{count} 個待處理遮蔽`,clearAll:`全部清除`,redactAll:`全部遮蔽`}},history:{undo:`還原`,redo:`取消復原`},comments:{page:`第{page}頁`,commentCount:`{count}則留言`,commentCountPlural:`{count}則留言`,addComment:`新增留言...`,addReply:`新增回覆...`,showAllAnnotations:`顯示所有註解`,closeAllAnnotations:`關閉所有註解`,save:`儲存`,cancel:`取消`,edit:`編輯`,delete:`移除`,showMore:`展開`,showLess:`折疊`,emptyState:`新增註解後,可以在此對註解進行編輯。`},blendMode:{normal:`正常`,multiply:`色彩增值`,screen:`濾色`,overlay:`覆蓋`,darken:`變暗`,lighten:`變亮`,colorDodge:`加亮顏色`,colorBurn:`加深顏色`,hardLight:`強光`,softLight:`柔光`,difference:`差值`,exclusion:`排除`,hue:`色相`,saturation:`飽和度`,color:`色彩`,luminosity:`光度`},print:{title:`列印設定`,loading:`處理中...`,pages:`要列印的頁碼`,all:`所有頁面`,current:`目前頁面({currentPage})`,specify:`指定頁面`,specifyEG:`例如:1-3, 5, 8-10`,total:`文件總頁數:{totalPages}`,annotation:`包含註解`,printing:`列印中...`,print:`列印`,cancel:`取消`},protect:{title:`文件保護`,cancel:`取消`,apply:`套用文件保護`,applying:`正在套用...`,applyFailed:`無法套用文件保護。請重試。`,removeFailed:`無法移除文件保護。請重試。`,passwordMismatch:`密碼不符`,noProtectionSelected:`請至少選擇一種文件保護方式。`,bothPasswordsNote:`使用文件密碼開啟的使用者將受到權限限制。使用擁有者密碼可獲得完整存取權限。`,openPassword:{title:`需要密碼才能開啟`,description:`使用者必須輸入密碼才能檢視此文件。`,label:`文件密碼`,placeholder:`輸入密碼`,confirm:`確認密碼`,confirmPlaceholder:`確認密碼`},ownerPassword:{label:`擁有者密碼`,placeholder:`輸入擁有者密碼`,confirm:`確認擁有者密碼`,confirmPlaceholder:`確認擁有者密碼`},permissions:{title:`限制權限`,description:`限制使用者對此文件的權限。`,allowedActions:`允許的操作`,print:`列印`,printHighQuality:`高品質列印`,copy:`複製內容`,accessibility:`擷取無障礙工具內容`,modify:`修改`,annotations:`新增/修改註解`,fillForms:`填寫表單與簽章`,assemble:`組合文件與擷取頁面`},encrypted:{title:`文件受保護`,description:`此文件已被擁有者保護。請輸入擁有者密碼以修改安全設定。`,enterOwnerPassword:`輸入擁有者密碼以修改`,unlockAndEdit:`解除鎖定並編輯`},modifyProtection:{title:`修改文件保護`,description:`選擇如何修改文件保護。`,changeOption:`變更密碼或權限`,changeDescription:`更新文件密碼或權限設定。`,removeOption:`移除所有文件保護`,removeDescription:`移除此文件的密碼保護。`},removeProtection:{title:`移除文件保護`,warning:`確定要移除文件保護嗎?`,description:`這將移除文件的所有密碼保護。任何人都可以開啟和修改它。`,confirm:`移除文件保護`}},security:{protected:{title:`此文件受保護`,description:`此文件受保護,某些功能可能被停用。請在文件選單中點擊「文件保護」以查看或解除權限鎖定。`,viewPermissions:`檢視權限`},viewPermissions:{title:`文件權限`,description:`此文件受擁有者限制,需要密碼才能解除特定操作的鎖定。`,restrictedActions:`受限操作`},unlock:{label:`輸入擁有者密碼以解除檔案鎖定`,placeholder:`輸入擁有者密碼`,button:`解除檔案鎖定`,invalidPassword:`密碼無效。請重試。`,failed:`解除鎖定失敗。請重試。`,success:`擁有者權限已解除鎖定!您現在擁有完整存取權限。`}},common:{close:`關閉`,back:`返回`,cancel:`取消`},link:{title:`插入連結`,url:`網址`,page:`頁面`,enterUrl:`輸入網址`,enterPage:`輸入頁碼`,pageRange:`第1頁到第{totalPages}頁`,link:`連結`},stamp:{title:`印章`,allStamps:`所有印章`,export:`匯出印章`,emptyState:`沒有找到印章。`,createFromSelected:`建立印章`,createFromGroup:`從群組建立印章`,library:{custom:`自訂印章`}},signature:{title:`簽章`,createNew:`建立新簽章`,createNewWithInitials:`建立簽章和姓名縮寫`,placeSignature:`簽章`,placeInitials:`姓名縮寫`,remove:`移除簽章`,emptyState:`尚未建立簽章。建立一個來開始吧。`,create:{title:`建立簽章`,draw:`繪製`,type:`輸入`,upload:`上傳`,signatureLabel:`簽章`,initialsLabel:`姓名縮寫`,clear:`清除`,typePlaceholder:`例如:王小明`,initialsPlaceholder:`例如:王`,uploadPlaceholder:`點擊或將圖片拖曳至此`,font:`字體`,color:`色彩`,cancel:`取消`,save:`儲存`}}}},{code:`ja`,name:`日本語`,translations:{search:{placeholder:`検索`,caseSensitive:`大文字小文字を区別`,wholeWord:`単語単位で検索`,resultsFound:`{count}件見つかりました`,page:`{page}ページ`},zoom:{in:`拡大`,out:`縮小`,fitWidth:`幅に合わせる`,fitPage:`ページに合わせる`,marquee:`範囲選択ズーム`,menu:`ズームメニュー`,level:`ズーム ({level}%)`,dragTip:`ドラッグしてズーム範囲を選択`},pan:{toggle:`パンモードの切り替え`},pointer:{toggle:`ポインターモードの切り替え`},capture:{screenshot:`スクリーンショット`,dragTip:`ドラッグしてキャプチャ範囲を選択`,title:`スクリーンショットプレビュー`,download:`ダウンロード`,cancel:`キャンセル`},document:{menu:`ドキュメントメニュー`,open:`開く`,close:`閉じる`,print:`印刷`,protect:`セキュリティ`,export:`エクスポート`,fullscreen:`全画面表示`,loading:`ドキュメントを読み込み中...`},emptyState:{title:`ドキュメントが開かれていません`,description:`PDFドキュメントを開いて始めましょう。`,descriptionMulti:`タブを使って複数のドキュメントを表示できます。`,openButton:`ドキュメントを開く`,supportedFormats:`対応フォーマット: PDF`},passwordPrompt:{title:`パスワードが必要です`,required:`このドキュメントはパスワードで保護されています。パスワードを入力してください。`,incorrect:`入力されたパスワードが正しくありません。もう一度お試しください。`,incorrectWarning:`パスワードが正しくありません。確認してもう一度お試しください。`,label:`パスワード`,placeholder:`ドキュメントのパスワードを入力`,open:`開く`,opening:`開いています...`,cancel:`キャンセル`,close:`閉じる`},documentError:{title:`ドキュメントの読み込みエラー`,unknown:`不明なエラーが発生しました`,errorCode:`エラーコード: {code}`,close:`ドキュメントを閉じる`},panel:{sidebar:`サイドバー`,search:`検索`,comment:`コメント`,thumbnails:`サムネイル`,outline:`アウトライン`,annotationStyle:`注釈スタイル`,redaction:`黒塗りサイドバー`},menu:{viewControls:`表示コントロール`,zoomControls:`ズームコントロール`,moreOptions:`その他のオプション`},outline:{title:`アウトライン`,loading:`アウトラインを読み込み中...`,noOutline:`アウトラインがありません`,noBookmarks:`このドキュメントにはブックマークがありません`},page:{settings:`ページ設定`,single:`単一ページ`,twoOdd:`見開き(奇数)`,twoEven:`見開き(偶数)`,vertical:`縦方向`,horizontal:`横方向`,spreadMode:`見開きモード`,scrollLayout:`スクロールレイアウト`,rotation:`ページ回転`,next:`次のページ`,previous:`前のページ`},rotate:{clockwise:`時計回りに回転`,counterClockwise:`反時計回りに回転`},selection:{copy:`選択範囲をコピー`},mode:{view:`表示`,annotate:`注釈`,shapes:`図形`,form:`フォーム`,redact:`黒塗り`,insert:`挿入`},form:{textfield:`テキストフィールド`,checkbox:`チェックボックス`,radio:`ラジオボタン`,select:`ドロップダウン`,listbox:`リストボックス`},annotation:{text:`テキスト`,highlight:`ハイライト`,strikeout:`取り消し線`,underline:`下線`,squiggly:`波線`,rectangle:`四角形`,circle:`円`,line:`線`,arrow:`矢印`,polygon:`多角形`,polyline:`折れ線`,ink:`インク`,inkHighlighter:`インク蛍光ペン`,stamp:`スタンプ`,freeText:`フリーテキスト`,square:`正方形`,style:`注釈スタイル`,styles:`{type}のスタイル`,defaults:`{type}のデフォルト`,color:`色`,opacity:`不透明度`,blendMode:`ブレンドモード`,strokeWidth:`線の太さ`,strokeColor:`線の色`,borderStyle:`枠線のスタイル`,fillColor:`塗りつぶしの色`,fontSize:`フォントサイズ`,fontFamily:`フォント`,textAlign:`テキスト配置`,verticalAlign:`縦方向の配置`,lineEnding:`線の端点`,lineStart:`始点`,lineEnd:`終点`,font:`フォント`,fontColor:`フォントの色`,backgroundColor:`背景色`,noStyles:`この注釈にはスタイルがありません。`,noStylesStamp:`スタンプにはスタイルがありません。`,selectAnnotation:`注釈を選択してスタイルを表示`,deleteSelected:`選択した注釈を削除`,deleteAllSelected:`選択を削除`,multiSelect:`{count}件の注釈が選択されています`,group:`グループ化`,ungroup:`グループ解除`,moreTools:`その他のツール`,addLink:`リンクを追加`,removeLink:`リンクを削除`,gotoLink:`リンク先へ移動`,comment:`コメント`,callout:`吹き出し`,redact:`黒塗り`,overlayText:`オーバーレイテキスト`,overlayTextPlaceholder:`例: 黒塗り済み`,rotation:`回転`},insert:{image:`画像`,rubberStamp:`スタンプ`},redaction:{redact:`黒塗り`,area:`範囲の黒塗り`,text:`テキストの黒塗り`,apply:`黒塗りを適用`,applyAll:`すべて適用`,clearAll:`すべてクリア`,deleteSelected:`選択した黒塗りを削除`,commitSelected:`選択した黒塗りを適用`,emptyState:`保留中の黒塗りはありません`,panel:{title:`黒塗り`,itemCount:`{count}件の保留中の黒塗り`,itemCountPlural:`{count}件の保留中の黒塗り`,clearAll:`すべてクリア`,redactAll:`すべて黒塗り`}},history:{undo:`元に戻す`,redo:`やり直す`},comments:{page:`{page}ページ`,commentCount:`{count}件のコメント`,commentCountPlural:`{count}件のコメント`,addComment:`コメントを追加...`,addReply:`返信を追加...`,showAllAnnotations:`すべての注釈を表示`,closeAllAnnotations:`すべての注釈を閉じる`,save:`保存`,cancel:`キャンセル`,edit:`編集`,delete:`削除`,showMore:`もっと見る`,showLess:`閉じる`,emptyState:`注釈を追加してコメントできるようにしましょう。`},blendMode:{normal:`通常`,multiply:`乗算`,screen:`スクリーン`,overlay:`オーバーレイ`,darken:`暗く`,lighten:`明るく`,colorDodge:`覆い焼きカラー`,colorBurn:`焼き込みカラー`,hardLight:`ハードライト`,softLight:`ソフトライト`,difference:`差の絶対値`,exclusion:`除外`,hue:`色相`,saturation:`彩度`,color:`カラー`,luminosity:`輝度`},print:{title:`印刷設定`,loading:`ドキュメントを準備中...`,pages:`印刷するページ`,all:`すべてのページ`,current:`現在のページ ({currentPage})`,specify:`ページを指定`,specifyEG:`例: 1-3, 5, 8-10`,total:`ドキュメントの総ページ数: {totalPages}`,annotation:`注釈を含める`,printing:`印刷中...`,print:`印刷`,cancel:`キャンセル`},protect:{title:`ドキュメントの保護`,cancel:`キャンセル`,apply:`保護を適用`,applying:`適用中...`,applyFailed:`保護の適用に失敗しました。もう一度お試しください。`,removeFailed:`保護の解除に失敗しました。もう一度お試しください。`,passwordMismatch:`パスワードが一致しません`,noProtectionSelected:`適用する保護オプションを少なくとも1つ選択してください。`,bothPasswordsNote:`ドキュメントパスワードで開いたユーザーは権限が制限されます。オーナーパスワードを使用すると完全なアクセスが可能になります。`,openPassword:{title:`開くにはパスワードが必要`,description:`このドキュメントを表示するにはパスワードの入力が必要です。`,label:`ドキュメントパスワード`,placeholder:`パスワードを入力`,confirm:`パスワードの確認`,confirmPlaceholder:`パスワードを確認`},ownerPassword:{label:`オーナーパスワード`,placeholder:`オーナーパスワードを入力`,confirm:`オーナーパスワードの確認`,confirmPlaceholder:`オーナーパスワードを確認`},permissions:{title:`権限を制限`,description:`このドキュメントでユーザーが行える操作を制限します。`,allowedActions:`許可された操作`,print:`印刷`,printHighQuality:`高品質印刷`,copy:`コンテンツのコピー`,accessibility:`アクセシビリティのための抽出`,modify:`コンテンツの変更`,annotations:`注釈・コメントの追加/変更`,fillForms:`フォームの入力と署名`,assemble:`ページの組み立てと抽出`},encrypted:{title:`ドキュメントは保護されています`,description:`このドキュメントはオーナーによって保護されています。セキュリティ設定を変更するにはオーナーパスワードを入力してください。`,enterOwnerPassword:`オーナーパスワードを入力して変更`,unlockAndEdit:`ロック解除して編集`},modifyProtection:{title:`保護の変更`,description:`ドキュメントの保護をどのように変更するか選択してください。`,changeOption:`パスワードまたは権限を変更`,changeDescription:`ドキュメントパスワードまたは権限設定を更新します。`,removeOption:`すべての保護を解除`,removeDescription:`このドキュメントからパスワード保護を解除します。`},removeProtection:{title:`保護の解除`,warning:`保護を解除してもよろしいですか?`,description:`ドキュメントからすべてのパスワード保護が解除されます。誰でもドキュメントを開いて変更できるようになります。`,confirm:`保護を解除`}},security:{protected:{title:`このドキュメントは保護されています`,description:`このファイルは保護されており、一部の機能が無効になっている場合があります。ドキュメントメニューのセキュリティから権限を確認またはロック解除できます。`,viewPermissions:`権限を表示`},viewPermissions:{title:`ドキュメントの権限`,description:`このファイルはオーナーによって制限されており、特定の操作をロック解除するにはパスワードが必要です。`,restrictedActions:`制限された操作`},unlock:{label:`オーナーパスワードを入力してロック解除`,placeholder:`オーナーパスワードを入力`,button:`ファイルのロックを解除`,invalidPassword:`パスワードが無効です。もう一度お試しください。`,failed:`ロック解除に失敗しました。もう一度お試しください。`,success:`オーナー権限がロック解除されました!完全なアクセスが可能になりました。`}},common:{close:`閉じる`,back:`戻る`,cancel:`キャンセル`},link:{title:`リンクの挿入`,url:`URL`,page:`ページ`,enterUrl:`URLを入力`,enterPage:`ページ番号を入力`,pageRange:`1~{totalPages}ページ`,link:`リンク`},stamp:{title:`スタンプ`,allStamps:`すべてのスタンプ`,export:`スタンプをエクスポート`,emptyState:`選択したライブラリにスタンプが見つかりません。`,createFromSelected:`スタンプを作成`,createFromGroup:`グループからスタンプを作成`,library:{custom:`カスタムスタンプ`}},signature:{title:`署名`,createNew:`新しい署名を作成`,createNewWithInitials:`署名とイニシャルを作成`,placeSignature:`署名`,placeInitials:`イニシャル`,remove:`署名を削除`,emptyState:`まだ署名がありません。作成して始めましょう。`,create:{title:`署名を作成`,draw:`描く`,type:`入力`,upload:`アップロード`,signatureLabel:`署名`,initialsLabel:`イニシャル`,clear:`クリア`,typePlaceholder:`例:山田太郎`,initialsPlaceholder:`例:山田`,uploadPlaceholder:`クリックまたは画像をここにドラッグ`,font:`フォント`,color:`色`,cancel:`キャンセル`,save:`保存`}}}},{code:`sv`,name:`Svenska`,translations:{search:{placeholder:`Sök`,caseSensitive:`Skiftlägeskänslig`,wholeWord:`Hela ord`,resultsFound:`{count} träffar`,page:`Sida {page}`},zoom:{in:`Zooma in`,out:`Zooma ut`,fitWidth:`Sidbredd`,fitPage:`Sidnivå`,marquee:`Zooma till markering`,menu:`Zoommeny`,level:`Zoomnivå ({level}%)`,dragTip:`Dra för att välja ett område att zooma in på`},pan:{toggle:`Panorera`},pointer:{toggle:`Välj`},capture:{screenshot:`Skärmdumpa`,dragTip:`Dra för att välja område`,title:`Förhandsgranskning`,download:`Ladda ned`,cancel:`Avbryt`},document:{menu:`Filmeny`,open:`Öppna`,close:`Stäng`,print:`Skriv ut`,protect:`Säkerhet`,export:`Ladda ned`,fullscreen:`Helskärmsläge`,loading:`Läser in dokumentet...`},emptyState:{title:`Ingen fil är öppen`,description:`Öppna en pdf för att komma igång.`,descriptionMulti:`Du kan växla mellan olika filer med hjälp av flikar.`,openButton:`Öppna fil`,supportedFormats:`Format som stöds: PDF`},passwordPrompt:{title:`Lösenord krävs`,required:`Den här filen är lösenordsskyddad. Skriv in lösenordet för att öppna den.`,incorrect:`Lösenordet du skrev in var fel. Var god försök igen.`,incorrectWarning:`Fel lösenord. Kontrollera att du skrivit rätt och försök igen.`,label:`Lösenord`,placeholder:`Skriv in filens lösenord`,open:`Öppna`,opening:`Öppnar...`,cancel:`Avbryt`,close:`Stäng`},documentError:{title:`Fel när dokumentet lästes in`,unknown:`Ett okänt fel inträffade`,errorCode:`Felkod: {code}`,close:`Stäng dokumentet`},panel:{sidebar:`Sidofält`,search:`Sök`,comment:`Kommentera`,thumbnails:`Miniatyrbilder`,outline:`Dokumentdisposition`,annotationStyle:`Annoteringsstil`,redaction:`Sidofält för maskning`},menu:{viewControls:`Visa kontroller`,zoomControls:`Zoomkontroller`,moreOptions:`Fler alternativ`},outline:{title:`Dokumentdisposition`,loading:`Läser in disposition...`,noOutline:`Ingen disposition tillgänglig`,noBookmarks:`Det här dokumentet har inga bokmärken`},page:{settings:`Sidinställningar`,single:`Enkelsidig vy`,twoOdd:`Dubbelsidig vy (Udda)`,twoEven:`Dubbelsidig vy (Jämna)`,vertical:`Lodrätt`,horizontal:`Vågrätt`,spreadMode:`Vy`,scrollLayout:`Skrollningsläge`,rotation:`Rotera`,next:`Nästa sida`,previous:`Föregående sida`},rotate:{clockwise:`Rotera medurs`,counterClockwise:`Rotera moturs`},selection:{copy:`Kopiera markering`},mode:{view:`Läsvy`,annotate:`Annotera`,shapes:`Rita former`,form:`Formulär`,redact:`Maskera`,insert:`Infoga`},form:{textfield:`Textfält`,checkbox:`Kryssruta`,radio:`Alternativknapp`,select:`Rullgardinsmeny`,listbox:`Listruta`},annotation:{text:`Text`,highlight:`Överstrykningspenna`,strikeout:`Genomstruken`,underline:`Understruken`,squiggly:`Vågig`,rectangle:`Rektangel`,circle:`Cirkel`,line:`Linje`,arrow:`Pil`,polygon:`Polygon`,polyline:`Flerpunktslinje`,ink:`Bläck`,inkHighlighter:`Bläcköverstrykningspenna`,stamp:`Stämpel`,freeText:`Fritext`,square:`Kvadrat`,style:`Annoteringsstil`,styles:`{type}stilar`,defaults:`{type}förval`,color:`Färg`,opacity:`Genomskinlighet`,blendMode:`Blandningsläge`,strokeWidth:`Linjebredd`,strokeColor:`Linjefärg`,borderStyle:`Kantlinjestil`,fillColor:`Fyllningsfärg`,fontSize:`Teckenstorlek`,fontFamily:`Typsnitt`,textAlign:`Justering`,verticalAlign:`Vertikal justering`,lineEnding:`Linjeslut`,lineStart:`Linjestart`,lineEnd:`Linjeslut`,font:`Typsnitt`,fontColor:`Teckenfärg`,backgroundColor:`Bakgrundsfärg`,noStyles:`Den här annoteringen har inga valda stilar.`,noStylesStamp:`Inga stilar finns tillgängliga.`,selectAnnotation:`Välj en annotering för att se stilalternativ.`,deleteSelected:`Ta bort vald annotering`,deleteAllSelected:`Ta bort alla valda`,multiSelect:`{count} annoteringar valda`,group:`Gruppera`,ungroup:`Lös upp grupp`,moreTools:`Fler verktyg`,addLink:`Lägg till länk`,removeLink:`Ta bort länk`,gotoLink:`Gå till länk`,comment:`Kommentera`,callout:`Bildtext`,redact:`Maskera`,overlayText:`Textöverlägg`,overlayTextPlaceholder:`t.ex., MASKERAD`,rotation:`Rotera`},insert:{image:`Bild`,rubberStamp:`Stämpel`},redaction:{redact:`Maskera`,area:`Maskera område`,text:`Maskera text`,apply:`Tillämpa maskering`,applyAll:`Tillämpa alla`,clearAll:`Rensa alla`,deleteSelected:`Ta bort vald maskering`,commitSelected:`Tillämpa vald maskering`,emptyState:`Inget väntar på att maskeras`,panel:{title:`Maskering`,itemCount:`{count} väntar på att maskeras`,itemCountPlural:`{count} väntar på att maskeras`,clearAll:`Rensa alla`,redactAll:`Maskera alla`}},history:{undo:`Ångra`,redo:`Gör om`},comments:{page:`Sida {page}`,commentCount:`{count} kommentar`,commentCountPlural:`{count} kommentarer`,addComment:`Lägg till kommentar...`,addReply:`Lägg till svar...`,showAllAnnotations:`Visa alla anteckningar`,closeAllAnnotations:`Stäng alla anteckningar`,save:`Spara`,cancel:`Avbryt`,edit:`Redigera`,delete:`Radera`,showMore:`mer`,showLess:`mindre`,emptyState:`Lägg till annoteringar för att kunna kommentera dem.`},blendMode:{normal:`Normal`,multiply:`Multiplicera`,screen:`Skärm`,overlay:`Täck över`,darken:`Mörkare`,lighten:`Ljusare`,colorDodge:`Färgskugga`,colorBurn:`Efterbelys färg`,hardLight:`Skarpt ljus`,softLight:`Mjukt ljus`,difference:`Differens`,exclusion:`Uteslutning`,hue:`Nyans`,saturation:`Mättnad`,color:`Färg`,luminosity:`Luminiscens`},print:{title:`Utskriftsinställningar`,loading:`Förbereder dokument...`,pages:`Sidor att skriva ut`,all:`Alla sidor`,current:`Aktuell sida ({currentPage})`,specify:`Välj sidor`,specifyEG:`t.ex. 1-3, 5, 8-10`,total:`Totalt antal sidor i dokumentet: {totalPages}`,annotation:`Inkludera annoteringar`,printing:`Skriver ut...`,print:`Skriv ut`,cancel:`Avbryt`},protect:{title:`Skydda dokumentet`,cancel:`Avbryt`,apply:`Tillämpa skydd`,applying:`Tillämpar...`,applyFailed:`Misslyckades med att tillämpa skydd. Var god försök igen.`,removeFailed:`Misslyckades med att ta bort skydd. Var god försök igen.`,passwordMismatch:`Lösenorden stämmer inte överens`,noProtectionSelected:`Välj minst ett alternativ att tillämpa.`,bothPasswordsNote:`Användare som öppnar dokumentet med lösenordet kommer ha begränsade behörigheter. Använd ägarlösenordet för att låsa upp alla behörigheter.`,openPassword:{title:`Kräv lösenord för att öppna fil`,description:`Användare måste skriva in ett lösenord för att öppna dokumentet.`,label:`Dokumentlösenord`,placeholder:`Skriv in lösenord`,confirm:`Bekräfta lösenord`,confirmPlaceholder:`Bekräfta lösenord`},ownerPassword:{label:`Ägarlösenord`,placeholder:`Skriv in ägarlösenord`,confirm:`Bekräfta ägarlösenord`,confirmPlaceholder:`Bekräfta ägarlösenord`},permissions:{title:`Begränsa behörigheter`,description:`Begränsa vad användaren kan göra med dokumentet.`,allowedActions:`Tillåtna handlingar`,print:`Skriv ut`,printHighQuality:`Skriv ut i hög kvalitet`,copy:`Kopiera innehåll`,accessibility:`Extrahera för tillgänglighet`,modify:`Ändra innehåll`,annotations:`Lägga till/ändra annoteringar & kommentarer`,fillForms:`Fylla i formulär & signera`,assemble:`Ordna sidor`},encrypted:{title:`Dokumentet är skyddat`,description:`Det här dokumentet skyddas av ägaren. Skriv in ägarlösenordet för att ändra säkerhetsinställningarna.`,enterOwnerPassword:`Skriv in ägarlösenordet för att redigera`,unlockAndEdit:`Lås upp & redigera`},modifyProtection:{title:`Ändra skydd`,description:`Välj hur du vill ändra dokumentskyddet.`,changeOption:`Ändra lösenord eller behörigheter`,changeDescription:`Ändra dokumentets lösenord eller behörigheter.`,removeOption:`Ta bort alla skydd`,removeDescription:`Ta bort lösenordsskydd från dokumentet.`},removeProtection:{title:`Ta bort skydd`,warning:`Är du säker på att du vill ta bort skydd?`,description:`Det här kommer ta bort allt lösenordsskydd från dokumentet. Vem som helst kommer kunna öppna och ändra det.`,confirm:`Ta bort skydd`}},security:{protected:{title:`Det här dokumentet är skyddat`,description:`Den här filen är skyddad och vissa funktioner kan vara inaktiverade. Gå till Säkerhet i filmenyn för att visa eller låsa upp behörigheter.`,viewPermissions:`Visa behörigheter`},viewPermissions:{title:`Filbehörigheter`,description:`Den här filen är skyddad av ägaren och kräver ett lösenord för vissa handlingar.`,restrictedActions:`Begränsade handlingar`},unlock:{label:`Skriv in ägarlösenordet för att låsa upp filen`,placeholder:`Skriv in ägarlösenordet`,button:`Lås upp filen`,invalidPassword:`Ogiltigt lösenord. Var vänlig försök igen.`,failed:`Misslyckades med att låsa upp. Var vänlig försök igen.`,success:`Ägarbehörighet upplåst! Du har nu full åtkomst.`}},common:{close:`Stäng`,back:`Tillbaka`,cancel:`Avbryt`},link:{title:`Lägg till länk`,url:`URL`,page:`Sida`,enterUrl:`Skriv in URL`,enterPage:`Skriv in sidnummer`,pageRange:`Sida 1 till {totalPages}`,link:`Länk`},stamp:{title:`Stämplar`,allStamps:`Alla stämplar`,export:`Exportera stämplar`,emptyState:`Inga stämplar hittades i det valda biblioteket.`,createFromSelected:`Skapa stämpel`,createFromGroup:`Skapa stämpel från grupp`,library:{custom:`Egna stämplar`}},signature:{title:`Signaturer`,createNew:`Skapa ny signatur`,createNewWithInitials:`Skapa signatur & initialer`,placeSignature:`Signatur`,placeInitials:`Initialer`,remove:`Ta bort signatur`,emptyState:`Inga signaturer ännu. Skapa en för att komma igång.`,create:{title:`Skapa signatur`,draw:`Rita`,type:`Skriv`,upload:`Ladda upp`,signatureLabel:`Signatur`,initialsLabel:`Initialer`,clear:`Rensa`,typePlaceholder:`t.ex. Erik Svensson`,initialsPlaceholder:`t.ex. ES`,uploadPlaceholder:`Klicka eller dra en bild hit`,font:`Typsnitt`,color:`Färg`,cancel:`Avbryt`,save:`Spara`}}}},{code:`pt-BR`,name:`Português (Brasil)`,translations:{search:{placeholder:`Pesquisar`,caseSensitive:`Diferenciar maiúsculas e minúsculas`,wholeWord:`Palavra inteira`,resultsFound:`{count} resultados encontrados`,page:`Página {page}`},zoom:{in:`Aproximar`,out:`Afastar`,fitWidth:`Ajustar à largura`,fitPage:`Ajustar à página`,marquee:`Zoom por área`,menu:`Menu de zoom`,level:`Nível de zoom ({level}%)`,dragTip:`Arraste para selecionar a área de zoom`},pan:{toggle:`Alternar modo de arrastar`},pointer:{toggle:`Alternar modo de ponteiro`},capture:{screenshot:`Captura de tela`,dragTip:`Arraste para selecionar a área a capturar`,title:`Pré-visualização da captura`,download:`Baixar`,cancel:`Cancelar`},document:{menu:`Menu do documento`,open:`Abrir`,close:`Fechar`,print:`Imprimir`,protect:`Segurança`,export:`Exportar`,fullscreen:`Tela cheia`,loading:`Carregando documento...`},emptyState:{title:`Nenhum documento aberto`,description:`Abra um documento PDF para começar.`,descriptionMulti:`Você pode visualizar vários documentos usando abas.`,openButton:`Abrir documento`,supportedFormats:`Formato suportado: PDF`},passwordPrompt:{title:`Senha necessária`,required:`Este documento está protegido por senha. Digite a senha para abri-lo.`,incorrect:`A senha digitada está incorreta. Tente novamente.`,incorrectWarning:`Senha incorreta. Verifique e tente novamente.`,label:`Senha`,placeholder:`Digite a senha do documento`,open:`Abrir`,opening:`Abrindo...`,cancel:`Cancelar`,close:`Fechar`},documentError:{title:`Erro ao carregar o documento`,unknown:`Ocorreu um erro desconhecido`,errorCode:`Código do erro: {code}`,close:`Fechar documento`},panel:{sidebar:`Barra lateral`,search:`Pesquisa`,comment:`Comentários`,thumbnails:`Miniaturas`,outline:`Sumário`,annotationStyle:`Estilo de anotação`,redaction:`Barra lateral de redação`},menu:{viewControls:`Controles de visualização`,zoomControls:`Controles de zoom`,moreOptions:`Mais opções`},outline:{title:`Sumário`,loading:`Carregando sumário...`,noOutline:`Nenhum sumário disponível`,noBookmarks:`Este documento não contém marcadores`},page:{settings:`Configurações da página`,single:`Página única`,twoOdd:`Duas páginas (ímpares)`,twoEven:`Duas páginas (pares)`,vertical:`Vertical`,horizontal:`Horizontal`,spreadMode:`Modo de páginas espelhadas`,scrollLayout:`Layout de rolagem`,rotation:`Rotação da página`,next:`Próxima página`,previous:`Página anterior`},rotate:{clockwise:`Girar no sentido horário`,counterClockwise:`Girar no sentido anti-horário`},selection:{copy:`Copiar seleção`},mode:{view:`Visualizar`,annotate:`Anotar`,shapes:`Formas`,form:`Formulário`,redact:`Redigir`,insert:`Inserir`},form:{textfield:`Campo de texto`,checkbox:`Caixa de seleção`,radio:`Botão de opção`,select:`Lista suspensa`,listbox:`Caixa de lista`},annotation:{text:`Texto`,highlight:`Realçar`,strikeout:`Tachado`,underline:`Sublinhado`,squiggly:`Sublinhado ondulado`,rectangle:`Retângulo`,circle:`Círculo`,line:`Linha`,arrow:`Seta`,polygon:`Polígono`,polyline:`Polilinha`,ink:`Tinta`,inkHighlighter:`Marca-texto de tinta`,stamp:`Carimbo`,caret:`Cursor de inserção`,insertText:`Inserir texto`,replaceText:`Substituir texto`,freeText:`Texto livre`,square:`Quadrado`,style:`Estilo de anotação`,styles:`Estilos de {type}`,defaults:`Padrões de {type}`,color:`Cor`,opacity:`Opacidade`,blendMode:`Modo de mesclagem`,strokeWidth:`Espessura do traço`,strokeColor:`Cor do traço`,borderStyle:`Estilo da borda`,fillColor:`Cor de preenchimento`,fontSize:`Tamanho da fonte`,fontFamily:`Fonte`,textAlign:`Alinhamento do texto`,verticalAlign:`Alinhamento vertical`,lineEnding:`Extremidade da linha`,lineStart:`Início da linha`,lineEnd:`Fim da linha`,font:`Fonte`,fontColor:`Cor da fonte`,backgroundColor:`Cor de fundo`,noStyles:`Não há estilos para esta anotação.`,noStylesStamp:`Não há estilos para carimbos.`,selectAnnotation:`Selecione uma anotação para ver seus estilos`,deleteSelected:`Excluir anotação selecionada`,deleteAllSelected:`Excluir selecionadas`,multiSelect:`{count} anotações selecionadas`,group:`Agrupar`,ungroup:`Desagrupar`,moreTools:`Mais ferramentas`,addLink:`Adicionar link`,removeLink:`Remover link`,gotoLink:`Ir para link`,comment:`Comentário`,callout:`Chamada`,redact:`Redigir`,overlayText:`Texto sobreposto`,overlayTextPlaceholder:`ex.: REDIGIDO`,rotation:`Rotação`},insert:{image:`Imagem`,rubberStamp:`Carimbo`},redaction:{redact:`Redigir`,area:`Área de redação`,text:`Redigir texto`,apply:`Aplicar redação`,applyAll:`Aplicar tudo`,clearAll:`Limpar tudo`,deleteSelected:`Excluir redação selecionada`,commitSelected:`Aplicar redação selecionada`,emptyState:`Nenhuma redação pendente`,panel:{title:`Redações`,itemCount:`{count} redação pendente`,itemCountPlural:`{count} redações pendentes`,clearAll:`Limpar tudo`,redactAll:`Redigir tudo`}},history:{undo:`Desfazer`,redo:`Refazer`},comments:{page:`Página {page}`,commentCount:`{count} comentário`,commentCountPlural:`{count} comentários`,addComment:`Adicionar comentário...`,addReply:`Adicionar resposta...`,showAllAnnotations:`Mostrar todas as anotações`,closeAllAnnotations:`Fechar todas as anotações`,save:`Salvar`,cancel:`Cancelar`,edit:`Editar`,delete:`Excluir`,showMore:`mais`,showLess:`menos`,emptyState:`Adicione anotações para poder comentá-las.`},blendMode:{normal:`Normal`,multiply:`Multiplicar`,screen:`Tela`,overlay:`Sobrepor`,darken:`Escurecer`,lighten:`Clarear`,colorDodge:`Subexposição de cores`,colorBurn:`Superexposição de cores`,hardLight:`Luz intensa`,softLight:`Luz suave`,difference:`Diferença`,exclusion:`Exclusão`,hue:`Matiz`,saturation:`Saturação`,color:`Cor`,luminosity:`Luminosidade`},print:{title:`Configurações de impressão`,loading:`Preparando documento...`,pages:`Páginas a imprimir`,all:`Todas as páginas`,current:`Página atual ({currentPage})`,specify:`Especificar páginas`,specifyEG:`ex.: 1-3, 5, 8-10`,total:`Total de páginas no documento: {totalPages}`,annotation:`Incluir anotações`,printing:`Imprimindo...`,print:`Imprimir`,cancel:`Cancelar`},protect:{title:`Proteger documento`,cancel:`Cancelar`,apply:`Aplicar proteção`,applying:`Aplicando...`,applyFailed:`Falha ao aplicar proteção. Tente novamente.`,removeFailed:`Falha ao remover proteção. Tente novamente.`,passwordMismatch:`As senhas não coincidem`,noProtectionSelected:`Selecione pelo menos uma opção de proteção para aplicar.`,bothPasswordsNote:`Usuários que abrirem com a senha do documento terão permissões restritas. Use a senha de proprietário para liberar o acesso completo.`,openPassword:{title:`Exigir senha para abrir`,description:`Os usuários precisarão digitar uma senha para visualizar este documento.`,label:`Senha do documento`,placeholder:`Digite a senha`,confirm:`Confirmar senha`,confirmPlaceholder:`Confirme a senha`},ownerPassword:{label:`Senha de proprietário`,placeholder:`Digite a senha de proprietário`,confirm:`Confirmar senha de proprietário`,confirmPlaceholder:`Confirme a senha de proprietário`},permissions:{title:`Restringir permissões`,description:`Limite o que os usuários podem fazer com este documento.`,allowedActions:`Ações permitidas`,print:`Imprimir`,printHighQuality:`Imprimir em alta qualidade`,copy:`Copiar conteúdo`,accessibility:`Extrair para acessibilidade`,modify:`Modificar conteúdo`,annotations:`Adicionar/modificar anotações e comentários`,fillForms:`Preencher formulários e assinar`,assemble:`Montar e extrair páginas`},encrypted:{title:`O documento está protegido`,description:`Este documento está protegido pelo proprietário. Digite a senha de proprietário para modificar as configurações de segurança.`,enterOwnerPassword:`Digite a senha de proprietário para modificar`,unlockAndEdit:`Desbloquear e editar`},modifyProtection:{title:`Modificar proteção`,description:`Escolha como deseja modificar a proteção do documento.`,changeOption:`Alterar senhas ou permissões`,changeDescription:`Atualize a senha do documento ou as configurações de permissão.`,removeOption:`Remover toda a proteção`,removeDescription:`Remover a proteção por senha deste documento.`},removeProtection:{title:`Remover proteção`,warning:`Tem certeza de que deseja remover a proteção?`,description:`Isso removerá toda a proteção por senha do documento. Qualquer pessoa poderá abri-lo e modificá-lo.`,confirm:`Remover proteção`}},security:{protected:{title:`Este documento está protegido`,description:`Este arquivo está protegido e alguns recursos podem estar desativados. Acesse Segurança no menu do documento para visualizar ou desbloquear as permissões.`,viewPermissions:`Visualizar permissões`},viewPermissions:{title:`Permissões do documento`,description:`Este arquivo está restrito pelo proprietário e requer uma senha para desbloquear determinadas ações.`,restrictedActions:`Ações restritas`},unlock:{label:`Digite a senha de proprietário para desbloquear o arquivo`,placeholder:`Digite a senha de proprietário`,button:`Desbloquear arquivo`,invalidPassword:`Senha inválida. Tente novamente.`,failed:`Falha ao desbloquear. Tente novamente.`,success:`Permissões de proprietário desbloqueadas! Você agora tem acesso completo.`}},common:{close:`Fechar`,back:`Voltar`,cancel:`Cancelar`},link:{title:`Inserir link`,url:`URL`,page:`Página`,enterUrl:`Digite a URL`,enterPage:`Digite o número da página`,pageRange:`Página 1 a {totalPages}`,link:`Link`},stamp:{title:`Carimbos`,allStamps:`Todos os carimbos`,export:`Exportar carimbos`,emptyState:`Nenhum carimbo encontrado na biblioteca selecionada.`,createFromSelected:`Criar carimbo`,createFromGroup:`Criar carimbo a partir de grupo`,library:{custom:`Carimbos personalizados`}},signature:{title:`Assinaturas`,createNew:`Criar nova assinatura`,createNewWithInitials:`Criar assinatura e iniciais`,placeSignature:`Assinatura`,placeInitials:`Iniciais`,remove:`Remover assinatura`,emptyState:`Nenhuma assinatura ainda. Crie uma para começar.`,create:{title:`Criar assinatura`,draw:`Desenhar`,type:`Digitar`,upload:`Enviar`,signatureLabel:`Assinatura`,initialsLabel:`Iniciais`,clear:`Limpar`,typePlaceholder:`ex.: João da Silva`,initialsPlaceholder:`ex.: JS`,uploadPlaceholder:`Clique ou arraste uma imagem aqui`,font:`Fonte`,color:`Cor`,cancel:`Cancelar`,save:`Salvar`}}}}],paramResolvers:_C},ui:{schema:{id:`pdf-viewer-ui`,version:`1.0.0`,toolbars:{"main-toolbar":{id:`main-toolbar`,position:{placement:`top`,slot:`main`,order:0},permanent:!0,responsive:{localeOverrides:{groups:[{id:`cjk-languages`,locales:[`zh-CN`,`ja`,`zh-TW`],breakpoints:{sm:{replaceHide:[`zoom-toolbar`,`mode-select-button`,`form-mode`,`redact-mode`],replaceShow:[`view-mode`,`annotate-mode`,`shapes-mode`,`insert-mode`,`overflow-tabs-button`,`pan-button`,`pointer-button`,`divider-3`]},md:{replaceShow:[`view-mode`,`annotate-mode`,`shapes-mode`,`insert-mode`,`zoom-toolbar`,`overflow-tabs-button`,`pan-button`,`pointer-button`,`divider-3`],replaceHide:[`zoom-menu-button`,`mode-select-button`,`form-mode`,`redact-mode`]}}},{id:`wide-label-languages`,locales:[`de`,`nl`,`pt-BR`],breakpoints:{md:{replaceShow:[`view-mode`,`annotate-mode`,`zoom-toolbar`,`pan-button`,`pointer-button`,`divider-3`,`overflow-tabs-button`]}}}]},breakpoints:{xxxs:{maxWidth:400,hide:[`annotate-mode`,`view-mode`,`shapes-mode`,`insert-mode`,`form-mode`,`redact-mode`,`zoom-toolbar`,`pan-button`,`pointer-button`,`divider-3`,`page-settings-button`,`zoom-menu-button`,`divider-2`,`overflow-tabs-button`],show:[`mode-select-button`]},xxs:{minWidth:400,show:[`page-settings-button`,`zoom-menu-button`,`divider-2`],hide:[`overflow-left-action-menu-button`]},xs:{minWidth:500,maxWidth:640,show:[`pan-button`,`pointer-button`,`divider-3`]},sm:{minWidth:640,maxWidth:768,hide:[`shapes-mode`,`insert-mode`,`form-mode`,`redact-mode`,`zoom-toolbar`,`mode-select-button`],show:[`view-mode`,`annotate-mode`,`overflow-tabs-button`,`pan-button`,`pointer-button`,`divider-3`]},md:{minWidth:768,show:[`view-mode`,`annotate-mode`,`shapes-mode`,`zoom-toolbar`,`pan-button`,`pointer-button`,`divider-3`,`overflow-tabs-button`],hide:[`zoom-menu-button`,`mode-select-button`]},lg:{minWidth:1024,show:[`shapes-mode`,`insert-mode`,`form-mode`,`redact-mode`],hide:[`overflow-tabs-button`]}}},items:[{type:`group`,id:`left-group`,alignment:`start`,gap:2,items:[{type:`command-button`,id:`document-menu-button`,commandId:`document:menu`,variant:`icon`,categories:[`document`,`document-menu`]},{type:`divider`,id:`divider-1`,orientation:`vertical`},{type:`command-button`,id:`sidebar-button`,commandId:`panel:toggle-sidebar`,variant:`icon`,categories:[`panel`,`panel-sidebar`]},{type:`command-button`,id:`overflow-left-action-menu-button`,commandId:`left-action-menu:overflow-menu`,variant:`icon`,categories:[`ui`,`ui-menu`]},{type:`command-button`,id:`page-settings-button`,commandId:`page:settings`,variant:`icon`,categories:[`page`,`page-settings`]}]},{type:`divider`,id:`divider-2`,orientation:`vertical`},{type:`group`,id:`center-group`,alignment:`center`,gap:2,items:[{type:`command-button`,id:`zoom-menu-button`,commandId:`zoom:toggle-menu-mobile`,variant:`icon`,categories:[`zoom`,`zoom-menu`]},{type:`custom`,id:`zoom-toolbar`,componentId:`zoom-toolbar`,categories:[`zoom`]},{type:`divider`,id:`divider-3`,orientation:`vertical`,visibilityDependsOn:{itemIds:[`zoom-toolbar`,`zoom-menu-button`]}},{type:`command-button`,id:`pan-button`,commandId:`pan:toggle`,variant:`icon`,categories:[`tools`,`pan`]},{type:`command-button`,id:`pointer-button`,commandId:`pointer:toggle`,variant:`icon`,categories:[`tools`,`pointer`]}]},{type:`spacer`,id:`spacer-1`,flex:!0},{type:`custom`,id:`mode-select-button`,componentId:`mode-select-button`,categories:[`mode`],visibilityDependsOn:{itemIds:[`mode:annotate`,`mode:shapes`,`mode:insert`,`mode:form`,`mode:redact`]}},{type:`tab-group`,id:`mode-tabs`,tabs:[{id:`view-mode`,commandId:`mode:view`,variant:`text`,categories:[`mode`,`mode-view`],visibilityDependsOn:{itemIds:[`annotate-mode`,`shapes-mode`,`insert-mode`,`form-mode`,`redact-mode`]}},{id:`annotate-mode`,commandId:`mode:annotate`,variant:`text`,categories:[`mode`,`mode-annotate`,`annotation`]},{id:`shapes-mode`,commandId:`mode:shapes`,variant:`text`,categories:[`mode`,`mode-shapes`,`annotation`,`annotation-shape`]},{id:`insert-mode`,commandId:`mode:insert`,variant:`text`,categories:[`mode`,`mode-insert`,`insert`]},{id:`form-mode`,commandId:`mode:form`,variant:`text`,categories:[`mode`,`mode-form`,`form`]},{id:`redact-mode`,commandId:`mode:redact`,variant:`text`,categories:[`mode`,`mode-redact`,`redaction`]},{id:`overflow-tabs-button`,commandId:`tabs:overflow-menu`,variant:`icon`,categories:[`ui`,`ui-menu`],visibilityDependsOn:{menuId:`mode-tabs-overflow-menu`}}]},{type:`spacer`,id:`spacer-2`,flex:!0},{type:`group`,id:`right-group`,alignment:`end`,gap:2,items:[{type:`command-button`,id:`search-button`,commandId:`panel:toggle-search`,variant:`icon`,categories:[`panel`,`panel-search`]},{type:`command-button`,id:`comment-button`,commandId:`panel:toggle-comment`,variant:`icon`,categories:[`panel`,`panel-comment`]}]}]},"annotation-toolbar":{id:`annotation-toolbar`,position:{placement:`top`,slot:`secondary`,order:0},responsive:{breakpoints:{sm:{maxWidth:640,hide:[`add-text`,`add-ink`,`add-ink-highlighter`,`add-insert-text`,`add-replace-text`,`add-comment`,`add-callout`],show:[`overflow-annotation-tools`]},md:{minWidth:640,hide:[`overflow-annotation-tools`],show:[`add-text`,`add-ink`,`add-ink-highlighter`,`add-insert-text`,`add-replace-text`,`add-comment`,`add-callout`]}}},permanent:!1,categories:[`annotation`],items:[{type:`spacer`,id:`spacer-3`,flex:!0},{type:`group`,id:`annotation-tools`,alignment:`start`,gap:2,items:[{type:`command-button`,id:`add-highlight`,commandId:`annotation:add-highlight`,variant:`icon`,categories:[`annotation`,`annotation-markup`,`annotation-highlight`]},{type:`command-button`,id:`add-strikeout`,commandId:`annotation:add-strikeout`,variant:`icon`,categories:[`annotation`,`annotation-markup`,`annotation-strikeout`]},{type:`command-button`,id:`add-underline`,commandId:`annotation:add-underline`,variant:`icon`,categories:[`annotation`,`annotation-markup`,`annotation-underline`]},{type:`command-button`,id:`add-squiggly`,commandId:`annotation:add-squiggly`,variant:`icon`,categories:[`annotation`,`annotation-markup`,`annotation-squiggly`]},{type:`command-button`,id:`add-ink`,commandId:`annotation:add-ink`,variant:`icon`,categories:[`annotation`,`annotation-ink`]},{type:`command-button`,id:`add-ink-highlighter`,commandId:`annotation:add-ink-highlighter`,variant:`icon`,categories:[`annotation`,`annotation-ink`]},{type:`command-button`,id:`add-text`,commandId:`annotation:add-text`,variant:`icon`,categories:[`annotation`,`annotation-text`]},{type:`command-button`,id:`add-insert-text`,commandId:`annotation:add-insert-text`,variant:`icon`,categories:[`annotation`,`annotation-markup`,`annotation-insert-text`]},{type:`command-button`,id:`add-replace-text`,commandId:`annotation:add-replace-text`,variant:`icon`,categories:[`annotation`,`annotation-markup`,`annotation-replace-text`]},{type:`command-button`,id:`add-comment`,commandId:`annotation:add-comment`,variant:`icon`,categories:[`annotation`,`annotation-comment-tool`]},{type:`command-button`,id:`add-callout`,commandId:`annotation:add-callout`,variant:`icon`,categories:[`annotation`,`annotation-text`]},{type:`command-button`,id:`overflow-annotation-tools`,commandId:`annotation:overflow-tools`,variant:`icon`,categories:[`annotation`,`annotation-overflow`]},{type:`divider`,id:`annotation-tools-divider-1`,orientation:`vertical`},{type:`command-button`,id:`toggle-annotation-style`,commandId:`panel:toggle-annotation-style`,variant:`icon`,categories:[`panel`,`panel-annotation-style`]},{type:`divider`,id:`annotation-tools-divider-2`,orientation:`vertical`,visibilityDependsOn:{itemIds:[`toggle-annotation-style`]}},{type:`command-button`,id:`undo-button`,commandId:`history:undo`,variant:`icon`,categories:[`history`,`history-undo`]},{type:`command-button`,id:`redo-button`,commandId:`history:redo`,variant:`icon`,categories:[`history`,`history-redo`]}]},{type:`spacer`,id:`spacer-4`,flex:!0}]},"shapes-toolbar":{id:`shapes-toolbar`,position:{placement:`top`,slot:`secondary`,order:0},responsive:{breakpoints:{sm:{maxWidth:640,hide:[`add-polygon`,`add-polyline`],show:[`overflow-shapes-tools`]},md:{minWidth:640,hide:[`overflow-shapes-tools`],show:[`add-polygon`,`add-polyline`]}}},permanent:!1,categories:[`annotation`,`annotation-shape`],items:[{type:`spacer`,id:`spacer-5`,flex:!0},{type:`group`,id:`shapes-tools`,alignment:`start`,gap:2,items:[{type:`command-button`,id:`add-rectangle`,commandId:`annotation:add-rectangle`,variant:`icon`,categories:[`annotation`,`annotation-shape`,`annotation-rectangle`]},{type:`command-button`,id:`add-circle`,commandId:`annotation:add-circle`,variant:`icon`,categories:[`annotation`,`annotation-shape`,`annotation-circle`]},{type:`command-button`,id:`add-line`,commandId:`annotation:add-line`,variant:`icon`,categories:[`annotation`,`annotation-shape`,`annotation-line`]},{type:`command-button`,id:`add-arrow`,commandId:`annotation:add-arrow`,variant:`icon`,categories:[`annotation`,`annotation-shape`,`annotation-arrow`]},{type:`command-button`,id:`add-polygon`,commandId:`annotation:add-polygon`,variant:`icon`,categories:[`annotation`,`annotation-shape`,`annotation-polygon`]},{type:`command-button`,id:`add-polyline`,commandId:`annotation:add-polyline`,variant:`icon`,categories:[`annotation`,`annotation-shape`,`annotation-polyline`]},{type:`command-button`,id:`overflow-shapes-tools`,commandId:`annotation:overflow-shapes`,variant:`icon`,categories:[`annotation`,`annotation-shape`,`annotation-overflow`]},{type:`divider`,id:`shapes-tools-divider-1`,orientation:`vertical`},{type:`command-button`,id:`toggle-annotation-style`,commandId:`panel:toggle-annotation-style`,variant:`icon`,categories:[`panel`,`panel-annotation-style`]},{type:`divider`,id:`shapes-tools-divider-2`,orientation:`vertical`,visibilityDependsOn:{itemIds:[`toggle-annotation-style`]}},{type:`command-button`,id:`undo-button`,commandId:`history:undo`,variant:`icon`,categories:[`history`,`history-undo`]},{type:`command-button`,id:`redo-button`,commandId:`history:redo`,variant:`icon`,categories:[`history`,`history-redo`]}]},{type:`spacer`,id:`spacer-6`,flex:!0}]},"form-toolbar":{id:`form-toolbar`,position:{placement:`top`,slot:`secondary`,order:0},responsive:{breakpoints:{sm:{maxWidth:640,hide:[`add-form-select`,`add-form-listbox`],show:[`overflow-forms-tools`]},md:{minWidth:640,hide:[`overflow-forms-tools`],show:[`add-form-select`,`add-form-listbox`]}}},permanent:!1,categories:[`form`],items:[{type:`spacer`,id:`spacer-form-1`,flex:!0},{type:`group`,id:`form-tools`,alignment:`start`,gap:2,items:[{type:`command-button`,id:`add-form-textfield`,commandId:`form:add-textfield`,variant:`icon`,categories:[`form`,`form-textfield`]},{type:`command-button`,id:`add-form-checkbox`,commandId:`form:add-checkbox`,variant:`icon`,categories:[`form`,`form-checkbox`]},{type:`command-button`,id:`add-form-radio`,commandId:`form:add-radio`,variant:`icon`,categories:[`form`,`form-radio`]},{type:`command-button`,id:`add-form-select`,commandId:`form:add-select`,variant:`icon`,categories:[`form`,`form-select`]},{type:`command-button`,id:`add-form-listbox`,commandId:`form:add-listbox`,variant:`icon`,categories:[`form`,`form-listbox`]},{type:`command-button`,id:`overflow-forms-tools`,commandId:`form:overflow-tools`,variant:`icon`,categories:[`form`,`form-overflow`]},{type:`divider`,id:`form-tools-divider-1`,orientation:`vertical`},{type:`command-button`,id:`toggle-annotation-style`,commandId:`panel:toggle-annotation-style`,variant:`icon`,categories:[`panel`,`panel-annotation-style`]},{type:`command-button`,id:`toggle-form-fill-mode`,commandId:`form:toggle-fill-mode`,variant:`icon`,categories:[`form`,`form-fill-mode`]},{type:`divider`,id:`form-tools-divider-2`,orientation:`vertical`},{type:`command-button`,id:`undo-button`,commandId:`history:undo`,variant:`icon`,categories:[`history`,`history-undo`]},{type:`command-button`,id:`redo-button`,commandId:`history:redo`,variant:`icon`,categories:[`history`,`history-redo`]}]},{type:`spacer`,id:`spacer-form-2`,flex:!0}]},"insert-toolbar":{id:`insert-toolbar`,position:{placement:`top`,slot:`secondary`,order:0},permanent:!1,categories:[`insert`],items:[{type:`spacer`,id:`spacer-insert-1`,flex:!0},{type:`group`,id:`insert-tools`,alignment:`start`,gap:2,items:[{type:`command-button`,id:`add-rubber-stamp`,commandId:`insert:add-rubber-stamp`,variant:`icon`,categories:[`insert`,`insert-rubber-stamp`]},{type:`command-button`,id:`add-signature`,commandId:`insert:add-signature`,variant:`icon`,categories:[`insert`,`insert-signature`]},{type:`command-button`,id:`add-image`,commandId:`insert:add-image`,variant:`icon`,categories:[`insert`,`insert-image`]},{type:`divider`,id:`insert-tools-divider-1`,orientation:`vertical`},{type:`command-button`,id:`toggle-annotation-style`,commandId:`panel:toggle-annotation-style`,variant:`icon`,categories:[`panel`,`panel-annotation-style`]},{type:`divider`,id:`insert-tools-divider-2`,orientation:`vertical`,visibilityDependsOn:{itemIds:[`toggle-annotation-style`]}},{type:`command-button`,id:`undo-button`,commandId:`history:undo`,variant:`icon`,categories:[`history`,`history-undo`]},{type:`command-button`,id:`redo-button`,commandId:`history:redo`,variant:`icon`,categories:[`history`,`history-redo`]}]},{type:`spacer`,id:`spacer-insert-2`,flex:!0}]},"redaction-toolbar":{id:`redaction-toolbar`,position:{placement:`top`,slot:`secondary`,order:0},permanent:!1,categories:[`redaction`],items:[{type:`spacer`,id:`spacer-7`,flex:!0},{type:`group`,id:`redaction-tools`,alignment:`start`,gap:2,items:[{type:`command-button`,id:`redact`,commandId:`redaction:redact`,variant:`icon`,categories:[`redaction`,`redaction-combined`]},{type:`divider`,id:`redaction-tools-divider-1`,orientation:`vertical`},{type:`command-button`,id:`toggle-redaction-panel`,commandId:`panel:toggle-redaction`,variant:`icon`,categories:[`panel`,`panel-redaction`]},{type:`command-button`,id:`toggle-annotation-style`,commandId:`panel:toggle-annotation-style`,variant:`icon`,categories:[`panel`,`panel-annotation-style`]},{type:`divider`,id:`redaction-tools-divider-2`,orientation:`vertical`,visibilityDependsOn:{itemIds:[`toggle-annotation-style`]}},{type:`command-button`,id:`undo-button`,commandId:`history:undo`,variant:`icon`,categories:[`history`,`history-undo`]},{type:`command-button`,id:`redo-button`,commandId:`history:redo`,variant:`icon`,categories:[`history`,`history-redo`]}]},{type:`spacer`,id:`spacer-8`,flex:!0}]}},menus:{"left-action-menu":{id:`left-action-menu`,categories:[`ui`],items:[{type:`submenu`,id:`page-settings-submenu`,labelKey:`menu.viewControls`,label:`View Controls`,icon:`viewSettings`,menuId:`page-settings-menu`,categories:[`page`]},{type:`submenu`,id:`zoom-submenu`,labelKey:`menu.zoomControls`,label:`Zoom Controls`,icon:`zoomIn`,menuId:`zoom-menu`,categories:[`zoom`]},{type:`divider`,id:`divider-15`},{type:`command`,id:`pan-button-menu`,commandId:`pan:toggle`,categories:[`tools`,`pan`]},{type:`command`,id:`pointer-button-menu`,commandId:`pointer:toggle`,categories:[`tools`,`pointer`]}]},"mode-tabs-overflow-menu":{id:`mode-tabs-overflow-menu`,items:[{type:`command`,id:`mode:view`,commandId:`mode:view`,categories:[`mode`,`mode-view`]},{type:`command`,id:`mode:annotate`,commandId:`mode:annotate`,categories:[`mode`,`mode-annotate`,`annotation`]},{type:`command`,id:`mode:shapes`,commandId:`mode:shapes`,categories:[`mode`,`mode-shapes`,`annotation`,`annotation-shape`]},{type:`command`,id:`mode:insert`,commandId:`mode:insert`,categories:[`mode`,`mode-insert`,`insert`]},{type:`command`,id:`mode:form`,commandId:`mode:form`,categories:[`mode`,`mode-form`,`form`]},{type:`command`,id:`mode:redact`,commandId:`mode:redact`,categories:[`mode`,`mode-redact`,`redaction`]}],responsive:{breakpoints:{xs:{maxWidth:640,show:[`mode:view`,`mode:annotate`,`mode:shapes`,`mode:insert`,`mode:form`,`mode:redact`]},sm:{minWidth:640,maxWidth:768,hide:[`mode:view`,`mode:annotate`]},md:{minWidth:768,hide:[`mode:view`,`mode:annotate`,`mode:shapes`]}},localeOverrides:{groups:[{id:`cjk-languages`,locales:[`zh-CN`,`zh-TW`,`ja`],breakpoints:{sm:{replaceHide:[`mode:view`,`mode:annotate`,`mode:shapes`,`mode:insert`],replaceShow:[`mode:form`,`mode:redact`]},md:{replaceHide:[`mode:view`,`mode:annotate`,`mode:shapes`,`mode:insert`],replaceShow:[`mode:form`,`mode:redact`]}}},{id:`wide-label-languages`,locales:[`de`,`nl`,`pt-BR`],breakpoints:{md:{replaceHide:[`mode:view`,`mode:annotate`]}}}]}}},"zoom-levels-menu":{id:`zoom-levels-menu`,categories:[`zoom`,`zoom-level`],items:[{type:`command`,id:`zoom-levels-menu:25`,commandId:`zoom:25`,categories:[`zoom`,`zoom-level`,`zoom-level-25`]},{type:`command`,id:`zoom-levels-menu:50`,commandId:`zoom:50`,categories:[`zoom`,`zoom-level`,`zoom-level-50`]},{type:`command`,id:`zoom-levels-menu:100`,commandId:`zoom:100`,categories:[`zoom`,`zoom-level`,`zoom-level-100`]},{type:`command`,id:`zoom-levels-menu:125`,commandId:`zoom:125`,categories:[`zoom`,`zoom-level`,`zoom-level-125`]},{type:`command`,id:`zoom-levels-menu:150`,commandId:`zoom:150`,categories:[`zoom`,`zoom-level`,`zoom-level-150`]},{type:`command`,id:`zoom-levels-menu:200`,commandId:`zoom:200`,categories:[`zoom`,`zoom-level`,`zoom-level-200`]},{type:`command`,id:`zoom-levels-menu:400`,commandId:`zoom:400`,categories:[`zoom`,`zoom-level`,`zoom-level-400`]},{type:`command`,id:`zoom-levels-menu:800`,commandId:`zoom:800`,categories:[`zoom`,`zoom-level`,`zoom-level-800`]},{type:`command`,id:`zoom-levels-menu:1600`,commandId:`zoom:1600`,categories:[`zoom`,`zoom-level`,`zoom-level-1600`]}]},"zoom-menu":{id:`zoom-menu`,categories:[`zoom`],items:[{type:`command`,id:`zoom-menu:25`,commandId:`zoom:25`,categories:[`zoom`,`zoom-level`,`zoom-level-25`]},{type:`command`,id:`zoom-menu:50`,commandId:`zoom:50`,categories:[`zoom`,`zoom-level`,`zoom-level-50`]},{type:`command`,id:`zoom-menu:100`,commandId:`zoom:100`,categories:[`zoom`,`zoom-level`,`zoom-level-100`]},{type:`command`,id:`zoom-menu:125`,commandId:`zoom:125`,categories:[`zoom`,`zoom-level`,`zoom-level-125`]},{type:`command`,id:`zoom-menu:150`,commandId:`zoom:150`,categories:[`zoom`,`zoom-level`,`zoom-level-150`]},{type:`command`,id:`zoom-menu:200`,commandId:`zoom:200`,categories:[`zoom`,`zoom-level`,`zoom-level-200`]},{type:`command`,id:`zoom-menu:400`,commandId:`zoom:400`,categories:[`zoom`,`zoom-level`,`zoom-level-400`]},{type:`command`,id:`zoom-menu:800`,commandId:`zoom:800`,categories:[`zoom`,`zoom-level`,`zoom-level-800`]},{type:`command`,id:`zoom-menu:1600`,commandId:`zoom:1600`,categories:[`zoom`,`zoom-level`,`zoom-level-1600`]},{type:`submenu`,id:`zoom-levels-submenu`,labelKey:`zoom.level`,label:`Zoom Levels`,menuId:`zoom-levels-menu`,categories:[`zoom`,`zoom-level`]},{type:`divider`,id:`divider-zoom-in-out`},{type:`command`,id:`zoom-menu:in`,commandId:`zoom:in`,categories:[`zoom`,`zoom-in`]},{type:`command`,id:`zoom-menu:out`,commandId:`zoom:out`,categories:[`zoom`,`zoom-out`]},{type:`divider`,id:`divider-8`},{type:`command`,id:`zoom:fit-page`,commandId:`zoom:fit-page`,categories:[`zoom`,`zoom-fit-page`]},{type:`command`,id:`zoom:fit-width`,commandId:`zoom:fit-width`,categories:[`zoom`,`zoom-fit-width`]},{type:`divider`,id:`divider-9`},{type:`command`,id:`zoom:marquee`,commandId:`zoom:marquee`,categories:[`zoom`,`zoom-marquee`]}],responsive:{breakpoints:{xs:{maxWidth:640,show:[`zoom-levels-submenu`,`divider-zoom-in-out`],hide:[`zoom-menu:25`,`zoom-menu:50`,`zoom-menu:100`,`zoom-menu:125`,`zoom-menu:150`,`zoom-menu:200`,`zoom-menu:400`,`zoom-menu:800`,`zoom-menu:1600`]},md:{minWidth:768,show:[`zoom-menu:25`,`zoom-menu:50`,`zoom-menu:100`,`zoom-menu:125`,`zoom-menu:150`,`zoom-menu:200`,`zoom-menu:400`,`zoom-menu:800`,`zoom-menu:1600`],hide:[`zoom-levels-submenu`,`divider-zoom-in-out`,`zoom-menu:in`,`zoom-menu:out`]}}}},"document-menu":{id:`document-menu`,categories:[`document`],items:[{type:`command`,id:`document:open`,commandId:`document:open`,categories:[`document`,`document-open`]},{type:`command`,id:`document:close`,commandId:`document:close`,categories:[`document`,`document-close`]},{type:`divider`,id:`divider-10`,visibilityDependsOn:{itemIds:[`document:open`,`document:close`]}},{type:`command`,id:`document:print`,commandId:`document:print`,categories:[`document`,`document-print`]},{type:`command`,id:`document:protect`,commandId:`document:protect`,categories:[`document`,`document-protect`,`security`]},{type:`command`,id:`document:capture`,commandId:`document:capture`,categories:[`document`,`document-capture`]},{type:`command`,id:`document:export`,commandId:`document:export`,categories:[`document`,`document-export`]},{type:`divider`,id:`divider-11`,visibilityDependsOn:{itemIds:[`document:export`,`document:print`,`document:capture`,`document:protect`]}},{type:`command`,id:`document:fullscreen`,commandId:`document:fullscreen`,categories:[`document`,`document-fullscreen`]}]},"annotation-tools-menu":{id:`annotation-tools-menu`,categories:[`annotation`],items:[{type:`command`,id:`annotation:add-ink`,commandId:`annotation:add-ink`,categories:[`annotation`,`annotation-ink`]},{type:`command`,id:`annotation:add-ink-highlighter`,commandId:`annotation:add-ink-highlighter`,categories:[`annotation`,`annotation-ink`]},{type:`command`,id:`annotation:add-text`,commandId:`annotation:add-text`,categories:[`annotation`,`annotation-text`]},{type:`command`,id:`annotation:add-insert-text`,commandId:`annotation:add-insert-text`,categories:[`annotation`,`annotation-markup`,`annotation-insert-text`]},{type:`command`,id:`annotation:add-replace-text`,commandId:`annotation:add-replace-text`,categories:[`annotation`,`annotation-markup`,`annotation-replace-text`]},{type:`command`,id:`annotation:add-comment`,commandId:`annotation:add-comment`,categories:[`annotation`,`annotation-comment-tool`]},{type:`command`,id:`annotation:add-callout`,commandId:`annotation:add-callout`,categories:[`annotation`,`annotation-text`]}]},"shapes-tools-menu":{id:`shapes-tools-menu`,categories:[`annotation`,`annotation-shape`],items:[{type:`command`,id:`annotation:add-polygon`,commandId:`annotation:add-polygon`,categories:[`annotation`,`annotation-shape`,`annotation-polygon`]},{type:`command`,id:`annotation:add-polyline`,commandId:`annotation:add-polyline`,categories:[`annotation`,`annotation-shape`,`annotation-polyline`]}]},"form-tools-menu":{id:`form-tools-menu`,categories:[`form`],items:[{type:`command`,id:`form:add-select`,commandId:`form:add-select`,categories:[`form`,`form-select`]},{type:`command`,id:`form:add-listbox`,commandId:`form:add-listbox`,categories:[`form`,`form-listbox`]}]},"page-settings-menu":{id:`page-settings-menu`,categories:[`page`],items:[{type:`section`,id:`spread-mode-section`,labelKey:`page.spreadMode`,label:`Spread Mode`,categories:[`page`,`spread`],items:[{type:`command`,id:`spread:none`,commandId:`spread:none`,categories:[`page`,`spread`,`spread-none`]},{type:`command`,id:`spread:odd`,commandId:`spread:odd`,categories:[`page`,`spread`,`spread-odd`]},{type:`command`,id:`spread:even`,commandId:`spread:even`,categories:[`page`,`spread`,`spread-even`]}]},{type:`divider`,id:`divider-13`},{type:`section`,id:`scroll-layout-section`,labelKey:`page.scrollLayout`,label:`Scroll Layout`,categories:[`page`,`scroll`],items:[{type:`command`,id:`scroll:vertical`,commandId:`scroll:vertical`,categories:[`page`,`scroll`,`scroll-vertical`]},{type:`command`,id:`scroll:horizontal`,commandId:`scroll:horizontal`,categories:[`page`,`scroll`,`scroll-horizontal`]}]},{type:`divider`,id:`divider-14`},{type:`section`,id:`page-rotation-section`,labelKey:`page.rotation`,label:`Page Rotation`,categories:[`page`,`rotate`],items:[{type:`command`,id:`rotate:clockwise`,commandId:`rotate:clockwise`,categories:[`page`,`rotate`,`rotate-clockwise`]},{type:`command`,id:`rotate:counter-clockwise`,commandId:`rotate:counter-clockwise`,categories:[`page`,`rotate`,`rotate-counter-clockwise`]}]},{type:`divider`,id:`divider-15`},{type:`command`,id:`document:fullscreen`,commandId:`document:fullscreen`,categories:[`document`,`document-fullscreen`]}]}},sidebars:{"sidebar-panel":{id:`sidebar-panel`,position:{placement:`left`,slot:`main`,order:0},content:{type:`tabs`,tabs:[{id:`thumbnails`,labelKey:`panel.thumbnails`,label:`Thumbnails`,icon:`squares`,componentId:`thumbnails-sidebar`},{id:`outline`,labelKey:`panel.outline`,label:`Outline`,icon:`listTree`,componentId:`outline-sidebar`}]},width:`250px`,collapsible:!0,defaultOpen:!1},"annotation-panel":{id:`annotation-panel`,position:{placement:`left`,slot:`main`,order:0},content:{type:`component`,componentId:`annotation-sidebar`},width:`250px`,collapsible:!0,defaultOpen:!1},"rubber-stamp-panel":{id:`rubber-stamp-panel`,position:{placement:`left`,slot:`main`,order:0},content:{type:`component`,componentId:`rubber-stamp-sidebar`},width:`250px`,collapsible:!0,defaultOpen:!1,categories:[`insert`,`insert-rubber-stamp`]},"signature-panel":{id:`signature-panel`,position:{placement:`left`,slot:`main`,order:0},content:{type:`component`,componentId:`signature-sidebar`},width:`250px`,collapsible:!0,defaultOpen:!1,categories:[`insert`,`insert-signature`]},"search-panel":{id:`search-panel`,position:{placement:`right`,slot:`main`,order:0},content:{type:`component`,componentId:`search-sidebar`},width:`250px`,collapsible:!0,defaultOpen:!1},"widget-edit-panel":{id:`widget-edit-panel`,position:{placement:`right`,slot:`main`,order:0},content:{type:`component`,componentId:`widget-edit-sidebar`},width:`250px`,collapsible:!0,defaultOpen:!1},"comment-panel":{id:`comment-panel`,position:{placement:`right`,slot:`main`,order:0},content:{type:`component`,componentId:`comment-sidebar`},width:`250px`,collapsible:!0,defaultOpen:!1},"redaction-panel":{id:`redaction-panel`,position:{placement:`right`,slot:`main`,order:0},content:{type:`component`,componentId:`redaction-sidebar`},width:`250px`,collapsible:!0,defaultOpen:!1,categories:[`redaction`]}},modals:{"print-modal":{id:`print-modal`,content:{type:`component`,componentId:`print-modal`},maxWidth:`28rem`,closeOnClickOutside:!0,closeOnEscape:!0},"protect-modal":{id:`protect-modal`,content:{type:`component`,componentId:`protect-modal`},maxWidth:`28rem`,closeOnClickOutside:!0,closeOnEscape:!0},"view-permissions-modal":{id:`view-permissions-modal`,content:{type:`component`,componentId:`view-permissions-modal`},maxWidth:`28rem`,closeOnClickOutside:!0,closeOnEscape:!0},"link-modal":{id:`link-modal`,content:{type:`component`,componentId:`link-modal`},maxWidth:`28rem`,closeOnClickOutside:!0,closeOnEscape:!0},"signature-create-modal":{id:`signature-create-modal`,content:{type:`component`,componentId:`signature-create-modal`},maxWidth:`32rem`,closeOnClickOutside:!1,closeOnEscape:!0,categories:[`insert`,`insert-signature`]}},overlays:{"page-controls":{id:`page-controls`,position:{anchor:`bottom-center`,offset:{bottom:`1.5rem`}},content:{type:`component`,componentId:`page-controls`},defaultEnabled:!0},"unlock-owner-overlay":{id:`unlock-owner-overlay`,position:{anchor:`bottom-right`,offset:{bottom:`1.5rem`,right:`1.5rem`}},content:{type:`component`,componentId:`unlock-owner-overlay`},categories:[`security`,`security-unlock-overlay`],defaultEnabled:!0}},selectionMenus:{annotation:{id:`annotation`,categories:[`annotation`],items:[{type:`command-button`,id:`comment-button`,commandId:`annotation:toggle-comment`,variant:`icon`,categories:[`annotation`,`annotation-comment`]},{type:`command-button`,id:`toggle-link`,commandId:`annotation:toggle-link`,variant:`icon`,categories:[`annotation`,`annotation-link`]},{type:`command-button`,id:`toggle-annotation-widget-edit`,commandId:`annotation:toggle-widget-edit`,variant:`icon`,categories:[`annotation`,`annotation-widget-edit`]},{type:`command-button`,id:`toggle-annotation-style`,commandId:`annotation:toggle-annotation-style`,variant:`icon`,categories:[`annotation`,`annotation-style`]},{type:`command-button`,id:`apply-redaction`,commandId:`annotation:apply-redaction`,variant:`icon`,categories:[`annotation`,`annotation-redaction`]},{type:`command-button`,id:`create-stamp-from-annotation`,commandId:`stamp:create-from-selected`,variant:`icon`,categories:[`annotation`,`stamp`]},{type:`command-button`,id:`delete-annotation`,commandId:`annotation:delete-selected`,variant:`icon`,categories:[`annotation`,`annotation-delete`]},{type:`command-button`,id:`goto-link`,commandId:`annotation:goto-link`,variant:`icon-text`,categories:[`annotation`,`annotation-link`]}]},groupAnnotation:{id:`groupAnnotation`,categories:[`annotation`,`annotation-group`],items:[{type:`command-button`,id:`comment-button`,commandId:`annotation:toggle-comment`,variant:`icon`,categories:[`annotation`,`annotation-comment`]},{type:`command-button`,id:`toggle-group-annotations`,commandId:`annotation:toggle-group`,variant:`icon`,categories:[`annotation`,`annotation-group`]},{type:`command-button`,id:`toggle-annotation-style`,commandId:`panel:toggle-annotation-style`,variant:`icon`,categories:[`panel`,`panel-annotation-style`]},{type:`command-button`,id:`create-stamp-from-group`,commandId:`stamp:create-from-group`,variant:`icon`,categories:[`annotation`,`stamp`,`annotation-group`]},{type:`command-button`,id:`delete-all-annotations`,commandId:`annotation:delete-all-selected`,variant:`icon`,categories:[`annotation`,`annotation-delete`,`annotation-group`]}]},redaction:{id:`redaction`,categories:[`redaction`],items:[{type:`command-button`,id:`delete-redaction`,commandId:`redaction:delete-selected`,variant:`icon`,categories:[`redaction`,`redaction-delete`]},{type:`command-button`,id:`commit-redaction`,commandId:`redaction:commit-selected`,variant:`icon`,categories:[`redaction`,`redaction-commit`]}]},selection:{id:`selection`,visibilityDependsOn:{itemIds:[`copy-selection`,`add-highlight`,`add-strikeout`,`add-underline`,`add-squiggly`,`add-link`,`redact-text`]},items:[{type:`command-button`,id:`copy-selection`,commandId:`selection:copy`,variant:`icon`,categories:[`selection`,`selection-copy`]},{type:`command-button`,id:`add-highlight`,commandId:`annotation:add-highlight`,variant:`icon`,categories:[`annotation`,`annotation-markup`,`annotation-highlight`]},{type:`command-button`,id:`add-strikeout`,commandId:`annotation:add-strikeout`,variant:`icon`,categories:[`annotation`,`annotation-markup`,`annotation-strikeout`]},{type:`command-button`,id:`add-underline`,commandId:`annotation:add-underline`,variant:`icon`,categories:[`annotation`,`annotation-markup`,`annotation-underline`]},{type:`command-button`,id:`add-squiggly`,commandId:`annotation:add-squiggly`,variant:`icon`,categories:[`annotation`,`annotation-markup`,`annotation-squiggly`]},{type:`command-button`,id:`add-link`,commandId:`annotation:add-link`,variant:`icon`,categories:[`annotation`,`annotation-link`]},{type:`command-button`,id:`redact-text`,commandId:`redaction:redact-text`,variant:`icon`,categories:[`redaction`,`redaction-text`]}]}}}},viewport:{viewportGap:10},scroll:{defaultStrategy:Mi.Vertical},zoom:{defaultZoomLevel:ss.FitPage},spread:{defaultSpreadMode:Yi.None},rotation:{defaultRotation:ut.Degree0},pan:{},render:{defaultImageType:`image/png`},tiling:{tileSize:768,overlapPx:2.5,extraRings:0},thumbnails:{width:150,gap:10,buffer:3,labelHeight:30},annotations:{locked:{type:yu.Include,categories:[`form`]}},search:{},selection:{},bookmarks:{},attachments:{},capture:{scale:2,imageType:`image/png`},redaction:{drawBlackBoxes:!0,useAnnotationMode:!0},print:{},export:{defaultFileName:`document.pdf`},fullscreen:{},stamp:{},signature:{mode:w_.SignatureAndInitials},history:{},interactionManager:{},form:{}};function IC(e){var t=e.documentId,n=e.tabBarVisibility,r=n===void 0?`multiple`:n,i=function(e){let t=ko(),{provides:n}=go(),r=n?.getSchema(),i=_o(e);return{renderToolbar:(a,o)=>{let s=`${a}-${o}`;if(!r||!n||!i)return null;let c=i.activeToolbars[s],l=c?r.toolbars[c.toolbarId]:null;c&&!l&&console.warn(`Toolbar "${c.toolbarId}" not found in schema`);let u=l&&!l.permanent?()=>n.forDocument(e).closeToolbarSlot(a,o):void 0,d=t.toolbar;return I(A,{children:c&&l&&I(d,{schema:l,documentId:e,isOpen:c.isOpen,onClose:u})},`toolbar-slot-${s}`)},renderSidebar:(a,o)=>{let s=`${a}-${o}`;if(!r||!n||!i)return null;let c=i.activeSidebars[s],l=c?r.sidebars?.[c.sidebarId]:null;c&&!l&&console.warn(`Sidebar "${c.sidebarId}" not found in schema`);let u=t.sidebar;return I(A,{children:c&&l&&I(u,{schema:l,documentId:e,isOpen:c.isOpen,onClose:()=>{n.forDocument(e).closeSidebarSlot(a,o)},sidebarProps:c.props})},`sidebar-slot-${s}`)},renderModal:()=>{if(!r||!n||!i)return null;let a=t.modal;if(!a)return null;let o=i.activeModal,s=o?r.modals?.[o.modalId]:null;return o&&!s&&console.warn(`Modal "${o.modalId}" not found in schema`),I(A,{children:o&&s&&I(a,{schema:s,documentId:e,isOpen:o.isOpen,onClose:()=>{n.forDocument(e).closeModal()},onExited:()=>{n.forDocument(e).clearModal()},modalProps:o.props})},`modal-slot`)},getActiveToolbars:()=>i?Object.entries(i.activeToolbars).map(([e,t])=>{let[n,r]=e.split(`-`);return{placement:n,slot:r,toolbarId:t.toolbarId,isOpen:t.isOpen}}):[],getActiveSidebars:()=>i?Object.entries(i.activeSidebars).map(([e,t])=>{let[n,r]=e.split(`-`);return{placement:n,slot:r,sidebarId:t.sidebarId,isOpen:t.isOpen}}):[],renderOverlays:()=>{if(!r||!n||!i)return null;let a=t.overlay;return a?I(A,{children:(r.overlays?Object.values(r.overlays):[]).filter(e=>!1!==i.enabledOverlays[e.id]).map(t=>I(a,{schema:t,documentId:e},t.id))},`overlays-slot`):null}}}(t),a=i.renderToolbar,o=i.renderSidebar,s=i.renderModal,c=i.renderOverlays,l=os(t).translate,u=Ao(`selection`,t),d=Ao(`annotation`,t),f=Ao(`groupAnnotation`,t),p=Ao(`redaction`,t);return k(A,null,k(TC,{documentStates:(e=>{let t=ti();return P(()=>t?t.documentOrder.map(e=>t.documents[e]).filter(e=>e!=null):[],[t,e])})(),activeDocumentId:(()=>{let e=ti();return P(()=>{if(!e)return{activeDocumentId:null,activeDocument:null};let t=e.activeDocumentId;return{activeDocumentId:t,activeDocument:t?e.documents[t]??null:null}},[e])})().activeDocumentId,visibility:r}),a(`top`,`main`),a(`top`,`secondary`),k(`div`,{id:`document-content`,className:`bg-bg-surface flex flex-1 overflow-hidden`},o(`left`,`main`),k(`div`,{className:`flex-1 overflow-hidden`},k(Lo,{documentId:t},function(e){var n=e.documentState,r=e.isLoading,i=e.isError,a=e.isLoaded;return k(A,null,r&&k(`div`,{className:`flex h-full items-center justify-center`},k(kx,{size:`lg`,text:l(`document.loading`)})),i&&k(DC,{documentState:n}),a&&k(`div`,{className:`relative h-full w-full`},k(Rp,{documentId:t},k(ji,{className:`bg-bg-app`,documentId:t},k(Cs,{documentId:t},k(Ji,{documentId:t,renderPage:function(e){var n=e.pageIndex;return k(zs,{documentId:t,pageIndex:n,style:{backgroundColor:`#fff`}},k(zp,{documentId:t,pageIndex:n},k(ks,{documentId:t,pageIndex:n,scale:.5,style:{pointerEvents:`none`}}),k(El,{documentId:t,pageIndex:n,style:{pointerEvents:`none`}}),k(sc,{documentId:t,pageIndex:n}),k(ws,{documentId:t,pageIndex:n}),k(gh,{documentId:t,pageIndex:n}),k(ll,{documentId:t,pageIndex:n,selectionMenu:u}),k(cg,{documentId:t,pageIndex:n,selectionMenu:p}),k(Dm,{documentId:t,pageIndex:n,selectionMenu:d,groupSelectionMenu:f})))}})))),c()))})),o(`right`,`main`)),s())}var LC=new Vt([new Rt,new Bt]);function RC(e){var t,r,i=e.config,a=e.onRegistryReady,s=function(e){let{wasmUrl:t=ci,worker:r=!0,logger:i,encoderPoolSize:a,fontFallback:o}=e??{},[s,c]=j(null),[l,u]=j(!0),[d,f]=j(null),p=N(null);return M(()=>{let e=!1;return(async()=>{try{let{createPdfiumEngine:e}=r?await n(()=>import(`./worker-engine-m0rlHn8R-S8mpn_O0.js`),__vite__mapDeps([0,1]),import.meta.url):await n(()=>import(`./direct-engine-DdrQKpgq-CtKfQzCt.js`),__vite__mapDeps([2,1]),import.meta.url),s=await e(t,{logger:i,encoderPoolSize:a,fontFallback:o});p.current=s,c(s),u(!1)}catch(t){e||(f(t),u(!1))}})(),()=>{var t,n;e=!0,(n=(t=p.current)?.closeAllDocuments)==null||n.call(t).wait(()=>{var e,t;(t=(e=p.current)?.destroy)==null||t.call(e),p.current=null},nr)}},[t,r,i,o]),{engine:s,isLoading:l,error:d}}(g(g(g({},i.wasmUrl&&{wasmUrl:i.wasmUrl}),i.fontFallback!==void 0&&{fontFallback:i.fontFallback}),{},{worker:i.worker,logger:i.log?LC:void 0})),c=s.engine,l=s.isLoading,u=P(function(){return{"thumbnails-sidebar":Cx,"annotation-sidebar":PS,"rubber-stamp-sidebar":qS,"signature-sidebar":JS,"zoom-toolbar":Jx,"search-sidebar":Dx,"outline-sidebar":Ox,"comment-sidebar":qx,"widget-edit-sidebar":VS,"print-modal":pC,"link-modal":mC,"signature-create-modal":sC,"protect-modal":MC,"unlock-owner-overlay":NC,"page-controls":hC,"mode-select-button":OC,"view-permissions-modal":PC,"redaction-sidebar":LS}},[]),d=P(function(){return{toolbar:nx,sidebar:fx,modal:Sx,overlay:fC,menu:hx,selectionMenu:lC}},[]),f=(t=i.fonts?.ui)===null?{family:iC,stylesheetUrl:null}:t===void 0?{family:iC,stylesheetUrl:`https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap`}:{family:t.family??iC,stylesheetUrl:t.stylesheetUrl??null},p=P(function(){return{"--ep-font-family":f.family}},[f.family]);return M(function(){f.stylesheetUrl&&rC(`ui`,f.stylesheetUrl,[f.family])},[f.family,f.stylesheetUrl]),k(`div`,{className:`embedpdf-snippet-root`,style:p},k(`style`,null,ct),!c||l?k(`div`,{className:`flex h-full w-full items-center justify-center`},k(kx,{size:`lg`,text:`Initializing PDF engine...`})):k(Qr,{config:{logger:i.log?LC:void 0,permissions:i.permissions},onInitialized:(r=o(v().m(function e(t){return v().w(function(e){for(;;)switch(e.n){case 0:a&&t&&a(t);case 1:return e.a(2)}},e)})),function(e){return r.apply(this,arguments)}),engine:c,plugins:[Ir(zo,g(g(g({},FC.documentManager),i.src&&{initialDocuments:[{url:i.src}]}),i.documentManager)),Ir(Yo,g(g(g({},FC.commands),i.disabledCategories&&{disabledCategories:i.disabledCategories}),i.commands)),Ir(as,g(g({},FC.i18n),i.i18n)),Ir(ho,g(g(g({},FC.ui),i.disabledCategories&&{disabledCategories:i.disabledCategories}),i.ui)),Ir(Di,g(g({},FC.viewport),i.viewport)),Ir(Gi,g(g({},FC.scroll),i.scroll)),Ir(ys,g(g({},FC.zoom),i.zoom)),Ir(oa,g(g({},FC.spread),i.spread)),Ir(Rs,g(g({},FC.rotation),i.rotation)),Ir(ih,g(g({},FC.pan),i.pan)),Ir(Os,g(g({},FC.render),i.render)),Ir(Cl,g(g({},FC.tiling),i.tiling)),Ir(Rl,g(g({},FC.thumbnails),i.thumbnails)),Ir(Om,g(g({},FC.annotations),i.annotations)),Ir(ac,g(g({},FC.search),i.search)),Ir(ul,g(g({},FC.selection),i.selection)),Ir(qm,g(g({},FC.bookmarks),i.bookmarks)),Ir(pg,g(g({},FC.attachments),i.attachments)),Ir(mh,g(g({},FC.capture),i.capture)),Ir(lg,g(g({},FC.redaction),i.redaction)),Ir(Pm,g(g({},FC.print),i.print)),Ir(Zm,g(g({},FC.export),i.export)),Ir(Hm,g(g({},FC.fullscreen),i.fullscreen)),Ir(Eh,g(g({},FC.history),i.history)),Ir(jp,g(g({},FC.interactionManager),i.interactionManager)),Ir(s_,g(g({},FC.form),i.form)),Ir(C_,g(g({},FC.stamp),i.stamp)),Ir(Q_,g(g({},FC.signature),i.signature))]},function(e){var t=e.pluginsReady,n=e.activeDocumentId;return k(A,null,t?k(A,null,n?k(ZS,{config:i},k(No,{documentId:n,components:u,renderers:d,className:`relative flex h-full w-full select-none flex-col`},k(IC,{documentId:n,tabBarVisibility:i.tabBar}),k(kC,{documentId:n}),k(Mx,{documentId:n}))):k(EC,null)):k(`div`,{className:`flex h-full items-center justify-center`},k(kx,{size:`lg`,text:`Initializing plugins...`})))}))}var zC=typeof HTMLElement<`u`?HTMLElement:l(function e(){c(this,e)}),BC=function(){function e(){var t;return c(this,e),d(t=s(this,e),`_resolveRegistry`,null),d(t,`themeStyleEl`,null),d(t,`systemPreferenceCleanup`,null),d(t,`handleRegistryReady`,function(e){t._resolveRegistry&&(t._resolveRegistry(e),t._resolveRegistry=null)}),t.root=t.attachShadow({mode:`open`}),t._registryPromise=new Promise(function(e){t._resolveRegistry=e}),t}return p(e,zC),l(e,[{key:`connectedCallback`,value:function(){this._config||={src:this.getAttribute(`src`)||`/demo.pdf`,worker:this.getAttribute(`worker`)!==`false`,theme:this.parseThemeAttribute()},this.setupTheme(),this.renderViewer()}},{key:`disconnectedCallback`,value:function(){var e;(e=this.systemPreferenceCleanup)==null||e.call(this),this.systemPreferenceCleanup=null,Ie(null,this.root)}},{key:`parseThemeAttribute`,value:function(){var e=this.getAttribute(`theme`);if(e)return[`light`,`dark`,`system`].includes(e)?{preference:e}:void 0}},{key:`config`,get:function(){return this._config},set:function(e){this._config=e,e.icons&&Ty(e.icons),this.isConnected&&(this.setupTheme(),this.renderViewer())}},{key:`registry`,get:function(){return this._registryPromise}},{key:`themePreference`,get:function(){var e;return((e=this._config)==null||(e=e.theme)==null?void 0:e.preference)||`system`}},{key:`activeColorScheme`,get:function(){return SC(this.themePreference)}},{key:`activeTheme`,get:function(){return this.resolveActiveTheme()}},{key:`resolveActiveTheme`,value:function(){var e,t,n=this._config?.theme,r=SC(n?.preference||`system`),i=r===`dark`?yC:vC,a=n?.[r];return t=i,(e=a)?xC(t,e):t}},{key:`setupTheme`,value:function(){var e,t,n=this;(e=this.systemPreferenceCleanup)==null||e.call(this),this.systemPreferenceCleanup=null,(((t=this._config)==null||(t=t.theme)==null?void 0:t.preference)||`system`)===`system`&&(this.systemPreferenceCleanup=function(e){if(typeof window>`u`)return function(){};var t=window.matchMedia(`(prefers-color-scheme: dark)`),n=function(t){return e(t.matches?`dark`:`light`)};return t.addEventListener(`change`,n),function(){return t.removeEventListener(`change`,n)}}(function(e){n.injectTheme(),n.dispatchEvent(new CustomEvent(`themechange`,{detail:{preference:`system`,colorScheme:e,theme:n.activeTheme},bubbles:!0}))})),this.injectTheme()}},{key:`injectTheme`,value:function(){var e=wC(this.resolveActiveTheme()),t=this.root.querySelector(`style[data-embedpdf-theme]`);t||((t=document.createElement(`style`)).setAttribute(`data-embedpdf-theme`,``),this.root.appendChild(t)),this.themeStyleEl=t,this.themeStyleEl.textContent=e,this.setAttribute(`data-color-scheme`,this.activeColorScheme)}},{key:`setTheme`,value:function(e){this._config&&(this._config.theme=typeof e==`string`?g(g({},this._config.theme),{},{preference:e}):g(g({},this._config.theme),e),this.setupTheme(),this.dispatchEvent(new CustomEvent(`themechange`,{detail:{preference:this.themePreference,colorScheme:this.activeColorScheme,theme:this.activeTheme},bubbles:!0})))}},{key:`registerIcon`,value:function(e,t){wy(e,t)}},{key:`registerIcons`,value:function(e){Ty(e)}},{key:`renderViewer`,value:function(){this._config&&(Ie(k(RC,{config:this._config,onRegistryReady:this.handleRegistryReady}),this.root),this.injectTheme())}}])}(),VC=[`type`,`target`],HC=`2.15.0`;typeof customElements>`u`||customElements.get(`embedpdf-container`)||customElements.define(`embedpdf-container`,BC);var UC={version:HC,init:function(e){if(e.type===`container`)return function(e){e.type,e.target;var t=_(e,VC),n=document.createElement(`embedpdf-container`);return n.config=t,e.target.appendChild(n),n}(e)}};export{_t as $,H as A,Ch as At,V as B,$t as C,Ft as Ct,en as D,ph as Dt,qt as E,B as Et,Xt as F,Ei as Ft,an as G,ut as H,nn as I,An as It,ln as J,UC as K,z_ as L,Dn as Lt,yC as M,kn as Mt,Ag as N,Es as Nt,wy as O,yn as Ot,Is as P,Dh as Pt,dn as Q,HC as R,zm as Rt,G_ as S,W as St,Mi as T,pt as Tt,Qn as U,K_ as V,Ym as W,na as X,rs as Y,rc as Z,L as _,wn as _t,rn as a,On as at,tr as b,gn as bt,Yt as c,Tn as ct,Xh as d,vs as dt,nh as et,Yi as f,Tt as ft,Af as g,bn as gt,vC as h,Op as ht,Mm as i,vn as it,Ll as j,En as jt,Jt as k,ss as kt,$n as l,Lt as lt,on as m,tn as mt,Gc as n,Ui as nt,Fo as o,xn as ot,K as p,Km as pt,gt as q,z as r,dg as rt,Ty as s,Sl as st,Go as t,un as tt,sn as u,G as ut,w_ as v,so as vt,xC as w,BC as wt,cn as x,yu as xt,fn as y,hn as yt,nr as z,R as zt};