@vue-pdf-viewer/viewer 4.0.0-beta.6 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/dist/{VPdfViewer.vue_vue_type_style_index_1_scoped_b89b6109_lang-B20_cSR3.js → VPdfViewer.vue_vue_type_style_index_1_scoped_b89b6109_lang-BJgLZwdF.js} +2152 -1960
  2. package/dist/VPdfViewer.vue_vue_type_style_index_1_scoped_b89b6109_lang-CxqvCVel.cjs +48 -0
  3. package/dist/{annotation-circle-0ubo5rf1.js → annotation-circle-COOiYsJg.js} +3 -3
  4. package/dist/{annotation-circle-D0tRo-6n.cjs → annotation-circle-DXiFCzpK.cjs} +1 -1
  5. package/dist/{annotation-font-weSbdjgD.js → annotation-font-Dz5-utxy.js} +3 -3
  6. package/dist/annotation-font-aIPqLFLe.cjs +1 -0
  7. package/dist/annotation-font-style-italic-Boz1BB0L.cjs +1 -0
  8. package/dist/{annotation-font-style-italic-DcGlIJ1a.js → annotation-font-style-italic-DrQU7N-a.js} +3 -3
  9. package/dist/{annotation-font-style-underline-BTkTZ_Is.js → annotation-font-style-underline-D7zPcuK6.js} +3 -3
  10. package/dist/annotation-font-style-underline-IDY4E2RK.cjs +1 -0
  11. package/dist/{annotation-font-weight-bold-xwBIbXyc.js → annotation-font-weight-bold-Ba2Ix8G4.js} +3 -3
  12. package/dist/annotation-font-weight-bold-CaItGpNu.cjs +1 -0
  13. package/dist/annotation-freetext-B7OQWCHy.cjs +1 -0
  14. package/dist/{annotation-freetext-CQ_RRlBQ.js → annotation-freetext-dvsFpAZu.js} +3 -3
  15. package/dist/annotation-highlight-C54z0iJp.cjs +1 -0
  16. package/dist/{annotation-highlight-ChCnie-U.js → annotation-highlight-DfO5AU26.js} +3 -3
  17. package/dist/annotation-ink-BXiSIamz.cjs +1 -0
  18. package/dist/{annotation-ink-AUjv0MoR.js → annotation-ink-Dq1T0COO.js} +3 -3
  19. package/dist/annotation-line-B8zjgl8Y.cjs +1 -0
  20. package/dist/{annotation-line-DNXr-JOS.js → annotation-line-mbXXKVam.js} +3 -3
  21. package/dist/{annotation-link-D-YgulsY.js → annotation-link-DHPTdWez.js} +3 -3
  22. package/dist/annotation-link-DprZbPvt.cjs +1 -0
  23. package/dist/{annotation-signature-Bkex5Nk1.js → annotation-signature-4ci2KImE.js} +3 -3
  24. package/dist/annotation-signature-Dmb-UCCB.cjs +1 -0
  25. package/dist/annotation-square-DTlpXXm8.cjs +1 -0
  26. package/dist/{annotation-square-BfIB5mW3.js → annotation-square-SQ7oqcEq.js} +3 -3
  27. package/dist/{annotation-squiggly-DeBMymIe.js → annotation-squiggly-B7fWFNAK.js} +3 -3
  28. package/dist/annotation-squiggly-D2Zj3PAI.cjs +1 -0
  29. package/dist/{annotation-stamp-DWiWsYdA.js → annotation-stamp-BkEskP5J.js} +3 -3
  30. package/dist/annotation-stamp-CXhm8tlI.cjs +1 -0
  31. package/dist/annotation-strikeout-4L6FjF5j.cjs +1 -0
  32. package/dist/{annotation-strikeout-CWDrP0rU.js → annotation-strikeout-C-bSOcHc.js} +3 -3
  33. package/dist/annotation-text-BMZsnbuQ.cjs +1 -0
  34. package/dist/{annotation-text-DeYYDSKn.js → annotation-text-BgsMjKeI.js} +3 -3
  35. package/dist/{annotation-underline-CgwFacyd.js → annotation-underline-Be5qs13j.js} +3 -3
  36. package/dist/annotation-underline-DVr5iTHa.cjs +1 -0
  37. package/dist/arrow-up-DqAIlEVn.cjs +1 -0
  38. package/dist/{arrow-up-BiwEJddu.js → arrow-up-vWNs2knA.js} +3 -3
  39. package/dist/{check-dvYcg6X_.js → check-BkaH7nrH.js} +3 -3
  40. package/dist/{check-ChtfkoV3.cjs → check-DpUhVfvc.cjs} +1 -1
  41. package/dist/{chevron-down-CVDp3iv9.js → chevron-down-BSFTOkiu.js} +3 -3
  42. package/dist/chevron-down-iGi3yGWG.cjs +1 -0
  43. package/dist/clear-ByQpYSqe.cjs +1 -0
  44. package/dist/{clear-D0d0aXhI.js → clear-CasZmBPr.js} +3 -3
  45. package/dist/{close-IpbbaszX.js → close-BgsD04zx.js} +3 -3
  46. package/dist/close-Dr41cTAP.cjs +1 -0
  47. package/dist/{comment-panel-D6A8yNfw.js → comment-panel-B-sIKcBp.js} +3 -3
  48. package/dist/comment-panel-NRFPmX0c.cjs +1 -0
  49. package/dist/{download-CMOMvnwF.js → download-DCHGUHXx.js} +3 -3
  50. package/dist/download-Dafu8lxL.cjs +1 -0
  51. package/dist/drag-icon-BRd1NN6-.cjs +1 -0
  52. package/dist/{drag-icon-3GRPy1Gk.js → drag-icon-D-z1P6O_.js} +3 -3
  53. package/dist/{drag-icon-dark-DXLtAf-Z.js → drag-icon-dark-DXDxQjnW.js} +3 -3
  54. package/dist/drag-icon-dark-tWAKp0gy.cjs +1 -0
  55. package/dist/ellipsis-vertical-BKdGikQh.cjs +1 -0
  56. package/dist/{ellipsis-vertical-BdPl_QKK.js → ellipsis-vertical-Cjbi7utY.js} +3 -3
  57. package/dist/empty-comment-dark-CC208JB4.cjs +1 -0
  58. package/dist/{empty-comment-dark-BCCY0a2L.js → empty-comment-dark-CrZRt0Hl.js} +3 -3
  59. package/dist/{empty-comment-light-B4FDCCnF.js → empty-comment-light-BVPUX2pA.js} +3 -3
  60. package/dist/empty-comment-light-t7egnBTJ.cjs +1 -0
  61. package/dist/file-63yRbTDx.cjs +1 -0
  62. package/dist/{file-HYz_W_Bn.js → file-BD05gONj.js} +3 -3
  63. package/dist/first-page-DCveWUis.cjs +1 -0
  64. package/dist/{first-page-DF2-f8F5.js → first-page-DihCXIQm.js} +3 -3
  65. package/dist/fullscreen-BFg9gcCO.cjs +1 -0
  66. package/dist/{fullscreen-DxRYZ3Qt.js → fullscreen-BmHQQPIs.js} +3 -3
  67. package/dist/{hand-CgNhcMPW.js → hand-B1v6mSWQ.js} +3 -3
  68. package/dist/hand-D0-0e0oJ.cjs +1 -0
  69. package/dist/{index-KKFBjC3r.js → index-BKMqpu34.js} +1994 -1967
  70. package/dist/index-BsAx_npy.cjs +27 -0
  71. package/dist/index.cjs +14 -14
  72. package/dist/index.js +4264 -4235
  73. package/dist/{info-CssPzj9L.js → info-DXpOTVKn.js} +3 -3
  74. package/dist/info-b-1PKTfc.cjs +1 -0
  75. package/dist/last-page-C5eHUlq9.cjs +1 -0
  76. package/dist/{last-page-DrYSRMe5.js → last-page-DIN17z_8.js} +3 -3
  77. package/dist/license.cjs +1 -1
  78. package/dist/license.js +1 -1
  79. package/dist/magnifier-CVKlEBIJ.cjs +1 -0
  80. package/dist/{magnifier-DQHbDi_X.js → magnifier-Dep29X1B.js} +3 -3
  81. package/dist/moon-Dlcx_YsO.cjs +1 -0
  82. package/dist/{moon-DXlgBCWH.js → moon-Dw-MII-V.js} +3 -3
  83. package/dist/{page-view-dual-CeQyiqfI.js → page-view-dual-DCLg-YkG.js} +3 -3
  84. package/dist/page-view-dual-SkkSVjyx.cjs +1 -0
  85. package/dist/{page-view-dual-with-cover-BT5sW_cl.js → page-view-dual-with-cover-BFBRneNZ.js} +3 -3
  86. package/dist/page-view-dual-with-cover-DonoXL1h.cjs +1 -0
  87. package/dist/{page-view-single-HpxafscY.cjs → page-view-single-Bv6yiJbr.cjs} +1 -1
  88. package/dist/{page-view-single-Cp9W1OUV.js → page-view-single-CWOhdavX.js} +3 -3
  89. package/dist/pointer-Bf4vWBBT.cjs +1 -0
  90. package/dist/{pointer-BppCj8EV.js → pointer-jfdFDx4z.js} +3 -3
  91. package/dist/{printer-BFl4fVY9.js → printer-B8qbXO9F.js} +3 -3
  92. package/dist/printer-vnAfobXY.cjs +1 -0
  93. package/dist/{rotate-counter-clockwise-C4VIpGoU.js → rotate-counter-clockwise-DFl9ijSR.js} +3 -3
  94. package/dist/rotate-counter-clockwise-DZero_KG.cjs +1 -0
  95. package/dist/scrolling-horizontal-DPPdLmPm.cjs +1 -0
  96. package/dist/{scrolling-horizontal-CLl5lWK8.js → scrolling-horizontal-JO2P2O-8.js} +3 -3
  97. package/dist/scrolling-page-BSQ4aGZg.cjs +1 -0
  98. package/dist/{scrolling-page-C5NJekbJ.js → scrolling-page-y5Rrmrnm.js} +3 -3
  99. package/dist/{scrolling-vertical-DjEDpf4E.js → scrolling-vertical-D9MCCss9.js} +3 -3
  100. package/dist/scrolling-vertical-DndlMdb1.cjs +1 -0
  101. package/dist/scrolling-wrapped-CT0CkkFE.cjs +1 -0
  102. package/dist/{scrolling-wrapped-BYH7Nvoa.js → scrolling-wrapped-CYbEHLH6.js} +3 -3
  103. package/dist/{sun-gPHy98wE.js → sun-BhyBd5LA.js} +3 -3
  104. package/dist/sun-KVjCL8EX.cjs +1 -0
  105. package/dist/{thumbnail-BIBuAei4.js → thumbnail-BMmN_jSl.js} +3 -3
  106. package/dist/thumbnail-z4ws3aqe.cjs +1 -0
  107. package/dist/trash-C_WNKhXY.cjs +1 -0
  108. package/dist/{trash-TzreR6N5.js → trash-Deie-RCt.js} +3 -3
  109. package/dist/types/components/AppButton.vue.d.ts +17 -11
  110. package/dist/types/components/AppColorPicker.vue.d.ts +14 -11
  111. package/dist/types/components/AppFormControl.vue.d.ts +24 -6
  112. package/dist/types/components/AppIcon.vue.d.ts +13 -3
  113. package/dist/types/components/AppInput.vue.d.ts +10 -1
  114. package/dist/types/components/AppLoader.vue.d.ts +18 -13
  115. package/dist/types/components/AppPopover.vue.d.ts +76 -21
  116. package/dist/types/components/AppTooltip.vue.d.ts +31 -14
  117. package/dist/types/components/ColorButton.vue.d.ts +13 -10
  118. package/dist/types/components/DragFileMask.vue.d.ts +45 -11
  119. package/dist/types/components/FreeTextPanel.vue.d.ts +1 -9
  120. package/dist/types/components/FreeTextPanelFontColors.vue.d.ts +1 -8
  121. package/dist/types/components/FreeTextPanelFontFamilySelector.vue.d.ts +1 -8
  122. package/dist/types/components/FreeTextPanelFontSizeSelector.vue.d.ts +1 -8
  123. package/dist/types/components/LayerAnnotation.vue.d.ts +36 -15
  124. package/dist/types/components/LayerAnnotationEditor.vue.d.ts +18 -3
  125. package/dist/types/components/LayerAnnotationEditorFreeText.vue.d.ts +31 -20
  126. package/dist/types/components/LayerAnnotationEditorFreeTextItem.vue.d.ts +19 -8
  127. package/dist/types/components/LayerAnnotationEditorHighlight.vue.d.ts +31 -22
  128. package/dist/types/components/LayerAnnotationEditorHighlightItem.vue.d.ts +18 -3
  129. package/dist/types/components/LayerAnnotationEditorImage.vue.d.ts +20 -13
  130. package/dist/types/components/LayerAnnotationEditorTextSelectionItem.vue.d.ts +18 -7
  131. package/dist/types/components/LayerAnnotationEditorTextSelectionItemMenu.vue.d.ts +19 -15
  132. package/dist/types/components/LayerAnnotationStampResizer.vue.d.ts +17 -7
  133. package/dist/types/components/LayerCanvas.vue.d.ts +13 -4
  134. package/dist/types/components/LayerCanvasDetail.vue.d.ts +10 -1
  135. package/dist/types/components/LayerOverlay.vue.d.ts +35 -15
  136. package/dist/types/components/LayerText.vue.d.ts +23 -9
  137. package/dist/types/components/LayerTextHighlight.vue.d.ts +10 -1
  138. package/dist/types/components/LayerTextSearchHighlight.vue.d.ts +10 -1
  139. package/dist/types/components/LayerXFA.vue.d.ts +21 -10
  140. package/dist/types/components/ModalPassword.vue.d.ts +14 -11
  141. package/dist/types/components/ModalPdfProperties.vue.d.ts +13 -4
  142. package/dist/types/components/ModalPrintLoadingProgress.vue.d.ts +13 -4
  143. package/dist/types/components/SwitchAppearance.vue.d.ts +22 -25
  144. package/dist/types/components/ToolCommentPanel.vue.d.ts +29 -24
  145. package/dist/types/components/ToolDownload.vue.d.ts +20 -15
  146. package/dist/types/components/ToolFullscreen.vue.d.ts +21 -16
  147. package/dist/types/components/ToolMenuOthers.vue.d.ts +76 -37
  148. package/dist/types/components/ToolMenuOthersMobile.vue.d.ts +12 -7
  149. package/dist/types/components/ToolOpenFile.vue.d.ts +20 -15
  150. package/dist/types/components/ToolOpenFileInput.vue.d.ts +4 -3
  151. package/dist/types/components/ToolPagination.vue.d.ts +60 -26
  152. package/dist/types/components/ToolPrint.vue.d.ts +27 -10
  153. package/dist/types/components/ToolSearch.vue.d.ts +57 -23
  154. package/dist/types/components/ToolThumbnail.vue.d.ts +36 -13
  155. package/dist/types/components/ToolZoom.vue.d.ts +45 -21
  156. package/dist/types/components/ToolZoomPercentageMenu.vue.d.ts +18 -7
  157. package/dist/types/components/VPdfComments.vue.d.ts +17 -6
  158. package/dist/types/components/VPdfCommentsDate.vue.d.ts +13 -3
  159. package/dist/types/components/VPdfCommentsHeader.vue.d.ts +13 -3
  160. package/dist/types/components/VPdfCommentsIcon.vue.d.ts +13 -3
  161. package/dist/types/components/VPdfCommentsReplies.vue.d.ts +13 -3
  162. package/dist/types/components/VPdfCommentsSidebar.vue.d.ts +4 -3
  163. package/dist/types/components/VPdfCommentsText.vue.d.ts +1 -11
  164. package/dist/types/components/VPdfPage.vue.d.ts +55 -16
  165. package/dist/types/components/VPdfThumbnail.vue.d.ts +17 -6
  166. package/dist/types/components/VPdfThumbnails.vue.d.ts +15 -6
  167. package/dist/types/components/VPdfViewer.vue.d.ts +604 -316
  168. package/dist/types/components/ui/button/Button.vue.d.ts +41 -8
  169. package/dist/types/components/ui/button/index.d.ts +1 -1
  170. package/dist/types/components/ui/checkbox/Checkbox.vue.d.ts +29 -15
  171. package/dist/types/components/ui/collapsible/Collapsible.vue.d.ts +26 -15
  172. package/dist/types/components/ui/collapsible/CollapsibleContent.vue.d.ts +24 -9
  173. package/dist/types/components/ui/collapsible/CollapsibleTrigger.vue.d.ts +24 -9
  174. package/dist/types/components/ui/dialog/Dialog.vue.d.ts +24 -13
  175. package/dist/types/components/ui/dialog/DialogClose.vue.d.ts +24 -9
  176. package/dist/types/components/ui/dialog/DialogContent.vue.d.ts +29 -25
  177. package/dist/types/components/ui/dialog/DialogDescription.vue.d.ts +29 -11
  178. package/dist/types/components/ui/dialog/DialogFooter.vue.d.ts +29 -11
  179. package/dist/types/components/ui/dialog/DialogHeader.vue.d.ts +29 -11
  180. package/dist/types/components/ui/dialog/DialogTitle.vue.d.ts +29 -11
  181. package/dist/types/components/ui/dialog/DialogTrigger.vue.d.ts +24 -9
  182. package/dist/types/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +24 -13
  183. package/dist/types/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +29 -17
  184. package/dist/types/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +44 -23
  185. package/dist/types/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +24 -9
  186. package/dist/types/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +35 -13
  187. package/dist/types/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +32 -12
  188. package/dist/types/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +24 -13
  189. package/dist/types/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +32 -16
  190. package/dist/types/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +13 -3
  191. package/dist/types/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +29 -11
  192. package/dist/types/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +24 -13
  193. package/dist/types/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +29 -27
  194. package/dist/types/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +29 -11
  195. package/dist/types/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +24 -9
  196. package/dist/types/components/ui/input/Input.vue.d.ts +13 -4
  197. package/dist/types/components/ui/popover/Popover.vue.d.ts +24 -13
  198. package/dist/types/components/ui/popover/PopoverContent.vue.d.ts +55 -27
  199. package/dist/types/components/ui/popover/PopoverTrigger.vue.d.ts +24 -9
  200. package/dist/types/components/ui/progress/Progress.vue.d.ts +23 -4
  201. package/dist/types/components/ui/select/Select.vue.d.ts +24 -16
  202. package/dist/types/components/ui/select/SelectContent.vue.d.ts +48 -21
  203. package/dist/types/components/ui/select/SelectGroup.vue.d.ts +29 -11
  204. package/dist/types/components/ui/select/SelectItem.vue.d.ts +29 -11
  205. package/dist/types/components/ui/select/SelectItemText.vue.d.ts +24 -9
  206. package/dist/types/components/ui/select/SelectLabel.vue.d.ts +29 -11
  207. package/dist/types/components/ui/select/SelectScrollDownButton.vue.d.ts +29 -11
  208. package/dist/types/components/ui/select/SelectScrollUpButton.vue.d.ts +29 -11
  209. package/dist/types/components/ui/select/SelectSeparator.vue.d.ts +13 -3
  210. package/dist/types/components/ui/select/SelectTrigger.vue.d.ts +29 -11
  211. package/dist/types/components/ui/select/SelectValue.vue.d.ts +24 -9
  212. package/dist/types/components/ui/toast/Toast.vue.d.ts +24 -91
  213. package/dist/types/components/ui/toast/ToastAction.vue.d.ts +29 -11
  214. package/dist/types/components/ui/toast/ToastClose.vue.d.ts +13 -3
  215. package/dist/types/components/ui/toast/ToastDescription.vue.d.ts +29 -11
  216. package/dist/types/components/ui/toast/ToastProvider.vue.d.ts +24 -9
  217. package/dist/types/components/ui/toast/ToastTitle.vue.d.ts +29 -11
  218. package/dist/types/components/ui/toast/ToastViewport.vue.d.ts +13 -3
  219. package/dist/types/components/ui/toast/index.d.ts +1 -1
  220. package/dist/types/components/ui/tooltip/Tooltip.vue.d.ts +24 -13
  221. package/dist/types/components/ui/tooltip/TooltipContent.vue.d.ts +44 -17
  222. package/dist/types/components/ui/tooltip/TooltipProvider.vue.d.ts +24 -9
  223. package/dist/types/components/ui/tooltip/TooltipTrigger.vue.d.ts +24 -9
  224. package/dist/types/composables/useAnnotationFreeText.d.ts +248 -454
  225. package/dist/types/composables/useAnnotationHighlight.d.ts +178 -288
  226. package/dist/types/composables/useAnnotationStamp.d.ts +212 -344
  227. package/dist/types/composables/useAnnotationStrikethrough.d.ts +216 -326
  228. package/dist/types/composables/useAnnotationUnderline.d.ts +216 -326
  229. package/dist/types/composables/useDownload.d.ts +1 -1
  230. package/dist/types/composables/usePinch.d.ts +2 -2
  231. package/dist/types/composables/usePrintControl.d.ts +1 -1
  232. package/dist/types/composables/useRotation.d.ts +1 -1
  233. package/dist/types/composables/useScale.d.ts +4 -4
  234. package/dist/types/const.d.ts +1065 -29
  235. package/dist/types/utils/CanvasRender.d.ts +1 -0
  236. package/dist/types/utils/searchHighlight.d.ts +1 -1
  237. package/dist/types/utils/types.d.ts +3 -3
  238. package/dist/zoom-in-Cd9AruDC.cjs +1 -0
  239. package/dist/{zoom-in-CPaNSJ1z.js → zoom-in-qogh-J7e.js} +3 -3
  240. package/dist/{zoom-out-CLnidFKC.js → zoom-out-BFzERV6_.js} +3 -3
  241. package/dist/zoom-out-Bg8q92O7.cjs +1 -0
  242. package/package.json +1 -1
  243. package/dist/VPdfViewer.vue_vue_type_style_index_1_scoped_b89b6109_lang-DhObPDJ_.cjs +0 -48
  244. package/dist/annotation-font-Blcpe4u2.cjs +0 -1
  245. package/dist/annotation-font-style-italic-B8kH4ITJ.cjs +0 -1
  246. package/dist/annotation-font-style-underline-CLE8ktZh.cjs +0 -1
  247. package/dist/annotation-font-weight-bold-D252ckAE.cjs +0 -1
  248. package/dist/annotation-freetext-g92Qx1IV.cjs +0 -1
  249. package/dist/annotation-highlight-C1CWBy8d.cjs +0 -1
  250. package/dist/annotation-ink-B2uYt5-C.cjs +0 -1
  251. package/dist/annotation-line-DUWuAW-f.cjs +0 -1
  252. package/dist/annotation-link-Cr6h9HZO.cjs +0 -1
  253. package/dist/annotation-signature-Cak3E29O.cjs +0 -1
  254. package/dist/annotation-square-CEqiLsCd.cjs +0 -1
  255. package/dist/annotation-squiggly-CFWCrBK4.cjs +0 -1
  256. package/dist/annotation-stamp-DPRZCSfZ.cjs +0 -1
  257. package/dist/annotation-strikeout-BeEvaYW8.cjs +0 -1
  258. package/dist/annotation-text-RpmlgGd_.cjs +0 -1
  259. package/dist/annotation-underline-D-poXEoT.cjs +0 -1
  260. package/dist/arrow-up-Cm2K9ps7.cjs +0 -1
  261. package/dist/chevron-down-C6TlWeSQ.cjs +0 -1
  262. package/dist/clear-D51Pvnp9.cjs +0 -1
  263. package/dist/close-BSg5DrkC.cjs +0 -1
  264. package/dist/comment-panel-J02V-i6Z.cjs +0 -1
  265. package/dist/download-CjQHSyu_.cjs +0 -1
  266. package/dist/drag-icon-L-zbStFS.cjs +0 -1
  267. package/dist/drag-icon-dark-DP846xO-.cjs +0 -1
  268. package/dist/ellipsis-vertical-C2GRrtGO.cjs +0 -1
  269. package/dist/empty-comment-dark-DIf5U2XR.cjs +0 -1
  270. package/dist/empty-comment-light-BJOzhQwj.cjs +0 -1
  271. package/dist/file-DWLuAXKz.cjs +0 -1
  272. package/dist/first-page-CK8tnfSk.cjs +0 -1
  273. package/dist/fullscreen-BFehSkBw.cjs +0 -1
  274. package/dist/hand-CNKizFpH.cjs +0 -1
  275. package/dist/index-D-jyfxuH.cjs +0 -27
  276. package/dist/info-y-EeYBI-.cjs +0 -1
  277. package/dist/last-page-CJ3rZYaG.cjs +0 -1
  278. package/dist/magnifier-UFqakbbr.cjs +0 -1
  279. package/dist/moon-CaYBgQ9U.cjs +0 -1
  280. package/dist/page-view-dual-IGi1zJDR.cjs +0 -1
  281. package/dist/page-view-dual-with-cover-C0NQphKH.cjs +0 -1
  282. package/dist/pointer-CrB9RNNW.cjs +0 -1
  283. package/dist/printer-BB3hCXL_.cjs +0 -1
  284. package/dist/rotate-counter-clockwise-D1tMmNZo.cjs +0 -1
  285. package/dist/scrolling-horizontal-2RbyZ4O9.cjs +0 -1
  286. package/dist/scrolling-page-Djd0UEUo.cjs +0 -1
  287. package/dist/scrolling-vertical-DIxUiF-k.cjs +0 -1
  288. package/dist/scrolling-wrapped-BwItKvON.cjs +0 -1
  289. package/dist/sun-Ch9jdMPV.cjs +0 -1
  290. package/dist/thumbnail-BXWQ1ywq.cjs +0 -1
  291. package/dist/trash-B5pwKFjg.cjs +0 -1
  292. package/dist/zoom-in-OIsimiHa.cjs +0 -1
  293. package/dist/zoom-out-HTJbE8IZ.cjs +0 -1
@@ -0,0 +1,27 @@
1
+ "use strict";const kt=require("./VPdfViewer.vue_vue_type_style_index_1_scoped_b89b6109_lang-CxqvCVel.cjs");function En(e,t){for(var a=0;a<t.length;a++){const r=t[a];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var xn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Tn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var a=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};a.prototype=t.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),a}var ee={options:{usePureJavaScript:!1}},Ei={},Gr={};Gr.byteLength=An;Gr.toByteArray=_n;Gr.fromByteArray=Rn;var xt=[],ot=[],In=typeof Uint8Array<"u"?Uint8Array:Array,ra="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Jt=0,Bn=ra.length;Jt<Bn;++Jt)xt[Jt]=ra[Jt],ot[ra.charCodeAt(Jt)]=Jt;ot[45]=62;ot[95]=63;function xi(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=e.indexOf("=");a===-1&&(a=t);var r=a===t?0:4-a%4;return[a,r]}function An(e){var t=xi(e),a=t[0],r=t[1];return(a+r)*3/4-r}function bn(e,t,a){return(t+a)*3/4-a}function _n(e){var t,a=xi(e),r=a[0],i=a[1],s=new In(bn(e,r,i)),n=0,o=i>0?r-4:r,l;for(l=0;l<o;l+=4)t=ot[e.charCodeAt(l)]<<18|ot[e.charCodeAt(l+1)]<<12|ot[e.charCodeAt(l+2)]<<6|ot[e.charCodeAt(l+3)],s[n++]=t>>16&255,s[n++]=t>>8&255,s[n++]=t&255;return i===2&&(t=ot[e.charCodeAt(l)]<<2|ot[e.charCodeAt(l+1)]>>4,s[n++]=t&255),i===1&&(t=ot[e.charCodeAt(l)]<<10|ot[e.charCodeAt(l+1)]<<4|ot[e.charCodeAt(l+2)]>>2,s[n++]=t>>8&255,s[n++]=t&255),s}function wn(e){return xt[e>>18&63]+xt[e>>12&63]+xt[e>>6&63]+xt[e&63]}function Nn(e,t,a){for(var r,i=[],s=t;s<a;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push(wn(r));return i.join("")}function Rn(e){for(var t,a=e.length,r=a%3,i=[],s=16383,n=0,o=a-r;n<o;n+=s)i.push(Nn(e,n,n+s>o?o:n+s));return r===1?(t=e[a-1],i.push(xt[t>>2]+xt[t<<4&63]+"==")):r===2&&(t=(e[a-2]<<8)+e[a-1],i.push(xt[t>>10]+xt[t>>4&63]+xt[t<<2&63]+"=")),i.join("")}var Aa={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Aa.read=function(e,t,a,r,i){var s,n,o=i*8-r-1,l=(1<<o)-1,f=l>>1,u=-7,p=a?i-1:0,m=a?-1:1,S=e[t+p];for(p+=m,s=S&(1<<-u)-1,S>>=-u,u+=o;u>0;s=s*256+e[t+p],p+=m,u-=8);for(n=s&(1<<-u)-1,s>>=-u,u+=r;u>0;n=n*256+e[t+p],p+=m,u-=8);if(s===0)s=1-f;else{if(s===l)return n?NaN:(S?-1:1)*(1/0);n=n+Math.pow(2,r),s=s-f}return(S?-1:1)*n*Math.pow(2,s-r)};Aa.write=function(e,t,a,r,i,s){var n,o,l,f=s*8-i-1,u=(1<<f)-1,p=u>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=r?0:s-1,C=r?1:-1,A=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,n=u):(n=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-n))<1&&(n--,l*=2),n+p>=1?t+=m/l:t+=m*Math.pow(2,1-p),t*l>=2&&(n++,l/=2),n+p>=u?(o=0,n=u):n+p>=1?(o=(t*l-1)*Math.pow(2,i),n=n+p):(o=t*Math.pow(2,p-1)*Math.pow(2,i),n=0));i>=8;e[a+S]=o&255,S+=C,o/=256,i-=8);for(n=n<<i|o,f+=i;f>0;e[a+S]=n&255,S+=C,n/=256,f-=8);e[a+S-C]|=A*128};/*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ */(function(e){const t=Gr,a=Aa,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=K,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i;const{Uint8Array:s,ArrayBuffer:n,SharedArrayBuffer:o}=globalThis;u.TYPED_ARRAY_SUPPORT=l(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const v=new s(1),c={foo:function(){return 42}};return Object.setPrototypeOf(c,s.prototype),Object.setPrototypeOf(v,c),v.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function f(v){if(v>i)throw new RangeError('The value "'+v+'" is invalid for option "size"');const c=new s(v);return Object.setPrototypeOf(c,u.prototype),c}function u(v,c,h){if(typeof v=="number"){if(typeof c=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return C(v)}return p(v,c,h)}u.poolSize=8192;function p(v,c,h){if(typeof v=="string")return A(v,c);if(n.isView(v))return w(v);if(v==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v);if(vt(v,n)||v&&vt(v.buffer,n)||typeof o<"u"&&(vt(v,o)||v&&vt(v.buffer,o)))return U(v,c,h);if(typeof v=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const E=v.valueOf&&v.valueOf();if(E!=null&&E!==v)return u.from(E,c,h);const B=D(v);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof v[Symbol.toPrimitive]=="function")return u.from(v[Symbol.toPrimitive]("string"),c,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v)}u.from=function(v,c,h){return p(v,c,h)},Object.setPrototypeOf(u.prototype,s.prototype),Object.setPrototypeOf(u,s);function m(v){if(typeof v!="number")throw new TypeError('"size" argument must be of type number');if(v<0)throw new RangeError('The value "'+v+'" is invalid for option "size"')}function S(v,c,h){return m(v),v<=0?f(v):c!==void 0?typeof h=="string"?f(v).fill(c,h):f(v).fill(c):f(v)}u.alloc=function(v,c,h){return S(v,c,h)};function C(v){return m(v),f(v<0?0:G(v)|0)}u.allocUnsafe=function(v){return C(v)},u.allocUnsafeSlow=function(v){return C(v)};function A(v,c){if((typeof c!="string"||c==="")&&(c="utf8"),!u.isEncoding(c))throw new TypeError("Unknown encoding: "+c);const h=F(v,c)|0;let E=f(h);const B=E.write(v,c);return B!==h&&(E=E.slice(0,B)),E}function b(v){const c=v.length<0?0:G(v.length)|0,h=f(c);for(let E=0;E<c;E+=1)h[E]=v[E]&255;return h}function w(v){if(vt(v,s)){const c=new s(v);return U(c.buffer,c.byteOffset,c.byteLength)}return b(v)}function U(v,c,h){if(c<0||v.byteLength<c)throw new RangeError('"offset" is outside of buffer bounds');if(v.byteLength<c+(h||0))throw new RangeError('"length" is outside of buffer bounds');let E;return c===void 0&&h===void 0?E=new s(v):h===void 0?E=new s(v,c):E=new s(v,c,h),Object.setPrototypeOf(E,u.prototype),E}function D(v){if(u.isBuffer(v)){const c=G(v.length)|0,h=f(c);return h.length===0||v.copy(h,0,0,c),h}if(v.length!==void 0)return typeof v.length!="number"||ta(v.length)?f(0):b(v);if(v.type==="Buffer"&&Array.isArray(v.data))return b(v.data)}function G(v){if(v>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return v|0}function K(v){return+v!=v&&(v=0),u.alloc(+v)}u.isBuffer=function(c){return c!=null&&c._isBuffer===!0&&c!==u.prototype},u.compare=function(c,h){if(vt(c,s)&&(c=u.from(c,c.offset,c.byteLength)),vt(h,s)&&(h=u.from(h,h.offset,h.byteLength)),!u.isBuffer(c)||!u.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(c===h)return 0;let E=c.length,B=h.length;for(let N=0,L=Math.min(E,B);N<L;++N)if(c[N]!==h[N]){E=c[N],B=h[N];break}return E<B?-1:B<E?1:0},u.isEncoding=function(c){switch(String(c).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(c,h){if(!Array.isArray(c))throw new TypeError('"list" argument must be an Array of Buffers');if(c.length===0)return u.alloc(0);let E;if(h===void 0)for(h=0,E=0;E<c.length;++E)h+=c[E].length;const B=u.allocUnsafe(h);let N=0;for(E=0;E<c.length;++E){let L=c[E];if(vt(L,s))N+L.length>B.length?(u.isBuffer(L)||(L=u.from(L)),L.copy(B,N)):s.prototype.set.call(B,L,N);else if(u.isBuffer(L))L.copy(B,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=L.length}return B};function F(v,c){if(u.isBuffer(v))return v.length;if(n.isView(v)||vt(v,n))return v.byteLength;if(typeof v!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof v);const h=v.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&h===0)return 0;let B=!1;for(;;)switch(c){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return ea(v).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return za(v).length;default:if(B)return E?-1:ea(v).length;c=(""+c).toLowerCase(),B=!0}}u.byteLength=F;function $(v,c,h){let E=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,c>>>=0,h<=c))return"";for(v||(v="utf8");;)switch(v){case"hex":return Le(this,c,h);case"utf8":case"utf-8":return z(this,c,h);case"ascii":return be(this,c,h);case"latin1":case"binary":return _e(this,c,h);case"base64":return Ae(this,c,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return He(this,c,h);default:if(E)throw new TypeError("Unknown encoding: "+v);v=(v+"").toLowerCase(),E=!0}}u.prototype._isBuffer=!0;function j(v,c,h){const E=v[c];v[c]=v[h],v[h]=E}u.prototype.swap16=function(){const c=this.length;if(c%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<c;h+=2)j(this,h,h+1);return this},u.prototype.swap32=function(){const c=this.length;if(c%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<c;h+=4)j(this,h,h+3),j(this,h+1,h+2);return this},u.prototype.swap64=function(){const c=this.length;if(c%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<c;h+=8)j(this,h,h+7),j(this,h+1,h+6),j(this,h+2,h+5),j(this,h+3,h+4);return this},u.prototype.toString=function(){const c=this.length;return c===0?"":arguments.length===0?z(this,0,c):$.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(c){if(!u.isBuffer(c))throw new TypeError("Argument must be a Buffer");return this===c?!0:u.compare(this,c)===0},u.prototype.inspect=function(){let c="";const h=e.INSPECT_MAX_BYTES;return c=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(c+=" ... "),"<Buffer "+c+">"},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(c,h,E,B,N){if(vt(c,s)&&(c=u.from(c,c.offset,c.byteLength)),!u.isBuffer(c))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof c);if(h===void 0&&(h=0),E===void 0&&(E=c?c.length:0),B===void 0&&(B=0),N===void 0&&(N=this.length),h<0||E>c.length||B<0||N>this.length)throw new RangeError("out of range index");if(B>=N&&h>=E)return 0;if(B>=N)return-1;if(h>=E)return 1;if(h>>>=0,E>>>=0,B>>>=0,N>>>=0,this===c)return 0;let L=N-B,te=E-h;const we=Math.min(L,te),Te=this.slice(B,N),Ne=c.slice(h,E);for(let ge=0;ge<we;++ge)if(Te[ge]!==Ne[ge]){L=Te[ge],te=Ne[ge];break}return L<te?-1:te<L?1:0};function le(v,c,h,E,B){if(v.length===0)return-1;if(typeof h=="string"?(E=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,ta(h)&&(h=B?0:v.length-1),h<0&&(h=v.length+h),h>=v.length){if(B)return-1;h=v.length-1}else if(h<0)if(B)h=0;else return-1;if(typeof c=="string"&&(c=u.from(c,E)),u.isBuffer(c))return c.length===0?-1:he(v,c,h,E,B);if(typeof c=="number")return c=c&255,typeof s.prototype.indexOf=="function"?B?s.prototype.indexOf.call(v,c,h):s.prototype.lastIndexOf.call(v,c,h):he(v,[c],h,E,B);throw new TypeError("val must be string, number or Buffer")}function he(v,c,h,E,B){let N=1,L=v.length,te=c.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(v.length<2||c.length<2)return-1;N=2,L/=2,te/=2,h/=2}function we(Ne,ge){return N===1?Ne[ge]:Ne.readUInt16BE(ge*N)}let Te;if(B){let Ne=-1;for(Te=h;Te<L;Te++)if(we(v,Te)===we(c,Ne===-1?0:Te-Ne)){if(Ne===-1&&(Ne=Te),Te-Ne+1===te)return Ne*N}else Ne!==-1&&(Te-=Te-Ne),Ne=-1}else for(h+te>L&&(h=L-te),Te=h;Te>=0;Te--){let Ne=!0;for(let ge=0;ge<te;ge++)if(we(v,Te+ge)!==we(c,ge)){Ne=!1;break}if(Ne)return Te}return-1}u.prototype.includes=function(c,h,E){return this.indexOf(c,h,E)!==-1},u.prototype.indexOf=function(c,h,E){return le(this,c,h,E,!0)},u.prototype.lastIndexOf=function(c,h,E){return le(this,c,h,E,!1)};function de(v,c,h,E){h=Number(h)||0;const B=v.length-h;E?(E=Number(E),E>B&&(E=B)):E=B;const N=c.length;E>N/2&&(E=N/2);let L;for(L=0;L<E;++L){const te=parseInt(c.substr(L*2,2),16);if(ta(te))return L;v[h+L]=te}return L}function Ee(v,c,h,E){return Br(ea(c,v.length-h),v,h,E)}function je(v,c,h,E){return Br(gn(c),v,h,E)}function rt(v,c,h,E){return Br(za(c),v,h,E)}function ye(v,c,h,E){return Br(vn(c,v.length-h),v,h,E)}u.prototype.write=function(c,h,E,B){if(h===void 0)B="utf8",E=this.length,h=0;else if(E===void 0&&typeof h=="string")B=h,E=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(E)?(E=E>>>0,B===void 0&&(B="utf8")):(B=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const N=this.length-h;if((E===void 0||E>N)&&(E=N),c.length>0&&(E<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let L=!1;for(;;)switch(B){case"hex":return de(this,c,h,E);case"utf8":case"utf-8":return Ee(this,c,h,E);case"ascii":case"latin1":case"binary":return je(this,c,h,E);case"base64":return rt(this,c,h,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,c,h,E);default:if(L)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),L=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ae(v,c,h){return c===0&&h===v.length?t.fromByteArray(v):t.fromByteArray(v.slice(c,h))}function z(v,c,h){h=Math.min(v.length,h);const E=[];let B=c;for(;B<h;){const N=v[B];let L=null,te=N>239?4:N>223?3:N>191?2:1;if(B+te<=h){let we,Te,Ne,ge;switch(te){case 1:N<128&&(L=N);break;case 2:we=v[B+1],(we&192)===128&&(ge=(N&31)<<6|we&63,ge>127&&(L=ge));break;case 3:we=v[B+1],Te=v[B+2],(we&192)===128&&(Te&192)===128&&(ge=(N&15)<<12|(we&63)<<6|Te&63,ge>2047&&(ge<55296||ge>57343)&&(L=ge));break;case 4:we=v[B+1],Te=v[B+2],Ne=v[B+3],(we&192)===128&&(Te&192)===128&&(Ne&192)===128&&(ge=(N&15)<<18|(we&63)<<12|(Te&63)<<6|Ne&63,ge>65535&&ge<1114112&&(L=ge))}}L===null?(L=65533,te=1):L>65535&&(L-=65536,E.push(L>>>10&1023|55296),L=56320|L&1023),E.push(L),B+=te}return Rt(E)}const gt=4096;function Rt(v){const c=v.length;if(c<=gt)return String.fromCharCode.apply(String,v);let h="",E=0;for(;E<c;)h+=String.fromCharCode.apply(String,v.slice(E,E+=gt));return h}function be(v,c,h){let E="";h=Math.min(v.length,h);for(let B=c;B<h;++B)E+=String.fromCharCode(v[B]&127);return E}function _e(v,c,h){let E="";h=Math.min(v.length,h);for(let B=c;B<h;++B)E+=String.fromCharCode(v[B]);return E}function Le(v,c,h){const E=v.length;(!c||c<0)&&(c=0),(!h||h<0||h>E)&&(h=E);let B="";for(let N=c;N<h;++N)B+=mn[v[N]];return B}function He(v,c,h){const E=v.slice(c,h);let B="";for(let N=0;N<E.length-1;N+=2)B+=String.fromCharCode(E[N]+E[N+1]*256);return B}u.prototype.slice=function(c,h){const E=this.length;c=~~c,h=h===void 0?E:~~h,c<0?(c+=E,c<0&&(c=0)):c>E&&(c=E),h<0?(h+=E,h<0&&(h=0)):h>E&&(h=E),h<c&&(h=c);const B=this.subarray(c,h);return Object.setPrototypeOf(B,u.prototype),B};function se(v,c,h){if(v%1!==0||v<0)throw new RangeError("offset is not uint");if(v+c>h)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(c,h,E){c=c>>>0,h=h>>>0,E||se(c,h,this.length);let B=this[c],N=1,L=0;for(;++L<h&&(N*=256);)B+=this[c+L]*N;return B},u.prototype.readUintBE=u.prototype.readUIntBE=function(c,h,E){c=c>>>0,h=h>>>0,E||se(c,h,this.length);let B=this[c+--h],N=1;for(;h>0&&(N*=256);)B+=this[c+--h]*N;return B},u.prototype.readUint8=u.prototype.readUInt8=function(c,h){return c=c>>>0,h||se(c,1,this.length),this[c]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(c,h){return c=c>>>0,h||se(c,2,this.length),this[c]|this[c+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(c,h){return c=c>>>0,h||se(c,2,this.length),this[c]<<8|this[c+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(c,h){return c=c>>>0,h||se(c,4,this.length),(this[c]|this[c+1]<<8|this[c+2]<<16)+this[c+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(c,h){return c=c>>>0,h||se(c,4,this.length),this[c]*16777216+(this[c+1]<<16|this[c+2]<<8|this[c+3])},u.prototype.readBigUInt64LE=Lt(function(c){c=c>>>0,Zt(c,"offset");const h=this[c],E=this[c+7];(h===void 0||E===void 0)&&hr(c,this.length-8);const B=h+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24,N=this[++c]+this[++c]*2**8+this[++c]*2**16+E*2**24;return BigInt(B)+(BigInt(N)<<BigInt(32))}),u.prototype.readBigUInt64BE=Lt(function(c){c=c>>>0,Zt(c,"offset");const h=this[c],E=this[c+7];(h===void 0||E===void 0)&&hr(c,this.length-8);const B=h*2**24+this[++c]*2**16+this[++c]*2**8+this[++c],N=this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+E;return(BigInt(B)<<BigInt(32))+BigInt(N)}),u.prototype.readIntLE=function(c,h,E){c=c>>>0,h=h>>>0,E||se(c,h,this.length);let B=this[c],N=1,L=0;for(;++L<h&&(N*=256);)B+=this[c+L]*N;return N*=128,B>=N&&(B-=Math.pow(2,8*h)),B},u.prototype.readIntBE=function(c,h,E){c=c>>>0,h=h>>>0,E||se(c,h,this.length);let B=h,N=1,L=this[c+--B];for(;B>0&&(N*=256);)L+=this[c+--B]*N;return N*=128,L>=N&&(L-=Math.pow(2,8*h)),L},u.prototype.readInt8=function(c,h){return c=c>>>0,h||se(c,1,this.length),this[c]&128?(255-this[c]+1)*-1:this[c]},u.prototype.readInt16LE=function(c,h){c=c>>>0,h||se(c,2,this.length);const E=this[c]|this[c+1]<<8;return E&32768?E|4294901760:E},u.prototype.readInt16BE=function(c,h){c=c>>>0,h||se(c,2,this.length);const E=this[c+1]|this[c]<<8;return E&32768?E|4294901760:E},u.prototype.readInt32LE=function(c,h){return c=c>>>0,h||se(c,4,this.length),this[c]|this[c+1]<<8|this[c+2]<<16|this[c+3]<<24},u.prototype.readInt32BE=function(c,h){return c=c>>>0,h||se(c,4,this.length),this[c]<<24|this[c+1]<<16|this[c+2]<<8|this[c+3]},u.prototype.readBigInt64LE=Lt(function(c){c=c>>>0,Zt(c,"offset");const h=this[c],E=this[c+7];(h===void 0||E===void 0)&&hr(c,this.length-8);const B=this[c+4]+this[c+5]*2**8+this[c+6]*2**16+(E<<24);return(BigInt(B)<<BigInt(32))+BigInt(h+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24)}),u.prototype.readBigInt64BE=Lt(function(c){c=c>>>0,Zt(c,"offset");const h=this[c],E=this[c+7];(h===void 0||E===void 0)&&hr(c,this.length-8);const B=(h<<24)+this[++c]*2**16+this[++c]*2**8+this[++c];return(BigInt(B)<<BigInt(32))+BigInt(this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+E)}),u.prototype.readFloatLE=function(c,h){return c=c>>>0,h||se(c,4,this.length),a.read(this,c,!0,23,4)},u.prototype.readFloatBE=function(c,h){return c=c>>>0,h||se(c,4,this.length),a.read(this,c,!1,23,4)},u.prototype.readDoubleLE=function(c,h){return c=c>>>0,h||se(c,8,this.length),a.read(this,c,!0,52,8)},u.prototype.readDoubleBE=function(c,h){return c=c>>>0,h||se(c,8,this.length),a.read(this,c,!1,52,8)};function ce(v,c,h,E,B,N){if(!u.isBuffer(v))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>B||c<N)throw new RangeError('"value" argument is out of bounds');if(h+E>v.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(c,h,E,B){if(c=+c,h=h>>>0,E=E>>>0,!B){const te=Math.pow(2,8*E)-1;ce(this,c,h,E,te,0)}let N=1,L=0;for(this[h]=c&255;++L<E&&(N*=256);)this[h+L]=c/N&255;return h+E},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(c,h,E,B){if(c=+c,h=h>>>0,E=E>>>0,!B){const te=Math.pow(2,8*E)-1;ce(this,c,h,E,te,0)}let N=E-1,L=1;for(this[h+N]=c&255;--N>=0&&(L*=256);)this[h+N]=c/L&255;return h+E},u.prototype.writeUint8=u.prototype.writeUInt8=function(c,h,E){return c=+c,h=h>>>0,E||ce(this,c,h,1,255,0),this[h]=c&255,h+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(c,h,E){return c=+c,h=h>>>0,E||ce(this,c,h,2,65535,0),this[h]=c&255,this[h+1]=c>>>8,h+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(c,h,E){return c=+c,h=h>>>0,E||ce(this,c,h,2,65535,0),this[h]=c>>>8,this[h+1]=c&255,h+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(c,h,E){return c=+c,h=h>>>0,E||ce(this,c,h,4,4294967295,0),this[h+3]=c>>>24,this[h+2]=c>>>16,this[h+1]=c>>>8,this[h]=c&255,h+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(c,h,E){return c=+c,h=h>>>0,E||ce(this,c,h,4,4294967295,0),this[h]=c>>>24,this[h+1]=c>>>16,this[h+2]=c>>>8,this[h+3]=c&255,h+4};function ke(v,c,h,E,B){Me(c,E,B,v,h,7);let N=Number(c&BigInt(4294967295));v[h++]=N,N=N>>8,v[h++]=N,N=N>>8,v[h++]=N,N=N>>8,v[h++]=N;let L=Number(c>>BigInt(32)&BigInt(4294967295));return v[h++]=L,L=L>>8,v[h++]=L,L=L>>8,v[h++]=L,L=L>>8,v[h++]=L,h}function Pe(v,c,h,E,B){Me(c,E,B,v,h,7);let N=Number(c&BigInt(4294967295));v[h+7]=N,N=N>>8,v[h+6]=N,N=N>>8,v[h+5]=N,N=N>>8,v[h+4]=N;let L=Number(c>>BigInt(32)&BigInt(4294967295));return v[h+3]=L,L=L>>8,v[h+2]=L,L=L>>8,v[h+1]=L,L=L>>8,v[h]=L,h+8}u.prototype.writeBigUInt64LE=Lt(function(c,h=0){return ke(this,c,h,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Lt(function(c,h=0){return Pe(this,c,h,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(c,h,E,B){if(c=+c,h=h>>>0,!B){const we=Math.pow(2,8*E-1);ce(this,c,h,E,we-1,-we)}let N=0,L=1,te=0;for(this[h]=c&255;++N<E&&(L*=256);)c<0&&te===0&&this[h+N-1]!==0&&(te=1),this[h+N]=(c/L>>0)-te&255;return h+E},u.prototype.writeIntBE=function(c,h,E,B){if(c=+c,h=h>>>0,!B){const we=Math.pow(2,8*E-1);ce(this,c,h,E,we-1,-we)}let N=E-1,L=1,te=0;for(this[h+N]=c&255;--N>=0&&(L*=256);)c<0&&te===0&&this[h+N+1]!==0&&(te=1),this[h+N]=(c/L>>0)-te&255;return h+E},u.prototype.writeInt8=function(c,h,E){return c=+c,h=h>>>0,E||ce(this,c,h,1,127,-128),c<0&&(c=255+c+1),this[h]=c&255,h+1},u.prototype.writeInt16LE=function(c,h,E){return c=+c,h=h>>>0,E||ce(this,c,h,2,32767,-32768),this[h]=c&255,this[h+1]=c>>>8,h+2},u.prototype.writeInt16BE=function(c,h,E){return c=+c,h=h>>>0,E||ce(this,c,h,2,32767,-32768),this[h]=c>>>8,this[h+1]=c&255,h+2},u.prototype.writeInt32LE=function(c,h,E){return c=+c,h=h>>>0,E||ce(this,c,h,4,2147483647,-2147483648),this[h]=c&255,this[h+1]=c>>>8,this[h+2]=c>>>16,this[h+3]=c>>>24,h+4},u.prototype.writeInt32BE=function(c,h,E){return c=+c,h=h>>>0,E||ce(this,c,h,4,2147483647,-2147483648),c<0&&(c=4294967295+c+1),this[h]=c>>>24,this[h+1]=c>>>16,this[h+2]=c>>>8,this[h+3]=c&255,h+4},u.prototype.writeBigInt64LE=Lt(function(c,h=0){return ke(this,c,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Lt(function(c,h=0){return Pe(this,c,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ve(v,c,h,E,B,N){if(h+E>v.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function Fe(v,c,h,E,B){return c=+c,h=h>>>0,B||Ve(v,c,h,4),a.write(v,c,h,E,23,4),h+4}u.prototype.writeFloatLE=function(c,h,E){return Fe(this,c,h,!0,E)},u.prototype.writeFloatBE=function(c,h,E){return Fe(this,c,h,!1,E)};function Oe(v,c,h,E,B){return c=+c,h=h>>>0,B||Ve(v,c,h,8),a.write(v,c,h,E,52,8),h+8}u.prototype.writeDoubleLE=function(c,h,E){return Oe(this,c,h,!0,E)},u.prototype.writeDoubleBE=function(c,h,E){return Oe(this,c,h,!1,E)},u.prototype.copy=function(c,h,E,B){if(!u.isBuffer(c))throw new TypeError("argument should be a Buffer");if(E||(E=0),!B&&B!==0&&(B=this.length),h>=c.length&&(h=c.length),h||(h=0),B>0&&B<E&&(B=E),B===E||c.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),c.length-h<B-E&&(B=c.length-h+E);const N=B-E;return this===c&&typeof s.prototype.copyWithin=="function"?this.copyWithin(h,E,B):s.prototype.set.call(c,this.subarray(E,B),h),N},u.prototype.fill=function(c,h,E,B){if(typeof c=="string"){if(typeof h=="string"?(B=h,h=0,E=this.length):typeof E=="string"&&(B=E,E=this.length),B!==void 0&&typeof B!="string")throw new TypeError("encoding must be a string");if(typeof B=="string"&&!u.isEncoding(B))throw new TypeError("Unknown encoding: "+B);if(c.length===1){const L=c.charCodeAt(0);(B==="utf8"&&L<128||B==="latin1")&&(c=L)}}else typeof c=="number"?c=c&255:typeof c=="boolean"&&(c=Number(c));if(h<0||this.length<h||this.length<E)throw new RangeError("Out of range index");if(E<=h)return this;h=h>>>0,E=E===void 0?this.length:E>>>0,c||(c=0);let N;if(typeof c=="number")for(N=h;N<E;++N)this[N]=c;else{const L=u.isBuffer(c)?c:u.from(c,B),te=L.length;if(te===0)throw new TypeError('The value "'+c+'" is invalid for argument "value"');for(N=0;N<E-h;++N)this[N+h]=L[N%te]}return this};const Be={};function Ue(v,c,h){Be[v]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:c.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${v}]`,this.stack,delete this.name}get code(){return v}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${v}]: ${this.message}`}}}Ue("ERR_BUFFER_OUT_OF_BOUNDS",function(v){return v?`${v} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ue("ERR_INVALID_ARG_TYPE",function(v,c){return`The "${v}" argument must be of type number. Received type ${typeof c}`},TypeError),Ue("ERR_OUT_OF_RANGE",function(v,c,h){let E=`The value of "${v}" is out of range.`,B=h;return Number.isInteger(h)&&Math.abs(h)>2**32?B=Ke(String(h)):typeof h=="bigint"&&(B=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(B=Ke(B)),B+="n"),E+=` It must be ${c}. Received ${B}`,E},RangeError);function Ke(v){let c="",h=v.length;const E=v[0]==="-"?1:0;for(;h>=E+4;h-=3)c=`_${v.slice(h-3,h)}${c}`;return`${v.slice(0,h)}${c}`}function Ge(v,c,h){Zt(c,"offset"),(v[c]===void 0||v[c+h]===void 0)&&hr(c,v.length-(h+1))}function Me(v,c,h,E,B,N){if(v>h||v<c){const L=typeof c=="bigint"?"n":"";let te;throw c===0||c===BigInt(0)?te=`>= 0${L} and < 2${L} ** ${(N+1)*8}${L}`:te=`>= -(2${L} ** ${(N+1)*8-1}${L}) and < 2 ** ${(N+1)*8-1}${L}`,new Be.ERR_OUT_OF_RANGE("value",te,v)}Ge(E,B,N)}function Zt(v,c){if(typeof v!="number")throw new Be.ERR_INVALID_ARG_TYPE(c,"number",v)}function hr(v,c,h){throw Math.floor(v)!==v?(Zt(v,h),new Be.ERR_OUT_OF_RANGE("offset","an integer",v)):c<0?new Be.ERR_BUFFER_OUT_OF_BOUNDS:new Be.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${c}`,v)}const dn=/[^+/0-9A-Za-z-_]/g;function yn(v){if(v=v.split("=")[0],v=v.trim().replace(dn,""),v.length<2)return"";for(;v.length%4!==0;)v=v+"=";return v}function ea(v,c){c=c||1/0;let h;const E=v.length;let B=null;const N=[];for(let L=0;L<E;++L){if(h=v.charCodeAt(L),h>55295&&h<57344){if(!B){if(h>56319){(c-=3)>-1&&N.push(239,191,189);continue}else if(L+1===E){(c-=3)>-1&&N.push(239,191,189);continue}B=h;continue}if(h<56320){(c-=3)>-1&&N.push(239,191,189),B=h;continue}h=(B-55296<<10|h-56320)+65536}else B&&(c-=3)>-1&&N.push(239,191,189);if(B=null,h<128){if((c-=1)<0)break;N.push(h)}else if(h<2048){if((c-=2)<0)break;N.push(h>>6|192,h&63|128)}else if(h<65536){if((c-=3)<0)break;N.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((c-=4)<0)break;N.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return N}function gn(v){const c=[];for(let h=0;h<v.length;++h)c.push(v.charCodeAt(h)&255);return c}function vn(v,c){let h,E,B;const N=[];for(let L=0;L<v.length&&!((c-=2)<0);++L)h=v.charCodeAt(L),E=h>>8,B=h%256,N.push(B),N.push(E);return N}function za(v){return t.toByteArray(yn(v))}function Br(v,c,h,E){let B;for(B=0;B<E&&!(B+h>=c.length||B>=v.length);++B)c[B+h]=v[B];return B}function vt(v,c){return v instanceof c||v!=null&&v.constructor!=null&&v.constructor.name!=null&&v.constructor.name===c.name}function ta(v){return v!==v}const mn=function(){const v="0123456789abcdef",c=new Array(256);for(let h=0;h<16;++h){const E=h*16;for(let B=0;B<16;++B)c[E+B]=v[h]+v[B]}return c}();function Lt(v){return typeof BigInt>"u"?Cn:v}function Cn(){throw new Error("BigInt not supported")}})(Ei);const pt=Ei.Buffer;var ba={},Ln=ba,Ya={};ba.encode=function(e,t,a){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(a!==void 0&&typeof a!="number")throw new TypeError('"maxline" must be a number.');var r="";if(!(e instanceof Uint8Array))r=Un(e,t);else{var i=0,s=t.length,n=t.charAt(0),o=[0];for(i=0;i<e.length;++i){for(var l=0,f=e[i];l<o.length;++l)f+=o[l]<<8,o[l]=f%s,f=f/s|0;for(;f>0;)o.push(f%s),f=f/s|0}for(i=0;e[i]===0&&i<e.length-1;++i)r+=n;for(i=o.length-1;i>=0;--i)r+=t[o[i]]}if(a){var u=new RegExp(".{1,"+a+"}","g");r=r.match(u).join(`\r
7
+ `)}return r};ba.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var a=Ya[t];if(!a){a=Ya[t]=[];for(var r=0;r<t.length;++r)a[t.charCodeAt(r)]=r}e=e.replace(/\s/g,"");for(var i=t.length,s=t.charAt(0),n=[0],r=0;r<e.length;r++){var o=a[e.charCodeAt(r)];if(o===void 0)return;for(var l=0,f=o;l<n.length;++l)f+=n[l]*i,n[l]=f&255,f>>=8;for(;f>0;)n.push(f&255),f>>=8}for(var u=0;e[u]===s&&u<e.length-1;++u)n.push(0);return typeof pt<"u"?pt.from(n.reverse()):new Uint8Array(n.reverse())};function Un(e,t){var a=0,r=t.length,i=t.charAt(0),s=[0];for(a=0;a<e.length();++a){for(var n=0,o=e.at(a);n<s.length;++n)o+=s[n]<<8,s[n]=o%r,o=o/r|0;for(;o>0;)s.push(o%r),o=o/r|0}var l="";for(a=0;e.at(a)===0&&a<e.length()-1;++a)l+=i;for(a=s.length-1;a>=0;--a)l+=t[s[a]];return l}var Xa=ee,Wa=Ln,I=Xa.util=Xa.util||{};(function(){if(typeof kt.p<"u"&&kt.p.nextTick&&!kt.p.browser){I.nextTick=kt.p.nextTick,typeof setImmediate=="function"?I.setImmediate=setImmediate:I.setImmediate=I.nextTick;return}if(typeof setImmediate=="function"){I.setImmediate=function(){return setImmediate.apply(void 0,arguments)},I.nextTick=function(n){return setImmediate(n)};return}if(I.setImmediate=function(n){setTimeout(n,0)},typeof window<"u"&&typeof window.postMessage=="function"){let n=function(o){if(o.source===window&&o.data===e){o.stopPropagation();var l=t.slice();t.length=0,l.forEach(function(f){f()})}};var e="forge.setImmediate",t=[];I.setImmediate=function(o){t.push(o),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",n,!0)}if(typeof MutationObserver<"u"){var a=Date.now(),r=!0,i=document.createElement("div"),t=[];new MutationObserver(function(){var o=t.slice();t.length=0,o.forEach(function(l){l()})}).observe(i,{attributes:!0});var s=I.setImmediate;I.setImmediate=function(o){Date.now()-a>15?(a=Date.now(),s(o)):(t.push(o),t.length===1&&i.setAttribute("a",r=!r))}}I.nextTick=I.setImmediate})();I.isNodejs=typeof kt.p<"u"&&kt.p.versions&&kt.p.versions.node;I.globalScope=function(){return I.isNodejs?xn:typeof self>"u"?window:self}();I.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};I.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer};I.isArrayBufferView=function(e){return e&&I.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function Sr(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}I.ByteBuffer=_a;function _a(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(I.isArrayBuffer(e)||I.isArrayBufferView(e))if(typeof pt<"u"&&e instanceof pt)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var a=0;a<t.length;++a)this.putByte(t[a])}}else(e instanceof _a||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}I.ByteStringBuffer=_a;var Dn=4096;I.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>Dn&&(this.data.substr(0,1),this._constructedStringLength=0)};I.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};I.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};I.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))};I.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var a=this.data;t>0;)t&1&&(a+=e),t>>>=1,t>0&&(e+=e);return this.data=a,this._optimizeConstructedString(t),this};I.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this};I.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(I.encodeUtf8(e))};I.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};I.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};I.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};I.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))};I.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))};I.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))};I.ByteStringBuffer.prototype.putInt=function(e,t){Sr(t);var a="";do t-=8,a+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(a)};I.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)};I.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())};I.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};I.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e};I.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e};I.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e};I.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e};I.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e};I.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e};I.ByteStringBuffer.prototype.getInt=function(e){Sr(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t};I.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),a=2<<e-2;return t>=a&&(t-=a<<1),t};I.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};I.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};I.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)};I.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this};I.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};I.ByteStringBuffer.prototype.copy=function(){var e=I.createBuffer(this.data);return e.read=this.read,e};I.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};I.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};I.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this};I.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var a=this.data.charCodeAt(t);a<16&&(e+="0"),e+=a.toString(16)}return e};I.ByteStringBuffer.prototype.toString=function(){return I.decodeUtf8(this.bytes())};function kn(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var a=I.isArrayBuffer(e),r=I.isArrayBufferView(e);if(a||r){a?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}I.DataBuffer=kn;I.DataBuffer.prototype.length=function(){return this.write-this.read};I.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};I.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var a=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+t);return r.set(a),this.data=new DataView(r.buffer),this};I.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this};I.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var a=0;a<t;++a)this.data.setUint8(e);return this};I.DataBuffer.prototype.putBytes=function(e,t){if(I.isArrayBufferView(e)){var a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=a.byteLength-a.byteOffset;this.accommodate(r);var i=new Uint8Array(this.data.buffer,this.write);return i.set(a),this.write+=r,this}if(I.isArrayBuffer(e)){var a=new Uint8Array(e);this.accommodate(a.byteLength);var i=new Uint8Array(this.data.buffer);return i.set(a,this.write),this.write+=a.byteLength,this}if(e instanceof I.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&I.isArrayBufferView(e.data)){var a=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(a.byteLength);var i=new Uint8Array(e.data.byteLength,this.write);return i.set(a),this.write+=a.byteLength,this}if(e instanceof I.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var s;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),s=new Uint8Array(this.data.buffer,this.write),this.write+=I.binary.hex.decode(e,s,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),s=new Uint8Array(this.data.buffer,this.write),this.write+=I.binary.base64.decode(e,s,this.write),this;if(t==="utf8"&&(e=I.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),s=new Uint8Array(this.data.buffer,this.write),this.write+=I.binary.raw.decode(s),this;if(t==="utf16")return this.accommodate(e.length*2),s=new Uint16Array(this.data.buffer,this.write),this.write+=I.text.utf16.encode(s),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)};I.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this};I.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")};I.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this};I.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this};I.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this};I.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this};I.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this};I.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this};I.DataBuffer.prototype.putInt=function(e,t){Sr(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this};I.DataBuffer.prototype.putSignedInt=function(e,t){return Sr(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)};I.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};I.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e};I.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e};I.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e};I.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e};I.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e};I.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e};I.DataBuffer.prototype.getInt=function(e){Sr(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t};I.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),a=2<<e-2;return t>=a&&(t-=a<<1),t};I.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};I.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};I.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)};I.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this};I.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};I.DataBuffer.prototype.copy=function(){return new I.DataBuffer(this)};I.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this};I.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};I.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this};I.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var a=this.data.getUint8(t);a<16&&(e+="0"),e+=a.toString(16)}return e};I.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return I.binary.raw.encode(t);if(e==="hex")return I.binary.hex.encode(t);if(e==="base64")return I.binary.base64.encode(t);if(e==="utf8")return I.text.utf8.decode(t);if(e==="utf16")return I.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)};I.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=I.encodeUtf8(e)),new I.ByteBuffer(e)};I.fillString=function(e,t){for(var a="";t>0;)t&1&&(a+=e),t>>>=1,t>0&&(e+=e);return a};I.xorBytes=function(e,t,a){for(var r="",i="",s="",n=0,o=0;a>0;--a,++n)i=e.charCodeAt(n)^t.charCodeAt(n),o>=10&&(r+=s,s="",o=0),s+=String.fromCharCode(i),++o;return r+=s,r};I.hexToBytes=function(e){var t="",a=0;for(e.length&!0&&(a=1,t+=String.fromCharCode(parseInt(e[0],16)));a<e.length;a+=2)t+=String.fromCharCode(parseInt(e.substr(a,2),16));return t};I.bytesToHex=function(e){return I.createBuffer(e).toHex()};I.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var Pt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Vt=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],Si="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";I.encode64=function(e,t){for(var a="",r="",i,s,n,o=0;o<e.length;)i=e.charCodeAt(o++),s=e.charCodeAt(o++),n=e.charCodeAt(o++),a+=Pt.charAt(i>>2),a+=Pt.charAt((i&3)<<4|s>>4),isNaN(s)?a+="==":(a+=Pt.charAt((s&15)<<2|n>>6),a+=isNaN(n)?"=":Pt.charAt(n&63)),t&&a.length>t&&(r+=a.substr(0,t)+`\r
8
+ `,a=a.substr(t));return r+=a,r};I.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",a,r,i,s,n=0;n<e.length;)a=Vt[e.charCodeAt(n++)-43],r=Vt[e.charCodeAt(n++)-43],i=Vt[e.charCodeAt(n++)-43],s=Vt[e.charCodeAt(n++)-43],t+=String.fromCharCode(a<<2|r>>4),i!==64&&(t+=String.fromCharCode((r&15)<<4|i>>2),s!==64&&(t+=String.fromCharCode((i&3)<<6|s)));return t};I.encodeUtf8=function(e){return unescape(encodeURIComponent(e))};I.decodeUtf8=function(e){return decodeURIComponent(escape(e))};I.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:Wa.encode,decode:Wa.decode}};I.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)};I.binary.raw.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(e.length)),a=a||0;for(var i=a,s=0;s<e.length;++s)r[i++]=e.charCodeAt(s);return t?i-a:r};I.binary.hex.encode=I.bytesToHex;I.binary.hex.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/2))),a=a||0;var i=0,s=a;for(e.length&1&&(i=1,r[s++]=parseInt(e[0],16));i<e.length;i+=2)r[s++]=parseInt(e.substr(i,2),16);return t?s-a:r};I.binary.base64.encode=function(e,t){for(var a="",r="",i,s,n,o=0;o<e.byteLength;)i=e[o++],s=e[o++],n=e[o++],a+=Pt.charAt(i>>2),a+=Pt.charAt((i&3)<<4|s>>4),isNaN(s)?a+="==":(a+=Pt.charAt((s&15)<<2|n>>6),a+=isNaN(n)?"=":Pt.charAt(n&63)),t&&a.length>t&&(r+=a.substr(0,t)+`\r
9
+ `,a=a.substr(t));return r+=a,r};I.binary.base64.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),a=a||0;for(var i,s,n,o,l=0,f=a;l<e.length;)i=Vt[e.charCodeAt(l++)-43],s=Vt[e.charCodeAt(l++)-43],n=Vt[e.charCodeAt(l++)-43],o=Vt[e.charCodeAt(l++)-43],r[f++]=i<<2|s>>4,n!==64&&(r[f++]=(s&15)<<4|n>>2,o!==64&&(r[f++]=(n&3)<<6|o));return t?f-a:r.subarray(0,f)};I.binary.base58.encode=function(e,t){return I.binary.baseN.encode(e,Si,t)};I.binary.base58.decode=function(e,t){return I.binary.baseN.decode(e,Si,t)};I.text={utf8:{},utf16:{}};I.text.utf8.encode=function(e,t,a){e=I.encodeUtf8(e);var r=t;r||(r=new Uint8Array(e.length)),a=a||0;for(var i=a,s=0;s<e.length;++s)r[i++]=e.charCodeAt(s);return t?i-a:r};I.text.utf8.decode=function(e){return I.decodeUtf8(String.fromCharCode.apply(null,e))};I.text.utf16.encode=function(e,t,a){var r=t;r||(r=new Uint8Array(e.length*2));var i=new Uint16Array(r.buffer);a=a||0;for(var s=a,n=a,o=0;o<e.length;++o)i[n++]=e.charCodeAt(o),s+=2;return t?s-a:r};I.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};I.deflate=function(e,t,a){if(t=I.decode64(e.deflate(I.encode64(t)).rval),a){var r=2,i=t.charCodeAt(1);i&32&&(r=6),t=t.substring(r,t.length-4)}return t};I.inflate=function(e,t,a){var r=e.inflate(I.encode64(t)).rval;return r===null?null:I.decode64(r)};var wa=function(e,t,a){if(!e)throw new Error("WebStorage not available.");var r;if(a===null?r=e.removeItem(t):(a=I.encode64(JSON.stringify(a)),r=e.setItem(t,a)),typeof r<"u"&&r.rval!==!0){var i=new Error(r.error.message);throw i.id=r.error.id,i.name=r.error.name,i}},Na=function(e,t){if(!e)throw new Error("WebStorage not available.");var a=e.getItem(t);if(e.init)if(a.rval===null){if(a.error){var r=new Error(a.error.message);throw r.id=a.error.id,r.name=a.error.name,r}a=null}else a=a.rval;return a!==null&&(a=JSON.parse(I.decode64(a))),a},Pn=function(e,t,a,r){var i=Na(e,t);i===null&&(i={}),i[a]=r,wa(e,t,i)},Vn=function(e,t,a){var r=Na(e,t);return r!==null&&(r=a in r?r[a]:null),r},Fn=function(e,t,a){var r=Na(e,t);if(r!==null&&a in r){delete r[a];var i=!0;for(var s in r){i=!1;break}i&&(r=null),wa(e,t,r)}},On=function(e,t){wa(e,t,null)},qr=function(e,t,a){var r=null;typeof a>"u"&&(a=["web","flash"]);var i,s=!1,n=null;for(var o in a){i=a[o];try{if(i==="flash"||i==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");r=e.apply(this,t),s=i==="flash"}(i==="web"||i==="both")&&(t[0]=localStorage,r=e.apply(this,t),s=!0)}catch(l){n=l}if(s)break}if(!s)throw n;return r};I.setItem=function(e,t,a,r,i){qr(Pn,arguments,i)};I.getItem=function(e,t,a,r){return qr(Vn,arguments,r)};I.removeItem=function(e,t,a,r){qr(Fn,arguments,r)};I.clearItems=function(e,t,a){qr(On,arguments,a)};I.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0};I.format=function(e){for(var t=/%./g,a,r,i=0,s=[],n=0;a=t.exec(e);){r=e.substring(n,t.lastIndex-2),r.length>0&&s.push(r),n=t.lastIndex;var o=a[0][1];switch(o){case"s":case"o":i<arguments.length?s.push(arguments[i+++1]):s.push("<?>");break;case"%":s.push("%");break;default:s.push("<%"+o+"?>")}}return s.push(e.substring(n)),s.join("")};I.formatNumber=function(e,t,a,r){var i=e,s=isNaN(t=Math.abs(t))?2:t,n=a===void 0?",":a,o=r===void 0?".":r,l=i<0?"-":"",f=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",u=f.length>3?f.length%3:0;return l+(u?f.substr(0,u)+o:"")+f.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+o)+(s?n+Math.abs(i-f).toFixed(s).slice(2):"")};I.formatSize=function(e){return e>=1073741824?e=I.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=I.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=I.formatNumber(e/1024,0)+" KiB":e=I.formatNumber(e,0)+" bytes",e};I.bytesFromIP=function(e){return e.indexOf(".")!==-1?I.bytesFromIPv4(e):e.indexOf(":")!==-1?I.bytesFromIPv6(e):null};I.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=I.createBuffer(),a=0;a<e.length;++a){var r=parseInt(e[a],10);if(isNaN(r))return null;t.putByte(r)}return t.getBytes()};I.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(n){return n.length===0&&++t,!0});for(var a=(8-e.length+t)*2,r=I.createBuffer(),i=0;i<8;++i){if(!e[i]||e[i].length===0){r.fillWithByte(0,a),a=0;continue}var s=I.hexToBytes(e[i]);s.length<2&&r.putByte(0),r.putBytes(s)}return r.getBytes()};I.bytesToIP=function(e){return e.length===4?I.bytesToIPv4(e):e.length===16?I.bytesToIPv6(e):null};I.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],a=0;a<e.length;++a)t.push(e.charCodeAt(a));return t.join(".")};I.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],a=[],r=0,i=0;i<e.length;i+=2){for(var s=I.bytesToHex(e[i]+e[i+1]);s[0]==="0"&&s!=="0";)s=s.substr(1);if(s==="0"){var n=a[a.length-1],o=t.length;!n||o!==n.end+1?a.push({start:o,end:o}):(n.end=o,n.end-n.start>a[r].end-a[r].start&&(r=a.length-1))}t.push(s)}if(a.length>0){var l=a[r];l.end-l.start>0&&(t.splice(l.start,l.end-l.start+1,""),l.start===0&&t.unshift(""),l.end===7&&t.push(""))}return t.join(":")};I.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in I&&!e.update)return t(null,I.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return I.cores=navigator.hardwareConcurrency,t(null,I.cores);if(typeof Worker>"u")return I.cores=1,t(null,I.cores);if(typeof Blob>"u")return I.cores=2,t(null,I.cores);var a=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(n){var o=Date.now(),l=o+4;self.postMessage({st:o,et:l})})}.toString(),")()"],{type:"application/javascript"}));r([],5,16);function r(n,o,l){if(o===0){var f=Math.floor(n.reduce(function(u,p){return u+p},0)/n.length);return I.cores=Math.max(1,f),URL.revokeObjectURL(a),t(null,I.cores)}i(l,function(u,p){n.push(s(l,p)),r(n,o-1,l)})}function i(n,o){for(var l=[],f=[],u=0;u<n;++u){var p=new Worker(a);p.addEventListener("message",function(m){if(f.push(m.data),f.length===n){for(var S=0;S<n;++S)l[S].terminate();o(null,f)}}),l.push(p)}for(var u=0;u<n;++u)l[u].postMessage(u)}function s(n,o){for(var l=[],f=0;f<n;++f)for(var u=o[f],p=l[f]=[],m=0;m<n;++m)if(f!==m){var S=o[m];(u.st>S.st&&u.st<S.et||S.st>u.st&&S.st<u.et)&&p.push(m)}return l.reduce(function(C,A){return Math.max(C,A.length)},0)}};var Ye=ee;Ye.cipher=Ye.cipher||{};Ye.cipher.algorithms=Ye.cipher.algorithms||{};Ye.cipher.createCipher=function(e,t){var a=e;if(typeof a=="string"&&(a=Ye.cipher.getAlgorithm(a),a&&(a=a())),!a)throw new Error("Unsupported algorithm: "+e);return new Ye.cipher.BlockCipher({algorithm:a,key:t,decrypt:!1})};Ye.cipher.createDecipher=function(e,t){var a=e;if(typeof a=="string"&&(a=Ye.cipher.getAlgorithm(a),a&&(a=a())),!a)throw new Error("Unsupported algorithm: "+e);return new Ye.cipher.BlockCipher({algorithm:a,key:t,decrypt:!0})};Ye.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),Ye.cipher.algorithms[e]=t};Ye.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in Ye.cipher.algorithms?Ye.cipher.algorithms[e]:null};var Ra=Ye.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};Ra.prototype.start=function(e){e=e||{};var t={};for(var a in e)t[a]=e[a];t.decrypt=this._decrypt,this._finish=!1,this._input=Ye.util.createBuffer(),this.output=e.output||Ye.util.createBuffer(),this.mode.start(t)};Ra.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Ra.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(a){return e(this.blockSize,a,!1)},this.mode.unpad=function(a){return e(this.blockSize,a,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t))};var ze=ee;ze.cipher=ze.cipher||{};var ie=ze.cipher.modes=ze.cipher.modes||{};ie.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};ie.ecb.prototype.start=function(e){};ie.ecb.prototype.encrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])};ie.ecb.prototype.decrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])};ie.ecb.prototype.pad=function(e,t){var a=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(a,a),!0};ie.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var a=e.length(),r=e.at(a-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)};ie.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};ie.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=Qr(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};ie.cbc.prototype.encrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r]);this._prev=this._outBlock};ie.cbc.prototype.decrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)};ie.cbc.prototype.pad=function(e,t){var a=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(a,a),!0};ie.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var a=e.length(),r=e.at(a-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)};ie.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=ze.util.createBuffer(),this._partialBytes=0};ie.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Qr(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};ie.cfb.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);return}var s=(this.blockSize-r)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(s>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!a)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};ie.cfb.prototype.decrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);return}var s=(this.blockSize-r)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(s>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!a)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};ie.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=ze.util.createBuffer(),this._partialBytes=0};ie.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Qr(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};ie.ofb.prototype.encrypt=function(e,t,a){var r=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];return}var s=(this.blockSize-r)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(s>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!a)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};ie.ofb.prototype.decrypt=ie.ofb.prototype.encrypt;ie.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=ze.util.createBuffer(),this._partialBytes=0};ie.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Qr(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};ie.ctr.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var s=(this.blockSize-r)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(s>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!a)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}zr(this._inBlock)};ie.ctr.prototype.decrypt=ie.ctr.prototype.encrypt;ie.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=ze.util.createBuffer(),this._partialBytes=0,this._R=3774873600};ie.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=ze.util.createBuffer(e.iv);this._cipherLength=0;var a;if("additionalData"in e?a=ze.util.createBuffer(e.additionalData):a=ze.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=ze.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var r=t.length();if(r===12)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(ua(r*8)))}this._inBlock=this._j0.slice(0),zr(this._inBlock),this._partialBytes=0,a=ze.util.createBuffer(a),this._aDataLength=ua(a.length()*8);var i=a.length()%this.blockSize;for(i&&a.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];a.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[a.getInt32(),a.getInt32(),a.getInt32(),a.getInt32()])};ie.gcm.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var s=(this.blockSize-r)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(s<=0||a){if(a){var n=r%this.blockSize;this._cipherLength+=n,this._partialOutput.truncate(this.blockSize-n)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!a)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),zr(this._inBlock)};ie.gcm.prototype.decrypt=function(e,t,a){var r=e.length();if(r<this.blockSize&&!(a&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),zr(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize};ie.gcm.prototype.afterFinish=function(e,t){var a=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=ze.util.createBuffer();var r=this._aDataLength.concat(ua(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,r);var i=[];this.cipher.encrypt(this._j0,i);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^i[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(a=!1),a};ie.gcm.prototype.multiply=function(e,t){for(var a=[0,0,0,0],r=t.slice(0),i=0;i<128;++i){var s=e[i/32|0]&1<<31-i%32;s&&(a[0]^=r[0],a[1]^=r[1],a[2]^=r[2],a[3]^=r[3]),this.pow(r,r)}return a};ie.gcm.prototype.pow=function(e,t){for(var a=e[3]&1,r=3;r>0;--r)t[r]=e[r]>>>1|(e[r-1]&1)<<31;t[0]=e[0]>>>1,a&&(t[0]^=this._R)};ie.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],a=0;a<32;++a){var r=a/8|0,i=e[r]>>>(7-a%8)*4&15,s=this._m[a][i];t[0]^=s[0],t[1]^=s[1],t[2]^=s[2],t[3]^=s[3]}return t};ie.gcm.prototype.ghash=function(e,t,a){return t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3],this.tableMultiply(t)};ie.gcm.prototype.generateHashTable=function(e,t){for(var a=8/t,r=4*a,i=16*a,s=new Array(i),n=0;n<i;++n){var o=[0,0,0,0],l=n/r|0,f=(r-1-n%r)*t;o[l]=1<<t-1<<f,s[n]=this.generateSubHashTable(this.multiply(o,e),t)}return s};ie.gcm.prototype.generateSubHashTable=function(e,t){var a=1<<t,r=a>>>1,i=new Array(a);i[r]=e.slice(0);for(var s=r>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s<r;){for(var n=1;n<s;++n){var o=i[s],l=i[n];i[s+n]=[o[0]^l[0],o[1]^l[1],o[2]^l[2],o[3]^l[3]]}s*=2}for(i[0]=[0,0,0,0],s=r+1;s<a;++s){var f=i[s^r];i[s]=[e[0]^f[0],e[1]^f[1],e[2]^f[2],e[3]^f[3]]}return i};function Qr(e,t){if(typeof e=="string"&&(e=ze.util.createBuffer(e)),ze.util.isArray(e)&&e.length>4){var a=e;e=ze.util.createBuffer();for(var r=0;r<a.length;++r)e.putByte(a[r])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!ze.util.isArray(e)){for(var i=[],s=t/4,r=0;r<s;++r)i.push(e.getInt32());e=i}return e}function zr(e){e[e.length-1]=e[e.length-1]+1&4294967295}function ua(e){return[e/4294967296|0,e&4294967295]}var Ce=ee;Ce.aes=Ce.aes||{};Ce.aes.startEncrypting=function(e,t,a,r){var i=Yr({key:e,output:a,decrypt:!1,mode:r});return i.start(t),i};Ce.aes.createEncryptionCipher=function(e,t){return Yr({key:e,output:null,decrypt:!1,mode:t})};Ce.aes.startDecrypting=function(e,t,a,r){var i=Yr({key:e,output:a,decrypt:!0,mode:r});return i.start(t),i};Ce.aes.createDecryptionCipher=function(e,t){return Yr({key:e,output:null,decrypt:!0,mode:t})};Ce.aes.Algorithm=function(e,t){La||Ii();var a=this;a.name=e,a.mode=new t({blockSize:16,cipher:{encrypt:function(r,i){return la(a._w,r,i,!1)},decrypt:function(r,i){return la(a._w,r,i,!0)}}}),a._init=!1};Ce.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,a;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=Ce.util.createBuffer(t);else if(Ce.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){a=t,t=Ce.util.createBuffer();for(var r=0;r<a.length;++r)t.putByte(a[r])}if(!Ce.util.isArray(t)){a=t,t=[];var i=a.length();if(i===16||i===24||i===32){i=i>>>2;for(var r=0;r<i;++r)t.push(a.getInt32())}}if(!Ce.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var s=this.mode.name,n=["CFB","OFB","CTR","GCM"].indexOf(s)!==-1;this._w=Bi(t,e.decrypt&&!n),this._init=!0}};Ce.aes._expandKey=function(e,t){return La||Ii(),Bi(e,t)};Ce.aes._updateBlock=la;ur("AES-ECB",Ce.cipher.modes.ecb);ur("AES-CBC",Ce.cipher.modes.cbc);ur("AES-CFB",Ce.cipher.modes.cfb);ur("AES-OFB",Ce.cipher.modes.ofb);ur("AES-CTR",Ce.cipher.modes.ctr);ur("AES-GCM",Ce.cipher.modes.gcm);function ur(e,t){var a=function(){return new Ce.aes.Algorithm(e,t)};Ce.cipher.registerAlgorithm(e,a)}var La=!1,er=4,Ze,fa,Ti,Xt,yt;function Ii(){La=!0,Ti=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;Ze=new Array(256),fa=new Array(256),Xt=new Array(4),yt=new Array(4);for(var t=0;t<4;++t)Xt[t]=new Array(256),yt[t]=new Array(256);for(var a=0,r=0,i,s,n,o,l,f,u,t=0;t<256;++t){o=r^r<<1^r<<2^r<<3^r<<4,o=o>>8^o&255^99,Ze[a]=o,fa[o]=a,l=e[o],i=e[a],s=e[i],n=e[s],f=l<<24^o<<16^o<<8^(o^l),u=(i^s^n)<<24^(a^n)<<16^(a^s^n)<<8^(a^i^n);for(var p=0;p<4;++p)Xt[p][a]=f,yt[p][o]=u,f=f<<24|f>>>8,u=u<<24|u>>>8;a===0?a=r=1:(a=i^e[e[e[i^n]]],r^=e[e[r]])}}function Bi(e,t){for(var a=e.slice(0),r,i=1,s=a.length,n=s+6+1,o=er*n,l=s;l<o;++l)r=a[l-1],l%s===0?(r=Ze[r>>>16&255]<<24^Ze[r>>>8&255]<<16^Ze[r&255]<<8^Ze[r>>>24]^Ti[i]<<24,i++):s>6&&l%s===4&&(r=Ze[r>>>24]<<24^Ze[r>>>16&255]<<16^Ze[r>>>8&255]<<8^Ze[r&255]),a[l]=a[l-s]^r;if(t){var f,u=yt[0],p=yt[1],m=yt[2],S=yt[3],C=a.slice(0);o=a.length;for(var l=0,A=o-er;l<o;l+=er,A-=er)if(l===0||l===o-er)C[l]=a[A],C[l+1]=a[A+3],C[l+2]=a[A+2],C[l+3]=a[A+1];else for(var b=0;b<er;++b)f=a[A+b],C[l+(3&-b)]=u[Ze[f>>>24]]^p[Ze[f>>>16&255]]^m[Ze[f>>>8&255]]^S[Ze[f&255]];a=C}return a}function la(e,t,a,r){var i=e.length/4-1,s,n,o,l,f;r?(s=yt[0],n=yt[1],o=yt[2],l=yt[3],f=fa):(s=Xt[0],n=Xt[1],o=Xt[2],l=Xt[3],f=Ze);var u,p,m,S,C,A,b;u=t[0]^e[0],p=t[r?3:1]^e[1],m=t[2]^e[2],S=t[r?1:3]^e[3];for(var w=3,U=1;U<i;++U)C=s[u>>>24]^n[p>>>16&255]^o[m>>>8&255]^l[S&255]^e[++w],A=s[p>>>24]^n[m>>>16&255]^o[S>>>8&255]^l[u&255]^e[++w],b=s[m>>>24]^n[S>>>16&255]^o[u>>>8&255]^l[p&255]^e[++w],S=s[S>>>24]^n[u>>>16&255]^o[p>>>8&255]^l[m&255]^e[++w],u=C,p=A,m=b;a[0]=f[u>>>24]<<24^f[p>>>16&255]<<16^f[m>>>8&255]<<8^f[S&255]^e[++w],a[r?3:1]=f[p>>>24]<<24^f[m>>>16&255]<<16^f[S>>>8&255]<<8^f[u&255]^e[++w],a[2]=f[m>>>24]<<24^f[S>>>16&255]<<16^f[u>>>8&255]<<8^f[p&255]^e[++w],a[r?1:3]=f[S>>>24]<<24^f[u>>>16&255]<<16^f[p>>>8&255]<<8^f[m&255]^e[++w]}function Yr(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),a="AES-"+t,r;e.decrypt?r=Ce.cipher.createDecipher(a,e.key):r=Ce.cipher.createCipher(a,e.key);var i=r.start;return r.start=function(s,n){var o=null;n instanceof Ce.util.ByteBuffer&&(o=n,n={}),n=n||{},n.output=o,n.iv=s,i.call(r,n)},r}var vr=ee;vr.pki=vr.pki||{};var ca=vr.pki.oids=vr.oids=vr.oids||{};function V(e,t){ca[e]=t,ca[t]=e}function pe(e,t){ca[e]=t}V("1.2.840.113549.1.1.1","rsaEncryption");V("1.2.840.113549.1.1.4","md5WithRSAEncryption");V("1.2.840.113549.1.1.5","sha1WithRSAEncryption");V("1.2.840.113549.1.1.7","RSAES-OAEP");V("1.2.840.113549.1.1.8","mgf1");V("1.2.840.113549.1.1.9","pSpecified");V("1.2.840.113549.1.1.10","RSASSA-PSS");V("1.2.840.113549.1.1.11","sha256WithRSAEncryption");V("1.2.840.113549.1.1.12","sha384WithRSAEncryption");V("1.2.840.113549.1.1.13","sha512WithRSAEncryption");V("1.3.101.112","EdDSA25519");V("1.2.840.10040.4.3","dsa-with-sha1");V("1.3.14.3.2.7","desCBC");V("1.3.14.3.2.26","sha1");V("1.3.14.3.2.29","sha1WithRSASignature");V("2.16.840.1.101.3.4.2.1","sha256");V("2.16.840.1.101.3.4.2.2","sha384");V("2.16.840.1.101.3.4.2.3","sha512");V("2.16.840.1.101.3.4.2.4","sha224");V("2.16.840.1.101.3.4.2.5","sha512-224");V("2.16.840.1.101.3.4.2.6","sha512-256");V("1.2.840.113549.2.2","md2");V("1.2.840.113549.2.5","md5");V("1.2.840.113549.1.7.1","data");V("1.2.840.113549.1.7.2","signedData");V("1.2.840.113549.1.7.3","envelopedData");V("1.2.840.113549.1.7.4","signedAndEnvelopedData");V("1.2.840.113549.1.7.5","digestedData");V("1.2.840.113549.1.7.6","encryptedData");V("1.2.840.113549.1.9.1","emailAddress");V("1.2.840.113549.1.9.2","unstructuredName");V("1.2.840.113549.1.9.3","contentType");V("1.2.840.113549.1.9.4","messageDigest");V("1.2.840.113549.1.9.5","signingTime");V("1.2.840.113549.1.9.6","counterSignature");V("1.2.840.113549.1.9.7","challengePassword");V("1.2.840.113549.1.9.8","unstructuredAddress");V("1.2.840.113549.1.9.14","extensionRequest");V("1.2.840.113549.1.9.20","friendlyName");V("1.2.840.113549.1.9.21","localKeyId");V("1.2.840.113549.1.9.22.1","x509Certificate");V("1.2.840.113549.1.12.10.1.1","keyBag");V("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");V("1.2.840.113549.1.12.10.1.3","certBag");V("1.2.840.113549.1.12.10.1.4","crlBag");V("1.2.840.113549.1.12.10.1.5","secretBag");V("1.2.840.113549.1.12.10.1.6","safeContentsBag");V("1.2.840.113549.1.5.13","pkcs5PBES2");V("1.2.840.113549.1.5.12","pkcs5PBKDF2");V("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");V("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");V("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");V("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");V("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");V("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");V("1.2.840.113549.2.7","hmacWithSHA1");V("1.2.840.113549.2.8","hmacWithSHA224");V("1.2.840.113549.2.9","hmacWithSHA256");V("1.2.840.113549.2.10","hmacWithSHA384");V("1.2.840.113549.2.11","hmacWithSHA512");V("1.2.840.113549.3.7","des-EDE3-CBC");V("2.16.840.1.101.3.4.1.2","aes128-CBC");V("2.16.840.1.101.3.4.1.22","aes192-CBC");V("2.16.840.1.101.3.4.1.42","aes256-CBC");V("2.5.4.3","commonName");V("2.5.4.4","surname");V("2.5.4.5","serialNumber");V("2.5.4.6","countryName");V("2.5.4.7","localityName");V("2.5.4.8","stateOrProvinceName");V("2.5.4.9","streetAddress");V("2.5.4.10","organizationName");V("2.5.4.11","organizationalUnitName");V("2.5.4.12","title");V("2.5.4.13","description");V("2.5.4.15","businessCategory");V("2.5.4.17","postalCode");V("2.5.4.42","givenName");V("2.5.4.65","pseudonym");V("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");V("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");V("2.16.840.1.113730.1.1","nsCertType");V("2.16.840.1.113730.1.13","nsComment");pe("2.5.29.1","authorityKeyIdentifier");pe("2.5.29.2","keyAttributes");pe("2.5.29.3","certificatePolicies");pe("2.5.29.4","keyUsageRestriction");pe("2.5.29.5","policyMapping");pe("2.5.29.6","subtreesConstraint");pe("2.5.29.7","subjectAltName");pe("2.5.29.8","issuerAltName");pe("2.5.29.9","subjectDirectoryAttributes");pe("2.5.29.10","basicConstraints");pe("2.5.29.11","nameConstraints");pe("2.5.29.12","policyConstraints");pe("2.5.29.13","basicConstraints");V("2.5.29.14","subjectKeyIdentifier");V("2.5.29.15","keyUsage");pe("2.5.29.16","privateKeyUsagePeriod");V("2.5.29.17","subjectAltName");V("2.5.29.18","issuerAltName");V("2.5.29.19","basicConstraints");pe("2.5.29.20","cRLNumber");pe("2.5.29.21","cRLReason");pe("2.5.29.22","expirationDate");pe("2.5.29.23","instructionCode");pe("2.5.29.24","invalidityDate");pe("2.5.29.25","cRLDistributionPoints");pe("2.5.29.26","issuingDistributionPoint");pe("2.5.29.27","deltaCRLIndicator");pe("2.5.29.28","issuingDistributionPoint");pe("2.5.29.29","certificateIssuer");pe("2.5.29.30","nameConstraints");V("2.5.29.31","cRLDistributionPoints");V("2.5.29.32","certificatePolicies");pe("2.5.29.33","policyMappings");pe("2.5.29.34","policyConstraints");V("2.5.29.35","authorityKeyIdentifier");pe("2.5.29.36","policyConstraints");V("2.5.29.37","extKeyUsage");pe("2.5.29.46","freshestCRL");pe("2.5.29.54","inhibitAnyPolicy");V("1.3.6.1.4.1.11129.2.4.2","timestampList");V("1.3.6.1.5.5.7.1.1","authorityInfoAccess");V("1.3.6.1.5.5.7.3.1","serverAuth");V("1.3.6.1.5.5.7.3.2","clientAuth");V("1.3.6.1.5.5.7.3.3","codeSigning");V("1.3.6.1.5.5.7.3.4","emailProtection");V("1.3.6.1.5.5.7.3.8","timeStamping");var xe=ee,H=xe.asn1=xe.asn1||{};H.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};H.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};H.maxDepth=256;H.create=function(e,t,a,r,i){if(xe.util.isArray(r)){for(var s=[],n=0;n<r.length;++n)r[n]!==void 0&&s.push(r[n]);r=s}var o={tagClass:e,type:t,constructed:a,composed:a||xe.util.isArray(r),value:r};return i&&"bitStringContents"in i&&(o.bitStringContents=i.bitStringContents,o.original=H.copy(o)),o};H.copy=function(e,t){var a;if(xe.util.isArray(e)){a=[];for(var r=0;r<e.length;++r)a.push(H.copy(e[r],t));return a}return typeof e=="string"?e:(a={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:H.copy(e.value,t)},t&&!t.excludeBitStringContents&&(a.bitStringContents=e.bitStringContents),a)};H.equals=function(e,t,a){if(xe.util.isArray(e)){if(!xe.util.isArray(t)||e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!H.equals(e[r],t[r]))return!1;return!0}if(typeof e!=typeof t)return!1;if(typeof e=="string")return e===t;var i=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&H.equals(e.value,t.value);return a&&a.includeBitStringContents&&(i=i&&e.bitStringContents===t.bitStringContents),i};H.getBerValueLength=function(e){var t=e.getByte();if(t!==128){var a,r=t&128;return r?a=e.getInt((t&127)<<3):a=t,a}};function yr(e,t,a){if(a>t){var r=new Error("Too few bytes to parse DER.");throw r.available=e.length(),r.remaining=t,r.requested=a,r}}var Kn=function(e,t){var a=e.getByte();if(t--,a!==128){var r,i=a&128;if(!i)r=a;else{var s=a&127;yr(e,t,s),r=e.getInt(s<<3)}if(r<0)throw new Error("Negative length: "+r);return r}};H.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"maxDepth"in t||(t.maxDepth=H.maxDepth),typeof e=="string"&&(e=xe.util.createBuffer(e));var a=e.length(),r=Nr(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=a,i.remaining=e.length(),i}return r};function Nr(e,t,a,r){if(a>=r.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var i;yr(e,t,2);var s=e.getByte();t--;var n=s&192,o=s&31;i=e.length();var l=Kn(e,t);if(t-=i-e.length(),l!==void 0&&l>t){if(r.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=e.length(),f.remaining=t,f.requested=l,f}l=t}var u,p,m=(s&32)===32;if(m)if(u=[],l===void 0)for(;;){if(yr(e,t,2),e.bytes(2)==="\0\0"){e.getBytes(2),t-=2;break}i=e.length(),u.push(Nr(e,t,a+1,r)),t-=i-e.length()}else for(;l>0;)i=e.length(),u.push(Nr(e,l,a+1,r)),t-=i-e.length(),l-=i-e.length();if(u===void 0&&n===H.Class.UNIVERSAL&&o===H.Type.BITSTRING&&(p=e.bytes(l)),u===void 0&&r.decodeBitStrings&&n===H.Class.UNIVERSAL&&o===H.Type.BITSTRING&&l>1){var S=e.read,C=t,A=0;if(o===H.Type.BITSTRING&&(yr(e,t,1),A=e.getByte(),t--),A===0)try{i=e.length();var b={strict:!0,decodeBitStrings:!0},w=Nr(e,t,a+1,b),U=i-e.length();t-=U,o==H.Type.BITSTRING&&U++;var D=w.tagClass;U===l&&(D===H.Class.UNIVERSAL||D===H.Class.CONTEXT_SPECIFIC)&&(u=[w])}catch{}u===void 0&&(e.read=S,t=C)}if(u===void 0){if(l===void 0){if(r.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");l=t}if(o===H.Type.BMPSTRING)for(u="";l>0;l-=2)yr(e,t,2),u+=String.fromCharCode(e.getInt16()),t-=2;else u=e.getBytes(l),t-=l}var G=p===void 0?null:{bitStringContents:p};return H.create(n,o,m,u,G)}H.toDer=function(e){var t=xe.util.createBuffer(),a=e.tagClass|e.type,r=xe.util.createBuffer(),i=!1;if("bitStringContents"in e&&(i=!0,e.original&&(i=H.equals(e,e.original))),i)r.putBytes(e.bitStringContents);else if(e.composed){e.constructed?a|=32:r.putByte(0);for(var s=0;s<e.value.length;++s)e.value[s]!==void 0&&r.putBuffer(H.toDer(e.value[s]))}else if(e.type===H.Type.BMPSTRING)for(var s=0;s<e.value.length;++s)r.putInt16(e.value.charCodeAt(s));else e.type===H.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&!(e.value.charCodeAt(1)&128)||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)===128)?r.putBytes(e.value.substr(1)):r.putBytes(e.value);if(t.putByte(a),r.length()<=127)t.putByte(r.length()&127);else{var n=r.length(),o="";do o+=String.fromCharCode(n&255),n=n>>>8;while(n>0);t.putByte(o.length|128);for(var s=o.length-1;s>=0;--s)t.putByte(o.charCodeAt(s))}return t.putBuffer(r),t};H.oidToDer=function(e){var t=e.split("."),a=xe.util.createBuffer();a.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var r,i,s,n,o=2;o<t.length;++o){if(r=!0,i=[],s=parseInt(t[o],10),s>4294967295)throw new Error("OID value too large; max is 32-bits.");do n=s&127,s=s>>>7,r||(n|=128),i.push(n),r=!1;while(s>0);for(var l=i.length-1;l>=0;--l)a.putByte(i[l])}return a};H.derToOid=function(e){var t;typeof e=="string"&&(e=xe.util.createBuffer(e));var a=e.getByte();t=Math.floor(a/40)+"."+a%40;for(var r=0;e.length()>0;){if(r>70368744177663)throw new Error("OID value too large; max is 53-bits.");a=e.getByte(),r=r*128,a&128?r+=a&127:(t+="."+(r+a),r=0)}return t};H.utcTimeToDate=function(e){var t=new Date,a=parseInt(e.substr(0,2),10);a=a>=50?1900+a:2e3+a;var r=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),s=parseInt(e.substr(6,2),10),n=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var l=e.charAt(10),f=10;l!=="+"&&l!=="-"&&(o=parseInt(e.substr(10,2),10),f+=2)}if(t.setUTCFullYear(a,r,i),t.setUTCHours(s,n,o,0),f&&(l=e.charAt(f),l==="+"||l==="-")){var u=parseInt(e.substr(f+1,2),10),p=parseInt(e.substr(f+4,2),10),m=u*60+p;m*=6e4,l==="+"?t.setTime(+t-m):t.setTime(+t+m)}return t};H.generalizedTimeToDate=function(e){var t=new Date,a=parseInt(e.substr(0,4),10),r=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),n=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),l=0,f=0,u=!1;e.charAt(e.length-1)==="Z"&&(u=!0);var p=e.length-5,m=e.charAt(p);if(m==="+"||m==="-"){var S=parseInt(e.substr(p+1,2),10),C=parseInt(e.substr(p+4,2),10);f=S*60+C,f*=6e4,m==="+"&&(f*=-1),u=!0}return e.charAt(14)==="."&&(l=parseFloat(e.substr(14),10)*1e3),u?(t.setUTCFullYear(a,r,i),t.setUTCHours(s,n,o,l),t.setTime(+t+f)):(t.setFullYear(a,r,i),t.setHours(s,n,o,l)),t};H.dateToUtcTime=function(e){if(typeof e=="string")return e;var t="",a=[];a.push((""+e.getUTCFullYear()).substr(2)),a.push(""+(e.getUTCMonth()+1)),a.push(""+e.getUTCDate()),a.push(""+e.getUTCHours()),a.push(""+e.getUTCMinutes()),a.push(""+e.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(t+="0"),t+=a[r];return t+="Z",t};H.dateToGeneralizedTime=function(e){if(typeof e=="string")return e;var t="",a=[];a.push(""+e.getUTCFullYear()),a.push(""+(e.getUTCMonth()+1)),a.push(""+e.getUTCDate()),a.push(""+e.getUTCHours()),a.push(""+e.getUTCMinutes()),a.push(""+e.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(t+="0"),t+=a[r];return t+="Z",t};H.integerToDer=function(e){var t=xe.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var a=new Error("Integer too large; max is 32-bits.");throw a.integer=e,a};H.derToInteger=function(e){typeof e=="string"&&(e=xe.util.createBuffer(e));var t=e.length()*8;if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)};H.validate=function(e,t,a,r){var i=!1;if((e.tagClass===t.tagClass||typeof t.tagClass>"u")&&(e.type===t.type||typeof t.type>"u"))if(e.constructed===t.constructed||typeof t.constructed>"u"){if(i=!0,t.value&&xe.util.isArray(t.value))for(var s=0,n=0;i&&n<t.value.length;++n){var o=t.value[n];i=!!o.optional;var l=e.value[s];if(!l){o.optional||(i=!1,r&&r.push("["+t.name+'] Missing required element. Expected tag class "'+o.tagClass+'", type "'+o.type+'"'));continue}var f=typeof o.tagClass<"u"&&typeof o.type<"u";if(f&&(l.tagClass!==o.tagClass||l.type!==o.type))if(o.optional){i=!0;continue}else{i=!1,r&&r.push("["+t.name+"] Tag mismatch. Expected ("+o.tagClass+","+o.type+"), got ("+l.tagClass+","+l.type+")");break}var u=H.validate(l,o,a,r);if(u)++s,i=!0;else if(o.optional)i=!0;else{i=!1;break}}if(i&&a&&(t.capture&&(a[t.capture]=e.value),t.captureAsn1&&(a[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(a[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)a[t.captureBitStringValue]="";else{var p=e.bitStringContents.charCodeAt(0);if(p!==0)throw new Error("captureBitStringValue only supported for zero unused bits");a[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else r&&r.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else r&&(e.tagClass!==t.tagClass&&r.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&r.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return i};var $a=/[^\\u0000-\\u00ff]/;H.prettyPrint=function(e,t,a){var r="";t=t||0,a=a||2,t>0&&(r+=`
10
+ `);for(var i="",s=0;s<t*a;++s)i+=" ";switch(r+=i+"Tag: ",e.tagClass){case H.Class.UNIVERSAL:r+="Universal:";break;case H.Class.APPLICATION:r+="Application:";break;case H.Class.CONTEXT_SPECIFIC:r+="Context-Specific:";break;case H.Class.PRIVATE:r+="Private:";break}if(e.tagClass===H.Class.UNIVERSAL)switch(r+=e.type,e.type){case H.Type.NONE:r+=" (None)";break;case H.Type.BOOLEAN:r+=" (Boolean)";break;case H.Type.INTEGER:r+=" (Integer)";break;case H.Type.BITSTRING:r+=" (Bit string)";break;case H.Type.OCTETSTRING:r+=" (Octet string)";break;case H.Type.NULL:r+=" (Null)";break;case H.Type.OID:r+=" (Object Identifier)";break;case H.Type.ODESC:r+=" (Object Descriptor)";break;case H.Type.EXTERNAL:r+=" (External or Instance of)";break;case H.Type.REAL:r+=" (Real)";break;case H.Type.ENUMERATED:r+=" (Enumerated)";break;case H.Type.EMBEDDED:r+=" (Embedded PDV)";break;case H.Type.UTF8:r+=" (UTF8)";break;case H.Type.ROID:r+=" (Relative Object Identifier)";break;case H.Type.SEQUENCE:r+=" (Sequence)";break;case H.Type.SET:r+=" (Set)";break;case H.Type.PRINTABLESTRING:r+=" (Printable String)";break;case H.Type.IA5String:r+=" (IA5String (ASCII))";break;case H.Type.UTCTIME:r+=" (UTC time)";break;case H.Type.GENERALIZEDTIME:r+=" (Generalized time)";break;case H.Type.BMPSTRING:r+=" (BMP String)";break}else r+=e.type;if(r+=`
11
+ `,r+=i+"Constructed: "+e.constructed+`
12
+ `,e.composed){for(var n=0,o="",s=0;s<e.value.length;++s)e.value[s]!==void 0&&(n+=1,o+=H.prettyPrint(e.value[s],t+1,a),s+1<e.value.length&&(o+=","));r+=i+"Sub values: "+n+o}else{if(r+=i+"Value: ",e.type===H.Type.OID){var l=H.derToOid(e.value);r+=l,xe.pki&&xe.pki.oids&&l in xe.pki.oids&&(r+=" ("+xe.pki.oids[l]+") ")}if(e.type===H.Type.INTEGER)try{r+=H.derToInteger(e.value)}catch{r+="0x"+xe.util.bytesToHex(e.value)}else if(e.type===H.Type.BITSTRING){if(e.value.length>1?r+="0x"+xe.util.bytesToHex(e.value.slice(1)):r+="(none)",e.value.length>0){var f=e.value.charCodeAt(0);f==1?r+=" (1 unused bit shown)":f>1&&(r+=" ("+f+" unused bits shown)")}}else if(e.type===H.Type.OCTETSTRING)$a.test(e.value)||(r+="("+e.value+") "),r+="0x"+xe.util.bytesToHex(e.value);else if(e.type===H.Type.UTF8)try{r+=xe.util.decodeUtf8(e.value)}catch(u){if(u.message==="URI malformed")r+="0x"+xe.util.bytesToHex(e.value)+" (malformed UTF8)";else throw u}else e.type===H.Type.PRINTABLESTRING||e.type===H.Type.IA5String?r+=e.value:$a.test(e.value)?r+="0x"+xe.util.bytesToHex(e.value):e.value.length===0?r+="[null]":r+=e.value}return r};var Ur=ee;Ur.md=Ur.md||{};Ur.md.algorithms=Ur.md.algorithms||{};var _t=ee,Mn=_t.hmac=_t.hmac||{};Mn.create=function(){var e=null,t=null,a=null,r=null,i={};return i.start=function(s,n){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in _t.md.algorithms)t=_t.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else t=s;if(n===null)n=e;else{if(typeof n=="string")n=_t.util.createBuffer(n);else if(_t.util.isArray(n)){var o=n;n=_t.util.createBuffer();for(var l=0;l<o.length;++l)n.putByte(o[l])}var f=n.length();f>t.blockLength&&(t.start(),t.update(n.bytes()),n=t.digest()),a=_t.util.createBuffer(),r=_t.util.createBuffer(),f=n.length();for(var l=0;l<f;++l){var o=n.at(l);a.putByte(54^o),r.putByte(92^o)}if(f<t.blockLength)for(var o=t.blockLength-f,l=0;l<o;++l)a.putByte(54),r.putByte(92);e=n,a=a.bytes(),r=r.bytes()}t.start(),t.update(a)},i.update=function(s){t.update(s)},i.getMac=function(){var s=t.digest().bytes();return t.start(),t.update(r),t.update(s),t.digest()},i.digest=i.getMac,i};var St=ee,Ai=St.md5=St.md5||{};St.md.md5=St.md.algorithms.md5=Ai;Ai.create=function(){bi||Hn();var e=null,t=St.util.createBuffer(),a=new Array(16),r={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var i=r.messageLengthSize/4,s=0;s<i;++s)r.fullMessageLength.push(0);return t=St.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},r},r.start(),r.update=function(i,s){s==="utf8"&&(i=St.util.encodeUtf8(i));var n=i.length;r.messageLength+=n,n=[n/4294967296>>>0,n>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=n[1],n[1]=n[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,n[0]=n[1]/4294967296>>>0;return t.putBytes(i),ja(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var i=St.util.createBuffer();i.putBytes(t.bytes());var s=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,n=s&r.blockLength-1;i.putBytes(ha.substr(0,r.blockLength-n));for(var o,l=0,f=r.fullMessageLength.length-1;f>=0;--f)o=r.fullMessageLength[f]*8+l,l=o/4294967296>>>0,i.putInt32Le(o>>>0);var u={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};ja(u,a,i);var p=St.util.createBuffer();return p.putInt32Le(u.h0),p.putInt32Le(u.h1),p.putInt32Le(u.h2),p.putInt32Le(u.h3),p},r};var ha=null,Rr=null,gr=null,rr=null,bi=!1;function Hn(){ha="€",ha+=St.util.fillString("\0",64),Rr=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],gr=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],rr=new Array(64);for(var e=0;e<64;++e)rr[e]=Math.floor(Math.abs(Math.sin(e+1))*4294967296);bi=!0}function ja(e,t,a){for(var r,i,s,n,o,l,f,u,p=a.length();p>=64;){for(i=e.h0,s=e.h1,n=e.h2,o=e.h3,u=0;u<16;++u)t[u]=a.getInt32Le(),l=o^s&(n^o),r=i+l+rr[u]+t[u],f=gr[u],i=o,o=n,n=s,s+=r<<f|r>>>32-f;for(;u<32;++u)l=n^o&(s^n),r=i+l+rr[u]+t[Rr[u]],f=gr[u],i=o,o=n,n=s,s+=r<<f|r>>>32-f;for(;u<48;++u)l=s^n^o,r=i+l+rr[u]+t[Rr[u]],f=gr[u],i=o,o=n,n=s,s+=r<<f|r>>>32-f;for(;u<64;++u)l=n^(s|~o),r=i+l+rr[u]+t[Rr[u]],f=gr[u],i=o,o=n,n=s,s+=r<<f|r>>>32-f;e.h0=e.h0+i|0,e.h1=e.h1+s|0,e.h2=e.h2+n|0,e.h3=e.h3+o|0,p-=64}}var Dr=ee,_i=Dr.pem=Dr.pem||{};_i.encode=function(e,t){t=t||{};var a="-----BEGIN "+e.type+`-----\r
13
+ `,r;if(e.procType&&(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]},a+=Ar(r)),e.contentDomain&&(r={name:"Content-Domain",values:[e.contentDomain]},a+=Ar(r)),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),a+=Ar(r)),e.headers)for(var i=0;i<e.headers.length;++i)a+=Ar(e.headers[i]);return e.procType&&(a+=`\r
14
+ `),a+=Dr.util.encode64(e.body,t.maxline||64)+`\r
15
+ `,a+="-----END "+e.type+`-----\r
16
+ `,a};_i.decode=function(e){for(var t=[],a=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,r=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,i=/\r?\n/,s;s=a.exec(e),!!s;){var n=s[1];n==="NEW CERTIFICATE REQUEST"&&(n="CERTIFICATE REQUEST");var o={type:n,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Dr.util.decode64(s[3])};if(t.push(o),!!s[2]){for(var l=s[2].split(i),f=0;s&&f<l.length;){for(var u=l[f].replace(/\s+$/,""),p=f+1;p<l.length;++p){var m=l[p];if(!/\s/.test(m[0]))break;u+=m,f=p}if(s=u.match(r),s){for(var S={name:s[1],values:[]},C=s[2].split(","),A=0;A<C.length;++A)S.values.push(Gn(C[A]));if(o.procType)if(!o.contentDomain&&S.name==="Content-Domain")o.contentDomain=C[0]||"";else if(!o.dekInfo&&S.name==="DEK-Info"){if(S.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');o.dekInfo={algorithm:C[0],parameters:C[1]||null}}else o.headers.push(S);else{if(S.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(S.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');o.procType={version:C[0],type:C[1]}}}++f}if(o.procType==="ENCRYPTED"&&!o.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(t.length===0)throw new Error("Invalid PEM formatted message.");return t};function Ar(e){for(var t=e.name+": ",a=[],r=function(l,f){return" "+f},i=0;i<e.values.length;++i)a.push(e.values[i].replace(/^(\S+\r\n)/,r));t+=a.join(",")+`\r
17
+ `;for(var s=0,n=-1,i=0;i<t.length;++i,++s)if(s>65&&n!==-1){var o=t[n];o===","?(++n,t=t.substr(0,n)+`\r
18
+ `+t.substr(n)):t=t.substr(0,n)+`\r
19
+ `+o+t.substr(n+1),s=i-n-1,n=-1,++i}else(t[i]===" "||t[i]===" "||t[i]===",")&&(n=i);return t}function Gn(e){return e.replace(/^\s+/,"")}var Ie=ee;Ie.des=Ie.des||{};Ie.des.startEncrypting=function(e,t,a,r){var i=Xr({key:e,output:a,decrypt:!1,mode:r||(t===null?"ECB":"CBC")});return i.start(t),i};Ie.des.createEncryptionCipher=function(e,t){return Xr({key:e,output:null,decrypt:!1,mode:t})};Ie.des.startDecrypting=function(e,t,a,r){var i=Xr({key:e,output:a,decrypt:!0,mode:r||(t===null?"ECB":"CBC")});return i.start(t),i};Ie.des.createDecryptionCipher=function(e,t){return Xr({key:e,output:null,decrypt:!0,mode:t})};Ie.des.Algorithm=function(e,t){var a=this;a.name=e,a.mode=new t({blockSize:8,cipher:{encrypt:function(r,i){return Za(a._keys,r,i,!1)},decrypt:function(r,i){return Za(a._keys,r,i,!0)}}}),a._init=!1};Ie.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=Ie.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=Zn(t),this._init=!0}};At("DES-ECB",Ie.cipher.modes.ecb);At("DES-CBC",Ie.cipher.modes.cbc);At("DES-CFB",Ie.cipher.modes.cfb);At("DES-OFB",Ie.cipher.modes.ofb);At("DES-CTR",Ie.cipher.modes.ctr);At("3DES-ECB",Ie.cipher.modes.ecb);At("3DES-CBC",Ie.cipher.modes.cbc);At("3DES-CFB",Ie.cipher.modes.cfb);At("3DES-OFB",Ie.cipher.modes.ofb);At("3DES-CTR",Ie.cipher.modes.ctr);function At(e,t){var a=function(){return new Ie.des.Algorithm(e,t)};Ie.cipher.registerAlgorithm(e,a)}var qn=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],Qn=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],zn=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],Yn=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],Xn=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],Wn=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],$n=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],jn=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function Zn(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],a=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],r=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],n=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],m=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],S=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],C=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],A=e.length()>8?3:1,b=[],w=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],U=0,D,G=0;G<A;G++){var K=e.getInt32(),F=e.getInt32();D=(K>>>4^F)&252645135,F^=D,K^=D<<4,D=(F>>>-16^K)&65535,K^=D,F^=D<<-16,D=(K>>>2^F)&858993459,F^=D,K^=D<<2,D=(F>>>-16^K)&65535,K^=D,F^=D<<-16,D=(K>>>1^F)&1431655765,F^=D,K^=D<<1,D=(F>>>8^K)&16711935,K^=D,F^=D<<8,D=(K>>>1^F)&1431655765,F^=D,K^=D<<1,D=K<<8|F>>>20&240,K=F<<24|F<<8&16711680|F>>>8&65280|F>>>24&240,F=D;for(var $=0;$<w.length;++$){w[$]?(K=K<<2|K>>>26,F=F<<2|F>>>26):(K=K<<1|K>>>27,F=F<<1|F>>>27),K&=-15,F&=-15;var j=t[K>>>28]|a[K>>>24&15]|r[K>>>20&15]|i[K>>>16&15]|s[K>>>12&15]|n[K>>>8&15]|o[K>>>4&15],le=l[F>>>28]|f[F>>>24&15]|u[F>>>20&15]|p[F>>>16&15]|m[F>>>12&15]|S[F>>>8&15]|C[F>>>4&15];D=(le>>>16^j)&65535,b[U++]=j^D,b[U++]=le^D<<16}}return b}function Za(e,t,a,r){var i=e.length===32?3:9,s;i===3?s=r?[30,-2,-2]:[0,32,2]:s=r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var n,o=t[0],l=t[1];n=(o>>>4^l)&252645135,l^=n,o^=n<<4,n=(o>>>16^l)&65535,l^=n,o^=n<<16,n=(l>>>2^o)&858993459,o^=n,l^=n<<2,n=(l>>>8^o)&16711935,o^=n,l^=n<<8,n=(o>>>1^l)&1431655765,l^=n,o^=n<<1,o=o<<1|o>>>31,l=l<<1|l>>>31;for(var f=0;f<i;f+=3){for(var u=s[f+1],p=s[f+2],m=s[f];m!=u;m+=p){var S=l^e[m],C=(l>>>4|l<<28)^e[m+1];n=o,o=l,l=n^(Qn[S>>>24&63]|Yn[S>>>16&63]|Wn[S>>>8&63]|jn[S&63]|qn[C>>>24&63]|zn[C>>>16&63]|Xn[C>>>8&63]|$n[C&63])}n=o,o=l,l=n}o=o>>>1|o<<31,l=l>>>1|l<<31,n=(o>>>1^l)&1431655765,l^=n,o^=n<<1,n=(l>>>8^o)&16711935,o^=n,l^=n<<8,n=(l>>>2^o)&858993459,o^=n,l^=n<<2,n=(o>>>16^l)&65535,l^=n,o^=n<<16,n=(o>>>4^l)&252645135,l^=n,o^=n<<4,a[0]=o,a[1]=l}function Xr(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),a="DES-"+t,r;e.decrypt?r=Ie.cipher.createDecipher(a,e.key):r=Ie.cipher.createCipher(a,e.key);var i=r.start;return r.start=function(s,n){var o=null;n instanceof Ie.util.ByteBuffer&&(o=n,n={}),n=n||{},n.output=o,n.iv=s,i.call(r,n)},r}const Jn={},es=Object.freeze(Object.defineProperty({__proto__:null,default:Jn},Symbol.toStringTag,{value:"Module"})),Ua=Tn(es);var Je=ee,ts=Je.pkcs5=Je.pkcs5||{},bt;Je.util.isNodejs&&!Je.options.usePureJavaScript&&(bt=Ua);Je.pbkdf2=ts.pbkdf2=function(e,t,a,r,i,s){if(typeof i=="function"&&(s=i,i=null),Je.util.isNodejs&&!Je.options.usePureJavaScript&&bt.pbkdf2&&(i===null||typeof i!="object")&&(bt.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),e=pt.from(e,"binary"),t=pt.from(t,"binary"),s?bt.pbkdf2Sync.length===4?bt.pbkdf2(e,t,a,r,function(D,G){if(D)return s(D);s(null,G.toString("binary"))}):bt.pbkdf2(e,t,a,r,i,function(D,G){if(D)return s(D);s(null,G.toString("binary"))}):bt.pbkdf2Sync.length===4?bt.pbkdf2Sync(e,t,a,r).toString("binary"):bt.pbkdf2Sync(e,t,a,r,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in Je.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=Je.md[i].create()}var n=i.digestLength;if(r>4294967295*n){var o=new Error("Derived key is too long.");if(s)return s(o);throw o}var l=Math.ceil(r/n),f=r-(l-1)*n,u=Je.hmac.create();u.start(i,e);var p="",m,S,C;if(!s){for(var A=1;A<=l;++A){u.start(null,null),u.update(t),u.update(Je.util.int32ToBytes(A)),m=C=u.digest().getBytes();for(var b=2;b<=a;++b)u.start(null,null),u.update(C),S=u.digest().getBytes(),m=Je.util.xorBytes(m,S,n),C=S;p+=A<l?m:m.substr(0,f)}return p}var A=1,b;function w(){if(A>l)return s(null,p);u.start(null,null),u.update(t),u.update(Je.util.int32ToBytes(A)),m=C=u.digest().getBytes(),b=2,U()}function U(){if(b<=a)return u.start(null,null),u.update(C),S=u.digest().getBytes(),m=Je.util.xorBytes(m,S,n),C=S,++b,Je.util.setImmediate(U);p+=A<l?m:m.substr(0,f),++A,w()}w()};var Tt=ee,wi=Tt.sha256=Tt.sha256||{};Tt.md.sha256=Tt.md.algorithms.sha256=wi;wi.create=function(){Ni||rs();var e=null,t=Tt.util.createBuffer(),a=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var i=r.messageLengthSize/4,s=0;s<i;++s)r.fullMessageLength.push(0);return t=Tt.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r},r.start(),r.update=function(i,s){s==="utf8"&&(i=Tt.util.encodeUtf8(i));var n=i.length;r.messageLength+=n,n=[n/4294967296>>>0,n>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=n[1],n[1]=n[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,n[0]=n[1]/4294967296>>>0;return t.putBytes(i),Ja(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var i=Tt.util.createBuffer();i.putBytes(t.bytes());var s=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,n=s&r.blockLength-1;i.putBytes(pa.substr(0,r.blockLength-n));for(var o,l,f=r.fullMessageLength[0]*8,u=0;u<r.fullMessageLength.length-1;++u)o=r.fullMessageLength[u+1]*8,l=o/4294967296>>>0,f+=l,i.putInt32(f>>>0),f=o>>>0;i.putInt32(f);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};Ja(p,a,i);var m=Tt.util.createBuffer();return m.putInt32(p.h0),m.putInt32(p.h1),m.putInt32(p.h2),m.putInt32(p.h3),m.putInt32(p.h4),m.putInt32(p.h5),m.putInt32(p.h6),m.putInt32(p.h7),m},r};var pa=null,Ni=!1,Ri=null;function rs(){pa="€",pa+=Tt.util.fillString("\0",64),Ri=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Ni=!0}function Ja(e,t,a){for(var r,i,s,n,o,l,f,u,p,m,S,C,A,b,w,U=a.length();U>=64;){for(f=0;f<16;++f)t[f]=a.getInt32();for(;f<64;++f)r=t[f-2],r=(r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,i=t[f-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[f]=r+t[f-7]+i+t[f-16]|0;for(u=e.h0,p=e.h1,m=e.h2,S=e.h3,C=e.h4,A=e.h5,b=e.h6,w=e.h7,f=0;f<64;++f)n=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),o=b^C&(A^b),s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),l=u&p|m&(u^p),r=w+n+o+Ri[f]+t[f],i=s+l,w=b,b=A,A=C,C=S+r>>>0,S=m,m=p,p=u,u=r+i>>>0;e.h0=e.h0+u|0,e.h1=e.h1+p|0,e.h2=e.h2+m|0,e.h3=e.h3+S|0,e.h4=e.h4+C|0,e.h5=e.h5+A|0,e.h6=e.h6+b|0,e.h7=e.h7+w|0,U-=64}}var Ct=ee,Lr=null;Ct.util.isNodejs&&!Ct.options.usePureJavaScript&&!kt.p.versions["node-webkit"]&&(Lr=Ua);var as=Ct.prng=Ct.prng||{};as.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},a=e.md,r=new Array(32),i=0;i<32;++i)r[i]=a.create();t.pools=r,t.pool=0,t.generate=function(f,u){if(!u)return t.generateSync(f);var p=t.plugin.cipher,m=t.plugin.increment,S=t.plugin.formatKey,C=t.plugin.formatSeed,A=Ct.util.createBuffer();t.key=null,b();function b(w){if(w)return u(w);if(A.length()>=f)return u(null,A.getBytes(f));if(t.generated>1048575&&(t.key=null),t.key===null)return Ct.util.nextTick(function(){s(b)});var U=p(t.key,t.seed);t.generated+=U.length,A.putBytes(U),t.key=S(p(t.key,m(t.seed))),t.seed=C(p(t.key,t.seed)),Ct.util.setImmediate(b)}},t.generateSync=function(f){var u=t.plugin.cipher,p=t.plugin.increment,m=t.plugin.formatKey,S=t.plugin.formatSeed;t.key=null;for(var C=Ct.util.createBuffer();C.length()<f;){t.generated>1048575&&(t.key=null),t.key===null&&n();var A=u(t.key,t.seed);t.generated+=A.length,C.putBytes(A),t.key=m(u(t.key,p(t.seed))),t.seed=S(u(t.key,t.seed))}return C.getBytes(f)};function s(f){if(t.pools[0].messageLength>=32)return o(),f();var u=32-t.pools[0].messageLength<<5;t.seedFile(u,function(p,m){if(p)return f(p);t.collect(m),o(),f()})}function n(){if(t.pools[0].messageLength>=32)return o();var f=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(f)),o()}function o(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var f=t.plugin.md.create();f.update(t.keyBytes);for(var u=1,p=0;p<32;++p)t.reseeds%u===0&&(f.update(t.pools[p].digest().getBytes()),t.pools[p].start()),u=u<<1;t.keyBytes=f.digest().getBytes(),f.start(),f.update(t.keyBytes);var m=f.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(m),t.generated=0}function l(f){var u=null,p=Ct.util.globalScope,m=p.crypto||p.msCrypto;m&&m.getRandomValues&&(u=function(K){return m.getRandomValues(K)});var S=Ct.util.createBuffer();if(u)for(;S.length()<f;){var C=Math.max(1,Math.min(f-S.length(),65536)/4),A=new Uint32Array(Math.floor(C));try{u(A);for(var b=0;b<A.length;++b)S.putInt32(A[b])}catch(K){if(!(typeof QuotaExceededError<"u"&&K instanceof QuotaExceededError))throw K}}if(S.length()<f)for(var w,U,D,G=Math.floor(Math.random()*65536);S.length()<f;){U=16807*(G&65535),w=16807*(G>>16),U+=(w&32767)<<16,U+=w>>15,U=(U&2147483647)+(U>>31),G=U&4294967295;for(var b=0;b<3;++b)D=G>>>(b<<3),D^=Math.floor(Math.random()*256),S.putByte(D&255)}return S.getBytes(f)}return Lr?(t.seedFile=function(f,u){Lr.randomBytes(f,function(p,m){if(p)return u(p);u(null,m.toString())})},t.seedFileSync=function(f){return Lr.randomBytes(f).toString()}):(t.seedFile=function(f,u){try{u(null,l(f))}catch(p){u(p)}},t.seedFileSync=l),t.collect=function(f){for(var u=f.length,p=0;p<u;++p)t.pools[t.pool].update(f.substr(p,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(f,u){for(var p="",m=0;m<u;m+=8)p+=String.fromCharCode(f>>m&255);t.collect(p)},t.registerWorker=function(f){if(f===self)t.seedFile=function(p,m){function S(C){var A=C.data;A.forge&&A.forge.prng&&(self.removeEventListener("message",S),m(A.forge.prng.err,A.forge.prng.bytes))}self.addEventListener("message",S),self.postMessage({forge:{prng:{needed:p}}})};else{var u=function(p){var m=p.data;m.forge&&m.forge.prng&&t.seedFile(m.forge.prng.needed,function(S,C){f.postMessage({forge:{prng:{err:S,bytes:C}}})})};f.addEventListener("message",u)}},t};var qe=ee;(function(){if(qe.random&&qe.random.getBytes){qe.random;return}(function(e){var t={},a=new Array(4),r=qe.util.createBuffer();t.formatKey=function(p){var m=qe.util.createBuffer(p);return p=new Array(4),p[0]=m.getInt32(),p[1]=m.getInt32(),p[2]=m.getInt32(),p[3]=m.getInt32(),qe.aes._expandKey(p,!1)},t.formatSeed=function(p){var m=qe.util.createBuffer(p);return p=new Array(4),p[0]=m.getInt32(),p[1]=m.getInt32(),p[2]=m.getInt32(),p[3]=m.getInt32(),p},t.cipher=function(p,m){return qe.aes._updateBlock(p,m,a,!1),r.putInt32(a[0]),r.putInt32(a[1]),r.putInt32(a[2]),r.putInt32(a[3]),r.getBytes()},t.increment=function(p){return++p[3],p},t.md=qe.md.sha256;function i(){var p=qe.prng.create(t);return p.getBytes=function(m,S){return p.generate(m,S)},p.getBytesSync=function(m){return p.generate(m)},p}var s=i(),n=null,o=qe.util.globalScope,l=o.crypto||o.msCrypto;if(l&&l.getRandomValues&&(n=function(p){return l.getRandomValues(p)}),qe.options.usePureJavaScript||!qe.util.isNodejs&&!n){if(s.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var u in navigator)try{typeof navigator[u]=="string"&&(f+=navigator[u])}catch{}s.collect(f),f=null}e&&(e().mousemove(function(p){s.collectInt(p.clientX,16),s.collectInt(p.clientY,16)}),e().keypress(function(p){s.collectInt(p.charCode,8)}))}if(!qe.random)qe.random=s;else for(var u in s)qe.random[u]=s[u];qe.random.createInstance=i,qe.random})(typeof jQuery<"u"?jQuery:null)})();var at=ee,aa=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],ei=[1,2,3,5],is=function(e,t){return e<<t&65535|(e&65535)>>16-t},ns=function(e,t){return(e&65535)>>t|e<<16-t&65535};at.rc2=at.rc2||{};at.rc2.expandKey=function(e,t){typeof e=="string"&&(e=at.util.createBuffer(e)),t=t||128;var a=e,r=e.length(),i=t,s=Math.ceil(i/8),n=255>>(i&7),o;for(o=r;o<128;o++)a.putByte(aa[a.at(o-1)+a.at(o-r)&255]);for(a.setAt(128-s,aa[a.at(128-s)&n]),o=127-s;o>=0;o--)a.setAt(o,aa[a.at(o+1)^a.at(o+s)]);return a};var Li=function(e,t,a){var r=!1,i=null,s=null,n=null,o,l,f,u,p=[];for(e=at.rc2.expandKey(e,t),f=0;f<64;f++)p.push(e.getInt16Le());a?(o=function(C){for(f=0;f<4;f++)C[f]+=p[u]+(C[(f+3)%4]&C[(f+2)%4])+(~C[(f+3)%4]&C[(f+1)%4]),C[f]=is(C[f],ei[f]),u++},l=function(C){for(f=0;f<4;f++)C[f]+=p[C[(f+3)%4]&63]}):(o=function(C){for(f=3;f>=0;f--)C[f]=ns(C[f],ei[f]),C[f]-=p[u]+(C[(f+3)%4]&C[(f+2)%4])+(~C[(f+3)%4]&C[(f+1)%4]),u--},l=function(C){for(f=3;f>=0;f--)C[f]-=p[C[(f+3)%4]&63]});var m=function(C){var A=[];for(f=0;f<4;f++){var b=i.getInt16Le();n!==null&&(a?b^=n.getInt16Le():n.putInt16Le(b)),A.push(b&65535)}u=a?0:63;for(var w=0;w<C.length;w++)for(var U=0;U<C[w][0];U++)C[w][1](A);for(f=0;f<4;f++)n!==null&&(a?n.putInt16Le(A[f]):A[f]^=n.getInt16Le()),s.putInt16Le(A[f])},S=null;return S={start:function(C,A){C&&typeof C=="string"&&(C=at.util.createBuffer(C)),r=!1,i=at.util.createBuffer(),s=A||new at.util.createBuffer,n=C,S.output=s},update:function(C){for(r||i.putBuffer(C);i.length()>=8;)m([[5,o],[1,l],[6,o],[1,l],[5,o]])},finish:function(C){var A=!0;if(a)if(C)A=C(8,i,!a);else{var b=i.length()===8?8:8-i.length();i.fillWithByte(b,b)}if(A&&(r=!0,S.update()),!a&&(A=i.length()===0,A))if(C)A=C(8,s,!a);else{var w=s.length(),U=s.at(w-1);U>w?A=!1:s.truncate(U)}return A}},S};at.rc2.startEncrypting=function(e,t,a){var r=at.rc2.createEncryptionCipher(e,128);return r.start(t,a),r};at.rc2.createEncryptionCipher=function(e,t){return Li(e,t,!0)};at.rc2.startDecrypting=function(e,t,a){var r=at.rc2.createDecryptionCipher(e,128);return r.start(t,a),r};at.rc2.createDecryptionCipher=function(e,t){return Li(e,t,!1)};var da=ee;da.jsbn=da.jsbn||{};var wt;function k(e,t,a){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,a):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}da.jsbn.BigInteger=k;function ue(){return new k(null)}function ss(e,t,a,r,i,s){for(;--s>=0;){var n=t*this.data[e++]+a.data[r]+i;i=Math.floor(n/67108864),a.data[r++]=n&67108863}return i}function os(e,t,a,r,i,s){for(var n=t&32767,o=t>>15;--s>=0;){var l=this.data[e]&32767,f=this.data[e++]>>15,u=o*l+f*n;l=n*l+((u&32767)<<15)+a.data[r]+(i&1073741823),i=(l>>>30)+(u>>>15)+o*f+(i>>>30),a.data[r++]=l&1073741823}return i}function ti(e,t,a,r,i,s){for(var n=t&16383,o=t>>14;--s>=0;){var l=this.data[e]&16383,f=this.data[e++]>>14,u=o*l+f*n;l=n*l+((u&16383)<<14)+a.data[r]+i,i=(l>>28)+(u>>14)+o*f,a.data[r++]=l&268435455}return i}typeof navigator>"u"?(k.prototype.am=ti,wt=28):navigator.appName=="Microsoft Internet Explorer"?(k.prototype.am=os,wt=30):navigator.appName!="Netscape"?(k.prototype.am=ss,wt=26):(k.prototype.am=ti,wt=28);k.prototype.DB=wt;k.prototype.DM=(1<<wt)-1;k.prototype.DV=1<<wt;var Da=52;k.prototype.FV=Math.pow(2,Da);k.prototype.F1=Da-wt;k.prototype.F2=2*wt-Da;var us="0123456789abcdefghijklmnopqrstuvwxyz",Wr=new Array,fr,ft;fr=48;for(ft=0;ft<=9;++ft)Wr[fr++]=ft;fr=97;for(ft=10;ft<36;++ft)Wr[fr++]=ft;fr=65;for(ft=10;ft<36;++ft)Wr[fr++]=ft;function ri(e){return us.charAt(e)}function Ui(e,t){var a=Wr[e.charCodeAt(t)];return a??-1}function fs(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function ls(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function Ft(e){var t=ue();return t.fromInt(e),t}function cs(e,t){var a;if(t==16)a=4;else if(t==8)a=3;else if(t==256)a=8;else if(t==2)a=1;else if(t==32)a=5;else if(t==4)a=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var r=e.length,i=!1,s=0;--r>=0;){var n=a==8?e[r]&255:Ui(e,r);if(n<0){e.charAt(r)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=n:s+a>this.DB?(this.data[this.t-1]|=(n&(1<<this.DB-s)-1)<<s,this.data[this.t++]=n>>this.DB-s):this.data[this.t-1]|=n<<s,s+=a,s>=this.DB&&(s-=this.DB)}a==8&&e[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&k.ZERO.subTo(this,this)}function hs(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function ps(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var a=(1<<t)-1,r,i=!1,s="",n=this.t,o=this.DB-n*this.DB%t;if(n-- >0)for(o<this.DB&&(r=this.data[n]>>o)>0&&(i=!0,s=ri(r));n>=0;)o<t?(r=(this.data[n]&(1<<o)-1)<<t-o,r|=this.data[--n]>>(o+=this.DB-t)):(r=this.data[n]>>(o-=t)&a,o<=0&&(o+=this.DB,--n)),r>0&&(i=!0),i&&(s+=ri(r));return i?s:"0"}function ds(){var e=ue();return k.ZERO.subTo(this,e),e}function ys(){return this.s<0?this.negate():this}function gs(e){var t=this.s-e.s;if(t!=0)return t;var a=this.t;if(t=a-e.t,t!=0)return this.s<0?-t:t;for(;--a>=0;)if((t=this.data[a]-e.data[a])!=0)return t;return 0}function $r(e){var t=1,a;return(a=e>>>16)!=0&&(e=a,t+=16),(a=e>>8)!=0&&(e=a,t+=8),(a=e>>4)!=0&&(e=a,t+=4),(a=e>>2)!=0&&(e=a,t+=2),(a=e>>1)!=0&&(e=a,t+=1),t}function vs(){return this.t<=0?0:this.DB*(this.t-1)+$r(this.data[this.t-1]^this.s&this.DM)}function ms(e,t){var a;for(a=this.t-1;a>=0;--a)t.data[a+e]=this.data[a];for(a=e-1;a>=0;--a)t.data[a]=0;t.t=this.t+e,t.s=this.s}function Cs(e,t){for(var a=e;a<this.t;++a)t.data[a-e]=this.data[a];t.t=Math.max(this.t-e,0),t.s=this.s}function Es(e,t){var a=e%this.DB,r=this.DB-a,i=(1<<r)-1,s=Math.floor(e/this.DB),n=this.s<<a&this.DM,o;for(o=this.t-1;o>=0;--o)t.data[o+s+1]=this.data[o]>>r|n,n=(this.data[o]&i)<<a;for(o=s-1;o>=0;--o)t.data[o]=0;t.data[s]=n,t.t=this.t+s+1,t.s=this.s,t.clamp()}function xs(e,t){t.s=this.s;var a=Math.floor(e/this.DB);if(a>=this.t){t.t=0;return}var r=e%this.DB,i=this.DB-r,s=(1<<r)-1;t.data[0]=this.data[a]>>r;for(var n=a+1;n<this.t;++n)t.data[n-a-1]|=(this.data[n]&s)<<i,t.data[n-a]=this.data[n]>>r;r>0&&(t.data[this.t-a-1]|=(this.s&s)<<i),t.t=this.t-a,t.clamp()}function Ss(e,t){for(var a=0,r=0,i=Math.min(e.t,this.t);a<i;)r+=this.data[a]-e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;a<this.t;)r+=this.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;a<e.t;)r-=e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[a++]=this.DV+r:r>0&&(t.data[a++]=r),t.t=a,t.clamp()}function Ts(e,t){var a=this.abs(),r=e.abs(),i=a.t;for(t.t=i+r.t;--i>=0;)t.data[i]=0;for(i=0;i<r.t;++i)t.data[i+a.t]=a.am(0,r.data[i],t,i,0,a.t);t.s=0,t.clamp(),this.s!=e.s&&k.ZERO.subTo(t,t)}function Is(e){for(var t=this.abs(),a=e.t=2*t.t;--a>=0;)e.data[a]=0;for(a=0;a<t.t-1;++a){var r=t.am(a,t.data[a],e,2*a,0,1);(e.data[a+t.t]+=t.am(a+1,2*t.data[a],e,2*a+1,r,t.t-a-1))>=t.DV&&(e.data[a+t.t]-=t.DV,e.data[a+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(a,t.data[a],e,2*a,0,1)),e.s=0,e.clamp()}function Bs(e,t,a){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t?.fromInt(0),a!=null&&this.copyTo(a);return}a==null&&(a=ue());var s=ue(),n=this.s,o=e.s,l=this.DB-$r(r.data[r.t-1]);l>0?(r.lShiftTo(l,s),i.lShiftTo(l,a)):(r.copyTo(s),i.copyTo(a));var f=s.t,u=s.data[f-1];if(u!=0){var p=u*(1<<this.F1)+(f>1?s.data[f-2]>>this.F2:0),m=this.FV/p,S=(1<<this.F1)/p,C=1<<this.F2,A=a.t,b=A-f,w=t??ue();for(s.dlShiftTo(b,w),a.compareTo(w)>=0&&(a.data[a.t++]=1,a.subTo(w,a)),k.ONE.dlShiftTo(f,w),w.subTo(s,s);s.t<f;)s.data[s.t++]=0;for(;--b>=0;){var U=a.data[--A]==u?this.DM:Math.floor(a.data[A]*m+(a.data[A-1]+C)*S);if((a.data[A]+=s.am(0,U,a,b,0,f))<U)for(s.dlShiftTo(b,w),a.subTo(w,a);a.data[A]<--U;)a.subTo(w,a)}t!=null&&(a.drShiftTo(f,t),n!=o&&k.ZERO.subTo(t,t)),a.t=f,a.clamp(),l>0&&a.rShiftTo(l,a),n<0&&k.ZERO.subTo(a,a)}}}function As(e){var t=ue();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(k.ZERO)>0&&e.subTo(t,t),t}function $t(e){this.m=e}function bs(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function _s(e){return e}function ws(e){e.divRemTo(this.m,null,e)}function Ns(e,t,a){e.multiplyTo(t,a),this.reduce(a)}function Rs(e,t){e.squareTo(t),this.reduce(t)}$t.prototype.convert=bs;$t.prototype.revert=_s;$t.prototype.reduce=ws;$t.prototype.mulTo=Ns;$t.prototype.sqrTo=Rs;function Ls(){if(this.t<1)return 0;var e=this.data[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function jt(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Us(e){var t=ue();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(k.ZERO)>0&&this.m.subTo(t,t),t}function Ds(e){var t=ue();return e.copyTo(t),this.reduce(t),t}function ks(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var a=e.data[t]&32767,r=a*this.mpl+((a*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(a=t+this.m.t,e.data[a]+=this.m.am(0,r,e,t,0,this.m.t);e.data[a]>=e.DV;)e.data[a]-=e.DV,e.data[++a]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function Ps(e,t){e.squareTo(t),this.reduce(t)}function Vs(e,t,a){e.multiplyTo(t,a),this.reduce(a)}jt.prototype.convert=Us;jt.prototype.revert=Ds;jt.prototype.reduce=ks;jt.prototype.mulTo=Vs;jt.prototype.sqrTo=Ps;function Fs(){return(this.t>0?this.data[0]&1:this.s)==0}function Os(e,t){if(e>4294967295||e<1)return k.ONE;var a=ue(),r=ue(),i=t.convert(this),s=$r(e)-1;for(i.copyTo(a);--s>=0;)if(t.sqrTo(a,r),(e&1<<s)>0)t.mulTo(r,i,a);else{var n=a;a=r,r=n}return t.revert(a)}function Ks(e,t){var a;return e<256||t.isEven()?a=new $t(t):a=new jt(t),this.exp(e,a)}k.prototype.copyTo=fs;k.prototype.fromInt=ls;k.prototype.fromString=cs;k.prototype.clamp=hs;k.prototype.dlShiftTo=ms;k.prototype.drShiftTo=Cs;k.prototype.lShiftTo=Es;k.prototype.rShiftTo=xs;k.prototype.subTo=Ss;k.prototype.multiplyTo=Ts;k.prototype.squareTo=Is;k.prototype.divRemTo=Bs;k.prototype.invDigit=Ls;k.prototype.isEven=Fs;k.prototype.exp=Os;k.prototype.toString=ps;k.prototype.negate=ds;k.prototype.abs=ys;k.prototype.compareTo=gs;k.prototype.bitLength=vs;k.prototype.mod=As;k.prototype.modPowInt=Ks;k.ZERO=Ft(0);k.ONE=Ft(1);function Ms(){var e=ue();return this.copyTo(e),e}function Hs(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function Gs(){return this.t==0?this.s:this.data[0]<<24>>24}function qs(){return this.t==0?this.s:this.data[0]<<16>>16}function Qs(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function zs(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function Ys(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),a=Math.pow(e,t),r=Ft(a),i=ue(),s=ue(),n="";for(this.divRemTo(r,i,s);i.signum()>0;)n=(a+s.intValue()).toString(e).substr(1)+n,i.divRemTo(r,i,s);return s.intValue().toString(e)+n}function Xs(e,t){this.fromInt(0),t==null&&(t=10);for(var a=this.chunkSize(t),r=Math.pow(t,a),i=!1,s=0,n=0,o=0;o<e.length;++o){var l=Ui(e,o);if(l<0){e.charAt(o)=="-"&&this.signum()==0&&(i=!0);continue}n=t*n+l,++s>=a&&(this.dMultiply(r),this.dAddOffset(n,0),s=0,n=0)}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(n,0)),i&&k.ZERO.subTo(this,this)}function Ws(e,t,a){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,a),this.testBit(e-1)||this.bitwiseTo(k.ONE.shiftLeft(e-1),ka,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(k.ONE.shiftLeft(e-1),this);else{var r=new Array,i=e&7;r.length=(e>>3)+1,t.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}}function $s(){var e=this.t,t=new Array;t[0]=this.s;var a=this.DB-e*this.DB%8,r,i=0;if(e-- >0)for(a<this.DB&&(r=this.data[e]>>a)!=(this.s&this.DM)>>a&&(t[i++]=r|this.s<<this.DB-a);e>=0;)a<8?(r=(this.data[e]&(1<<a)-1)<<8-a,r|=this.data[--e]>>(a+=this.DB-8)):(r=this.data[e]>>(a-=8)&255,a<=0&&(a+=this.DB,--e)),r&128&&(r|=-256),i==0&&(this.s&128)!=(r&128)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t}function js(e){return this.compareTo(e)==0}function Zs(e){return this.compareTo(e)<0?this:e}function Js(e){return this.compareTo(e)>0?this:e}function eo(e,t,a){var r,i,s=Math.min(e.t,this.t);for(r=0;r<s;++r)a.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(i=e.s&this.DM,r=s;r<this.t;++r)a.data[r]=t(this.data[r],i);a.t=this.t}else{for(i=this.s&this.DM,r=s;r<e.t;++r)a.data[r]=t(i,e.data[r]);a.t=e.t}a.s=t(this.s,e.s),a.clamp()}function to(e,t){return e&t}function ro(e){var t=ue();return this.bitwiseTo(e,to,t),t}function ka(e,t){return e|t}function ao(e){var t=ue();return this.bitwiseTo(e,ka,t),t}function Di(e,t){return e^t}function io(e){var t=ue();return this.bitwiseTo(e,Di,t),t}function ki(e,t){return e&~t}function no(e){var t=ue();return this.bitwiseTo(e,ki,t),t}function so(){for(var e=ue(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function oo(e){var t=ue();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function uo(e){var t=ue();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function fo(e){if(e==0)return-1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function lo(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+fo(this.data[e]);return this.s<0?this.t*this.DB:-1}function co(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function ho(){for(var e=0,t=this.s&this.DM,a=0;a<this.t;++a)e+=co(this.data[a]^t);return e}function po(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function yo(e,t){var a=k.ONE.shiftLeft(e);return this.bitwiseTo(a,t,a),a}function go(e){return this.changeBit(e,ka)}function vo(e){return this.changeBit(e,ki)}function mo(e){return this.changeBit(e,Di)}function Co(e,t){for(var a=0,r=0,i=Math.min(e.t,this.t);a<i;)r+=this.data[a]+e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;a<this.t;)r+=this.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;a<e.t;)r+=e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[a++]=r:r<-1&&(t.data[a++]=this.DV+r),t.t=a,t.clamp()}function Eo(e){var t=ue();return this.addTo(e,t),t}function xo(e){var t=ue();return this.subTo(e,t),t}function So(e){var t=ue();return this.multiplyTo(e,t),t}function To(){var e=ue();return this.squareTo(e),e}function Io(e){var t=ue();return this.divRemTo(e,t,null),t}function Bo(e){var t=ue();return this.divRemTo(e,null,t),t}function Ao(e){var t=ue(),a=ue();return this.divRemTo(e,t,a),new Array(t,a)}function bo(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function _o(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function Tr(){}function Pi(e){return e}function wo(e,t,a){e.multiplyTo(t,a)}function No(e,t){e.squareTo(t)}Tr.prototype.convert=Pi;Tr.prototype.revert=Pi;Tr.prototype.mulTo=wo;Tr.prototype.sqrTo=No;function Ro(e){return this.exp(e,new Tr)}function Lo(e,t,a){var r=Math.min(this.t+e.t,t);for(a.s=0,a.t=r;r>0;)a.data[--r]=0;var i;for(i=a.t-this.t;r<i;++r)a.data[r+this.t]=this.am(0,e.data[r],a,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e.data[r],a,r,0,t-r);a.clamp()}function Uo(e,t,a){--t;var r=a.t=this.t+e.t-t;for(a.s=0;--r>=0;)a.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)a.data[this.t+r-t]=this.am(t-r,e.data[r],a,0,0,this.t+r-t);a.clamp(),a.drShiftTo(1,a)}function lr(e){this.r2=ue(),this.q3=ue(),k.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function Do(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=ue();return e.copyTo(t),this.reduce(t),t}function ko(e){return e}function Po(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function Vo(e,t){e.squareTo(t),this.reduce(t)}function Fo(e,t,a){e.multiplyTo(t,a),this.reduce(a)}lr.prototype.convert=Do;lr.prototype.revert=ko;lr.prototype.reduce=Po;lr.prototype.mulTo=Fo;lr.prototype.sqrTo=Vo;function Oo(e,t){var a=e.bitLength(),r,i=Ft(1),s;if(a<=0)return i;a<18?r=1:a<48?r=3:a<144?r=4:a<768?r=5:r=6,a<8?s=new $t(t):t.isEven()?s=new lr(t):s=new jt(t);var n=new Array,o=3,l=r-1,f=(1<<r)-1;if(n[1]=s.convert(this),r>1){var u=ue();for(s.sqrTo(n[1],u);o<=f;)n[o]=ue(),s.mulTo(u,n[o-2],n[o]),o+=2}var p=e.t-1,m,S=!0,C=ue(),A;for(a=$r(e.data[p])-1;p>=0;){for(a>=l?m=e.data[p]>>a-l&f:(m=(e.data[p]&(1<<a+1)-1)<<l-a,p>0&&(m|=e.data[p-1]>>this.DB+a-l)),o=r;!(m&1);)m>>=1,--o;if((a-=o)<0&&(a+=this.DB,--p),S)n[m].copyTo(i),S=!1;else{for(;o>1;)s.sqrTo(i,C),s.sqrTo(C,i),o-=2;o>0?s.sqrTo(i,C):(A=i,i=C,C=A),s.mulTo(C,n[m],i)}for(;p>=0&&!(e.data[p]&1<<a);)s.sqrTo(i,C),A=i,i=C,C=A,--a<0&&(a=this.DB-1,--p)}return s.revert(i)}function Ko(e){var t=this.s<0?this.negate():this.clone(),a=e.s<0?e.negate():e.clone();if(t.compareTo(a)<0){var r=t;t=a,a=r}var i=t.getLowestSetBit(),s=a.getLowestSetBit();if(s<0)return t;for(i<s&&(s=i),s>0&&(t.rShiftTo(s,t),a.rShiftTo(s,a));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=a.getLowestSetBit())>0&&a.rShiftTo(i,a),t.compareTo(a)>=0?(t.subTo(a,t),t.rShiftTo(1,t)):(a.subTo(t,a),a.rShiftTo(1,a));return s>0&&a.lShiftTo(s,a),a}function Mo(e){if(e<=0)return 0;var t=this.DV%e,a=this.s<0?e-1:0;if(this.t>0)if(t==0)a=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)a=(t*a+this.data[r])%e;return a}function Ho(e){if(this.signum()==0)return k.ZERO;var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return k.ZERO;for(var a=e.clone(),r=this.clone(),i=Ft(1),s=Ft(0),n=Ft(0),o=Ft(1);a.signum()!=0;){for(;a.isEven();)a.rShiftTo(1,a),t?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(e,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;r.isEven();)r.rShiftTo(1,r),t?((!n.isEven()||!o.isEven())&&(n.addTo(this,n),o.subTo(e,o)),n.rShiftTo(1,n)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);a.compareTo(r)>=0?(a.subTo(r,a),t&&i.subTo(n,i),s.subTo(o,s)):(r.subTo(a,r),t&&n.subTo(i,n),o.subTo(s,o))}if(r.compareTo(k.ONE)!=0)return k.ZERO;if(o.compareTo(e)>=0)return o.subtract(e);if(o.signum()<0)o.addTo(e,o);else return o;return o.signum()<0?o.add(e):o}var dt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Go=(1<<26)/dt[dt.length-1];function qo(e){var t,a=this.abs();if(a.t==1&&a.data[0]<=dt[dt.length-1]){for(t=0;t<dt.length;++t)if(a.data[0]==dt[t])return!0;return!1}if(a.isEven())return!1;for(t=1;t<dt.length;){for(var r=dt[t],i=t+1;i<dt.length&&r<Go;)r*=dt[i++];for(r=a.modInt(r);t<i;)if(r%dt[t++]==0)return!1}return a.millerRabin(e)}function Qo(e){var t=this.subtract(k.ONE),a=t.getLowestSetBit();if(a<=0)return!1;for(var r=t.shiftRight(a),i=zo(),s,n=0;n<e;++n){do s=new k(this.bitLength(),i);while(s.compareTo(k.ONE)<=0||s.compareTo(t)>=0);var o=s.modPow(r,this);if(o.compareTo(k.ONE)!=0&&o.compareTo(t)!=0){for(var l=1;l++<a&&o.compareTo(t)!=0;)if(o=o.modPowInt(2,this),o.compareTo(k.ONE)==0)return!1;if(o.compareTo(t)!=0)return!1}}return!0}function zo(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}k.prototype.chunkSize=Qs;k.prototype.toRadix=Ys;k.prototype.fromRadix=Xs;k.prototype.fromNumber=Ws;k.prototype.bitwiseTo=eo;k.prototype.changeBit=yo;k.prototype.addTo=Co;k.prototype.dMultiply=bo;k.prototype.dAddOffset=_o;k.prototype.multiplyLowerTo=Lo;k.prototype.multiplyUpperTo=Uo;k.prototype.modInt=Mo;k.prototype.millerRabin=Qo;k.prototype.clone=Ms;k.prototype.intValue=Hs;k.prototype.byteValue=Gs;k.prototype.shortValue=qs;k.prototype.signum=zs;k.prototype.toByteArray=$s;k.prototype.equals=js;k.prototype.min=Zs;k.prototype.max=Js;k.prototype.and=ro;k.prototype.or=ao;k.prototype.xor=io;k.prototype.andNot=no;k.prototype.not=so;k.prototype.shiftLeft=oo;k.prototype.shiftRight=uo;k.prototype.getLowestSetBit=lo;k.prototype.bitCount=ho;k.prototype.testBit=po;k.prototype.setBit=go;k.prototype.clearBit=vo;k.prototype.flipBit=mo;k.prototype.add=Eo;k.prototype.subtract=xo;k.prototype.multiply=So;k.prototype.divide=Io;k.prototype.remainder=Bo;k.prototype.divideAndRemainder=Ao;k.prototype.modPow=Oo;k.prototype.modInverse=Ho;k.prototype.pow=Ro;k.prototype.gcd=Ko;k.prototype.isProbablePrime=qo;k.prototype.square=To;var It=ee,Vi=It.sha1=It.sha1||{};It.md.sha1=It.md.algorithms.sha1=Vi;Vi.create=function(){Fi||Yo();var e=null,t=It.util.createBuffer(),a=new Array(80),r={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var i=r.messageLengthSize/4,s=0;s<i;++s)r.fullMessageLength.push(0);return t=It.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},r},r.start(),r.update=function(i,s){s==="utf8"&&(i=It.util.encodeUtf8(i));var n=i.length;r.messageLength+=n,n=[n/4294967296>>>0,n>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=n[1],n[1]=n[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,n[0]=n[1]/4294967296>>>0;return t.putBytes(i),ai(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var i=It.util.createBuffer();i.putBytes(t.bytes());var s=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,n=s&r.blockLength-1;i.putBytes(ya.substr(0,r.blockLength-n));for(var o,l,f=r.fullMessageLength[0]*8,u=0;u<r.fullMessageLength.length-1;++u)o=r.fullMessageLength[u+1]*8,l=o/4294967296>>>0,f+=l,i.putInt32(f>>>0),f=o>>>0;i.putInt32(f);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};ai(p,a,i);var m=It.util.createBuffer();return m.putInt32(p.h0),m.putInt32(p.h1),m.putInt32(p.h2),m.putInt32(p.h3),m.putInt32(p.h4),m},r};var ya=null,Fi=!1;function Yo(){ya="€",ya+=It.util.fillString("\0",64),Fi=!0}function ai(e,t,a){for(var r,i,s,n,o,l,f,u,p=a.length();p>=64;){for(i=e.h0,s=e.h1,n=e.h2,o=e.h3,l=e.h4,u=0;u<16;++u)r=a.getInt32(),t[u]=r,f=o^s&(n^o),r=(i<<5|i>>>27)+f+l+1518500249+r,l=o,o=n,n=(s<<30|s>>>2)>>>0,s=i,i=r;for(;u<20;++u)r=t[u-3]^t[u-8]^t[u-14]^t[u-16],r=r<<1|r>>>31,t[u]=r,f=o^s&(n^o),r=(i<<5|i>>>27)+f+l+1518500249+r,l=o,o=n,n=(s<<30|s>>>2)>>>0,s=i,i=r;for(;u<32;++u)r=t[u-3]^t[u-8]^t[u-14]^t[u-16],r=r<<1|r>>>31,t[u]=r,f=s^n^o,r=(i<<5|i>>>27)+f+l+1859775393+r,l=o,o=n,n=(s<<30|s>>>2)>>>0,s=i,i=r;for(;u<40;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,f=s^n^o,r=(i<<5|i>>>27)+f+l+1859775393+r,l=o,o=n,n=(s<<30|s>>>2)>>>0,s=i,i=r;for(;u<60;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,f=s&n|o&(s^n),r=(i<<5|i>>>27)+f+l+2400959708+r,l=o,o=n,n=(s<<30|s>>>2)>>>0,s=i,i=r;for(;u<80;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,f=s^n^o,r=(i<<5|i>>>27)+f+l+3395469782+r,l=o,o=n,n=(s<<30|s>>>2)>>>0,s=i,i=r;e.h0=e.h0+i|0,e.h1=e.h1+s|0,e.h2=e.h2+n|0,e.h3=e.h3+o|0,e.h4=e.h4+l|0,p-=64}}var Bt=ee,Oi=Bt.pkcs1=Bt.pkcs1||{};Oi.encode_rsa_oaep=function(e,t,a){var r,i,s,n;typeof a=="string"?(r=a,i=arguments[3]||void 0,s=arguments[4]||void 0):a&&(r=a.label||void 0,i=a.seed||void 0,s=a.md||void 0,a.mgf1&&a.mgf1.md&&(n=a.mgf1.md)),s?s.start():s=Bt.md.sha1.create(),n||(n=s);var o=Math.ceil(e.n.bitLength()/8),l=o-2*s.digestLength-2;if(t.length>l){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=t.length,f.maxLength=l,f}r||(r=""),s.update(r,"raw");for(var u=s.digest(),p="",m=l-t.length,S=0;S<m;S++)p+="\0";var C=u.getBytes()+p+""+t;if(!i)i=Bt.random.getBytes(s.digestLength);else if(i.length!==s.digestLength){var f=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw f.seedLength=i.length,f.digestLength=s.digestLength,f}var A=kr(i,o-s.digestLength-1,n),b=Bt.util.xorBytes(C,A,C.length),w=kr(b,s.digestLength,n),U=Bt.util.xorBytes(i,w,i.length);return"\0"+U+b};Oi.decode_rsa_oaep=function(e,t,a){var r,i,s;typeof a=="string"?(r=a,i=arguments[3]||void 0):a&&(r=a.label||void 0,i=a.md||void 0,a.mgf1&&a.mgf1.md&&(s=a.mgf1.md));var n=Math.ceil(e.n.bitLength()/8);if(t.length!==n){var b=new Error("RSAES-OAEP encoded message length is invalid.");throw b.length=t.length,b.expectedLength=n,b}if(i===void 0?i=Bt.md.sha1.create():i.start(),s||(s=i),n<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");r||(r=""),i.update(r,"raw");for(var o=i.digest().getBytes(),l=t.charAt(0),f=t.substring(1,i.digestLength+1),u=t.substring(1+i.digestLength),p=kr(u,i.digestLength,s),m=Bt.util.xorBytes(f,p,f.length),S=kr(m,n-i.digestLength-1,s),C=Bt.util.xorBytes(u,S,u.length),A=C.substring(0,i.digestLength),b=l!=="\0",w=0;w<i.digestLength;++w)b|=o.charAt(w)!==A.charAt(w);for(var U=1,D=i.digestLength,G=i.digestLength;G<C.length;G++){var K=C.charCodeAt(G),F=K&1^1,$=U?65534:0;b|=K&$,U=U&F,D+=U}if(b||C.charCodeAt(D)!==1)throw new Error("Invalid RSAES-OAEP padding.");return C.substring(D+1)};function kr(e,t,a){a||(a=Bt.md.sha1.create());for(var r="",i=Math.ceil(t/a.digestLength),s=0;s<i;++s){var n=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,s&255);a.start(),a.update(e+n),r+=a.digest().getBytes()}return r.substring(0,t)}var Ut=ee;(function(){if(Ut.prime){Ut.prime;return}var e=Ut.prime=Ut.prime||{},t=Ut.jsbn.BigInteger,a=[6,4,2,4,2,4,6,2],r=new t(null);r.fromInt(30);var i=function(p,m){return p|m};e.generateProbablePrime=function(p,m,S){typeof m=="function"&&(S=m,m={}),m=m||{};var C=m.algorithm||"PRIMEINC";typeof C=="string"&&(C={name:C}),C.options=C.options||{};var A=m.prng||Ut.random,b={nextBytes:function(w){for(var U=A.getBytesSync(w.length),D=0;D<w.length;++D)w[D]=U.charCodeAt(D)}};if(C.name==="PRIMEINC")return s(p,b,C.options,S);throw new Error("Invalid prime generation algorithm: "+C.name)};function s(p,m,S,C){return"workers"in S?l(p,m,S,C):n(p,m,S,C)}function n(p,m,S,C){var A=f(p,m),b=0,w=u(A.bitLength());"millerRabinTests"in S&&(w=S.millerRabinTests);var U=10;"maxBlockTime"in S&&(U=S.maxBlockTime),o(A,p,m,b,w,U,C)}function o(p,m,S,C,A,b,w){var U=+new Date;do{if(p.bitLength()>m&&(p=f(m,S)),p.isProbablePrime(A))return w(null,p);p.dAddOffset(a[C++%8],0)}while(b<0||+new Date-U<b);Ut.util.setImmediate(function(){o(p,m,S,C,A,b,w)})}function l(p,m,S,C){if(typeof Worker>"u")return n(p,m,S,C);var A=f(p,m),b=S.workers,w=S.workLoad||100,U=w*30/8,D=S.workerScript||"forge/prime.worker.js";if(b===-1)return Ut.util.estimateCores(function(K,F){K&&(F=2),b=F-1,G()});G();function G(){b=Math.max(1,b);for(var K=[],F=0;F<b;++F)K[F]=new Worker(D);for(var F=0;F<b;++F)K[F].addEventListener("message",j);var $=!1;function j(le){if(!$){var he=le.data;if(he.found){for(var de=0;de<K.length;++de)K[de].terminate();return $=!0,C(null,new t(he.prime,16))}A.bitLength()>p&&(A=f(p,m));var Ee=A.toString(16);le.target.postMessage({hex:Ee,workLoad:w}),A.dAddOffset(U,0)}}}}function f(p,m){var S=new t(p,m),C=p-1;return S.testBit(C)||S.bitwiseTo(t.ONE.shiftLeft(C),i,S),S.dAddOffset(31-S.mod(r).byteValue(),0),S}function u(p){return p<=100?27:p<=150?18:p<=200?15:p<=250?12:p<=300?9:p<=350?8:p<=400?7:p<=500?6:p<=600?5:p<=800?4:p<=1250?3:2}})();var Y=ee;if(typeof fe>"u")var fe=Y.jsbn.BigInteger;var ga=Y.util.isNodejs?Ua:null,_=Y.asn1,lt=Y.util;Y.pki=Y.pki||{};Y.pki.rsa=Y.rsa=Y.rsa||{};var Z=Y.pki,Xo=[6,4,2,4,2,4,6,2],Wo={name:"PrivateKeyInfo",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},$o={name:"RSAPrivateKey",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},jo={name:"RSAPublicKey",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},Zo=Y.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},Jo={name:"DigestInfo",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:_.Class.UNIVERSAL,type:_.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},e0=function(e){var t;if(e.algorithm in Z.oids)t=Z.oids[e.algorithm];else{var a=new Error("Unknown message digest algorithm.");throw a.algorithm=e.algorithm,a}var r=_.oidToDer(t).getBytes(),i=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]),s=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);s.value.push(_.create(_.Class.UNIVERSAL,_.Type.OID,!1,r)),s.value.push(_.create(_.Class.UNIVERSAL,_.Type.NULL,!1,""));var n=_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(s),i.value.push(n),_.toDer(i).getBytes()},Ki=function(e,t,a){if(a)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(fe.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(fe.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var r;do r=new fe(Y.util.bytesToHex(Y.random.getBytes(t.n.bitLength()/8)),16);while(r.compareTo(t.n)>=0||!r.gcd(t.n).equals(fe.ONE));e=e.multiply(r.modPow(t.e,t.n)).mod(t.n);for(var i=e.mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(s)<0;)i=i.add(t.p);var n=i.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return n=n.multiply(r.modInverse(t.n)).mod(t.n),n};Z.rsa.encrypt=function(e,t,a){var r=a,i,s=Math.ceil(t.n.bitLength()/8);a!==!1&&a!==!0?(r=a===2,i=Mi(e,t,a)):(i=Y.util.createBuffer(),i.putBytes(e));for(var n=new fe(i.toHex(),16),o=Ki(n,t,r),l=o.toString(16),f=Y.util.createBuffer(),u=s-Math.ceil(l.length/2);u>0;)f.putByte(0),--u;return f.putBytes(Y.util.hexToBytes(l)),f.getBytes()};Z.rsa.decrypt=function(e,t,a,r){var i=Math.ceil(t.n.bitLength()/8);if(e.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=i,s}var n=new fe(Y.util.createBuffer(e).toHex(),16);if(n.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=Ki(n,t,a),l=o.toString(16),f=Y.util.createBuffer(),u=i-Math.ceil(l.length/2);u>0;)f.putByte(0),--u;return f.putBytes(Y.util.hexToBytes(l)),r!==!1?Pr(f.getBytes(),t,a):f.getBytes()};Z.rsa.createKeyPairGenerationState=function(e,t,a){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,a=a||{};var r=a.prng||Y.random,i={nextBytes:function(o){for(var l=r.getBytesSync(o.length),f=0;f<o.length;++f)o[f]=l.charCodeAt(f)}},s=a.algorithm||"PRIMEINC",n;if(s==="PRIMEINC")n={algorithm:s,state:0,bits:e,rng:i,eInt:t||65537,e:new fe(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},n.e.fromInt(n.eInt);else throw new Error("Invalid key generation algorithm: "+s);return n};Z.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var a=new fe(null);a.fromInt(30);for(var r=0,i=function(p,m){return p|m},s=+new Date,n,o=0;e.keys===null&&(t<=0||o<t);){if(e.state===0){var l=e.p===null?e.pBits:e.qBits,f=l-1;e.pqState===0?(e.num=new fe(l,e.rng),e.num.testBit(f)||e.num.bitwiseTo(fe.ONE.shiftLeft(f),i,e.num),e.num.dAddOffset(31-e.num.mod(a).byteValue(),0),r=0,++e.pqState):e.pqState===1?e.num.bitLength()>l?e.pqState=0:e.num.isProbablePrime(r0(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(Xo[r++%8],0):e.pqState===2?e.pqState=e.num.subtract(fe.ONE).gcd(e.e).compareTo(fe.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(fe.ONE),e.q1=e.q.subtract(fe.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(fe.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var u=e.e.modInverse(e.phi);e.keys={privateKey:Z.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:Z.rsa.setPublicKey(e.n,e.e)}}n=+new Date,o+=n-s,s=n}return e.keys!==null};Z.rsa.generateKeyPair=function(e,t,a,r){if(arguments.length===1?typeof e=="object"?(a=e,e=void 0):typeof e=="function"&&(r=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(r=t,t=void 0):typeof t!="number"&&(a=t,t=void 0):(a=e,r=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof a=="function"&&(r=a,a=void 0):(r=a,a=t,t=void 0)),a=a||{},e===void 0&&(e=a.bits||2048),t===void 0&&(t=a.e||65537),!Y.options.usePureJavaScript&&!a.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(r){if(ii("generateKeyPair"))return ga.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,l,f){if(o)return r(o);r(null,{privateKey:Z.privateKeyFromPem(f),publicKey:Z.publicKeyFromPem(l)})});if(ni("generateKey")&&ni("exportKey"))return lt.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:oi(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return lt.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){r(o)}).then(function(o){if(o){var l=Z.privateKeyFromAsn1(_.fromDer(Y.util.createBuffer(o)));r(null,{privateKey:l,publicKey:Z.setRsaPublicKey(l.n,l.e)})}});if(si("generateKey")&&si("exportKey")){var i=lt.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:oi(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(o){var l=o.target.result,f=lt.globalScope.msCrypto.subtle.exportKey("pkcs8",l.privateKey);f.oncomplete=function(u){var p=u.target.result,m=Z.privateKeyFromAsn1(_.fromDer(Y.util.createBuffer(p)));r(null,{privateKey:m,publicKey:Z.setRsaPublicKey(m.n,m.e)})},f.onerror=function(u){r(u)}},i.onerror=function(o){r(o)};return}}else if(ii("generateKeyPairSync")){var s=ga.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Z.privateKeyFromPem(s.privateKey),publicKey:Z.publicKeyFromPem(s.publicKey)}}}var n=Z.rsa.createKeyPairGenerationState(e,t,a);if(!r)return Z.rsa.stepKeyPairGenerationState(n,0),n.keys;t0(n,a,r)};Z.setRsaPublicKey=Z.rsa.setPublicKey=function(e,t){var a={n:e,e:t};return a.encrypt=function(r,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(o,l,f){return Mi(o,l,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(o,l){return Y.pkcs1.encode_rsa_oaep(l,o,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(o){return o}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var n=i.encode(r,a,!0);return Z.rsa.encrypt(n,a,!0)},a.verify=function(r,i,s,n){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),n===void 0&&(n={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in n||(n._parseAllDigestBytes=!0),"_skipPaddingChecks"in n||(n._skipPaddingChecks=!1),s==="RSASSA-PKCS1-V1_5"?s={verify:function(l,f){f=Pr(f,a,!0,void 0,n);var u=_.fromDer(f,{parseAllBytes:n._parseAllDigestBytes}),p={},m=[];if(!_.validate(u,Jo,p,m)||u.value.length!==2){var S=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw S.errors=m,S}var C=_.derToOid(p.algorithmIdentifier);if(!(C===Y.oids.md2||C===Y.oids.md5||C===Y.oids.sha1||C===Y.oids.sha224||C===Y.oids.sha256||C===Y.oids.sha384||C===Y.oids.sha512||C===Y.oids["sha512-224"]||C===Y.oids["sha512-256"])){var S=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw S.oid=C,S}if((C===Y.oids.md2||C===Y.oids.md5)&&!("parameters"in p))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return l===p.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(l,f){return f=Pr(f,a,!0,void 0,n),l===f}});var o=Z.rsa.decrypt(i,a,!0,!1);return s.verify(r,o,a.n.bitLength())},a};Z.setRsaPrivateKey=Z.rsa.setPrivateKey=function(e,t,a,r,i,s,n,o){var l={n:e,e:t,d:a,p:r,q:i,dP:s,dQ:n,qInv:o};return l.decrypt=function(f,u,p){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var m=Z.rsa.decrypt(f,l,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Pr};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(S,C){return Y.pkcs1.decode_rsa_oaep(C,S,p)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(S){return S}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(m,l,!1)},l.sign=function(f,u){var p=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:e0},p=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return f}},p=1);var m=u.encode(f,l.n.bitLength());return Z.rsa.encrypt(m,l,p)},l};Z.wrapRsaPrivateKey=function(e){return _.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(0).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(Z.oids.rsaEncryption).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")]),_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,_.toDer(e).getBytes())])};Z.privateKeyFromAsn1=function(e){var t={},a=[];if(_.validate(e,Wo,t,a)&&(e=_.fromDer(Y.util.createBuffer(t.privateKey))),t={},a=[],!_.validate(e,$o,t,a)){var r=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw r.errors=a,r}var i,s,n,o,l,f,u,p;return i=Y.util.createBuffer(t.privateKeyModulus).toHex(),s=Y.util.createBuffer(t.privateKeyPublicExponent).toHex(),n=Y.util.createBuffer(t.privateKeyPrivateExponent).toHex(),o=Y.util.createBuffer(t.privateKeyPrime1).toHex(),l=Y.util.createBuffer(t.privateKeyPrime2).toHex(),f=Y.util.createBuffer(t.privateKeyExponent1).toHex(),u=Y.util.createBuffer(t.privateKeyExponent2).toHex(),p=Y.util.createBuffer(t.privateKeyCoefficient).toHex(),Z.setRsaPrivateKey(new fe(i,16),new fe(s,16),new fe(n,16),new fe(o,16),new fe(l,16),new fe(f,16),new fe(u,16),new fe(p,16))};Z.privateKeyToAsn1=Z.privateKeyToRSAPrivateKey=function(e){return _.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(0).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,mt(e.n)),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,mt(e.e)),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,mt(e.d)),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,mt(e.p)),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,mt(e.q)),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,mt(e.dP)),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,mt(e.dQ)),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,mt(e.qInv))])};Z.publicKeyFromAsn1=function(e){var t={},a=[];if(_.validate(e,Zo,t,a)){var r=_.derToOid(t.publicKeyOid);if(r!==Z.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=r,i}e=t.rsaPublicKey}if(a=[],!_.validate(e,jo,t,a)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=a,i}var s=Y.util.createBuffer(t.publicKeyModulus).toHex(),n=Y.util.createBuffer(t.publicKeyExponent).toHex();return Z.setRsaPublicKey(new fe(s,16),new fe(n,16))};Z.publicKeyToAsn1=Z.publicKeyToSubjectPublicKeyInfo=function(e){return _.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(Z.oids.rsaEncryption).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")]),_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,[Z.publicKeyToRSAPublicKey(e)])])};Z.publicKeyToRSAPublicKey=function(e){return _.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,mt(e.n)),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,mt(e.e))])};function Mi(e,t,a){var r=Y.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=e.length,s.max=i-11,s}r.putByte(0),r.putByte(a);var n=i-3-e.length,o;if(a===0||a===1){o=a===0?0:255;for(var l=0;l<n;++l)r.putByte(o)}else for(;n>0;){for(var f=0,u=Y.random.getBytes(n),l=0;l<n;++l)o=u.charCodeAt(l),o===0?++f:r.putByte(o);n=f}return r.putByte(0),r.putBytes(e),r}function Pr(e,t,a,r,i){var s=Math.ceil(t.n.bitLength()/8),n=Y.util.createBuffer(e),o=n.getByte(),l=n.getByte();if(o!==0||a&&l!==0&&l!==1||!a&&l!==2||a&&l===0&&typeof r>"u")throw new Error("Encryption block is invalid.");var f=0;if(l===0){f=s-3-r;for(var u=0;u<f;++u)if(n.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(l===1){for(f=0;n.length()>1;){if(n.getByte()!==255){--n.read;break}++f}if(f<8&&!(i&&i._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(l===2){for(f=0;n.length()>1;){if(n.getByte()===0){--n.read;break}++f}if(f<8&&!(i&&i._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var p=n.getByte();if(p!==0||f!==s-3-n.length())throw new Error("Encryption block is invalid.");return n.getBytes()}function t0(e,t,a){typeof t=="function"&&(a=t,t={}),t=t||{};var r={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(r.prng=t.prng),i();function i(){s(e.pBits,function(o,l){if(o)return a(o);if(e.p=l,e.q!==null)return n(o,e.q);s(e.qBits,n)})}function s(o,l){Y.prime.generateProbablePrime(o,r,l)}function n(o,l){if(o)return a(o);if(e.q=l,e.p.compareTo(e.q)<0){var f=e.p;e.p=e.q,e.q=f}if(e.p.subtract(fe.ONE).gcd(e.e).compareTo(fe.ONE)!==0){e.p=null,i();return}if(e.q.subtract(fe.ONE).gcd(e.e).compareTo(fe.ONE)!==0){e.q=null,s(e.qBits,n);return}if(e.p1=e.p.subtract(fe.ONE),e.q1=e.q.subtract(fe.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(fe.ONE)!==0){e.p=e.q=null,i();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,s(e.qBits,n);return}var u=e.e.modInverse(e.phi);e.keys={privateKey:Z.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:Z.rsa.setPublicKey(e.n,e.e)},a(null,e.keys)}}function mt(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var a=Y.util.hexToBytes(t);return a.length>1&&(a.charCodeAt(0)===0&&!(a.charCodeAt(1)&128)||a.charCodeAt(0)===255&&(a.charCodeAt(1)&128)===128)?a.substr(1):a}function r0(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function ii(e){return Y.util.isNodejs&&typeof ga[e]=="function"}function ni(e){return typeof lt.globalScope<"u"&&typeof lt.globalScope.crypto=="object"&&typeof lt.globalScope.crypto.subtle=="object"&&typeof lt.globalScope.crypto.subtle[e]=="function"}function si(e){return typeof lt.globalScope<"u"&&typeof lt.globalScope.msCrypto=="object"&&typeof lt.globalScope.msCrypto.subtle=="object"&&typeof lt.globalScope.msCrypto.subtle[e]=="function"}function oi(e){for(var t=Y.util.hexToBytes(e.toString(16)),a=new Uint8Array(t.length),r=0;r<t.length;++r)a[r]=t.charCodeAt(r);return a}var Q=ee;if(typeof a0>"u")var a0=Q.jsbn.BigInteger;var R=Q.asn1,J=Q.pki=Q.pki||{};J.pbe=Q.pbe=Q.pbe||{};var qt=J.oids,i0={name:"EncryptedPrivateKeyInfo",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:R.Class.UNIVERSAL,type:R.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:R.Class.UNIVERSAL,type:R.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},n0={name:"PBES2Algorithms",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:R.Class.UNIVERSAL,type:R.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:R.Class.UNIVERSAL,type:R.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:R.Class.UNIVERSAL,type:R.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:R.Class.UNIVERSAL,type:R.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:R.Class.UNIVERSAL,type:R.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:R.Class.UNIVERSAL,type:R.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:R.Class.UNIVERSAL,type:R.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},s0={name:"pkcs-12PbeParams",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:R.Class.UNIVERSAL,type:R.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:R.Class.UNIVERSAL,type:R.Type.INTEGER,constructed:!1,capture:"iterations"}]};J.encryptPrivateKeyInfo=function(e,t,a){a=a||{},a.saltSize=a.saltSize||8,a.count=a.count||2048,a.algorithm=a.algorithm||"aes128",a.prfAlgorithm=a.prfAlgorithm||"sha1";var r=Q.random.getBytesSync(a.saltSize),i=a.count,s=R.integerToDer(i),n,o,l;if(a.algorithm.indexOf("aes")===0||a.algorithm==="des"){var f,u,p;switch(a.algorithm){case"aes128":n=16,f=16,u=qt["aes128-CBC"],p=Q.aes.createEncryptionCipher;break;case"aes192":n=24,f=16,u=qt["aes192-CBC"],p=Q.aes.createEncryptionCipher;break;case"aes256":n=32,f=16,u=qt["aes256-CBC"],p=Q.aes.createEncryptionCipher;break;case"des":n=8,f=8,u=qt.desCBC,p=Q.des.createEncryptionCipher;break;default:var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=a.algorithm,m}var S="hmacWith"+a.prfAlgorithm.toUpperCase(),C=Gi(S),A=Q.pkcs5.pbkdf2(t,r,i,n,C),b=Q.random.getBytesSync(f),w=p(A);w.start(b),w.update(R.toDer(e)),w.finish(),l=w.output.getBytes();var U=o0(r,s,n,S);o=R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OID,!1,R.oidToDer(qt.pkcs5PBES2).getBytes()),R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OID,!1,R.oidToDer(qt.pkcs5PBKDF2).getBytes()),U]),R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OID,!1,R.oidToDer(u).getBytes()),R.create(R.Class.UNIVERSAL,R.Type.OCTETSTRING,!1,b)])])])}else if(a.algorithm==="3des"){n=24;var D=new Q.util.ByteBuffer(r),A=J.pbe.generatePkcs12Key(t,D,1,i,n),b=J.pbe.generatePkcs12Key(t,D,2,i,n),w=Q.des.createEncryptionCipher(A);w.start(b),w.update(R.toDer(e)),w.finish(),l=w.output.getBytes(),o=R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OID,!1,R.oidToDer(qt["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OCTETSTRING,!1,r),R.create(R.Class.UNIVERSAL,R.Type.INTEGER,!1,s.getBytes())])])}else{var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=a.algorithm,m}var G=R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[o,R.create(R.Class.UNIVERSAL,R.Type.OCTETSTRING,!1,l)]);return G};J.decryptPrivateKeyInfo=function(e,t){var a=null,r={},i=[];if(!R.validate(e,i0,r,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var n=R.derToOid(r.encryptionOid),o=J.pbe.getCipher(n,r.encryptionParams,t),l=Q.util.createBuffer(r.encryptedData);return o.update(l),o.finish()&&(a=R.fromDer(o.output)),a};J.encryptedPrivateKeyToPem=function(e,t){var a={type:"ENCRYPTED PRIVATE KEY",body:R.toDer(e).getBytes()};return Q.pem.encode(a,{maxline:t})};J.encryptedPrivateKeyFromPem=function(e){var t=Q.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var a=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return R.fromDer(t.body)};J.encryptRsaPrivateKey=function(e,t,a){if(a=a||{},!a.legacy){var r=J.wrapRsaPrivateKey(J.privateKeyToAsn1(e));return r=J.encryptPrivateKeyInfo(r,t,a),J.encryptedPrivateKeyToPem(r)}var i,s,n,o;switch(a.algorithm){case"aes128":i="AES-128-CBC",n=16,s=Q.random.getBytesSync(16),o=Q.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",n=24,s=Q.random.getBytesSync(16),o=Q.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",n=32,s=Q.random.getBytesSync(16),o=Q.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",n=24,s=Q.random.getBytesSync(8),o=Q.des.createEncryptionCipher;break;case"des":i="DES-CBC",n=8,s=Q.random.getBytesSync(8),o=Q.des.createEncryptionCipher;break;default:var l=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+a.algorithm+'".');throw l.algorithm=a.algorithm,l}var f=Q.pbe.opensslDeriveBytes(t,s.substr(0,8),n),u=o(f);u.start(s),u.update(R.toDer(J.privateKeyToAsn1(e))),u.finish();var p={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:Q.util.bytesToHex(s).toUpperCase()},body:u.output.getBytes()};return Q.pem.encode(p)};J.decryptRsaPrivateKey=function(e,t){var a=null,r=Q.pem.decode(e)[0];if(r.type!=="ENCRYPTED PRIVATE KEY"&&r.type!=="PRIVATE KEY"&&r.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(r.procType&&r.procType.type==="ENCRYPTED"){var s,n;switch(r.dekInfo.algorithm){case"DES-CBC":s=8,n=Q.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,n=Q.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,n=Q.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,n=Q.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,n=Q.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,n=function(p){return Q.rc2.createDecryptionCipher(p,40)};break;case"RC2-64-CBC":s=8,n=function(p){return Q.rc2.createDecryptionCipher(p,64)};break;case"RC2-128-CBC":s=16,n=function(p){return Q.rc2.createDecryptionCipher(p,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+r.dekInfo.algorithm+'".');throw i.algorithm=r.dekInfo.algorithm,i}var o=Q.util.hexToBytes(r.dekInfo.parameters),l=Q.pbe.opensslDeriveBytes(t,o.substr(0,8),s),f=n(l);if(f.start(o),f.update(Q.util.createBuffer(r.body)),f.finish())a=f.output.getBytes();else return a}else a=r.body;return r.type==="ENCRYPTED PRIVATE KEY"?a=J.decryptPrivateKeyInfo(R.fromDer(a),t):a=R.fromDer(a),a!==null&&(a=J.privateKeyFromAsn1(a)),a};J.pbe.generatePkcs12Key=function(e,t,a,r,i,s){var n,o;if(typeof s>"u"||s===null){if(!("sha1"in Q.md))throw new Error('"sha1" hash algorithm unavailable.');s=Q.md.sha1.create()}var l=s.digestLength,f=s.blockLength,u=new Q.util.ByteBuffer,p=new Q.util.ByteBuffer;if(e!=null){for(o=0;o<e.length;o++)p.putInt16(e.charCodeAt(o));p.putInt16(0)}var m=p.length(),S=t.length(),C=new Q.util.ByteBuffer;C.fillWithByte(a,f);var A=f*Math.ceil(S/f),b=new Q.util.ByteBuffer;for(o=0;o<A;o++)b.putByte(t.at(o%S));var w=f*Math.ceil(m/f),U=new Q.util.ByteBuffer;for(o=0;o<w;o++)U.putByte(p.at(o%m));var D=b;D.putBuffer(U);for(var G=Math.ceil(i/l),K=1;K<=G;K++){var F=new Q.util.ByteBuffer;F.putBytes(C.bytes()),F.putBytes(D.bytes());for(var $=0;$<r;$++)s.start(),s.update(F.getBytes()),F=s.digest();var j=new Q.util.ByteBuffer;for(o=0;o<f;o++)j.putByte(F.at(o%l));var le=Math.ceil(S/f)+Math.ceil(m/f),he=new Q.util.ByteBuffer;for(n=0;n<le;n++){var de=new Q.util.ByteBuffer(D.getBytes(f)),Ee=511;for(o=j.length()-1;o>=0;o--)Ee=Ee>>8,Ee+=j.at(o)+de.at(o),de.setAt(o,Ee&255);he.putBuffer(de)}D=he,u.putBuffer(F)}return u.truncate(u.length()-i),u};J.pbe.getCipher=function(e,t,a){switch(e){case J.oids.pkcs5PBES2:return J.pbe.getCipherForPBES2(e,t,a);case J.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case J.oids["pbewithSHAAnd40BitRC2-CBC"]:return J.pbe.getCipherForPKCS12PBE(e,t,a);default:var r=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw r.oid=e,r.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],r}};J.pbe.getCipherForPBES2=function(e,t,a){var r={},i=[];if(!R.validate(t,n0,r,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(e=R.derToOid(r.kdfOid),e!==J.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=e,s.supportedOids=["pkcs5PBKDF2"],s}if(e=R.derToOid(r.encOid),e!==J.oids["aes128-CBC"]&&e!==J.oids["aes192-CBC"]&&e!==J.oids["aes256-CBC"]&&e!==J.oids["des-EDE3-CBC"]&&e!==J.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=e,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var n=r.kdfSalt,o=Q.util.createBuffer(r.kdfIterationCount);o=o.getInt(o.length()<<3);var l,f;switch(J.oids[e]){case"aes128-CBC":l=16,f=Q.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=Q.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=Q.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=Q.des.createDecryptionCipher;break;case"desCBC":l=8,f=Q.des.createDecryptionCipher;break}var u=Hi(r.prfOid),p=Q.pkcs5.pbkdf2(a,n,o,l,u),m=r.encIv,S=f(p);return S.start(m),S};J.pbe.getCipherForPKCS12PBE=function(e,t,a){var r={},i=[];if(!R.validate(t,s0,r,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var n=Q.util.createBuffer(r.salt),o=Q.util.createBuffer(r.iterations);o=o.getInt(o.length()<<3);var l,f,u;switch(e){case J.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24,f=8,u=Q.des.startDecrypting;break;case J.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5,f=8,u=function(A,b){var w=Q.rc2.createDecryptionCipher(A,40);return w.start(b,null),w};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=e,s}var p=Hi(r.prfOid),m=J.pbe.generatePkcs12Key(a,n,1,o,l,p);p.start();var S=J.pbe.generatePkcs12Key(a,n,2,o,f,p);return u(m,S)};J.pbe.opensslDeriveBytes=function(e,t,a,r){if(typeof r>"u"||r===null){if(!("md5"in Q.md))throw new Error('"md5" hash algorithm unavailable.');r=Q.md.md5.create()}t===null&&(t="");for(var i=[ui(r,e+t)],s=16,n=1;s<a;++n,s+=16)i.push(ui(r,i[n-1]+e+t));return i.join("").substr(0,a)};function ui(e,t){return e.start().update(t).digest().getBytes()}function Hi(e){var t;if(!e)t="hmacWithSHA1";else if(t=J.oids[R.derToOid(e)],!t){var a=new Error("Unsupported PRF OID.");throw a.oid=e,a.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],a}return Gi(t)}function Gi(e){var t=Q.md;switch(e){case"hmacWithSHA224":t=Q.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var a=new Error("Unsupported PRF algorithm.");throw a.algorithm=e,a.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],a}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function o0(e,t,a,r){var i=R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OCTETSTRING,!1,e),R.create(R.Class.UNIVERSAL,R.Type.INTEGER,!1,t.getBytes())]);return r!=="hmacWithSHA1"&&i.value.push(R.create(R.Class.UNIVERSAL,R.Type.INTEGER,!1,Q.util.hexToBytes(a.toString(16))),R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OID,!1,R.oidToDer(J.oids[r]).getBytes()),R.create(R.Class.UNIVERSAL,R.Type.NULL,!1,"")])),i}var nr=ee,q=nr.asn1,cr=nr.pkcs7asn1=nr.pkcs7asn1||{};nr.pkcs7=nr.pkcs7||{};nr.pkcs7.asn1=cr;var qi={name:"ContentInfo",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:q.Class.UNIVERSAL,type:q.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:q.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};cr.contentInfoValidator=qi;var Qi={name:"EncryptedContentInfo",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:q.Class.UNIVERSAL,type:q.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:q.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:q.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};cr.envelopedDataValidator={name:"EnvelopedData",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:q.Class.UNIVERSAL,type:q.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(Qi)};cr.encryptedDataValidator={name:"EncryptedData",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"version"}].concat(Qi)};var u0={name:"SignerInfo",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:q.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:q.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:q.Class.UNIVERSAL,type:q.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:q.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};cr.signedDataValidator={name:"SignedData",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:q.Class.UNIVERSAL,type:q.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},qi,{name:"SignedData.Certificates",tagClass:q.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:q.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:q.Class.UNIVERSAL,type:q.Type.SET,capture:"signerInfos",optional:!0,value:[u0]}]};cr.recipientInfoValidator={name:"RecipientInfo",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:q.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:q.Class.UNIVERSAL,type:q.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]};var Wt=ee;Wt.mgf=Wt.mgf||{};var f0=Wt.mgf.mgf1=Wt.mgf1=Wt.mgf1||{};f0.create=function(e){var t={generate:function(a,r){for(var i=new Wt.util.ByteBuffer,s=Math.ceil(r/e.digestLength),n=0;n<s;n++){var o=new Wt.util.ByteBuffer;o.putInt32(n),e.start(),e.update(a+o.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}};return t};var Vr=ee;Vr.mgf=Vr.mgf||{};Vr.mgf.mgf1=Vr.mgf1;var Qt=ee,l0=Qt.pss=Qt.pss||{};l0.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,a=e.mgf,r=t.digestLength,i=e.salt||null;typeof i=="string"&&(i=Qt.util.createBuffer(i));var s;if("saltLength"in e)s=e.saltLength;else if(i!==null)s=i.length();else throw new Error("Salt length not specified or specific salt not given.");if(i!==null&&i.length()!==s)throw new Error("Given salt length does not match length of given salt.");var n=e.prng||Qt.random,o={};return o.encode=function(l,f){var u,p=f-1,m=Math.ceil(p/8),S=l.digest().getBytes();if(m<r+s+2)throw new Error("Message is too long to encrypt.");var C;i===null?C=n.getBytesSync(s):C=i.bytes();var A=new Qt.util.ByteBuffer;A.fillWithByte(0,8),A.putBytes(S),A.putBytes(C),t.start(),t.update(A.getBytes());var b=t.digest().getBytes(),w=new Qt.util.ByteBuffer;w.fillWithByte(0,m-s-r-2),w.putByte(1),w.putBytes(C);var U=w.getBytes(),D=m-r-1,G=a.generate(b,D),K="";for(u=0;u<D;u++)K+=String.fromCharCode(U.charCodeAt(u)^G.charCodeAt(u));var F=65280>>8*m-p&255;return K=String.fromCharCode(K.charCodeAt(0)&~F)+K.substr(1),K+b+"¼"},o.verify=function(l,f,u){var p,m=u-1,S=Math.ceil(m/8);if(f=f.substr(-S),S<r+s+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(f.charCodeAt(S-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var C=S-r-1,A=f.substr(0,C),b=f.substr(C,r),w=65280>>8*S-m&255;if(A.charCodeAt(0)&w)throw new Error("Bits beyond keysize not zero as expected.");var U=a.generate(b,C),D="";for(p=0;p<C;p++)D+=String.fromCharCode(A.charCodeAt(p)^U.charCodeAt(p));D=String.fromCharCode(D.charCodeAt(0)&~w)+D.substr(1);var G=S-r-s-2;for(p=0;p<G;p++)if(D.charCodeAt(p)!==0)throw new Error("Leftmost octets not zero as expected");if(D.charCodeAt(G)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var K=D.substr(-s),F=new Qt.util.ByteBuffer;F.fillWithByte(0,8),F.putBytes(l),F.putBytes(K),t.start(),t.update(F.getBytes());var $=t.digest().getBytes();return b===$},o};var X=ee,d=X.asn1,O=X.pki=X.pki||{},oe=O.oids,Re={};Re.CN=oe.commonName;Re.commonName="CN";Re.C=oe.countryName;Re.countryName="C";Re.L=oe.localityName;Re.localityName="L";Re.ST=oe.stateOrProvinceName;Re.stateOrProvinceName="ST";Re.O=oe.organizationName;Re.organizationName="O";Re.OU=oe.organizationalUnitName;Re.organizationalUnitName="OU";Re.E=oe.emailAddress;Re.emailAddress="E";var zi=X.pki.rsa.publicKeyValidator,c0={name:"Certificate",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:d.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:d.Class.UNIVERSAL,type:d.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:d.Class.UNIVERSAL,type:d.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:d.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:d.Class.UNIVERSAL,type:d.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:d.Class.UNIVERSAL,type:d.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:d.Class.UNIVERSAL,type:d.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:d.Class.UNIVERSAL,type:d.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},zi,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:d.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:d.Class.UNIVERSAL,type:d.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:d.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:d.Class.UNIVERSAL,type:d.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:d.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:d.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:d.Class.UNIVERSAL,type:d.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},h0={name:"rsapss",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:d.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:d.Class.UNIVERSAL,type:d.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:d.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:d.Class.UNIVERSAL,type:d.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:d.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:d.Class.UNIVERSAL,type:d.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:d.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:d.Class.UNIVERSAL,type:d.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},p0={name:"CertificationRequestInfo",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:d.Class.UNIVERSAL,type:d.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},zi,{name:"CertificationRequestInfo.attributes",tagClass:d.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:d.Class.UNIVERSAL,type:d.Type.SET,constructed:!0}]}]}]},d0={name:"CertificationRequest",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[p0,{name:"CertificationRequest.signatureAlgorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:d.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:d.Class.UNIVERSAL,type:d.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};O.RDNAttributesAsArray=function(e,t){for(var a=[],r,i,s,n=0;n<e.value.length;++n){r=e.value[n];for(var o=0;o<r.value.length;++o)s={},i=r.value[o],s.type=d.derToOid(i.value[0].value),s.value=i.value[1].value,s.valueTagClass=i.value[1].type,s.type in oe&&(s.name=oe[s.type],s.name in Re&&(s.shortName=Re[s.name])),t&&(t.update(s.type),t.update(s.value)),a.push(s)}return a};O.CRIAttributesAsArray=function(e){for(var t=[],a=0;a<e.length;++a)for(var r=e[a],i=d.derToOid(r.value[0].value),s=r.value[1].value,n=0;n<s.length;++n){var o={};if(o.type=i,o.value=s[n].value,o.valueTagClass=s[n].type,o.type in oe&&(o.name=oe[o.type],o.name in Re&&(o.shortName=Re[o.name])),o.type===oe.extensionRequest){o.extensions=[];for(var l=0;l<o.value.length;++l)o.extensions.push(O.certificateExtensionFromAsn1(o.value[l]))}t.push(o)}return t};function Ht(e,t){typeof t=="string"&&(t={shortName:t});for(var a=null,r,i=0;a===null&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(a=r);return a}var Fr=function(e,t,a){var r={};if(e!==oe["RSASSA-PSS"])return r;a&&(r={hash:{algorithmOid:oe.sha1},mgf:{algorithmOid:oe.mgf1,hash:{algorithmOid:oe.sha1}},saltLength:20});var i={},s=[];if(!d.validate(t,h0,i,s)){var n=new Error("Cannot read RSASSA-PSS parameter block.");throw n.errors=s,n}return i.hashOid!==void 0&&(r.hash=r.hash||{},r.hash.algorithmOid=d.derToOid(i.hashOid)),i.maskGenOid!==void 0&&(r.mgf=r.mgf||{},r.mgf.algorithmOid=d.derToOid(i.maskGenOid),r.mgf.hash=r.mgf.hash||{},r.mgf.hash.algorithmOid=d.derToOid(i.maskGenHashOid)),i.saltLength!==void 0&&(r.saltLength=i.saltLength.charCodeAt(0)),r},jr=function(e){switch(oe[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return X.md.sha1.create();case"md5WithRSAEncryption":return X.md.md5.create();case"sha256WithRSAEncryption":return X.md.sha256.create();case"sha384WithRSAEncryption":return X.md.sha384.create();case"sha512WithRSAEncryption":return X.md.sha512.create();case"RSASSA-PSS":return X.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},Yi=function(e){var t=e.certificate,a;switch(t.signatureOid){case oe.sha1WithRSAEncryption:case oe.sha1WithRSASignature:break;case oe["RSASSA-PSS"]:var r,i;if(r=oe[t.signatureParameters.mgf.hash.algorithmOid],r===void 0||X.md[r]===void 0){var s=new Error("Unsupported MGF hash function.");throw s.oid=t.signatureParameters.mgf.hash.algorithmOid,s.name=r,s}if(i=oe[t.signatureParameters.mgf.algorithmOid],i===void 0||X.mgf[i]===void 0){var s=new Error("Unsupported MGF function.");throw s.oid=t.signatureParameters.mgf.algorithmOid,s.name=i,s}if(i=X.mgf[i].create(X.md[r].create()),r=oe[t.signatureParameters.hash.algorithmOid],r===void 0||X.md[r]===void 0){var s=new Error("Unsupported RSASSA-PSS hash function.");throw s.oid=t.signatureParameters.hash.algorithmOid,s.name=r,s}a=X.pss.create(X.md[r].create(),i,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,a)};O.certificateFromPem=function(e,t,a){var r=X.pem.decode(e)[0];if(r.type!=="CERTIFICATE"&&r.type!=="X509 CERTIFICATE"&&r.type!=="TRUSTED CERTIFICATE"){var i=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw i.headerType=r.type,i}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var s=d.fromDer(r.body,a);return O.certificateFromAsn1(s,t)};O.certificateToPem=function(e,t){var a={type:"CERTIFICATE",body:d.toDer(O.certificateToAsn1(e)).getBytes()};return X.pem.encode(a,{maxline:t})};O.publicKeyFromPem=function(e){var t=X.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){var a=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var r=d.fromDer(t.body);return O.publicKeyFromAsn1(r)};O.publicKeyToPem=function(e,t){var a={type:"PUBLIC KEY",body:d.toDer(O.publicKeyToAsn1(e)).getBytes()};return X.pem.encode(a,{maxline:t})};O.publicKeyToRSAPublicKeyPem=function(e,t){var a={type:"RSA PUBLIC KEY",body:d.toDer(O.publicKeyToRSAPublicKey(e)).getBytes()};return X.pem.encode(a,{maxline:t})};O.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||X.md.sha1.create(),r=t.type||"RSAPublicKey",i;switch(r){case"RSAPublicKey":i=d.toDer(O.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":i=d.toDer(O.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}a.start(),a.update(i);var s=a.digest();if(t.encoding==="hex"){var n=s.toHex();return t.delimiter?n.match(/.{2}/g).join(t.delimiter):n}else{if(t.encoding==="binary")return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return s};O.certificationRequestFromPem=function(e,t,a){var r=X.pem.decode(e)[0];if(r.type!=="CERTIFICATE REQUEST"){var i=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw i.headerType=r.type,i}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var s=d.fromDer(r.body,a);return O.certificationRequestFromAsn1(s,t)};O.certificationRequestToPem=function(e,t){var a={type:"CERTIFICATE REQUEST",body:d.toDer(O.certificationRequestToAsn1(e)).getBytes()};return X.pem.encode(a,{maxline:t})};O.createCertificate=function(){var e={};return e.version=2,e.serialNumber="00",e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return Ht(e.issuer,t)},e.issuer.addField=function(t){ct([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return Ht(e.subject,t)},e.subject.addField=function(t){ct([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,a){ct(t),e.subject.attributes=t,delete e.subject.uniqueId,a&&(e.subject.uniqueId=a),e.subject.hash=null},e.setIssuer=function(t,a){ct(t),e.issuer.attributes=t,delete e.issuer.uniqueId,a&&(e.issuer.uniqueId=a),e.issuer.hash=null},e.setExtensions=function(t){for(var a=0;a<t.length;++a)Xi(t[a],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var a=null,r,i=0;a===null&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(a=r);return a},e.sign=function(t,a){e.md=a||X.md.sha1.create();var r=oe[e.md.algorithm+"WithRSAEncryption"];if(!r){var i=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=r,e.tbsCertificate=O.getTBSCertificate(e);var s=d.toDer(e.tbsCertificate);e.md.update(s.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var a=!1;if(!e.issued(t)){var r=t.issuer,i=e.subject,s=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw s.expectedIssuer=i.attributes,s.actualIssuer=r.attributes,s}var n=t.md;if(n===null){n=jr({signatureOid:t.signatureOid,type:"certificate"});var o=t.tbsCertificate||O.getTBSCertificate(t),l=d.toDer(o);n.update(l.getBytes())}return n!==null&&(a=Yi({certificate:e,md:n,signature:t.signature})),a},e.isIssuer=function(t){var a=!1,r=e.issuer,i=t.subject;if(r.hash&&i.hash)a=r.hash===i.hash;else if(r.attributes.length===i.attributes.length){a=!0;for(var s,n,o=0;a&&o<r.attributes.length;++o)s=r.attributes[o],n=i.attributes[o],(s.type!==n.type||s.value!==n.value)&&(a=!1)}return a},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return O.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=oe.subjectKeyIdentifier,a=0;a<e.extensions.length;++a){var r=e.extensions[a];if(r.id===t){var i=e.generateSubjectKeyIdentifier().getBytes();return X.util.hexToBytes(r.subjectKeyIdentifier)===i}}return!1},e};O.certificateFromAsn1=function(e,t){var a={},r=[];if(!d.validate(e,c0,a,r)){var i=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw i.errors=r,i}var s=d.derToOid(a.publicKeyOid);if(s!==O.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var n=O.createCertificate();n.version=a.certVersion?a.certVersion.charCodeAt(0):0;var o=X.util.createBuffer(a.certSerialNumber);n.serialNumber=o.toHex(),n.signatureOid=X.asn1.derToOid(a.certSignatureOid),n.signatureParameters=Fr(n.signatureOid,a.certSignatureParams,!0),n.siginfo.algorithmOid=X.asn1.derToOid(a.certinfoSignatureOid),n.siginfo.parameters=Fr(n.siginfo.algorithmOid,a.certinfoSignatureParams,!1),n.signature=a.certSignature;var l=[];if(a.certValidity1UTCTime!==void 0&&l.push(d.utcTimeToDate(a.certValidity1UTCTime)),a.certValidity2GeneralizedTime!==void 0&&l.push(d.generalizedTimeToDate(a.certValidity2GeneralizedTime)),a.certValidity3UTCTime!==void 0&&l.push(d.utcTimeToDate(a.certValidity3UTCTime)),a.certValidity4GeneralizedTime!==void 0&&l.push(d.generalizedTimeToDate(a.certValidity4GeneralizedTime)),l.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(l.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(n.validity.notBefore=l[0],n.validity.notAfter=l[1],n.tbsCertificate=a.tbsCertificate,t){n.md=jr({signatureOid:n.signatureOid,type:"certificate"});var f=d.toDer(n.tbsCertificate);n.md.update(f.getBytes())}var u=X.md.sha1.create(),p=d.toDer(a.certIssuer);u.update(p.getBytes()),n.issuer.getField=function(C){return Ht(n.issuer,C)},n.issuer.addField=function(C){ct([C]),n.issuer.attributes.push(C)},n.issuer.attributes=O.RDNAttributesAsArray(a.certIssuer),a.certIssuerUniqueId&&(n.issuer.uniqueId=a.certIssuerUniqueId),n.issuer.hash=u.digest().toHex();var m=X.md.sha1.create(),S=d.toDer(a.certSubject);return m.update(S.getBytes()),n.subject.getField=function(C){return Ht(n.subject,C)},n.subject.addField=function(C){ct([C]),n.subject.attributes.push(C)},n.subject.attributes=O.RDNAttributesAsArray(a.certSubject),a.certSubjectUniqueId&&(n.subject.uniqueId=a.certSubjectUniqueId),n.subject.hash=m.digest().toHex(),a.certExtensions?n.extensions=O.certificateExtensionsFromAsn1(a.certExtensions):n.extensions=[],n.publicKey=O.publicKeyFromAsn1(a.subjectPublicKeyInfo),n};O.certificateExtensionsFromAsn1=function(e){for(var t=[],a=0;a<e.value.length;++a)for(var r=e.value[a],i=0;i<r.value.length;++i)t.push(O.certificateExtensionFromAsn1(r.value[i]));return t};O.certificateExtensionFromAsn1=function(e){var t={};if(t.id=d.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===d.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in oe){if(t.name=oe[t.id],t.name==="keyUsage"){var a=d.fromDer(t.value),r=0,i=0;a.value.length>1&&(r=a.value.charCodeAt(1),i=a.value.length>2?a.value.charCodeAt(2):0),t.digitalSignature=(r&128)===128,t.nonRepudiation=(r&64)===64,t.keyEncipherment=(r&32)===32,t.dataEncipherment=(r&16)===16,t.keyAgreement=(r&8)===8,t.keyCertSign=(r&4)===4,t.cRLSign=(r&2)===2,t.encipherOnly=(r&1)===1,t.decipherOnly=(i&128)===128}else if(t.name==="basicConstraints"){var a=d.fromDer(t.value);a.value.length>0&&a.value[0].type===d.Type.BOOLEAN?t.cA=a.value[0].value.charCodeAt(0)!==0:t.cA=!1;var s=null;a.value.length>0&&a.value[0].type===d.Type.INTEGER?s=a.value[0].value:a.value.length>1&&(s=a.value[1].value),s!==null&&(t.pathLenConstraint=d.derToInteger(s))}else if(t.name==="extKeyUsage")for(var a=d.fromDer(t.value),n=0;n<a.value.length;++n){var o=d.derToOid(a.value[n].value);o in oe?t[oe[o]]=!0:t[o]=!0}else if(t.name==="nsCertType"){var a=d.fromDer(t.value),r=0;a.value.length>1&&(r=a.value.charCodeAt(1)),t.client=(r&128)===128,t.server=(r&64)===64,t.email=(r&32)===32,t.objsign=(r&16)===16,t.reserved=(r&8)===8,t.sslCA=(r&4)===4,t.emailCA=(r&2)===2,t.objCA=(r&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var l,a=d.fromDer(t.value),f=0;f<a.value.length;++f){l=a.value[f];var u={type:l.type,value:l.value};switch(t.altNames.push(u),l.type){case 1:case 2:case 6:break;case 7:u.ip=X.util.bytesToIP(l.value);break;case 8:u.oid=d.derToOid(l.value);break}}}else if(t.name==="subjectKeyIdentifier"){var a=d.fromDer(t.value);t.subjectKeyIdentifier=X.util.bytesToHex(a.value)}}return t};O.certificationRequestFromAsn1=function(e,t){var a={},r=[];if(!d.validate(e,d0,a,r)){var i=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw i.errors=r,i}var s=d.derToOid(a.publicKeyOid);if(s!==O.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var n=O.createCertificationRequest();if(n.version=a.csrVersion?a.csrVersion.charCodeAt(0):0,n.signatureOid=X.asn1.derToOid(a.csrSignatureOid),n.signatureParameters=Fr(n.signatureOid,a.csrSignatureParams,!0),n.siginfo.algorithmOid=X.asn1.derToOid(a.csrSignatureOid),n.siginfo.parameters=Fr(n.siginfo.algorithmOid,a.csrSignatureParams,!1),n.signature=a.csrSignature,n.certificationRequestInfo=a.certificationRequestInfo,t){n.md=jr({signatureOid:n.signatureOid,type:"certification request"});var o=d.toDer(n.certificationRequestInfo);n.md.update(o.getBytes())}var l=X.md.sha1.create();return n.subject.getField=function(f){return Ht(n.subject,f)},n.subject.addField=function(f){ct([f]),n.subject.attributes.push(f)},n.subject.attributes=O.RDNAttributesAsArray(a.certificationRequestInfoSubject,l),n.subject.hash=l.digest().toHex(),n.publicKey=O.publicKeyFromAsn1(a.subjectPublicKeyInfo),n.getAttribute=function(f){return Ht(n,f)},n.addAttribute=function(f){ct([f]),n.attributes.push(f)},n.attributes=O.CRIAttributesAsArray(a.certificationRequestInfoAttributes||[]),n};O.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return Ht(e.subject,t)},e.subject.addField=function(t){ct([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return Ht(e,t)},e.addAttribute=function(t){ct([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){ct(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){ct(t),e.attributes=t},e.sign=function(t,a){e.md=a||X.md.sha1.create();var r=oe[e.md.algorithm+"WithRSAEncryption"];if(!r){var i=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=r,e.certificationRequestInfo=O.getCertificationRequestInfo(e);var s=d.toDer(e.certificationRequestInfo);e.md.update(s.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,a=e.md;if(a===null){a=jr({signatureOid:e.signatureOid,type:"certification request"});var r=e.certificationRequestInfo||O.getCertificationRequestInfo(e),i=d.toDer(r);a.update(i.getBytes())}return a!==null&&(t=Yi({certificate:e,md:a,signature:e.signature})),t},e};function sr(e){for(var t=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]),a,r,i=e.attributes,s=0;s<i.length;++s){a=i[s];var n=a.value,o=d.Type.PRINTABLESTRING;"valueTagClass"in a&&(o=a.valueTagClass,o===d.Type.UTF8&&(n=X.util.encodeUtf8(n))),r=d.create(d.Class.UNIVERSAL,d.Type.SET,!0,[d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(a.type).getBytes()),d.create(d.Class.UNIVERSAL,o,!1,n)])]),t.value.push(r)}return t}function ct(e){for(var t,a=0;a<e.length;++a){if(t=e[a],typeof t.name>"u"&&(t.type&&t.type in O.oids?t.name=O.oids[t.type]:t.shortName&&t.shortName in Re&&(t.name=O.oids[Re[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in O.oids)t.type=O.oids[t.name];else{var r=new Error("Attribute type not specified.");throw r.attribute=t,r}if(typeof t.shortName>"u"&&t.name&&t.name in Re&&(t.shortName=Re[t.name]),t.type===oe.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=d.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var i=0;i<t.extensions.length;++i)t.value.push(O.certificateExtensionToAsn1(Xi(t.extensions[i])))}if(typeof t.value>"u"){var r=new Error("Attribute value not specified.");throw r.attribute=t,r}}}function Xi(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in O.oids&&(e.name=O.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in O.oids)e.id=O.oids[e.name];else{var a=new Error("Extension ID not specified.");throw a.extension=e,a}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var r=0,i=0,s=0;e.digitalSignature&&(i|=128,r=7),e.nonRepudiation&&(i|=64,r=6),e.keyEncipherment&&(i|=32,r=5),e.dataEncipherment&&(i|=16,r=4),e.keyAgreement&&(i|=8,r=3),e.keyCertSign&&(i|=4,r=2),e.cRLSign&&(i|=2,r=1),e.encipherOnly&&(i|=1,r=0),e.decipherOnly&&(s|=128,r=7);var n=String.fromCharCode(r);s!==0?n+=String.fromCharCode(i)+String.fromCharCode(s):i!==0&&(n+=String.fromCharCode(i)),e.value=d.create(d.Class.UNIVERSAL,d.Type.BITSTRING,!1,n)}else if(e.name==="basicConstraints")e.value=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(d.create(d.Class.UNIVERSAL,d.Type.BOOLEAN,!1,"ÿ")),"pathLenConstraint"in e&&e.value.value.push(d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,d.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]);var o=e.value.value;for(var l in e)e[l]===!0&&(l in oe?o.push(d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(oe[l]).getBytes())):l.indexOf(".")!==-1&&o.push(d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(l).getBytes())))}else if(e.name==="nsCertType"){var r=0,i=0;e.client&&(i|=128,r=7),e.server&&(i|=64,r=6),e.email&&(i|=32,r=5),e.objsign&&(i|=16,r=4),e.reserved&&(i|=8,r=3),e.sslCA&&(i|=4,r=2),e.emailCA&&(i|=2,r=1),e.objCA&&(i|=1,r=0);var n=String.fromCharCode(r);i!==0&&(n+=String.fromCharCode(i)),e.value=d.create(d.Class.UNIVERSAL,d.Type.BITSTRING,!1,n)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]);for(var f,u=0;u<e.altNames.length;++u){f=e.altNames[u];var n=f.value;if(f.type===7&&f.ip){if(n=X.util.bytesFromIP(f.ip),n===null){var a=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw a.extension=e,a}}else f.type===8&&(f.oid?n=d.oidToDer(d.oidToDer(f.oid)):n=d.oidToDer(n));e.value.value.push(d.create(d.Class.CONTEXT_SPECIFIC,f.type,!1,n))}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=d.create(d.Class.UNIVERSAL,d.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var p=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=p.toHex(),e.value=d.create(d.Class.UNIVERSAL,d.Type.OCTETSTRING,!1,p.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]);var o=e.value.value;if(e.keyIdentifier){var m=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;o.push(d.create(d.Class.CONTEXT_SPECIFIC,0,!1,m))}if(e.authorityCertIssuer){var S=[d.create(d.Class.CONTEXT_SPECIFIC,4,!0,[sr(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];o.push(d.create(d.Class.CONTEXT_SPECIFIC,1,!0,S))}if(e.serialNumber){var C=X.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);o.push(d.create(d.Class.CONTEXT_SPECIFIC,2,!1,C))}}else if(e.name==="cRLDistributionPoints"){e.value=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]);for(var o=e.value.value,A=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]),b=d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[]),f,u=0;u<e.altNames.length;++u){f=e.altNames[u];var n=f.value;if(f.type===7&&f.ip){if(n=X.util.bytesFromIP(f.ip),n===null){var a=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw a.extension=e,a}}else f.type===8&&(f.oid?n=d.oidToDer(d.oidToDer(f.oid)):n=d.oidToDer(n));b.value.push(d.create(d.Class.CONTEXT_SPECIFIC,f.type,!1,n))}A.value.push(d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[b])),o.push(A)}if(typeof e.value>"u"){var a=new Error("Extension value not specified.");throw a.extension=e,a}return e}function Pa(e,t){switch(e){case oe["RSASSA-PSS"]:var a=[];return t.hash.algorithmOid!==void 0&&a.push(d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(t.hash.algorithmOid).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&a.push(d.create(d.Class.CONTEXT_SPECIFIC,1,!0,[d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(t.mgf.algorithmOid).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(t.mgf.hash.algorithmOid).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&a.push(d.create(d.Class.CONTEXT_SPECIFIC,2,!0,[d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,d.integerToDer(t.saltLength).getBytes())])),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,a);default:return d.create(d.Class.UNIVERSAL,d.Type.NULL,!1,"")}}function y0(e){var t=d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var a=e.attributes,r=0;r<a.length;++r){var i=a[r],s=i.value,n=d.Type.UTF8;"valueTagClass"in i&&(n=i.valueTagClass),n===d.Type.UTF8&&(s=X.util.encodeUtf8(s));var o=!1;"valueConstructed"in i&&(o=i.valueConstructed);var l=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(i.type).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.SET,!0,[d.create(d.Class.UNIVERSAL,n,o,s)])]);t.value.push(l)}return t}var g0=new Date("1950-01-01T00:00:00Z"),v0=new Date("2050-01-01T00:00:00Z");function fi(e){return e>=g0&&e<v0?d.create(d.Class.UNIVERSAL,d.Type.UTCTIME,!1,d.dateToUtcTime(e)):d.create(d.Class.UNIVERSAL,d.Type.GENERALIZEDTIME,!1,d.dateToGeneralizedTime(e))}O.getTBSCertificate=function(e){var t=fi(e.validity.notBefore),a=fi(e.validity.notAfter),r=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,d.integerToDer(e.version).getBytes())]),d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,X.util.hexToBytes(e.serialNumber)),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.siginfo.algorithmOid).getBytes()),Pa(e.siginfo.algorithmOid,e.siginfo.parameters)]),sr(e.issuer),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[t,a]),sr(e.subject),O.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&r.value.push(d.create(d.Class.CONTEXT_SPECIFIC,1,!0,[d.create(d.Class.UNIVERSAL,d.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&r.value.push(d.create(d.Class.CONTEXT_SPECIFIC,2,!0,[d.create(d.Class.UNIVERSAL,d.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&r.value.push(O.certificateExtensionsToAsn1(e.extensions)),r};O.getCertificationRequestInfo=function(e){var t=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,d.integerToDer(e.version).getBytes()),sr(e.subject),O.publicKeyToAsn1(e.publicKey),y0(e)]);return t};O.distinguishedNameToAsn1=function(e){return sr(e)};O.certificateToAsn1=function(e){var t=e.tbsCertificate||O.getTBSCertificate(e);return d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[t,d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.signatureOid).getBytes()),Pa(e.signatureOid,e.signatureParameters)]),d.create(d.Class.UNIVERSAL,d.Type.BITSTRING,!1,"\0"+e.signature)])};O.certificateExtensionsToAsn1=function(e){var t=d.create(d.Class.CONTEXT_SPECIFIC,3,!0,[]),a=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]);t.value.push(a);for(var r=0;r<e.length;++r)a.value.push(O.certificateExtensionToAsn1(e[r]));return t};O.certificateExtensionToAsn1=function(e){var t=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]);t.value.push(d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.id).getBytes())),e.critical&&t.value.push(d.create(d.Class.UNIVERSAL,d.Type.BOOLEAN,!1,"ÿ"));var a=e.value;return typeof e.value!="string"&&(a=d.toDer(a).getBytes()),t.value.push(d.create(d.Class.UNIVERSAL,d.Type.OCTETSTRING,!1,a)),t};O.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||O.getCertificationRequestInfo(e);return d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[t,d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.signatureOid).getBytes()),Pa(e.signatureOid,e.signatureParameters)]),d.create(d.Class.UNIVERSAL,d.Type.BITSTRING,!1,"\0"+e.signature)])};O.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(n){var o=a(n.issuer);return o},t.addCertificate=function(n){if(typeof n=="string"&&(n=X.pki.certificateFromPem(n)),r(n.subject),!t.hasCertificate(n))if(n.subject.hash in t.certs){var o=t.certs[n.subject.hash];X.util.isArray(o)||(o=[o]),o.push(n),t.certs[n.subject.hash]=o}else t.certs[n.subject.hash]=n},t.hasCertificate=function(n){typeof n=="string"&&(n=X.pki.certificateFromPem(n));var o=a(n.subject);if(!o)return!1;X.util.isArray(o)||(o=[o]);for(var l=d.toDer(O.certificateToAsn1(n)).getBytes(),f=0;f<o.length;++f){var u=d.toDer(O.certificateToAsn1(o[f])).getBytes();if(l===u)return!0}return!1},t.listAllCertificates=function(){var n=[];for(var o in t.certs)if(t.certs.hasOwnProperty(o)){var l=t.certs[o];if(!X.util.isArray(l))n.push(l);else for(var f=0;f<l.length;++f)n.push(l[f])}return n},t.removeCertificate=function(n){var o;if(typeof n=="string"&&(n=X.pki.certificateFromPem(n)),r(n.subject),!t.hasCertificate(n))return null;var l=a(n.subject);if(!X.util.isArray(l))return o=t.certs[n.subject.hash],delete t.certs[n.subject.hash],o;for(var f=d.toDer(O.certificateToAsn1(n)).getBytes(),u=0;u<l.length;++u){var p=d.toDer(O.certificateToAsn1(l[u])).getBytes();f===p&&(o=l[u],l.splice(u,1))}return l.length===0&&delete t.certs[n.subject.hash],o};function a(n){return r(n),t.certs[n.hash]||null}function r(n){if(!n.hash){var o=X.md.sha1.create();n.attributes=O.RDNAttributesAsArray(sr(n),o),n.hash=o.digest().toHex()}}if(e)for(var i=0;i<e.length;++i){var s=e[i];t.addCertificate(s)}return t};O.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};O.verifyCertificateChain=function(e,t,a){typeof a=="function"&&(a={verify:a}),a=a||{},t=t.slice(0);var r=t.slice(0),i=a.validityCheckDate;typeof i>"u"&&(i=new Date);var s=!0,n=null,o=0;do{var l=t.shift(),f=null,u=!1;if(i&&(i<l.validity.notBefore||i>l.validity.notAfter)&&(n={message:"Certificate is not valid yet or has expired.",error:O.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:i}),n===null){if(f=t[0]||e.getIssuer(l),f===null&&l.isIssuer(l)&&(u=!0,f=l),f){var p=f;X.util.isArray(p)||(p=[p]);for(var m=!1;!m&&p.length>0;){f=p.shift();try{m=f.verify(l)}catch{}}m||(n={message:"Certificate signature is invalid.",error:O.certificateError.bad_certificate})}n===null&&(!f||u)&&!e.hasCertificate(l)&&(n={message:"Certificate is not trusted.",error:O.certificateError.unknown_ca})}if(n===null&&f&&!l.isIssuer(f)&&(n={message:"Certificate issuer is invalid.",error:O.certificateError.bad_certificate}),n===null)for(var S={keyUsage:!0,basicConstraints:!0},C=0;n===null&&C<l.extensions.length;++C){var A=l.extensions[C];A.critical&&!(A.name in S)&&(n={message:"Certificate has an unsupported critical extension.",error:O.certificateError.unsupported_certificate})}if(n===null&&(!s||t.length===0&&(!f||u))){var b=l.getExtension("basicConstraints"),w=l.getExtension("keyUsage");if(w!==null&&(!w.keyCertSign||b===null)&&(n={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:O.certificateError.bad_certificate}),n===null&&b===null&&(n={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:O.certificateError.bad_certificate}),n===null&&b!==null&&!b.cA&&(n={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:O.certificateError.bad_certificate}),n===null&&w!==null&&"pathLenConstraint"in b){var U=o-1;U>b.pathLenConstraint&&(n={message:"Certificate basicConstraints pathLenConstraint violated.",error:O.certificateError.bad_certificate})}}var D=n===null?!0:n.error,G=a.verify?a.verify(D,o,r):D;if(G===!0)n=null;else throw D===!0&&(n={message:"The application rejected the certificate.",error:O.certificateError.bad_certificate}),(G||G===0)&&(typeof G=="object"&&!X.util.isArray(G)?(G.message&&(n.message=G.message),G.error&&(n.error=G.error)):typeof G=="string"&&(n.error=G)),n;s=!1,++o}while(t.length>0);return!0};var me=ee,x=me.asn1,re=me.pki,xr=me.pkcs12=me.pkcs12||{},Wi={name:"ContentInfo",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:x.Class.UNIVERSAL,type:x.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:x.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},m0={name:"PFX",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"version"},Wi,{name:"PFX.macData",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:x.Class.UNIVERSAL,type:x.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:x.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:x.Class.UNIVERSAL,type:x.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:x.Class.UNIVERSAL,type:x.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},C0={name:"SafeBag",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:x.Class.UNIVERSAL,type:x.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:x.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:x.Class.UNIVERSAL,type:x.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},E0={name:"Attribute",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:x.Class.UNIVERSAL,type:x.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:x.Class.UNIVERSAL,type:x.Type.SET,constructed:!0,capture:"values"}]},x0={name:"CertBag",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:x.Class.UNIVERSAL,type:x.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:x.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:x.Class.UNIVERSAL,type:x.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function pr(e,t,a,r){for(var i=[],s=0;s<e.length;s++)for(var n=0;n<e[s].safeBags.length;n++){var o=e[s].safeBags[n];if(!(r!==void 0&&o.type!==r)){if(t===null){i.push(o);continue}o.attributes[t]!==void 0&&o.attributes[t].indexOf(a)>=0&&i.push(o)}}return i}xr.pkcs12FromAsn1=function(e,t,a){typeof t=="string"?(a=t,t=!0):t===void 0&&(t=!0);var r={},i=[];if(!x.validate(e,m0,r,i)){var s=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw s.errors=s,s}var n={version:r.version.charCodeAt(0),safeContents:[],getBags:function(b){var w={},U;return"localKeyId"in b?U=b.localKeyId:"localKeyIdHex"in b&&(U=me.util.hexToBytes(b.localKeyIdHex)),U===void 0&&!("friendlyName"in b)&&"bagType"in b&&(w[b.bagType]=pr(n.safeContents,null,null,b.bagType)),U!==void 0&&(w.localKeyId=pr(n.safeContents,"localKeyId",U,b.bagType)),"friendlyName"in b&&(w.friendlyName=pr(n.safeContents,"friendlyName",b.friendlyName,b.bagType)),w},getBagsByFriendlyName:function(b,w){return pr(n.safeContents,"friendlyName",b,w)},getBagsByLocalKeyId:function(b,w){return pr(n.safeContents,"localKeyId",b,w)}};if(r.version.charCodeAt(0)!==3){var s=new Error("PKCS#12 PFX of version other than 3 not supported.");throw s.version=r.version.charCodeAt(0),s}if(x.derToOid(r.contentType)!==re.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=x.derToOid(r.contentType),s}var o=r.content.value[0];if(o.tagClass!==x.Class.UNIVERSAL||o.type!==x.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=Va(o),r.mac){var l=null,f=0,u=x.derToOid(r.macAlgorithm);switch(u){case re.oids.sha1:l=me.md.sha1.create(),f=20;break;case re.oids.sha256:l=me.md.sha256.create(),f=32;break;case re.oids.sha384:l=me.md.sha384.create(),f=48;break;case re.oids.sha512:l=me.md.sha512.create(),f=64;break;case re.oids.md5:l=me.md.md5.create(),f=16;break}if(l===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+u);var p=new me.util.ByteBuffer(r.macSalt),m="macIterations"in r?parseInt(me.util.bytesToHex(r.macIterations),16):1,S=xr.generateKey(a,p,3,m,f,l),C=me.hmac.create();C.start(l,S),C.update(o.value);var A=C.getMac();if(A.getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(e.value)&&e.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return S0(n,o.value,t,a),n};function Va(e){if(e.composed||e.constructed){for(var t=me.util.createBuffer(),a=0;a<e.value.length;++a)t.putBytes(e.value[a].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function S0(e,t,a,r){if(t=x.fromDer(t,a),t.tagClass!==x.Class.UNIVERSAL||t.type!==x.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var i=0;i<t.value.length;i++){var s=t.value[i],n={},o=[];if(!x.validate(s,Wi,n,o)){var l=new Error("Cannot read ContentInfo.");throw l.errors=o,l}var f={encrypted:!1},u=null,p=n.content.value[0];switch(x.derToOid(n.contentType)){case re.oids.data:if(p.tagClass!==x.Class.UNIVERSAL||p.type!==x.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");u=Va(p).value;break;case re.oids.encryptedData:u=T0(p,r),f.encrypted=!0;break;default:var l=new Error("Unsupported PKCS#12 contentType.");throw l.contentType=x.derToOid(n.contentType),l}f.safeBags=I0(u,a,r),e.safeContents.push(f)}}function T0(e,t){var a={},r=[];if(!x.validate(e,me.pkcs7.asn1.encryptedDataValidator,a,r)){var i=new Error("Cannot read EncryptedContentInfo.");throw i.errors=r,i}var s=x.derToOid(a.contentType);if(s!==re.oids.data){var i=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw i.oid=s,i}s=x.derToOid(a.encAlgorithm);var n=re.pbe.getCipher(s,a.encParameter,t),o=Va(a.encryptedContentAsn1),l=me.util.createBuffer(o.value);if(n.update(l),!n.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return n.output.getBytes()}function I0(e,t,a){if(!t&&e.length===0)return[];if(e=x.fromDer(e,t),e.tagClass!==x.Class.UNIVERSAL||e.type!==x.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var r=[],i=0;i<e.value.length;i++){var s=e.value[i],n={},o=[];if(!x.validate(s,C0,n,o)){var l=new Error("Cannot read SafeBag.");throw l.errors=o,l}var f={type:x.derToOid(n.bagId),attributes:B0(n.bagAttributes)};r.push(f);var u,p,m=n.bagValue.value[0];switch(f.type){case re.oids.pkcs8ShroudedKeyBag:if(m=re.decryptPrivateKeyInfo(m,a),m===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case re.oids.keyBag:try{f.key=re.privateKeyFromAsn1(m)}catch{f.key=null,f.asn1=m}continue;case re.oids.certBag:u=x0,p=function(){if(x.derToOid(n.certId)!==re.oids.x509Certificate){var C=new Error("Unsupported certificate type, only X.509 supported.");throw C.oid=x.derToOid(n.certId),C}var A=x.fromDer(n.cert,t);try{f.cert=re.certificateFromAsn1(A,!0)}catch{f.cert=null,f.asn1=A}};break;default:var l=new Error("Unsupported PKCS#12 SafeBag type.");throw l.oid=f.type,l}if(u!==void 0&&!x.validate(m,u,n,o)){var l=new Error("Cannot read PKCS#12 "+u.name);throw l.errors=o,l}p()}return r}function B0(e){var t={};if(e!==void 0)for(var a=0;a<e.length;++a){var r={},i=[];if(!x.validate(e[a],E0,r,i)){var s=new Error("Cannot read PKCS#12 BagAttribute.");throw s.errors=i,s}var n=x.derToOid(r.oid);if(re.oids[n]!==void 0){t[re.oids[n]]=[];for(var o=0;o<r.values.length;++o)t[re.oids[n]].push(r.values[o].value)}}return t}xr.toPkcs12Asn1=function(e,t,a,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||r.encAlgorithm||"aes128","useMac"in r||(r.useMac=!0),"localKeyId"in r||(r.localKeyId=null),"generateLocalKeyId"in r||(r.generateLocalKeyId=!0);var i=r.localKeyId,s;if(i!==null)i=me.util.hexToBytes(i);else if(r.generateLocalKeyId)if(t){var n=me.util.isArray(t)?t[0]:t;typeof n=="string"&&(n=re.certificateFromPem(n));var o=me.md.sha1.create();o.update(x.toDer(re.certificateToAsn1(n)).getBytes()),i=o.digest().getBytes()}else i=me.random.getBytes(20);var l=[];i!==null&&l.push(x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(re.oids.localKeyId).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SET,!0,[x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,i)])])),"friendlyName"in r&&l.push(x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(re.oids.friendlyName).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SET,!0,[x.create(x.Class.UNIVERSAL,x.Type.BMPSTRING,!1,r.friendlyName)])])),l.length>0&&(s=x.create(x.Class.UNIVERSAL,x.Type.SET,!0,l));var f=[],u=[];t!==null&&(me.util.isArray(t)?u=t:u=[t]);for(var p=[],m=0;m<u.length;++m){t=u[m],typeof t=="string"&&(t=re.certificateFromPem(t));var S=m===0?s:void 0,C=re.certificateToAsn1(t),A=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(re.oids.certBag).getBytes()),x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(re.oids.x509Certificate).getBytes()),x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,x.toDer(C).getBytes())])])]),S]);p.push(A)}if(p.length>0){var b=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,p),w=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(re.oids.data).getBytes()),x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,x.toDer(b).getBytes())])]);f.push(w)}var U=null;if(e!==null){var D=re.wrapRsaPrivateKey(re.privateKeyToAsn1(e));a===null?U=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(re.oids.keyBag).getBytes()),x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[D]),s]):U=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(re.oids.pkcs8ShroudedKeyBag).getBytes()),x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[re.encryptPrivateKeyInfo(D,a,r)]),s]);var G=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[U]),K=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(re.oids.data).getBytes()),x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,x.toDer(G).getBytes())])]);f.push(K)}var F=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,f),$;if(r.useMac){var o=me.md.sha1.create(),j=new me.util.ByteBuffer(me.random.getBytes(r.saltSize)),le=r.count,e=xr.generateKey(a,j,3,le,20),he=me.hmac.create();he.start(o,e),he.update(x.toDer(F).getBytes());var de=he.getMac();$=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(re.oids.sha1).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")]),x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,de.getBytes())]),x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,j.getBytes()),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(le).getBytes())])}return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(3).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(re.oids.data).getBytes()),x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,x.toDer(F).getBytes())])]),$])};xr.generateKey=me.pbe.generatePkcs12Key;var Gt=ee,Fa=Gt.asn1,or=Gt.pki=Gt.pki||{};or.pemToDer=function(e){var t=Gt.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Gt.util.createBuffer(t.body)};or.privateKeyFromPem=function(e){var t=Gt.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){var a=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=Fa.fromDer(t.body);return or.privateKeyFromAsn1(r)};or.privateKeyToPem=function(e,t){var a={type:"RSA PRIVATE KEY",body:Fa.toDer(or.privateKeyToAsn1(e)).getBytes()};return Gt.pem.encode(a,{maxline:t})};or.privateKeyInfoToPem=function(e,t){var a={type:"PRIVATE KEY",body:Fa.toDer(e).getBytes()};return Gt.pem.encode(a,{maxline:t})};var P=ee,Zr=function(e,t,a,r){var i=P.util.createBuffer(),s=e.length>>1,n=s+(e.length&1),o=e.substr(0,n),l=e.substr(s,n),f=P.util.createBuffer(),u=P.hmac.create();a=t+a;var p=Math.ceil(r/16),m=Math.ceil(r/20);u.start("MD5",o);var S=P.util.createBuffer();f.putBytes(a);for(var C=0;C<p;++C)u.start(null,null),u.update(f.getBytes()),f.putBuffer(u.digest()),u.start(null,null),u.update(f.bytes()+a),S.putBuffer(u.digest());u.start("SHA1",l);var A=P.util.createBuffer();f.clear(),f.putBytes(a);for(var C=0;C<m;++C)u.start(null,null),u.update(f.getBytes()),f.putBuffer(u.digest()),u.start(null,null),u.update(f.bytes()+a),A.putBuffer(u.digest());return i.putBytes(P.util.xorBytes(S.getBytes(),A.getBytes(),r)),i},A0=function(e,t,a){var r=P.hmac.create();r.start("SHA1",e);var i=P.util.createBuffer();return i.putInt32(t[0]),i.putInt32(t[1]),i.putByte(a.type),i.putByte(a.version.major),i.putByte(a.version.minor),i.putInt16(a.length),i.putBytes(a.fragment.bytes()),r.update(i.getBytes()),r.digest().getBytes()},b0=function(e,t,a){var r=!1;try{var i=e.deflate(t.fragment.getBytes());t.fragment=P.util.createBuffer(i),t.length=i.length,r=!0}catch{}return r},_0=function(e,t,a){var r=!1;try{var i=e.inflate(t.fragment.getBytes());t.fragment=P.util.createBuffer(i),t.length=i.length,r=!0}catch{}return r},nt=function(e,t){var a=0;switch(t){case 1:a=e.getByte();break;case 2:a=e.getInt16();break;case 3:a=e.getInt24();break;case 4:a=e.getInt32();break}return P.util.createBuffer(e.getBytes(a))},ut=function(e,t,a){e.putInt(a.length(),t<<3),e.putBuffer(a)},g={};g.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};g.SupportedVersions=[g.Versions.TLS_1_1,g.Versions.TLS_1_0];g.Version=g.SupportedVersions[0];g.MaxFragment=15360;g.ConnectionEnd={server:0,client:1};g.PRFAlgorithm={tls_prf_sha256:0};g.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};g.CipherType={stream:0,block:1,aead:2};g.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};g.CompressionMethod={none:0,deflate:1};g.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};g.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};g.Alert={};g.Alert.Level={warning:1,fatal:2};g.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};g.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};g.CipherSuites={};g.getCipherSuite=function(e){var t=null;for(var a in g.CipherSuites){var r=g.CipherSuites[a];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t};g.handleUnexpected=function(e,t){var a=!e.open&&e.entity===g.ConnectionEnd.client;a||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unexpected_message}})};g.handleHelloRequest=function(e,t,a){!e.handshaking&&e.handshakes>0&&(g.queue(e,g.createAlert(e,{level:g.Alert.Level.warning,description:g.Alert.Description.no_renegotiation})),g.flush(e)),e.process()};g.parseHelloMessage=function(e,t,a){var r=null,i=e.entity===g.ConnectionEnd.client;if(a<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});else{var s=t.fragment,n=s.length();if(r={version:{major:s.getByte(),minor:s.getByte()},random:P.util.createBuffer(s.getBytes(32)),session_id:nt(s,1),extensions:[]},i?(r.cipher_suite=s.getBytes(2),r.compression_method=s.getByte()):(r.cipher_suites=nt(s,2),r.compression_methods=nt(s,1)),n=a-(n-s.length()),n>0){for(var o=nt(s,2);o.length()>0;)r.extensions.push({type:[o.getByte(),o.getByte()],data:nt(o,2)});if(!i)for(var l=0;l<r.extensions.length;++l){var f=r.extensions[l];if(f.type[0]===0&&f.type[1]===0)for(var u=nt(f.data,2);u.length()>0;){var p=u.getByte();if(p!==0)break;e.session.extensions.server_name.serverNameList.push(nt(u,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=g.getCipherSuite(r.cipher_suite);else for(var m=P.util.createBuffer(r.cipher_suites.bytes());m.length()>0&&(e.session.cipherSuite=g.getCipherSuite(m.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.handshake_failure},cipherSuite:P.util.bytesToHex(r.cipher_suite)});i?e.session.compressionMethod=r.compression_method:e.session.compressionMethod=g.CompressionMethod.none}return r};g.createSecurityParameters=function(e,t){var a=e.entity===g.ConnectionEnd.client,r=t.random.bytes(),i=a?e.session.sp.client_random:r,s=a?r:g.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:g.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:s}};g.handleServerHello=function(e,t,a){var r=g.parseHelloMessage(e,t,a);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}});e.session.version=e.version;var i=r.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=$i,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=N0,e.session.resuming=!1,g.createSecurityParameters(e,r)),e.session.id=i,e.process()}};g.handleClientHello=function(e,t,a){var r=g.parseHelloMessage(e,t,a);if(!e.fail){var i=r.session_id.bytes(),s=null;if(e.sessionCache&&(s=e.sessionCache.getSession(i),s===null?i="":(s.version.major!==r.version.major||s.version.minor>r.version.minor)&&(s=null,i="")),i.length===0&&(i=P.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=r.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else{for(var n,o=1;o<g.SupportedVersions.length&&(n=g.SupportedVersions[o],!(n.minor<=r.version.minor));++o);e.version={major:n.major,minor:n.minor},e.session.version=e.version}s!==null?(e.expect=Oa,e.session.resuming=!0,e.session.sp.client_random=r.random.bytes()):(e.expect=e.verifyClient!==!1?V0:va,e.session.resuming=!1,g.createSecurityParameters(e,r)),e.open=!0,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerHello(e)})),e.session.resuming?(g.queue(e,g.createRecord(e,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),e.state.pending=g.createConnectionState(e),e.state.current.write=e.state.pending.write,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createFinished(e)}))):(g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificate(e)})),e.fail||(g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerKeyExchange(e)})),e.verifyClient!==!1&&g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificateRequest(e)})),g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerHelloDone(e)})))),g.flush(e),e.process()}};g.handleCertificate=function(e,t,a){if(a<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment,i={certificate_list:nt(r,3)},s,n,o=[];try{for(;i.certificate_list.length()>0;)s=nt(i.certificate_list,3),n=P.asn1.fromDer(s),s=P.pki.certificateFromAsn1(n,!0),o.push(s)}catch(f){return e.error(e,{message:"Could not parse certificate list.",cause:f,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate}})}var l=e.entity===g.ConnectionEnd.client;(l||e.verifyClient===!0)&&o.length===0?e.error(e,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}}):o.length===0?e.expect=l?li:va:(l?e.session.serverCertificate=o[0]:e.session.clientCertificate=o[0],g.verifyCertificateChain(e,o)&&(e.expect=l?li:va)),e.process()};g.handleServerKeyExchange=function(e,t,a){if(a>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unsupported_certificate}});e.expect=R0,e.process()};g.handleClientKeyExchange=function(e,t,a){if(a<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unsupported_certificate}});var r=t.fragment,i={enc_pre_master_secret:nt(r,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=P.pki.privateKeyFromPem(s)}catch(l){e.error(e,{message:"Could not get private key.",cause:l,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}})}if(s===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}});try{var n=e.session.sp;n.pre_master_secret=s.decrypt(i.enc_pre_master_secret);var o=e.session.clientHelloVersion;if(o.major!==n.pre_master_secret.charCodeAt(0)||o.minor!==n.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{n.pre_master_secret=P.random.getBytes(48)}e.expect=Oa,e.session.clientCertificate!==null&&(e.expect=F0),e.process()};g.handleCertificateRequest=function(e,t,a){if(a<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment,i={certificate_types:nt(r,1),certificate_authorities:nt(r,2)};e.session.certificateRequest=i,e.expect=L0,e.process()};g.handleCertificateVerify=function(e,t,a){if(a<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var i=r.bytes();r.read+=4;var s={signature:nt(r,2).getBytes()},n=P.util.createBuffer();n.putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest()),n=n.getBytes();try{var o=e.session.clientCertificate;if(!o.publicKey.verify(n,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.handshake_failure}})}e.expect=Oa,e.process()};g.handleServerHelloDone=function(e,t,a){if(a>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.record_overflow}});if(e.serverCertificate===null){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.insufficient_security}},i=0,s=e.verify(e,r.alert.description,i,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!P.util.isArray(s)?(s.message&&(r.message=s.message),s.alert&&(r.alert.description=s.alert)):typeof s=="number"&&(r.alert.description=s)),e.error(e,r)}e.session.certificateRequest!==null&&(t=g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificate(e)}),g.queue(e,t)),t=g.createRecord(e,{type:g.ContentType.handshake,data:g.createClientKeyExchange(e)}),g.queue(e,t),e.expect=k0;var n=function(o,l){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&g.queue(o,g.createRecord(o,{type:g.ContentType.handshake,data:g.createCertificateVerify(o,l)})),g.queue(o,g.createRecord(o,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),o.state.pending=g.createConnectionState(o),o.state.current.write=o.state.pending.write,g.queue(o,g.createRecord(o,{type:g.ContentType.handshake,data:g.createFinished(o)})),o.expect=$i,g.flush(o),o.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return n(e,null);g.getClientSignature(e,n)};g.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var a=e.entity===g.ConnectionEnd.client;(e.session.resuming&&a||!e.session.resuming&&!a)&&(e.state.pending=g.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&a||e.session.resuming&&!a)&&(e.state.pending=null),e.expect=a?U0:O0,e.process()};g.handleFinished=function(e,t,a){var r=t.fragment;r.read-=4;var i=r.bytes();r.read+=4;var s=t.fragment.getBytes();r=P.util.createBuffer(),r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var n=e.entity===g.ConnectionEnd.client,o=n?"server finished":"client finished",l=e.session.sp,f=12,u=Zr;if(r=u(l.master_secret,o,r.getBytes(),f),r.getBytes()!==s)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.decrypt_error}});e.session.md5.update(i),e.session.sha1.update(i),(e.session.resuming&&n||!e.session.resuming&&!n)&&(g.queue(e,g.createRecord(e,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createFinished(e)}))),e.expect=n?D0:K0,e.handshaking=!1,++e.handshakes,e.peerCertificate=n?e.session.serverCertificate:e.session.clientCertificate,g.flush(e),e.isConnected=!0,e.connected(e),e.process()};g.handleAlert=function(e,t){var a=t.fragment,r={level:a.getByte(),description:a.getByte()},i;switch(r.description){case g.Alert.Description.close_notify:i="Connection closed.";break;case g.Alert.Description.unexpected_message:i="Unexpected message.";break;case g.Alert.Description.bad_record_mac:i="Bad record MAC.";break;case g.Alert.Description.decryption_failed:i="Decryption failed.";break;case g.Alert.Description.record_overflow:i="Record overflow.";break;case g.Alert.Description.decompression_failure:i="Decompression failed.";break;case g.Alert.Description.handshake_failure:i="Handshake failure.";break;case g.Alert.Description.bad_certificate:i="Bad certificate.";break;case g.Alert.Description.unsupported_certificate:i="Unsupported certificate.";break;case g.Alert.Description.certificate_revoked:i="Certificate revoked.";break;case g.Alert.Description.certificate_expired:i="Certificate expired.";break;case g.Alert.Description.certificate_unknown:i="Certificate unknown.";break;case g.Alert.Description.illegal_parameter:i="Illegal parameter.";break;case g.Alert.Description.unknown_ca:i="Unknown certificate authority.";break;case g.Alert.Description.access_denied:i="Access denied.";break;case g.Alert.Description.decode_error:i="Decode error.";break;case g.Alert.Description.decrypt_error:i="Decrypt error.";break;case g.Alert.Description.export_restriction:i="Export restriction.";break;case g.Alert.Description.protocol_version:i="Unsupported protocol version.";break;case g.Alert.Description.insufficient_security:i="Insufficient security.";break;case g.Alert.Description.internal_error:i="Internal error.";break;case g.Alert.Description.user_canceled:i="User canceled.";break;case g.Alert.Description.no_renegotiation:i="Renegotiation not supported.";break;default:i="Unknown error.";break}if(r.description===g.Alert.Description.close_notify)return e.close();e.error(e,{message:i,send:!1,origin:e.entity===g.ConnectionEnd.client?"server":"client",alert:r}),e.process()};g.handleHandshake=function(e,t){var a=t.fragment,r=a.getByte(),i=a.getInt24();if(i>a.length())return e.fragmented=t,t.fragment=P.util.createBuffer(),a.read-=4,e.process();e.fragmented=null,a.read-=4;var s=a.bytes(i+4);a.read+=4,r in Or[e.entity][e.expect]?(e.entity===g.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:P.md.md5.create(),sha1:P.md.sha1.create()}),r!==g.HandshakeType.hello_request&&r!==g.HandshakeType.certificate_verify&&r!==g.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),Or[e.entity][e.expect][r](e,t,i)):g.handleUnexpected(e,t)};g.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()};g.handleHeartbeat=function(e,t){var a=t.fragment,r=a.getByte(),i=a.getInt16(),s=a.getBytes(i);if(r===g.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>s.length)return e.process();g.queue(e,g.createRecord(e,{type:g.ContentType.heartbeat,data:g.createHeartbeat(g.HeartbeatMessageType.heartbeat_response,s)})),g.flush(e)}else if(r===g.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,P.util.createBuffer(s))}e.process()};var w0=0,N0=1,li=2,R0=3,L0=4,$i=5,U0=6,D0=7,k0=8,P0=0,V0=1,va=2,F0=3,Oa=4,O0=5,K0=6,y=g.handleUnexpected,ji=g.handleChangeCipherSpec,Xe=g.handleAlert,et=g.handleHandshake,Zi=g.handleApplicationData,We=g.handleHeartbeat,Ka=[];Ka[g.ConnectionEnd.client]=[[y,Xe,et,y,We],[y,Xe,et,y,We],[y,Xe,et,y,We],[y,Xe,et,y,We],[y,Xe,et,y,We],[ji,Xe,y,y,We],[y,Xe,et,y,We],[y,Xe,et,Zi,We],[y,Xe,et,y,We]];Ka[g.ConnectionEnd.server]=[[y,Xe,et,y,We],[y,Xe,et,y,We],[y,Xe,et,y,We],[y,Xe,et,y,We],[ji,Xe,y,y,We],[y,Xe,et,y,We],[y,Xe,et,Zi,We],[y,Xe,et,y,We]];var Dt=g.handleHelloRequest,M0=g.handleServerHello,Ji=g.handleCertificate,ci=g.handleServerKeyExchange,ia=g.handleCertificateRequest,br=g.handleServerHelloDone,en=g.handleFinished,Or=[];Or[g.ConnectionEnd.client]=[[y,y,M0,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y],[Dt,y,y,y,y,y,y,y,y,y,y,Ji,ci,ia,br,y,y,y,y,y,y],[Dt,y,y,y,y,y,y,y,y,y,y,y,ci,ia,br,y,y,y,y,y,y],[Dt,y,y,y,y,y,y,y,y,y,y,y,y,ia,br,y,y,y,y,y,y],[Dt,y,y,y,y,y,y,y,y,y,y,y,y,y,br,y,y,y,y,y,y],[Dt,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y],[Dt,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,en],[Dt,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y],[Dt,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y]];var H0=g.handleClientHello,G0=g.handleClientKeyExchange,q0=g.handleCertificateVerify;Or[g.ConnectionEnd.server]=[[y,H0,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y],[y,y,y,y,y,y,y,y,y,y,y,Ji,y,y,y,y,y,y,y,y,y],[y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,G0,y,y,y,y],[y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,q0,y,y,y,y,y],[y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y],[y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,en],[y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y],[y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y]];g.generateKeys=function(e,t){var a=Zr,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=a(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===g.Versions.TLS_1_0.major&&e.version.minor===g.Versions.TLS_1_0.minor;s&&(i+=2*t.fixed_iv_length);var n=a(t.master_secret,"key expansion",r,i),o={client_write_MAC_key:n.getBytes(t.mac_key_length),server_write_MAC_key:n.getBytes(t.mac_key_length),client_write_key:n.getBytes(t.enc_key_length),server_write_key:n.getBytes(t.enc_key_length)};return s&&(o.client_write_IV=n.getBytes(t.fixed_iv_length),o.server_write_IV=n.getBytes(t.fixed_iv_length)),o};g.createConnectionState=function(e){var t=e.entity===g.ConnectionEnd.client,a=function(){var s={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(n){return!0},compressionState:null,compressFunction:function(n){return!0},updateSequenceNumber:function(){s.sequenceNumber[1]===4294967295?(s.sequenceNumber[1]=0,++s.sequenceNumber[0]):++s.sequenceNumber[1]}};return s},r={read:a(),write:a()};if(r.read.update=function(s,n){return r.read.cipherFunction(n,r.read)?r.read.compressFunction(s,n,r.read)||s.error(s,{message:"Could not decompress record.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_record_mac}}),!s.fail},r.write.update=function(s,n){return r.write.compressFunction(s,n,r.write)?r.write.cipherFunction(n,r.write)||s.error(s,{message:"Could not encrypt record.",send:!1,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}),!s.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=g.generateKeys(e,i),r.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,r.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,i),i.compression_algorithm){case g.CompressionMethod.none:break;case g.CompressionMethod.deflate:r.read.compressFunction=_0,r.write.compressFunction=b0;break;default:throw new Error("Unsupported compression algorithm.")}}return r};g.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,a=P.util.createBuffer();return a.putInt32(t),a.putBytes(P.random.getBytes(28)),a};g.createRecord=function(e,t){if(!t.data)return null;var a={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return a};g.createAlert=function(e,t){var a=P.util.createBuffer();return a.putByte(t.level),a.putByte(t.description),g.createRecord(e,{type:g.ContentType.alert,data:a})};g.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=P.util.createBuffer(),a=0;a<e.cipherSuites.length;++a){var r=e.cipherSuites[a];t.putByte(r.id[0]),t.putByte(r.id[1])}var i=t.length(),s=P.util.createBuffer();s.putByte(g.CompressionMethod.none);var n=s.length(),o=P.util.createBuffer();if(e.virtualHost){var l=P.util.createBuffer();l.putByte(0),l.putByte(0);var f=P.util.createBuffer();f.putByte(0),ut(f,2,P.util.createBuffer(e.virtualHost));var u=P.util.createBuffer();ut(u,2,f),ut(l,2,u),o.putBuffer(l)}var p=o.length();p>0&&(p+=2);var m=e.session.id,S=m.length+1+2+4+28+2+i+1+n+p,C=P.util.createBuffer();return C.putByte(g.HandshakeType.client_hello),C.putInt24(S),C.putByte(e.version.major),C.putByte(e.version.minor),C.putBytes(e.session.sp.client_random),ut(C,1,P.util.createBuffer(m)),ut(C,2,t),ut(C,1,s),p>0&&ut(C,2,o),C};g.createServerHello=function(e){var t=e.session.id,a=t.length+1+2+4+28+2+1,r=P.util.createBuffer();return r.putByte(g.HandshakeType.server_hello),r.putInt24(a),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),ut(r,1,P.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r};g.createCertificate=function(e){var t=e.entity===g.ConnectionEnd.client,a=null;if(e.getCertificate){var r;t?r=e.session.certificateRequest:r=e.session.extensions.server_name.serverNameList,a=e.getCertificate(e,r)}var i=P.util.createBuffer();if(a!==null)try{P.util.isArray(a)||(a=[a]);for(var s=null,n=0;n<a.length;++n){var o=P.pem.decode(a[n])[0];if(o.type!=="CERTIFICATE"&&o.type!=="X509 CERTIFICATE"&&o.type!=="TRUSTED CERTIFICATE"){var l=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw l.headerType=o.type,l}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var f=P.util.createBuffer(o.body);s===null&&(s=P.asn1.fromDer(f.bytes(),!1));var u=P.util.createBuffer();ut(u,3,f),i.putBuffer(u)}a=P.pki.certificateFromAsn1(s),t?e.session.clientCertificate=a:e.session.serverCertificate=a}catch(S){return e.error(e,{message:"Could not send certificate list.",cause:S,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate}})}var p=3+i.length(),m=P.util.createBuffer();return m.putByte(g.HandshakeType.certificate),m.putInt24(p),ut(m,3,i),m};g.createClientKeyExchange=function(e){var t=P.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(P.random.getBytes(46));var a=e.session.sp;a.pre_master_secret=t.getBytes();var r=e.session.serverCertificate.publicKey;t=r.encrypt(a.pre_master_secret);var i=t.length+2,s=P.util.createBuffer();return s.putByte(g.HandshakeType.client_key_exchange),s.putInt24(i),s.putInt16(t.length),s.putBytes(t),s};g.createServerKeyExchange=function(e){var t=P.util.createBuffer();return t};g.getClientSignature=function(e,t){var a=P.util.createBuffer();a.putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest()),a=a.getBytes(),e.getSignature=e.getSignature||function(r,i,s){var n=null;if(r.getPrivateKey)try{n=r.getPrivateKey(r,r.session.clientCertificate),n=P.pki.privateKeyFromPem(n)}catch(o){r.error(r,{message:"Could not get private key.",cause:o,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}})}n===null?r.error(r,{message:"No private key set.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}):i=n.sign(i,null),s(r,i)},e.getSignature(e,a,t)};g.createCertificateVerify=function(e,t){var a=t.length+2,r=P.util.createBuffer();return r.putByte(g.HandshakeType.certificate_verify),r.putInt24(a),r.putInt16(t.length),r.putBytes(t),r};g.createCertificateRequest=function(e){var t=P.util.createBuffer();t.putByte(1);var a=P.util.createBuffer();for(var r in e.caStore.certs){var i=e.caStore.certs[r],s=P.pki.distinguishedNameToAsn1(i.subject),n=P.asn1.toDer(s);a.putInt16(n.length()),a.putBuffer(n)}var o=1+t.length()+2+a.length(),l=P.util.createBuffer();return l.putByte(g.HandshakeType.certificate_request),l.putInt24(o),ut(l,1,t),ut(l,2,a),l};g.createServerHelloDone=function(e){var t=P.util.createBuffer();return t.putByte(g.HandshakeType.server_hello_done),t.putInt24(0),t};g.createChangeCipherSpec=function(){var e=P.util.createBuffer();return e.putByte(1),e};g.createFinished=function(e){var t=P.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var a=e.entity===g.ConnectionEnd.client,r=e.session.sp,i=12,s=Zr,n=a?"client finished":"server finished";t=s(r.master_secret,n,t.getBytes(),i);var o=P.util.createBuffer();return o.putByte(g.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o};g.createHeartbeat=function(e,t,a){typeof a>"u"&&(a=t.length);var r=P.util.createBuffer();r.putByte(e),r.putInt16(a),r.putBytes(t);var i=r.length(),s=Math.max(16,i-a-3);return r.putBytes(P.random.getBytes(s)),r};g.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===g.ContentType.handshake||t.type===g.ContentType.alert||t.type===g.ContentType.change_cipher_spec))){if(t.type===g.ContentType.handshake){var a=t.fragment.bytes();e.session.md5.update(a),e.session.sha1.update(a),a=null}var r;if(t.fragment.length()<=g.MaxFragment)r=[t];else{r=[];for(var i=t.fragment.bytes();i.length>g.MaxFragment;)r.push(g.createRecord(e,{type:t.type,data:P.util.createBuffer(i.slice(0,g.MaxFragment))})),i=i.slice(g.MaxFragment);i.length>0&&r.push(g.createRecord(e,{type:t.type,data:P.util.createBuffer(i)}))}for(var s=0;s<r.length&&!e.fail;++s){var n=r[s],o=e.state.current.write;o.update(e,n)&&e.records.push(n)}}};g.flush=function(e){for(var t=0;t<e.records.length;++t){var a=e.records[t];e.tlsData.putByte(a.type),e.tlsData.putByte(a.version.major),e.tlsData.putByte(a.version.minor),e.tlsData.putInt16(a.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var na=function(e){switch(e){case!0:return!0;case P.pki.certificateError.bad_certificate:return g.Alert.Description.bad_certificate;case P.pki.certificateError.unsupported_certificate:return g.Alert.Description.unsupported_certificate;case P.pki.certificateError.certificate_revoked:return g.Alert.Description.certificate_revoked;case P.pki.certificateError.certificate_expired:return g.Alert.Description.certificate_expired;case P.pki.certificateError.certificate_unknown:return g.Alert.Description.certificate_unknown;case P.pki.certificateError.unknown_ca:return g.Alert.Description.unknown_ca;default:return g.Alert.Description.bad_certificate}},Q0=function(e){switch(e){case!0:return!0;case g.Alert.Description.bad_certificate:return P.pki.certificateError.bad_certificate;case g.Alert.Description.unsupported_certificate:return P.pki.certificateError.unsupported_certificate;case g.Alert.Description.certificate_revoked:return P.pki.certificateError.certificate_revoked;case g.Alert.Description.certificate_expired:return P.pki.certificateError.certificate_expired;case g.Alert.Description.certificate_unknown:return P.pki.certificateError.certificate_unknown;case g.Alert.Description.unknown_ca:return P.pki.certificateError.unknown_ca;default:return P.pki.certificateError.bad_certificate}};g.verifyCertificateChain=function(e,t){try{var a={};for(var r in e.verifyOptions)a[r]=e.verifyOptions[r];a.verify=function(s,n,o){var l=na(s),f=e.verify(e,s,n,o);if(f!==!0){if(typeof f=="object"&&!P.util.isArray(f)){var u=new Error("The application rejected the certificate.");throw u.send=!0,u.alert={level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate},f.message&&(u.message=f.message),f.alert&&(u.alert.description=f.alert),u}f!==s&&(f=Q0(f))}return f},P.pki.verifyCertificateChain(e.caStore,t,a)}catch(s){var i=s;(typeof i!="object"||P.util.isArray(i))&&(i={send:!0,alert:{level:g.Alert.Level.fatal,description:na(s)}}),"send"in i||(i.send=!0),"alert"in i||(i.alert={level:g.Alert.Level.fatal,description:na(i.error)}),e.error(e,i)}return!e.fail};g.createSessionCache=function(e,t){var a=null;if(e&&e.getSession&&e.setSession&&e.order)a=e;else{a={},a.cache=e||{},a.capacity=Math.max(t||100,1),a.order=[];for(var r in e)a.order.length<=t?a.order.push(r):delete e[r];a.getSession=function(i){var s=null,n=null;if(i?n=P.util.bytesToHex(i):a.order.length>0&&(n=a.order[0]),n!==null&&n in a.cache){s=a.cache[n],delete a.cache[n];for(var o in a.order)if(a.order[o]===n){a.order.splice(o,1);break}}return s},a.setSession=function(i,s){if(a.order.length===a.capacity){var n=a.order.shift();delete a.cache[n]}var n=P.util.bytesToHex(i);a.order.push(n),a.cache[n]=s}}return a};g.createConnection=function(e){var t=null;e.caStore?P.util.isArray(e.caStore)?t=P.pki.createCaStore(e.caStore):t=e.caStore:t=P.pki.createCaStore();var a=e.cipherSuites||null;if(a===null){a=[];for(var r in g.CipherSuites)a.push(g.CipherSuites[r])}var i=e.server?g.ConnectionEnd.server:g.ConnectionEnd.client,s=e.sessionCache?g.createSessionCache(e.sessionCache):null,n={version:{major:g.Version.major,minor:g.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:a,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(u,p,m,S){return p},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:P.util.createBuffer(),tlsData:P.util.createBuffer(),data:P.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(u,p){p.origin=p.origin||(u.entity===g.ConnectionEnd.client?"client":"server"),p.send&&(g.queue(u,g.createAlert(u,p.alert)),g.flush(u));var m=p.fatal!==!1;m&&(u.fail=!0),e.error(u,p),m&&u.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};n.reset=function(u){n.version={major:g.Version.major,minor:g.Version.minor},n.record=null,n.session=null,n.peerCertificate=null,n.state={pending:null,current:null},n.expect=n.entity===g.ConnectionEnd.client?w0:P0,n.fragmented=null,n.records=[],n.open=!1,n.handshakes=0,n.handshaking=!1,n.isConnected=!1,n.fail=!(u||typeof u>"u"),n.input.clear(),n.tlsData.clear(),n.data.clear(),n.state.current=g.createConnectionState(n)},n.reset();var o=function(u,p){var m=p.type-g.ContentType.change_cipher_spec,S=Ka[u.entity][u.expect];m in S?S[m](u,p):g.handleUnexpected(u,p)},l=function(u){var p=0,m=u.input,S=m.length();if(S<5)p=5-S;else{u.record={type:m.getByte(),version:{major:m.getByte(),minor:m.getByte()},length:m.getInt16(),fragment:P.util.createBuffer(),ready:!1};var C=u.record.version.major===u.version.major;C&&u.session&&u.session.version&&(C=u.record.version.minor===u.version.minor),C||u.error(u,{message:"Incompatible TLS version.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}})}return p},f=function(u){var p=0,m=u.input,S=m.length();if(S<u.record.length)p=u.record.length-S;else{u.record.fragment.putBytes(m.getBytes(u.record.length)),m.compact();var C=u.state.current.read;C.update(u,u.record)&&(u.fragmented!==null&&(u.fragmented.type===u.record.type?(u.fragmented.fragment.putBuffer(u.record.fragment),u.record=u.fragmented):u.error(u,{message:"Invalid fragmented record.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unexpected_message}})),u.record.ready=!0)}return p};return n.handshake=function(u){if(n.entity!==g.ConnectionEnd.client)n.error(n,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(n.handshaking)n.error(n,{message:"Handshake already in progress.",fatal:!1});else{n.fail&&!n.open&&n.handshakes===0&&(n.fail=!1),n.handshaking=!0,u=u||"";var p=null;u.length>0&&(n.sessionCache&&(p=n.sessionCache.getSession(u)),p===null&&(u="")),u.length===0&&n.sessionCache&&(p=n.sessionCache.getSession(),p!==null&&(u=p.id)),n.session={id:u,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:P.md.md5.create(),sha1:P.md.sha1.create()},p&&(n.version=p.version,n.session.sp=p.sp),n.session.sp.client_random=g.createRandom().getBytes(),n.open=!0,g.queue(n,g.createRecord(n,{type:g.ContentType.handshake,data:g.createClientHello(n)})),g.flush(n)}},n.process=function(u){var p=0;return u&&n.input.putBytes(u),n.fail||(n.record!==null&&n.record.ready&&n.record.fragment.isEmpty()&&(n.record=null),n.record===null&&(p=l(n)),!n.fail&&n.record!==null&&!n.record.ready&&(p=f(n)),!n.fail&&n.record!==null&&n.record.ready&&o(n,n.record)),p},n.prepare=function(u){return g.queue(n,g.createRecord(n,{type:g.ContentType.application_data,data:P.util.createBuffer(u)})),g.flush(n)},n.prepareHeartbeatRequest=function(u,p){return u instanceof P.util.ByteBuffer&&(u=u.bytes()),typeof p>"u"&&(p=u.length),n.expectedHeartbeatPayload=u,g.queue(n,g.createRecord(n,{type:g.ContentType.heartbeat,data:g.createHeartbeat(g.HeartbeatMessageType.heartbeat_request,u,p)})),g.flush(n)},n.close=function(u){if(!n.fail&&n.sessionCache&&n.session){var p={id:n.session.id,version:n.session.version,sp:n.session.sp};p.sp.keys=null,n.sessionCache.setSession(p.id,p)}n.open&&(n.open=!1,n.input.clear(),(n.isConnected||n.handshaking)&&(n.isConnected=n.handshaking=!1,g.queue(n,g.createAlert(n,{level:g.Alert.Level.warning,description:g.Alert.Description.close_notify})),g.flush(n)),n.closed(n)),n.reset(u)},n};P.tls=P.tls||{};for(var sa in g)typeof g[sa]!="function"&&(P.tls[sa]=g[sa]);P.tls.prf_tls1=Zr;P.tls.hmac_sha1=A0;P.tls.createSessionCache=g.createSessionCache;P.tls.createConnection=g.createConnection;var Mt=ee,ht=Mt.tls;ht.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=ht.BulkCipherAlgorithm.aes,e.cipher_type=ht.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=ht.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:tn};ht.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=ht.BulkCipherAlgorithm.aes,e.cipher_type=ht.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=ht.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:tn};function tn(e,t,a){var r=t.entity===Mt.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:Mt.cipher.createDecipher("AES-CBC",r?a.keys.server_write_key:a.keys.client_write_key),iv:r?a.keys.server_write_IV:a.keys.client_write_IV},e.write.cipherState={init:!1,cipher:Mt.cipher.createCipher("AES-CBC",r?a.keys.client_write_key:a.keys.server_write_key),iv:r?a.keys.client_write_IV:a.keys.server_write_IV},e.read.cipherFunction=W0,e.write.cipherFunction=z0,e.read.macLength=e.write.macLength=a.mac_length,e.read.macFunction=e.write.macFunction=ht.hmac_sha1}function z0(e,t){var a=!1,r=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(r),t.updateSequenceNumber();var i;e.version.minor===ht.Versions.TLS_1_0.minor?i=t.cipherState.init?null:t.cipherState.iv:i=Mt.random.getBytesSync(16),t.cipherState.init=!0;var s=t.cipherState.cipher;return s.start({iv:i}),e.version.minor>=ht.Versions.TLS_1_1.minor&&s.output.putBytes(i),s.update(e.fragment),s.finish(Y0)&&(e.fragment=s.output,e.length=e.fragment.length(),a=!0),a}function Y0(e,t,a){if(!a){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function X0(e,t,a){var r=!0;if(a){for(var i=t.length(),s=t.last(),n=i-1-s;n<i-1;++n)r=r&&t.at(n)==s;r&&t.truncate(s+1)}return r}function W0(e,t){var a=!1,r;e.version.minor===ht.Versions.TLS_1_0.minor?r=t.cipherState.init?null:t.cipherState.iv:r=e.fragment.getBytes(16),t.cipherState.init=!0;var i=t.cipherState.cipher;i.start({iv:r}),i.update(e.fragment),a=i.finish(X0);var s=t.macLength,n=Mt.random.getBytesSync(s),o=i.output.length();o>=s?(e.fragment=i.output.getBytes(o-s),n=i.output.getBytes(s)):e.fragment=i.output.getBytes(),e.fragment=Mt.util.createBuffer(e.fragment),e.length=e.fragment.length();var l=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),a=$0(t.macKey,n,l)&&a,a}function $0(e,t,a){var r=Mt.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(a),a=r.digest().getBytes(),t===a}var Se=ee,Ir=Se.sha512=Se.sha512||{};Se.md.sha512=Se.md.algorithms.sha512=Ir;var rn=Se.sha384=Se.sha512.sha384=Se.sha512.sha384||{};rn.create=function(){return Ir.create("SHA-384")};Se.md.sha384=Se.md.algorithms.sha384=rn;Se.sha512.sha256=Se.sha512.sha256||{create:function(){return Ir.create("SHA-512/256")}};Se.md["sha512/256"]=Se.md.algorithms["sha512/256"]=Se.sha512.sha256;Se.sha512.sha224=Se.sha512.sha224||{create:function(){return Ir.create("SHA-512/224")}};Se.md["sha512/224"]=Se.md.algorithms["sha512/224"]=Se.sha512.sha224;Ir.create=function(e){if(an||j0(),typeof e>"u"&&(e="SHA-512"),!(e in zt))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=zt[e],a=null,r=Se.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var n=64;switch(e){case"SHA-384":n=48;break;case"SHA-512/256":n=32;break;case"SHA-512/224":n=28;break}var o={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:n,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var l=o.messageLengthSize/4,f=0;f<l;++f)o.fullMessageLength.push(0);r=Se.util.createBuffer(),a=new Array(t.length);for(var f=0;f<t.length;++f)a[f]=t[f].slice(0);return o},o.start(),o.update=function(l,f){f==="utf8"&&(l=Se.util.encodeUtf8(l));var u=l.length;o.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var p=o.fullMessageLength.length-1;p>=0;--p)o.fullMessageLength[p]+=u[1],u[1]=u[0]+(o.fullMessageLength[p]/4294967296>>>0),o.fullMessageLength[p]=o.fullMessageLength[p]>>>0,u[0]=u[1]/4294967296>>>0;return r.putBytes(l),hi(a,i,r),(r.read>2048||r.length()===0)&&r.compact(),o},o.digest=function(){var l=Se.util.createBuffer();l.putBytes(r.bytes());var f=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,u=f&o.blockLength-1;l.putBytes(ma.substr(0,o.blockLength-u));for(var p,m,S=o.fullMessageLength[0]*8,C=0;C<o.fullMessageLength.length-1;++C)p=o.fullMessageLength[C+1]*8,m=p/4294967296>>>0,S+=m,l.putInt32(S>>>0),S=p>>>0;l.putInt32(S);for(var A=new Array(a.length),C=0;C<a.length;++C)A[C]=a[C].slice(0);hi(A,i,l);var b=Se.util.createBuffer(),w;e==="SHA-512"?w=A.length:e==="SHA-384"?w=A.length-2:w=A.length-4;for(var C=0;C<w;++C)b.putInt32(A[C][0]),(C!==w-1||e!=="SHA-512/224")&&b.putInt32(A[C][1]);return b},o};var ma=null,an=!1,Ca=null,zt=null;function j0(){ma="€",ma+=Se.util.fillString("\0",128),Ca=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],zt={},zt["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],zt["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],zt["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],zt["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],an=!0}function hi(e,t,a){for(var r,i,s,n,o,l,f,u,p,m,S,C,A,b,w,U,D,G,K,F,$,j,le,he,de,Ee,je,rt,ye,Ae,z,gt,Rt,be,_e,Le=a.length();Le>=128;){for(ye=0;ye<16;++ye)t[ye][0]=a.getInt32()>>>0,t[ye][1]=a.getInt32()>>>0;for(;ye<80;++ye)gt=t[ye-2],Ae=gt[0],z=gt[1],r=((Ae>>>19|z<<13)^(z>>>29|Ae<<3)^Ae>>>6)>>>0,i=((Ae<<13|z>>>19)^(z<<3|Ae>>>29)^(Ae<<26|z>>>6))>>>0,be=t[ye-15],Ae=be[0],z=be[1],s=((Ae>>>1|z<<31)^(Ae>>>8|z<<24)^Ae>>>7)>>>0,n=((Ae<<31|z>>>1)^(Ae<<24|z>>>8)^(Ae<<25|z>>>7))>>>0,Rt=t[ye-7],_e=t[ye-16],z=i+Rt[1]+n+_e[1],t[ye][0]=r+Rt[0]+s+_e[0]+(z/4294967296>>>0)>>>0,t[ye][1]=z>>>0;for(A=e[0][0],b=e[0][1],w=e[1][0],U=e[1][1],D=e[2][0],G=e[2][1],K=e[3][0],F=e[3][1],$=e[4][0],j=e[4][1],le=e[5][0],he=e[5][1],de=e[6][0],Ee=e[6][1],je=e[7][0],rt=e[7][1],ye=0;ye<80;++ye)f=(($>>>14|j<<18)^($>>>18|j<<14)^(j>>>9|$<<23))>>>0,u=(($<<18|j>>>14)^($<<14|j>>>18)^(j<<23|$>>>9))>>>0,p=(de^$&(le^de))>>>0,m=(Ee^j&(he^Ee))>>>0,o=((A>>>28|b<<4)^(b>>>2|A<<30)^(b>>>7|A<<25))>>>0,l=((A<<4|b>>>28)^(b<<30|A>>>2)^(b<<25|A>>>7))>>>0,S=(A&w|D&(A^w))>>>0,C=(b&U|G&(b^U))>>>0,z=rt+u+m+Ca[ye][1]+t[ye][1],r=je+f+p+Ca[ye][0]+t[ye][0]+(z/4294967296>>>0)>>>0,i=z>>>0,z=l+C,s=o+S+(z/4294967296>>>0)>>>0,n=z>>>0,je=de,rt=Ee,de=le,Ee=he,le=$,he=j,z=F+i,$=K+r+(z/4294967296>>>0)>>>0,j=z>>>0,K=D,F=G,D=w,G=U,w=A,U=b,z=i+n,A=r+s+(z/4294967296>>>0)>>>0,b=z>>>0;z=e[0][1]+b,e[0][0]=e[0][0]+A+(z/4294967296>>>0)>>>0,e[0][1]=z>>>0,z=e[1][1]+U,e[1][0]=e[1][0]+w+(z/4294967296>>>0)>>>0,e[1][1]=z>>>0,z=e[2][1]+G,e[2][0]=e[2][0]+D+(z/4294967296>>>0)>>>0,e[2][1]=z>>>0,z=e[3][1]+F,e[3][0]=e[3][0]+K+(z/4294967296>>>0)>>>0,e[3][1]=z>>>0,z=e[4][1]+j,e[4][0]=e[4][0]+$+(z/4294967296>>>0)>>>0,e[4][1]=z>>>0,z=e[5][1]+he,e[5][0]=e[5][0]+le+(z/4294967296>>>0)>>>0,e[5][1]=z>>>0,z=e[6][1]+Ee,e[6][0]=e[6][0]+de+(z/4294967296>>>0)>>>0,e[6][1]=z>>>0,z=e[7][1]+rt,e[7][0]=e[7][0]+je+(z/4294967296>>>0)>>>0,e[7][1]=z>>>0,Le-=128}}var Ma={},Z0=ee,Qe=Z0.asn1;Ma.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Ma.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]};var $e=ee,nn=Ma,J0=nn.publicKeyValidator,eu=nn.privateKeyValidator;if(typeof tu>"u")var tu=$e.jsbn.BigInteger;var Ea=$e.util.ByteBuffer,it=typeof pt>"u"?Uint8Array:pt;$e.pki=$e.pki||{};$e.pki.ed25519=$e.ed25519=$e.ed25519||{};var ae=$e.ed25519;ae.constants={};ae.constants.PUBLIC_KEY_BYTE_LENGTH=32;ae.constants.PRIVATE_KEY_BYTE_LENGTH=64;ae.constants.SEED_BYTE_LENGTH=32;ae.constants.SIGN_BYTE_LENGTH=64;ae.constants.HASH_BYTE_LENGTH=64;ae.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=$e.random.getBytesSync(ae.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==ae.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+ae.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=Nt({message:t,encoding:"binary"});for(var a=new it(ae.constants.PUBLIC_KEY_BYTE_LENGTH),r=new it(ae.constants.PRIVATE_KEY_BYTE_LENGTH),i=0;i<32;++i)r[i]=t[i];return nu(a,r),{publicKey:a,privateKey:r}};ae.privateKeyFromAsn1=function(e){var t={},a=[],r=$e.asn1.validate(e,eu,t,a);if(!r){var i=new Error("Invalid Key.");throw i.errors=a,i}var s=$e.asn1.derToOid(t.privateKeyOid),n=$e.oids.EdDSA25519;if(s!==n)throw new Error('Invalid OID "'+s+'"; OID must be "'+n+'".');var o=t.privateKey,l=Nt({message:$e.asn1.fromDer(o).value,encoding:"binary"});return{privateKeyBytes:l}};ae.publicKeyFromAsn1=function(e){var t={},a=[],r=$e.asn1.validate(e,J0,t,a);if(!r){var i=new Error("Invalid Key.");throw i.errors=a,i}var s=$e.asn1.derToOid(t.publicKeyOid),n=$e.oids.EdDSA25519;if(s!==n)throw new Error('Invalid OID "'+s+'"; OID must be "'+n+'".');var o=t.ed25519PublicKey;if(o.length!==ae.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return Nt({message:o,encoding:"binary"})};ae.publicKeyFromPrivateKey=function(e){e=e||{};var t=Nt({message:e.privateKey,encoding:"binary"});if(t.length!==ae.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ae.constants.PRIVATE_KEY_BYTE_LENGTH);for(var a=new it(ae.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<a.length;++r)a[r]=t[32+r];return a};ae.sign=function(e){e=e||{};var t=Nt(e),a=Nt({message:e.privateKey,encoding:"binary"});if(a.length===ae.constants.SEED_BYTE_LENGTH){var r=ae.generateKeyPair({seed:a});a=r.privateKey}else if(a.length!==ae.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ae.constants.SEED_BYTE_LENGTH+" or "+ae.constants.PRIVATE_KEY_BYTE_LENGTH);var i=new it(ae.constants.SIGN_BYTE_LENGTH+t.length);su(i,t,t.length,a);for(var s=new it(ae.constants.SIGN_BYTE_LENGTH),n=0;n<s.length;++n)s[n]=i[n];return s};ae.verify=function(e){e=e||{};var t=Nt(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var a=Nt({message:e.signature,encoding:"binary"});if(a.length!==ae.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+ae.constants.SIGN_BYTE_LENGTH);var r=Nt({message:e.publicKey,encoding:"binary"});if(r.length!==ae.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+ae.constants.PUBLIC_KEY_BYTE_LENGTH);var i=new it(ae.constants.SIGN_BYTE_LENGTH+t.length),s=new it(ae.constants.SIGN_BYTE_LENGTH+t.length),n;for(n=0;n<ae.constants.SIGN_BYTE_LENGTH;++n)i[n]=a[n];for(n=0;n<t.length;++n)i[n+ae.constants.SIGN_BYTE_LENGTH]=t[n];return ou(s,i,i.length,r)>=0};function Nt(e){var t=e.message;if(t instanceof Uint8Array||t instanceof it)return t;var a=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),a="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!a)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof pt<"u")return pt.from(t,a);t=new Ea(t,a)}else if(!(t instanceof Ea))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var r=new it(t.length()),i=0;i<r.length;++i)r[i]=t.at(i);return r}var xa=W(),Kr=W([1]),ru=W([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),au=W([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),pi=W([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),di=W([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),mr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),iu=W([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Cr(e,t){var a=$e.md.sha512.create(),r=new Ea(e);a.update(r.getBytes(t),"binary");var i=a.digest().getBytes();if(typeof pt<"u")return pt.from(i,"binary");for(var s=new it(ae.constants.HASH_BYTE_LENGTH),n=0;n<64;++n)s[n]=i.charCodeAt(n);return s}function nu(e,t){var a=[W(),W(),W(),W()],r,i=Cr(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,Ga(a,i),Ha(e,a),r=0;r<32;++r)t[r+32]=e[r];return 0}function su(e,t,a,r){var i,s,n=new Float64Array(64),o=[W(),W(),W(),W()],l=Cr(r,32);l[0]&=248,l[31]&=127,l[31]|=64;var f=a+64;for(i=0;i<a;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=l[32+i];var u=Cr(e.subarray(32),a+32);for(Sa(u),Ga(o,u),Ha(e,o),i=32;i<64;++i)e[i]=r[i];var p=Cr(e,a+64);for(Sa(p),i=32;i<64;++i)n[i]=0;for(i=0;i<32;++i)n[i]=u[i];for(i=0;i<32;++i)for(s=0;s<32;s++)n[i+s]+=p[i]*l[s];return sn(e.subarray(32),n),f}function ou(e,t,a,r){var i,s,n=new it(32),o=[W(),W(),W(),W()],l=[W(),W(),W(),W()];if(s=-1,a<64||fu(l,r)||!uu(t,32))return-1;for(i=0;i<a;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=r[i];var f=Cr(e,a);if(Sa(f),fn(o,l,f),Ga(l,t.subarray(32)),Ta(o,l),Ha(n,o),a-=64,on(t,0,n,0)){for(i=0;i<a;++i)e[i]=0;return-1}for(i=0;i<a;++i)e[i]=t[i+64];return s=a,s}function uu(e,t){var a;for(a=31;a>=0;--a){if(e[t+a]<mr[a])return!0;if(e[t+a]>mr[a])return!1}return!1}function sn(e,t){var a,r,i,s;for(r=63;r>=32;--r){for(a=0,i=r-32,s=r-12;i<s;++i)t[i]+=a-16*t[r]*mr[i-(r-32)],a=t[i]+128>>8,t[i]-=a*256;t[i]+=a,t[r]=0}for(a=0,i=0;i<32;++i)t[i]+=a-(t[31]>>4)*mr[i],a=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=a*mr[i];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function Sa(e){for(var t=new Float64Array(64),a=0;a<64;++a)t[a]=e[a],e[a]=0;sn(e,t)}function Ta(e,t){var a=W(),r=W(),i=W(),s=W(),n=W(),o=W(),l=W(),f=W(),u=W();ar(a,e[1],e[0]),ar(u,t[1],t[0]),ve(a,a,u),tr(r,e[0],e[1]),tr(u,t[0],t[1]),ve(r,r,u),ve(i,e[3],t[3]),ve(i,i,au),ve(s,e[2],t[2]),tr(s,s,s),ar(n,r,a),ar(o,s,i),tr(l,s,i),tr(f,r,a),ve(e[0],n,o),ve(e[1],f,l),ve(e[2],l,o),ve(e[3],n,f)}function yi(e,t,a){for(var r=0;r<4;++r)ln(e[r],t[r],a)}function Ha(e,t){var a=W(),r=W(),i=W();pu(i,t[2]),ve(a,t[0],i),ve(r,t[1],i),Mr(e,r),e[31]^=un(a)<<7}function Mr(e,t){var a,r,i,s=W(),n=W();for(a=0;a<16;++a)n[a]=t[a];for(oa(n),oa(n),oa(n),r=0;r<2;++r){for(s[0]=n[0]-65517,a=1;a<15;++a)s[a]=n[a]-65535-(s[a-1]>>16&1),s[a-1]&=65535;s[15]=n[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,ln(n,s,1-i)}for(a=0;a<16;a++)e[2*a]=n[a]&255,e[2*a+1]=n[a]>>8}function fu(e,t){var a=W(),r=W(),i=W(),s=W(),n=W(),o=W(),l=W();return Ot(e[2],Kr),lu(e[1],t),Yt(i,e[1]),ve(s,i,ru),ar(i,i,e[2]),tr(s,e[2],s),Yt(n,s),Yt(o,n),ve(l,o,n),ve(a,l,i),ve(a,a,s),cu(a,a),ve(a,a,i),ve(a,a,s),ve(a,a,s),ve(e[0],a,s),Yt(r,e[0]),ve(r,r,s),gi(r,i)&&ve(e[0],e[0],iu),Yt(r,e[0]),ve(r,r,s),gi(r,i)?-1:(un(e[0])===t[31]>>7&&ar(e[0],xa,e[0]),ve(e[3],e[0],e[1]),0)}function lu(e,t){var a;for(a=0;a<16;++a)e[a]=t[2*a]+(t[2*a+1]<<8);e[15]&=32767}function cu(e,t){var a=W(),r;for(r=0;r<16;++r)a[r]=t[r];for(r=250;r>=0;--r)Yt(a,a),r!==1&&ve(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}function gi(e,t){var a=new it(32),r=new it(32);return Mr(a,e),Mr(r,t),on(a,0,r,0)}function on(e,t,a,r){return hu(e,t,a,r,32)}function hu(e,t,a,r,i){var s,n=0;for(s=0;s<i;++s)n|=e[t+s]^a[r+s];return(1&n-1>>>8)-1}function un(e){var t=new it(32);return Mr(t,e),t[0]&1}function fn(e,t,a){var r,i;for(Ot(e[0],xa),Ot(e[1],Kr),Ot(e[2],Kr),Ot(e[3],xa),i=255;i>=0;--i)r=a[i/8|0]>>(i&7)&1,yi(e,t,r),Ta(t,e),Ta(e,e),yi(e,t,r)}function Ga(e,t){var a=[W(),W(),W(),W()];Ot(a[0],pi),Ot(a[1],di),Ot(a[2],Kr),ve(a[3],pi,di),fn(e,a,t)}function Ot(e,t){var a;for(a=0;a<16;a++)e[a]=t[a]|0}function pu(e,t){var a=W(),r;for(r=0;r<16;++r)a[r]=t[r];for(r=253;r>=0;--r)Yt(a,a),r!==2&&r!==4&&ve(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}function oa(e){var t,a,r=1;for(t=0;t<16;++t)a=e[t]+r+65535,r=Math.floor(a/65536),e[t]=a-r*65536;e[0]+=r-1+37*(r-1)}function ln(e,t,a){for(var r,i=~(a-1),s=0;s<16;++s)r=i&(e[s]^t[s]),e[s]^=r,t[s]^=r}function W(e){var t,a=new Float64Array(16);if(e)for(t=0;t<e.length;++t)a[t]=e[t];return a}function tr(e,t,a){for(var r=0;r<16;++r)e[r]=t[r]+a[r]}function ar(e,t,a){for(var r=0;r<16;++r)e[r]=t[r]-a[r]}function Yt(e,t){ve(e,t,t)}function ve(e,t,a){var r,i,s=0,n=0,o=0,l=0,f=0,u=0,p=0,m=0,S=0,C=0,A=0,b=0,w=0,U=0,D=0,G=0,K=0,F=0,$=0,j=0,le=0,he=0,de=0,Ee=0,je=0,rt=0,ye=0,Ae=0,z=0,gt=0,Rt=0,be=a[0],_e=a[1],Le=a[2],He=a[3],se=a[4],ce=a[5],ke=a[6],Pe=a[7],Ve=a[8],Fe=a[9],Oe=a[10],Be=a[11],Ue=a[12],Ke=a[13],Ge=a[14],Me=a[15];r=t[0],s+=r*be,n+=r*_e,o+=r*Le,l+=r*He,f+=r*se,u+=r*ce,p+=r*ke,m+=r*Pe,S+=r*Ve,C+=r*Fe,A+=r*Oe,b+=r*Be,w+=r*Ue,U+=r*Ke,D+=r*Ge,G+=r*Me,r=t[1],n+=r*be,o+=r*_e,l+=r*Le,f+=r*He,u+=r*se,p+=r*ce,m+=r*ke,S+=r*Pe,C+=r*Ve,A+=r*Fe,b+=r*Oe,w+=r*Be,U+=r*Ue,D+=r*Ke,G+=r*Ge,K+=r*Me,r=t[2],o+=r*be,l+=r*_e,f+=r*Le,u+=r*He,p+=r*se,m+=r*ce,S+=r*ke,C+=r*Pe,A+=r*Ve,b+=r*Fe,w+=r*Oe,U+=r*Be,D+=r*Ue,G+=r*Ke,K+=r*Ge,F+=r*Me,r=t[3],l+=r*be,f+=r*_e,u+=r*Le,p+=r*He,m+=r*se,S+=r*ce,C+=r*ke,A+=r*Pe,b+=r*Ve,w+=r*Fe,U+=r*Oe,D+=r*Be,G+=r*Ue,K+=r*Ke,F+=r*Ge,$+=r*Me,r=t[4],f+=r*be,u+=r*_e,p+=r*Le,m+=r*He,S+=r*se,C+=r*ce,A+=r*ke,b+=r*Pe,w+=r*Ve,U+=r*Fe,D+=r*Oe,G+=r*Be,K+=r*Ue,F+=r*Ke,$+=r*Ge,j+=r*Me,r=t[5],u+=r*be,p+=r*_e,m+=r*Le,S+=r*He,C+=r*se,A+=r*ce,b+=r*ke,w+=r*Pe,U+=r*Ve,D+=r*Fe,G+=r*Oe,K+=r*Be,F+=r*Ue,$+=r*Ke,j+=r*Ge,le+=r*Me,r=t[6],p+=r*be,m+=r*_e,S+=r*Le,C+=r*He,A+=r*se,b+=r*ce,w+=r*ke,U+=r*Pe,D+=r*Ve,G+=r*Fe,K+=r*Oe,F+=r*Be,$+=r*Ue,j+=r*Ke,le+=r*Ge,he+=r*Me,r=t[7],m+=r*be,S+=r*_e,C+=r*Le,A+=r*He,b+=r*se,w+=r*ce,U+=r*ke,D+=r*Pe,G+=r*Ve,K+=r*Fe,F+=r*Oe,$+=r*Be,j+=r*Ue,le+=r*Ke,he+=r*Ge,de+=r*Me,r=t[8],S+=r*be,C+=r*_e,A+=r*Le,b+=r*He,w+=r*se,U+=r*ce,D+=r*ke,G+=r*Pe,K+=r*Ve,F+=r*Fe,$+=r*Oe,j+=r*Be,le+=r*Ue,he+=r*Ke,de+=r*Ge,Ee+=r*Me,r=t[9],C+=r*be,A+=r*_e,b+=r*Le,w+=r*He,U+=r*se,D+=r*ce,G+=r*ke,K+=r*Pe,F+=r*Ve,$+=r*Fe,j+=r*Oe,le+=r*Be,he+=r*Ue,de+=r*Ke,Ee+=r*Ge,je+=r*Me,r=t[10],A+=r*be,b+=r*_e,w+=r*Le,U+=r*He,D+=r*se,G+=r*ce,K+=r*ke,F+=r*Pe,$+=r*Ve,j+=r*Fe,le+=r*Oe,he+=r*Be,de+=r*Ue,Ee+=r*Ke,je+=r*Ge,rt+=r*Me,r=t[11],b+=r*be,w+=r*_e,U+=r*Le,D+=r*He,G+=r*se,K+=r*ce,F+=r*ke,$+=r*Pe,j+=r*Ve,le+=r*Fe,he+=r*Oe,de+=r*Be,Ee+=r*Ue,je+=r*Ke,rt+=r*Ge,ye+=r*Me,r=t[12],w+=r*be,U+=r*_e,D+=r*Le,G+=r*He,K+=r*se,F+=r*ce,$+=r*ke,j+=r*Pe,le+=r*Ve,he+=r*Fe,de+=r*Oe,Ee+=r*Be,je+=r*Ue,rt+=r*Ke,ye+=r*Ge,Ae+=r*Me,r=t[13],U+=r*be,D+=r*_e,G+=r*Le,K+=r*He,F+=r*se,$+=r*ce,j+=r*ke,le+=r*Pe,he+=r*Ve,de+=r*Fe,Ee+=r*Oe,je+=r*Be,rt+=r*Ue,ye+=r*Ke,Ae+=r*Ge,z+=r*Me,r=t[14],D+=r*be,G+=r*_e,K+=r*Le,F+=r*He,$+=r*se,j+=r*ce,le+=r*ke,he+=r*Pe,de+=r*Ve,Ee+=r*Fe,je+=r*Oe,rt+=r*Be,ye+=r*Ue,Ae+=r*Ke,z+=r*Ge,gt+=r*Me,r=t[15],G+=r*be,K+=r*_e,F+=r*Le,$+=r*He,j+=r*se,le+=r*ce,he+=r*ke,de+=r*Pe,Ee+=r*Ve,je+=r*Fe,rt+=r*Oe,ye+=r*Be,Ae+=r*Ue,z+=r*Ke,gt+=r*Ge,Rt+=r*Me,s+=38*K,n+=38*F,o+=38*$,l+=38*j,f+=38*le,u+=38*he,p+=38*de,m+=38*Ee,S+=38*je,C+=38*rt,A+=38*ye,b+=38*Ae,w+=38*z,U+=38*gt,D+=38*Rt,i=1,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=n+i+65535,i=Math.floor(r/65536),n=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=S+i+65535,i=Math.floor(r/65536),S=r-i*65536,r=C+i+65535,i=Math.floor(r/65536),C=r-i*65536,r=A+i+65535,i=Math.floor(r/65536),A=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,r=w+i+65535,i=Math.floor(r/65536),w=r-i*65536,r=U+i+65535,i=Math.floor(r/65536),U=r-i*65536,r=D+i+65535,i=Math.floor(r/65536),D=r-i*65536,r=G+i+65535,i=Math.floor(r/65536),G=r-i*65536,s+=i-1+37*(i-1),i=1,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=n+i+65535,i=Math.floor(r/65536),n=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=S+i+65535,i=Math.floor(r/65536),S=r-i*65536,r=C+i+65535,i=Math.floor(r/65536),C=r-i*65536,r=A+i+65535,i=Math.floor(r/65536),A=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,r=w+i+65535,i=Math.floor(r/65536),w=r-i*65536,r=U+i+65535,i=Math.floor(r/65536),U=r-i*65536,r=D+i+65535,i=Math.floor(r/65536),D=r-i*65536,r=G+i+65535,i=Math.floor(r/65536),G=r-i*65536,s+=i-1+37*(i-1),e[0]=s,e[1]=n,e[2]=o,e[3]=l,e[4]=f,e[5]=u,e[6]=p,e[7]=m,e[8]=S,e[9]=C,e[10]=A,e[11]=b,e[12]=w,e[13]=U,e[14]=D,e[15]=G}var st=ee;st.kem=st.kem||{};var vi=st.jsbn.BigInteger;st.kem.rsa={};st.kem.rsa.create=function(e,t){t=t||{};var a=t.prng||st.random,r={};return r.encrypt=function(i,s){var n=Math.ceil(i.n.bitLength()/8),o;do o=new vi(st.util.bytesToHex(a.getBytesSync(n)),16).mod(i.n);while(o.compareTo(vi.ONE)<=0);o=st.util.hexToBytes(o.toString(16));var l=n-o.length;l>0&&(o=st.util.fillString("\0",l)+o);var f=i.encrypt(o,"NONE"),u=e.generate(o,s);return{encapsulation:f,key:u}},r.decrypt=function(i,s,n){var o=i.decrypt(s,"NONE");return e.generate(o,n)},r};st.kem.kdf1=function(e,t){cn(this,e,0,t||e.digestLength)};st.kem.kdf2=function(e,t){cn(this,e,1,t||e.digestLength)};function cn(e,t,a,r){e.generate=function(i,s){for(var n=new st.util.ByteBuffer,o=Math.ceil(s/r)+a,l=new st.util.ByteBuffer,f=a;f<o;++f){l.putInt32(f),t.start(),t.update(i+l.getBytes());var u=t.digest();n.putBytes(u.getBytes(r))}return n.truncate(n.length()-s),n.getBytes()}}var ne=ee;ne.log=ne.log||{};ne.log.levels=["none","error","warning","info","debug","verbose","max"];var Hr={},Ia=[],Er=null;ne.log.LEVEL_LOCKED=2;ne.log.NO_LEVEL_CHECK=4;ne.log.INTERPOLATE=8;for(var Kt=0;Kt<ne.log.levels.length;++Kt){var mi=ne.log.levels[Kt];Hr[mi]={index:Kt,name:mi.toUpperCase()}}ne.log.logMessage=function(e){for(var t=Hr[e.level].index,a=0;a<Ia.length;++a){var r=Ia[a];if(r.flags&ne.log.NO_LEVEL_CHECK)r.f(e);else{var i=Hr[r.level].index;t<=i&&r.f(r,e)}}};ne.log.prepareStandard=function(e){"standard"in e||(e.standard=Hr[e.level].name+" ["+e.category+"] "+e.message)};ne.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=ne.util.format.apply(this,t)}};ne.log.prepareStandardFull=function(e){"standardFull"in e||(ne.log.prepareStandard(e),e.standardFull=e.standard)};for(var Ci=["error","warning","info","debug","verbose"],Kt=0;Kt<Ci.length;++Kt)(function(t){ne.log[t]=function(a,r){var i=Array.prototype.slice.call(arguments).slice(2),s={timestamp:new Date,level:t,category:a,message:r,arguments:i};ne.log.logMessage(s)}})(Ci[Kt]);ne.log.makeLogger=function(e){var t={flags:0,f:e};return ne.log.setLevel(t,"none"),t};ne.log.setLevel=function(e,t){var a=!1;if(e&&!(e.flags&ne.log.LEVEL_LOCKED))for(var r=0;r<ne.log.levels.length;++r){var i=ne.log.levels[r];if(t==i){e.level=t,a=!0;break}}return a};ne.log.lock=function(e,t){typeof t>"u"||t?e.flags|=ne.log.LEVEL_LOCKED:e.flags&=~ne.log.LEVEL_LOCKED};ne.log.addLogger=function(e){Ia.push(e)};if(typeof console<"u"&&"log"in console){var dr;if(console.error&&console.warn&&console.info&&console.debug){var du={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},qa=function(e,t){ne.log.prepareStandard(t);var a=du[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),a.apply(console,r)};dr=ne.log.makeLogger(qa)}else{var qa=function(t,a){ne.log.prepareStandardFull(a),console.log(a.standardFull)};dr=ne.log.makeLogger(qa)}ne.log.setLevel(dr,"debug"),ne.log.addLogger(dr),Er=dr}else console={log:function(){}};if(Er!==null&&typeof window<"u"&&window.location){var _r=new URL(window.location.href).searchParams;if(_r.has("console.level")&&ne.log.setLevel(Er,_r.get("console.level").slice(-1)[0]),_r.has("console.lock")){var yu=_r.get("console.lock").slice(-1)[0];yu=="true"&&ne.log.lock(Er)}}ne.log.consoleLogger=Er;var M=ee,T=M.asn1,tt=M.pkcs7=M.pkcs7||{};tt.messageFromPem=function(e){var t=M.pem.decode(e)[0];if(t.type!=="PKCS7"){var a=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=T.fromDer(t.body);return tt.messageFromAsn1(r)};tt.messageToPem=function(e,t){var a={type:"PKCS7",body:T.toDer(e.toAsn1()).getBytes()};return M.pem.encode(a,{maxline:t})};tt.messageFromAsn1=function(e){var t={},a=[];if(!T.validate(e,tt.asn1.contentInfoValidator,t,a)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=a,r}var i=T.derToOid(t.contentType),s;switch(i){case M.pki.oids.envelopedData:s=tt.createEnvelopedData();break;case M.pki.oids.encryptedData:s=tt.createEncryptedData();break;case M.pki.oids.signedData:s=tt.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+i+" is not (yet) supported.")}return s.fromAsn1(t.content.value[0]),s};tt.createSignedData=function(){var e=null;return e={type:M.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(r){if(Qa(e,r,tt.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var i=e.rawCapture.certificates.value,s=0;s<i.length;++s)e.certificates.push(M.pki.certificateFromAsn1(i[s]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],i=0;i<e.certificates.length;++i)r.push(M.pki.certificateToAsn1(e.certificates[i]));var s=[],n=T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(e.version).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&n.value[0].value.push(T.create(T.Class.CONTEXT_SPECIFIC,0,!0,r)),s.length>0&&n.value[0].value.push(T.create(T.Class.CONTEXT_SPECIFIC,1,!0,s)),n.value[0].value.push(T.create(T.Class.UNIVERSAL,T.Type.SET,!0,e.signerInfos)),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.type).getBytes()),n])},addSigner:function(r){var i=r.issuer,s=r.serialNumber;if(r.certificate){var n=r.certificate;typeof n=="string"&&(n=M.pki.certificateFromPem(n)),i=n.issuer.attributes,s=n.serialNumber}var o=r.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=M.pki.privateKeyFromPem(o));var l=r.digestAlgorithm||M.pki.oids.sha1;switch(l){case M.pki.oids.sha1:case M.pki.oids.sha256:case M.pki.oids.sha384:case M.pki.oids.sha512:case M.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+l)}var f=r.authenticatedAttributes||[];if(f.length>0){for(var u=!1,p=!1,m=0;m<f.length;++m){var S=f[m];if(!u&&S.type===M.pki.oids.contentType){if(u=!0,p)break;continue}if(!p&&S.type===M.pki.oids.messageDigest){if(p=!0,u)break;continue}}if(!u||!p)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:i,serialNumber:s,digestAlgorithm:l,signatureAlgorithm:M.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:f,unauthenticatedAttributes:[]})},sign:function(r){if(r=r||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(M.pki.oids.data).getBytes())]),"content"in e)){var i;e.content instanceof M.util.ByteBuffer?i=e.content.bytes():typeof e.content=="string"&&(i=M.util.encodeUtf8(e.content)),r.detached?e.detachedContent=T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,i):e.contentInfo.value.push(T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,i)]))}if(e.signers.length!==0){var s=t();a(s)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(r){typeof r=="string"&&(r=M.pki.certificateFromPem(r)),e.certificates.push(r)},addCertificateRevokationList:function(r){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var r={},i=0;i<e.signers.length;++i){var s=e.signers[i],n=s.digestAlgorithm;n in r||(r[n]=M.md[M.pki.oids[n]].create()),s.authenticatedAttributes.length===0?s.md=r[n]:s.md=M.md[M.pki.oids[n]].create()}e.digestAlgorithmIdentifiers=[];for(var n in r)e.digestAlgorithmIdentifiers.push(T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(n).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")]));return r}function a(r){var i;if(e.detachedContent?i=e.detachedContent:(i=e.contentInfo.value[1],i=i.value[0]),!i)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var s=T.derToOid(e.contentInfo.value[0].value),n=T.toDer(i);n.getByte(),T.getBerValueLength(n),n=n.getBytes();for(var o in r)r[o].start().update(n);for(var l=new Date,f=0;f<e.signers.length;++f){var u=e.signers[f];if(u.authenticatedAttributes.length===0){if(s!==M.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{u.authenticatedAttributesAsn1=T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=T.create(T.Class.UNIVERSAL,T.Type.SET,!0,[]),m=0;m<u.authenticatedAttributes.length;++m){var S=u.authenticatedAttributes[m];S.type===M.pki.oids.messageDigest?S.value=r[u.digestAlgorithm].digest():S.type===M.pki.oids.signingTime&&(S.value||(S.value=l)),p.value.push(Ba(S)),u.authenticatedAttributesAsn1.value.push(Ba(S))}n=T.toDer(p).getBytes(),u.md.start().update(n)}u.signature=u.key.sign(u.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=xu(e.signers)}};tt.createEncryptedData=function(){var e=null;return e={type:M.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:M.pki.oids["aes256-CBC"]},fromAsn1:function(t){Qa(e,t,tt.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),hn(e)}},e};tt.createEnvelopedData=function(){var e=null;return e={type:M.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:M.pki.oids["aes256-CBC"]},fromAsn1:function(t){var a=Qa(e,t,tt.asn1.envelopedDataValidator);e.recipients=mu(a.recipientInfos.value)},toAsn1:function(){return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.type).getBytes()),T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(e.version).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SET,!0,Cu(e.recipients)),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,Su(e.encryptedContent))])])])},findRecipient:function(t){for(var a=t.issuer.attributes,r=0;r<e.recipients.length;++r){var i=e.recipients[r],s=i.issuer;if(i.serialNumber===t.serialNumber&&s.length===a.length){for(var n=!0,o=0;o<a.length;++o)if(s[o].type!==a[o].type||s[o].value!==a[o].value){n=!1;break}if(n)return i}}return null},decrypt:function(t,a){if(e.encryptedContent.key===void 0&&t!==void 0&&a!==void 0)switch(t.encryptedContent.algorithm){case M.pki.oids.rsaEncryption:case M.pki.oids.desCBC:var r=a.decrypt(t.encryptedContent.content);e.encryptedContent.key=M.util.createBuffer(r);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}hn(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:M.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,a){if(e.encryptedContent.content===void 0){a=a||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var r,i,s;switch(a){case M.pki.oids["aes128-CBC"]:r=16,i=16,s=M.aes.createEncryptionCipher;break;case M.pki.oids["aes192-CBC"]:r=24,i=16,s=M.aes.createEncryptionCipher;break;case M.pki.oids["aes256-CBC"]:r=32,i=16,s=M.aes.createEncryptionCipher;break;case M.pki.oids["des-EDE3-CBC"]:r=24,i=8,s=M.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+a)}if(t===void 0)t=M.util.createBuffer(M.random.getBytes(r));else if(t.length()!=r)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+r+".");e.encryptedContent.algorithm=a,e.encryptedContent.key=t,e.encryptedContent.parameter=M.util.createBuffer(M.random.getBytes(i));var n=s(t);if(n.start(e.encryptedContent.parameter.copy()),n.update(e.content),!n.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=n.output}for(var o=0;o<e.recipients.length;++o){var l=e.recipients[o];if(l.encryptedContent.content===void 0)switch(l.encryptedContent.algorithm){case M.pki.oids.rsaEncryption:l.encryptedContent.content=l.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+l.encryptedContent.algorithm)}}}},e};function gu(e){var t={},a=[];if(!T.validate(e,tt.asn1.recipientInfoValidator,t,a)){var r=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw r.errors=a,r}return{version:t.version.charCodeAt(0),issuer:M.pki.RDNAttributesAsArray(t.issuer),serialNumber:M.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:T.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function vu(e){return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(e.version).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[M.pki.distinguishedNameToAsn1({attributes:e.issuer}),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,M.util.hexToBytes(e.serialNumber))]),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.encryptedContent.algorithm).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")]),T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function mu(e){for(var t=[],a=0;a<e.length;++a)t.push(gu(e[a]));return t}function Cu(e){for(var t=[],a=0;a<e.length;++a)t.push(vu(e[a]));return t}function Eu(e){var t=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(e.version).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[M.pki.distinguishedNameToAsn1({attributes:e.issuer}),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,M.util.hexToBytes(e.serialNumber))]),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.digestAlgorithm).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.signatureAlgorithm).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")])),t.value.push(T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var a=T.create(T.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r<e.unauthenticatedAttributes.length;++r){var i=e.unauthenticatedAttributes[r];a.values.push(Ba(i))}t.value.push(a)}return t}function xu(e){for(var t=[],a=0;a<e.length;++a)t.push(Eu(e[a]));return t}function Ba(e){var t;if(e.type===M.pki.oids.contentType)t=T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.value).getBytes());else if(e.type===M.pki.oids.messageDigest)t=T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===M.pki.oids.signingTime){var a=new Date("1950-01-01T00:00:00Z"),r=new Date("2050-01-01T00:00:00Z"),i=e.value;if(typeof i=="string"){var s=Date.parse(i);isNaN(s)?i.length===13?i=T.utcTimeToDate(i):i=T.generalizedTimeToDate(i):i=new Date(s)}i>=a&&i<r?t=T.create(T.Class.UNIVERSAL,T.Type.UTCTIME,!1,T.dateToUtcTime(i)):t=T.create(T.Class.UNIVERSAL,T.Type.GENERALIZEDTIME,!1,T.dateToGeneralizedTime(i))}return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.type).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SET,!0,[t])])}function Su(e){return[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(M.pki.oids.data).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.algorithm).getBytes()),e.parameter?T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,e.content.getBytes())])]}function Qa(e,t,a){var r={},i=[];if(!T.validate(t,a,r,i)){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw s.errors=s,s}var n=T.derToOid(r.contentType);if(n!==M.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(r.encryptedContent){var o="";if(M.util.isArray(r.encryptedContent))for(var l=0;l<r.encryptedContent.length;++l){if(r.encryptedContent[l].type!==T.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=r.encryptedContent[l].value}else o=r.encryptedContent;e.encryptedContent={algorithm:T.derToOid(r.encAlgorithm),parameter:M.util.createBuffer(r.encParameter.value),content:M.util.createBuffer(o)}}if(r.content){var o="";if(M.util.isArray(r.content))for(var l=0;l<r.content.length;++l){if(r.content[l].type!==T.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=r.content[l].value}else o=r.content;e.content=M.util.createBuffer(o)}return e.version=r.version.charCodeAt(0),e.rawCapture=r,r}function hn(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case M.pki.oids["aes128-CBC"]:case M.pki.oids["aes192-CBC"]:case M.pki.oids["aes256-CBC"]:t=M.aes.createDecryptionCipher(e.encryptedContent.key);break;case M.pki.oids.desCBC:case M.pki.oids["des-EDE3-CBC"]:t=M.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}var De=ee,Jr=De.ssh=De.ssh||{};Jr.privateKeyToPutty=function(e,t,a){a=a||"",t=t||"";var r="ssh-rsa",i=t===""?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: "+r+`\r
20
+ `;s+="Encryption: "+i+`\r
21
+ `,s+="Comment: "+a+`\r
22
+ `;var n=De.util.createBuffer();ir(n,r),Et(n,e.e),Et(n,e.n);var o=De.util.encode64(n.bytes(),64),l=Math.floor(o.length/66)+1;s+="Public-Lines: "+l+`\r
23
+ `,s+=o;var f=De.util.createBuffer();Et(f,e.d),Et(f,e.p),Et(f,e.q),Et(f,e.qInv);var u;if(!t)u=De.util.encode64(f.bytes(),64);else{var p=f.length()+16-1;p-=p%16;var m=wr(f.bytes());m.truncate(m.length()-p+f.length()),f.putBuffer(m);var S=De.util.createBuffer();S.putBuffer(wr("\0\0\0\0",t)),S.putBuffer(wr("\0\0\0",t));var C=De.aes.createEncryptionCipher(S.truncate(8),"CBC");C.start(De.util.createBuffer().fillWithByte(0,16)),C.update(f.copy()),C.finish();var A=C.output;A.truncate(16),u=De.util.encode64(A.bytes(),64)}l=Math.floor(u.length/66)+1,s+=`\r
24
+ Private-Lines: `+l+`\r
25
+ `,s+=u;var b=wr("putty-private-key-file-mac-key",t),w=De.util.createBuffer();ir(w,r),ir(w,i),ir(w,a),w.putInt32(n.length()),w.putBuffer(n),w.putInt32(f.length()),w.putBuffer(f);var U=De.hmac.create();return U.start("sha1",b),U.update(w.bytes()),s+=`\r
26
+ Private-MAC: `+U.digest().toHex()+`\r
27
+ `,s};Jr.publicKeyToOpenSSH=function(e,t){var a="ssh-rsa";t=t||"";var r=De.util.createBuffer();return ir(r,a),Et(r,e.e),Et(r,e.n),a+" "+De.util.encode64(r.bytes())+" "+t};Jr.privateKeyToOpenSSH=function(e,t){return t?De.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):De.pki.privateKeyToPem(e)};Jr.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||De.md.md5.create(),r="ssh-rsa",i=De.util.createBuffer();ir(i,r),Et(i,e.e),Et(i,e.n),a.start(),a.update(i.getBytes());var s=a.digest();if(t.encoding==="hex"){var n=s.toHex();return t.delimiter?n.match(/.{2}/g).join(t.delimiter):n}else{if(t.encoding==="binary")return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return s};function Et(e,t){var a=t.toString(16);a[0]>="8"&&(a="00"+a);var r=De.util.hexToBytes(a);e.putInt32(r.length),e.putBytes(r)}function ir(e,t){e.putInt32(t.length),e.putString(t)}function wr(){for(var e=De.md.sha1.create(),t=arguments.length,a=0;a<t;++a)e.update(arguments[a]);return e.digest()}var pn=ee;const Tu=Sn(pn),Iu=En({__proto__:null,default:Tu},[pn]);exports.i=Iu;