@peculiar/certificates-viewer 4.7.1-alpha.5 → 4.8.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 (348) hide show
  1. package/components/actions.js +1 -2
  2. package/components/actions.js.map +1 -1
  3. package/components/arrow_top.js +2 -4
  4. package/components/arrow_top.js.map +1 -1
  5. package/components/attribute-certificate-viewer.js +7 -12
  6. package/components/attribute-certificate-viewer.js.map +1 -1
  7. package/components/button-menu.js +4 -2
  8. package/components/button-menu.js.map +1 -1
  9. package/components/button.js +5 -8
  10. package/components/button.js.map +1 -1
  11. package/components/certificate-chain-viewer.js +5 -3
  12. package/components/certificate-chain-viewer.js.map +1 -1
  13. package/components/certificate-viewer.js +4 -2
  14. package/components/certificate-viewer.js.map +1 -1
  15. package/components/circular-progress.js +4 -2
  16. package/components/circular-progress.js.map +1 -1
  17. package/components/crl-viewer.js +6 -7
  18. package/components/crl-viewer.js.map +1 -1
  19. package/components/cross.js +3 -6
  20. package/components/cross.js.map +1 -1
  21. package/components/csr-viewer.js +4 -2
  22. package/components/csr-viewer.js.map +1 -1
  23. package/components/download.js +89 -89
  24. package/components/download.js.map +1 -1
  25. package/components/highlight-words.js +4 -2
  26. package/components/highlight-words.js.map +1 -1
  27. package/components/index2.js +14 -49
  28. package/components/index2.js.map +1 -1
  29. package/components/issuer_name.js.map +1 -1
  30. package/components/miscellaneous.js +61 -153
  31. package/components/miscellaneous.js.map +1 -1
  32. package/components/peculiar-certificate-decoder.js +5 -3
  33. package/components/peculiar-certificate-decoder.js.map +1 -1
  34. package/components/peculiar-certificates-viewer.js +6 -16
  35. package/components/peculiar-certificates-viewer.js.map +1 -1
  36. package/components/pkcs10_certificate_request.js.map +1 -1
  37. package/components/row.js +6 -17
  38. package/components/row.js.map +1 -1
  39. package/components/ssh-certificate-viewer.js +5 -5
  40. package/components/ssh-certificate-viewer.js.map +1 -1
  41. package/components/subject_name.js.map +1 -1
  42. package/components/text-hider.js +4 -2
  43. package/components/text-hider.js.map +1 -1
  44. package/dist/cjs/{actions-ByC9jQU-.js → actions-mGiqn4uZ.js} +4 -5
  45. package/dist/cjs/{actions-ByC9jQU-.js.map → actions-mGiqn4uZ.js.map} +1 -1
  46. package/dist/cjs/{arrow_top-Cw9KN115.js → arrow_top-opfTrg-m.js} +5 -7
  47. package/dist/cjs/{arrow_top-Cw9KN115.js.map → arrow_top-opfTrg-m.js.map} +1 -1
  48. package/dist/cjs/{button-C8EWG_-r.js → button-B215SxsO.js} +8 -11
  49. package/dist/{esm-es5/button-Bbh7MwG6.js.map → cjs/button-B215SxsO.js.map} +1 -1
  50. package/dist/cjs/cross-DV79hJ_S.js +49 -0
  51. package/dist/cjs/{cross-3DqhA0G_.js.map → cross-DV79hJ_S.js.map} +1 -1
  52. package/dist/cjs/download-DAw3krU6.js +23 -0
  53. package/dist/cjs/{download-DQP0KR4o.js.map → download-DAw3krU6.js.map} +1 -1
  54. package/dist/cjs/{extension-CjXYQXbF.js → extension-BDpdRJkE.js} +3 -3
  55. package/dist/cjs/extension-BDpdRJkE.js.map +1 -0
  56. package/dist/cjs/{index-uHmGhObe.js → index-BDWR3dnW.js} +88 -47
  57. package/dist/cjs/index-BDWR3dnW.js.map +1 -0
  58. package/dist/cjs/index.cjs.js +9 -11
  59. package/dist/cjs/{link-Cgh8wnbs.js → link-BScgjwVZ.js} +5 -5
  60. package/dist/cjs/{link-Cgh8wnbs.js.map → link-BScgjwVZ.js.map} +1 -1
  61. package/dist/cjs/loader.cjs.js +2 -4
  62. package/dist/cjs/{miscellaneous-7gtHz795.js → miscellaneous-Bomq8zQH.js} +75 -178
  63. package/dist/cjs/miscellaneous-Bomq8zQH.js.map +1 -0
  64. package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.cjs.js.map +1 -1
  65. package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js +30 -79
  66. package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +3 -5
  67. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +7 -9
  68. package/dist/cjs/peculiar-certificate-decoder.entry.cjs.js.map +1 -1
  69. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +8 -10
  70. package/dist/cjs/peculiar-certificate-viewer.entry.cjs.js.map +1 -1
  71. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +10 -24
  72. package/dist/cjs/peculiar-certificates-viewer.entry.cjs.js.map +1 -1
  73. package/dist/cjs/peculiar-text-hider.cjs.entry.js +3 -5
  74. package/dist/cjs/peculiar.cjs.js +3 -5
  75. package/dist/cjs/peculiar.cjs.js.map +1 -1
  76. package/dist/cjs/{pkcs10_certificate_request-CIOxDu_Z.js → pkcs10_certificate_request-DZLiHGCV.js} +3 -3
  77. package/dist/cjs/{pkcs10_certificate_request-CIOxDu_Z.js.map → pkcs10_certificate_request-DZLiHGCV.js.map} +1 -1
  78. package/dist/cjs/{ssh_certificate-DnXj2sM0.js → ssh_certificate-Bh14rhzR.js} +89 -88
  79. package/dist/cjs/ssh_certificate-Bh14rhzR.js.map +1 -0
  80. package/dist/cjs/{x509_certificate-DPgu-mwG.js → x509_certificate-p8RMn7Hw.js} +4 -4
  81. package/dist/cjs/{x509_certificate-DPgu-mwG.js.map → x509_certificate-p8RMn7Hw.js.map} +1 -1
  82. package/dist/cjs/{x509_crl-D_DKkGcn.js → x509_crl-tjmX6l3R.js} +5 -5
  83. package/dist/cjs/{x509_crl-D_DKkGcn.js.map → x509_crl-tjmX6l3R.js.map} +1 -1
  84. package/dist/collection/collection-manifest.json +2 -2
  85. package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +14 -14
  86. package/dist/collection/components/button-menu/button-menu.js +1 -2
  87. package/dist/collection/components/button-menu/button-menu.js.map +1 -1
  88. package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.css +0 -447
  89. package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js +2 -3
  90. package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js.map +1 -1
  91. package/dist/collection/components/certificate-decoder/certificate-decoder.js +2 -3
  92. package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
  93. package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js +1 -1
  94. package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js.map +1 -1
  95. package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js +1 -1
  96. package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js.map +1 -1
  97. package/dist/collection/components/certificate-viewer/certificate-viewer.js +16 -16
  98. package/dist/collection/components/certificates-viewer/certificates-viewer.js +4 -5
  99. package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -1
  100. package/dist/collection/components/circular-progress/circular-progress.js +2 -2
  101. package/dist/collection/components/crl-viewer/crl-viewer.js +12 -12
  102. package/dist/collection/components/csr-viewer/csr-viewer.js +10 -10
  103. package/dist/collection/components/highlight-words/highlight-words.js +2 -2
  104. package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js +6 -6
  105. package/dist/collection/crypto/extensions/cabforganization_identifier.js.map +1 -1
  106. package/dist/collection/crypto/ssh_certificate.js +8 -3
  107. package/dist/collection/crypto/ssh_certificate.js.map +1 -1
  108. package/dist/esm/{actions-BOY2Tl0T.js → actions-CabuIstu.js} +4 -5
  109. package/dist/esm/{actions-BOY2Tl0T.js.map → actions-CabuIstu.js.map} +1 -1
  110. package/dist/esm/{arrow_top-DL0RWe4n.js → arrow_top-CWdnzNJA.js} +5 -7
  111. package/dist/{esm-es5/arrow_top-DL0RWe4n.js.map → esm/arrow_top-CWdnzNJA.js.map} +1 -1
  112. package/dist/esm/{button-Bbh7MwG6.js → button-DoyFdU2L.js} +8 -11
  113. package/dist/esm/{button-Bbh7MwG6.js.map → button-DoyFdU2L.js.map} +1 -1
  114. package/dist/esm/cross-B4NPVkar.js +45 -0
  115. package/dist/{esm-es5/cross-G84H_-QL.js.map → esm/cross-B4NPVkar.js.map} +1 -1
  116. package/dist/esm/download-C7Viw-3R.js +21 -0
  117. package/dist/esm/{download-ykcxSgxU.js.map → download-C7Viw-3R.js.map} +1 -1
  118. package/dist/esm/{extension-B3br1_Py.js → extension-xW03sQxn.js} +3 -3
  119. package/dist/esm/extension-xW03sQxn.js.map +1 -0
  120. package/dist/esm/{index-CwgZaF40.js → index-B0tLzdJT.js} +88 -47
  121. package/dist/esm/index-B0tLzdJT.js.map +1 -0
  122. package/dist/esm/index.js +9 -11
  123. package/dist/esm/{link-CGURvKy1.js → link-BDCg-T_l.js} +5 -5
  124. package/dist/esm/{link-CGURvKy1.js.map → link-BDCg-T_l.js.map} +1 -1
  125. package/dist/esm/loader.js +3 -5
  126. package/dist/esm/{miscellaneous-phHcBJWR.js → miscellaneous-DxE6a1mr.js} +75 -178
  127. package/dist/esm/miscellaneous-DxE6a1mr.js.map +1 -0
  128. package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -1
  129. package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js +30 -79
  130. package/dist/esm/peculiar-button-menu_3.entry.js +3 -5
  131. package/dist/esm/peculiar-certificate-decoder.entry.js +7 -9
  132. package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
  133. package/dist/esm/peculiar-certificate-viewer.entry.js +8 -10
  134. package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -1
  135. package/dist/esm/peculiar-certificates-viewer.entry.js +10 -24
  136. package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -1
  137. package/dist/esm/peculiar-text-hider.entry.js +3 -5
  138. package/dist/esm/peculiar.js +4 -6
  139. package/dist/esm/peculiar.js.map +1 -1
  140. package/dist/esm/{pkcs10_certificate_request-HIoLPXGQ.js → pkcs10_certificate_request-Crr9FABo.js} +3 -3
  141. package/dist/esm/{pkcs10_certificate_request-HIoLPXGQ.js.map → pkcs10_certificate_request-Crr9FABo.js.map} +1 -1
  142. package/dist/esm/{ssh_certificate-rmToyzuK.js → ssh_certificate-CmOVFH_Z.js} +89 -88
  143. package/dist/esm/ssh_certificate-CmOVFH_Z.js.map +1 -0
  144. package/dist/esm/{x509_certificate-C1VvfHQ5.js → x509_certificate-C2EVTspY.js} +4 -4
  145. package/dist/{esm-es5/x509_certificate-C1VvfHQ5.js.map → esm/x509_certificate-C2EVTspY.js.map} +1 -1
  146. package/dist/esm/{x509_crl-rfnWQkGD.js → x509_crl-Bdnys_YT.js} +5 -5
  147. package/dist/{esm-es5/x509_crl-rfnWQkGD.js.map → esm/x509_crl-Bdnys_YT.js.map} +1 -1
  148. package/dist/esm-es5/{actions-BOY2Tl0T.js → actions-CabuIstu.js} +3 -3
  149. package/dist/esm-es5/{actions-BOY2Tl0T.js.map → actions-CabuIstu.js.map} +1 -1
  150. package/dist/esm-es5/{arrow_top-DL0RWe4n.js → arrow_top-CWdnzNJA.js} +2 -2
  151. package/dist/{esm/arrow_top-DL0RWe4n.js.map → esm-es5/arrow_top-CWdnzNJA.js.map} +1 -1
  152. package/dist/esm-es5/{button-Bbh7MwG6.js → button-DoyFdU2L.js} +2 -2
  153. package/dist/{cjs/button-C8EWG_-r.js.map → esm-es5/button-DoyFdU2L.js.map} +1 -1
  154. package/dist/esm-es5/{cross-G84H_-QL.js → cross-B4NPVkar.js} +2 -2
  155. package/dist/{esm/cross-G84H_-QL.js.map → esm-es5/cross-B4NPVkar.js.map} +1 -1
  156. package/dist/esm-es5/{download-ykcxSgxU.js → download-C7Viw-3R.js} +2 -2
  157. package/dist/esm-es5/{download-ykcxSgxU.js.map → download-C7Viw-3R.js.map} +1 -1
  158. package/dist/esm-es5/{extension-B3br1_Py.js → extension-xW03sQxn.js} +2 -2
  159. package/dist/esm-es5/extension-xW03sQxn.js.map +1 -0
  160. package/dist/esm-es5/index-B0tLzdJT.js +6 -0
  161. package/dist/esm-es5/index-B0tLzdJT.js.map +1 -0
  162. package/dist/esm-es5/index.js +1 -1
  163. package/dist/esm-es5/{link-CGURvKy1.js → link-BDCg-T_l.js} +3 -3
  164. package/dist/esm-es5/{link-CGURvKy1.js.map → link-BDCg-T_l.js.map} +1 -1
  165. package/dist/esm-es5/loader.js +2 -2
  166. package/dist/esm-es5/{miscellaneous-phHcBJWR.js → miscellaneous-DxE6a1mr.js} +4 -4
  167. package/dist/esm-es5/miscellaneous-DxE6a1mr.js.map +1 -0
  168. package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -1
  169. package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js +3 -3
  170. package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -1
  171. package/dist/esm-es5/peculiar-button-menu_3.entry.js +1 -1
  172. package/dist/esm-es5/peculiar-button-menu_3.entry.js.map +1 -1
  173. package/dist/esm-es5/peculiar-certificate-decoder.entry.js +2 -2
  174. package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
  175. package/dist/esm-es5/peculiar-certificate-viewer.entry.js +2 -2
  176. package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -1
  177. package/dist/esm-es5/peculiar-certificates-viewer.entry.js +2 -2
  178. package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -1
  179. package/dist/esm-es5/peculiar-text-hider.entry.js +1 -1
  180. package/dist/esm-es5/peculiar.js +2 -2
  181. package/dist/esm-es5/peculiar.js.map +1 -1
  182. package/dist/esm-es5/{pkcs10_certificate_request-HIoLPXGQ.js → pkcs10_certificate_request-Crr9FABo.js} +3 -3
  183. package/dist/esm-es5/{pkcs10_certificate_request-HIoLPXGQ.js.map → pkcs10_certificate_request-Crr9FABo.js.map} +1 -1
  184. package/dist/esm-es5/{ssh_certificate-rmToyzuK.js → ssh_certificate-CmOVFH_Z.js} +5 -5
  185. package/dist/esm-es5/ssh_certificate-CmOVFH_Z.js.map +1 -0
  186. package/dist/esm-es5/{x509_certificate-C1VvfHQ5.js → x509_certificate-C2EVTspY.js} +3 -3
  187. package/dist/{esm/x509_certificate-C1VvfHQ5.js.map → esm-es5/x509_certificate-C2EVTspY.js.map} +1 -1
  188. package/dist/esm-es5/{x509_crl-rfnWQkGD.js → x509_crl-Bdnys_YT.js} +4 -4
  189. package/dist/{esm/x509_crl-rfnWQkGD.js.map → esm-es5/x509_crl-Bdnys_YT.js.map} +1 -1
  190. package/dist/peculiar/index.esm.js +1 -1
  191. package/dist/peculiar/p--UIbyTPo.system.js.map +1 -0
  192. package/dist/peculiar/{p-872f7312.system.entry.js → p-16bd5fac.system.entry.js} +18 -18
  193. package/dist/peculiar/p-16bd5fac.system.entry.js.map +1 -0
  194. package/dist/peculiar/{p-04422929.entry.js → p-26e1e392.entry.js} +3 -3
  195. package/dist/peculiar/p-26e1e392.entry.js.map +1 -0
  196. package/dist/peculiar/{p-154dd0da.entry.js → p-2c5ec624.entry.js} +2 -2
  197. package/dist/peculiar/p-2c5ec624.entry.js.map +1 -0
  198. package/dist/peculiar/{p-27ae6a3a.entry.js → p-4111bd62.entry.js} +2 -2
  199. package/dist/peculiar/p-4111bd62.entry.js.map +1 -0
  200. package/dist/peculiar/{p-3685975d.system.entry.js → p-4b510453.system.entry.js} +3 -3
  201. package/dist/peculiar/p-4b510453.system.entry.js.map +1 -0
  202. package/dist/peculiar/{p-6f0f2749.system.entry.js → p-4fc81fd0.system.entry.js} +3 -3
  203. package/dist/peculiar/p-4fc81fd0.system.entry.js.map +1 -0
  204. package/dist/peculiar/p-51832de2.entry.js +152 -0
  205. package/dist/peculiar/p-51832de2.entry.js.map +1 -0
  206. package/dist/peculiar/{p-B4PdAFCr.system.js → p-AHlPpL1z.system.js} +2 -2
  207. package/dist/peculiar/{p-B4PdAFCr.system.js.map → p-AHlPpL1z.system.js.map} +1 -1
  208. package/dist/peculiar/p-B0tLzdJT.js +6 -0
  209. package/dist/peculiar/p-B0tLzdJT.js.map +1 -0
  210. package/dist/peculiar/{p-B1eGYq5U.js → p-B4vvBwd6.js} +3 -3
  211. package/dist/peculiar/{p-B1eGYq5U.js.map → p-B4vvBwd6.js.map} +1 -1
  212. package/dist/peculiar/{p-CYFfXlCT.js → p-B7cL9SBA.js} +4 -4
  213. package/dist/peculiar/{p-CYFfXlCT.js.map → p-B7cL9SBA.js.map} +1 -1
  214. package/dist/peculiar/{p-DanjeXNk.js → p-BAAnYCav.js} +3 -3
  215. package/dist/peculiar/{p-DanjeXNk.js.map → p-BAAnYCav.js.map} +1 -1
  216. package/dist/peculiar/{p-CHnDlTqM.js → p-BLjDwIXV.js} +3 -3
  217. package/dist/peculiar/{p-CHnDlTqM.js.map → p-BLjDwIXV.js.map} +1 -1
  218. package/dist/peculiar/{p-CutTi-2B.js → p-BNRN5kAu.js} +2 -2
  219. package/dist/peculiar/{p-CutTi-2B.js.map → p-BNRN5kAu.js.map} +1 -1
  220. package/dist/peculiar/{p-Bi5mjeeg.system.js → p-BX5m4Pk2.system.js} +2 -2
  221. package/dist/peculiar/{p-Bi5mjeeg.system.js.map → p-BX5m4Pk2.system.js.map} +1 -1
  222. package/dist/peculiar/{p-N3w4Sc5c.system.js.map → p-BdGJr6Nw.system.js.map} +1 -1
  223. package/dist/peculiar/{p-CTksa0ml.system.js → p-Bfl7RVFY.system.js} +4 -4
  224. package/dist/peculiar/{p-CTksa0ml.system.js.map → p-Bfl7RVFY.system.js.map} +1 -1
  225. package/dist/peculiar/{p-B8_0p5ke.js → p-BjREwt05.js} +43 -43
  226. package/dist/peculiar/p-BjREwt05.js.map +1 -0
  227. package/dist/peculiar/{p-BGASC3UX.system.js → p-BjfN0sUP.system.js} +3 -3
  228. package/dist/peculiar/p-BjfN0sUP.system.js.map +1 -0
  229. package/dist/peculiar/{p-DMZr5ztF.js → p-BrjKJZAs.js} +2 -2
  230. package/dist/peculiar/{p-DMZr5ztF.js.map → p-BrjKJZAs.js.map} +1 -1
  231. package/dist/peculiar/{p-CkePJXWQ.js → p-BxiR02Uf.js} +4 -4
  232. package/dist/peculiar/{p-CkePJXWQ.js.map → p-BxiR02Uf.js.map} +1 -1
  233. package/dist/peculiar/{p-ZT6tVIen.js → p-C-zA8CWJ.js} +2 -2
  234. package/dist/peculiar/{p-ZT6tVIen.js.map → p-C-zA8CWJ.js.map} +1 -1
  235. package/dist/peculiar/{p-Bknpl7EO.system.js → p-C9U3cZjb.system.js} +3 -3
  236. package/dist/peculiar/{p-Bknpl7EO.system.js.map → p-C9U3cZjb.system.js.map} +1 -1
  237. package/dist/peculiar/{p-DorRvFf7.system.js → p-CCPSoWEH.system.js} +43 -43
  238. package/dist/peculiar/p-CCPSoWEH.system.js.map +1 -0
  239. package/dist/peculiar/{p-ZxTK29QB.system.js → p-CGipIfjs.system.js} +5 -5
  240. package/dist/peculiar/{p-ZxTK29QB.system.js.map → p-CGipIfjs.system.js.map} +1 -1
  241. package/dist/peculiar/{p-kq9wAWxW.system.js → p-CLcRtCZ9.system.js} +5 -5
  242. package/dist/peculiar/p-CLcRtCZ9.system.js.map +1 -0
  243. package/dist/peculiar/{p-CdS84qJs.system.js → p-CNRpL2vk.system.js} +2 -2
  244. package/dist/peculiar/{p-CdS84qJs.system.js.map → p-CNRpL2vk.system.js.map} +1 -1
  245. package/dist/peculiar/{p-JyD6URnB.js → p-CVqAvraM.js} +2 -2
  246. package/dist/peculiar/{p-JyD6URnB.js.map → p-CVqAvraM.js.map} +1 -1
  247. package/dist/peculiar/{p-D8xU284r.system.js → p-CWwlqwKM.system.js} +2 -2
  248. package/dist/peculiar/{p-D8xU284r.system.js.map → p-CWwlqwKM.system.js.map} +1 -1
  249. package/dist/peculiar/p-CbJUBy06.system.js +5 -0
  250. package/dist/peculiar/p-CbJUBy06.system.js.map +1 -0
  251. package/dist/peculiar/p-CfHXB_pJ.system.js.map +1 -0
  252. package/dist/peculiar/p-Ckf8xErP.system.js +12 -0
  253. package/dist/peculiar/p-Ckf8xErP.system.js.map +1 -0
  254. package/dist/peculiar/{p-rmToyzuK.js → p-CmOVFH_Z.js} +4 -4
  255. package/dist/peculiar/p-CmOVFH_Z.js.map +1 -0
  256. package/dist/peculiar/{p-CbJQZ9Hh.system.js.map → p-Cp79UjaU.system.js.map} +1 -1
  257. package/dist/peculiar/p-D4MqnJ9p.system.js.map +1 -0
  258. package/dist/peculiar/p-D5BlV4_w.system.js +6 -0
  259. package/dist/peculiar/p-D5BlV4_w.system.js.map +1 -0
  260. package/dist/peculiar/{p-eziSY5IJ.system.js.map → p-DOSHmuRc.system.js.map} +1 -1
  261. package/dist/peculiar/p-DXA1451q.js +12 -0
  262. package/dist/peculiar/p-DXA1451q.js.map +1 -0
  263. package/dist/peculiar/{p-DkshB-5z.system.js → p-DberG072.system.js} +5 -5
  264. package/dist/peculiar/{p-DkshB-5z.system.js.map → p-DberG072.system.js.map} +1 -1
  265. package/dist/peculiar/{p-de857304.system.entry.js → p-ae88bf01.system.entry.js} +2 -2
  266. package/dist/peculiar/p-ae88bf01.system.entry.js.map +1 -0
  267. package/dist/peculiar/{p-a4454e2d.system.entry.js → p-c4bbd44c.system.entry.js} +3 -3
  268. package/dist/peculiar/p-c4bbd44c.system.entry.js.map +1 -0
  269. package/dist/peculiar/{p-9d9f24bd.entry.js → p-d212830c.entry.js} +2 -2
  270. package/dist/peculiar/p-d212830c.entry.js.map +1 -0
  271. package/dist/peculiar/{p-019339d6.entry.js → p-e40e47be.entry.js} +2 -2
  272. package/dist/peculiar/p-e40e47be.entry.js.map +1 -0
  273. package/dist/peculiar/{p-607d08e8.system.entry.js → p-ef52478f.system.entry.js} +2 -2
  274. package/dist/peculiar/p-ef52478f.system.entry.js.map +1 -0
  275. package/dist/peculiar/p-qOxEa6Ap.system.js.map +1 -0
  276. package/dist/peculiar/{p-NnCM1ETy.system.js → p-vusQjz44.system.js} +2 -2
  277. package/dist/peculiar/{p-NnCM1ETy.system.js.map → p-vusQjz44.system.js.map} +1 -1
  278. package/dist/peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.esm.js.map +1 -1
  279. package/dist/peculiar/peculiar-certificate-decoder.entry.esm.js.map +1 -1
  280. package/dist/peculiar/peculiar-certificate-viewer.entry.esm.js.map +1 -1
  281. package/dist/peculiar/peculiar-certificates-viewer.entry.esm.js.map +1 -1
  282. package/dist/peculiar/peculiar.esm.js +1 -1
  283. package/dist/peculiar/peculiar.esm.js.map +1 -1
  284. package/dist/peculiar/peculiar.js +1 -1
  285. package/dist/types/crypto/ssh_certificate.d.ts +1 -1
  286. package/dist/types/interface.d.ts +86 -86
  287. package/dist/types/stencil-public-runtime.d.ts +49 -2
  288. package/hydrate/index.d.ts +2 -0
  289. package/hydrate/index.js +368 -496
  290. package/hydrate/index.mjs +368 -496
  291. package/package.json +4 -4
  292. package/dist/cjs/cross-3DqhA0G_.js +0 -52
  293. package/dist/cjs/download-DQP0KR4o.js +0 -24
  294. package/dist/cjs/extension-CjXYQXbF.js.map +0 -1
  295. package/dist/cjs/index-uHmGhObe.js.map +0 -1
  296. package/dist/cjs/miscellaneous-7gtHz795.js.map +0 -1
  297. package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js.map +0 -1
  298. package/dist/cjs/peculiar-button-menu_3.cjs.entry.js.map +0 -1
  299. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +0 -1
  300. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +0 -1
  301. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +0 -1
  302. package/dist/cjs/peculiar-text-hider.cjs.entry.js.map +0 -1
  303. package/dist/cjs/ssh_certificate-DnXj2sM0.js.map +0 -1
  304. package/dist/esm/cross-G84H_-QL.js +0 -48
  305. package/dist/esm/download-ykcxSgxU.js +0 -22
  306. package/dist/esm/extension-B3br1_Py.js.map +0 -1
  307. package/dist/esm/index-CwgZaF40.js.map +0 -1
  308. package/dist/esm/miscellaneous-phHcBJWR.js.map +0 -1
  309. package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js.map +0 -1
  310. package/dist/esm/peculiar-button-menu_3.entry.js.map +0 -1
  311. package/dist/esm/ssh_certificate-rmToyzuK.js.map +0 -1
  312. package/dist/esm-es5/extension-B3br1_Py.js.map +0 -1
  313. package/dist/esm-es5/index-CwgZaF40.js +0 -6
  314. package/dist/esm-es5/index-CwgZaF40.js.map +0 -1
  315. package/dist/esm-es5/miscellaneous-phHcBJWR.js.map +0 -1
  316. package/dist/esm-es5/ssh_certificate-rmToyzuK.js.map +0 -1
  317. package/dist/peculiar/p-019339d6.entry.js.map +0 -1
  318. package/dist/peculiar/p-04422929.entry.js.map +0 -1
  319. package/dist/peculiar/p-154dd0da.entry.js.map +0 -1
  320. package/dist/peculiar/p-27ae6a3a.entry.js.map +0 -1
  321. package/dist/peculiar/p-3685975d.system.entry.js.map +0 -1
  322. package/dist/peculiar/p-607d08e8.system.entry.js.map +0 -1
  323. package/dist/peculiar/p-6f0f2749.system.entry.js.map +0 -1
  324. package/dist/peculiar/p-7385d0bb.entry.js +0 -152
  325. package/dist/peculiar/p-7385d0bb.entry.js.map +0 -1
  326. package/dist/peculiar/p-872f7312.system.entry.js.map +0 -1
  327. package/dist/peculiar/p-9d9f24bd.entry.js.map +0 -1
  328. package/dist/peculiar/p-B2GW-g6v.system.js +0 -5
  329. package/dist/peculiar/p-B2GW-g6v.system.js.map +0 -1
  330. package/dist/peculiar/p-B8_0p5ke.js.map +0 -1
  331. package/dist/peculiar/p-BGASC3UX.system.js.map +0 -1
  332. package/dist/peculiar/p-BdfvItQB.system.js.map +0 -1
  333. package/dist/peculiar/p-BtqN4pgo.js +0 -12
  334. package/dist/peculiar/p-BtqN4pgo.js.map +0 -1
  335. package/dist/peculiar/p-CuX3t1Hg.system.js.map +0 -1
  336. package/dist/peculiar/p-Cv-b9S6H.system.js.map +0 -1
  337. package/dist/peculiar/p-CwgZaF40.js +0 -6
  338. package/dist/peculiar/p-CwgZaF40.js.map +0 -1
  339. package/dist/peculiar/p-D0w6miI2.system.js +0 -12
  340. package/dist/peculiar/p-D0w6miI2.system.js.map +0 -1
  341. package/dist/peculiar/p-DKl0YViA.system.js +0 -6
  342. package/dist/peculiar/p-DKl0YViA.system.js.map +0 -1
  343. package/dist/peculiar/p-DOFJd-ye.system.js.map +0 -1
  344. package/dist/peculiar/p-DorRvFf7.system.js.map +0 -1
  345. package/dist/peculiar/p-a4454e2d.system.entry.js.map +0 -1
  346. package/dist/peculiar/p-de857304.system.entry.js.map +0 -1
  347. package/dist/peculiar/p-kq9wAWxW.system.js.map +0 -1
  348. package/dist/peculiar/p-rmToyzuK.js.map +0 -1
@@ -1,4 +1,4 @@
1
- var __extends=this&&this.__extends||function(){var t=function(e,i){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))t[i]=e[i]};return t(e,i)};return function(e,i){if(typeof i!=="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");t(e,i);function r(){this.constructor=e}e.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[n]=e[n]}return t};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(t,e,i,r){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function o(t){try{u(r.next(t))}catch(t){a(t)}}function s(t){try{u(r["throw"](t))}catch(t){a(t)}}function u(t){t.done?i(t.value):n(t.value).then(o,s)}u((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return u([t,e])}}function u(s){if(r)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(i=0)),i)try{if(r=1,n&&(a=s[0]&2?n["return"]:s[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;if(n=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;n=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t];n=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __rest=this&&this.__rest||function(t,e){var i={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0)i[r]=t[r];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++){if(e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n]))i[r[n]]=t[r[n]]}return i};var __spreadArray=this&&this.__spreadArray||function(t,e,i){if(i||arguments.length===2)for(var r=0,n=e.length,a;r<n;r++){if(a||!(r in e)){if(!a)a=Array.prototype.slice.call(e,0,r);a[r]=e[r]}}return t.concat(a||Array.prototype.slice.call(e))};
1
+ var __extends=this&&this.__extends||function(){var t=function(e,i){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))t[i]=e[i]};return t(e,i)};return function(e,i){if(typeof i!=="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");t(e,i);function r(){this.constructor=e}e.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[n]=e[n]}return t};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(t,e,i,r){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function o(t){try{u(r.next(t))}catch(t){a(t)}}function s(t){try{u(r["throw"](t))}catch(t){a(t)}}function u(t){t.done?i(t.value):n(t.value).then(o,s)}u((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=s(0),o["throw"]=s(1),o["return"]=s(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return u([t,e])}}function u(s){if(r)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(i=0)),i)try{if(r=1,n&&(a=s[0]&2?n["return"]:s[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;if(n=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;n=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t];n=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __rest=this&&this.__rest||function(t,e){var i={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0)i[r]=t[r];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++){if(e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n]))i[r[n]]=t[r[n]]}return i};var __spreadArray=this&&this.__spreadArray||function(t,e,i){if(i||arguments.length===2)for(var r=0,n=e.length,a;r<n;r++){if(a||!(r in e)){if(!a)a=Array.prototype.slice.call(e,0,r);a[r]=e[r]}}return t.concat(a||Array.prototype.slice.call(e))};
2
2
  /*!
3
3
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
4
4
  */System.register([],(function(t){"use strict";return{execute:function(){var e=this;var i;t({bs:bi,d:r});
@@ -75,7 +75,7 @@ var __extends=this&&this.__extends||function(){var t=function(e,i){t=Object.setP
75
75
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
76
76
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
77
77
  *
78
- */function S(){if(typeof BigInt==="undefined"){throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}}function A(t){var e=0;var i=0;for(var r=0;r<t.length;r++){var n=t[r];e+=n.byteLength}var a=new Uint8Array(e);for(var r=0;r<t.length;r++){var n=t[r];a.set(new Uint8Array(n),i);i+=n.byteLength}return a.buffer}function C(t,e,i,r){if(!(e instanceof Uint8Array)){t.error="Wrong parameter: inputBuffer must be 'Uint8Array'";return false}if(!e.byteLength){t.error="Wrong parameter: inputBuffer has zero length";return false}if(i<0){t.error="Wrong parameter: inputOffset less than zero";return false}if(r<0){t.error="Wrong parameter: inputLength less than zero";return false}if(e.byteLength-i-r<0){t.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return false}return true}var m=function(){function t(){this.items=[]}t.prototype.write=function(t){this.items.push(t)};t.prototype.final=function(){return A(this.items)};return t}();var g=[new Uint8Array([1])];var w="0123456789";var _="name";var b="valueHexView";var E="isHexOnly";var P="idBlock";var D="tagClass";var I="tagNumber";var B="isConstructed";var x="fromBER";var T="toBER";var O="local";var k="";var M=new ArrayBuffer(0);var R=new Uint8Array(0);var N="EndOfContent";var K="OCTET STRING";var j="BIT STRING";function H(t){var e;return e=function(t){__extends(e,t);function e(){var e=[];for(var i=0;i<arguments.length;i++){e[i]=arguments[i]}var r;var n=t.apply(this,e)||this;var a=e[0]||{};n.isHexOnly=(r=a.isHexOnly)!==null&&r!==void 0?r:false;n.valueHexView=a.valueHex?u.BufferSourceConverter.toUint8Array(a.valueHex):R;return n}Object.defineProperty(e.prototype,"valueHex",{get:function(){return this.valueHexView.slice().buffer},set:function(t){this.valueHexView=new Uint8Array(t)},enumerable:false,configurable:true});e.prototype.fromBER=function(t,e,i){var r=t instanceof ArrayBuffer?new Uint8Array(t):t;if(!C(this,r,e,i)){return-1}var n=e+i;this.valueHexView=r.subarray(e,n);if(!this.valueHexView.length){this.warnings.push("Zero buffer length");return e}this.blockLength=i;return n};e.prototype.toBER=function(t){if(t===void 0){t=false}if(!this.isHexOnly){this.error="Flag 'isHexOnly' is not set, abort";return M}if(t){return new ArrayBuffer(this.valueHexView.byteLength)}return this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{isHexOnly:this.isHexOnly,valueHex:u.Convert.ToHex(this.valueHexView)})};return e}(t),e.NAME="hexBlock",e}var U=function(){function t(t){var e=t===void 0?{}:t,i=e.blockLength,r=i===void 0?0:i,n=e.error,a=n===void 0?k:n,o=e.warnings,s=o===void 0?[]:o,c=e.valueBeforeDecode,f=c===void 0?R:c;this.blockLength=r;this.error=a;this.warnings=s;this.valueBeforeDecodeView=u.BufferSourceConverter.toUint8Array(f)}t.blockName=function(){return this.NAME};Object.defineProperty(t.prototype,"valueBeforeDecode",{get:function(){return this.valueBeforeDecodeView.slice().buffer},set:function(t){this.valueBeforeDecodeView=new Uint8Array(t)},enumerable:false,configurable:true});t.prototype.toJSON=function(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:u.Convert.ToHex(this.valueBeforeDecodeView)}};return t}();U.NAME="baseBlock";var F=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.fromBER=function(t,e,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")};e.prototype.toBER=function(t,e){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")};return e}(U);F.NAME="valueBlock";var L=function(t){__extends(e,t);function e(e){var i=e===void 0?{}:e,r=i.idBlock,n=r===void 0?{}:r;var a,o,s,c;var f=t.call(this)||this;if(n){f.isHexOnly=(a=n.isHexOnly)!==null&&a!==void 0?a:false;f.valueHexView=n.valueHex?u.BufferSourceConverter.toUint8Array(n.valueHex):R;f.tagClass=(o=n.tagClass)!==null&&o!==void 0?o:-1;f.tagNumber=(s=n.tagNumber)!==null&&s!==void 0?s:-1;f.isConstructed=(c=n.isConstructed)!==null&&c!==void 0?c:false}else{f.tagClass=-1;f.tagNumber=-1;f.isConstructed=false}return f}e.prototype.toBER=function(t){if(t===void 0){t=false}var e=0;switch(this.tagClass){case 1:e|=0;break;case 2:e|=64;break;case 3:e|=128;break;case 4:e|=192;break;default:this.error="Unknown tag class";return M}if(this.isConstructed)e|=32;if(this.tagNumber<31&&!this.isHexOnly){var i=new Uint8Array(1);if(!t){var r=this.tagNumber;r&=31;e|=r;i[0]=e}return i.buffer}if(!this.isHexOnly){var n=v(this.tagNumber,7);var a=new Uint8Array(n);var o=n.byteLength;var s=new Uint8Array(o+1);s[0]=e|31;if(!t){for(var u=0;u<o-1;u++)s[u+1]=a[u]|128;s[o]=a[o-1]}return s.buffer}var c=new Uint8Array(this.valueHexView.byteLength+1);c[0]=e|31;if(!t){var f=this.valueHexView;for(var u=0;u<f.length-1;u++)c[u+1]=f[u]|128;c[this.valueHexView.byteLength]=f[f.length-1]}return c.buffer};e.prototype.fromBER=function(t,e,i){var r=u.BufferSourceConverter.toUint8Array(t);if(!C(this,r,e,i)){return-1}var n=r.subarray(e,e+i);if(n.length===0){this.error="Zero buffer length";return-1}var a=n[0]&192;switch(a){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:this.error="Unknown tag class";return-1}this.isConstructed=(n[0]&32)===32;this.isHexOnly=false;var o=n[0]&31;if(o!==31){this.tagNumber=o;this.blockLength=1}else{var s=1;var c=this.valueHexView=new Uint8Array(255);var v=255;while(n[s]&128){c[s-1]=n[s]&127;s++;if(s>=n.length){this.error="End of input reached before message was fully decoded";return-1}if(s===v){v+=255;var h=new Uint8Array(v);for(var d=0;d<c.length;d++)h[d]=c[d];c=this.valueHexView=new Uint8Array(v)}}this.blockLength=s+1;c[s-1]=n[s]&127;var l=new Uint8Array(s);for(var d=0;d<s;d++)l[d]=c[d];c=this.valueHexView=new Uint8Array(s);c.set(l);if(this.blockLength<=9)this.tagNumber=f(c,7);else{this.isHexOnly=true;this.warnings.push("Tag too long, represented as hex-coded")}}if(this.tagClass===1&&this.isConstructed){switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:this.error="Constructed encoding used for primitive type";return-1}}return e+this.blockLength};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed})};return e}(H(U));L.NAME="identificationBlock";var V=function(t){__extends(e,t);function e(e){var i=e===void 0?{}:e,r=i.lenBlock,n=r===void 0?{}:r;var a,o,s;var u=t.call(this)||this;u.isIndefiniteForm=(a=n.isIndefiniteForm)!==null&&a!==void 0?a:false;u.longFormUsed=(o=n.longFormUsed)!==null&&o!==void 0?o:false;u.length=(s=n.length)!==null&&s!==void 0?s:0;return u}e.prototype.fromBER=function(t,e,i){var r=u.BufferSourceConverter.toUint8Array(t);if(!C(this,r,e,i)){return-1}var n=r.subarray(e,e+i);if(n.length===0){this.error="Zero buffer length";return-1}if(n[0]===255){this.error="Length block 0xFF is reserved by standard";return-1}this.isIndefiniteForm=n[0]===128;if(this.isIndefiniteForm){this.blockLength=1;return e+this.blockLength}this.longFormUsed=!!(n[0]&128);if(this.longFormUsed===false){this.length=n[0];this.blockLength=1;return e+this.blockLength}var a=n[0]&127;if(a>8){this.error="Too big integer";return-1}if(a+1>n.length){this.error="End of input reached before message was fully decoded";return-1}var o=e+1;var s=r.subarray(o,o+a);if(s[a-1]===0)this.warnings.push("Needlessly long encoded length");this.length=f(s,8);if(this.longFormUsed&&this.length<=127)this.warnings.push("Unnecessary usage of long length form");this.blockLength=a+1;return e+this.blockLength};e.prototype.toBER=function(t){if(t===void 0){t=false}var e;var i;if(this.length>127)this.longFormUsed=true;if(this.isIndefiniteForm){e=new ArrayBuffer(1);if(t===false){i=new Uint8Array(e);i[0]=128}return e}if(this.longFormUsed){var r=v(this.length,8);if(r.byteLength>127){this.error="Too big length";return M}e=new ArrayBuffer(r.byteLength+1);if(t)return e;var n=new Uint8Array(r);i=new Uint8Array(e);i[0]=r.byteLength|128;for(var a=0;a<r.byteLength;a++)i[a+1]=n[a];return e}e=new ArrayBuffer(1);if(t===false){i=new Uint8Array(e);i[0]=this.length}return e};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length})};return e}(U);V.NAME="lengthBlock";var G={};var W=function(t){__extends(e,t);function e(e,i){if(e===void 0){e={}}var r=this;var n=e.name,a=n===void 0?k:n,o=e.optional,s=o===void 0?false:o,u=e.primitiveSchema,c=__rest(e,["name","optional","primitiveSchema"]);r=t.call(this,c)||this;r.name=a;r.optional=s;if(u){r.primitiveSchema=u}r.idBlock=new L(c);r.lenBlock=new V(c);r.valueBlock=i?new i(c):new F(c);return r}e.prototype.fromBER=function(t,e,i){var r=this.valueBlock.fromBER(t,e,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);if(r===-1){this.error=this.valueBlock.error;return r}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return r};e.prototype.toBER=function(t,e){var i=e||new m;if(!e){Q(this)}var r=this.idBlock.toBER(t);i.write(r);if(this.lenBlock.isIndefiniteForm){i.write(new Uint8Array([128]).buffer);this.valueBlock.toBER(t,i);i.write(new ArrayBuffer(2))}else{var n=this.valueBlock.toBER(t);this.lenBlock.length=n.byteLength;var a=this.lenBlock.toBER(t);i.write(a);i.write(n)}if(!e){return i.final()}return M};e.prototype.toJSON=function(){var e=__assign(__assign({},t.prototype.toJSON.call(this)),{idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional});if(this.primitiveSchema)e.primitiveSchema=this.primitiveSchema.toJSON();return e};e.prototype.toString=function(t){if(t===void 0){t="ascii"}if(t==="ascii"){return this.onAsciiEncoding()}return u.Convert.ToHex(this.toBER())};e.prototype.onAsciiEncoding=function(){var t=this.constructor.NAME;var e=u.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return"".concat(t," : ").concat(e)};e.prototype.isEqual=function(t){if(this===t){return true}if(!(t instanceof this.constructor)){return false}var e=this.toBER();var i=t.toBER();return p(e,i)};return e}(U);W.NAME="BaseBlock";function Q(t){var e;if(t instanceof G.Constructed){for(var i=0,r=t.valueBlock.value;i<r.length;i++){var n=r[i];if(Q(n)){t.lenBlock.isIndefiniteForm=true}}}return!!((e=t.lenBlock)===null||e===void 0?void 0:e.isIndefiniteForm)}var q=function(t){__extends(e,t);function e(e,i){if(e===void 0){e={}}var r=this;var n=e.value,a=n===void 0?k:n,o=__rest(e,["value"]);r=t.call(this,o,i)||this;if(a){r.fromString(a)}return r}e.prototype.getValue=function(){return this.valueBlock.value};e.prototype.setValue=function(t){this.valueBlock.value=t};e.prototype.fromBER=function(t,e,i){var r=this.valueBlock.fromBER(t,e,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);if(r===-1){this.error=this.valueBlock.error;return r}this.fromBuffer(this.valueBlock.valueHexView);if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return r};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : '").concat(this.valueBlock.value,"'")};return e}(W);q.NAME="BaseStringBlock";var z=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.isHexOnly,n=r===void 0?true:r,a=__rest(e,["isHexOnly"]);i=t.call(this,a)||this;i.isHexOnly=n;return i}return e}(H(F));z.NAME="PrimitiveValueBlock";var Y;var Z=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,z)||this;i.idBlock.isConstructed=false;return i}return e}(W);Y=Z;(function(){G.Primitive=Y})();Z.NAME="PRIMITIVE";function $(t,e){if(t instanceof e){return t}var i=new e;i.idBlock=t.idBlock;i.lenBlock=t.lenBlock;i.warnings=t.warnings;i.valueBeforeDecodeView=t.valueBeforeDecodeView;return i}function X(t,e,i){if(e===void 0){e=0}if(i===void 0){i=t.length}var r=e;var n=new W({},F);var a=new U;if(!C(a,t,e,i)){n.error=a.error;return{offset:-1,result:n}}var o=t.subarray(e,e+i);if(!o.length){n.error="Zero buffer length";return{offset:-1,result:n}}var s=n.idBlock.fromBER(t,e,i);if(n.idBlock.warnings.length){n.warnings.concat(n.idBlock.warnings)}if(s===-1){n.error=n.idBlock.error;return{offset:-1,result:n}}e=s;i-=n.idBlock.blockLength;s=n.lenBlock.fromBER(t,e,i);if(n.lenBlock.warnings.length){n.warnings.concat(n.lenBlock.warnings)}if(s===-1){n.error=n.lenBlock.error;return{offset:-1,result:n}}e=s;i-=n.lenBlock.blockLength;if(!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm){n.error="Indefinite length form used for primitive encoding form";return{offset:-1,result:n}}var u=W;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===false){n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard";return{offset:-1,result:n}}switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0){n.error="Type [UNIVERSAL 0] is reserved";return{offset:-1,result:n}}u=G.EndOfContent;break;case 1:u=G.Boolean;break;case 2:u=G.Integer;break;case 3:u=G.BitString;break;case 4:u=G.OctetString;break;case 5:u=G.Null;break;case 6:u=G.ObjectIdentifier;break;case 10:u=G.Enumerated;break;case 12:u=G.Utf8String;break;case 13:u=G.RelativeObjectIdentifier;break;case 14:u=G.TIME;break;case 15:n.error="[UNIVERSAL 15] is reserved by ASN.1 standard";return{offset:-1,result:n};case 16:u=G.Sequence;break;case 17:u=G.Set;break;case 18:u=G.NumericString;break;case 19:u=G.PrintableString;break;case 20:u=G.TeletexString;break;case 21:u=G.VideotexString;break;case 22:u=G.IA5String;break;case 23:u=G.UTCTime;break;case 24:u=G.GeneralizedTime;break;case 25:u=G.GraphicString;break;case 26:u=G.VisibleString;break;case 27:u=G.GeneralString;break;case 28:u=G.UniversalString;break;case 29:u=G.CharacterString;break;case 30:u=G.BmpString;break;case 31:u=G.DATE;break;case 32:u=G.TimeOfDay;break;case 33:u=G.DateTime;break;case 34:u=G.Duration;break;default:{var c=n.idBlock.isConstructed?new G.Constructed:new G.Primitive;c.idBlock=n.idBlock;c.lenBlock=n.lenBlock;c.warnings=n.warnings;n=c}}break;case 2:case 3:case 4:default:{u=n.idBlock.isConstructed?G.Constructed:G.Primitive}}n=$(n,u);s=n.fromBER(t,e,n.lenBlock.isIndefiniteForm?i:n.lenBlock.length);n.valueBeforeDecodeView=t.subarray(r,r+n.blockLength);return{offset:s,result:n}}function J(t){if(!t.byteLength){var e=new W({},F);e.error="Input buffer has zero length";return{offset:-1,result:e}}return X(u.BufferSourceConverter.toUint8Array(t).slice(),0,t.byteLength)}function tt(t,e){if(t){return 1}return e}var et=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=r===void 0?[]:r,a=e.isIndefiniteForm,o=a===void 0?false:a,s=__rest(e,["value","isIndefiniteForm"]);i=t.call(this,s)||this;i.value=n;i.isIndefiniteForm=o;return i}e.prototype.fromBER=function(t,e,i){var r=u.BufferSourceConverter.toUint8Array(t);if(!C(this,r,e,i)){return-1}this.valueBeforeDecodeView=r.subarray(e,e+i);if(this.valueBeforeDecodeView.length===0){this.warnings.push("Zero buffer length");return e}var n=e;while(tt(this.isIndefiniteForm,i)>0){var a=X(r,n,i);if(a.offset===-1){this.error=a.result.error;this.warnings.concat(a.result.warnings);return-1}n=a.offset;this.blockLength+=a.result.blockLength;i-=a.result.blockLength;this.value.push(a.result);if(this.isIndefiniteForm&&a.result.constructor.NAME===N){break}}if(this.isIndefiniteForm){if(this.value[this.value.length-1].constructor.NAME===N){this.value.pop()}else{this.warnings.push("No EndOfContent block encoded")}}return n};e.prototype.toBER=function(t,e){var i=e||new m;for(var r=0;r<this.value.length;r++){this.value[r].toBER(t,i)}if(!e){return i.final()}return M};e.prototype.toJSON=function(){var e=__assign(__assign({},t.prototype.toJSON.call(this)),{isIndefiniteForm:this.isIndefiniteForm,value:[]});for(var i=0,r=this.value;i<r.length;i++){var n=r[i];e.value.push(n.toJSON())}return e};return e}(F);et.NAME="ConstructedValueBlock";var it;var rt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,et)||this;i.idBlock.isConstructed=true;return i}e.prototype.fromBER=function(t,e,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;var r=this.valueBlock.fromBER(t,e,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);if(r===-1){this.error=this.valueBlock.error;return r}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return r};e.prototype.onAsciiEncoding=function(){var t=[];for(var e=0,i=this.valueBlock.value;e<i.length;e++){var r=i[e];t.push(r.toString("ascii").split("\n").map((function(t){return" ".concat(t)})).join("\n"))}var n=this.idBlock.tagClass===3?"[".concat(this.idBlock.tagNumber,"]"):this.constructor.NAME;return t.length?"".concat(n," :\n").concat(t.join("\n")):"".concat(n," :")};return e}(W);it=rt;(function(){G.Constructed=it})();rt.NAME="CONSTRUCTED";var nt=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.fromBER=function(t,e,i){return e};e.prototype.toBER=function(t){return M};return e}(F);nt.override="EndOfContentValueBlock";var at;var ot=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,nt)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=0;return i}return e}(W);at=ot;(function(){G.EndOfContent=at})();ot.NAME=N;var st;var ut=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,F)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=5;return i}e.prototype.fromBER=function(t,e,i){if(this.lenBlock.length>0)this.warnings.push("Non-zero length of value block for Null type");if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;this.blockLength+=i;if(e+i>t.byteLength){this.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return-1}return e+i};e.prototype.toBER=function(t,e){var i=new ArrayBuffer(2);if(!t){var r=new Uint8Array(i);r[0]=5;r[1]=0}if(e){e.write(i)}return i};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME)};return e}(W);st=ut;(function(){G.Null=st})();ut.NAME="NULL";var ct=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=__rest(e,["value"]);i=t.call(this,n)||this;if(n.valueHex){i.valueHexView=u.BufferSourceConverter.toUint8Array(n.valueHex)}else{i.valueHexView=new Uint8Array(1)}if(r){i.value=r}return i}Object.defineProperty(e.prototype,"value",{get:function(){for(var t=0,e=this.valueHexView;t<e.length;t++){var i=e[t];if(i>0){return true}}return false},set:function(t){this.valueHexView[0]=t?255:0},enumerable:false,configurable:true});e.prototype.fromBER=function(t,e,i){var r=u.BufferSourceConverter.toUint8Array(t);if(!C(this,r,e,i)){return-1}this.valueHexView=r.subarray(e,e+i);if(i>1)this.warnings.push("Boolean value encoded in more then 1 octet");this.isHexOnly=true;d.call(this);this.blockLength=i;return e+i};e.prototype.toBER=function(){return this.valueHexView.slice()};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{value:this.value})};return e}(H(F));ct.NAME="BooleanValueBlock";var ft;var vt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,ct)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=1;return i}e.prototype.getValue=function(){return this.valueBlock.value};e.prototype.setValue=function(t){this.valueBlock.value=t};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.getValue)};return e}(W);ft=vt;(function(){G.Boolean=ft})();vt.NAME="BOOLEAN";var ht=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.isConstructed,n=r===void 0?false:r,a=__rest(e,["isConstructed"]);i=t.call(this,a)||this;i.isConstructed=n;return i}e.prototype.fromBER=function(e,i,r){var n=0;if(this.isConstructed){this.isHexOnly=false;n=et.prototype.fromBER.call(this,e,i,r);if(n===-1)return n;for(var a=0;a<this.value.length;a++){var o=this.value[a].constructor.NAME;if(o===N){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only";return-1}}if(o!==K){this.error="OCTET STRING may consists of OCTET STRINGs only";return-1}}}else{this.isHexOnly=true;n=t.prototype.fromBER.call(this,e,i,r);this.blockLength=r}return n};e.prototype.toBER=function(t,e){if(this.isConstructed)return et.prototype.toBER.call(this,t,e);return t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{isConstructed:this.isConstructed})};return e}(H(et));ht.NAME="OctetStringValueBlock";var dt;var lt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.idBlock,n=r===void 0?{}:r,a=e.lenBlock,o=a===void 0?{}:a,s=__rest(e,["idBlock","lenBlock"]);var u,c;(u=s.isConstructed)!==null&&u!==void 0?u:s.isConstructed=!!((c=s.value)===null||c===void 0?void 0:c.length);i=t.call(this,__assign({idBlock:__assign({isConstructed:s.isConstructed},n),lenBlock:__assign(__assign({},o),{isIndefiniteForm:!!s.isIndefiniteForm})},s),ht)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=4;return i}e.prototype.fromBER=function(e,i,r){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;if(r===0){if(this.idBlock.error.length===0)this.blockLength+=this.idBlock.blockLength;if(this.lenBlock.error.length===0)this.blockLength+=this.lenBlock.blockLength;return i}if(!this.valueBlock.isConstructed){var n=e instanceof ArrayBuffer?new Uint8Array(e):e;var a=n.subarray(i,i+r);try{if(a.byteLength){var o=X(a,0,a.byteLength);if(o.offset!==-1&&o.offset===r){this.valueBlock.value=[o.result]}}}catch(t){}}return t.prototype.fromBER.call(this,e,i,r)};e.prototype.onAsciiEncoding=function(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return rt.prototype.onAsciiEncoding.call(this)}var t=this.constructor.NAME;var e=u.Convert.ToHex(this.valueBlock.valueHexView);return"".concat(t," : ").concat(e)};e.prototype.getValue=function(){if(!this.idBlock.isConstructed){return this.valueBlock.valueHexView.slice().buffer}var t=[];for(var e=0,i=this.valueBlock.value;e<i.length;e++){var r=i[e];if(r instanceof dt){t.push(r.valueBlock.valueHexView)}}return u.BufferSourceConverter.concat(t)};return e}(W);dt=lt;(function(){G.OctetString=dt})();lt.NAME=K;var pt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.unusedBits,n=r===void 0?0:r,a=e.isConstructed,o=a===void 0?false:a,s=__rest(e,["unusedBits","isConstructed"]);i=t.call(this,s)||this;i.unusedBits=n;i.isConstructed=o;i.blockLength=i.valueHexView.byteLength;return i}e.prototype.fromBER=function(t,e,i){if(!i){return e}var r=-1;if(this.isConstructed){r=et.prototype.fromBER.call(this,t,e,i);if(r===-1)return r;for(var n=0,a=this.value;n<a.length;n++){var o=a[n];var s=o.constructor.NAME;if(s===N){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only";return-1}}if(s!==j){this.error="BIT STRING may consists of BIT STRINGs only";return-1}var c=o.valueBlock;if(this.unusedBits>0&&c.unusedBits>0){this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only';return-1}this.unusedBits=c.unusedBits}return r}var f=u.BufferSourceConverter.toUint8Array(t);if(!C(this,f,e,i)){return-1}var v=f.subarray(e,e+i);this.unusedBits=v[0];if(this.unusedBits>7){this.error="Unused bits for BitString must be in range 0-7";return-1}if(!this.unusedBits){var h=v.subarray(1);try{if(h.byteLength){var d=X(h,0,h.byteLength);if(d.offset!==-1&&d.offset===i-1){this.value=[d.result]}}}catch(t){}}this.valueHexView=v.subarray(1);this.blockLength=v.length;return e+i};e.prototype.toBER=function(t,e){if(this.isConstructed){return et.prototype.toBER.call(this,t,e)}if(t){return new ArrayBuffer(this.valueHexView.byteLength+1)}if(!this.valueHexView.byteLength){return M}var i=new Uint8Array(this.valueHexView.length+1);i[0]=this.unusedBits;i.set(this.valueHexView,1);return i.buffer};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{unusedBits:this.unusedBits,isConstructed:this.isConstructed})};return e}(H(et));pt.NAME="BitStringValueBlock";var yt;var St=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.idBlock,n=r===void 0?{}:r,a=e.lenBlock,o=a===void 0?{}:a,s=__rest(e,["idBlock","lenBlock"]);var u,c;(u=s.isConstructed)!==null&&u!==void 0?u:s.isConstructed=!!((c=s.value)===null||c===void 0?void 0:c.length);i=t.call(this,__assign({idBlock:__assign({isConstructed:s.isConstructed},n),lenBlock:__assign(__assign({},o),{isIndefiniteForm:!!s.isIndefiniteForm})},s),pt)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=3;return i}e.prototype.fromBER=function(e,i,r){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;return t.prototype.fromBER.call(this,e,i,r)};e.prototype.onAsciiEncoding=function(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return rt.prototype.onAsciiEncoding.call(this)}else{var t=[];var e=this.valueBlock.valueHexView;for(var i=0,r=e;i<r.length;i++){var n=r[i];t.push(n.toString(2).padStart(8,"0"))}var a=t.join("");var o=this.constructor.NAME;var s=a.substring(0,a.length-this.valueBlock.unusedBits);return"".concat(o," : ").concat(s)}};return e}(W);yt=St;(function(){G.BitString=yt})();St.NAME=j;var At;function Ct(t,e){var i=new Uint8Array([0]);var r=new Uint8Array(t);var n=new Uint8Array(e);var a=r.slice(0);var o=a.length-1;var s=n.slice(0);var u=s.length-1;var c=0;var f=u<o?o:u;var v=0;for(var d=f;d>=0;d--,v++){switch(true){case v<s.length:c=a[o-v]+s[u-v]+i[0];break;default:c=a[o-v]+i[0]}i[0]=c/10;switch(true){case v>=a.length:a=h(new Uint8Array([c%10]),a);break;default:a[o-v]=c%10}}if(i[0]>0)a=h(i,a);return a}function mt(t){if(t>=g.length){for(var e=g.length;e<=t;e++){var i=new Uint8Array([0]);var r=g[e-1].slice(0);for(var n=r.length-1;n>=0;n--){var a=new Uint8Array([(r[n]<<1)+i[0]]);i[0]=a[0]/10;r[n]=a[0]%10}if(i[0]>0)r=h(i,r);g.push(r)}}return g[t]}function gt(t,e){var i=0;var r=new Uint8Array(t);var n=new Uint8Array(e);var a=r.slice(0);var o=a.length-1;var s=n.slice(0);var u=s.length-1;var c;var f=0;for(var v=u;v>=0;v--,f++){c=a[o-f]-s[u-f]-i;switch(true){case c<0:i=1;a[o-f]=c+10;break;default:i=0;a[o-f]=c}}if(i>0){for(var v=o-u+1;v>=0;v--,f++){c=a[o-f]-i;if(c<0){i=1;a[o-f]=c+10}else{i=0;a[o-f]=c;break}}}return a.slice()}var wt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=__rest(e,["value"]);i=t.call(this,n)||this;i._valueDec=0;if(n.valueHex){i.setValueHex()}if(r!==undefined){i.valueDec=r}return i}e.prototype.setValueHex=function(){if(this.valueHexView.length>=4){this.warnings.push("Too big Integer for decoding, hex only");this.isHexOnly=true;this._valueDec=0}else{this.isHexOnly=false;if(this.valueHexView.length>0){this._valueDec=d.call(this)}}};Object.defineProperty(e.prototype,"valueDec",{get:function(){return this._valueDec},set:function(t){this._valueDec=t;this.isHexOnly=false;this.valueHexView=new Uint8Array(l(t))},enumerable:false,configurable:true});e.prototype.fromDER=function(t,e,i,r){if(r===void 0){r=0}var n=this.fromBER(t,e,i);if(n===-1)return n;var a=this.valueHexView;if(a[0]===0&&(a[1]&128)!==0){this.valueHexView=a.subarray(1)}else{if(r!==0){if(a.length<r){if(r-a.length>1)r=a.length+1;this.valueHexView=a.subarray(r-a.length)}}}return n};e.prototype.toDER=function(t){if(t===void 0){t=false}var e=this.valueHexView;switch(true){case(e[0]&128)!==0:{var i=new Uint8Array(this.valueHexView.length+1);i[0]=0;i.set(e,1);this.valueHexView=i}break;case e[0]===0&&(e[1]&128)===0:{this.valueHexView=this.valueHexView.subarray(1)}break}return this.toBER(t)};e.prototype.fromBER=function(e,i,r){var n=t.prototype.fromBER.call(this,e,i,r);if(n===-1){return n}this.setValueHex();return n};e.prototype.toBER=function(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{valueDec:this.valueDec})};e.prototype.toString=function(){var t=this.valueHexView.length*8-1;var e=new Uint8Array(this.valueHexView.length*8/3);var i=0;var r;var n=this.valueHexView;var a="";var o=false;for(var s=n.byteLength-1;s>=0;s--){r=n[s];for(var u=0;u<8;u++){if((r&1)===1){switch(i){case t:e=gt(mt(i),e);a="-";break;default:e=Ct(e,mt(i))}}i++;r>>=1}}for(var u=0;u<e.length;u++){if(e[u])o=true;if(o)a+=w.charAt(e[u])}if(o===false)a+=w.charAt(0);return a};return e}(H(F));At=wt;wt.NAME="IntegerValueBlock";(function(){Object.defineProperty(At.prototype,"valueHex",{set:function(t){this.valueHexView=new Uint8Array(t);this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}})})();var _t;var bt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,wt)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=2;return i}e.prototype.toBigInt=function(){S();return BigInt(this.valueBlock.toString())};e.fromBigInt=function(t){S();var e=BigInt(t);var i=new m;var r=e.toString(16).replace(/^-/,"");var n=new Uint8Array(u.Convert.FromHex(r));if(e<0){var a=new Uint8Array(n.length+(n[0]&128?1:0));a[0]|=128;var o=BigInt("0x".concat(u.Convert.ToHex(a)));var s=o+e;var c=u.BufferSourceConverter.toUint8Array(u.Convert.FromHex(s.toString(16)));c[0]|=128;i.write(c)}else{if(n[0]&128){i.write(new Uint8Array([0]))}i.write(n)}var f=new _t({valueHex:i.final()});return f};e.prototype.convertToDER=function(){var t=new _t({valueHex:this.valueBlock.valueHexView});t.valueBlock.toDER();return t};e.prototype.convertFromDER=function(){return new _t({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString())};return e}(W);_t=bt;(function(){G.Integer=_t})();bt.NAME="INTEGER";var Et;var Pt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=10;return i}return e}(bt);Et=Pt;(function(){G.Enumerated=Et})();Pt.NAME="ENUMERATED";var Dt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.valueDec,n=r===void 0?-1:r,a=e.isFirstSid,o=a===void 0?false:a,s=__rest(e,["valueDec","isFirstSid"]);i=t.call(this,s)||this;i.valueDec=n;i.isFirstSid=o;return i}e.prototype.fromBER=function(t,e,i){if(!i){return e}var r=u.BufferSourceConverter.toUint8Array(t);if(!C(this,r,e,i)){return-1}var n=r.subarray(e,e+i);this.valueHexView=new Uint8Array(i);for(var a=0;a<i;a++){this.valueHexView[a]=n[a]&127;this.blockLength++;if((n[a]&128)===0)break}var o=new Uint8Array(this.blockLength);for(var a=0;a<this.blockLength;a++){o[a]=this.valueHexView[a]}this.valueHexView=o;if((n[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=f(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return e+this.blockLength};Object.defineProperty(e.prototype,"valueBigInt",{set:function(t){S();var e=BigInt(t).toString(2);while(e.length%7){e="0"+e}var i=new Uint8Array(e.length/7);for(var r=0;r<i.length;r++){i[r]=parseInt(e.slice(r*7,r*7+7),2)+(r+1<i.length?128:0)}this.fromBER(i.buffer,0,i.length)},enumerable:false,configurable:true});e.prototype.toBER=function(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);var e=this.valueHexView;var i=new Uint8Array(this.blockLength);for(var r=0;r<this.blockLength-1;r++)i[r]=e[r]|128;i[this.blockLength-1]=e[this.blockLength-1];return i.buffer}var n=v(this.valueDec,7);if(n.byteLength===0){this.error="Error during encoding SID value";return M}var a=new Uint8Array(n.byteLength);if(!t){var o=new Uint8Array(n);var s=n.byteLength-1;for(var r=0;r<s;r++)a[r]=o[r]|128;a[s]=o[s]}return a};e.prototype.toString=function(){var t="";if(this.isHexOnly)t=u.Convert.ToHex(this.valueHexView);else{if(this.isFirstSid){var e=this.valueDec;if(this.valueDec<=39)t="0.";else{if(this.valueDec<=79){t="1.";e-=40}else{t="2.";e-=80}}t+=e.toString()}else t=this.valueDec.toString()}return t};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{valueDec:this.valueDec,isFirstSid:this.isFirstSid})};return e}(H(F));Dt.NAME="sidBlock";var It=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=r===void 0?k:r,a=__rest(e,["value"]);i=t.call(this,a)||this;i.value=[];if(n){i.fromString(n)}return i}e.prototype.fromBER=function(t,e,i){var r=e;while(i>0){var n=new Dt;r=n.fromBER(t,r,i);if(r===-1){this.blockLength=0;this.error=n.error;return r}if(this.value.length===0)n.isFirstSid=true;this.blockLength+=n.blockLength;i-=n.blockLength;this.value.push(n)}return r};e.prototype.toBER=function(t){var e=[];for(var i=0;i<this.value.length;i++){var r=this.value[i].toBER(t);if(r.byteLength===0){this.error=this.value[i].error;return M}e.push(r)}return A(e)};e.prototype.fromString=function(t){this.value=[];var e=0;var i=0;var r="";var n=false;do{i=t.indexOf(".",e);if(i===-1)r=t.substring(e);else r=t.substring(e,i);e=i+1;if(n){var a=this.value[0];var o=0;switch(a.valueDec){case 0:break;case 1:o=40;break;case 2:o=80;break;default:this.value=[];return}var s=parseInt(r,10);if(isNaN(s))return;a.valueDec=s+o;n=false}else{var a=new Dt;if(r>Number.MAX_SAFE_INTEGER){S();var u=BigInt(r);a.valueBigInt=u}else{a.valueDec=parseInt(r,10);if(isNaN(a.valueDec))return}if(!this.value.length){a.isFirstSid=true;n=true}this.value.push(a)}}while(i!==-1)};e.prototype.toString=function(){var t="";var e=false;for(var i=0;i<this.value.length;i++){e=this.value[i].isHexOnly;var r=this.value[i].toString();if(i!==0)t="".concat(t,".");if(e){r="{".concat(r,"}");if(this.value[i].isFirstSid)t="2.{".concat(r," - 80}");else t+=r}else t+=r}return t};e.prototype.toJSON=function(){var e=__assign(__assign({},t.prototype.toJSON.call(this)),{value:this.toString(),sidArray:[]});for(var i=0;i<this.value.length;i++){e.sidArray.push(this.value[i].toJSON())}return e};return e}(F);It.NAME="ObjectIdentifierValueBlock";var Bt;var xt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,It)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=6;return i}e.prototype.getValue=function(){return this.valueBlock.toString()};e.prototype.setValue=function(t){this.valueBlock.fromString(t)};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString()||"empty")};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{value:this.getValue()})};return e}(W);Bt=xt;(function(){G.ObjectIdentifier=Bt})();xt.NAME="OBJECT IDENTIFIER";var Tt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.valueDec,n=r===void 0?0:r,a=__rest(e,["valueDec"]);i=t.call(this,a)||this;i.valueDec=n;return i}e.prototype.fromBER=function(t,e,i){if(i===0)return e;var r=u.BufferSourceConverter.toUint8Array(t);if(!C(this,r,e,i))return-1;var n=r.subarray(e,e+i);this.valueHexView=new Uint8Array(i);for(var a=0;a<i;a++){this.valueHexView[a]=n[a]&127;this.blockLength++;if((n[a]&128)===0)break}var o=new Uint8Array(this.blockLength);for(var a=0;a<this.blockLength;a++)o[a]=this.valueHexView[a];this.valueHexView=o;if((n[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=f(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return e+this.blockLength};e.prototype.toBER=function(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);var e=this.valueHexView;var i=new Uint8Array(this.blockLength);for(var r=0;r<this.blockLength-1;r++)i[r]=e[r]|128;i[this.blockLength-1]=e[this.blockLength-1];return i.buffer}var n=v(this.valueDec,7);if(n.byteLength===0){this.error="Error during encoding SID value";return M}var a=new Uint8Array(n.byteLength);if(!t){var o=new Uint8Array(n);var s=n.byteLength-1;for(var r=0;r<s;r++)a[r]=o[r]|128;a[s]=o[s]}return a.buffer};e.prototype.toString=function(){var t="";if(this.isHexOnly)t=u.Convert.ToHex(this.valueHexView);else{t=this.valueDec.toString()}return t};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{valueDec:this.valueDec})};return e}(H(U));Tt.NAME="relativeSidBlock";var Ot=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=r===void 0?k:r,a=__rest(e,["value"]);i=t.call(this,a)||this;i.value=[];if(n){i.fromString(n)}return i}e.prototype.fromBER=function(t,e,i){var r=e;while(i>0){var n=new Tt;r=n.fromBER(t,r,i);if(r===-1){this.blockLength=0;this.error=n.error;return r}this.blockLength+=n.blockLength;i-=n.blockLength;this.value.push(n)}return r};e.prototype.toBER=function(t,e){var i=[];for(var r=0;r<this.value.length;r++){var n=this.value[r].toBER(t);if(n.byteLength===0){this.error=this.value[r].error;return M}i.push(n)}return A(i)};e.prototype.fromString=function(t){this.value=[];var e=0;var i=0;var r="";do{i=t.indexOf(".",e);if(i===-1)r=t.substring(e);else r=t.substring(e,i);e=i+1;var n=new Tt;n.valueDec=parseInt(r,10);if(isNaN(n.valueDec))return true;this.value.push(n)}while(i!==-1);return true};e.prototype.toString=function(){var t="";var e=false;for(var i=0;i<this.value.length;i++){e=this.value[i].isHexOnly;var r=this.value[i].toString();if(i!==0)t="".concat(t,".");if(e){r="{".concat(r,"}");t+=r}else t+=r}return t};e.prototype.toJSON=function(){var e=__assign(__assign({},t.prototype.toJSON.call(this)),{value:this.toString(),sidArray:[]});for(var i=0;i<this.value.length;i++)e.sidArray.push(this.value[i].toJSON());return e};return e}(F);Ot.NAME="RelativeObjectIdentifierValueBlock";var kt;var Mt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,Ot)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=13;return i}e.prototype.getValue=function(){return this.valueBlock.toString()};e.prototype.setValue=function(t){this.valueBlock.fromString(t)};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString()||"empty")};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{value:this.getValue()})};return e}(W);kt=Mt;(function(){G.RelativeObjectIdentifier=kt})();Mt.NAME="RelativeObjectIdentifier";var Rt;var Nt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=16;return i}return e}(rt);Rt=Nt;(function(){G.Sequence=Rt})();Nt.NAME="SEQUENCE";var Kt;var jt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=17;return i}return e}(rt);Kt=jt;(function(){G.Set=Kt})();jt.NAME="SET";var Ht=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=__rest(e,[]);i=t.call(this,r)||this;i.isHexOnly=true;i.value=k;return i}e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{value:this.value})};return e}(H(F));Ht.NAME="StringValueBlock";var Ut=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ht);Ut.NAME="SimpleStringValueBlock";var Ft=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=__rest(e,[]);return t.call(this,i,Ut)||this}e.prototype.fromBuffer=function(t){this.valueBlock.value=String.fromCharCode.apply(null,u.BufferSourceConverter.toUint8Array(t))};e.prototype.fromString=function(t){var e=t.length;var i=this.valueBlock.valueHexView=new Uint8Array(e);for(var r=0;r<e;r++)i[r]=t.charCodeAt(r);this.valueBlock.value=t};return e}(q);Ft.NAME="SIMPLE STRING";var Lt=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.fromBuffer=function(t){this.valueBlock.valueHexView=u.BufferSourceConverter.toUint8Array(t);try{this.valueBlock.value=u.Convert.ToUtf8String(t)}catch(e){this.warnings.push('Error during "decodeURIComponent": '.concat(e,", using raw string"));this.valueBlock.value=u.Convert.ToBinary(t)}};e.prototype.fromString=function(t){this.valueBlock.valueHexView=new Uint8Array(u.Convert.FromUtf8String(t));this.valueBlock.value=t};return e}(Ft);Lt.NAME="Utf8StringValueBlock";var Vt;var Gt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=12;return i}return e}(Lt);Vt=Gt;(function(){G.Utf8String=Vt})();Gt.NAME="UTF8String";var Wt=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.fromBuffer=function(t){this.valueBlock.value=u.Convert.ToUtf16String(t);this.valueBlock.valueHexView=u.BufferSourceConverter.toUint8Array(t)};e.prototype.fromString=function(t){this.valueBlock.value=t;this.valueBlock.valueHexView=new Uint8Array(u.Convert.FromUtf16String(t))};return e}(Ft);Wt.NAME="BmpStringValueBlock";var Qt;var qt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=__rest(e,[]);i=t.call(this,r)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=30;return i}return e}(Wt);Qt=qt;(function(){G.BmpString=Qt})();qt.NAME="BMPString";var zt=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.fromBuffer=function(t){var e=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0);var i=new Uint8Array(e);for(var r=0;r<i.length;r+=4){i[r]=i[r+3];i[r+1]=i[r+2];i[r+2]=0;i[r+3]=0}this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(e))};e.prototype.fromString=function(t){var e=t.length;var i=this.valueBlock.valueHexView=new Uint8Array(e*4);for(var r=0;r<e;r++){var n=v(t.charCodeAt(r),8);var a=new Uint8Array(n);if(a.length>4)continue;var o=4-a.length;for(var s=a.length-1;s>=0;s--)i[r*4+s+o]=a[s]}this.valueBlock.value=t};return e}(Ft);zt.NAME="UniversalStringValueBlock";var Yt;var Zt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=__rest(e,[]);i=t.call(this,r)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=28;return i}return e}(zt);Yt=Zt;(function(){G.UniversalString=Yt})();Zt.NAME="UniversalString";var $t;var Xt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=18;return i}return e}(Ft);$t=Xt;(function(){G.NumericString=$t})();Xt.NAME="NumericString";var Jt;var te=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=19;return i}return e}(Ft);Jt=te;(function(){G.PrintableString=Jt})();te.NAME="PrintableString";var ee;var ie=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=20;return i}return e}(Ft);ee=ie;(function(){G.TeletexString=ee})();ie.NAME="TeletexString";var re;var ne=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=21;return i}return e}(Ft);re=ne;(function(){G.VideotexString=re})();ne.NAME="VideotexString";var ae;var oe=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=22;return i}return e}(Ft);ae=oe;(function(){G.IA5String=ae})();oe.NAME="IA5String";var se;var ue=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=25;return i}return e}(Ft);se=ue;(function(){G.GraphicString=se})();ue.NAME="GraphicString";var ce;var fe=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=26;return i}return e}(Ft);ce=fe;(function(){G.VisibleString=ce})();fe.NAME="VisibleString";var ve;var he=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=27;return i}return e}(Ft);ve=he;(function(){G.GeneralString=ve})();he.NAME="GeneralString";var de;var le=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=29;return i}return e}(Ft);de=le;(function(){G.CharacterString=de})();le.NAME="CharacterString";var pe;var ye=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=e.valueDate,a=__rest(e,["value","valueDate"]);i=t.call(this,a)||this;i.year=0;i.month=0;i.day=0;i.hour=0;i.minute=0;i.second=0;if(r){i.fromString(r);i.valueBlock.valueHexView=new Uint8Array(r.length);for(var o=0;o<r.length;o++)i.valueBlock.valueHexView[o]=r.charCodeAt(o)}if(n){i.fromDate(n);i.valueBlock.valueHexView=new Uint8Array(i.toBuffer())}i.idBlock.tagClass=1;i.idBlock.tagNumber=23;return i}e.prototype.fromBuffer=function(t){this.fromString(String.fromCharCode.apply(null,u.BufferSourceConverter.toUint8Array(t)))};e.prototype.toBuffer=function(){var t=this.toString();var e=new ArrayBuffer(t.length);var i=new Uint8Array(e);for(var r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return e};e.prototype.fromDate=function(t){this.year=t.getUTCFullYear();this.month=t.getUTCMonth()+1;this.day=t.getUTCDate();this.hour=t.getUTCHours();this.minute=t.getUTCMinutes();this.second=t.getUTCSeconds()};e.prototype.toDate=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))};e.prototype.fromString=function(t){var e=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/gi;var i=e.exec(t);if(i===null){this.error="Wrong input string for conversion";return}var r=parseInt(i[1],10);if(r>=50)this.year=1900+r;else this.year=2e3+r;this.month=parseInt(i[2],10);this.day=parseInt(i[3],10);this.hour=parseInt(i[4],10);this.minute=parseInt(i[5],10);this.second=parseInt(i[6],10)};e.prototype.toString=function(e){if(e===void 0){e="iso"}if(e==="iso"){var i=new Array(7);i[0]=y(this.year<2e3?this.year-1900:this.year-2e3,2);i[1]=y(this.month,2);i[2]=y(this.day,2);i[3]=y(this.hour,2);i[4]=y(this.minute,2);i[5]=y(this.second,2);i[6]="Z";return i.join("")}return t.prototype.toString.call(this,e)};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.toDate().toISOString())};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second})};return e}(fe);pe=ye;(function(){G.UTCTime=pe})();ye.NAME="UTCTime";var Se;var Ae=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i;var r=t.call(this,e)||this;(i=r.millisecond)!==null&&i!==void 0?i:r.millisecond=0;r.idBlock.tagClass=1;r.idBlock.tagNumber=24;return r}e.prototype.fromDate=function(e){t.prototype.fromDate.call(this,e);this.millisecond=e.getUTCMilliseconds()};e.prototype.toDate=function(){var t=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(t)};e.prototype.fromString=function(t){var e=false;var i="";var r="";var n=0;var a;var o=0;var s=0;if(t[t.length-1]==="Z"){i=t.substring(0,t.length-1);e=true}else{var u=new Number(t[t.length-1]);if(isNaN(u.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(e){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{var c=1;var f=i.indexOf("+");var v="";if(f===-1){f=i.indexOf("-");c=-1}if(f!==-1){v=i.substring(f+1);i=i.substring(0,f);if(v.length!==2&&v.length!==4)throw new Error("Wrong input string for conversion");var u=parseInt(v.substring(0,2),10);if(isNaN(u.valueOf()))throw new Error("Wrong input string for conversion");o=c*u;if(v.length===4){u=parseInt(v.substring(2,4),10);if(isNaN(u.valueOf()))throw new Error("Wrong input string for conversion");s=c*u}}}var h=i.indexOf(".");if(h===-1)h=i.indexOf(",");if(h!==-1){var d=new Number("0".concat(i.substring(h)));if(isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");n=d.valueOf();r=i.substring(0,h)}else r=i;switch(true){case r.length===8:a=/(\d{4})(\d{2})(\d{2})/gi;if(h!==-1)throw new Error("Wrong input string for conversion");break;case r.length===10:a=/(\d{4})(\d{2})(\d{2})(\d{2})/gi;if(h!==-1){var l=60*n;this.minute=Math.floor(l);l=60*(l-this.minute);this.second=Math.floor(l);l=1e3*(l-this.second);this.millisecond=Math.floor(l)}break;case r.length===12:a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(h!==-1){var l=60*n;this.second=Math.floor(l);l=1e3*(l-this.second);this.millisecond=Math.floor(l)}break;case r.length===14:a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(h!==-1){var l=1e3*n;this.millisecond=Math.floor(l)}break;default:throw new Error("Wrong input string for conversion")}var p=a.exec(r);if(p===null)throw new Error("Wrong input string for conversion");for(var y=1;y<p.length;y++){switch(y){case 1:this.year=parseInt(p[y],10);break;case 2:this.month=parseInt(p[y],10);break;case 3:this.day=parseInt(p[y],10);break;case 4:this.hour=parseInt(p[y],10)+o;break;case 5:this.minute=parseInt(p[y],10)+s;break;case 6:this.second=parseInt(p[y],10);break;default:throw new Error("Wrong input string for conversion")}}if(e===false){var S=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=S.getUTCFullYear();this.month=S.getUTCMonth();this.day=S.getUTCDay();this.hour=S.getUTCHours();this.minute=S.getUTCMinutes();this.second=S.getUTCSeconds();this.millisecond=S.getUTCMilliseconds()}};e.prototype.toString=function(e){if(e===void 0){e="iso"}if(e==="iso"){var i=[];i.push(y(this.year,4));i.push(y(this.month,2));i.push(y(this.day,2));i.push(y(this.hour,2));i.push(y(this.minute,2));i.push(y(this.second,2));if(this.millisecond!==0){i.push(".");i.push(y(this.millisecond,3))}i.push("Z");return i.join("")}return t.prototype.toString.call(this,e)};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{millisecond:this.millisecond})};return e}(ye);Se=Ae;(function(){G.GeneralizedTime=Se})();Ae.NAME="GeneralizedTime";var Ce;var me=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=31;return i}return e}(Gt);Ce=me;(function(){G.DATE=Ce})();me.NAME="DATE";var ge;var we=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=32;return i}return e}(Gt);ge=we;(function(){G.TimeOfDay=ge})();we.NAME="TimeOfDay";var _e;var be=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=33;return i}return e}(Gt);_e=be;(function(){G.DateTime=_e})();be.NAME="DateTime";var Ee;var Pe=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=34;return i}return e}(Gt);Ee=Pe;(function(){G.Duration=Ee})();Pe.NAME="Duration";var De;var Ie=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=14;return i}return e}(Gt);De=Ie;(function(){G.TIME=De})();Ie.NAME="TIME";var Be=function(){function t(t){var e=t===void 0?{}:t,i=e.name,r=i===void 0?k:i,n=e.optional,a=n===void 0?false:n;this.name=r;this.optional=a}return t}();var xe=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=r===void 0?[]:r,a=__rest(e,["value"]);i=t.call(this,a)||this;i.value=n;return i}return e}(Be);var Te=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=r===void 0?new Be:r,a=e.local,o=a===void 0?false:a,s=__rest(e,["value","local"]);i=t.call(this,s)||this;i.value=n;i.local=o;return i}return e}(Be);var Oe=function(){function t(t){var e=t===void 0?{}:t,i=e.data,r=i===void 0?R:i;this.dataView=u.BufferSourceConverter.toUint8Array(r)}Object.defineProperty(t.prototype,"data",{get:function(){return this.dataView.slice().buffer},set:function(t){this.dataView=u.BufferSourceConverter.toUint8Array(t)},enumerable:false,configurable:true});t.prototype.fromBER=function(t,e,i){var r=e+i;this.dataView=u.BufferSourceConverter.toUint8Array(t).subarray(e,r);return r};t.prototype.toBER=function(t){return this.dataView.slice().buffer};return t}();function ke(t,e,i){if(i instanceof xe){for(var r=0,n=i.value;r<n.length;r++){var a=n[r];var o=ke(t,e,a);if(o.verified){return{verified:true,result:t}}}{var s={verified:false,result:{error:"Wrong values for Choice type"}};if(i.hasOwnProperty(_))s.name=i.name;return s}}if(i instanceof Be){if(i.hasOwnProperty(_))t[i.name]=e;return{verified:true,result:t}}if(t instanceof Object===false){return{verified:false,result:{error:"Wrong root object"}}}if(e instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 data"}}}if(i instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(P in i===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(x in i.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(T in i.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}var u=i.idBlock.toBER(false);if(u.byteLength===0){return{verified:false,result:{error:"Error encoding idBlock for ASN.1 schema"}}}var c=i.idBlock.fromBER(u,0,u.byteLength);if(c===-1){return{verified:false,result:{error:"Error decoding idBlock for ASN.1 schema"}}}if(i.idBlock.hasOwnProperty(D)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.tagClass!==e.idBlock.tagClass){return{verified:false,result:t}}if(i.idBlock.hasOwnProperty(I)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.tagNumber!==e.idBlock.tagNumber){return{verified:false,result:t}}if(i.idBlock.hasOwnProperty(B)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.isConstructed!==e.idBlock.isConstructed){return{verified:false,result:t}}if(!(E in i.idBlock)){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.isHexOnly!==e.idBlock.isHexOnly){return{verified:false,result:t}}if(i.idBlock.isHexOnly){if(b in i.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}var f=i.idBlock.valueHexView;var v=e.idBlock.valueHexView;if(f.length!==v.length){return{verified:false,result:t}}for(var h=0;h<f.length;h++){if(f[h]!==v[1]){return{verified:false,result:t}}}}if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name)t[i.name]=e}if(i instanceof G.Constructed){var d=0;var o={verified:false,result:{error:"Unknown error"}};var l=i.valueBlock.value.length;if(l>0){if(i.valueBlock.value[0]instanceof Te){l=e.valueBlock.value.length}}if(l===0){return{verified:true,result:t}}if(e.valueBlock.value.length===0&&i.valueBlock.value.length!==0){var p=true;for(var h=0;h<i.valueBlock.value.length;h++)p=p&&(i.valueBlock.value[h].optional||false);if(p){return{verified:true,result:t}}if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name)delete t[i.name]}t.error="Inconsistent object length";return{verified:false,result:t}}for(var h=0;h<l;h++){if(h-d>=e.valueBlock.value.length){if(i.valueBlock.value[h].optional===false){var s={verified:false,result:t};t.error="Inconsistent length between ASN.1 data and schema";if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name){delete t[i.name];s.name=i.name}}return s}}else{if(i.valueBlock.value[0]instanceof Te){o=ke(t,e.valueBlock.value[h],i.valueBlock.value[0].value);if(o.verified===false){if(i.valueBlock.value[0].optional)d++;else{if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name)delete t[i.name]}return o}}if(_ in i.valueBlock.value[0]&&i.valueBlock.value[0].name.length>0){var y={};if(O in i.valueBlock.value[0]&&i.valueBlock.value[0].local)y=e;else y=t;if(typeof y[i.valueBlock.value[0].name]==="undefined")y[i.valueBlock.value[0].name]=[];y[i.valueBlock.value[0].name].push(e.valueBlock.value[h])}}else{o=ke(t,e.valueBlock.value[h-d],i.valueBlock.value[h]);if(o.verified===false){if(i.valueBlock.value[h].optional)d++;else{if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name)delete t[i.name]}return o}}}}}if(o.verified===false){var s={verified:false,result:t};if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name){delete t[i.name];s.name=i.name}}return s}return{verified:true,result:t}}if(i.primitiveSchema&&b in e.valueBlock){var S=X(e.valueBlock.valueHexView);if(S.offset===-1){var s={verified:false,result:S.result};if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name){delete t[i.name];s.name=i.name}}return s}return ke(t,S.result,i.primitiveSchema)}return{verified:true,result:t}}function Me(t,e){if(e instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema type"}}}var i=X(u.BufferSourceConverter.toUint8Array(t));if(i.offset===-1){return{verified:false,result:i.result}}return ke(i.result,i.result,e)}var Re=Object.freeze({__proto__:null,Any:Be,BaseBlock:W,BaseStringBlock:q,BitString:St,BmpString:qt,Boolean:vt,CharacterString:le,Choice:xe,Constructed:rt,DATE:me,DateTime:be,Duration:Pe,EndOfContent:ot,Enumerated:Pt,GeneralString:he,GeneralizedTime:Ae,GraphicString:ue,HexBlock:H,IA5String:oe,Integer:bt,Null:ut,NumericString:Xt,ObjectIdentifier:xt,OctetString:lt,Primitive:Z,PrintableString:te,RawData:Oe,RelativeObjectIdentifier:Mt,Repeated:Te,Sequence:Nt,Set:jt,TIME:Ie,TeletexString:ie,TimeOfDay:we,UTCTime:ye,UniversalString:Zt,Utf8String:Gt,ValueBlock:F,VideotexString:ne,ViewWriter:m,VisibleString:fe,compareSchema:ke,fromBER:J,verifySchema:Me});var Ne;t("bw",Ne);(function(t){t[t["Sequence"]=0]="Sequence";t[t["Set"]=1]="Set";t[t["Choice"]=2]="Choice"})(Ne||t("bw",Ne={}));var Ke;t("bu",Ke);(function(t){t[t["Any"]=1]="Any";t[t["Boolean"]=2]="Boolean";t[t["OctetString"]=3]="OctetString";t[t["BitString"]=4]="BitString";t[t["Integer"]=5]="Integer";t[t["Enumerated"]=6]="Enumerated";t[t["ObjectIdentifier"]=7]="ObjectIdentifier";t[t["Utf8String"]=8]="Utf8String";t[t["BmpString"]=9]="BmpString";t[t["UniversalString"]=10]="UniversalString";t[t["NumericString"]=11]="NumericString";t[t["PrintableString"]=12]="PrintableString";t[t["TeletexString"]=13]="TeletexString";t[t["VideotexString"]=14]="VideotexString";t[t["IA5String"]=15]="IA5String";t[t["GraphicString"]=16]="GraphicString";t[t["VisibleString"]=17]="VisibleString";t[t["GeneralString"]=18]="GeneralString";t[t["CharacterString"]=19]="CharacterString";t[t["UTCTime"]=20]="UTCTime";t[t["GeneralizedTime"]=21]="GeneralizedTime";t[t["DATE"]=22]="DATE";t[t["TimeOfDay"]=23]="TimeOfDay";t[t["DateTime"]=24]="DateTime";t[t["Duration"]=25]="Duration";t[t["TIME"]=26]="TIME";t[t["Null"]=27]="Null"})(Ke||t("bu",Ke={}));var je=function(){function t(t,e){if(e===void 0){e=0}this.unusedBits=0;this.value=new ArrayBuffer(0);if(t){if(typeof t==="number"){this.fromNumber(t)}else if(u.BufferSourceConverter.isBufferSource(t)){this.unusedBits=e;this.value=u.BufferSourceConverter.toArrayBuffer(t)}else{throw TypeError("Unsupported type of 'params' argument for BitString")}}}t.prototype.fromASN=function(t){if(!(t instanceof St)){throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString")}this.unusedBits=t.valueBlock.unusedBits;this.value=t.valueBlock.valueHex;return this};t.prototype.toASN=function(){return new St({unusedBits:this.unusedBits,valueHex:this.value})};t.prototype.toSchema=function(t){return new St({name:t})};t.prototype.toNumber=function(){var t="";var e=new Uint8Array(this.value);for(var i=0,r=e;i<r.length;i++){var n=r[i];t+=n.toString(2).padStart(8,"0")}t=t.split("").reverse().join("");if(this.unusedBits){t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")}return parseInt(t,2)};t.prototype.fromNumber=function(t){var e=t.toString(2);var i=e.length+7>>3;this.unusedBits=(i<<3)-e.length;var r=new Uint8Array(i);e=e.padStart(i<<3,"0").split("").reverse().join("");var n=0;while(n<i){r[n]=parseInt(e.slice(n<<3,(n<<3)+8),2);n++}this.value=r.buffer};return t}();var He=function(){function t(t){if(typeof t==="number"){this.buffer=new ArrayBuffer(t)}else{if(u.BufferSourceConverter.isBufferSource(t)){this.buffer=u.BufferSourceConverter.toArrayBuffer(t)}else if(Array.isArray(t)){this.buffer=new Uint8Array(t)}else{this.buffer=new ArrayBuffer(0)}}}Object.defineProperty(t.prototype,"byteLength",{get:function(){return this.buffer.byteLength},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"byteOffset",{get:function(){return 0},enumerable:false,configurable:true});t.prototype.fromASN=function(t){if(!(t instanceof lt)){throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString")}this.buffer=t.valueBlock.valueHex;return this};t.prototype.toASN=function(){return new lt({valueHex:this.buffer})};t.prototype.toSchema=function(t){return new lt({name:t})};return t}();t("a0",He);var Ue={fromASN:function(t){return t instanceof ut?null:t.valueBeforeDecodeView},toASN:function(t){if(t===null){return new ut}var e=J(t);if(e.result.error){throw new Error(e.result.error)}return e.result}};var Fe={fromASN:function(t){return t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec},toASN:function(t){return new bt({value:+t})}};var Le={fromASN:function(t){return t.valueBlock.valueDec},toASN:function(t){return new Pt({value:t})}};var Ve=t("bA",{fromASN:function(t){return t.valueBlock.valueHexView},toASN:function(t){return new bt({valueHex:t})}});var Ge={fromASN:function(t){return t.valueBlock.valueHexView},toASN:function(t){return new St({valueHex:t})}};var We={fromASN:function(t){return t.valueBlock.toString()},toASN:function(t){return new xt({value:t})}};var Qe={fromASN:function(t){return t.valueBlock.value},toASN:function(t){return new vt({value:t})}};var qe={fromASN:function(t){return t.valueBlock.valueHexView},toASN:function(t){return new lt({valueHex:t})}};var ze={fromASN:function(t){return new He(t.getValue())},toASN:function(t){return t.toASN()}};function Ye(t){return{fromASN:function(t){return t.valueBlock.value},toASN:function(e){return new t({value:e})}}}var Ze=Ye(Gt);var $e=Ye(qt);var Xe=Ye(Zt);var Je=Ye(Xt);var ti=Ye(te);var ei=Ye(ie);var ii=Ye(ne);var ri=Ye(oe);var ni=Ye(ue);var ai=Ye(fe);var oi=Ye(he);var si=Ye(le);var ui={fromASN:function(t){return t.toDate()},toASN:function(t){return new ye({valueDate:t})}};var ci={fromASN:function(t){return t.toDate()},toASN:function(t){return new Ae({valueDate:t})}};var fi={fromASN:function(){return null},toASN:function(){return new ut}};function vi(t){switch(t){case Ke.Any:return Ue;case Ke.BitString:return Ge;case Ke.BmpString:return $e;case Ke.Boolean:return Qe;case Ke.CharacterString:return si;case Ke.Enumerated:return Le;case Ke.GeneralString:return oi;case Ke.GeneralizedTime:return ci;case Ke.GraphicString:return ni;case Ke.IA5String:return ri;case Ke.Integer:return Fe;case Ke.Null:return fi;case Ke.NumericString:return Je;case Ke.ObjectIdentifier:return We;case Ke.OctetString:return qe;case Ke.PrintableString:return ti;case Ke.TeletexString:return ei;case Ke.UTCTime:return ui;case Ke.UniversalString:return Xe;case Ke.Utf8String:return Ze;case Ke.VideotexString:return ii;case Ke.VisibleString:return ai;default:return null}}function hi(t){if(typeof t==="function"&&t.prototype){if(t.prototype.toASN&&t.prototype.fromASN){return true}else{return hi(t.prototype)}}else{return!!(t&&typeof t==="object"&&"toASN"in t&&"fromASN"in t)}}function di(t){var e;if(t){var i=Object.getPrototypeOf(t);if(((e=i===null||i===void 0?void 0:i.prototype)===null||e===void 0?void 0:e.constructor)===Array){return true}return di(i)}return false}function li(t,e){if(!(t&&e)){return false}if(t.byteLength!==e.byteLength){return false}var i=new Uint8Array(t);var r=new Uint8Array(e);for(var n=0;n<t.byteLength;n++){if(i[n]!==r[n]){return false}}return true}var pi=function(){function t(){this.items=new WeakMap}t.prototype.has=function(t){return this.items.has(t)};t.prototype.get=function(t,e){if(e===void 0){e=false}var i=this.items.get(t);if(!i){throw new Error("Cannot get schema for '".concat(t.prototype.constructor.name,"' target"))}if(e&&!i.schema){throw new Error("Schema '".concat(t.prototype.constructor.name,"' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'."))}return i};t.prototype.cache=function(t){var e=this.get(t);if(!e.schema){e.schema=this.create(t,true)}};t.prototype.createDefault=function(t){var e={type:Ne.Sequence,items:{}};var i=this.findParentSchema(t);if(i){Object.assign(e,i);e.items=Object.assign({},e.items,i.items)}return e};t.prototype.create=function(t,e){var i=this.items.get(t)||this.createDefault(t);var r=[];for(var n in i.items){var a=i.items[n];var o=e?n:"";var s=void 0;if(typeof a.type==="number"){var u=Ke[a.type];var c=Re[u];if(!c){throw new Error("Cannot get ASN1 class by name '".concat(u,"'"))}s=new c({name:o})}else if(hi(a.type)){var f=new a.type;s=f.toSchema(o)}else if(a.optional){var v=this.get(a.type);if(v.type===Ne.Choice){s=new Be({name:o})}else{s=this.create(a.type,false);s.name=o}}else{s=new Be({name:o})}var h=!!a.optional||a.defaultValue!==undefined;if(a.repeated){s.name="";var d=a.repeated==="set"?jt:Nt;s=new d({name:"",value:[new Te({name:o,value:s})]})}if(a.context!==null&&a.context!==undefined){if(a.implicit){if(typeof a.type==="number"||hi(a.type)){var d=a.repeated?rt:Z;r.push(new d({name:o,optional:h,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);var l=!!a.repeated;var p=!l?this.get(a.type,true).schema:s;p="valueBlock"in p?p.valueBlock.value:p.value;r.push(new rt({name:!l?o:"",optional:h,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}}else{r.push(new rt({optional:h,idBlock:{tagClass:3,tagNumber:a.context},value:[s]}))}}else{s.optional=h;r.push(s)}}switch(i.type){case Ne.Sequence:return new Nt({value:r,name:""});case Ne.Set:return new jt({value:r,name:""});case Ne.Choice:return new xe({value:r,name:""});default:throw new Error("Unsupported ASN1 type in use")}};t.prototype.set=function(t,e){this.items.set(t,e);return this};t.prototype.findParentSchema=function(t){var e=Object.getPrototypeOf(t);if(e){var i=this.items.get(e);return i||this.findParentSchema(e)}return null};return t}();var yi=new pi;var Si=t("bv",(function(t){return function(e){var i;if(!yi.has(e)){i=yi.createDefault(e);yi.set(e,i)}else{i=yi.get(e)}Object.assign(i,t)}}));var Ai=t("bt",(function(t){return function(e,i){var r;if(!yi.has(e.constructor)){r=yi.createDefault(e.constructor);yi.set(e.constructor,r)}else{r=yi.get(e.constructor)}var n=Object.assign({},t);if(typeof n.type==="number"&&!n.converter){var a=vi(t.type);if(!a){throw new Error("Cannot get default converter for property '".concat(i,"' of ").concat(e.constructor.name))}n.converter=a}r.items[i]=n}}));var Ci=function(t){__extends(e,t);function e(){var e=t.apply(this,arguments)||this;e.schemas=[];return e}return e}(Error);var mi=function(){function t(){}t.parse=function(t,e){var i=J(t);if(i.result.error){throw new Error(i.result.error)}var r=this.fromASN(i.result,e);return r};t.fromASN=function(t,e){try{if(hi(e)){var i=new e;return i.fromASN(t)}var r=yi.get(e);yi.cache(e);var n=r.schema;var a=this.handleChoiceTypes(t,r,e,n);if(a===null||a===void 0?void 0:a.result){return a.result}if(a===null||a===void 0?void 0:a.targetSchema){n=a.targetSchema}var o=this.handleSequenceTypes(t,r,e,n);if(o&&"isManualMapping"in o){return o.result}var s=o;var u=new e;if(di(e)){return this.handleArrayTypes(t,r,e)}this.processSchemaItems(r,s,u);return u}catch(t){if(t instanceof Ci){t.schemas.push(e.name)}throw t}};t.handleChoiceTypes=function(t,e,i,r){if(t.constructor===rt&&e.type===Ne.Choice&&t.idBlock.tagClass===3){for(var n in e.items){var a=e.items[n];if(a.context===t.idBlock.tagNumber&&a.implicit){if(typeof a.type==="function"&&yi.has(a.type)){var o=yi.get(a.type);if(o&&o.type===Ne.Sequence){var s=new Nt;if("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&"value"in s.valueBlock){s.valueBlock.value=t.valueBlock.value;var u=this.fromASN(s,a.type);var c=new i;c[n]=u;return{result:c}}}}}}}else if(t.constructor===rt&&e.type!==Ne.Choice){var f=new rt({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:e.schema.valueBlock.value});for(var n in e.items){delete t[n]}return{targetSchema:f}}return null};t.handleSequenceTypes=function(t,e,i,r){if(e.type===Ne.Sequence){var n=Object.keys(e.items).filter((function(t){var i=e.items[t];return i.optional&&typeof i.type==="function"&&yi.has(i.type)&&yi.get(i.type).type===Ne.Choice}));if(n.length>0&&"value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&i.name==="CertReqMsg"){return this.handleManualMapping(t,e,i)}var a=ke({},t,r);if(!a.verified){throw new Ci("Data does not match to ".concat(i.name," ASN1 schema. ").concat(a.result.error))}return a}else{var a=ke({},t,r);if(!a.verified){throw new Ci("Data does not match to ".concat(i.name," ASN1 schema. ").concat(a.result.error))}return a}};t.handleManualMapping=function(t,e,i){var r=new i;var n=t.valueBlock.value;var a=Object.keys(e.items);var o=0;for(var s=0;s<a.length;s++){var u=a[s];var c=e.items[u];if(o>=n.length)break;if(c.repeated){r[u]=this.processRepeatedField(n,o,c);break}else if(typeof c.type==="number"){r[u]=this.processPrimitiveField(n[o],c);o++}else if(this.isOptionalChoiceField(c)){var f=this.processOptionalChoiceField(n[o],c);if(f.processed){r[u]=f.value;o++}}else{r[u]=this.fromASN(n[o],c.type);o++}}return{result:r,verified:true,isManualMapping:true}};t.processRepeatedField=function(t,e,i){var r=this;var n=t.slice(e);if(n.length===1&&n[0].constructor.name==="Sequence"){var a=n[0];if(a.valueBlock&&a.valueBlock.value&&Array.isArray(a.valueBlock.value)){n=a.valueBlock.value}}if(typeof i.type==="number"){var o=vi(i.type);if(!o)throw new Error("No converter for ASN.1 type ".concat(i.type));return n.filter((function(t){return t&&t.valueBlock})).map((function(t){try{return o.fromASN(t)}catch(t){return undefined}})).filter((function(t){return t!==undefined}))}else{return n.filter((function(t){return t&&t.valueBlock})).map((function(t){try{return r.fromASN(t,i.type)}catch(t){return undefined}})).filter((function(t){return t!==undefined}))}};t.processPrimitiveField=function(t,e){var i=vi(e.type);if(!i)throw new Error("No converter for ASN.1 type ".concat(e.type));return i.fromASN(t)};t.isOptionalChoiceField=function(t){return t.optional&&typeof t.type==="function"&&yi.has(t.type)&&yi.get(t.type).type===Ne.Choice};t.processOptionalChoiceField=function(t,e){try{var i=this.fromASN(t,e.type);return{processed:true,value:i}}catch(t){if(t instanceof Ci&&/Wrong values for Choice type/.test(t.message)){return{processed:false}}throw t}};t.handleArrayTypes=function(t,e,i){var r=this;if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}var n=e.itemType;if(typeof n==="number"){var a=vi(n);if(!a){throw new Error("Cannot get default converter for array item of ".concat(i.name," ASN1 schema"))}return i.from(t.valueBlock.value,(function(t){return a.fromASN(t)}))}else{return i.from(t.valueBlock.value,(function(t){return r.fromASN(t,n)}))}};t.processSchemaItems=function(t,e,i){for(var r in t.items){var n=e.result[r];if(!n){continue}var a=t.items[r];var o=a.type;if(typeof o==="number"||hi(o)){i[r]=this.processPrimitiveSchemaItem(n,a,o)}else{i[r]=this.processComplexSchemaItem(n,a,o)}}};t.processPrimitiveSchemaItem=function(t,e,i){var r;var n=(r=e.converter)!==null&&r!==void 0?r:hi(i)?new i:null;if(!n){throw new Error("Converter is empty")}if(e.repeated){return this.processRepeatedPrimitiveItem(t,e,n)}else{return this.processSinglePrimitiveItem(t,e,i,n)}};t.processRepeatedPrimitiveItem=function(t,e,i){if(e.implicit){var r=e.repeated==="sequence"?Nt:jt;var n=new r;n.valueBlock=t.valueBlock;var a=J(n.toBER(false));if(a.offset===-1){throw new Error("Cannot parse the child item. ".concat(a.result.error))}if(!("value"in a.result.valueBlock&&Array.isArray(a.result.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}var o=a.result.valueBlock.value;return Array.from(o,(function(t){return i.fromASN(t)}))}else{return Array.from(t,(function(t){return i.fromASN(t)}))}};t.processSinglePrimitiveItem=function(t,e,i,r){var n=t;if(e.implicit){var a=void 0;if(hi(i)){a=(new i).toSchema("")}else{var o=Ke[i];var s=Re[o];if(!s){throw new Error("Cannot get '".concat(o,"' class from asn1js module"))}a=new s}a.valueBlock=n.valueBlock;n=J(a.toBER(false)).result}return r.fromASN(n)};t.processComplexSchemaItem=function(t,e,i){var r=this;if(e.repeated){if(!Array.isArray(t)){throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.")}return Array.from(t,(function(t){return r.fromASN(t,i)}))}else{var n=this.handleImplicitTagging(t,e,i);if(this.isOptionalChoiceField(e)){try{return this.fromASN(n,i)}catch(t){if(t instanceof Ci&&/Wrong values for Choice type/.test(t.message)){return undefined}throw t}}else{return this.fromASN(n,i)}}};t.handleImplicitTagging=function(t,e,i){if(e.implicit&&typeof e.context==="number"){var r=yi.get(i);if(r.type===Ne.Sequence){var n=new Nt;if("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&"value"in n.valueBlock){n.valueBlock.value=t.valueBlock.value;return n}}else if(r.type===Ne.Set){var a=new jt;if("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&"value"in a.valueBlock){a.valueBlock.value=t.valueBlock.value;return a}}}return t};return t}();t("q",mi);var gi=function(){function t(){}t.serialize=function(t){if(t instanceof W){return t.toBER(false)}return this.toASN(t).toBER(false)};t.toASN=function(e){var i=this;if(e&&typeof e==="object"&&hi(e)){return e.toASN()}if(!(e&&typeof e==="object")){throw new TypeError("Parameter 1 should be type of Object.")}var r=e.constructor;var n=yi.get(r);yi.cache(r);var a=[];if(n.itemType){if(!Array.isArray(e)){throw new TypeError("Parameter 1 should be type of Array.")}if(typeof n.itemType==="number"){var o=vi(n.itemType);if(!o){throw new Error("Cannot get default converter for array item of ".concat(r.name," ASN1 schema"))}a=e.map((function(t){return o.toASN(t)}))}else{a=e.map((function(t){return i.toAsnItem({type:n.itemType},"[]",r,t)}))}}else{for(var s in n.items){var u=n.items[s];var c=e[s];if(c===undefined||u.defaultValue===c||typeof u.defaultValue==="object"&&typeof c==="object"&&li(this.serialize(u.defaultValue),this.serialize(c))){continue}var f=t.toAsnItem(u,s,r,c);if(typeof u.context==="number"){if(u.implicit){if(!u.repeated&&(typeof u.type==="number"||hi(u.type))){var v={};v.valueHex=f instanceof ut?f.valueBeforeDecodeView:f.valueBlock.toBER();a.push(new Z(__assign({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context}},v)))}else{a.push(new rt({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:f.valueBlock.value}))}}else{a.push(new rt({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:[f]}))}}else if(u.repeated){a=a.concat(f)}else{a.push(f)}}}var h;switch(n.type){case Ne.Sequence:h=new Nt({value:a});break;case Ne.Set:h=new jt({value:a});break;case Ne.Choice:if(!a[0]){throw new Error("Schema '".concat(r.name,"' has wrong data. Choice cannot be empty."))}h=a[0];break}return h};t.toAsnItem=function(t,e,i,r){var n=this;var a;if(typeof t.type==="number"){var o=t.converter;if(!o){throw new Error("Property '".concat(e,"' doesn't have converter for type ").concat(Ke[t.type]," in schema '").concat(i.name,"'"))}if(t.repeated){if(!Array.isArray(r)){throw new TypeError("Parameter 'objProp' should be type of Array.")}var s=Array.from(r,(function(t){return o.toASN(t)}));var u=t.repeated==="sequence"?Nt:jt;a=new u({value:s})}else{a=o.toASN(r)}}else{if(t.repeated){if(!Array.isArray(r)){throw new TypeError("Parameter 'objProp' should be type of Array.")}var s=Array.from(r,(function(t){return n.toASN(t)}));var u=t.repeated==="sequence"?Nt:jt;a=new u({value:s})}else{a=this.toASN(r)}}return a};return t}();var wi=function(t){__extends(e,t);function e(e){if(e===void 0){e=[]}var i=this;if(typeof e==="number"){i=t.call(this,e)||this}else{i=t.call(this)||this;for(var r=0,n=e;r<n.length;r++){var a=n[r];i.push(a)}}return i}return e}(Array);t("bx",wi);var _i=function(){function t(){}t.serialize=function(t){return gi.serialize(t)};t.parse=function(t,e){return mi.parse(t,e)};t.toString=function(e){var i=u.BufferSourceConverter.isBufferSource(e)?u.BufferSourceConverter.toArrayBuffer(e):t.serialize(e);var r=J(i);if(r.offset===-1){throw new Error("Cannot decode ASN.1 data. ".concat(r.result.error))}return r.result.toString()};return t}();t("e",_i);function bi(t,e,i,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(t,e,i,r);else for(var s=t.length-1;s>=0;s--)if(o=t[s])a=(n<3?o(a):n>3?o(e,i,a):o(e,i))||a;return n>3&&a&&Object.defineProperty(e,i,a),a}typeof SuppressedError==="function"?SuppressedError:function(t,e,i){var r=new Error(i);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};var Ei=function(){function t(){}t.isIPv4=function(t){return/^(\d{1,3}\.){3}\d{1,3}$/.test(t)};t.parseIPv4=function(t){var e=t.split(".");if(e.length!==4){throw new Error("Invalid IPv4 address")}return e.map((function(t){var e=parseInt(t,10);if(isNaN(e)||e<0||e>255){throw new Error("Invalid IPv4 address part")}return e}))};t.parseIPv6=function(t){var e=this.expandIPv6(t);var i=e.split(":");if(i.length!==8){throw new Error("Invalid IPv6 address")}return i.reduce((function(t,e){var i=parseInt(e,16);if(isNaN(i)||i<0||i>65535){throw new Error("Invalid IPv6 address part")}t.push(i>>8&255);t.push(i&255);return t}),[])};t.expandIPv6=function(t){if(!t.includes("::")){return t}var e=t.split("::");if(e.length>2){throw new Error("Invalid IPv6 address")}var i=e[0]?e[0].split(":"):[];var r=e[1]?e[1].split(":"):[];var n=8-(i.length+r.length);if(n<0){throw new Error("Invalid IPv6 address")}return __spreadArray(__spreadArray(__spreadArray([],i,true),Array(n).fill("0"),true),r,true).join(":")};t.formatIPv6=function(t){var e=[];for(var i=0;i<16;i+=2){e.push((t[i]<<8|t[i+1]).toString(16))}return this.compressIPv6(e.join(":"))};t.compressIPv6=function(t){var e=t.split(":");var i=-1;var r=0;var n=-1;var a=0;for(var o=0;o<e.length;o++){if(e[o]==="0"){if(n===-1){n=o}a++}else{if(a>r){i=n;r=a}n=-1;a=0}}if(a>r){i=n;r=a}if(r>1){var s=e.slice(0,i).join(":");var u=e.slice(i+r).join(":");return"".concat(s,"::").concat(u)}return t};t.parseCIDR=function(t){var e=t.split("/"),i=e[0],r=e[1];var n=parseInt(r,10);if(this.isIPv4(i)){if(n<0||n>32){throw new Error("Invalid IPv4 prefix length")}return[this.parseIPv4(i),n]}else{if(n<0||n>128){throw new Error("Invalid IPv6 prefix length")}return[this.parseIPv6(i),n]}};t.decodeIP=function(t){if(t.length===64&&parseInt(t,16)===0){return"::/0"}if(t.length!==16){return t}var e=parseInt(t.slice(8),16).toString(2).split("").reduce((function(t,e){return t+ +e}),0);var i=t.slice(0,8).replace(/(.{2})/g,(function(t){return"".concat(parseInt(t,16),".")}));i=i.slice(0,-1);return"".concat(i,"/").concat(e)};t.toString=function(t){var e=new Uint8Array(t);if(e.length===4){return Array.from(e).join(".")}if(e.length===16){return this.formatIPv6(e)}if(e.length===8||e.length===32){var i=e.length/2;var r=e.slice(0,i);var n=e.slice(i);var a=e.every((function(t){return t===0}));if(a){return e.length===8?"0.0.0.0/0":"::/0"}var o=n.reduce((function(t,e){return t+(e.toString(2).match(/1/g)||[]).length}),0);if(e.length===8){var s=Array.from(r).join(".");return"".concat(s,"/").concat(o)}else{var s=this.formatIPv6(r);return"".concat(s,"/").concat(o)}}return this.decodeIP(u.Convert.ToHex(t))};t.fromString=function(t){if(t.includes("/")){var e=this.parseCIDR(t),i=e[0],r=e[1];var n=new Uint8Array(i.length);var a=r;for(var o=0;o<n.length;o++){if(a>=8){n[o]=255;a-=8}else if(a>0){n[o]=255<<8-a;a=0}}var s=new Uint8Array(i.length*2);s.set(i,0);s.set(n,i.length);return s.buffer}var u=this.isIPv4(t)?this.parseIPv4(t):this.parseIPv6(t);return new Uint8Array(u).buffer};return t}();var Pi,Di,Ii;var Bi=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}t.prototype.toString=function(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""};return t}();bi([Ai({type:Ke.TeletexString})],Bi.prototype,"teletexString",void 0);bi([Ai({type:Ke.PrintableString})],Bi.prototype,"printableString",void 0);bi([Ai({type:Ke.UniversalString})],Bi.prototype,"universalString",void 0);bi([Ai({type:Ke.Utf8String})],Bi.prototype,"utf8String",void 0);bi([Ai({type:Ke.BmpString})],Bi.prototype,"bmpString",void 0);Bi=bi([Si({type:Ne.Choice})],Bi);var xi=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;Object.assign(i,e);return i}e.prototype.toString=function(){return this.ia5String||(this.anyValue?u.Convert.ToHex(this.anyValue):t.prototype.toString.call(this))};return e}(Bi);bi([Ai({type:Ke.IA5String})],xi.prototype,"ia5String",void 0);bi([Ai({type:Ke.Any})],xi.prototype,"anyValue",void 0);xi=bi([Si({type:Ne.Choice})],xi);var Ti=function(){function t(t){if(t===void 0){t={}}this.type="";this.value=new xi;Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Ti.prototype,"type",void 0);bi([Ai({type:xi})],Ti.prototype,"value",void 0);var Oi=Pi=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Pi.prototype);return i}return e}(wi);Oi=Pi=bi([Si({type:Ne.Set,itemType:Ti})],Oi);var ki=Di=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Di.prototype);return i}return e}(wi);ki=Di=bi([Si({type:Ne.Sequence,itemType:Oi})],ki);var Mi=t("bn",Ii=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Ii.prototype);return i}return e}(ki));t("bn",Mi=Ii=bi([Si({type:Ne.Sequence})],Mi));var Ri={fromASN:function(t){return Ei.toString(qe.fromASN(t))},toASN:function(t){return qe.toASN(Ei.fromString(t))}};var Ni=function(){function t(t){if(t===void 0){t={}}this.typeId="";this.value=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("bo",Ni);bi([Ai({type:Ke.ObjectIdentifier})],Ni.prototype,"typeId",void 0);bi([Ai({type:Ke.Any,context:0})],Ni.prototype,"value",void 0);var Ki=function(){function t(t){if(t===void 0){t={}}this.partyName=new Bi;Object.assign(this,t)}return t}();t("br",Ki);bi([Ai({type:Bi,optional:true,context:0,implicit:true})],Ki.prototype,"nameAssigner",void 0);bi([Ai({type:Bi,context:1,implicit:true})],Ki.prototype,"partyName",void 0);var ji=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ni,context:0,implicit:true})],ji.prototype,"otherName",void 0);bi([Ai({type:Ke.IA5String,context:1,implicit:true})],ji.prototype,"rfc822Name",void 0);bi([Ai({type:Ke.IA5String,context:2,implicit:true})],ji.prototype,"dNSName",void 0);bi([Ai({type:Ke.Any,context:3,implicit:true})],ji.prototype,"x400Address",void 0);bi([Ai({type:Mi,context:4,implicit:false})],ji.prototype,"directoryName",void 0);bi([Ai({type:Ki,context:5})],ji.prototype,"ediPartyName",void 0);bi([Ai({type:Ke.IA5String,context:6,implicit:true})],ji.prototype,"uniformResourceIdentifier",void 0);bi([Ai({type:Ke.OctetString,context:7,implicit:true,converter:Ri})],ji.prototype,"iPAddress",void 0);bi([Ai({type:Ke.ObjectIdentifier,context:8,implicit:true})],ji.prototype,"registeredID",void 0);ji=bi([Si({type:Ne.Choice})],ji);var Hi="1.3.6.1.5.5.7";var Ui="".concat(Hi,".1");var Fi="2.5.29";var Li;var Vi=t("bg","".concat(Ui,".1"));var Gi=function(){function t(t){if(t===void 0){t={}}this.accessMethod="";this.accessLocation=new ji;Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Gi.prototype,"accessMethod",void 0);bi([Ai({type:ji})],Gi.prototype,"accessLocation",void 0);var Wi=t("aG",Li=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Li.prototype);return i}return e}(wi));t("aG",Wi=Li=bi([Si({type:Ne.Sequence,itemType:Gi})],Wi));var Qi=t("bf","".concat(Fi,".35"));var qi=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(He);var zi=function(){function t(t){if(t===void 0){t={}}if(t){Object.assign(this,t)}}return t}();t("aF",zi);bi([Ai({type:qi,context:0,optional:true,implicit:true})],zi.prototype,"keyIdentifier",void 0);bi([Ai({type:ji,context:1,optional:true,implicit:true,repeated:"sequence"})],zi.prototype,"authorityCertIssuer",void 0);bi([Ai({type:Ke.Integer,context:2,optional:true,implicit:true,converter:Ve})],zi.prototype,"authorityCertSerialNumber",void 0);var Yi=t("be","".concat(Fi,".19"));var Zi=function(){function t(t){if(t===void 0){t={}}this.cA=false;Object.assign(this,t)}return t}();t("aE",Zi);bi([Ai({type:Ke.Boolean,defaultValue:false})],Zi.prototype,"cA",void 0);bi([Ai({type:Ke.Integer,optional:true})],Zi.prototype,"pathLenConstraint",void 0);var $i;var Xi=$i=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,$i.prototype);return i}return e}(wi);Xi=$i=bi([Si({type:Ne.Sequence,itemType:ji})],Xi);var Ji;var tr=t("bd","".concat(Fi,".29"));var er=t("aD",Ji=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Ji.prototype);return i}return e}(Xi));t("aD",er=Ji=bi([Si({type:Ne.Sequence})],er));var ir;var rr=t("bc","".concat(Fi,".32"));var nr=t("bp",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}t.prototype.toString=function(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""};return t}());bi([Ai({type:Ke.IA5String})],nr.prototype,"ia5String",void 0);bi([Ai({type:Ke.VisibleString})],nr.prototype,"visibleString",void 0);bi([Ai({type:Ke.BmpString})],nr.prototype,"bmpString",void 0);bi([Ai({type:Ke.Utf8String})],nr.prototype,"utf8String",void 0);t("bp",nr=bi([Si({type:Ne.Choice})],nr));var ar=function(){function t(t){if(t===void 0){t={}}this.organization=new nr;this.noticeNumbers=[];Object.assign(this,t)}return t}();bi([Ai({type:nr})],ar.prototype,"organization",void 0);bi([Ai({type:Ke.Integer,repeated:"sequence"})],ar.prototype,"noticeNumbers",void 0);var or=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("bq",or);bi([Ai({type:ar,optional:true})],or.prototype,"noticeRef",void 0);bi([Ai({type:nr,optional:true})],or.prototype,"explicitText",void 0);var sr=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.IA5String})],sr.prototype,"cPSuri",void 0);bi([Ai({type:or})],sr.prototype,"userNotice",void 0);sr=bi([Si({type:Ne.Choice})],sr);var ur=function(){function t(t){if(t===void 0){t={}}this.policyQualifierId="";this.qualifier=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],ur.prototype,"policyQualifierId",void 0);bi([Ai({type:Ke.Any})],ur.prototype,"qualifier",void 0);var cr=function(){function t(t){if(t===void 0){t={}}this.policyIdentifier="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],cr.prototype,"policyIdentifier",void 0);bi([Ai({type:ur,repeated:"sequence",optional:true})],cr.prototype,"policyQualifiers",void 0);var fr=t("aC",ir=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ir.prototype);return i}return e}(wi));t("aC",fr=ir=bi([Si({type:Ne.Sequence,itemType:cr})],fr));var vr=t("aK","".concat(Fi,".20"));var hr=t("a7",function(){function t(t){if(t===void 0){t=0}this.value=t}return t}());bi([Ai({type:Ke.Integer})],hr.prototype,"value",void 0);t("a7",hr=bi([Si({type:Ne.Choice})],hr));var dr=t("aJ","".concat(Fi,".27"));var lr=t("a6",function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(hr));t("a6",lr=bi([Si({type:Ne.Choice})],lr));var pr;var yr=t("bb","".concat(Fi,".31"));var Sr;(function(t){t[t["unused"]=1]="unused";t[t["keyCompromise"]=2]="keyCompromise";t[t["cACompromise"]=4]="cACompromise";t[t["affiliationChanged"]=8]="affiliationChanged";t[t["superseded"]=16]="superseded";t[t["cessationOfOperation"]=32]="cessationOfOperation";t[t["certificateHold"]=64]="certificateHold";t[t["privilegeWithdrawn"]=128]="privilegeWithdrawn";t[t["aACompromise"]=256]="aACompromise"})(Sr||(Sr={}));var Ar=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.toJSON=function(){var t=[];var e=this.toNumber();if(e&Sr.aACompromise){t.push("aACompromise")}if(e&Sr.affiliationChanged){t.push("affiliationChanged")}if(e&Sr.cACompromise){t.push("cACompromise")}if(e&Sr.certificateHold){t.push("certificateHold")}if(e&Sr.cessationOfOperation){t.push("cessationOfOperation")}if(e&Sr.keyCompromise){t.push("keyCompromise")}if(e&Sr.privilegeWithdrawn){t.push("privilegeWithdrawn")}if(e&Sr.superseded){t.push("superseded")}if(e&Sr.unused){t.push("unused")}return t};e.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return e}(je);var Cr=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:ji,context:0,repeated:"sequence",implicit:true})],Cr.prototype,"fullName",void 0);bi([Ai({type:Oi,context:1,implicit:true})],Cr.prototype,"nameRelativeToCRLIssuer",void 0);Cr=bi([Si({type:Ne.Choice})],Cr);var mr=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Cr,context:0,optional:true})],mr.prototype,"distributionPoint",void 0);bi([Ai({type:Ar,context:1,optional:true,implicit:true})],mr.prototype,"reasons",void 0);bi([Ai({type:ji,context:2,optional:true,repeated:"sequence",implicit:true})],mr.prototype,"cRLIssuer",void 0);var gr=t("aB",pr=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,pr.prototype);return i}return e}(wi));t("aB",gr=pr=bi([Si({type:Ne.Sequence,itemType:mr})],gr));var wr;var _r=wr=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,wr.prototype);return i}return e}(gr);_r=wr=bi([Si({type:Ne.Sequence,itemType:mr})],_r);var br=t("ba","".concat(Fi,".28"));var Er=function(){function t(e){if(e===void 0){e={}}this.onlyContainsUserCerts=t.ONLY;this.onlyContainsCACerts=t.ONLY;this.indirectCRL=t.ONLY;this.onlyContainsAttributeCerts=t.ONLY;Object.assign(this,e)}return t}();t("aA",Er);Er.ONLY=false;bi([Ai({type:Cr,context:0,optional:true})],Er.prototype,"distributionPoint",void 0);bi([Ai({type:Ke.Boolean,context:1,defaultValue:Er.ONLY,implicit:true})],Er.prototype,"onlyContainsUserCerts",void 0);bi([Ai({type:Ke.Boolean,context:2,defaultValue:Er.ONLY,implicit:true})],Er.prototype,"onlyContainsCACerts",void 0);bi([Ai({type:Ar,context:3,optional:true,implicit:true})],Er.prototype,"onlySomeReasons",void 0);bi([Ai({type:Ke.Boolean,context:4,defaultValue:Er.ONLY,implicit:true})],Er.prototype,"indirectCRL",void 0);bi([Ai({type:Ke.Boolean,context:5,defaultValue:Er.ONLY,implicit:true})],Er.prototype,"onlyContainsAttributeCerts",void 0);var Pr=t("b9","".concat(Fi,".21"));var Dr;(function(t){t[t["unspecified"]=0]="unspecified";t[t["keyCompromise"]=1]="keyCompromise";t[t["cACompromise"]=2]="cACompromise";t[t["affiliationChanged"]=3]="affiliationChanged";t[t["superseded"]=4]="superseded";t[t["cessationOfOperation"]=5]="cessationOfOperation";t[t["certificateHold"]=6]="certificateHold";t[t["removeFromCRL"]=8]="removeFromCRL";t[t["privilegeWithdrawn"]=9]="privilegeWithdrawn";t[t["aACompromise"]=10]="aACompromise"})(Dr||(Dr={}));var Ir=t("az",function(){function t(t){if(t===void 0){t=Dr.unspecified}this.reason=Dr.unspecified;this.reason=t}t.prototype.toJSON=function(){return Dr[this.reason]};t.prototype.toString=function(){return this.toJSON()};return t}());bi([Ai({type:Ke.Enumerated})],Ir.prototype,"reason",void 0);t("az",Ir=bi([Si({type:Ne.Choice})],Ir));var Br;var xr=t("b8","".concat(Fi,".37"));var Tr=t("ay",Br=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Br.prototype);return i}return e}(wi));t("ay",Tr=Br=bi([Si({type:Ne.Sequence,itemType:Ke.ObjectIdentifier})],Tr));var Or=t("b7","".concat(Fi,".54"));var kr=t("ax",function(){function t(t){if(t===void 0){t=new ArrayBuffer(0)}this.value=t}return t}());bi([Ai({type:Ke.Integer,converter:Ve})],kr.prototype,"value",void 0);t("ax",kr=bi([Si({type:Ne.Choice})],kr));var Mr=t("b6","".concat(Fi,".24"));var Rr=t("aw",function(){function t(t){this.value=new Date;if(t){this.value=t}}return t}());bi([Ai({type:Ke.GeneralizedTime})],Rr.prototype,"value",void 0);t("aw",Rr=bi([Si({type:Ne.Choice})],Rr));var Nr;var Kr=t("b5","".concat(Fi,".18"));var jr=t("av",Nr=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Nr.prototype);return i}return e}(Xi));t("av",jr=Nr=bi([Si({type:Ne.Sequence})],jr));var Hr=t("b4","".concat(Fi,".15"));var Ur;(function(t){t[t["digitalSignature"]=1]="digitalSignature";t[t["nonRepudiation"]=2]="nonRepudiation";t[t["keyEncipherment"]=4]="keyEncipherment";t[t["dataEncipherment"]=8]="dataEncipherment";t[t["keyAgreement"]=16]="keyAgreement";t[t["keyCertSign"]=32]="keyCertSign";t[t["cRLSign"]=64]="cRLSign";t[t["encipherOnly"]=128]="encipherOnly";t[t["decipherOnly"]=256]="decipherOnly"})(Ur||(Ur={}));var Fr=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.toJSON=function(){var t=this.toNumber();var e=[];if(t&Ur.cRLSign){e.push("crlSign")}if(t&Ur.dataEncipherment){e.push("dataEncipherment")}if(t&Ur.decipherOnly){e.push("decipherOnly")}if(t&Ur.digitalSignature){e.push("digitalSignature")}if(t&Ur.encipherOnly){e.push("encipherOnly")}if(t&Ur.keyAgreement){e.push("keyAgreement")}if(t&Ur.keyCertSign){e.push("keyCertSign")}if(t&Ur.keyEncipherment){e.push("keyEncipherment")}if(t&Ur.nonRepudiation){e.push("nonRepudiation")}return e};e.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return e}(je);t("au",Fr);var Lr;var Vr=t("b3","".concat(Fi,".30"));var Gr=function(){function t(t){if(t===void 0){t={}}this.base=new ji;this.minimum=0;Object.assign(this,t)}return t}();bi([Ai({type:ji})],Gr.prototype,"base",void 0);bi([Ai({type:Ke.Integer,context:0,defaultValue:0,implicit:true})],Gr.prototype,"minimum",void 0);bi([Ai({type:Ke.Integer,context:1,optional:true,implicit:true})],Gr.prototype,"maximum",void 0);var Wr=Lr=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Lr.prototype);return i}return e}(wi);Wr=Lr=bi([Si({type:Ne.Sequence,itemType:Gr})],Wr);var Qr=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("at",Qr);bi([Ai({type:Wr,context:0,optional:true,implicit:true})],Qr.prototype,"permittedSubtrees",void 0);bi([Ai({type:Wr,context:1,optional:true,implicit:true})],Qr.prototype,"excludedSubtrees",void 0);var qr=t("b2","".concat(Fi,".36"));var zr=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("as",zr);bi([Ai({type:Ke.Integer,context:0,implicit:true,optional:true,converter:Ve})],zr.prototype,"requireExplicitPolicy",void 0);bi([Ai({type:Ke.Integer,context:1,implicit:true,optional:true,converter:Ve})],zr.prototype,"inhibitPolicyMapping",void 0);var Yr;var Zr=t("b1","".concat(Fi,".33"));var $r=function(){function t(t){if(t===void 0){t={}}this.issuerDomainPolicy="";this.subjectDomainPolicy="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],$r.prototype,"issuerDomainPolicy",void 0);bi([Ai({type:Ke.ObjectIdentifier})],$r.prototype,"subjectDomainPolicy",void 0);var Xr=t("ar",Yr=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Yr.prototype);return i}return e}(wi));t("ar",Xr=Yr=bi([Si({type:Ne.Sequence,itemType:$r})],Xr));var Jr;var tn=t("b0","".concat(Fi,".17"));var en=t("aq",Jr=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Jr.prototype);return i}return e}(Xi));t("aq",en=Jr=bi([Si({type:Ne.Sequence})],en));var rn=function(){function t(t){if(t===void 0){t={}}this.type="";this.values=[];Object.assign(this,t)}return t}();t("p",rn);bi([Ai({type:Ke.ObjectIdentifier})],rn.prototype,"type",void 0);bi([Ai({type:Ke.Any,repeated:"set"})],rn.prototype,"values",void 0);var nn;var an=t("a$","".concat(Fi,".9"));var on=t("ap",nn=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,nn.prototype);return i}return e}(wi));t("ap",on=nn=bi([Si({type:Ne.Sequence,itemType:rn})],on));var sn=t("a_","".concat(Fi,".14"));var un=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(qi);t("ao",un);var cn=t("aP","".concat(Fi,".16"));var fn=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("ad",fn);bi([Ai({type:Ke.GeneralizedTime,context:0,implicit:true,optional:true})],fn.prototype,"notBefore",void 0);bi([Ai({type:Ke.GeneralizedTime,context:1,implicit:true,optional:true})],fn.prototype,"notAfter",void 0);var vn=t("aO","1.2.840.113533.7.65.0");var hn;(function(t){t[t["keyUpdateAllowed"]=1]="keyUpdateAllowed";t[t["newExtensions"]=2]="newExtensions";t[t["pKIXCertificate"]=4]="pKIXCertificate"})(hn||(hn={}));var dn=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.toJSON=function(){var t=[];var e=this.toNumber();if(e&hn.pKIXCertificate){t.push("pKIXCertificate")}if(e&hn.newExtensions){t.push("newExtensions")}if(e&hn.keyUpdateAllowed){t.push("keyUpdateAllowed")}return t};e.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return e}(je);var ln=function(){function t(t){if(t===void 0){t={}}this.entrustVers="";this.entrustInfoFlags=new dn;Object.assign(this,t)}return t}();t("ac",ln);bi([Ai({type:Ke.GeneralString})],ln.prototype,"entrustVers",void 0);bi([Ai({type:dn})],ln.prototype,"entrustInfoFlags",void 0);var pn;var yn=t("aL","".concat(Ui,".11"));var Sn=t("a8",pn=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,pn.prototype);return i}return e}(wi));t("a8",Sn=pn=bi([Si({type:Ne.Sequence,itemType:Gi})],Sn));var An=function(){function t(t){if(t===void 0){t={}}this.algorithm="";Object.assign(this,t)}t.prototype.isEqual=function(e){return e instanceof t&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&u.isEqual(e.parameters,this.parameters)||e.parameters===this.parameters)};return t}();bi([Ai({type:Ke.ObjectIdentifier})],An.prototype,"algorithm",void 0);bi([Ai({type:Ke.Any,optional:true})],An.prototype,"parameters",void 0);var Cn=function(){function t(t){if(t===void 0){t={}}this.algorithm=new An;this.subjectPublicKey=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:An})],Cn.prototype,"algorithm",void 0);bi([Ai({type:Ke.BitString})],Cn.prototype,"subjectPublicKey",void 0);var mn=function(){function t(t){if(t){if(typeof t==="string"||typeof t==="number"||t instanceof Date){var e=new Date(t);if(e.getUTCFullYear()>2049){this.generalTime=e}else{this.utcTime=e}}else{Object.assign(this,t)}}}t.prototype.getTime=function(){var t=this.utcTime||this.generalTime;if(!t){throw new Error("Cannot get time from CHOICE object")}return t};return t}();bi([Ai({type:Ke.UTCTime})],mn.prototype,"utcTime",void 0);bi([Ai({type:Ke.GeneralizedTime})],mn.prototype,"generalTime",void 0);mn=bi([Si({type:Ne.Choice})],mn);var gn=function(){function t(t){this.notBefore=new mn(new Date);this.notAfter=new mn(new Date);if(t){this.notBefore=new mn(t.notBefore);this.notAfter=new mn(t.notAfter)}}return t}();bi([Ai({type:mn})],gn.prototype,"notBefore",void 0);bi([Ai({type:mn})],gn.prototype,"notAfter",void 0);var wn;var _n=function(){function t(e){if(e===void 0){e={}}this.extnID="";this.critical=t.CRITICAL;this.extnValue=new He;Object.assign(this,e)}return t}();t("a3",_n);_n.CRITICAL=false;bi([Ai({type:Ke.ObjectIdentifier})],_n.prototype,"extnID",void 0);bi([Ai({type:Ke.Boolean,defaultValue:_n.CRITICAL})],_n.prototype,"critical",void 0);bi([Ai({type:He})],_n.prototype,"extnValue",void 0);var bn=wn=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,wn.prototype);return i}return e}(wi);bn=wn=bi([Si({type:Ne.Sequence,itemType:_n})],bn);var En;(function(t){t[t["v1"]=0]="v1";t[t["v2"]=1]="v2";t[t["v3"]=2]="v3"})(En||(En={}));var Pn=function(){function t(t){if(t===void 0){t={}}this.version=En.v1;this.serialNumber=new ArrayBuffer(0);this.signature=new An;this.issuer=new Mi;this.validity=new gn;this.subject=new Mi;this.subjectPublicKeyInfo=new Cn;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,context:0,defaultValue:En.v1})],Pn.prototype,"version",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Pn.prototype,"serialNumber",void 0);bi([Ai({type:An})],Pn.prototype,"signature",void 0);bi([Ai({type:Mi})],Pn.prototype,"issuer",void 0);bi([Ai({type:gn})],Pn.prototype,"validity",void 0);bi([Ai({type:Mi})],Pn.prototype,"subject",void 0);bi([Ai({type:Cn})],Pn.prototype,"subjectPublicKeyInfo",void 0);bi([Ai({type:Ke.BitString,context:1,implicit:true,optional:true})],Pn.prototype,"issuerUniqueID",void 0);bi([Ai({type:Ke.BitString,context:2,implicit:true,optional:true})],Pn.prototype,"subjectUniqueID",void 0);bi([Ai({type:bn,context:3,optional:true})],Pn.prototype,"extensions",void 0);var Dn=function(){function t(t){if(t===void 0){t={}}this.tbsCertificate=new Pn;this.signatureAlgorithm=new An;this.signatureValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("C",Dn);bi([Ai({type:Pn})],Dn.prototype,"tbsCertificate",void 0);bi([Ai({type:An})],Dn.prototype,"signatureAlgorithm",void 0);bi([Ai({type:Ke.BitString})],Dn.prototype,"signatureValue",void 0);var In=function(){function t(t){if(t===void 0){t={}}this.userCertificate=new ArrayBuffer(0);this.revocationDate=new mn;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,converter:Ve})],In.prototype,"userCertificate",void 0);bi([Ai({type:mn})],In.prototype,"revocationDate",void 0);bi([Ai({type:_n,optional:true,repeated:"sequence"})],In.prototype,"crlEntryExtensions",void 0);var Bn=function(){function t(t){if(t===void 0){t={}}this.signature=new An;this.issuer=new Mi;this.thisUpdate=new mn;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,optional:true})],Bn.prototype,"version",void 0);bi([Ai({type:An})],Bn.prototype,"signature",void 0);bi([Ai({type:Mi})],Bn.prototype,"issuer",void 0);bi([Ai({type:mn})],Bn.prototype,"thisUpdate",void 0);bi([Ai({type:mn,optional:true})],Bn.prototype,"nextUpdate",void 0);bi([Ai({type:In,repeated:"sequence",optional:true})],Bn.prototype,"revokedCertificates",void 0);bi([Ai({type:_n,optional:true,context:0,repeated:"sequence"})],Bn.prototype,"crlExtensions",void 0);var xn=function(){function t(t){if(t===void 0){t={}}this.tbsCertList=new Bn;this.signatureAlgorithm=new An;this.signature=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("o",xn);bi([Ai({type:Bn})],xn.prototype,"tbsCertList",void 0);bi([Ai({type:An})],xn.prototype,"signatureAlgorithm",void 0);bi([Ai({type:Ke.BitString})],xn.prototype,"signature",void 0);var Tn=t("i","1.2.840.10045.2.1");var On="1.2.840.10045.4.1";var kn="1.2.840.10045.4.3.1";var Mn="1.2.840.10045.4.3.2";var Rn="1.2.840.10045.4.3.3";var Nn="1.2.840.10045.4.3.4";function Kn(t){return new An({algorithm:t})}Kn(On);Kn(kn);Kn(Mn);Kn(Rn);Kn(Nn);var jn=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],jn.prototype,"fieldType",void 0);bi([Ai({type:Ke.Any})],jn.prototype,"parameters",void 0);jn=bi([Si({type:Ne.Sequence})],jn);var Hn=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(He);var Un=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.OctetString})],Un.prototype,"a",void 0);bi([Ai({type:Ke.OctetString})],Un.prototype,"b",void 0);bi([Ai({type:Ke.BitString,optional:true})],Un.prototype,"seed",void 0);Un=bi([Si({type:Ne.Sequence})],Un);var Fn;(function(t){t[t["ecpVer1"]=1]="ecpVer1"})(Fn||(Fn={}));var Ln=function(){function t(t){if(t===void 0){t={}}this.version=Fn.ecpVer1;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Ln.prototype,"version",void 0);bi([Ai({type:jn})],Ln.prototype,"fieldID",void 0);bi([Ai({type:Un})],Ln.prototype,"curve",void 0);bi([Ai({type:Hn})],Ln.prototype,"base",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Ln.prototype,"order",void 0);bi([Ai({type:Ke.Integer,optional:true})],Ln.prototype,"cofactor",void 0);Ln=bi([Si({type:Ne.Sequence})],Ln);var Vn=t("E",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:Ke.ObjectIdentifier})],Vn.prototype,"namedCurve",void 0);bi([Ai({type:Ke.Null})],Vn.prototype,"implicitCurve",void 0);bi([Ai({type:Ln})],Vn.prototype,"specifiedCurve",void 0);t("E",Vn=bi([Si({type:Ne.Choice})],Vn));var Gn=function(){function t(t){if(t===void 0){t={}}this.version=1;this.privateKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Gn.prototype,"version",void 0);bi([Ai({type:He})],Gn.prototype,"privateKey",void 0);bi([Ai({type:Vn,context:0,optional:true})],Gn.prototype,"parameters",void 0);bi([Ai({type:Ke.BitString,context:1,optional:true})],Gn.prototype,"publicKey",void 0);var Wn=function(){function t(t){if(t===void 0){t={}}this.r=new ArrayBuffer(0);this.s=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,converter:Ve})],Wn.prototype,"r",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Wn.prototype,"s",void 0);var Qn="1.2.840.113549.1.1";var qn=t("f","".concat(Qn,".1"));var zn="".concat(Qn,".7");var Yn="".concat(Qn,".9");var Zn="".concat(Qn,".10");var $n="".concat(Qn,".2");var Xn="".concat(Qn,".4");var Jn="".concat(Qn,".5");var ta="".concat(Qn,".12");var ea="".concat(Qn,".13");var ia="".concat(Qn,".15");var ra="".concat(Qn,".16");var na="1.3.14.3.2.26";var aa="2.16.840.1.101.3.4.2.4";var oa="2.16.840.1.101.3.4.2.1";var sa="2.16.840.1.101.3.4.2.2";var ua="2.16.840.1.101.3.4.2.3";var ca="2.16.840.1.101.3.4.2.5";var fa="2.16.840.1.101.3.4.2.6";var va="1.2.840.113549.2.2";var ha="1.2.840.113549.2.5";var da="".concat(Qn,".8");function la(t){return new An({algorithm:t,parameters:null})}la(va);la(ha);var pa=la(na);la(aa);la(oa);la(sa);la(ua);la(ca);la(fa);var ya=new An({algorithm:da,parameters:_i.serialize(pa)});var Sa=new An({algorithm:Yn,parameters:_i.serialize(qe.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});la(qn);la($n);la(Xn);la(Jn);la(ia);la(ra);la(ta);la(ea);la(ia);la(ra);var Aa=function(){function t(t){if(t===void 0){t={}}this.hashAlgorithm=new An(pa);this.maskGenAlgorithm=new An({algorithm:da,parameters:_i.serialize(pa)});this.pSourceAlgorithm=new An(Sa);Object.assign(this,t)}return t}();bi([Ai({type:An,context:0,defaultValue:pa})],Aa.prototype,"hashAlgorithm",void 0);bi([Ai({type:An,context:1,defaultValue:ya})],Aa.prototype,"maskGenAlgorithm",void 0);bi([Ai({type:An,context:2,defaultValue:Sa})],Aa.prototype,"pSourceAlgorithm",void 0);new An({algorithm:zn,parameters:_i.serialize(new Aa)});var Ca=function(){function t(t){if(t===void 0){t={}}this.hashAlgorithm=new An(pa);this.maskGenAlgorithm=new An({algorithm:da,parameters:_i.serialize(pa)});this.saltLength=20;this.trailerField=1;Object.assign(this,t)}return t}();bi([Ai({type:An,context:0,defaultValue:pa})],Ca.prototype,"hashAlgorithm",void 0);bi([Ai({type:An,context:1,defaultValue:ya})],Ca.prototype,"maskGenAlgorithm",void 0);bi([Ai({type:Ke.Integer,context:2,defaultValue:20})],Ca.prototype,"saltLength",void 0);bi([Ai({type:Ke.Integer,context:3,defaultValue:1})],Ca.prototype,"trailerField",void 0);new An({algorithm:Zn,parameters:_i.serialize(new Ca)});var ma=function(){function t(t){if(t===void 0){t={}}this.digestAlgorithm=new An;this.digest=new He;Object.assign(this,t)}return t}();bi([Ai({type:An})],ma.prototype,"digestAlgorithm",void 0);bi([Ai({type:He})],ma.prototype,"digest",void 0);var ga;var wa=function(){function t(t){if(t===void 0){t={}}this.prime=new ArrayBuffer(0);this.exponent=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,converter:Ve})],wa.prototype,"prime",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],wa.prototype,"exponent",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],wa.prototype,"coefficient",void 0);var _a=ga=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ga.prototype);return i}return e}(wi);_a=ga=bi([Si({type:Ne.Sequence,itemType:wa})],_a);var ba=function(){function t(t){if(t===void 0){t={}}this.version=0;this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);this.privateExponent=new ArrayBuffer(0);this.prime1=new ArrayBuffer(0);this.prime2=new ArrayBuffer(0);this.exponent1=new ArrayBuffer(0);this.exponent2=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],ba.prototype,"version",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"modulus",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"publicExponent",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"privateExponent",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"prime1",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"prime2",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"exponent1",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"exponent2",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"coefficient",void 0);bi([Ai({type:_a,optional:true})],ba.prototype,"otherPrimeInfos",void 0);var Ea=function(){function t(t){if(t===void 0){t={}}this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("R",Ea);bi([Ai({type:Ke.Integer,converter:Ve})],Ea.prototype,"modulus",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Ea.prototype,"publicExponent",void 0);var Pa,Da;var Ia=t("j","1.3.6.1.4.1.18227.2.1");var Ba=t("l",Pa=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Pa.prototype);return i}return e}(wi));t("l",Ba=Pa=bi([Si({type:Ne.Sequence,itemType:An})],Ba));var xa=t("k",Da=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Da.prototype);return i}return e}(wi));t("k",xa=Da=bi([Si({type:Ne.Sequence,itemType:Ke.BitString})],xa));var Ta=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(He);var Oa=function(){function t(t){if(t===void 0){t={}}this.encryptionAlgorithm=new An;this.encryptedData=new Ta;Object.assign(this,t)}return t}();bi([Ai({type:An})],Oa.prototype,"encryptionAlgorithm",void 0);bi([Ai({type:Ta})],Oa.prototype,"encryptedData",void 0);var ka;var Ma;(function(t){t[t["v1"]=0]="v1"})(Ma||(Ma={}));var Ra=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(He);var Na=ka=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ka.prototype);return i}return e}(wi);Na=ka=bi([Si({type:Ne.Sequence,itemType:rn})],Na);var Ka=function(){function t(t){if(t===void 0){t={}}this.version=Ma.v1;this.privateKeyAlgorithm=new An;this.privateKey=new Ra;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Ka.prototype,"version",void 0);bi([Ai({type:An})],Ka.prototype,"privateKeyAlgorithm",void 0);bi([Ai({type:Ra})],Ka.prototype,"privateKey",void 0);bi([Ai({type:Na,implicit:true,context:0,optional:true})],Ka.prototype,"attributes",void 0);var ja;var Ha;(function(t){t[t["v1"]=0]="v1";t[t["v2"]=1]="v2"})(Ha||(Ha={}));var Ua=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Ua=bi([Si({type:Ne.Sequence})],Ua);var Fa=function(){function t(){this.version=Ha.v1;this.privateKeyAlgorithm=new An;this.privateKey=new ArrayBuffer(0)}return t}();bi([Ai({type:Ke.Integer})],Fa.prototype,"version",void 0);bi([Ai({type:An})],Fa.prototype,"privateKeyAlgorithm",void 0);bi([Ai({type:Ke.OctetString})],Fa.prototype,"privateKey",void 0);bi([Ai({type:Na,context:0,implicit:true,optional:true})],Fa.prototype,"attributes",void 0);bi([Ai({type:Ke.BitString,context:1,implicit:true,optional:true})],Fa.prototype,"publicKey",void 0);Fa=bi([Si({type:Ne.Sequence})],Fa);var La=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Fa);La=bi([Si({type:Ne.Sequence})],La);var Va=ja=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ja.prototype);return i}return e}(wi);Va=ja=bi([Si({type:Ne.Sequence,itemType:Fa})],Va);var Ga,Wa;var Qa=t("g","2.16.840.1.114027.80.4.1");var qa=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);qa=bi([Si({type:Ne.Sequence})],qa);var za=t("h",Ga=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Ga.prototype);return i}return e}(wi));t("h",za=Ga=bi([Si({type:Ne.Sequence,itemType:Cn})],za));var Ya=Wa=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Wa.prototype);return i}return e}(wi);Ya=Wa=bi([Si({type:Ne.Sequence,itemType:Fa})],Ya);var Za={exports:{}};var $a=Za.exports;var Xa;function Ja(){if(Xa)return Za.exports;Xa=1;(function(t,e){!function(e,i){t.exports=i()}($a,(function(){var t=1e3,e=6e4,i=36e5,r="millisecond",n="second",a="minute",o="hour",s="day",u="week",c="month",f="quarter",v="year",h="date",d="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},S=function(t,e,i){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(i)+t},A={s:S,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),r=Math.floor(i/60),n=i%60;return(e<=0?"+":"-")+S(r,2,"0")+":"+S(n,2,"0")},m:function t(e,i){if(e.date()<i.date())return-t(i,e);var r=12*(i.year()-e.year())+(i.month()-e.month()),n=e.clone().add(r,c),a=i-n<0,o=e.clone().add(r+(a?-1:1),c);return+(-(r+(i-n)/(a?n-o:o-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:v,w:u,d:s,D:h,h:o,m:a,s:n,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},C="en",m={};m[C]=y;var g="$isDayjsObject",w=function(t){return t instanceof P||!(!t||!t[g])},_=function t(e,i,r){var n;if(!e)return C;if("string"==typeof e){var a=e.toLowerCase();m[a]&&(n=a),i&&(m[a]=i,n=a);var o=e.split("-");if(!n&&o.length>1)return t(o[0])}else{var s=e.name;m[s]=e,n=s}return!r&&n&&(C=n),n||!r&&C},b=function(t,e){if(w(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new P(i)},E=A;E.l=_,E.i=w,E.w=function(t,e){return b(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var P=function(){function y(t){this.$L=_(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[g]=true}var S=y.prototype;return S.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(E.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var n=r[2]-1||0,a=(r[7]||"0").substring(0,3);return i?new Date(Date.UTC(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(e)}(t),this.init()},S.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},S.$utils=function(){return E},S.isValid=function(){return!(this.$d.toString()===d)},S.isSame=function(t,e){var i=b(t);return this.startOf(e)<=i&&i<=this.endOf(e)},S.isAfter=function(t,e){return b(t)<this.startOf(e)},S.isBefore=function(t,e){return this.endOf(e)<b(t)},S.$g=function(t,e,i){return E.u(t)?this[e]:this.set(i,t)},S.unix=function(){return Math.floor(this.valueOf()/1e3)},S.valueOf=function(){return this.$d.getTime()},S.startOf=function(t,e){var i=this,r=!!E.u(e)||e,f=E.p(t),d=function(t,e){var n=E.w(i.$u?Date.UTC(i.$y,e,t):new Date(i.$y,e,t),i);return r?n:n.endOf(s)},l=function(t,e){return E.w(i.toDate()[t].apply(i.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),i)},p=this.$W,y=this.$M,S=this.$D,A="set"+(this.$u?"UTC":"");switch(f){case v:return r?d(1,0):d(31,11);case c:return r?d(1,y):d(0,y+1);case u:var C=this.$locale().weekStart||0,m=(p<C?p+7:p)-C;return d(r?S-m:S+(6-m),y);case s:case h:return l(A+"Hours",0);case o:return l(A+"Minutes",1);case a:return l(A+"Seconds",2);case n:return l(A+"Milliseconds",3);default:return this.clone()}},S.endOf=function(t){return this.startOf(t,false)},S.$set=function(t,e){var i,u=E.p(t),f="set"+(this.$u?"UTC":""),d=(i={},i[s]=f+"Date",i[h]=f+"Date",i[c]=f+"Month",i[v]=f+"FullYear",i[o]=f+"Hours",i[a]=f+"Minutes",i[n]=f+"Seconds",i[r]=f+"Milliseconds",i)[u],l=u===s?this.$D+(e-this.$W):e;if(u===c||u===v){var p=this.clone().set(h,1);p.$d[d](l),p.init(),this.$d=p.set(h,Math.min(this.$D,p.daysInMonth())).$d}else d&&this.$d[d](l);return this.init(),this},S.set=function(t,e){return this.clone().$set(t,e)},S.get=function(t){return this[E.p(t)]()},S.add=function(r,f){var h,d=this;r=Number(r);var l=E.p(f),p=function(t){var e=b(d);return E.w(e.date(e.date()+Math.round(t*r)),d)};if(l===c)return this.set(c,this.$M+r);if(l===v)return this.set(v,this.$y+r);if(l===s)return p(1);if(l===u)return p(7);var y=(h={},h[a]=e,h[o]=i,h[n]=t,h)[l]||1,S=this.$d.getTime()+r*y;return E.w(S,this)},S.subtract=function(t,e){return this.add(-1*t,e)},S.format=function(t){var e=this,i=this.$locale();if(!this.isValid())return i.invalidDate||d;var r=t||"YYYY-MM-DDTHH:mm:ssZ",n=E.z(this),a=this.$H,o=this.$m,s=this.$M,u=i.weekdays,c=i.months,f=i.meridiem,v=function(t,i,n,a){return t&&(t[i]||t(e,r))||n[i].slice(0,a)},h=function(t){return E.s(a%12||12,t,"0")},l=f||function(t,e,i){var r=t<12?"AM":"PM";return i?r.toLowerCase():r};return r.replace(p,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return E.s(e.$y,4,"0");case"M":return s+1;case"MM":return E.s(s+1,2,"0");case"MMM":return v(i.monthsShort,s,c,3);case"MMMM":return v(c,s);case"D":return e.$D;case"DD":return E.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return v(i.weekdaysMin,e.$W,u,2);case"ddd":return v(i.weekdaysShort,e.$W,u,3);case"dddd":return u[e.$W];case"H":return String(a);case"HH":return E.s(a,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return l(a,o,true);case"A":return l(a,o,false);case"m":return String(o);case"mm":return E.s(o,2,"0");case"s":return String(e.$s);case"ss":return E.s(e.$s,2,"0");case"SSS":return E.s(e.$ms,3,"0");case"Z":return n}return null}(t)||n.replace(":","")}))},S.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},S.diff=function(r,h,d){var l,p=this,y=E.p(h),S=b(r),A=(S.utcOffset()-this.utcOffset())*e,C=this-S,m=function(){return E.m(p,S)};switch(y){case v:l=m()/12;break;case c:l=m();break;case f:l=m()/3;break;case u:l=(C-A)/6048e5;break;case s:l=(C-A)/864e5;break;case o:l=C/i;break;case a:l=C/e;break;case n:l=C/t;break;default:l=C}return d?l:E.a(l)},S.daysInMonth=function(){return this.endOf(c).$D},S.$locale=function(){return m[this.$L]},S.locale=function(t,e){if(!t)return this.$L;var i=this.clone(),r=_(t,e,true);return r&&(i.$L=r),i},S.clone=function(){return E.w(this.$d,this)},S.toDate=function(){return new Date(this.valueOf())},S.toJSON=function(){return this.isValid()?this.toISOString():null},S.toISOString=function(){return this.$d.toISOString()},S.toString=function(){return this.$d.toUTCString()},y}(),D=P.prototype;return b.prototype=D,[["$ms",r],["$s",n],["$m",a],["$H",o],["$W",s],["$M",c],["$y",v],["$D",h]].forEach((function(t){D[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),b.extend=function(t,e){return t.$i||(t(e,P,b),t.$i=true),b},b.locale=_,b.isDayjs=w,b.unix=function(t){return b(1e3*t)},b.en=m[C],b.Ls=m,b.p={},b}))})(Za);return Za.exports}var to=Ja();var eo=n(to);var io={exports:{}};var ro=io.exports;var no;function ao(){if(no)return io.exports;no=1;(function(t,e){!function(e,i){t.exports=i()}(ro,(function(){return function(t,e,i){t=t||{};var r=e.prototype,n={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(t,e,i,n){return r.fromToBase(t,e,i,n)}i.en.relativeTime=n,r.fromToBase=function(e,r,a,o,s){for(var u,c,f,v=a.$locale().relativeTime||n,h=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],d=h.length,l=0;l<d;l+=1){var p=h[l];p.d&&(u=o?i(e).diff(a,p.d,true):a.diff(e,p.d,true));var y=(t.rounding||Math.round)(Math.abs(u));if(f=u>0,y<=p.r||!p.r){y<=1&&l>0&&(p=h[l-1]);var S=v[p.l];s&&(y=s(""+y)),c="string"==typeof S?S.replace("%d",y):S(y,r,p.l,f);break}}if(r)return c;var A=f?v.future:v.past;return"function"==typeof A?A(c):A.replace("%s",c)},r.to=function(t,e){return a(t,e,this,true)},r.from=function(t,e){return a(t,e,this)};var o=function(t){return t.$u?i.utc():i()};r.toNow=function(t){return this.to(o(this),t)},r.fromNow=function(t){return this.from(o(this),t)}}}))})(io);return io.exports}var oo=ao();var so=n(oo);
78
+ */function S(){if(typeof BigInt==="undefined"){throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}}function A(t){var e=0;var i=0;for(var r=0;r<t.length;r++){var n=t[r];e+=n.byteLength}var a=new Uint8Array(e);for(var r=0;r<t.length;r++){var n=t[r];a.set(new Uint8Array(n),i);i+=n.byteLength}return a.buffer}function C(t,e,i,r){if(!(e instanceof Uint8Array)){t.error="Wrong parameter: inputBuffer must be 'Uint8Array'";return false}if(!e.byteLength){t.error="Wrong parameter: inputBuffer has zero length";return false}if(i<0){t.error="Wrong parameter: inputOffset less than zero";return false}if(r<0){t.error="Wrong parameter: inputLength less than zero";return false}if(e.byteLength-i-r<0){t.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return false}return true}var m=function(){function t(){this.items=[]}t.prototype.write=function(t){this.items.push(t)};t.prototype.final=function(){return A(this.items)};return t}();var g=[new Uint8Array([1])];var w="0123456789";var _="name";var b="valueHexView";var E="isHexOnly";var P="idBlock";var D="tagClass";var I="tagNumber";var B="isConstructed";var x="fromBER";var T="toBER";var O="local";var k="";var M=new ArrayBuffer(0);var R=new Uint8Array(0);var N="EndOfContent";var K="OCTET STRING";var j="BIT STRING";function H(t){var e;return e=function(t){__extends(e,t);function e(){var e=[];for(var i=0;i<arguments.length;i++){e[i]=arguments[i]}var r;var n=t.apply(this,e)||this;var a=e[0]||{};n.isHexOnly=(r=a.isHexOnly)!==null&&r!==void 0?r:false;n.valueHexView=a.valueHex?u.BufferSourceConverter.toUint8Array(a.valueHex):R;return n}Object.defineProperty(e.prototype,"valueHex",{get:function(){return this.valueHexView.slice().buffer},set:function(t){this.valueHexView=new Uint8Array(t)},enumerable:false,configurable:true});e.prototype.fromBER=function(t,e,i){var r=t instanceof ArrayBuffer?new Uint8Array(t):t;if(!C(this,r,e,i)){return-1}var n=e+i;this.valueHexView=r.subarray(e,n);if(!this.valueHexView.length){this.warnings.push("Zero buffer length");return e}this.blockLength=i;return n};e.prototype.toBER=function(t){if(t===void 0){t=false}if(!this.isHexOnly){this.error="Flag 'isHexOnly' is not set, abort";return M}if(t){return new ArrayBuffer(this.valueHexView.byteLength)}return this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{isHexOnly:this.isHexOnly,valueHex:u.Convert.ToHex(this.valueHexView)})};return e}(t),e.NAME="hexBlock",e}var U=function(){function t(t){var e=t===void 0?{}:t,i=e.blockLength,r=i===void 0?0:i,n=e.error,a=n===void 0?k:n,o=e.warnings,s=o===void 0?[]:o,c=e.valueBeforeDecode,f=c===void 0?R:c;this.blockLength=r;this.error=a;this.warnings=s;this.valueBeforeDecodeView=u.BufferSourceConverter.toUint8Array(f)}t.blockName=function(){return this.NAME};Object.defineProperty(t.prototype,"valueBeforeDecode",{get:function(){return this.valueBeforeDecodeView.slice().buffer},set:function(t){this.valueBeforeDecodeView=new Uint8Array(t)},enumerable:false,configurable:true});t.prototype.toJSON=function(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:u.Convert.ToHex(this.valueBeforeDecodeView)}};return t}();U.NAME="baseBlock";var F=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.fromBER=function(t,e,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")};e.prototype.toBER=function(t,e){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")};return e}(U);F.NAME="valueBlock";var L=function(t){__extends(e,t);function e(e){var i=e===void 0?{}:e,r=i.idBlock,n=r===void 0?{}:r;var a,o,s,c;var f=t.call(this)||this;if(n){f.isHexOnly=(a=n.isHexOnly)!==null&&a!==void 0?a:false;f.valueHexView=n.valueHex?u.BufferSourceConverter.toUint8Array(n.valueHex):R;f.tagClass=(o=n.tagClass)!==null&&o!==void 0?o:-1;f.tagNumber=(s=n.tagNumber)!==null&&s!==void 0?s:-1;f.isConstructed=(c=n.isConstructed)!==null&&c!==void 0?c:false}else{f.tagClass=-1;f.tagNumber=-1;f.isConstructed=false}return f}e.prototype.toBER=function(t){if(t===void 0){t=false}var e=0;switch(this.tagClass){case 1:e|=0;break;case 2:e|=64;break;case 3:e|=128;break;case 4:e|=192;break;default:this.error="Unknown tag class";return M}if(this.isConstructed)e|=32;if(this.tagNumber<31&&!this.isHexOnly){var i=new Uint8Array(1);if(!t){var r=this.tagNumber;r&=31;e|=r;i[0]=e}return i.buffer}if(!this.isHexOnly){var n=v(this.tagNumber,7);var a=new Uint8Array(n);var o=n.byteLength;var s=new Uint8Array(o+1);s[0]=e|31;if(!t){for(var u=0;u<o-1;u++)s[u+1]=a[u]|128;s[o]=a[o-1]}return s.buffer}var c=new Uint8Array(this.valueHexView.byteLength+1);c[0]=e|31;if(!t){var f=this.valueHexView;for(var u=0;u<f.length-1;u++)c[u+1]=f[u]|128;c[this.valueHexView.byteLength]=f[f.length-1]}return c.buffer};e.prototype.fromBER=function(t,e,i){var r=u.BufferSourceConverter.toUint8Array(t);if(!C(this,r,e,i)){return-1}var n=r.subarray(e,e+i);if(n.length===0){this.error="Zero buffer length";return-1}var a=n[0]&192;switch(a){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:this.error="Unknown tag class";return-1}this.isConstructed=(n[0]&32)===32;this.isHexOnly=false;var o=n[0]&31;if(o!==31){this.tagNumber=o;this.blockLength=1}else{var s=1;var c=this.valueHexView=new Uint8Array(255);var v=255;while(n[s]&128){c[s-1]=n[s]&127;s++;if(s>=n.length){this.error="End of input reached before message was fully decoded";return-1}if(s===v){v+=255;var h=new Uint8Array(v);for(var d=0;d<c.length;d++)h[d]=c[d];c=this.valueHexView=new Uint8Array(v)}}this.blockLength=s+1;c[s-1]=n[s]&127;var l=new Uint8Array(s);for(var d=0;d<s;d++)l[d]=c[d];c=this.valueHexView=new Uint8Array(s);c.set(l);if(this.blockLength<=9)this.tagNumber=f(c,7);else{this.isHexOnly=true;this.warnings.push("Tag too long, represented as hex-coded")}}if(this.tagClass===1&&this.isConstructed){switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:this.error="Constructed encoding used for primitive type";return-1}}return e+this.blockLength};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed})};return e}(H(U));L.NAME="identificationBlock";var V=function(t){__extends(e,t);function e(e){var i=e===void 0?{}:e,r=i.lenBlock,n=r===void 0?{}:r;var a,o,s;var u=t.call(this)||this;u.isIndefiniteForm=(a=n.isIndefiniteForm)!==null&&a!==void 0?a:false;u.longFormUsed=(o=n.longFormUsed)!==null&&o!==void 0?o:false;u.length=(s=n.length)!==null&&s!==void 0?s:0;return u}e.prototype.fromBER=function(t,e,i){var r=u.BufferSourceConverter.toUint8Array(t);if(!C(this,r,e,i)){return-1}var n=r.subarray(e,e+i);if(n.length===0){this.error="Zero buffer length";return-1}if(n[0]===255){this.error="Length block 0xFF is reserved by standard";return-1}this.isIndefiniteForm=n[0]===128;if(this.isIndefiniteForm){this.blockLength=1;return e+this.blockLength}this.longFormUsed=!!(n[0]&128);if(this.longFormUsed===false){this.length=n[0];this.blockLength=1;return e+this.blockLength}var a=n[0]&127;if(a>8){this.error="Too big integer";return-1}if(a+1>n.length){this.error="End of input reached before message was fully decoded";return-1}var o=e+1;var s=r.subarray(o,o+a);if(s[a-1]===0)this.warnings.push("Needlessly long encoded length");this.length=f(s,8);if(this.longFormUsed&&this.length<=127)this.warnings.push("Unnecessary usage of long length form");this.blockLength=a+1;return e+this.blockLength};e.prototype.toBER=function(t){if(t===void 0){t=false}var e;var i;if(this.length>127)this.longFormUsed=true;if(this.isIndefiniteForm){e=new ArrayBuffer(1);if(t===false){i=new Uint8Array(e);i[0]=128}return e}if(this.longFormUsed){var r=v(this.length,8);if(r.byteLength>127){this.error="Too big length";return M}e=new ArrayBuffer(r.byteLength+1);if(t)return e;var n=new Uint8Array(r);i=new Uint8Array(e);i[0]=r.byteLength|128;for(var a=0;a<r.byteLength;a++)i[a+1]=n[a];return e}e=new ArrayBuffer(1);if(t===false){i=new Uint8Array(e);i[0]=this.length}return e};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length})};return e}(U);V.NAME="lengthBlock";var G={};var W=function(t){__extends(e,t);function e(e,i){if(e===void 0){e={}}var r=this;var n=e.name,a=n===void 0?k:n,o=e.optional,s=o===void 0?false:o,u=e.primitiveSchema,c=__rest(e,["name","optional","primitiveSchema"]);r=t.call(this,c)||this;r.name=a;r.optional=s;if(u){r.primitiveSchema=u}r.idBlock=new L(c);r.lenBlock=new V(c);r.valueBlock=i?new i(c):new F(c);return r}e.prototype.fromBER=function(t,e,i){var r=this.valueBlock.fromBER(t,e,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);if(r===-1){this.error=this.valueBlock.error;return r}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return r};e.prototype.toBER=function(t,e){var i=e||new m;if(!e){Q(this)}var r=this.idBlock.toBER(t);i.write(r);if(this.lenBlock.isIndefiniteForm){i.write(new Uint8Array([128]).buffer);this.valueBlock.toBER(t,i);i.write(new ArrayBuffer(2))}else{var n=this.valueBlock.toBER(t);this.lenBlock.length=n.byteLength;var a=this.lenBlock.toBER(t);i.write(a);i.write(n)}if(!e){return i.final()}return M};e.prototype.toJSON=function(){var e=__assign(__assign({},t.prototype.toJSON.call(this)),{idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional});if(this.primitiveSchema)e.primitiveSchema=this.primitiveSchema.toJSON();return e};e.prototype.toString=function(t){if(t===void 0){t="ascii"}if(t==="ascii"){return this.onAsciiEncoding()}return u.Convert.ToHex(this.toBER())};e.prototype.onAsciiEncoding=function(){var t=this.constructor.NAME;var e=u.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return"".concat(t," : ").concat(e)};e.prototype.isEqual=function(t){if(this===t){return true}if(!(t instanceof this.constructor)){return false}var e=this.toBER();var i=t.toBER();return p(e,i)};return e}(U);W.NAME="BaseBlock";function Q(t){var e;if(t instanceof G.Constructed){for(var i=0,r=t.valueBlock.value;i<r.length;i++){var n=r[i];if(Q(n)){t.lenBlock.isIndefiniteForm=true}}}return!!((e=t.lenBlock)===null||e===void 0?void 0:e.isIndefiniteForm)}var q=function(t){__extends(e,t);function e(e,i){if(e===void 0){e={}}var r=this;var n=e.value,a=n===void 0?k:n,o=__rest(e,["value"]);r=t.call(this,o,i)||this;if(a){r.fromString(a)}return r}e.prototype.getValue=function(){return this.valueBlock.value};e.prototype.setValue=function(t){this.valueBlock.value=t};e.prototype.fromBER=function(t,e,i){var r=this.valueBlock.fromBER(t,e,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);if(r===-1){this.error=this.valueBlock.error;return r}this.fromBuffer(this.valueBlock.valueHexView);if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return r};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : '").concat(this.valueBlock.value,"'")};return e}(W);q.NAME="BaseStringBlock";var z=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.isHexOnly,n=r===void 0?true:r,a=__rest(e,["isHexOnly"]);i=t.call(this,a)||this;i.isHexOnly=n;return i}return e}(H(F));z.NAME="PrimitiveValueBlock";var Y;var Z=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,z)||this;i.idBlock.isConstructed=false;return i}return e}(W);Y=Z;(function(){G.Primitive=Y})();Z.NAME="PRIMITIVE";function $(t,e){if(t instanceof e){return t}var i=new e;i.idBlock=t.idBlock;i.lenBlock=t.lenBlock;i.warnings=t.warnings;i.valueBeforeDecodeView=t.valueBeforeDecodeView;return i}function X(t,e,i){if(e===void 0){e=0}if(i===void 0){i=t.length}var r=e;var n=new W({},F);var a=new U;if(!C(a,t,e,i)){n.error=a.error;return{offset:-1,result:n}}var o=t.subarray(e,e+i);if(!o.length){n.error="Zero buffer length";return{offset:-1,result:n}}var s=n.idBlock.fromBER(t,e,i);if(n.idBlock.warnings.length){n.warnings.concat(n.idBlock.warnings)}if(s===-1){n.error=n.idBlock.error;return{offset:-1,result:n}}e=s;i-=n.idBlock.blockLength;s=n.lenBlock.fromBER(t,e,i);if(n.lenBlock.warnings.length){n.warnings.concat(n.lenBlock.warnings)}if(s===-1){n.error=n.lenBlock.error;return{offset:-1,result:n}}e=s;i-=n.lenBlock.blockLength;if(!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm){n.error="Indefinite length form used for primitive encoding form";return{offset:-1,result:n}}var u=W;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===false){n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard";return{offset:-1,result:n}}switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0){n.error="Type [UNIVERSAL 0] is reserved";return{offset:-1,result:n}}u=G.EndOfContent;break;case 1:u=G.Boolean;break;case 2:u=G.Integer;break;case 3:u=G.BitString;break;case 4:u=G.OctetString;break;case 5:u=G.Null;break;case 6:u=G.ObjectIdentifier;break;case 10:u=G.Enumerated;break;case 12:u=G.Utf8String;break;case 13:u=G.RelativeObjectIdentifier;break;case 14:u=G.TIME;break;case 15:n.error="[UNIVERSAL 15] is reserved by ASN.1 standard";return{offset:-1,result:n};case 16:u=G.Sequence;break;case 17:u=G.Set;break;case 18:u=G.NumericString;break;case 19:u=G.PrintableString;break;case 20:u=G.TeletexString;break;case 21:u=G.VideotexString;break;case 22:u=G.IA5String;break;case 23:u=G.UTCTime;break;case 24:u=G.GeneralizedTime;break;case 25:u=G.GraphicString;break;case 26:u=G.VisibleString;break;case 27:u=G.GeneralString;break;case 28:u=G.UniversalString;break;case 29:u=G.CharacterString;break;case 30:u=G.BmpString;break;case 31:u=G.DATE;break;case 32:u=G.TimeOfDay;break;case 33:u=G.DateTime;break;case 34:u=G.Duration;break;default:{var c=n.idBlock.isConstructed?new G.Constructed:new G.Primitive;c.idBlock=n.idBlock;c.lenBlock=n.lenBlock;c.warnings=n.warnings;n=c}}break;case 2:case 3:case 4:default:{u=n.idBlock.isConstructed?G.Constructed:G.Primitive}}n=$(n,u);s=n.fromBER(t,e,n.lenBlock.isIndefiniteForm?i:n.lenBlock.length);n.valueBeforeDecodeView=t.subarray(r,r+n.blockLength);return{offset:s,result:n}}function J(t){if(!t.byteLength){var e=new W({},F);e.error="Input buffer has zero length";return{offset:-1,result:e}}return X(u.BufferSourceConverter.toUint8Array(t).slice(),0,t.byteLength)}function tt(t,e){if(t){return 1}return e}var et=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=r===void 0?[]:r,a=e.isIndefiniteForm,o=a===void 0?false:a,s=__rest(e,["value","isIndefiniteForm"]);i=t.call(this,s)||this;i.value=n;i.isIndefiniteForm=o;return i}e.prototype.fromBER=function(t,e,i){var r=u.BufferSourceConverter.toUint8Array(t);if(!C(this,r,e,i)){return-1}this.valueBeforeDecodeView=r.subarray(e,e+i);if(this.valueBeforeDecodeView.length===0){this.warnings.push("Zero buffer length");return e}var n=e;while(tt(this.isIndefiniteForm,i)>0){var a=X(r,n,i);if(a.offset===-1){this.error=a.result.error;this.warnings.concat(a.result.warnings);return-1}n=a.offset;this.blockLength+=a.result.blockLength;i-=a.result.blockLength;this.value.push(a.result);if(this.isIndefiniteForm&&a.result.constructor.NAME===N){break}}if(this.isIndefiniteForm){if(this.value[this.value.length-1].constructor.NAME===N){this.value.pop()}else{this.warnings.push("No EndOfContent block encoded")}}return n};e.prototype.toBER=function(t,e){var i=e||new m;for(var r=0;r<this.value.length;r++){this.value[r].toBER(t,i)}if(!e){return i.final()}return M};e.prototype.toJSON=function(){var e=__assign(__assign({},t.prototype.toJSON.call(this)),{isIndefiniteForm:this.isIndefiniteForm,value:[]});for(var i=0,r=this.value;i<r.length;i++){var n=r[i];e.value.push(n.toJSON())}return e};return e}(F);et.NAME="ConstructedValueBlock";var it;var rt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,et)||this;i.idBlock.isConstructed=true;return i}e.prototype.fromBER=function(t,e,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;var r=this.valueBlock.fromBER(t,e,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);if(r===-1){this.error=this.valueBlock.error;return r}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return r};e.prototype.onAsciiEncoding=function(){var t=[];for(var e=0,i=this.valueBlock.value;e<i.length;e++){var r=i[e];t.push(r.toString("ascii").split("\n").map((function(t){return" ".concat(t)})).join("\n"))}var n=this.idBlock.tagClass===3?"[".concat(this.idBlock.tagNumber,"]"):this.constructor.NAME;return t.length?"".concat(n," :\n").concat(t.join("\n")):"".concat(n," :")};return e}(W);it=rt;(function(){G.Constructed=it})();rt.NAME="CONSTRUCTED";var nt=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.fromBER=function(t,e,i){return e};e.prototype.toBER=function(t){return M};return e}(F);nt.override="EndOfContentValueBlock";var at;var ot=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,nt)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=0;return i}return e}(W);at=ot;(function(){G.EndOfContent=at})();ot.NAME=N;var st;var ut=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,F)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=5;return i}e.prototype.fromBER=function(t,e,i){if(this.lenBlock.length>0)this.warnings.push("Non-zero length of value block for Null type");if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;this.blockLength+=i;if(e+i>t.byteLength){this.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return-1}return e+i};e.prototype.toBER=function(t,e){var i=new ArrayBuffer(2);if(!t){var r=new Uint8Array(i);r[0]=5;r[1]=0}if(e){e.write(i)}return i};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME)};return e}(W);st=ut;(function(){G.Null=st})();ut.NAME="NULL";var ct=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=__rest(e,["value"]);i=t.call(this,n)||this;if(n.valueHex){i.valueHexView=u.BufferSourceConverter.toUint8Array(n.valueHex)}else{i.valueHexView=new Uint8Array(1)}if(r){i.value=r}return i}Object.defineProperty(e.prototype,"value",{get:function(){for(var t=0,e=this.valueHexView;t<e.length;t++){var i=e[t];if(i>0){return true}}return false},set:function(t){this.valueHexView[0]=t?255:0},enumerable:false,configurable:true});e.prototype.fromBER=function(t,e,i){var r=u.BufferSourceConverter.toUint8Array(t);if(!C(this,r,e,i)){return-1}this.valueHexView=r.subarray(e,e+i);if(i>1)this.warnings.push("Boolean value encoded in more then 1 octet");this.isHexOnly=true;d.call(this);this.blockLength=i;return e+i};e.prototype.toBER=function(){return this.valueHexView.slice()};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{value:this.value})};return e}(H(F));ct.NAME="BooleanValueBlock";var ft;var vt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,ct)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=1;return i}e.prototype.getValue=function(){return this.valueBlock.value};e.prototype.setValue=function(t){this.valueBlock.value=t};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.getValue)};return e}(W);ft=vt;(function(){G.Boolean=ft})();vt.NAME="BOOLEAN";var ht=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.isConstructed,n=r===void 0?false:r,a=__rest(e,["isConstructed"]);i=t.call(this,a)||this;i.isConstructed=n;return i}e.prototype.fromBER=function(e,i,r){var n=0;if(this.isConstructed){this.isHexOnly=false;n=et.prototype.fromBER.call(this,e,i,r);if(n===-1)return n;for(var a=0;a<this.value.length;a++){var o=this.value[a].constructor.NAME;if(o===N){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only";return-1}}if(o!==K){this.error="OCTET STRING may consists of OCTET STRINGs only";return-1}}}else{this.isHexOnly=true;n=t.prototype.fromBER.call(this,e,i,r);this.blockLength=r}return n};e.prototype.toBER=function(t,e){if(this.isConstructed)return et.prototype.toBER.call(this,t,e);return t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{isConstructed:this.isConstructed})};return e}(H(et));ht.NAME="OctetStringValueBlock";var dt;var lt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.idBlock,n=r===void 0?{}:r,a=e.lenBlock,o=a===void 0?{}:a,s=__rest(e,["idBlock","lenBlock"]);var u,c;(u=s.isConstructed)!==null&&u!==void 0?u:s.isConstructed=!!((c=s.value)===null||c===void 0?void 0:c.length);i=t.call(this,__assign({idBlock:__assign({isConstructed:s.isConstructed},n),lenBlock:__assign(__assign({},o),{isIndefiniteForm:!!s.isIndefiniteForm})},s),ht)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=4;return i}e.prototype.fromBER=function(e,i,r){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;if(r===0){if(this.idBlock.error.length===0)this.blockLength+=this.idBlock.blockLength;if(this.lenBlock.error.length===0)this.blockLength+=this.lenBlock.blockLength;return i}if(!this.valueBlock.isConstructed){var n=e instanceof ArrayBuffer?new Uint8Array(e):e;var a=n.subarray(i,i+r);try{if(a.byteLength){var o=X(a,0,a.byteLength);if(o.offset!==-1&&o.offset===r){this.valueBlock.value=[o.result]}}}catch(t){}}return t.prototype.fromBER.call(this,e,i,r)};e.prototype.onAsciiEncoding=function(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return rt.prototype.onAsciiEncoding.call(this)}var t=this.constructor.NAME;var e=u.Convert.ToHex(this.valueBlock.valueHexView);return"".concat(t," : ").concat(e)};e.prototype.getValue=function(){if(!this.idBlock.isConstructed){return this.valueBlock.valueHexView.slice().buffer}var t=[];for(var e=0,i=this.valueBlock.value;e<i.length;e++){var r=i[e];if(r instanceof dt){t.push(r.valueBlock.valueHexView)}}return u.BufferSourceConverter.concat(t)};return e}(W);dt=lt;(function(){G.OctetString=dt})();lt.NAME=K;var pt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.unusedBits,n=r===void 0?0:r,a=e.isConstructed,o=a===void 0?false:a,s=__rest(e,["unusedBits","isConstructed"]);i=t.call(this,s)||this;i.unusedBits=n;i.isConstructed=o;i.blockLength=i.valueHexView.byteLength;return i}e.prototype.fromBER=function(t,e,i){if(!i){return e}var r=-1;if(this.isConstructed){r=et.prototype.fromBER.call(this,t,e,i);if(r===-1)return r;for(var n=0,a=this.value;n<a.length;n++){var o=a[n];var s=o.constructor.NAME;if(s===N){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only";return-1}}if(s!==j){this.error="BIT STRING may consists of BIT STRINGs only";return-1}var c=o.valueBlock;if(this.unusedBits>0&&c.unusedBits>0){this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only';return-1}this.unusedBits=c.unusedBits}return r}var f=u.BufferSourceConverter.toUint8Array(t);if(!C(this,f,e,i)){return-1}var v=f.subarray(e,e+i);this.unusedBits=v[0];if(this.unusedBits>7){this.error="Unused bits for BitString must be in range 0-7";return-1}if(!this.unusedBits){var h=v.subarray(1);try{if(h.byteLength){var d=X(h,0,h.byteLength);if(d.offset!==-1&&d.offset===i-1){this.value=[d.result]}}}catch(t){}}this.valueHexView=v.subarray(1);this.blockLength=v.length;return e+i};e.prototype.toBER=function(t,e){if(this.isConstructed){return et.prototype.toBER.call(this,t,e)}if(t){return new ArrayBuffer(this.valueHexView.byteLength+1)}if(!this.valueHexView.byteLength){return M}var i=new Uint8Array(this.valueHexView.length+1);i[0]=this.unusedBits;i.set(this.valueHexView,1);return i.buffer};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{unusedBits:this.unusedBits,isConstructed:this.isConstructed})};return e}(H(et));pt.NAME="BitStringValueBlock";var yt;var St=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.idBlock,n=r===void 0?{}:r,a=e.lenBlock,o=a===void 0?{}:a,s=__rest(e,["idBlock","lenBlock"]);var u,c;(u=s.isConstructed)!==null&&u!==void 0?u:s.isConstructed=!!((c=s.value)===null||c===void 0?void 0:c.length);i=t.call(this,__assign({idBlock:__assign({isConstructed:s.isConstructed},n),lenBlock:__assign(__assign({},o),{isIndefiniteForm:!!s.isIndefiniteForm})},s),pt)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=3;return i}e.prototype.fromBER=function(e,i,r){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;return t.prototype.fromBER.call(this,e,i,r)};e.prototype.onAsciiEncoding=function(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return rt.prototype.onAsciiEncoding.call(this)}else{var t=[];var e=this.valueBlock.valueHexView;for(var i=0,r=e;i<r.length;i++){var n=r[i];t.push(n.toString(2).padStart(8,"0"))}var a=t.join("");var o=this.constructor.NAME;var s=a.substring(0,a.length-this.valueBlock.unusedBits);return"".concat(o," : ").concat(s)}};return e}(W);yt=St;(function(){G.BitString=yt})();St.NAME=j;var At;function Ct(t,e){var i=new Uint8Array([0]);var r=new Uint8Array(t);var n=new Uint8Array(e);var a=r.slice(0);var o=a.length-1;var s=n.slice(0);var u=s.length-1;var c=0;var f=u<o?o:u;var v=0;for(var d=f;d>=0;d--,v++){switch(true){case v<s.length:c=a[o-v]+s[u-v]+i[0];break;default:c=a[o-v]+i[0]}i[0]=c/10;switch(true){case v>=a.length:a=h(new Uint8Array([c%10]),a);break;default:a[o-v]=c%10}}if(i[0]>0)a=h(i,a);return a}function mt(t){if(t>=g.length){for(var e=g.length;e<=t;e++){var i=new Uint8Array([0]);var r=g[e-1].slice(0);for(var n=r.length-1;n>=0;n--){var a=new Uint8Array([(r[n]<<1)+i[0]]);i[0]=a[0]/10;r[n]=a[0]%10}if(i[0]>0)r=h(i,r);g.push(r)}}return g[t]}function gt(t,e){var i=0;var r=new Uint8Array(t);var n=new Uint8Array(e);var a=r.slice(0);var o=a.length-1;var s=n.slice(0);var u=s.length-1;var c;var f=0;for(var v=u;v>=0;v--,f++){c=a[o-f]-s[u-f]-i;switch(true){case c<0:i=1;a[o-f]=c+10;break;default:i=0;a[o-f]=c}}if(i>0){for(var v=o-u+1;v>=0;v--,f++){c=a[o-f]-i;if(c<0){i=1;a[o-f]=c+10}else{i=0;a[o-f]=c;break}}}return a.slice()}var wt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=__rest(e,["value"]);i=t.call(this,n)||this;i._valueDec=0;if(n.valueHex){i.setValueHex()}if(r!==undefined){i.valueDec=r}return i}e.prototype.setValueHex=function(){if(this.valueHexView.length>=4){this.warnings.push("Too big Integer for decoding, hex only");this.isHexOnly=true;this._valueDec=0}else{this.isHexOnly=false;if(this.valueHexView.length>0){this._valueDec=d.call(this)}}};Object.defineProperty(e.prototype,"valueDec",{get:function(){return this._valueDec},set:function(t){this._valueDec=t;this.isHexOnly=false;this.valueHexView=new Uint8Array(l(t))},enumerable:false,configurable:true});e.prototype.fromDER=function(t,e,i,r){if(r===void 0){r=0}var n=this.fromBER(t,e,i);if(n===-1)return n;var a=this.valueHexView;if(a[0]===0&&(a[1]&128)!==0){this.valueHexView=a.subarray(1)}else{if(r!==0){if(a.length<r){if(r-a.length>1)r=a.length+1;this.valueHexView=a.subarray(r-a.length)}}}return n};e.prototype.toDER=function(t){if(t===void 0){t=false}var e=this.valueHexView;switch(true){case(e[0]&128)!==0:{var i=new Uint8Array(this.valueHexView.length+1);i[0]=0;i.set(e,1);this.valueHexView=i}break;case e[0]===0&&(e[1]&128)===0:{this.valueHexView=this.valueHexView.subarray(1)}break}return this.toBER(t)};e.prototype.fromBER=function(e,i,r){var n=t.prototype.fromBER.call(this,e,i,r);if(n===-1){return n}this.setValueHex();return n};e.prototype.toBER=function(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{valueDec:this.valueDec})};e.prototype.toString=function(){var t=this.valueHexView.length*8-1;var e=new Uint8Array(this.valueHexView.length*8/3);var i=0;var r;var n=this.valueHexView;var a="";var o=false;for(var s=n.byteLength-1;s>=0;s--){r=n[s];for(var u=0;u<8;u++){if((r&1)===1){switch(i){case t:e=gt(mt(i),e);a="-";break;default:e=Ct(e,mt(i))}}i++;r>>=1}}for(var u=0;u<e.length;u++){if(e[u])o=true;if(o)a+=w.charAt(e[u])}if(o===false)a+=w.charAt(0);return a};return e}(H(F));At=wt;wt.NAME="IntegerValueBlock";(function(){Object.defineProperty(At.prototype,"valueHex",{set:function(t){this.valueHexView=new Uint8Array(t);this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}})})();var _t;var bt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,wt)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=2;return i}e.prototype.toBigInt=function(){S();return BigInt(this.valueBlock.toString())};e.fromBigInt=function(t){S();var e=BigInt(t);var i=new m;var r=e.toString(16).replace(/^-/,"");var n=new Uint8Array(u.Convert.FromHex(r));if(e<0){var a=new Uint8Array(n.length+(n[0]&128?1:0));a[0]|=128;var o=BigInt("0x".concat(u.Convert.ToHex(a)));var s=o+e;var c=u.BufferSourceConverter.toUint8Array(u.Convert.FromHex(s.toString(16)));c[0]|=128;i.write(c)}else{if(n[0]&128){i.write(new Uint8Array([0]))}i.write(n)}var f=new _t({valueHex:i.final()});return f};e.prototype.convertToDER=function(){var t=new _t({valueHex:this.valueBlock.valueHexView});t.valueBlock.toDER();return t};e.prototype.convertFromDER=function(){return new _t({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString())};return e}(W);_t=bt;(function(){G.Integer=_t})();bt.NAME="INTEGER";var Et;var Pt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=10;return i}return e}(bt);Et=Pt;(function(){G.Enumerated=Et})();Pt.NAME="ENUMERATED";var Dt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.valueDec,n=r===void 0?-1:r,a=e.isFirstSid,o=a===void 0?false:a,s=__rest(e,["valueDec","isFirstSid"]);i=t.call(this,s)||this;i.valueDec=n;i.isFirstSid=o;return i}e.prototype.fromBER=function(t,e,i){if(!i){return e}var r=u.BufferSourceConverter.toUint8Array(t);if(!C(this,r,e,i)){return-1}var n=r.subarray(e,e+i);this.valueHexView=new Uint8Array(i);for(var a=0;a<i;a++){this.valueHexView[a]=n[a]&127;this.blockLength++;if((n[a]&128)===0)break}var o=new Uint8Array(this.blockLength);for(var a=0;a<this.blockLength;a++){o[a]=this.valueHexView[a]}this.valueHexView=o;if((n[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=f(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return e+this.blockLength};Object.defineProperty(e.prototype,"valueBigInt",{set:function(t){S();var e=BigInt(t).toString(2);while(e.length%7){e="0"+e}var i=new Uint8Array(e.length/7);for(var r=0;r<i.length;r++){i[r]=parseInt(e.slice(r*7,r*7+7),2)+(r+1<i.length?128:0)}this.fromBER(i.buffer,0,i.length)},enumerable:false,configurable:true});e.prototype.toBER=function(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);var e=this.valueHexView;var i=new Uint8Array(this.blockLength);for(var r=0;r<this.blockLength-1;r++)i[r]=e[r]|128;i[this.blockLength-1]=e[this.blockLength-1];return i.buffer}var n=v(this.valueDec,7);if(n.byteLength===0){this.error="Error during encoding SID value";return M}var a=new Uint8Array(n.byteLength);if(!t){var o=new Uint8Array(n);var s=n.byteLength-1;for(var r=0;r<s;r++)a[r]=o[r]|128;a[s]=o[s]}return a};e.prototype.toString=function(){var t="";if(this.isHexOnly)t=u.Convert.ToHex(this.valueHexView);else{if(this.isFirstSid){var e=this.valueDec;if(this.valueDec<=39)t="0.";else{if(this.valueDec<=79){t="1.";e-=40}else{t="2.";e-=80}}t+=e.toString()}else t=this.valueDec.toString()}return t};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{valueDec:this.valueDec,isFirstSid:this.isFirstSid})};return e}(H(F));Dt.NAME="sidBlock";var It=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=r===void 0?k:r,a=__rest(e,["value"]);i=t.call(this,a)||this;i.value=[];if(n){i.fromString(n)}return i}e.prototype.fromBER=function(t,e,i){var r=e;while(i>0){var n=new Dt;r=n.fromBER(t,r,i);if(r===-1){this.blockLength=0;this.error=n.error;return r}if(this.value.length===0)n.isFirstSid=true;this.blockLength+=n.blockLength;i-=n.blockLength;this.value.push(n)}return r};e.prototype.toBER=function(t){var e=[];for(var i=0;i<this.value.length;i++){var r=this.value[i].toBER(t);if(r.byteLength===0){this.error=this.value[i].error;return M}e.push(r)}return A(e)};e.prototype.fromString=function(t){this.value=[];var e=0;var i=0;var r="";var n=false;do{i=t.indexOf(".",e);if(i===-1)r=t.substring(e);else r=t.substring(e,i);e=i+1;if(n){var a=this.value[0];var o=0;switch(a.valueDec){case 0:break;case 1:o=40;break;case 2:o=80;break;default:this.value=[];return}var s=parseInt(r,10);if(isNaN(s))return;a.valueDec=s+o;n=false}else{var a=new Dt;if(r>Number.MAX_SAFE_INTEGER){S();var u=BigInt(r);a.valueBigInt=u}else{a.valueDec=parseInt(r,10);if(isNaN(a.valueDec))return}if(!this.value.length){a.isFirstSid=true;n=true}this.value.push(a)}}while(i!==-1)};e.prototype.toString=function(){var t="";var e=false;for(var i=0;i<this.value.length;i++){e=this.value[i].isHexOnly;var r=this.value[i].toString();if(i!==0)t="".concat(t,".");if(e){r="{".concat(r,"}");if(this.value[i].isFirstSid)t="2.{".concat(r," - 80}");else t+=r}else t+=r}return t};e.prototype.toJSON=function(){var e=__assign(__assign({},t.prototype.toJSON.call(this)),{value:this.toString(),sidArray:[]});for(var i=0;i<this.value.length;i++){e.sidArray.push(this.value[i].toJSON())}return e};return e}(F);It.NAME="ObjectIdentifierValueBlock";var Bt;var xt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,It)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=6;return i}e.prototype.getValue=function(){return this.valueBlock.toString()};e.prototype.setValue=function(t){this.valueBlock.fromString(t)};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString()||"empty")};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{value:this.getValue()})};return e}(W);Bt=xt;(function(){G.ObjectIdentifier=Bt})();xt.NAME="OBJECT IDENTIFIER";var Tt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.valueDec,n=r===void 0?0:r,a=__rest(e,["valueDec"]);i=t.call(this,a)||this;i.valueDec=n;return i}e.prototype.fromBER=function(t,e,i){if(i===0)return e;var r=u.BufferSourceConverter.toUint8Array(t);if(!C(this,r,e,i))return-1;var n=r.subarray(e,e+i);this.valueHexView=new Uint8Array(i);for(var a=0;a<i;a++){this.valueHexView[a]=n[a]&127;this.blockLength++;if((n[a]&128)===0)break}var o=new Uint8Array(this.blockLength);for(var a=0;a<this.blockLength;a++)o[a]=this.valueHexView[a];this.valueHexView=o;if((n[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=f(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return e+this.blockLength};e.prototype.toBER=function(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);var e=this.valueHexView;var i=new Uint8Array(this.blockLength);for(var r=0;r<this.blockLength-1;r++)i[r]=e[r]|128;i[this.blockLength-1]=e[this.blockLength-1];return i.buffer}var n=v(this.valueDec,7);if(n.byteLength===0){this.error="Error during encoding SID value";return M}var a=new Uint8Array(n.byteLength);if(!t){var o=new Uint8Array(n);var s=n.byteLength-1;for(var r=0;r<s;r++)a[r]=o[r]|128;a[s]=o[s]}return a.buffer};e.prototype.toString=function(){var t="";if(this.isHexOnly)t=u.Convert.ToHex(this.valueHexView);else{t=this.valueDec.toString()}return t};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{valueDec:this.valueDec})};return e}(H(U));Tt.NAME="relativeSidBlock";var Ot=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=r===void 0?k:r,a=__rest(e,["value"]);i=t.call(this,a)||this;i.value=[];if(n){i.fromString(n)}return i}e.prototype.fromBER=function(t,e,i){var r=e;while(i>0){var n=new Tt;r=n.fromBER(t,r,i);if(r===-1){this.blockLength=0;this.error=n.error;return r}this.blockLength+=n.blockLength;i-=n.blockLength;this.value.push(n)}return r};e.prototype.toBER=function(t,e){var i=[];for(var r=0;r<this.value.length;r++){var n=this.value[r].toBER(t);if(n.byteLength===0){this.error=this.value[r].error;return M}i.push(n)}return A(i)};e.prototype.fromString=function(t){this.value=[];var e=0;var i=0;var r="";do{i=t.indexOf(".",e);if(i===-1)r=t.substring(e);else r=t.substring(e,i);e=i+1;var n=new Tt;n.valueDec=parseInt(r,10);if(isNaN(n.valueDec))return true;this.value.push(n)}while(i!==-1);return true};e.prototype.toString=function(){var t="";var e=false;for(var i=0;i<this.value.length;i++){e=this.value[i].isHexOnly;var r=this.value[i].toString();if(i!==0)t="".concat(t,".");if(e){r="{".concat(r,"}");t+=r}else t+=r}return t};e.prototype.toJSON=function(){var e=__assign(__assign({},t.prototype.toJSON.call(this)),{value:this.toString(),sidArray:[]});for(var i=0;i<this.value.length;i++)e.sidArray.push(this.value[i].toJSON());return e};return e}(F);Ot.NAME="RelativeObjectIdentifierValueBlock";var kt;var Mt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e,Ot)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=13;return i}e.prototype.getValue=function(){return this.valueBlock.toString()};e.prototype.setValue=function(t){this.valueBlock.fromString(t)};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString()||"empty")};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{value:this.getValue()})};return e}(W);kt=Mt;(function(){G.RelativeObjectIdentifier=kt})();Mt.NAME="RelativeObjectIdentifier";var Rt;var Nt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=16;return i}return e}(rt);Rt=Nt;(function(){G.Sequence=Rt})();Nt.NAME="SEQUENCE";var Kt;var jt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=17;return i}return e}(rt);Kt=jt;(function(){G.Set=Kt})();jt.NAME="SET";var Ht=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=__rest(e,[]);i=t.call(this,r)||this;i.isHexOnly=true;i.value=k;return i}e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{value:this.value})};return e}(H(F));Ht.NAME="StringValueBlock";var Ut=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ht);Ut.NAME="SimpleStringValueBlock";var Ft=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=__rest(e,[]);return t.call(this,i,Ut)||this}e.prototype.fromBuffer=function(t){this.valueBlock.value=String.fromCharCode.apply(null,u.BufferSourceConverter.toUint8Array(t))};e.prototype.fromString=function(t){var e=t.length;var i=this.valueBlock.valueHexView=new Uint8Array(e);for(var r=0;r<e;r++)i[r]=t.charCodeAt(r);this.valueBlock.value=t};return e}(q);Ft.NAME="SIMPLE STRING";var Lt=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.fromBuffer=function(t){this.valueBlock.valueHexView=u.BufferSourceConverter.toUint8Array(t);try{this.valueBlock.value=u.Convert.ToUtf8String(t)}catch(e){this.warnings.push('Error during "decodeURIComponent": '.concat(e,", using raw string"));this.valueBlock.value=u.Convert.ToBinary(t)}};e.prototype.fromString=function(t){this.valueBlock.valueHexView=new Uint8Array(u.Convert.FromUtf8String(t));this.valueBlock.value=t};return e}(Ft);Lt.NAME="Utf8StringValueBlock";var Vt;var Gt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=12;return i}return e}(Lt);Vt=Gt;(function(){G.Utf8String=Vt})();Gt.NAME="UTF8String";var Wt=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.fromBuffer=function(t){this.valueBlock.value=u.Convert.ToUtf16String(t);this.valueBlock.valueHexView=u.BufferSourceConverter.toUint8Array(t)};e.prototype.fromString=function(t){this.valueBlock.value=t;this.valueBlock.valueHexView=new Uint8Array(u.Convert.FromUtf16String(t))};return e}(Ft);Wt.NAME="BmpStringValueBlock";var Qt;var qt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=__rest(e,[]);i=t.call(this,r)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=30;return i}return e}(Wt);Qt=qt;(function(){G.BmpString=Qt})();qt.NAME="BMPString";var zt=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.fromBuffer=function(t){var e=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0);var i=new Uint8Array(e);for(var r=0;r<i.length;r+=4){i[r]=i[r+3];i[r+1]=i[r+2];i[r+2]=0;i[r+3]=0}this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(e))};e.prototype.fromString=function(t){var e=t.length;var i=this.valueBlock.valueHexView=new Uint8Array(e*4);for(var r=0;r<e;r++){var n=v(t.charCodeAt(r),8);var a=new Uint8Array(n);if(a.length>4)continue;var o=4-a.length;for(var s=a.length-1;s>=0;s--)i[r*4+s+o]=a[s]}this.valueBlock.value=t};return e}(Ft);zt.NAME="UniversalStringValueBlock";var Yt;var Zt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=__rest(e,[]);i=t.call(this,r)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=28;return i}return e}(zt);Yt=Zt;(function(){G.UniversalString=Yt})();Zt.NAME="UniversalString";var $t;var Xt=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=18;return i}return e}(Ft);$t=Xt;(function(){G.NumericString=$t})();Xt.NAME="NumericString";var Jt;var te=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=19;return i}return e}(Ft);Jt=te;(function(){G.PrintableString=Jt})();te.NAME="PrintableString";var ee;var ie=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=20;return i}return e}(Ft);ee=ie;(function(){G.TeletexString=ee})();ie.NAME="TeletexString";var re;var ne=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=21;return i}return e}(Ft);re=ne;(function(){G.VideotexString=re})();ne.NAME="VideotexString";var ae;var oe=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=22;return i}return e}(Ft);ae=oe;(function(){G.IA5String=ae})();oe.NAME="IA5String";var se;var ue=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=25;return i}return e}(Ft);se=ue;(function(){G.GraphicString=se})();ue.NAME="GraphicString";var ce;var fe=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=26;return i}return e}(Ft);ce=fe;(function(){G.VisibleString=ce})();fe.NAME="VisibleString";var ve;var he=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=27;return i}return e}(Ft);ve=he;(function(){G.GeneralString=ve})();he.NAME="GeneralString";var de;var le=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=29;return i}return e}(Ft);de=le;(function(){G.CharacterString=de})();le.NAME="CharacterString";var pe;var ye=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=e.valueDate,a=__rest(e,["value","valueDate"]);i=t.call(this,a)||this;i.year=0;i.month=0;i.day=0;i.hour=0;i.minute=0;i.second=0;if(r){i.fromString(r);i.valueBlock.valueHexView=new Uint8Array(r.length);for(var o=0;o<r.length;o++)i.valueBlock.valueHexView[o]=r.charCodeAt(o)}if(n){i.fromDate(n);i.valueBlock.valueHexView=new Uint8Array(i.toBuffer())}i.idBlock.tagClass=1;i.idBlock.tagNumber=23;return i}e.prototype.fromBuffer=function(t){this.fromString(String.fromCharCode.apply(null,u.BufferSourceConverter.toUint8Array(t)))};e.prototype.toBuffer=function(){var t=this.toString();var e=new ArrayBuffer(t.length);var i=new Uint8Array(e);for(var r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return e};e.prototype.fromDate=function(t){this.year=t.getUTCFullYear();this.month=t.getUTCMonth()+1;this.day=t.getUTCDate();this.hour=t.getUTCHours();this.minute=t.getUTCMinutes();this.second=t.getUTCSeconds()};e.prototype.toDate=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))};e.prototype.fromString=function(t){var e=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/gi;var i=e.exec(t);if(i===null){this.error="Wrong input string for conversion";return}var r=parseInt(i[1],10);if(r>=50)this.year=1900+r;else this.year=2e3+r;this.month=parseInt(i[2],10);this.day=parseInt(i[3],10);this.hour=parseInt(i[4],10);this.minute=parseInt(i[5],10);this.second=parseInt(i[6],10)};e.prototype.toString=function(e){if(e===void 0){e="iso"}if(e==="iso"){var i=new Array(7);i[0]=y(this.year<2e3?this.year-1900:this.year-2e3,2);i[1]=y(this.month,2);i[2]=y(this.day,2);i[3]=y(this.hour,2);i[4]=y(this.minute,2);i[5]=y(this.second,2);i[6]="Z";return i.join("")}return t.prototype.toString.call(this,e)};e.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.toDate().toISOString())};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second})};return e}(fe);pe=ye;(function(){G.UTCTime=pe})();ye.NAME="UTCTime";var Se;var Ae=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i;var r=t.call(this,e)||this;(i=r.millisecond)!==null&&i!==void 0?i:r.millisecond=0;r.idBlock.tagClass=1;r.idBlock.tagNumber=24;return r}e.prototype.fromDate=function(e){t.prototype.fromDate.call(this,e);this.millisecond=e.getUTCMilliseconds()};e.prototype.toDate=function(){var t=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(t)};e.prototype.fromString=function(t){var e=false;var i="";var r="";var n=0;var a;var o=0;var s=0;if(t[t.length-1]==="Z"){i=t.substring(0,t.length-1);e=true}else{var u=new Number(t[t.length-1]);if(isNaN(u.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(e){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{var c=1;var f=i.indexOf("+");var v="";if(f===-1){f=i.indexOf("-");c=-1}if(f!==-1){v=i.substring(f+1);i=i.substring(0,f);if(v.length!==2&&v.length!==4)throw new Error("Wrong input string for conversion");var u=parseInt(v.substring(0,2),10);if(isNaN(u.valueOf()))throw new Error("Wrong input string for conversion");o=c*u;if(v.length===4){u=parseInt(v.substring(2,4),10);if(isNaN(u.valueOf()))throw new Error("Wrong input string for conversion");s=c*u}}}var h=i.indexOf(".");if(h===-1)h=i.indexOf(",");if(h!==-1){var d=new Number("0".concat(i.substring(h)));if(isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");n=d.valueOf();r=i.substring(0,h)}else r=i;switch(true){case r.length===8:a=/(\d{4})(\d{2})(\d{2})/gi;if(h!==-1)throw new Error("Wrong input string for conversion");break;case r.length===10:a=/(\d{4})(\d{2})(\d{2})(\d{2})/gi;if(h!==-1){var l=60*n;this.minute=Math.floor(l);l=60*(l-this.minute);this.second=Math.floor(l);l=1e3*(l-this.second);this.millisecond=Math.floor(l)}break;case r.length===12:a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(h!==-1){var l=60*n;this.second=Math.floor(l);l=1e3*(l-this.second);this.millisecond=Math.floor(l)}break;case r.length===14:a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(h!==-1){var l=1e3*n;this.millisecond=Math.floor(l)}break;default:throw new Error("Wrong input string for conversion")}var p=a.exec(r);if(p===null)throw new Error("Wrong input string for conversion");for(var y=1;y<p.length;y++){switch(y){case 1:this.year=parseInt(p[y],10);break;case 2:this.month=parseInt(p[y],10);break;case 3:this.day=parseInt(p[y],10);break;case 4:this.hour=parseInt(p[y],10)+o;break;case 5:this.minute=parseInt(p[y],10)+s;break;case 6:this.second=parseInt(p[y],10);break;default:throw new Error("Wrong input string for conversion")}}if(e===false){var S=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=S.getUTCFullYear();this.month=S.getUTCMonth();this.day=S.getUTCDay();this.hour=S.getUTCHours();this.minute=S.getUTCMinutes();this.second=S.getUTCSeconds();this.millisecond=S.getUTCMilliseconds()}};e.prototype.toString=function(e){if(e===void 0){e="iso"}if(e==="iso"){var i=[];i.push(y(this.year,4));i.push(y(this.month,2));i.push(y(this.day,2));i.push(y(this.hour,2));i.push(y(this.minute,2));i.push(y(this.second,2));if(this.millisecond!==0){i.push(".");i.push(y(this.millisecond,3))}i.push("Z");return i.join("")}return t.prototype.toString.call(this,e)};e.prototype.toJSON=function(){return __assign(__assign({},t.prototype.toJSON.call(this)),{millisecond:this.millisecond})};return e}(ye);Se=Ae;(function(){G.GeneralizedTime=Se})();Ae.NAME="GeneralizedTime";var Ce;var me=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=31;return i}return e}(Gt);Ce=me;(function(){G.DATE=Ce})();me.NAME="DATE";var ge;var we=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=32;return i}return e}(Gt);ge=we;(function(){G.TimeOfDay=ge})();we.NAME="TimeOfDay";var _e;var be=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=33;return i}return e}(Gt);_e=be;(function(){G.DateTime=_e})();be.NAME="DateTime";var Ee;var Pe=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=34;return i}return e}(Gt);Ee=Pe;(function(){G.Duration=Ee})();Pe.NAME="Duration";var De;var Ie=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;i.idBlock.tagClass=1;i.idBlock.tagNumber=14;return i}return e}(Gt);De=Ie;(function(){G.TIME=De})();Ie.NAME="TIME";var Be=function(){function t(t){var e=t===void 0?{}:t,i=e.name,r=i===void 0?k:i,n=e.optional,a=n===void 0?false:n;this.name=r;this.optional=a}return t}();var xe=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=r===void 0?[]:r,a=__rest(e,["value"]);i=t.call(this,a)||this;i.value=n;return i}return e}(Be);var Te=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=this;var r=e.value,n=r===void 0?new Be:r,a=e.local,o=a===void 0?false:a,s=__rest(e,["value","local"]);i=t.call(this,s)||this;i.value=n;i.local=o;return i}return e}(Be);var Oe=function(){function t(t){var e=t===void 0?{}:t,i=e.data,r=i===void 0?R:i;this.dataView=u.BufferSourceConverter.toUint8Array(r)}Object.defineProperty(t.prototype,"data",{get:function(){return this.dataView.slice().buffer},set:function(t){this.dataView=u.BufferSourceConverter.toUint8Array(t)},enumerable:false,configurable:true});t.prototype.fromBER=function(t,e,i){var r=e+i;this.dataView=u.BufferSourceConverter.toUint8Array(t).subarray(e,r);return r};t.prototype.toBER=function(t){return this.dataView.slice().buffer};return t}();function ke(t,e,i){if(i instanceof xe){for(var r=0,n=i.value;r<n.length;r++){var a=n[r];var o=ke(t,e,a);if(o.verified){return{verified:true,result:t}}}{var s={verified:false,result:{error:"Wrong values for Choice type"}};if(i.hasOwnProperty(_))s.name=i.name;return s}}if(i instanceof Be){if(i.hasOwnProperty(_))t[i.name]=e;return{verified:true,result:t}}if(t instanceof Object===false){return{verified:false,result:{error:"Wrong root object"}}}if(e instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 data"}}}if(i instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(P in i===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(x in i.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(T in i.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}var u=i.idBlock.toBER(false);if(u.byteLength===0){return{verified:false,result:{error:"Error encoding idBlock for ASN.1 schema"}}}var c=i.idBlock.fromBER(u,0,u.byteLength);if(c===-1){return{verified:false,result:{error:"Error decoding idBlock for ASN.1 schema"}}}if(i.idBlock.hasOwnProperty(D)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.tagClass!==e.idBlock.tagClass){return{verified:false,result:t}}if(i.idBlock.hasOwnProperty(I)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.tagNumber!==e.idBlock.tagNumber){return{verified:false,result:t}}if(i.idBlock.hasOwnProperty(B)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.isConstructed!==e.idBlock.isConstructed){return{verified:false,result:t}}if(!(E in i.idBlock)){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.isHexOnly!==e.idBlock.isHexOnly){return{verified:false,result:t}}if(i.idBlock.isHexOnly){if(b in i.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}var f=i.idBlock.valueHexView;var v=e.idBlock.valueHexView;if(f.length!==v.length){return{verified:false,result:t}}for(var h=0;h<f.length;h++){if(f[h]!==v[1]){return{verified:false,result:t}}}}if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name)t[i.name]=e}if(i instanceof G.Constructed){var d=0;var o={verified:false,result:{error:"Unknown error"}};var l=i.valueBlock.value.length;if(l>0){if(i.valueBlock.value[0]instanceof Te){l=e.valueBlock.value.length}}if(l===0){return{verified:true,result:t}}if(e.valueBlock.value.length===0&&i.valueBlock.value.length!==0){var p=true;for(var h=0;h<i.valueBlock.value.length;h++)p=p&&(i.valueBlock.value[h].optional||false);if(p){return{verified:true,result:t}}if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name)delete t[i.name]}t.error="Inconsistent object length";return{verified:false,result:t}}for(var h=0;h<l;h++){if(h-d>=e.valueBlock.value.length){if(i.valueBlock.value[h].optional===false){var s={verified:false,result:t};t.error="Inconsistent length between ASN.1 data and schema";if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name){delete t[i.name];s.name=i.name}}return s}}else{if(i.valueBlock.value[0]instanceof Te){o=ke(t,e.valueBlock.value[h],i.valueBlock.value[0].value);if(o.verified===false){if(i.valueBlock.value[0].optional)d++;else{if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name)delete t[i.name]}return o}}if(_ in i.valueBlock.value[0]&&i.valueBlock.value[0].name.length>0){var y={};if(O in i.valueBlock.value[0]&&i.valueBlock.value[0].local)y=e;else y=t;if(typeof y[i.valueBlock.value[0].name]==="undefined")y[i.valueBlock.value[0].name]=[];y[i.valueBlock.value[0].name].push(e.valueBlock.value[h])}}else{o=ke(t,e.valueBlock.value[h-d],i.valueBlock.value[h]);if(o.verified===false){if(i.valueBlock.value[h].optional)d++;else{if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name)delete t[i.name]}return o}}}}}if(o.verified===false){var s={verified:false,result:t};if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name){delete t[i.name];s.name=i.name}}return s}return{verified:true,result:t}}if(i.primitiveSchema&&b in e.valueBlock){var S=X(e.valueBlock.valueHexView);if(S.offset===-1){var s={verified:false,result:S.result};if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,k);if(i.name){delete t[i.name];s.name=i.name}}return s}return ke(t,S.result,i.primitiveSchema)}return{verified:true,result:t}}function Me(t,e){if(e instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema type"}}}var i=X(u.BufferSourceConverter.toUint8Array(t));if(i.offset===-1){return{verified:false,result:i.result}}return ke(i.result,i.result,e)}var Re=Object.freeze({__proto__:null,Any:Be,BaseBlock:W,BaseStringBlock:q,BitString:St,BmpString:qt,Boolean:vt,CharacterString:le,Choice:xe,Constructed:rt,DATE:me,DateTime:be,Duration:Pe,EndOfContent:ot,Enumerated:Pt,GeneralString:he,GeneralizedTime:Ae,GraphicString:ue,HexBlock:H,IA5String:oe,Integer:bt,Null:ut,NumericString:Xt,ObjectIdentifier:xt,OctetString:lt,Primitive:Z,PrintableString:te,RawData:Oe,RelativeObjectIdentifier:Mt,Repeated:Te,Sequence:Nt,Set:jt,TIME:Ie,TeletexString:ie,TimeOfDay:we,UTCTime:ye,UniversalString:Zt,Utf8String:Gt,ValueBlock:F,VideotexString:ne,ViewWriter:m,VisibleString:fe,compareSchema:ke,fromBER:J,verifySchema:Me});var Ne;t("bw",Ne);(function(t){t[t["Sequence"]=0]="Sequence";t[t["Set"]=1]="Set";t[t["Choice"]=2]="Choice"})(Ne||t("bw",Ne={}));var Ke;t("bu",Ke);(function(t){t[t["Any"]=1]="Any";t[t["Boolean"]=2]="Boolean";t[t["OctetString"]=3]="OctetString";t[t["BitString"]=4]="BitString";t[t["Integer"]=5]="Integer";t[t["Enumerated"]=6]="Enumerated";t[t["ObjectIdentifier"]=7]="ObjectIdentifier";t[t["Utf8String"]=8]="Utf8String";t[t["BmpString"]=9]="BmpString";t[t["UniversalString"]=10]="UniversalString";t[t["NumericString"]=11]="NumericString";t[t["PrintableString"]=12]="PrintableString";t[t["TeletexString"]=13]="TeletexString";t[t["VideotexString"]=14]="VideotexString";t[t["IA5String"]=15]="IA5String";t[t["GraphicString"]=16]="GraphicString";t[t["VisibleString"]=17]="VisibleString";t[t["GeneralString"]=18]="GeneralString";t[t["CharacterString"]=19]="CharacterString";t[t["UTCTime"]=20]="UTCTime";t[t["GeneralizedTime"]=21]="GeneralizedTime";t[t["DATE"]=22]="DATE";t[t["TimeOfDay"]=23]="TimeOfDay";t[t["DateTime"]=24]="DateTime";t[t["Duration"]=25]="Duration";t[t["TIME"]=26]="TIME";t[t["Null"]=27]="Null"})(Ke||t("bu",Ke={}));var je=function(){function t(t,e){if(e===void 0){e=0}this.unusedBits=0;this.value=new ArrayBuffer(0);if(t){if(typeof t==="number"){this.fromNumber(t)}else if(u.BufferSourceConverter.isBufferSource(t)){this.unusedBits=e;this.value=u.BufferSourceConverter.toArrayBuffer(t)}else{throw TypeError("Unsupported type of 'params' argument for BitString")}}}t.prototype.fromASN=function(t){if(!(t instanceof St)){throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString")}this.unusedBits=t.valueBlock.unusedBits;this.value=t.valueBlock.valueHex;return this};t.prototype.toASN=function(){return new St({unusedBits:this.unusedBits,valueHex:this.value})};t.prototype.toSchema=function(t){return new St({name:t})};t.prototype.toNumber=function(){var t="";var e=new Uint8Array(this.value);for(var i=0,r=e;i<r.length;i++){var n=r[i];t+=n.toString(2).padStart(8,"0")}t=t.split("").reverse().join("");if(this.unusedBits){t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")}return parseInt(t,2)};t.prototype.fromNumber=function(t){var e=t.toString(2);var i=e.length+7>>3;this.unusedBits=(i<<3)-e.length;var r=new Uint8Array(i);e=e.padStart(i<<3,"0").split("").reverse().join("");var n=0;while(n<i){r[n]=parseInt(e.slice(n<<3,(n<<3)+8),2);n++}this.value=r.buffer};return t}();var He=function(){function t(t){if(typeof t==="number"){this.buffer=new ArrayBuffer(t)}else{if(u.BufferSourceConverter.isBufferSource(t)){this.buffer=u.BufferSourceConverter.toArrayBuffer(t)}else if(Array.isArray(t)){this.buffer=new Uint8Array(t)}else{this.buffer=new ArrayBuffer(0)}}}Object.defineProperty(t.prototype,"byteLength",{get:function(){return this.buffer.byteLength},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"byteOffset",{get:function(){return 0},enumerable:false,configurable:true});t.prototype.fromASN=function(t){if(!(t instanceof lt)){throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString")}this.buffer=t.valueBlock.valueHex;return this};t.prototype.toASN=function(){return new lt({valueHex:this.buffer})};t.prototype.toSchema=function(t){return new lt({name:t})};return t}();t("a0",He);var Ue={fromASN:function(t){return t instanceof ut?null:t.valueBeforeDecodeView},toASN:function(t){if(t===null){return new ut}var e=J(t);if(e.result.error){throw new Error(e.result.error)}return e.result}};var Fe={fromASN:function(t){return t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec},toASN:function(t){return new bt({value:+t})}};var Le={fromASN:function(t){return t.valueBlock.valueDec},toASN:function(t){return new Pt({value:t})}};var Ve=t("bA",{fromASN:function(t){return t.valueBlock.valueHexView},toASN:function(t){return new bt({valueHex:t})}});var Ge={fromASN:function(t){return t.valueBlock.valueHexView},toASN:function(t){return new St({valueHex:t})}};var We={fromASN:function(t){return t.valueBlock.toString()},toASN:function(t){return new xt({value:t})}};var Qe={fromASN:function(t){return t.valueBlock.value},toASN:function(t){return new vt({value:t})}};var qe={fromASN:function(t){return t.valueBlock.valueHexView},toASN:function(t){return new lt({valueHex:t})}};var ze={fromASN:function(t){return new He(t.getValue())},toASN:function(t){return t.toASN()}};function Ye(t){return{fromASN:function(t){return t.valueBlock.value},toASN:function(e){return new t({value:e})}}}var Ze=Ye(Gt);var $e=Ye(qt);var Xe=Ye(Zt);var Je=Ye(Xt);var ti=Ye(te);var ei=Ye(ie);var ii=Ye(ne);var ri=Ye(oe);var ni=Ye(ue);var ai=Ye(fe);var oi=Ye(he);var si=Ye(le);var ui={fromASN:function(t){return t.toDate()},toASN:function(t){return new ye({valueDate:t})}};var ci={fromASN:function(t){return t.toDate()},toASN:function(t){return new Ae({valueDate:t})}};var fi={fromASN:function(){return null},toASN:function(){return new ut}};function vi(t){switch(t){case Ke.Any:return Ue;case Ke.BitString:return Ge;case Ke.BmpString:return $e;case Ke.Boolean:return Qe;case Ke.CharacterString:return si;case Ke.Enumerated:return Le;case Ke.GeneralString:return oi;case Ke.GeneralizedTime:return ci;case Ke.GraphicString:return ni;case Ke.IA5String:return ri;case Ke.Integer:return Fe;case Ke.Null:return fi;case Ke.NumericString:return Je;case Ke.ObjectIdentifier:return We;case Ke.OctetString:return qe;case Ke.PrintableString:return ti;case Ke.TeletexString:return ei;case Ke.UTCTime:return ui;case Ke.UniversalString:return Xe;case Ke.Utf8String:return Ze;case Ke.VideotexString:return ii;case Ke.VisibleString:return ai;default:return null}}function hi(t){if(typeof t==="function"&&t.prototype){if(t.prototype.toASN&&t.prototype.fromASN){return true}else{return hi(t.prototype)}}else{return!!(t&&typeof t==="object"&&"toASN"in t&&"fromASN"in t)}}function di(t){var e;if(t){var i=Object.getPrototypeOf(t);if(((e=i===null||i===void 0?void 0:i.prototype)===null||e===void 0?void 0:e.constructor)===Array){return true}return di(i)}return false}function li(t,e){if(!(t&&e)){return false}if(t.byteLength!==e.byteLength){return false}var i=new Uint8Array(t);var r=new Uint8Array(e);for(var n=0;n<t.byteLength;n++){if(i[n]!==r[n]){return false}}return true}var pi=function(){function t(){this.items=new WeakMap}t.prototype.has=function(t){return this.items.has(t)};t.prototype.get=function(t,e){if(e===void 0){e=false}var i=this.items.get(t);if(!i){throw new Error("Cannot get schema for '".concat(t.prototype.constructor.name,"' target"))}if(e&&!i.schema){throw new Error("Schema '".concat(t.prototype.constructor.name,"' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'."))}return i};t.prototype.cache=function(t){var e=this.get(t);if(!e.schema){e.schema=this.create(t,true)}};t.prototype.createDefault=function(t){var e={type:Ne.Sequence,items:{}};var i=this.findParentSchema(t);if(i){Object.assign(e,i);e.items=Object.assign({},e.items,i.items)}return e};t.prototype.create=function(t,e){var i=this.items.get(t)||this.createDefault(t);var r=[];for(var n in i.items){var a=i.items[n];var o=e?n:"";var s=void 0;if(typeof a.type==="number"){var u=Ke[a.type];var c=Re[u];if(!c){throw new Error("Cannot get ASN1 class by name '".concat(u,"'"))}s=new c({name:o})}else if(hi(a.type)){var f=new a.type;s=f.toSchema(o)}else if(a.optional){var v=this.get(a.type);if(v.type===Ne.Choice){s=new Be({name:o})}else{s=this.create(a.type,false);s.name=o}}else{s=new Be({name:o})}var h=!!a.optional||a.defaultValue!==undefined;if(a.repeated){s.name="";var d=a.repeated==="set"?jt:Nt;s=new d({name:"",value:[new Te({name:o,value:s})]})}if(a.context!==null&&a.context!==undefined){if(a.implicit){if(typeof a.type==="number"||hi(a.type)){var d=a.repeated?rt:Z;r.push(new d({name:o,optional:h,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);var l=!!a.repeated;var p=!l?this.get(a.type,true).schema:s;p="valueBlock"in p?p.valueBlock.value:p.value;r.push(new rt({name:!l?o:"",optional:h,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}}else{r.push(new rt({optional:h,idBlock:{tagClass:3,tagNumber:a.context},value:[s]}))}}else{s.optional=h;r.push(s)}}switch(i.type){case Ne.Sequence:return new Nt({value:r,name:""});case Ne.Set:return new jt({value:r,name:""});case Ne.Choice:return new xe({value:r,name:""});default:throw new Error("Unsupported ASN1 type in use")}};t.prototype.set=function(t,e){this.items.set(t,e);return this};t.prototype.findParentSchema=function(t){var e=Object.getPrototypeOf(t);if(e){var i=this.items.get(e);return i||this.findParentSchema(e)}return null};return t}();var yi=new pi;var Si=t("bv",(function(t){return function(e){var i;if(!yi.has(e)){i=yi.createDefault(e);yi.set(e,i)}else{i=yi.get(e)}Object.assign(i,t)}}));var Ai=t("bt",(function(t){return function(e,i){var r;if(!yi.has(e.constructor)){r=yi.createDefault(e.constructor);yi.set(e.constructor,r)}else{r=yi.get(e.constructor)}var n=Object.assign({},t);if(typeof n.type==="number"&&!n.converter){var a=vi(t.type);if(!a){throw new Error("Cannot get default converter for property '".concat(i,"' of ").concat(e.constructor.name))}n.converter=a}n.raw=t.raw;r.items[i]=n}}));var Ci=function(t){__extends(e,t);function e(){var e=t.apply(this,arguments)||this;e.schemas=[];return e}return e}(Error);var mi=function(){function t(){}t.parse=function(t,e){var i=J(t);if(i.result.error){throw new Error(i.result.error)}var r=this.fromASN(i.result,e);return r};t.fromASN=function(t,e){try{if(hi(e)){var i=new e;return i.fromASN(t)}var r=yi.get(e);yi.cache(e);var n=r.schema;var a=this.handleChoiceTypes(t,r,e,n);if(a===null||a===void 0?void 0:a.result){return a.result}if(a===null||a===void 0?void 0:a.targetSchema){n=a.targetSchema}var o=this.handleSequenceTypes(t,r,e,n);var s=new e;if(di(e)){return this.handleArrayTypes(t,r,e)}this.processSchemaItems(r,o,s);return s}catch(t){if(t instanceof Ci){t.schemas.push(e.name)}throw t}};t.handleChoiceTypes=function(t,e,i,r){if(t.constructor===rt&&e.type===Ne.Choice&&t.idBlock.tagClass===3){for(var n in e.items){var a=e.items[n];if(a.context===t.idBlock.tagNumber&&a.implicit){if(typeof a.type==="function"&&yi.has(a.type)){var o=yi.get(a.type);if(o&&o.type===Ne.Sequence){var s=new Nt;if("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&"value"in s.valueBlock){s.valueBlock.value=t.valueBlock.value;var u=this.fromASN(s,a.type);var c=new i;c[n]=u;return{result:c}}}}}}}else if(t.constructor===rt&&e.type!==Ne.Choice){var f=new rt({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:e.schema.valueBlock.value});for(var n in e.items){delete t[n]}return{targetSchema:f}}return null};t.handleSequenceTypes=function(t,e,i,r){if(e.type===Ne.Sequence){var n=ke({},t,r);if(!n.verified){throw new Ci("Data does not match to ".concat(i.name," ASN1 schema.").concat(n.result.error?" ".concat(n.result.error):""))}return n}else{var n=ke({},t,r);if(!n.verified){throw new Ci("Data does not match to ".concat(i.name," ASN1 schema.").concat(n.result.error?" ".concat(n.result.error):""))}return n}};t.processRepeatedField=function(t,e,i){var r=this;var n=t.slice(e);if(n.length===1&&n[0].constructor.name==="Sequence"){var a=n[0];if(a.valueBlock&&a.valueBlock.value&&Array.isArray(a.valueBlock.value)){n=a.valueBlock.value}}if(typeof i.type==="number"){var o=vi(i.type);if(!o)throw new Error("No converter for ASN.1 type ".concat(i.type));return n.filter((function(t){return t&&t.valueBlock})).map((function(t){try{return o.fromASN(t)}catch(t){return undefined}})).filter((function(t){return t!==undefined}))}else{return n.filter((function(t){return t&&t.valueBlock})).map((function(t){try{return r.fromASN(t,i.type)}catch(t){return undefined}})).filter((function(t){return t!==undefined}))}};t.processPrimitiveField=function(t,e){var i=vi(e.type);if(!i)throw new Error("No converter for ASN.1 type ".concat(e.type));return i.fromASN(t)};t.isOptionalChoiceField=function(t){return t.optional&&typeof t.type==="function"&&yi.has(t.type)&&yi.get(t.type).type===Ne.Choice};t.processOptionalChoiceField=function(t,e){try{var i=this.fromASN(t,e.type);return{processed:true,value:i}}catch(t){if(t instanceof Ci&&/Wrong values for Choice type/.test(t.message)){return{processed:false}}throw t}};t.handleArrayTypes=function(t,e,i){var r=this;if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}var n=e.itemType;if(typeof n==="number"){var a=vi(n);if(!a){throw new Error("Cannot get default converter for array item of ".concat(i.name," ASN1 schema"))}return i.from(t.valueBlock.value,(function(t){return a.fromASN(t)}))}else{return i.from(t.valueBlock.value,(function(t){return r.fromASN(t,n)}))}};t.processSchemaItems=function(t,e,i){for(var r in t.items){var n=e.result[r];if(!n){continue}var a=t.items[r];var o=a.type;var s=void 0;if(typeof o==="number"||hi(o)){s=this.processPrimitiveSchemaItem(n,a,o)}else{s=this.processComplexSchemaItem(n,a,o)}if(s&&typeof s==="object"&&"value"in s&&"raw"in s){i[r]=s.value;i["".concat(r,"Raw")]=s.raw}else{i[r]=s}}};t.processPrimitiveSchemaItem=function(t,e,i){var r;var n=(r=e.converter)!==null&&r!==void 0?r:hi(i)?new i:null;if(!n){throw new Error("Converter is empty")}if(e.repeated){return this.processRepeatedPrimitiveItem(t,e,n)}else{return this.processSinglePrimitiveItem(t,e,i,n)}};t.processRepeatedPrimitiveItem=function(t,e,i){if(e.implicit){var r=e.repeated==="sequence"?Nt:jt;var n=new r;n.valueBlock=t.valueBlock;var a=J(n.toBER(false));if(a.offset===-1){throw new Error("Cannot parse the child item. ".concat(a.result.error))}if(!("value"in a.result.valueBlock&&Array.isArray(a.result.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}var o=a.result.valueBlock.value;return Array.from(o,(function(t){return i.fromASN(t)}))}else{return Array.from(t,(function(t){return i.fromASN(t)}))}};t.processSinglePrimitiveItem=function(t,e,i,r){var n=t;if(e.implicit){var a=void 0;if(hi(i)){a=(new i).toSchema("")}else{var o=Ke[i];var s=Re[o];if(!s){throw new Error("Cannot get '".concat(o,"' class from asn1js module"))}a=new s}a.valueBlock=n.valueBlock;n=J(a.toBER(false)).result}return r.fromASN(n)};t.processComplexSchemaItem=function(t,e,i){var r=this;if(e.repeated){if(!Array.isArray(t)){throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.")}return Array.from(t,(function(t){return r.fromASN(t,i)}))}else{var n=this.handleImplicitTagging(t,e,i);if(this.isOptionalChoiceField(e)){try{return this.fromASN(n,i)}catch(t){if(t instanceof Ci&&/Wrong values for Choice type/.test(t.message)){return undefined}throw t}}else{var a=this.fromASN(n,i);if(e.raw){return{value:a,raw:t.valueBeforeDecodeView}}return a}}};t.handleImplicitTagging=function(t,e,i){if(e.implicit&&typeof e.context==="number"){var r=yi.get(i);if(r.type===Ne.Sequence){var n=new Nt;if("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&"value"in n.valueBlock){n.valueBlock.value=t.valueBlock.value;return n}}else if(r.type===Ne.Set){var a=new jt;if("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&"value"in a.valueBlock){a.valueBlock.value=t.valueBlock.value;return a}}}return t};return t}();t("q",mi);var gi=function(){function t(){}t.serialize=function(t){if(t instanceof W){return t.toBER(false)}return this.toASN(t).toBER(false)};t.toASN=function(e){var i=this;if(e&&typeof e==="object"&&hi(e)){return e.toASN()}if(!(e&&typeof e==="object")){throw new TypeError("Parameter 1 should be type of Object.")}var r=e.constructor;var n=yi.get(r);yi.cache(r);var a=[];if(n.itemType){if(!Array.isArray(e)){throw new TypeError("Parameter 1 should be type of Array.")}if(typeof n.itemType==="number"){var o=vi(n.itemType);if(!o){throw new Error("Cannot get default converter for array item of ".concat(r.name," ASN1 schema"))}a=e.map((function(t){return o.toASN(t)}))}else{a=e.map((function(t){return i.toAsnItem({type:n.itemType},"[]",r,t)}))}}else{for(var s in n.items){var u=n.items[s];var c=e[s];if(c===undefined||u.defaultValue===c||typeof u.defaultValue==="object"&&typeof c==="object"&&li(this.serialize(u.defaultValue),this.serialize(c))){continue}var f=t.toAsnItem(u,s,r,c);if(typeof u.context==="number"){if(u.implicit){if(!u.repeated&&(typeof u.type==="number"||hi(u.type))){var v={};v.valueHex=f instanceof ut?f.valueBeforeDecodeView:f.valueBlock.toBER();a.push(new Z(__assign({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context}},v)))}else{a.push(new rt({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:f.valueBlock.value}))}}else{a.push(new rt({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:[f]}))}}else if(u.repeated){a=a.concat(f)}else{a.push(f)}}}var h;switch(n.type){case Ne.Sequence:h=new Nt({value:a});break;case Ne.Set:h=new jt({value:a});break;case Ne.Choice:if(!a[0]){throw new Error("Schema '".concat(r.name,"' has wrong data. Choice cannot be empty."))}h=a[0];break}return h};t.toAsnItem=function(t,e,i,r){var n=this;var a;if(typeof t.type==="number"){var o=t.converter;if(!o){throw new Error("Property '".concat(e,"' doesn't have converter for type ").concat(Ke[t.type]," in schema '").concat(i.name,"'"))}if(t.repeated){if(!Array.isArray(r)){throw new TypeError("Parameter 'objProp' should be type of Array.")}var s=Array.from(r,(function(t){return o.toASN(t)}));var u=t.repeated==="sequence"?Nt:jt;a=new u({value:s})}else{a=o.toASN(r)}}else{if(t.repeated){if(!Array.isArray(r)){throw new TypeError("Parameter 'objProp' should be type of Array.")}var s=Array.from(r,(function(t){return n.toASN(t)}));var u=t.repeated==="sequence"?Nt:jt;a=new u({value:s})}else{a=this.toASN(r)}}return a};return t}();var wi=function(t){__extends(e,t);function e(e){if(e===void 0){e=[]}var i=this;if(typeof e==="number"){i=t.call(this,e)||this}else{i=t.call(this)||this;for(var r=0,n=e;r<n.length;r++){var a=n[r];i.push(a)}}return i}return e}(Array);t("bx",wi);var _i=function(){function t(){}t.serialize=function(t){return gi.serialize(t)};t.parse=function(t,e){return mi.parse(t,e)};t.toString=function(e){var i=u.BufferSourceConverter.isBufferSource(e)?u.BufferSourceConverter.toArrayBuffer(e):t.serialize(e);var r=J(i);if(r.offset===-1){throw new Error("Cannot decode ASN.1 data. ".concat(r.result.error))}return r.result.toString()};return t}();t("e",_i);function bi(t,e,i,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(t,e,i,r);else for(var s=t.length-1;s>=0;s--)if(o=t[s])a=(n<3?o(a):n>3?o(e,i,a):o(e,i))||a;return n>3&&a&&Object.defineProperty(e,i,a),a}typeof SuppressedError==="function"?SuppressedError:function(t,e,i){var r=new Error(i);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};var Ei=function(){function t(){}t.isIPv4=function(t){return/^(\d{1,3}\.){3}\d{1,3}$/.test(t)};t.parseIPv4=function(t){var e=t.split(".");if(e.length!==4){throw new Error("Invalid IPv4 address")}return e.map((function(t){var e=parseInt(t,10);if(isNaN(e)||e<0||e>255){throw new Error("Invalid IPv4 address part")}return e}))};t.parseIPv6=function(t){var e=this.expandIPv6(t);var i=e.split(":");if(i.length!==8){throw new Error("Invalid IPv6 address")}return i.reduce((function(t,e){var i=parseInt(e,16);if(isNaN(i)||i<0||i>65535){throw new Error("Invalid IPv6 address part")}t.push(i>>8&255);t.push(i&255);return t}),[])};t.expandIPv6=function(t){if(!t.includes("::")){return t}var e=t.split("::");if(e.length>2){throw new Error("Invalid IPv6 address")}var i=e[0]?e[0].split(":"):[];var r=e[1]?e[1].split(":"):[];var n=8-(i.length+r.length);if(n<0){throw new Error("Invalid IPv6 address")}return __spreadArray(__spreadArray(__spreadArray([],i,true),Array(n).fill("0"),true),r,true).join(":")};t.formatIPv6=function(t){var e=[];for(var i=0;i<16;i+=2){e.push((t[i]<<8|t[i+1]).toString(16))}return this.compressIPv6(e.join(":"))};t.compressIPv6=function(t){var e=t.split(":");var i=-1;var r=0;var n=-1;var a=0;for(var o=0;o<e.length;o++){if(e[o]==="0"){if(n===-1){n=o}a++}else{if(a>r){i=n;r=a}n=-1;a=0}}if(a>r){i=n;r=a}if(r>1){var s=e.slice(0,i).join(":");var u=e.slice(i+r).join(":");return"".concat(s,"::").concat(u)}return t};t.parseCIDR=function(t){var e=t.split("/"),i=e[0],r=e[1];var n=parseInt(r,10);if(this.isIPv4(i)){if(n<0||n>32){throw new Error("Invalid IPv4 prefix length")}return[this.parseIPv4(i),n]}else{if(n<0||n>128){throw new Error("Invalid IPv6 prefix length")}return[this.parseIPv6(i),n]}};t.decodeIP=function(t){if(t.length===64&&parseInt(t,16)===0){return"::/0"}if(t.length!==16){return t}var e=parseInt(t.slice(8),16).toString(2).split("").reduce((function(t,e){return t+ +e}),0);var i=t.slice(0,8).replace(/(.{2})/g,(function(t){return"".concat(parseInt(t,16),".")}));i=i.slice(0,-1);return"".concat(i,"/").concat(e)};t.toString=function(t){var e=new Uint8Array(t);if(e.length===4){return Array.from(e).join(".")}if(e.length===16){return this.formatIPv6(e)}if(e.length===8||e.length===32){var i=e.length/2;var r=e.slice(0,i);var n=e.slice(i);var a=e.every((function(t){return t===0}));if(a){return e.length===8?"0.0.0.0/0":"::/0"}var o=n.reduce((function(t,e){return t+(e.toString(2).match(/1/g)||[]).length}),0);if(e.length===8){var s=Array.from(r).join(".");return"".concat(s,"/").concat(o)}else{var s=this.formatIPv6(r);return"".concat(s,"/").concat(o)}}return this.decodeIP(u.Convert.ToHex(t))};t.fromString=function(t){if(t.includes("/")){var e=this.parseCIDR(t),i=e[0],r=e[1];var n=new Uint8Array(i.length);var a=r;for(var o=0;o<n.length;o++){if(a>=8){n[o]=255;a-=8}else if(a>0){n[o]=255<<8-a;a=0}}var s=new Uint8Array(i.length*2);s.set(i,0);s.set(n,i.length);return s.buffer}var u=this.isIPv4(t)?this.parseIPv4(t):this.parseIPv6(t);return new Uint8Array(u).buffer};return t}();var Pi,Di,Ii;var Bi=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}t.prototype.toString=function(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""};return t}();bi([Ai({type:Ke.TeletexString})],Bi.prototype,"teletexString",void 0);bi([Ai({type:Ke.PrintableString})],Bi.prototype,"printableString",void 0);bi([Ai({type:Ke.UniversalString})],Bi.prototype,"universalString",void 0);bi([Ai({type:Ke.Utf8String})],Bi.prototype,"utf8String",void 0);bi([Ai({type:Ke.BmpString})],Bi.prototype,"bmpString",void 0);Bi=bi([Si({type:Ne.Choice})],Bi);var xi=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}var i=t.call(this,e)||this;Object.assign(i,e);return i}e.prototype.toString=function(){return this.ia5String||(this.anyValue?u.Convert.ToHex(this.anyValue):t.prototype.toString.call(this))};return e}(Bi);bi([Ai({type:Ke.IA5String})],xi.prototype,"ia5String",void 0);bi([Ai({type:Ke.Any})],xi.prototype,"anyValue",void 0);xi=bi([Si({type:Ne.Choice})],xi);var Ti=function(){function t(t){if(t===void 0){t={}}this.type="";this.value=new xi;Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Ti.prototype,"type",void 0);bi([Ai({type:xi})],Ti.prototype,"value",void 0);var Oi=Pi=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Pi.prototype);return i}return e}(wi);Oi=Pi=bi([Si({type:Ne.Set,itemType:Ti})],Oi);var ki=Di=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Di.prototype);return i}return e}(wi);ki=Di=bi([Si({type:Ne.Sequence,itemType:Oi})],ki);var Mi=t("bn",Ii=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Ii.prototype);return i}return e}(ki));t("bn",Mi=Ii=bi([Si({type:Ne.Sequence})],Mi));var Ri={fromASN:function(t){return Ei.toString(qe.fromASN(t))},toASN:function(t){return qe.toASN(Ei.fromString(t))}};var Ni=function(){function t(t){if(t===void 0){t={}}this.typeId="";this.value=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("bo",Ni);bi([Ai({type:Ke.ObjectIdentifier})],Ni.prototype,"typeId",void 0);bi([Ai({type:Ke.Any,context:0})],Ni.prototype,"value",void 0);var Ki=function(){function t(t){if(t===void 0){t={}}this.partyName=new Bi;Object.assign(this,t)}return t}();t("br",Ki);bi([Ai({type:Bi,optional:true,context:0,implicit:true})],Ki.prototype,"nameAssigner",void 0);bi([Ai({type:Bi,context:1,implicit:true})],Ki.prototype,"partyName",void 0);var ji=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ni,context:0,implicit:true})],ji.prototype,"otherName",void 0);bi([Ai({type:Ke.IA5String,context:1,implicit:true})],ji.prototype,"rfc822Name",void 0);bi([Ai({type:Ke.IA5String,context:2,implicit:true})],ji.prototype,"dNSName",void 0);bi([Ai({type:Ke.Any,context:3,implicit:true})],ji.prototype,"x400Address",void 0);bi([Ai({type:Mi,context:4,implicit:false})],ji.prototype,"directoryName",void 0);bi([Ai({type:Ki,context:5})],ji.prototype,"ediPartyName",void 0);bi([Ai({type:Ke.IA5String,context:6,implicit:true})],ji.prototype,"uniformResourceIdentifier",void 0);bi([Ai({type:Ke.OctetString,context:7,implicit:true,converter:Ri})],ji.prototype,"iPAddress",void 0);bi([Ai({type:Ke.ObjectIdentifier,context:8,implicit:true})],ji.prototype,"registeredID",void 0);ji=bi([Si({type:Ne.Choice})],ji);var Hi="1.3.6.1.5.5.7";var Ui="".concat(Hi,".1");var Fi="2.5.29";var Li;var Vi=t("bg","".concat(Ui,".1"));var Gi=function(){function t(t){if(t===void 0){t={}}this.accessMethod="";this.accessLocation=new ji;Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Gi.prototype,"accessMethod",void 0);bi([Ai({type:ji})],Gi.prototype,"accessLocation",void 0);var Wi=t("aG",Li=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Li.prototype);return i}return e}(wi));t("aG",Wi=Li=bi([Si({type:Ne.Sequence,itemType:Gi})],Wi));var Qi=t("bf","".concat(Fi,".35"));var qi=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(He);var zi=function(){function t(t){if(t===void 0){t={}}if(t){Object.assign(this,t)}}return t}();t("aF",zi);bi([Ai({type:qi,context:0,optional:true,implicit:true})],zi.prototype,"keyIdentifier",void 0);bi([Ai({type:ji,context:1,optional:true,implicit:true,repeated:"sequence"})],zi.prototype,"authorityCertIssuer",void 0);bi([Ai({type:Ke.Integer,context:2,optional:true,implicit:true,converter:Ve})],zi.prototype,"authorityCertSerialNumber",void 0);var Yi=t("be","".concat(Fi,".19"));var Zi=function(){function t(t){if(t===void 0){t={}}this.cA=false;Object.assign(this,t)}return t}();t("aE",Zi);bi([Ai({type:Ke.Boolean,defaultValue:false})],Zi.prototype,"cA",void 0);bi([Ai({type:Ke.Integer,optional:true})],Zi.prototype,"pathLenConstraint",void 0);var $i;var Xi=$i=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,$i.prototype);return i}return e}(wi);Xi=$i=bi([Si({type:Ne.Sequence,itemType:ji})],Xi);var Ji;var tr=t("bd","".concat(Fi,".29"));var er=t("aD",Ji=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Ji.prototype);return i}return e}(Xi));t("aD",er=Ji=bi([Si({type:Ne.Sequence})],er));var ir;var rr=t("bc","".concat(Fi,".32"));var nr=t("bp",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}t.prototype.toString=function(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""};return t}());bi([Ai({type:Ke.IA5String})],nr.prototype,"ia5String",void 0);bi([Ai({type:Ke.VisibleString})],nr.prototype,"visibleString",void 0);bi([Ai({type:Ke.BmpString})],nr.prototype,"bmpString",void 0);bi([Ai({type:Ke.Utf8String})],nr.prototype,"utf8String",void 0);t("bp",nr=bi([Si({type:Ne.Choice})],nr));var ar=function(){function t(t){if(t===void 0){t={}}this.organization=new nr;this.noticeNumbers=[];Object.assign(this,t)}return t}();bi([Ai({type:nr})],ar.prototype,"organization",void 0);bi([Ai({type:Ke.Integer,repeated:"sequence"})],ar.prototype,"noticeNumbers",void 0);var or=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("bq",or);bi([Ai({type:ar,optional:true})],or.prototype,"noticeRef",void 0);bi([Ai({type:nr,optional:true})],or.prototype,"explicitText",void 0);var sr=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.IA5String})],sr.prototype,"cPSuri",void 0);bi([Ai({type:or})],sr.prototype,"userNotice",void 0);sr=bi([Si({type:Ne.Choice})],sr);var ur=function(){function t(t){if(t===void 0){t={}}this.policyQualifierId="";this.qualifier=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],ur.prototype,"policyQualifierId",void 0);bi([Ai({type:Ke.Any})],ur.prototype,"qualifier",void 0);var cr=function(){function t(t){if(t===void 0){t={}}this.policyIdentifier="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],cr.prototype,"policyIdentifier",void 0);bi([Ai({type:ur,repeated:"sequence",optional:true})],cr.prototype,"policyQualifiers",void 0);var fr=t("aC",ir=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ir.prototype);return i}return e}(wi));t("aC",fr=ir=bi([Si({type:Ne.Sequence,itemType:cr})],fr));var vr=t("aK","".concat(Fi,".20"));var hr=t("a7",function(){function t(t){if(t===void 0){t=0}this.value=t}return t}());bi([Ai({type:Ke.Integer})],hr.prototype,"value",void 0);t("a7",hr=bi([Si({type:Ne.Choice})],hr));var dr=t("aJ","".concat(Fi,".27"));var lr=t("a6",function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(hr));t("a6",lr=bi([Si({type:Ne.Choice})],lr));var pr;var yr=t("bb","".concat(Fi,".31"));var Sr;(function(t){t[t["unused"]=1]="unused";t[t["keyCompromise"]=2]="keyCompromise";t[t["cACompromise"]=4]="cACompromise";t[t["affiliationChanged"]=8]="affiliationChanged";t[t["superseded"]=16]="superseded";t[t["cessationOfOperation"]=32]="cessationOfOperation";t[t["certificateHold"]=64]="certificateHold";t[t["privilegeWithdrawn"]=128]="privilegeWithdrawn";t[t["aACompromise"]=256]="aACompromise"})(Sr||(Sr={}));var Ar=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.toJSON=function(){var t=[];var e=this.toNumber();if(e&Sr.aACompromise){t.push("aACompromise")}if(e&Sr.affiliationChanged){t.push("affiliationChanged")}if(e&Sr.cACompromise){t.push("cACompromise")}if(e&Sr.certificateHold){t.push("certificateHold")}if(e&Sr.cessationOfOperation){t.push("cessationOfOperation")}if(e&Sr.keyCompromise){t.push("keyCompromise")}if(e&Sr.privilegeWithdrawn){t.push("privilegeWithdrawn")}if(e&Sr.superseded){t.push("superseded")}if(e&Sr.unused){t.push("unused")}return t};e.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return e}(je);var Cr=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:ji,context:0,repeated:"sequence",implicit:true})],Cr.prototype,"fullName",void 0);bi([Ai({type:Oi,context:1,implicit:true})],Cr.prototype,"nameRelativeToCRLIssuer",void 0);Cr=bi([Si({type:Ne.Choice})],Cr);var mr=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Cr,context:0,optional:true})],mr.prototype,"distributionPoint",void 0);bi([Ai({type:Ar,context:1,optional:true,implicit:true})],mr.prototype,"reasons",void 0);bi([Ai({type:ji,context:2,optional:true,repeated:"sequence",implicit:true})],mr.prototype,"cRLIssuer",void 0);var gr=t("aB",pr=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,pr.prototype);return i}return e}(wi));t("aB",gr=pr=bi([Si({type:Ne.Sequence,itemType:mr})],gr));var wr;var _r=wr=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,wr.prototype);return i}return e}(gr);_r=wr=bi([Si({type:Ne.Sequence,itemType:mr})],_r);var br=t("ba","".concat(Fi,".28"));var Er=function(){function t(e){if(e===void 0){e={}}this.onlyContainsUserCerts=t.ONLY;this.onlyContainsCACerts=t.ONLY;this.indirectCRL=t.ONLY;this.onlyContainsAttributeCerts=t.ONLY;Object.assign(this,e)}return t}();t("aA",Er);Er.ONLY=false;bi([Ai({type:Cr,context:0,optional:true})],Er.prototype,"distributionPoint",void 0);bi([Ai({type:Ke.Boolean,context:1,defaultValue:Er.ONLY,implicit:true})],Er.prototype,"onlyContainsUserCerts",void 0);bi([Ai({type:Ke.Boolean,context:2,defaultValue:Er.ONLY,implicit:true})],Er.prototype,"onlyContainsCACerts",void 0);bi([Ai({type:Ar,context:3,optional:true,implicit:true})],Er.prototype,"onlySomeReasons",void 0);bi([Ai({type:Ke.Boolean,context:4,defaultValue:Er.ONLY,implicit:true})],Er.prototype,"indirectCRL",void 0);bi([Ai({type:Ke.Boolean,context:5,defaultValue:Er.ONLY,implicit:true})],Er.prototype,"onlyContainsAttributeCerts",void 0);var Pr=t("b9","".concat(Fi,".21"));var Dr;(function(t){t[t["unspecified"]=0]="unspecified";t[t["keyCompromise"]=1]="keyCompromise";t[t["cACompromise"]=2]="cACompromise";t[t["affiliationChanged"]=3]="affiliationChanged";t[t["superseded"]=4]="superseded";t[t["cessationOfOperation"]=5]="cessationOfOperation";t[t["certificateHold"]=6]="certificateHold";t[t["removeFromCRL"]=8]="removeFromCRL";t[t["privilegeWithdrawn"]=9]="privilegeWithdrawn";t[t["aACompromise"]=10]="aACompromise"})(Dr||(Dr={}));var Ir=t("az",function(){function t(t){if(t===void 0){t=Dr.unspecified}this.reason=Dr.unspecified;this.reason=t}t.prototype.toJSON=function(){return Dr[this.reason]};t.prototype.toString=function(){return this.toJSON()};return t}());bi([Ai({type:Ke.Enumerated})],Ir.prototype,"reason",void 0);t("az",Ir=bi([Si({type:Ne.Choice})],Ir));var Br;var xr=t("b8","".concat(Fi,".37"));var Tr=t("ay",Br=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Br.prototype);return i}return e}(wi));t("ay",Tr=Br=bi([Si({type:Ne.Sequence,itemType:Ke.ObjectIdentifier})],Tr));var Or=t("b7","".concat(Fi,".54"));var kr=t("ax",function(){function t(t){if(t===void 0){t=new ArrayBuffer(0)}this.value=t}return t}());bi([Ai({type:Ke.Integer,converter:Ve})],kr.prototype,"value",void 0);t("ax",kr=bi([Si({type:Ne.Choice})],kr));var Mr=t("b6","".concat(Fi,".24"));var Rr=t("aw",function(){function t(t){this.value=new Date;if(t){this.value=t}}return t}());bi([Ai({type:Ke.GeneralizedTime})],Rr.prototype,"value",void 0);t("aw",Rr=bi([Si({type:Ne.Choice})],Rr));var Nr;var Kr=t("b5","".concat(Fi,".18"));var jr=t("av",Nr=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Nr.prototype);return i}return e}(Xi));t("av",jr=Nr=bi([Si({type:Ne.Sequence})],jr));var Hr=t("b4","".concat(Fi,".15"));var Ur;(function(t){t[t["digitalSignature"]=1]="digitalSignature";t[t["nonRepudiation"]=2]="nonRepudiation";t[t["keyEncipherment"]=4]="keyEncipherment";t[t["dataEncipherment"]=8]="dataEncipherment";t[t["keyAgreement"]=16]="keyAgreement";t[t["keyCertSign"]=32]="keyCertSign";t[t["cRLSign"]=64]="cRLSign";t[t["encipherOnly"]=128]="encipherOnly";t[t["decipherOnly"]=256]="decipherOnly"})(Ur||(Ur={}));var Fr=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.toJSON=function(){var t=this.toNumber();var e=[];if(t&Ur.cRLSign){e.push("crlSign")}if(t&Ur.dataEncipherment){e.push("dataEncipherment")}if(t&Ur.decipherOnly){e.push("decipherOnly")}if(t&Ur.digitalSignature){e.push("digitalSignature")}if(t&Ur.encipherOnly){e.push("encipherOnly")}if(t&Ur.keyAgreement){e.push("keyAgreement")}if(t&Ur.keyCertSign){e.push("keyCertSign")}if(t&Ur.keyEncipherment){e.push("keyEncipherment")}if(t&Ur.nonRepudiation){e.push("nonRepudiation")}return e};e.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return e}(je);t("au",Fr);var Lr;var Vr=t("b3","".concat(Fi,".30"));var Gr=function(){function t(t){if(t===void 0){t={}}this.base=new ji;this.minimum=0;Object.assign(this,t)}return t}();bi([Ai({type:ji})],Gr.prototype,"base",void 0);bi([Ai({type:Ke.Integer,context:0,defaultValue:0,implicit:true})],Gr.prototype,"minimum",void 0);bi([Ai({type:Ke.Integer,context:1,optional:true,implicit:true})],Gr.prototype,"maximum",void 0);var Wr=Lr=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Lr.prototype);return i}return e}(wi);Wr=Lr=bi([Si({type:Ne.Sequence,itemType:Gr})],Wr);var Qr=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("at",Qr);bi([Ai({type:Wr,context:0,optional:true,implicit:true})],Qr.prototype,"permittedSubtrees",void 0);bi([Ai({type:Wr,context:1,optional:true,implicit:true})],Qr.prototype,"excludedSubtrees",void 0);var qr=t("b2","".concat(Fi,".36"));var zr=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("as",zr);bi([Ai({type:Ke.Integer,context:0,implicit:true,optional:true,converter:Ve})],zr.prototype,"requireExplicitPolicy",void 0);bi([Ai({type:Ke.Integer,context:1,implicit:true,optional:true,converter:Ve})],zr.prototype,"inhibitPolicyMapping",void 0);var Yr;var Zr=t("b1","".concat(Fi,".33"));var $r=function(){function t(t){if(t===void 0){t={}}this.issuerDomainPolicy="";this.subjectDomainPolicy="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],$r.prototype,"issuerDomainPolicy",void 0);bi([Ai({type:Ke.ObjectIdentifier})],$r.prototype,"subjectDomainPolicy",void 0);var Xr=t("ar",Yr=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Yr.prototype);return i}return e}(wi));t("ar",Xr=Yr=bi([Si({type:Ne.Sequence,itemType:$r})],Xr));var Jr;var tn=t("b0","".concat(Fi,".17"));var en=t("aq",Jr=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Jr.prototype);return i}return e}(Xi));t("aq",en=Jr=bi([Si({type:Ne.Sequence})],en));var rn=function(){function t(t){if(t===void 0){t={}}this.type="";this.values=[];Object.assign(this,t)}return t}();t("p",rn);bi([Ai({type:Ke.ObjectIdentifier})],rn.prototype,"type",void 0);bi([Ai({type:Ke.Any,repeated:"set"})],rn.prototype,"values",void 0);var nn;var an=t("a$","".concat(Fi,".9"));var on=t("ap",nn=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,nn.prototype);return i}return e}(wi));t("ap",on=nn=bi([Si({type:Ne.Sequence,itemType:rn})],on));var sn=t("a_","".concat(Fi,".14"));var un=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(qi);t("ao",un);var cn=t("aP","".concat(Fi,".16"));var fn=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("ad",fn);bi([Ai({type:Ke.GeneralizedTime,context:0,implicit:true,optional:true})],fn.prototype,"notBefore",void 0);bi([Ai({type:Ke.GeneralizedTime,context:1,implicit:true,optional:true})],fn.prototype,"notAfter",void 0);var vn=t("aO","1.2.840.113533.7.65.0");var hn;(function(t){t[t["keyUpdateAllowed"]=1]="keyUpdateAllowed";t[t["newExtensions"]=2]="newExtensions";t[t["pKIXCertificate"]=4]="pKIXCertificate"})(hn||(hn={}));var dn=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.toJSON=function(){var t=[];var e=this.toNumber();if(e&hn.pKIXCertificate){t.push("pKIXCertificate")}if(e&hn.newExtensions){t.push("newExtensions")}if(e&hn.keyUpdateAllowed){t.push("keyUpdateAllowed")}return t};e.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return e}(je);var ln=function(){function t(t){if(t===void 0){t={}}this.entrustVers="";this.entrustInfoFlags=new dn;Object.assign(this,t)}return t}();t("ac",ln);bi([Ai({type:Ke.GeneralString})],ln.prototype,"entrustVers",void 0);bi([Ai({type:dn})],ln.prototype,"entrustInfoFlags",void 0);var pn;var yn=t("aL","".concat(Ui,".11"));var Sn=t("a8",pn=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,pn.prototype);return i}return e}(wi));t("a8",Sn=pn=bi([Si({type:Ne.Sequence,itemType:Gi})],Sn));var An=function(){function t(t){if(t===void 0){t={}}this.algorithm="";Object.assign(this,t)}t.prototype.isEqual=function(e){return e instanceof t&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&u.isEqual(e.parameters,this.parameters)||e.parameters===this.parameters)};return t}();bi([Ai({type:Ke.ObjectIdentifier})],An.prototype,"algorithm",void 0);bi([Ai({type:Ke.Any,optional:true})],An.prototype,"parameters",void 0);var Cn=function(){function t(t){if(t===void 0){t={}}this.algorithm=new An;this.subjectPublicKey=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:An})],Cn.prototype,"algorithm",void 0);bi([Ai({type:Ke.BitString})],Cn.prototype,"subjectPublicKey",void 0);var mn=function(){function t(t){if(t){if(typeof t==="string"||typeof t==="number"||t instanceof Date){var e=new Date(t);if(e.getUTCFullYear()>2049){this.generalTime=e}else{this.utcTime=e}}else{Object.assign(this,t)}}}t.prototype.getTime=function(){var t=this.utcTime||this.generalTime;if(!t){throw new Error("Cannot get time from CHOICE object")}return t};return t}();bi([Ai({type:Ke.UTCTime})],mn.prototype,"utcTime",void 0);bi([Ai({type:Ke.GeneralizedTime})],mn.prototype,"generalTime",void 0);mn=bi([Si({type:Ne.Choice})],mn);var gn=function(){function t(t){this.notBefore=new mn(new Date);this.notAfter=new mn(new Date);if(t){this.notBefore=new mn(t.notBefore);this.notAfter=new mn(t.notAfter)}}return t}();bi([Ai({type:mn})],gn.prototype,"notBefore",void 0);bi([Ai({type:mn})],gn.prototype,"notAfter",void 0);var wn;var _n=function(){function t(e){if(e===void 0){e={}}this.extnID="";this.critical=t.CRITICAL;this.extnValue=new He;Object.assign(this,e)}return t}();t("a3",_n);_n.CRITICAL=false;bi([Ai({type:Ke.ObjectIdentifier})],_n.prototype,"extnID",void 0);bi([Ai({type:Ke.Boolean,defaultValue:_n.CRITICAL})],_n.prototype,"critical",void 0);bi([Ai({type:He})],_n.prototype,"extnValue",void 0);var bn=wn=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,wn.prototype);return i}return e}(wi);bn=wn=bi([Si({type:Ne.Sequence,itemType:_n})],bn);var En;(function(t){t[t["v1"]=0]="v1";t[t["v2"]=1]="v2";t[t["v3"]=2]="v3"})(En||(En={}));var Pn=function(){function t(t){if(t===void 0){t={}}this.version=En.v1;this.serialNumber=new ArrayBuffer(0);this.signature=new An;this.issuer=new Mi;this.validity=new gn;this.subject=new Mi;this.subjectPublicKeyInfo=new Cn;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,context:0,defaultValue:En.v1})],Pn.prototype,"version",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Pn.prototype,"serialNumber",void 0);bi([Ai({type:An})],Pn.prototype,"signature",void 0);bi([Ai({type:Mi})],Pn.prototype,"issuer",void 0);bi([Ai({type:gn})],Pn.prototype,"validity",void 0);bi([Ai({type:Mi})],Pn.prototype,"subject",void 0);bi([Ai({type:Cn})],Pn.prototype,"subjectPublicKeyInfo",void 0);bi([Ai({type:Ke.BitString,context:1,implicit:true,optional:true})],Pn.prototype,"issuerUniqueID",void 0);bi([Ai({type:Ke.BitString,context:2,implicit:true,optional:true})],Pn.prototype,"subjectUniqueID",void 0);bi([Ai({type:bn,context:3,optional:true})],Pn.prototype,"extensions",void 0);var Dn=function(){function t(t){if(t===void 0){t={}}this.tbsCertificate=new Pn;this.signatureAlgorithm=new An;this.signatureValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("C",Dn);bi([Ai({type:Pn,raw:true})],Dn.prototype,"tbsCertificate",void 0);bi([Ai({type:An})],Dn.prototype,"signatureAlgorithm",void 0);bi([Ai({type:Ke.BitString})],Dn.prototype,"signatureValue",void 0);var In=function(){function t(t){if(t===void 0){t={}}this.userCertificate=new ArrayBuffer(0);this.revocationDate=new mn;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,converter:Ve})],In.prototype,"userCertificate",void 0);bi([Ai({type:mn})],In.prototype,"revocationDate",void 0);bi([Ai({type:_n,optional:true,repeated:"sequence"})],In.prototype,"crlEntryExtensions",void 0);var Bn=function(){function t(t){if(t===void 0){t={}}this.signature=new An;this.issuer=new Mi;this.thisUpdate=new mn;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,optional:true})],Bn.prototype,"version",void 0);bi([Ai({type:An})],Bn.prototype,"signature",void 0);bi([Ai({type:Mi})],Bn.prototype,"issuer",void 0);bi([Ai({type:mn})],Bn.prototype,"thisUpdate",void 0);bi([Ai({type:mn,optional:true})],Bn.prototype,"nextUpdate",void 0);bi([Ai({type:In,repeated:"sequence",optional:true})],Bn.prototype,"revokedCertificates",void 0);bi([Ai({type:_n,optional:true,context:0,repeated:"sequence"})],Bn.prototype,"crlExtensions",void 0);var xn=function(){function t(t){if(t===void 0){t={}}this.tbsCertList=new Bn;this.signatureAlgorithm=new An;this.signature=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("o",xn);bi([Ai({type:Bn,raw:true})],xn.prototype,"tbsCertList",void 0);bi([Ai({type:An})],xn.prototype,"signatureAlgorithm",void 0);bi([Ai({type:Ke.BitString})],xn.prototype,"signature",void 0);var Tn=t("i","1.2.840.10045.2.1");var On="1.2.840.10045.4.1";var kn="1.2.840.10045.4.3.1";var Mn="1.2.840.10045.4.3.2";var Rn="1.2.840.10045.4.3.3";var Nn="1.2.840.10045.4.3.4";function Kn(t){return new An({algorithm:t})}Kn(On);Kn(kn);Kn(Mn);Kn(Rn);Kn(Nn);var jn=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],jn.prototype,"fieldType",void 0);bi([Ai({type:Ke.Any})],jn.prototype,"parameters",void 0);jn=bi([Si({type:Ne.Sequence})],jn);var Hn=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(He);var Un=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.OctetString})],Un.prototype,"a",void 0);bi([Ai({type:Ke.OctetString})],Un.prototype,"b",void 0);bi([Ai({type:Ke.BitString,optional:true})],Un.prototype,"seed",void 0);Un=bi([Si({type:Ne.Sequence})],Un);var Fn;(function(t){t[t["ecpVer1"]=1]="ecpVer1"})(Fn||(Fn={}));var Ln=function(){function t(t){if(t===void 0){t={}}this.version=Fn.ecpVer1;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Ln.prototype,"version",void 0);bi([Ai({type:jn})],Ln.prototype,"fieldID",void 0);bi([Ai({type:Un})],Ln.prototype,"curve",void 0);bi([Ai({type:Hn})],Ln.prototype,"base",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Ln.prototype,"order",void 0);bi([Ai({type:Ke.Integer,optional:true})],Ln.prototype,"cofactor",void 0);Ln=bi([Si({type:Ne.Sequence})],Ln);var Vn=t("E",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:Ke.ObjectIdentifier})],Vn.prototype,"namedCurve",void 0);bi([Ai({type:Ke.Null})],Vn.prototype,"implicitCurve",void 0);bi([Ai({type:Ln})],Vn.prototype,"specifiedCurve",void 0);t("E",Vn=bi([Si({type:Ne.Choice})],Vn));var Gn=function(){function t(t){if(t===void 0){t={}}this.version=1;this.privateKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Gn.prototype,"version",void 0);bi([Ai({type:He})],Gn.prototype,"privateKey",void 0);bi([Ai({type:Vn,context:0,optional:true})],Gn.prototype,"parameters",void 0);bi([Ai({type:Ke.BitString,context:1,optional:true})],Gn.prototype,"publicKey",void 0);var Wn=function(){function t(t){if(t===void 0){t={}}this.r=new ArrayBuffer(0);this.s=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,converter:Ve})],Wn.prototype,"r",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Wn.prototype,"s",void 0);var Qn="1.2.840.113549.1.1";var qn=t("f","".concat(Qn,".1"));var zn="".concat(Qn,".7");var Yn="".concat(Qn,".9");var Zn="".concat(Qn,".10");var $n="".concat(Qn,".2");var Xn="".concat(Qn,".4");var Jn="".concat(Qn,".5");var ta="".concat(Qn,".12");var ea="".concat(Qn,".13");var ia="".concat(Qn,".15");var ra="".concat(Qn,".16");var na="1.3.14.3.2.26";var aa="2.16.840.1.101.3.4.2.4";var oa="2.16.840.1.101.3.4.2.1";var sa="2.16.840.1.101.3.4.2.2";var ua="2.16.840.1.101.3.4.2.3";var ca="2.16.840.1.101.3.4.2.5";var fa="2.16.840.1.101.3.4.2.6";var va="1.2.840.113549.2.2";var ha="1.2.840.113549.2.5";var da="".concat(Qn,".8");function la(t){return new An({algorithm:t,parameters:null})}la(va);la(ha);var pa=la(na);la(aa);la(oa);la(sa);la(ua);la(ca);la(fa);var ya=new An({algorithm:da,parameters:_i.serialize(pa)});var Sa=new An({algorithm:Yn,parameters:_i.serialize(qe.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});la(qn);la($n);la(Xn);la(Jn);la(ia);la(ra);la(ta);la(ea);la(ia);la(ra);var Aa=function(){function t(t){if(t===void 0){t={}}this.hashAlgorithm=new An(pa);this.maskGenAlgorithm=new An({algorithm:da,parameters:_i.serialize(pa)});this.pSourceAlgorithm=new An(Sa);Object.assign(this,t)}return t}();bi([Ai({type:An,context:0,defaultValue:pa})],Aa.prototype,"hashAlgorithm",void 0);bi([Ai({type:An,context:1,defaultValue:ya})],Aa.prototype,"maskGenAlgorithm",void 0);bi([Ai({type:An,context:2,defaultValue:Sa})],Aa.prototype,"pSourceAlgorithm",void 0);new An({algorithm:zn,parameters:_i.serialize(new Aa)});var Ca=function(){function t(t){if(t===void 0){t={}}this.hashAlgorithm=new An(pa);this.maskGenAlgorithm=new An({algorithm:da,parameters:_i.serialize(pa)});this.saltLength=20;this.trailerField=1;Object.assign(this,t)}return t}();bi([Ai({type:An,context:0,defaultValue:pa})],Ca.prototype,"hashAlgorithm",void 0);bi([Ai({type:An,context:1,defaultValue:ya})],Ca.prototype,"maskGenAlgorithm",void 0);bi([Ai({type:Ke.Integer,context:2,defaultValue:20})],Ca.prototype,"saltLength",void 0);bi([Ai({type:Ke.Integer,context:3,defaultValue:1})],Ca.prototype,"trailerField",void 0);new An({algorithm:Zn,parameters:_i.serialize(new Ca)});var ma=function(){function t(t){if(t===void 0){t={}}this.digestAlgorithm=new An;this.digest=new He;Object.assign(this,t)}return t}();bi([Ai({type:An})],ma.prototype,"digestAlgorithm",void 0);bi([Ai({type:He})],ma.prototype,"digest",void 0);var ga;var wa=function(){function t(t){if(t===void 0){t={}}this.prime=new ArrayBuffer(0);this.exponent=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,converter:Ve})],wa.prototype,"prime",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],wa.prototype,"exponent",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],wa.prototype,"coefficient",void 0);var _a=ga=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ga.prototype);return i}return e}(wi);_a=ga=bi([Si({type:Ne.Sequence,itemType:wa})],_a);var ba=function(){function t(t){if(t===void 0){t={}}this.version=0;this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);this.privateExponent=new ArrayBuffer(0);this.prime1=new ArrayBuffer(0);this.prime2=new ArrayBuffer(0);this.exponent1=new ArrayBuffer(0);this.exponent2=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],ba.prototype,"version",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"modulus",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"publicExponent",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"privateExponent",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"prime1",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"prime2",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"exponent1",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"exponent2",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],ba.prototype,"coefficient",void 0);bi([Ai({type:_a,optional:true})],ba.prototype,"otherPrimeInfos",void 0);var Ea=function(){function t(t){if(t===void 0){t={}}this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("R",Ea);bi([Ai({type:Ke.Integer,converter:Ve})],Ea.prototype,"modulus",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Ea.prototype,"publicExponent",void 0);var Pa,Da;var Ia=t("j","1.3.6.1.4.1.18227.2.1");var Ba=t("l",Pa=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Pa.prototype);return i}return e}(wi));t("l",Ba=Pa=bi([Si({type:Ne.Sequence,itemType:An})],Ba));var xa=t("k",Da=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Da.prototype);return i}return e}(wi));t("k",xa=Da=bi([Si({type:Ne.Sequence,itemType:Ke.BitString})],xa));var Ta=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(He);var Oa=function(){function t(t){if(t===void 0){t={}}this.encryptionAlgorithm=new An;this.encryptedData=new Ta;Object.assign(this,t)}return t}();bi([Ai({type:An})],Oa.prototype,"encryptionAlgorithm",void 0);bi([Ai({type:Ta})],Oa.prototype,"encryptedData",void 0);var ka;var Ma;(function(t){t[t["v1"]=0]="v1"})(Ma||(Ma={}));var Ra=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(He);var Na=ka=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ka.prototype);return i}return e}(wi);Na=ka=bi([Si({type:Ne.Sequence,itemType:rn})],Na);var Ka=function(){function t(t){if(t===void 0){t={}}this.version=Ma.v1;this.privateKeyAlgorithm=new An;this.privateKey=new Ra;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Ka.prototype,"version",void 0);bi([Ai({type:An})],Ka.prototype,"privateKeyAlgorithm",void 0);bi([Ai({type:Ra})],Ka.prototype,"privateKey",void 0);bi([Ai({type:Na,implicit:true,context:0,optional:true})],Ka.prototype,"attributes",void 0);var ja;var Ha;(function(t){t[t["v1"]=0]="v1";t[t["v2"]=1]="v2"})(Ha||(Ha={}));var Ua=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Ua=bi([Si({type:Ne.Sequence})],Ua);var Fa=function(){function t(){this.version=Ha.v1;this.privateKeyAlgorithm=new An;this.privateKey=new ArrayBuffer(0)}return t}();bi([Ai({type:Ke.Integer})],Fa.prototype,"version",void 0);bi([Ai({type:An})],Fa.prototype,"privateKeyAlgorithm",void 0);bi([Ai({type:Ke.OctetString})],Fa.prototype,"privateKey",void 0);bi([Ai({type:Na,context:0,implicit:true,optional:true})],Fa.prototype,"attributes",void 0);bi([Ai({type:Ke.BitString,context:1,implicit:true,optional:true})],Fa.prototype,"publicKey",void 0);Fa=bi([Si({type:Ne.Sequence})],Fa);var La=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Fa);La=bi([Si({type:Ne.Sequence})],La);var Va=ja=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ja.prototype);return i}return e}(wi);Va=ja=bi([Si({type:Ne.Sequence,itemType:Fa})],Va);var Ga,Wa;var Qa=t("g","2.16.840.1.114027.80.4.1");var qa=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);qa=bi([Si({type:Ne.Sequence})],qa);var za=t("h",Ga=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Ga.prototype);return i}return e}(wi));t("h",za=Ga=bi([Si({type:Ne.Sequence,itemType:Cn})],za));var Ya=Wa=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Wa.prototype);return i}return e}(wi);Ya=Wa=bi([Si({type:Ne.Sequence,itemType:Fa})],Ya);var Za={exports:{}};var $a=Za.exports;var Xa;function Ja(){if(Xa)return Za.exports;Xa=1;(function(t,e){!function(e,i){t.exports=i()}($a,(function(){var t=1e3,e=6e4,i=36e5,r="millisecond",n="second",a="minute",o="hour",s="day",u="week",c="month",f="quarter",v="year",h="date",d="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},S=function(t,e,i){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(i)+t},A={s:S,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),r=Math.floor(i/60),n=i%60;return(e<=0?"+":"-")+S(r,2,"0")+":"+S(n,2,"0")},m:function t(e,i){if(e.date()<i.date())return-t(i,e);var r=12*(i.year()-e.year())+(i.month()-e.month()),n=e.clone().add(r,c),a=i-n<0,o=e.clone().add(r+(a?-1:1),c);return+(-(r+(i-n)/(a?n-o:o-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:v,w:u,d:s,D:h,h:o,m:a,s:n,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},C="en",m={};m[C]=y;var g="$isDayjsObject",w=function(t){return t instanceof P||!(!t||!t[g])},_=function t(e,i,r){var n;if(!e)return C;if("string"==typeof e){var a=e.toLowerCase();m[a]&&(n=a),i&&(m[a]=i,n=a);var o=e.split("-");if(!n&&o.length>1)return t(o[0])}else{var s=e.name;m[s]=e,n=s}return!r&&n&&(C=n),n||!r&&C},b=function(t,e){if(w(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new P(i)},E=A;E.l=_,E.i=w,E.w=function(t,e){return b(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var P=function(){function y(t){this.$L=_(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[g]=true}var S=y.prototype;return S.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(E.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var n=r[2]-1||0,a=(r[7]||"0").substring(0,3);return i?new Date(Date.UTC(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(e)}(t),this.init()},S.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},S.$utils=function(){return E},S.isValid=function(){return!(this.$d.toString()===d)},S.isSame=function(t,e){var i=b(t);return this.startOf(e)<=i&&i<=this.endOf(e)},S.isAfter=function(t,e){return b(t)<this.startOf(e)},S.isBefore=function(t,e){return this.endOf(e)<b(t)},S.$g=function(t,e,i){return E.u(t)?this[e]:this.set(i,t)},S.unix=function(){return Math.floor(this.valueOf()/1e3)},S.valueOf=function(){return this.$d.getTime()},S.startOf=function(t,e){var i=this,r=!!E.u(e)||e,f=E.p(t),d=function(t,e){var n=E.w(i.$u?Date.UTC(i.$y,e,t):new Date(i.$y,e,t),i);return r?n:n.endOf(s)},l=function(t,e){return E.w(i.toDate()[t].apply(i.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),i)},p=this.$W,y=this.$M,S=this.$D,A="set"+(this.$u?"UTC":"");switch(f){case v:return r?d(1,0):d(31,11);case c:return r?d(1,y):d(0,y+1);case u:var C=this.$locale().weekStart||0,m=(p<C?p+7:p)-C;return d(r?S-m:S+(6-m),y);case s:case h:return l(A+"Hours",0);case o:return l(A+"Minutes",1);case a:return l(A+"Seconds",2);case n:return l(A+"Milliseconds",3);default:return this.clone()}},S.endOf=function(t){return this.startOf(t,false)},S.$set=function(t,e){var i,u=E.p(t),f="set"+(this.$u?"UTC":""),d=(i={},i[s]=f+"Date",i[h]=f+"Date",i[c]=f+"Month",i[v]=f+"FullYear",i[o]=f+"Hours",i[a]=f+"Minutes",i[n]=f+"Seconds",i[r]=f+"Milliseconds",i)[u],l=u===s?this.$D+(e-this.$W):e;if(u===c||u===v){var p=this.clone().set(h,1);p.$d[d](l),p.init(),this.$d=p.set(h,Math.min(this.$D,p.daysInMonth())).$d}else d&&this.$d[d](l);return this.init(),this},S.set=function(t,e){return this.clone().$set(t,e)},S.get=function(t){return this[E.p(t)]()},S.add=function(r,f){var h,d=this;r=Number(r);var l=E.p(f),p=function(t){var e=b(d);return E.w(e.date(e.date()+Math.round(t*r)),d)};if(l===c)return this.set(c,this.$M+r);if(l===v)return this.set(v,this.$y+r);if(l===s)return p(1);if(l===u)return p(7);var y=(h={},h[a]=e,h[o]=i,h[n]=t,h)[l]||1,S=this.$d.getTime()+r*y;return E.w(S,this)},S.subtract=function(t,e){return this.add(-1*t,e)},S.format=function(t){var e=this,i=this.$locale();if(!this.isValid())return i.invalidDate||d;var r=t||"YYYY-MM-DDTHH:mm:ssZ",n=E.z(this),a=this.$H,o=this.$m,s=this.$M,u=i.weekdays,c=i.months,f=i.meridiem,v=function(t,i,n,a){return t&&(t[i]||t(e,r))||n[i].slice(0,a)},h=function(t){return E.s(a%12||12,t,"0")},l=f||function(t,e,i){var r=t<12?"AM":"PM";return i?r.toLowerCase():r};return r.replace(p,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return E.s(e.$y,4,"0");case"M":return s+1;case"MM":return E.s(s+1,2,"0");case"MMM":return v(i.monthsShort,s,c,3);case"MMMM":return v(c,s);case"D":return e.$D;case"DD":return E.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return v(i.weekdaysMin,e.$W,u,2);case"ddd":return v(i.weekdaysShort,e.$W,u,3);case"dddd":return u[e.$W];case"H":return String(a);case"HH":return E.s(a,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return l(a,o,true);case"A":return l(a,o,false);case"m":return String(o);case"mm":return E.s(o,2,"0");case"s":return String(e.$s);case"ss":return E.s(e.$s,2,"0");case"SSS":return E.s(e.$ms,3,"0");case"Z":return n}return null}(t)||n.replace(":","")}))},S.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},S.diff=function(r,h,d){var l,p=this,y=E.p(h),S=b(r),A=(S.utcOffset()-this.utcOffset())*e,C=this-S,m=function(){return E.m(p,S)};switch(y){case v:l=m()/12;break;case c:l=m();break;case f:l=m()/3;break;case u:l=(C-A)/6048e5;break;case s:l=(C-A)/864e5;break;case o:l=C/i;break;case a:l=C/e;break;case n:l=C/t;break;default:l=C}return d?l:E.a(l)},S.daysInMonth=function(){return this.endOf(c).$D},S.$locale=function(){return m[this.$L]},S.locale=function(t,e){if(!t)return this.$L;var i=this.clone(),r=_(t,e,true);return r&&(i.$L=r),i},S.clone=function(){return E.w(this.$d,this)},S.toDate=function(){return new Date(this.valueOf())},S.toJSON=function(){return this.isValid()?this.toISOString():null},S.toISOString=function(){return this.$d.toISOString()},S.toString=function(){return this.$d.toUTCString()},y}(),D=P.prototype;return b.prototype=D,[["$ms",r],["$s",n],["$m",a],["$H",o],["$W",s],["$M",c],["$y",v],["$D",h]].forEach((function(t){D[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),b.extend=function(t,e){return t.$i||(t(e,P,b),t.$i=true),b},b.locale=_,b.isDayjs=w,b.unix=function(t){return b(1e3*t)},b.en=m[C],b.Ls=m,b.p={},b}))})(Za);return Za.exports}var to=Ja();var eo=n(to);var io={exports:{}};var ro=io.exports;var no;function ao(){if(no)return io.exports;no=1;(function(t,e){!function(e,i){t.exports=i()}(ro,(function(){return function(t,e,i){t=t||{};var r=e.prototype,n={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(t,e,i,n){return r.fromToBase(t,e,i,n)}i.en.relativeTime=n,r.fromToBase=function(e,r,a,o,s){for(var u,c,f,v=a.$locale().relativeTime||n,h=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],d=h.length,l=0;l<d;l+=1){var p=h[l];p.d&&(u=o?i(e).diff(a,p.d,true):a.diff(e,p.d,true));var y=(t.rounding||Math.round)(Math.abs(u));if(f=u>0,y<=p.r||!p.r){y<=1&&l>0&&(p=h[l-1]);var S=v[p.l];s&&(y=s(""+y)),c="string"==typeof S?S.replace("%d",y):S(y,r,p.l,f);break}}if(r)return c;var A=f?v.future:v.past;return"function"==typeof A?A(c):A.replace("%s",c)},r.to=function(t,e){return a(t,e,this,true)},r.from=function(t,e){return a(t,e,this)};var o=function(t){return t.$u?i.utc():i()};r.toNow=function(t){return this.to(o(this),t)},r.fromNow=function(t){return this.from(o(this),t)}}}))})(io);return io.exports}var oo=ao();var so=n(oo);
79
79
  /**
80
80
  * @license
81
81
  * Copyright (c) Peculiar Ventures, LLC.
@@ -103,7 +103,7 @@ var __extends=this&&this.__extends||function(){var t=function(e,i){t=Object.setP
103
103
  *
104
104
  * This source code is licensed under the MIT license found in the
105
105
  * LICENSE file in the root directory of this source tree.
106
- */var hs=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(t,i):n?n.value=i:e.set(t,i),i};var ds=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(t):r?r.value:e.get(t)};var ls;var ps=function(){function t(t){ls.set(this,new Mi);if(u.BufferSourceConverter.isBufferSource(t)){hs(this,ls,mi.parse(t,Mi),"f")}else{hs(this,ls,t,"f")}}t.prototype.toJSON=function(){var t=[];ds(this,ls,"f").forEach((function(e){return e.forEach((function(e){t.push({type:e.type,name:vs[e.type],shortName:fs[e.type],value:e.value.toString()})}))}));return t};return t}();t("N",ps);ls=new WeakMap;var ys;var Ss=t("aN","".concat(Ui,".2"));var As;(function(t){t[t["picture"]=0]="picture";t[t["handwrittenSignature"]=1]="handwrittenSignature"})(As||(As={}));var Cs=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Cs.prototype,"predefinedBiometricType",void 0);bi([Ai({type:Ke.ObjectIdentifier})],Cs.prototype,"biometricDataOid",void 0);Cs=bi([Si({type:Ne.Choice})],Cs);var ms=function(){function t(t){if(t===void 0){t={}}this.typeOfBiometricData=new Cs;this.hashAlgorithm=new An;this.biometricDataHash=new He;Object.assign(this,t)}return t}();bi([Ai({type:Cs})],ms.prototype,"typeOfBiometricData",void 0);bi([Ai({type:An})],ms.prototype,"hashAlgorithm",void 0);bi([Ai({type:He})],ms.prototype,"biometricDataHash",void 0);bi([Ai({type:Ke.IA5String,optional:true})],ms.prototype,"sourceDataUri",void 0);var gs=t("ab",ys=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ys.prototype);return i}return e}(wi));t("ab",gs=ys=bi([Si({type:Ne.Sequence,itemType:ms})],gs));var ws="".concat(Hi,".11");var _s,bs;var Es=t("aZ","".concat(Ui,".3"));var Ps=function(){function t(){this.statementId="";this.statementInfo=new ArrayBuffer(0)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Ps.prototype,"statementId",void 0);bi([Ai({type:Ke.Any,optional:true})],Ps.prototype,"statementInfo",void 0);var Ds=t("by","".concat(ws,".2"));var Is=_s=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,_s.prototype);return i}return e}(wi);Is=_s=bi([Si({type:Ne.Sequence,itemType:ji})],Is);var Bs=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("bz",Bs);bi([Ai({type:Ke.ObjectIdentifier,optional:true})],Bs.prototype,"semanticsIdentifier",void 0);bi([Ai({type:Is,optional:true})],Bs.prototype,"nameRegistrationAuthorities",void 0);var xs=t("an",bs=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,bs.prototype);return i}return e}(wi));t("an",xs=bs=bi([Si({type:Ne.Sequence,itemType:Ps})],xs));var Ts=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);Ts=bi([Si({type:Ne.Choice})],Ts);var Os;(function(t){t["M"]="M";t["F"]="F";t["m"]="m";t["f"]="f"})(Os||(Os={}));var ks;var Ms=ks=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ks.prototype);return i}return e}(fr);Ms=ks=bi([Si({type:Ne.Sequence})],Ms);var Rs=t("aY","1.3.6.1.4.1.311.21.7");var Ns=function(){function t(t){if(t===void 0){t={}}this.templateID="";this.templateMajorVersion=0;this.templateMinorVersion=0;Object.assign(this,t)}return t}();t("am",Ns);bi([Ai({type:Ke.ObjectIdentifier})],Ns.prototype,"templateID",void 0);bi([Ai({type:Ke.Integer})],Ns.prototype,"templateMajorVersion",void 0);bi([Ai({type:Ke.Integer})],Ns.prototype,"templateMinorVersion",void 0);var Ks=t("aX","1.3.6.1.4.1.311.20.2");var js=function(){function t(t){if(t===void 0){t={}}this.name="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.Utf8String})],js.prototype,"name",void 0);var Hs=t("al",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}t.prototype.toString=function(){var t,e;return((t=this.name)===null||t===void 0?void 0:t.toString())||((e=this.spec)===null||e===void 0?void 0:e.name)||""};return t}());bi([Ai({type:Bi})],Hs.prototype,"name",void 0);bi([Ai({type:js})],Hs.prototype,"spec",void 0);t("al",Hs=bi([Si({type:Ne.Choice})],Hs));var Us=t("aU","1.3.6.1.4.1.311.21.1");var Fs=t("ai",function(){function t(){this.value=new ArrayBuffer(0)}t.prototype.toString=function(){var t=this.getVersion();return"V".concat(t.certificateIndex,".").concat(t.keyIndex)};t.prototype.getVersion=function(){var t=new Uint8Array(this.value);if(this.value.byteLength<4){t=new Uint8Array(4);t.set(new Uint8Array(this.value),4-this.value.byteLength)}return{keyIndex:parseInt(u.Convert.ToHex(t.slice(0,2)),16),certificateIndex:parseInt(u.Convert.ToHex(t.slice(2)),16)}};return t}());bi([Ai({type:Ke.Integer,converter:Ve})],Fs.prototype,"value",void 0);t("ai",Fs=bi([Si({type:Ne.Choice})],Fs));var Ls=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.NumericString})],Ls.prototype,"numericString",void 0);bi([Ai({type:Ke.PrintableString})],Ls.prototype,"printableString",void 0);bi([Ai({type:Ke.TeletexString})],Ls.prototype,"teletexString",void 0);bi([Ai({type:Ke.VideotexString})],Ls.prototype,"videotexString",void 0);bi([Ai({type:Ke.IA5String})],Ls.prototype,"ia5String",void 0);bi([Ai({type:Ke.GraphicString})],Ls.prototype,"graphicString",void 0);bi([Ai({type:Ke.VisibleString})],Ls.prototype,"visibleString",void 0);bi([Ai({type:Ke.GeneralString})],Ls.prototype,"generalString",void 0);bi([Ai({type:Ke.UniversalString})],Ls.prototype,"universalString",void 0);bi([Ai({type:Ke.BmpString})],Ls.prototype,"bmpString",void 0);Ls=bi([Si({type:Ne.Choice})],Ls);var Vs=function(){function t(t){if(t===void 0){t=new ArrayBuffer(0)}this.value=t}return t}();bi([Ai({type:Ke.Any})],Vs.prototype,"value",void 0);Vs=bi([Si({type:Ne.Choice})],Vs);var Gs;var Ws=Gs=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Gs.prototype);return i}return e}(bn);Ws=Gs=bi([Si({type:Ne.Sequence})],Ws);var Qs=function(){function t(t){if(t===void 0){t={}}this.keySpec=0;this.cspName="";this.signature=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Qs.prototype,"keySpec",void 0);bi([Ai({type:Ke.BmpString})],Qs.prototype,"cspName",void 0);bi([Ai({type:Ke.BitString})],Qs.prototype,"signature",void 0);var qs;var zs=qs=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,qs.prototype);return i}return e}(wi);zs=qs=bi([Si({type:Ne.Sequence,itemType:Ke.Any})],zs);var Ys;var Zs=Ys=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Ys.prototype);return i}return e}(wi);Zs=Ys=bi([Si({type:Ne.Sequence,itemType:Ke.Any})],Zs);var $s;var Xs=function(){function t(t){if(t===void 0){t={}}this.name="";this.value="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.BmpString})],Xs.prototype,"name",void 0);bi([Ai({type:Ke.BmpString})],Xs.prototype,"value",void 0);var Js=$s=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,$s.prototype);return i}return e}(wi);Js=$s=bi([Si({type:Ne.Sequence,itemType:Xs})],Js);var tu=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ni);tu=bi([Si({type:Ne.Sequence})],tu);var eu=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ni);eu=bi([Si({type:Ne.Sequence})],eu);var iu=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Dn);iu=bi([Si({type:Ne.Sequence})],iu);var ru=function(){function t(t){if(t===void 0){t={}}this.clientId=0;this.machineName="";this.userName="";this.processName="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],ru.prototype,"clientId",void 0);bi([Ai({type:Ke.Utf8String})],ru.prototype,"machineName",void 0);bi([Ai({type:Ke.Utf8String})],ru.prototype,"userName",void 0);bi([Ai({type:Ke.Utf8String})],ru.prototype,"processName",void 0);var nu="2.16.840.1.113730";var au="".concat(nu,".1");var ou=function(){function t(t){this.value="";if(t){this.value=t}}return t}();bi([Ai({type:Ke.IA5String})],ou.prototype,"value",void 0);ou=bi([Si({type:Ne.Choice})],ou);var su=function(){function t(t){this.value="";if(t){this.value=t}}return t}();bi([Ai({type:Ke.IA5String})],su.prototype,"value",void 0);su=bi([Si({type:Ne.Choice})],su);var uu=function(){function t(t){this.value="";if(t){this.value=t}}return t}();bi([Ai({type:Ke.IA5String})],uu.prototype,"value",void 0);uu=bi([Si({type:Ne.Choice})],uu);var cu=function(){function t(t){this.value="";if(t){this.value=t}}return t}();bi([Ai({type:Ke.IA5String})],cu.prototype,"value",void 0);cu=bi([Si({type:Ne.Choice})],cu);var fu=t("aV","".concat(au,".1"));var vu;(function(t){t[t["sslClient"]=1]="sslClient";t[t["sslServer"]=2]="sslServer";t[t["sMime"]=4]="sMime";t[t["objectSigning"]=8]="objectSigning";t[t["sslCa"]=32]="sslCa";t[t["sMimeCa"]=64]="sMimeCa";t[t["objectSigningCa"]=128]="objectSigningCa"})(vu||(vu={}));var hu=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.toJSON=function(){var t=this.toNumber();var e=[];if(t&vu.objectSigning){e.push("objectSigning")}if(t&vu.objectSigningCa){e.push("objectSigningCa")}if(t&vu.sMime){e.push("sMime")}if(t&vu.sMimeCa){e.push("sMimeCa")}if(t&vu.sslCa){e.push("sslCa")}if(t&vu.sslClient){e.push("sslClient")}if(t&vu.sslServer){e.push("sslServer")}return e};e.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return e}(je);t("aj",hu);var du=t("aW","".concat(au,".13"));var lu=t("ak",function(){function t(t){this.value="";if(t){this.value=t}}return t}());bi([Ai({type:Ke.IA5String})],lu.prototype,"value",void 0);t("ak",lu=bi([Si({type:Ne.Choice})],lu));var pu=function(){function t(t){this.value="";if(t){this.value=t}}return t}();bi([Ai({type:Ke.IA5String})],pu.prototype,"value",void 0);pu=bi([Si({type:Ne.Choice})],pu);var yu=function(){function t(t){this.value="";if(t){this.value=t}}return t}();bi([Ai({type:Ke.IA5String})],yu.prototype,"value",void 0);yu=bi([Si({type:Ne.Choice})],yu);var Su=t("aT","1.3.6.1.4.1.52266.1");var Au=function(){function t(t){if(t===void 0){t={}}this.leiCode="";Object.assign(this,t)}return t}();bi([Ai({type:te})],Au.prototype,"leiCode",void 0);bi([Ai({type:te,context:0,optional:true})],Au.prototype,"leiRole",void 0);Au=bi([Si({type:Ne.Sequence})],Au);var Cu=function(){function t(t){if(t){this.text=t}}Object.defineProperty(t.prototype,"text",{get:function(){if(this.bmpString!==undefined){return this.bmpString}if(this.ia5String!==undefined){return this.ia5String}if(this.printableString!==undefined){return this.printableString}if(this.utf8String!==undefined){return this.utf8String}if(this.visibleString!==undefined){return this.visibleString}return undefined},set:function(t){this.printableString=t},enumerable:false,configurable:true});return t}();bi([Ai({type:Ke.IA5String})],Cu.prototype,"ia5String",void 0);bi([Ai({type:Ke.VisibleString})],Cu.prototype,"visibleString",void 0);bi([Ai({type:Ke.BmpString})],Cu.prototype,"bmpString",void 0);bi([Ai({type:Ke.Utf8String})],Cu.prototype,"utf8String",void 0);bi([Ai({type:Ke.PrintableString})],Cu.prototype,"printableString",void 0);Cu=bi([Si({type:Ne.Choice})],Cu);var mu=t("ah",function(t){__extends(e,t);function e(e){var i=t.call(this)||this;if(typeof e==="string"){i.text=e}else if(e instanceof Au){i.struct=e}return i}return e}(Cu));bi([Ai({type:Au})],mu.prototype,"struct",void 0);t("ah",mu=bi([Si({type:Ne.Choice})],mu));var gu=t("aS","1.3.6.1.4.1.52266.2");var wu=t("ag",function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Cu));t("ag",wu=bi([Si({type:Ne.Choice})],wu));var _u=function(){function t(t){this.offset=0;this.view=u.BufferSourceConverter.toUint8Array(t)}Object.defineProperty(t.prototype,"position",{get:function(){return this.offset},enumerable:false,configurable:true});t.prototype.read=function(t){if(t===void 0){t=1}var e=this.view.slice(this.offset,this.offset+t);this.offset=this.offset+e.length;return e};t.prototype.readByte=function(){var t=this.read();if(!t.length){throw new Error("End of stream")}return t[0]};t.prototype.readNumber=function(t){var e=this.read(t);var i=u.Convert.ToHex(e);return parseInt(i,16)};t.prototype.readEnd=function(){return this.read(this.view.length-this.offset)};t.prototype.reset=function(){this.offset=0};return t}();t("a1",_u);var bu=function(){function t(){}t.createStream=function(t){var e=u.BufferSourceConverter.toUint8Array(t);return new _u(e)};return t}();var Eu;(function(t){t[t["certificateTimestamp"]=0]="certificateTimestamp";t[t["treeHash"]=1]="treeHash"})(Eu||(Eu={}));var Pu;(function(t){t[t["none"]=0]="none";t[t["md5"]=1]="md5";t[t["sha1"]=2]="sha1";t[t["sha224"]=3]="sha224";t[t["sha256"]=4]="sha256";t[t["sha384"]=5]="sha384";t[t["sha512"]=6]="sha512"})(Pu||(Pu={}));var Du;(function(t){t[t["anonymous"]=0]="anonymous";t[t["rsa"]=1]="rsa";t[t["dsa"]=2]="dsa";t[t["ecdsa"]=3]="ecdsa"})(Du||(Du={}));var Iu=function(t){__extends(e,t);function e(e){var i=t.call(this)||this;i.version=0;i.logId=new ArrayBuffer(32);i.timestamp=new Date;i.extensions=new ArrayBuffer(0);i.hashAlgorithm=0;i.signatureAlgorithm=0;i.signature=new ArrayBuffer(0);if(e){i.parse(e)}return i}e.prototype.parse=function(t){this.version=t.readByte();t.read(2);this.logId=u.BufferSourceConverter.toArrayBuffer(t.read(32));this.timestamp=new Date(t.readNumber(8));var e=t.readNumber(2);this.extensions=t.read(e).buffer;this.hashAlgorithm=t.readByte();this.signatureAlgorithm=t.readByte();this.signature=t.read(t.readNumber(2)).buffer};e.prototype.toJSON=function(){return{version:this.version,logId:u.Convert.ToHex(this.logId),timestamp:this.timestamp,extensions:u.Convert.ToBase64(this.extensions),hashAlgorithm:Pu[this.hashAlgorithm]||"undefined",signatureAlgorithm:Du[this.signatureAlgorithm]||"undefined",signature:u.Convert.ToBase64(this.signature)}};return e}(bu);t("a2",Iu);var Bu;(function(t){t[t["v1"]=1]="v1"})(Bu||(Bu={}));var xu=t("aQ","1.2.840.113583.1.1.9.2");var Tu=function(){function t(t){if(t===void 0){t={}}this.version=Bu.v1;Object.assign(this,t)}return t}();t("ae",Tu);bi([Ai({type:Ke.Integer})],Tu.prototype,"version",void 0);var Ou=t("aR","1.2.840.113583.1.1.9.1");var ku=function(){function t(t){if(t===void 0){t={}}this.version=Bu.v1;this.location=new ji;this.requiresAuth=false;Object.assign(this,t)}return t}();t("af",ku);bi([Ai({type:Ke.Integer})],ku.prototype,"version",void 0);bi([Ai({type:ji})],ku.prototype,"location",void 0);bi([Ai({type:Ke.Boolean,defaultValue:false,optional:true})],ku.prototype,"requiresAuth",void 0);var Mu=function(){function t(t){if(t===void 0){t={}}this.hashAlg=new An;this.hashValue=new He;Object.assign(this,t)}return t}();bi([Ai({type:An})],Mu.prototype,"hashAlg",void 0);bi([Ai({type:He})],Mu.prototype,"hashValue",void 0);var Ru=function(){function t(t){if(t===void 0){t={}}this.mediaType="";this.logotypeHash=[];this.logotypeURI=[];Object.assign(this,t)}return t}();bi([Ai({type:Ke.IA5String})],Ru.prototype,"mediaType",void 0);bi([Ai({type:Mu,repeated:"sequence"})],Ru.prototype,"logotypeHash",void 0);bi([Ai({type:Ke.IA5String,repeated:"sequence"})],Ru.prototype,"logotypeURI",void 0);var Nu;(function(t){t[t["mono"]=1]="mono";t[t["stereo"]=2]="stereo";t[t["quad"]=4]="quad"})(Nu||(Nu={}));var Ku=function(){function t(t){if(t===void 0){t={}}this.fileSize=0;this.playTime=0;this.channels=Nu.mono;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Ku.prototype,"fileSize",void 0);bi([Ai({type:Ke.Integer})],Ku.prototype,"playTime",void 0);bi([Ai({type:Ke.Integer})],Ku.prototype,"channels",void 0);bi([Ai({type:Ke.Integer,implicit:true,context:3,optional:true})],Ku.prototype,"sampleRate",void 0);bi([Ai({type:Ke.IA5String,implicit:true,context:4,optional:true})],Ku.prototype,"language",void 0);var ju=function(){function t(t){if(t===void 0){t={}}this.audioDetails=new Ru;Object.assign(this,t)}return t}();bi([Ai({type:Ru})],ju.prototype,"audioDetails",void 0);bi([Ai({type:Ku,optional:true})],ju.prototype,"audioInfo",void 0);var Hu=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,context:1,implicit:true})],Hu.prototype,"numBits",void 0);bi([Ai({type:Ke.Integer,context:2,implicit:true})],Hu.prototype,"tableSize",void 0);Hu=bi([Si({type:Ne.Choice})],Hu);var Uu;(function(t){t[t["grayScale"]=0]="grayScale";t[t["color"]=1]="color"})(Uu||(Uu={}));var Fu=function(){function t(t){if(t===void 0){t={}}this.type=Uu.color;this.fileSize=0;this.xSize=0;this.ySize=0;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,context:0,implicit:true,defaultValue:Uu.color})],Fu.prototype,"type",void 0);bi([Ai({type:Ke.Integer})],Fu.prototype,"fileSize",void 0);bi([Ai({type:Ke.Integer})],Fu.prototype,"xSize",void 0);bi([Ai({type:Ke.Integer})],Fu.prototype,"ySize",void 0);bi([Ai({type:Hu})],Fu.prototype,"resolution",void 0);bi([Ai({type:Ke.IA5String,context:4,implicit:true,optional:true})],Fu.prototype,"language",void 0);var Lu=function(){function t(t){if(t===void 0){t={}}this.imageDetails=new Ru;Object.assign(this,t)}return t}();bi([Ai({type:Ru})],Lu.prototype,"imageDetails",void 0);bi([Ai({type:Fu,optional:true})],Lu.prototype,"imageInfo",void 0);var Vu=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Lu,repeated:"sequence",optional:true})],Vu.prototype,"image",void 0);bi([Ai({type:ju,repeated:"sequence",context:1,optional:true})],Vu.prototype,"audio",void 0);var Gu=function(){function t(t){if(t===void 0){t={}}this.refStructHash=[];this.refStructURI=[];Object.assign(this,t)}return t}();bi([Ai({type:Mu,repeated:"sequence"})],Gu.prototype,"refStructHash",void 0);bi([Ai({type:Ke.IA5String,repeated:"sequence"})],Gu.prototype,"refStructURI",void 0);var Wu=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Vu,implicit:true,context:0})],Wu.prototype,"direct",void 0);bi([Ai({type:Gu,implicit:true,context:1})],Wu.prototype,"indirect",void 0);Wu=bi([Si({type:Ne.Choice})],Wu);var Qu=function(){function t(t){if(t===void 0){t={}}this.logotypeType="";this.info=new Wu;Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Qu.prototype,"logotypeType",void 0);bi([Ai({type:Wu})],Qu.prototype,"info",void 0);var qu=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("aa",qu);bi([Ai({type:Wu,context:0,repeated:"sequence",optional:true})],qu.prototype,"communityLogos",void 0);bi([Ai({type:Wu,context:1,optional:true})],qu.prototype,"issuerLogo",void 0);bi([Ai({type:Wu,context:2,optional:true})],qu.prototype,"subjectLogo",void 0);bi([Ai({type:Qu,context:3,repeated:"sequence",optional:true})],qu.prototype,"otherLogos",void 0);var zu,Yu,Zu;var $u="1.3.6.1.5.5.7";var Xu="".concat($u,".1");var Ju=zu=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,zu.prototype);return i}return e}(wi);Ju=zu=bi([Si({type:Ne.Sequence,itemType:Ke.IA5String})],Ju);var tc=function(){function t(t){if(t===void 0){t={}}this.claim="";this.permitted=[];Object.assign(this,t)}return t}();bi([Ai({type:Ke.IA5String})],tc.prototype,"claim",void 0);bi([Ai({type:Ke.Utf8String,repeated:"sequence"})],tc.prototype,"permitted",void 0);var ec=Yu=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Yu.prototype);return i}return e}(wi);ec=Yu=bi([Si({type:Ne.Sequence,itemType:tc})],ec);var ic=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ju,optional:true,context:0})],ic.prototype,"mustInclude",void 0);bi([Ai({type:ec,optional:true,context:1})],ic.prototype,"permittedValues",void 0);var rc=t("aM","".concat(Xu,".26"));var nc=function(){function t(){this.start="";this.count=2}return t}();bi([Ai({type:Ke.IA5String})],nc.prototype,"start",void 0);bi([Ai({type:Ke.Integer})],nc.prototype,"count",void 0);var ac=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.IA5String,context:0})],ac.prototype,"spc",void 0);bi([Ai({type:nc,context:1})],ac.prototype,"range",void 0);bi([Ai({type:Ke.IA5String,context:2})],ac.prototype,"one",void 0);ac=bi([Si({type:Ne.Choice})],ac);var oc=t("a9",Zu=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Zu.prototype);return i}return e}(wi));t("a9",oc=Zu=bi([Si({type:Ne.Sequence,itemType:ac})],oc));var sc;var uc=t("aI","1.3.6.1.4.1.11129.2.1.17");var cc;(function(t){t[t["verified"]=0]="verified";t[t["selfSigned"]=1]="selfSigned";t[t["unverified"]=2]="unverified";t[t["failed"]=3]="failed"})(cc||(cc={}));var fc=function(){function t(t){if(t===void 0){t={}}this.verifiedBootKey=new He;this.deviceLocked=false;this.verifiedBootState=cc.verified;Object.assign(this,t)}return t}();t("bC",fc);bi([Ai({type:He})],fc.prototype,"verifiedBootKey",void 0);bi([Ai({type:Ke.Boolean})],fc.prototype,"deviceLocked",void 0);bi([Ai({type:Ke.Enumerated})],fc.prototype,"verifiedBootState",void 0);bi([Ai({type:He,optional:true})],fc.prototype,"verifiedBootHash",void 0);var vc=t("bD",sc=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,sc.prototype);return i}return e}(wi));t("bD",vc=sc=bi([Si({type:Ne.Set,itemType:Ke.Integer})],vc));var hc=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({context:1,type:vc,optional:true})],hc.prototype,"purpose",void 0);bi([Ai({context:2,type:Ke.Integer,optional:true})],hc.prototype,"algorithm",void 0);bi([Ai({context:3,type:Ke.Integer,optional:true})],hc.prototype,"keySize",void 0);bi([Ai({context:5,type:vc,optional:true})],hc.prototype,"digest",void 0);bi([Ai({context:6,type:vc,optional:true})],hc.prototype,"padding",void 0);bi([Ai({context:10,type:Ke.Integer,optional:true})],hc.prototype,"ecCurve",void 0);bi([Ai({context:200,type:Ke.Integer,optional:true})],hc.prototype,"rsaPublicExponent",void 0);bi([Ai({context:203,type:vc,optional:true})],hc.prototype,"mgfDigest",void 0);bi([Ai({context:303,type:Ke.Null,optional:true})],hc.prototype,"rollbackResistance",void 0);bi([Ai({context:305,type:Ke.Null,optional:true})],hc.prototype,"earlyBootOnly",void 0);bi([Ai({context:400,type:Ke.Integer,optional:true})],hc.prototype,"activeDateTime",void 0);bi([Ai({context:401,type:Ke.Integer,optional:true})],hc.prototype,"originationExpireDateTime",void 0);bi([Ai({context:402,type:Ke.Integer,optional:true})],hc.prototype,"usageExpireDateTime",void 0);bi([Ai({context:405,type:Ke.Integer,optional:true})],hc.prototype,"usageCountLimit",void 0);bi([Ai({context:503,type:Ke.Null,optional:true})],hc.prototype,"noAuthRequired",void 0);bi([Ai({context:504,type:Ke.Integer,optional:true})],hc.prototype,"userAuthType",void 0);bi([Ai({context:505,type:Ke.Integer,optional:true})],hc.prototype,"authTimeout",void 0);bi([Ai({context:506,type:Ke.Null,optional:true})],hc.prototype,"allowWhileOnBody",void 0);bi([Ai({context:507,type:Ke.Null,optional:true})],hc.prototype,"trustedUserPresenceRequired",void 0);bi([Ai({context:508,type:Ke.Null,optional:true})],hc.prototype,"trustedConfirmationRequired",void 0);bi([Ai({context:509,type:Ke.Null,optional:true})],hc.prototype,"unlockedDeviceRequired",void 0);bi([Ai({context:600,type:Ke.Null,optional:true})],hc.prototype,"allApplications",void 0);bi([Ai({context:601,type:He,optional:true})],hc.prototype,"applicationId",void 0);bi([Ai({context:701,type:Ke.Integer,optional:true})],hc.prototype,"creationDateTime",void 0);bi([Ai({context:702,type:Ke.Integer,optional:true})],hc.prototype,"origin",void 0);bi([Ai({context:703,type:Ke.Null,optional:true})],hc.prototype,"rollbackResistant",void 0);bi([Ai({context:704,type:fc,optional:true})],hc.prototype,"rootOfTrust",void 0);bi([Ai({context:705,type:Ke.Integer,optional:true})],hc.prototype,"osVersion",void 0);bi([Ai({context:706,type:Ke.Integer,optional:true})],hc.prototype,"osPatchLevel",void 0);bi([Ai({context:709,type:He,optional:true})],hc.prototype,"attestationApplicationId",void 0);bi([Ai({context:710,type:He,optional:true})],hc.prototype,"attestationIdBrand",void 0);bi([Ai({context:711,type:He,optional:true})],hc.prototype,"attestationIdDevice",void 0);bi([Ai({context:712,type:He,optional:true})],hc.prototype,"attestationIdProduct",void 0);bi([Ai({context:713,type:He,optional:true})],hc.prototype,"attestationIdSerial",void 0);bi([Ai({context:714,type:He,optional:true})],hc.prototype,"attestationIdImei",void 0);bi([Ai({context:715,type:He,optional:true})],hc.prototype,"attestationIdMeid",void 0);bi([Ai({context:716,type:He,optional:true})],hc.prototype,"attestationIdManufacturer",void 0);bi([Ai({context:717,type:He,optional:true})],hc.prototype,"attestationIdModel",void 0);bi([Ai({context:718,type:Ke.Integer,optional:true})],hc.prototype,"vendorPatchLevel",void 0);bi([Ai({context:719,type:Ke.Integer,optional:true})],hc.prototype,"bootPatchLevel",void 0);bi([Ai({context:720,type:Ke.Null,optional:true})],hc.prototype,"deviceUniqueAttestation",void 0);bi([Ai({context:723,type:He,optional:true})],hc.prototype,"attestationIdSecondImei",void 0);bi([Ai({context:724,type:He,optional:true})],hc.prototype,"moduleHash",void 0);var dc;(function(t){t[t["software"]=0]="software";t[t["trustedEnvironment"]=1]="trustedEnvironment";t[t["strongBox"]=2]="strongBox"})(dc||(dc={}));var lc;(function(t){t[t["KM2"]=1]="KM2";t[t["KM3"]=2]="KM3";t[t["KM4"]=3]="KM4";t[t["KM4_1"]=4]="KM4_1";t[t["keyMint1"]=100]="keyMint1";t[t["keyMint2"]=200]="keyMint2";t[t["keyMint3"]=300]="keyMint3";t[t["keyMint4"]=400]="keyMint4"})(lc||(lc={}));var pc=function(){function t(t){if(t===void 0){t={}}this.attestationVersion=lc.KM4;this.attestationSecurityLevel=dc.software;this.keymasterVersion=0;this.keymasterSecurityLevel=dc.software;this.attestationChallenge=new He;this.uniqueId=new He;this.softwareEnforced=new hc;this.teeEnforced=new hc;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],pc.prototype,"attestationVersion",void 0);bi([Ai({type:Ke.Enumerated})],pc.prototype,"attestationSecurityLevel",void 0);bi([Ai({type:Ke.Integer})],pc.prototype,"keymasterVersion",void 0);bi([Ai({type:Ke.Enumerated})],pc.prototype,"keymasterSecurityLevel",void 0);bi([Ai({type:He})],pc.prototype,"attestationChallenge",void 0);bi([Ai({type:He})],pc.prototype,"uniqueId",void 0);bi([Ai({type:hc})],pc.prototype,"softwareEnforced",void 0);bi([Ai({type:hc})],pc.prototype,"teeEnforced",void 0);var yc=function(){function t(t){if(t===void 0){t={}}this.attestationVersion=lc.keyMint4;this.attestationSecurityLevel=dc.software;this.keyMintVersion=0;this.keyMintSecurityLevel=dc.software;this.attestationChallenge=new He;this.uniqueId=new He;this.softwareEnforced=new hc;this.hardwareEnforced=new hc;Object.assign(this,t)}t.prototype.toLegacyKeyDescription=function(){return new pc({attestationVersion:this.attestationVersion,attestationSecurityLevel:this.attestationSecurityLevel,keymasterVersion:this.keyMintVersion,keymasterSecurityLevel:this.keyMintSecurityLevel,attestationChallenge:this.attestationChallenge,uniqueId:this.uniqueId,softwareEnforced:this.softwareEnforced,teeEnforced:this.hardwareEnforced})};t.fromLegacyKeyDescription=function(e){return new t({attestationVersion:e.attestationVersion,attestationSecurityLevel:e.attestationSecurityLevel,keyMintVersion:e.keymasterVersion,keyMintSecurityLevel:e.keymasterSecurityLevel,attestationChallenge:e.attestationChallenge,uniqueId:e.uniqueId,softwareEnforced:e.softwareEnforced,hardwareEnforced:e.teeEnforced})};return t}();bi([Ai({type:Ke.Integer})],yc.prototype,"attestationVersion",void 0);bi([Ai({type:Ke.Enumerated})],yc.prototype,"attestationSecurityLevel",void 0);bi([Ai({type:Ke.Integer})],yc.prototype,"keyMintVersion",void 0);bi([Ai({type:Ke.Enumerated})],yc.prototype,"keyMintSecurityLevel",void 0);bi([Ai({type:He})],yc.prototype,"attestationChallenge",void 0);bi([Ai({type:He})],yc.prototype,"uniqueId",void 0);bi([Ai({type:hc})],yc.prototype,"softwareEnforced",void 0);bi([Ai({type:hc})],yc.prototype,"hardwareEnforced",void 0);var Sc;var Ac=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(hc);Ac=bi([Si({type:Ne.Choice})],Ac);var Cc=Sc=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Sc.prototype);return i}e.prototype.findProperty=function(t){var e=this.find((function(e){return t in e}));if(e){return e[t]}return undefined};return e}(wi);Cc=Sc=bi([Si({type:Ne.Sequence,itemType:Ac})],Cc);var mc=function(){function t(t){if(t===void 0){t={}}this.attestationVersion=lc.KM4;this.attestationSecurityLevel=dc.software;this.keymasterVersion=0;this.keymasterSecurityLevel=dc.software;this.attestationChallenge=new He;this.uniqueId=new He;this.softwareEnforced=new Cc;this.teeEnforced=new Cc;Object.assign(this,t)}Object.defineProperty(t.prototype,"keyMintVersion",{get:function(){return this.keymasterVersion},set:function(t){this.keymasterVersion=t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"keyMintSecurityLevel",{get:function(){return this.keymasterSecurityLevel},set:function(t){this.keymasterSecurityLevel=t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hardwareEnforced",{get:function(){return this.teeEnforced},set:function(t){this.teeEnforced=t},enumerable:false,configurable:true});return t}();t("a5",mc);bi([Ai({type:Ke.Integer})],mc.prototype,"attestationVersion",void 0);bi([Ai({type:Ke.Enumerated})],mc.prototype,"attestationSecurityLevel",void 0);bi([Ai({type:Ke.Integer})],mc.prototype,"keymasterVersion",void 0);bi([Ai({type:Ke.Enumerated})],mc.prototype,"keymasterSecurityLevel",void 0);bi([Ai({type:He})],mc.prototype,"attestationChallenge",void 0);bi([Ai({type:He})],mc.prototype,"uniqueId",void 0);bi([Ai({type:Cc})],mc.prototype,"softwareEnforced",void 0);bi([Ai({type:Cc})],mc.prototype,"teeEnforced",void 0);var gc=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}if("keymasterVersion"in e&&!("keyMintVersion"in e)){e.keyMintVersion=e.keymasterVersion}if("keymasterSecurityLevel"in e&&!("keyMintSecurityLevel"in e)){e.keyMintSecurityLevel=e.keymasterSecurityLevel}if("teeEnforced"in e&&!("hardwareEnforced"in e)){e.hardwareEnforced=e.teeEnforced}return t.call(this,e)||this}return e}(mc);gc=bi([Si({type:Ne.Sequence})],gc);var wc=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.OctetString})],wc.prototype,"packageName",void 0);bi([Ai({type:Ke.Integer})],wc.prototype,"version",void 0);var _c=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("bB",_c);bi([Ai({type:wc,repeated:"set"})],_c.prototype,"packageInfos",void 0);bi([Ai({type:Ke.OctetString,repeated:"set"})],_c.prototype,"signatureDigests",void 0);var bc=undefined&&undefined.__decorate||function(t,e,i,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(t,e,i,r);else for(var s=t.length-1;s>=0;s--)if(o=t[s])a=(n<3?o(a):n>3?o(e,i,a):o(e,i))||a;return n>3&&a&&Object.defineProperty(e,i,a),a};var Ec=t("aH","2.23.140.3.1");var Pc=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("a4",Pc);bc([Ai({type:Ke.PrintableString})],Pc.prototype,"registrationSchemeIdentifier",void 0);bc([Ai({type:Ke.PrintableString})],Pc.prototype,"registrationCountry",void 0);bc([Ai({type:Ke.PrintableString,optional:true,context:0,implicit:true})],Pc.prototype,"registrationStateOrProvince",void 0);bc([Ai({type:Ke.Utf8String})],Pc.prototype,"registrationReference",void 0);
106
+ */var hs=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(t,i):n?n.value=i:e.set(t,i),i};var ds=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(t):r?r.value:e.get(t)};var ls;var ps=function(){function t(t){ls.set(this,new Mi);if(u.BufferSourceConverter.isBufferSource(t)){hs(this,ls,mi.parse(t,Mi),"f")}else{hs(this,ls,t,"f")}}t.prototype.toJSON=function(){var t=[];ds(this,ls,"f").forEach((function(e){return e.forEach((function(e){t.push({type:e.type,name:vs[e.type],shortName:fs[e.type],value:e.value.toString()})}))}));return t};return t}();t("N",ps);ls=new WeakMap;var ys;var Ss=t("aN","".concat(Ui,".2"));var As;(function(t){t[t["picture"]=0]="picture";t[t["handwrittenSignature"]=1]="handwrittenSignature"})(As||(As={}));var Cs=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Cs.prototype,"predefinedBiometricType",void 0);bi([Ai({type:Ke.ObjectIdentifier})],Cs.prototype,"biometricDataOid",void 0);Cs=bi([Si({type:Ne.Choice})],Cs);var ms=function(){function t(t){if(t===void 0){t={}}this.typeOfBiometricData=new Cs;this.hashAlgorithm=new An;this.biometricDataHash=new He;Object.assign(this,t)}return t}();bi([Ai({type:Cs})],ms.prototype,"typeOfBiometricData",void 0);bi([Ai({type:An})],ms.prototype,"hashAlgorithm",void 0);bi([Ai({type:He})],ms.prototype,"biometricDataHash",void 0);bi([Ai({type:Ke.IA5String,optional:true})],ms.prototype,"sourceDataUri",void 0);var gs=t("ab",ys=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ys.prototype);return i}return e}(wi));t("ab",gs=ys=bi([Si({type:Ne.Sequence,itemType:ms})],gs));var ws="".concat(Hi,".11");var _s,bs;var Es=t("aZ","".concat(Ui,".3"));var Ps=function(){function t(){this.statementId=""}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Ps.prototype,"statementId",void 0);bi([Ai({type:Ke.Any,optional:true})],Ps.prototype,"statementInfo",void 0);var Ds=t("by","".concat(ws,".2"));var Is=_s=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,_s.prototype);return i}return e}(wi);Is=_s=bi([Si({type:Ne.Sequence,itemType:ji})],Is);var Bs=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("bz",Bs);bi([Ai({type:Ke.ObjectIdentifier,optional:true})],Bs.prototype,"semanticsIdentifier",void 0);bi([Ai({type:Is,optional:true})],Bs.prototype,"nameRegistrationAuthorities",void 0);var xs=t("an",bs=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,bs.prototype);return i}return e}(wi));t("an",xs=bs=bi([Si({type:Ne.Sequence,itemType:Ps})],xs));var Ts=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);Ts=bi([Si({type:Ne.Choice})],Ts);var Os;(function(t){t["M"]="M";t["F"]="F";t["m"]="m";t["f"]="f"})(Os||(Os={}));var ks;var Ms=ks=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ks.prototype);return i}return e}(fr);Ms=ks=bi([Si({type:Ne.Sequence})],Ms);var Rs=t("aY","1.3.6.1.4.1.311.21.7");var Ns=function(){function t(t){if(t===void 0){t={}}this.templateID="";this.templateMajorVersion=0;this.templateMinorVersion=0;Object.assign(this,t)}return t}();t("am",Ns);bi([Ai({type:Ke.ObjectIdentifier})],Ns.prototype,"templateID",void 0);bi([Ai({type:Ke.Integer})],Ns.prototype,"templateMajorVersion",void 0);bi([Ai({type:Ke.Integer})],Ns.prototype,"templateMinorVersion",void 0);var Ks=t("aX","1.3.6.1.4.1.311.20.2");var js=function(){function t(t){if(t===void 0){t={}}this.name="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.Utf8String})],js.prototype,"name",void 0);var Hs=t("al",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}t.prototype.toString=function(){var t,e;return((t=this.name)===null||t===void 0?void 0:t.toString())||((e=this.spec)===null||e===void 0?void 0:e.name)||""};return t}());bi([Ai({type:Bi})],Hs.prototype,"name",void 0);bi([Ai({type:js})],Hs.prototype,"spec",void 0);t("al",Hs=bi([Si({type:Ne.Choice})],Hs));var Us=t("aU","1.3.6.1.4.1.311.21.1");var Fs=t("ai",function(){function t(){this.value=new ArrayBuffer(0)}t.prototype.toString=function(){var t=this.getVersion();return"V".concat(t.certificateIndex,".").concat(t.keyIndex)};t.prototype.getVersion=function(){var t=new Uint8Array(this.value);if(this.value.byteLength<4){t=new Uint8Array(4);t.set(new Uint8Array(this.value),4-this.value.byteLength)}return{keyIndex:parseInt(u.Convert.ToHex(t.slice(0,2)),16),certificateIndex:parseInt(u.Convert.ToHex(t.slice(2)),16)}};return t}());bi([Ai({type:Ke.Integer,converter:Ve})],Fs.prototype,"value",void 0);t("ai",Fs=bi([Si({type:Ne.Choice})],Fs));var Ls=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.NumericString})],Ls.prototype,"numericString",void 0);bi([Ai({type:Ke.PrintableString})],Ls.prototype,"printableString",void 0);bi([Ai({type:Ke.TeletexString})],Ls.prototype,"teletexString",void 0);bi([Ai({type:Ke.VideotexString})],Ls.prototype,"videotexString",void 0);bi([Ai({type:Ke.IA5String})],Ls.prototype,"ia5String",void 0);bi([Ai({type:Ke.GraphicString})],Ls.prototype,"graphicString",void 0);bi([Ai({type:Ke.VisibleString})],Ls.prototype,"visibleString",void 0);bi([Ai({type:Ke.GeneralString})],Ls.prototype,"generalString",void 0);bi([Ai({type:Ke.UniversalString})],Ls.prototype,"universalString",void 0);bi([Ai({type:Ke.BmpString})],Ls.prototype,"bmpString",void 0);Ls=bi([Si({type:Ne.Choice})],Ls);var Vs=function(){function t(t){if(t===void 0){t=new ArrayBuffer(0)}this.value=t}return t}();bi([Ai({type:Ke.Any})],Vs.prototype,"value",void 0);Vs=bi([Si({type:Ne.Choice})],Vs);var Gs;var Ws=Gs=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Gs.prototype);return i}return e}(bn);Ws=Gs=bi([Si({type:Ne.Sequence})],Ws);var Qs=function(){function t(t){if(t===void 0){t={}}this.keySpec=0;this.cspName="";this.signature=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Qs.prototype,"keySpec",void 0);bi([Ai({type:Ke.BmpString})],Qs.prototype,"cspName",void 0);bi([Ai({type:Ke.BitString})],Qs.prototype,"signature",void 0);var qs;var zs=qs=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,qs.prototype);return i}return e}(wi);zs=qs=bi([Si({type:Ne.Sequence,itemType:Ke.Any})],zs);var Ys;var Zs=Ys=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Ys.prototype);return i}return e}(wi);Zs=Ys=bi([Si({type:Ne.Sequence,itemType:Ke.Any})],Zs);var $s;var Xs=function(){function t(t){if(t===void 0){t={}}this.name="";this.value="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.BmpString})],Xs.prototype,"name",void 0);bi([Ai({type:Ke.BmpString})],Xs.prototype,"value",void 0);var Js=$s=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,$s.prototype);return i}return e}(wi);Js=$s=bi([Si({type:Ne.Sequence,itemType:Xs})],Js);var tu=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ni);tu=bi([Si({type:Ne.Sequence})],tu);var eu=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ni);eu=bi([Si({type:Ne.Sequence})],eu);var iu=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Dn);iu=bi([Si({type:Ne.Sequence})],iu);var ru=function(){function t(t){if(t===void 0){t={}}this.clientId=0;this.machineName="";this.userName="";this.processName="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],ru.prototype,"clientId",void 0);bi([Ai({type:Ke.Utf8String})],ru.prototype,"machineName",void 0);bi([Ai({type:Ke.Utf8String})],ru.prototype,"userName",void 0);bi([Ai({type:Ke.Utf8String})],ru.prototype,"processName",void 0);var nu="2.16.840.1.113730";var au="".concat(nu,".1");var ou=function(){function t(t){this.value="";if(t){this.value=t}}return t}();bi([Ai({type:Ke.IA5String})],ou.prototype,"value",void 0);ou=bi([Si({type:Ne.Choice})],ou);var su=function(){function t(t){this.value="";if(t){this.value=t}}return t}();bi([Ai({type:Ke.IA5String})],su.prototype,"value",void 0);su=bi([Si({type:Ne.Choice})],su);var uu=function(){function t(t){this.value="";if(t){this.value=t}}return t}();bi([Ai({type:Ke.IA5String})],uu.prototype,"value",void 0);uu=bi([Si({type:Ne.Choice})],uu);var cu=function(){function t(t){this.value="";if(t){this.value=t}}return t}();bi([Ai({type:Ke.IA5String})],cu.prototype,"value",void 0);cu=bi([Si({type:Ne.Choice})],cu);var fu=t("aV","".concat(au,".1"));var vu;(function(t){t[t["sslClient"]=1]="sslClient";t[t["sslServer"]=2]="sslServer";t[t["sMime"]=4]="sMime";t[t["objectSigning"]=8]="objectSigning";t[t["sslCa"]=32]="sslCa";t[t["sMimeCa"]=64]="sMimeCa";t[t["objectSigningCa"]=128]="objectSigningCa"})(vu||(vu={}));var hu=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.toJSON=function(){var t=this.toNumber();var e=[];if(t&vu.objectSigning){e.push("objectSigning")}if(t&vu.objectSigningCa){e.push("objectSigningCa")}if(t&vu.sMime){e.push("sMime")}if(t&vu.sMimeCa){e.push("sMimeCa")}if(t&vu.sslCa){e.push("sslCa")}if(t&vu.sslClient){e.push("sslClient")}if(t&vu.sslServer){e.push("sslServer")}return e};e.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return e}(je);t("aj",hu);var du=t("aW","".concat(au,".13"));var lu=t("ak",function(){function t(t){this.value="";if(t){this.value=t}}return t}());bi([Ai({type:Ke.IA5String})],lu.prototype,"value",void 0);t("ak",lu=bi([Si({type:Ne.Choice})],lu));var pu=function(){function t(t){this.value="";if(t){this.value=t}}return t}();bi([Ai({type:Ke.IA5String})],pu.prototype,"value",void 0);pu=bi([Si({type:Ne.Choice})],pu);var yu=function(){function t(t){this.value="";if(t){this.value=t}}return t}();bi([Ai({type:Ke.IA5String})],yu.prototype,"value",void 0);yu=bi([Si({type:Ne.Choice})],yu);var Su=t("aT","1.3.6.1.4.1.52266.1");var Au=function(){function t(t){if(t===void 0){t={}}this.leiCode="";Object.assign(this,t)}return t}();bi([Ai({type:te})],Au.prototype,"leiCode",void 0);bi([Ai({type:te,context:0,optional:true})],Au.prototype,"leiRole",void 0);Au=bi([Si({type:Ne.Sequence})],Au);var Cu=function(){function t(t){if(t){this.text=t}}Object.defineProperty(t.prototype,"text",{get:function(){if(this.bmpString!==undefined){return this.bmpString}if(this.ia5String!==undefined){return this.ia5String}if(this.printableString!==undefined){return this.printableString}if(this.utf8String!==undefined){return this.utf8String}if(this.visibleString!==undefined){return this.visibleString}return undefined},set:function(t){this.printableString=t},enumerable:false,configurable:true});return t}();bi([Ai({type:Ke.IA5String})],Cu.prototype,"ia5String",void 0);bi([Ai({type:Ke.VisibleString})],Cu.prototype,"visibleString",void 0);bi([Ai({type:Ke.BmpString})],Cu.prototype,"bmpString",void 0);bi([Ai({type:Ke.Utf8String})],Cu.prototype,"utf8String",void 0);bi([Ai({type:Ke.PrintableString})],Cu.prototype,"printableString",void 0);Cu=bi([Si({type:Ne.Choice})],Cu);var mu=t("ah",function(t){__extends(e,t);function e(e){var i=t.call(this)||this;if(typeof e==="string"){i.text=e}else if(e instanceof Au){i.struct=e}return i}return e}(Cu));bi([Ai({type:Au})],mu.prototype,"struct",void 0);t("ah",mu=bi([Si({type:Ne.Choice})],mu));var gu=t("aS","1.3.6.1.4.1.52266.2");var wu=t("ag",function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Cu));t("ag",wu=bi([Si({type:Ne.Choice})],wu));var _u=function(){function t(t){this.offset=0;this.view=u.BufferSourceConverter.toUint8Array(t)}Object.defineProperty(t.prototype,"position",{get:function(){return this.offset},enumerable:false,configurable:true});t.prototype.read=function(t){if(t===void 0){t=1}var e=this.view.slice(this.offset,this.offset+t);this.offset=this.offset+e.length;return e};t.prototype.readByte=function(){var t=this.read();if(!t.length){throw new Error("End of stream")}return t[0]};t.prototype.readNumber=function(t){var e=this.read(t);var i=u.Convert.ToHex(e);return parseInt(i,16)};t.prototype.readEnd=function(){return this.read(this.view.length-this.offset)};t.prototype.reset=function(){this.offset=0};return t}();t("a1",_u);var bu=function(){function t(){}t.createStream=function(t){var e=u.BufferSourceConverter.toUint8Array(t);return new _u(e)};return t}();var Eu;(function(t){t[t["certificateTimestamp"]=0]="certificateTimestamp";t[t["treeHash"]=1]="treeHash"})(Eu||(Eu={}));var Pu;(function(t){t[t["none"]=0]="none";t[t["md5"]=1]="md5";t[t["sha1"]=2]="sha1";t[t["sha224"]=3]="sha224";t[t["sha256"]=4]="sha256";t[t["sha384"]=5]="sha384";t[t["sha512"]=6]="sha512"})(Pu||(Pu={}));var Du;(function(t){t[t["anonymous"]=0]="anonymous";t[t["rsa"]=1]="rsa";t[t["dsa"]=2]="dsa";t[t["ecdsa"]=3]="ecdsa"})(Du||(Du={}));var Iu=function(t){__extends(e,t);function e(e){var i=t.call(this)||this;i.version=0;i.logId=new ArrayBuffer(32);i.timestamp=new Date;i.extensions=new ArrayBuffer(0);i.hashAlgorithm=0;i.signatureAlgorithm=0;i.signature=new ArrayBuffer(0);if(e){i.parse(e)}return i}e.prototype.parse=function(t){this.version=t.readByte();t.read(2);this.logId=u.BufferSourceConverter.toArrayBuffer(t.read(32));this.timestamp=new Date(t.readNumber(8));var e=t.readNumber(2);this.extensions=t.read(e).buffer;this.hashAlgorithm=t.readByte();this.signatureAlgorithm=t.readByte();this.signature=t.read(t.readNumber(2)).buffer};e.prototype.toJSON=function(){return{version:this.version,logId:u.Convert.ToHex(this.logId),timestamp:this.timestamp,extensions:u.Convert.ToBase64(this.extensions),hashAlgorithm:Pu[this.hashAlgorithm]||"undefined",signatureAlgorithm:Du[this.signatureAlgorithm]||"undefined",signature:u.Convert.ToBase64(this.signature)}};return e}(bu);t("a2",Iu);var Bu;(function(t){t[t["v1"]=1]="v1"})(Bu||(Bu={}));var xu=t("aQ","1.2.840.113583.1.1.9.2");var Tu=function(){function t(t){if(t===void 0){t={}}this.version=Bu.v1;Object.assign(this,t)}return t}();t("ae",Tu);bi([Ai({type:Ke.Integer})],Tu.prototype,"version",void 0);var Ou=t("aR","1.2.840.113583.1.1.9.1");var ku=function(){function t(t){if(t===void 0){t={}}this.version=Bu.v1;this.location=new ji;this.requiresAuth=false;Object.assign(this,t)}return t}();t("af",ku);bi([Ai({type:Ke.Integer})],ku.prototype,"version",void 0);bi([Ai({type:ji})],ku.prototype,"location",void 0);bi([Ai({type:Ke.Boolean,defaultValue:false,optional:true})],ku.prototype,"requiresAuth",void 0);var Mu=function(){function t(t){if(t===void 0){t={}}this.hashAlg=new An;this.hashValue=new He;Object.assign(this,t)}return t}();bi([Ai({type:An})],Mu.prototype,"hashAlg",void 0);bi([Ai({type:He})],Mu.prototype,"hashValue",void 0);var Ru=function(){function t(t){if(t===void 0){t={}}this.mediaType="";this.logotypeHash=[];this.logotypeURI=[];Object.assign(this,t)}return t}();bi([Ai({type:Ke.IA5String})],Ru.prototype,"mediaType",void 0);bi([Ai({type:Mu,repeated:"sequence"})],Ru.prototype,"logotypeHash",void 0);bi([Ai({type:Ke.IA5String,repeated:"sequence"})],Ru.prototype,"logotypeURI",void 0);var Nu;(function(t){t[t["mono"]=1]="mono";t[t["stereo"]=2]="stereo";t[t["quad"]=4]="quad"})(Nu||(Nu={}));var Ku=function(){function t(t){if(t===void 0){t={}}this.fileSize=0;this.playTime=0;this.channels=Nu.mono;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Ku.prototype,"fileSize",void 0);bi([Ai({type:Ke.Integer})],Ku.prototype,"playTime",void 0);bi([Ai({type:Ke.Integer})],Ku.prototype,"channels",void 0);bi([Ai({type:Ke.Integer,implicit:true,context:3,optional:true})],Ku.prototype,"sampleRate",void 0);bi([Ai({type:Ke.IA5String,implicit:true,context:4,optional:true})],Ku.prototype,"language",void 0);var ju=function(){function t(t){if(t===void 0){t={}}this.audioDetails=new Ru;Object.assign(this,t)}return t}();bi([Ai({type:Ru})],ju.prototype,"audioDetails",void 0);bi([Ai({type:Ku,optional:true})],ju.prototype,"audioInfo",void 0);var Hu=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,context:1,implicit:true})],Hu.prototype,"numBits",void 0);bi([Ai({type:Ke.Integer,context:2,implicit:true})],Hu.prototype,"tableSize",void 0);Hu=bi([Si({type:Ne.Choice})],Hu);var Uu;(function(t){t[t["grayScale"]=0]="grayScale";t[t["color"]=1]="color"})(Uu||(Uu={}));var Fu=function(){function t(t){if(t===void 0){t={}}this.type=Uu.color;this.fileSize=0;this.xSize=0;this.ySize=0;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,context:0,implicit:true,defaultValue:Uu.color})],Fu.prototype,"type",void 0);bi([Ai({type:Ke.Integer})],Fu.prototype,"fileSize",void 0);bi([Ai({type:Ke.Integer})],Fu.prototype,"xSize",void 0);bi([Ai({type:Ke.Integer})],Fu.prototype,"ySize",void 0);bi([Ai({type:Hu})],Fu.prototype,"resolution",void 0);bi([Ai({type:Ke.IA5String,context:4,implicit:true,optional:true})],Fu.prototype,"language",void 0);var Lu=function(){function t(t){if(t===void 0){t={}}this.imageDetails=new Ru;Object.assign(this,t)}return t}();bi([Ai({type:Ru})],Lu.prototype,"imageDetails",void 0);bi([Ai({type:Fu,optional:true})],Lu.prototype,"imageInfo",void 0);var Vu=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Lu,repeated:"sequence",optional:true})],Vu.prototype,"image",void 0);bi([Ai({type:ju,repeated:"sequence",context:1,optional:true})],Vu.prototype,"audio",void 0);var Gu=function(){function t(t){if(t===void 0){t={}}this.refStructHash=[];this.refStructURI=[];Object.assign(this,t)}return t}();bi([Ai({type:Mu,repeated:"sequence"})],Gu.prototype,"refStructHash",void 0);bi([Ai({type:Ke.IA5String,repeated:"sequence"})],Gu.prototype,"refStructURI",void 0);var Wu=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Vu,implicit:true,context:0})],Wu.prototype,"direct",void 0);bi([Ai({type:Gu,implicit:true,context:1})],Wu.prototype,"indirect",void 0);Wu=bi([Si({type:Ne.Choice})],Wu);var Qu=function(){function t(t){if(t===void 0){t={}}this.logotypeType="";this.info=new Wu;Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Qu.prototype,"logotypeType",void 0);bi([Ai({type:Wu})],Qu.prototype,"info",void 0);var qu=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("aa",qu);bi([Ai({type:Wu,context:0,repeated:"sequence",optional:true})],qu.prototype,"communityLogos",void 0);bi([Ai({type:Wu,context:1,optional:true})],qu.prototype,"issuerLogo",void 0);bi([Ai({type:Wu,context:2,optional:true})],qu.prototype,"subjectLogo",void 0);bi([Ai({type:Qu,context:3,repeated:"sequence",optional:true})],qu.prototype,"otherLogos",void 0);var zu,Yu,Zu;var $u="1.3.6.1.5.5.7";var Xu="".concat($u,".1");var Ju=zu=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,zu.prototype);return i}return e}(wi);Ju=zu=bi([Si({type:Ne.Sequence,itemType:Ke.IA5String})],Ju);var tc=function(){function t(t){if(t===void 0){t={}}this.claim="";this.permitted=[];Object.assign(this,t)}return t}();bi([Ai({type:Ke.IA5String})],tc.prototype,"claim",void 0);bi([Ai({type:Ke.Utf8String,repeated:"sequence"})],tc.prototype,"permitted",void 0);var ec=Yu=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Yu.prototype);return i}return e}(wi);ec=Yu=bi([Si({type:Ne.Sequence,itemType:tc})],ec);var ic=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ju,optional:true,context:0})],ic.prototype,"mustInclude",void 0);bi([Ai({type:ec,optional:true,context:1})],ic.prototype,"permittedValues",void 0);var rc=t("aM","".concat(Xu,".26"));var nc=function(){function t(){this.start="";this.count=2}return t}();bi([Ai({type:Ke.IA5String})],nc.prototype,"start",void 0);bi([Ai({type:Ke.Integer})],nc.prototype,"count",void 0);var ac=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.IA5String,context:0})],ac.prototype,"spc",void 0);bi([Ai({type:nc,context:1})],ac.prototype,"range",void 0);bi([Ai({type:Ke.IA5String,context:2})],ac.prototype,"one",void 0);ac=bi([Si({type:Ne.Choice})],ac);var oc=t("a9",Zu=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Zu.prototype);return i}return e}(wi));t("a9",oc=Zu=bi([Si({type:Ne.Sequence,itemType:ac})],oc));var sc;var uc=t("aI","1.3.6.1.4.1.11129.2.1.17");var cc;(function(t){t[t["verified"]=0]="verified";t[t["selfSigned"]=1]="selfSigned";t[t["unverified"]=2]="unverified";t[t["failed"]=3]="failed"})(cc||(cc={}));var fc=function(){function t(t){if(t===void 0){t={}}this.verifiedBootKey=new He;this.deviceLocked=false;this.verifiedBootState=cc.verified;Object.assign(this,t)}return t}();t("bC",fc);bi([Ai({type:He})],fc.prototype,"verifiedBootKey",void 0);bi([Ai({type:Ke.Boolean})],fc.prototype,"deviceLocked",void 0);bi([Ai({type:Ke.Enumerated})],fc.prototype,"verifiedBootState",void 0);bi([Ai({type:He,optional:true})],fc.prototype,"verifiedBootHash",void 0);var vc=t("bD",sc=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,sc.prototype);return i}return e}(wi));t("bD",vc=sc=bi([Si({type:Ne.Set,itemType:Ke.Integer})],vc));var hc=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({context:1,type:vc,optional:true})],hc.prototype,"purpose",void 0);bi([Ai({context:2,type:Ke.Integer,optional:true})],hc.prototype,"algorithm",void 0);bi([Ai({context:3,type:Ke.Integer,optional:true})],hc.prototype,"keySize",void 0);bi([Ai({context:5,type:vc,optional:true})],hc.prototype,"digest",void 0);bi([Ai({context:6,type:vc,optional:true})],hc.prototype,"padding",void 0);bi([Ai({context:10,type:Ke.Integer,optional:true})],hc.prototype,"ecCurve",void 0);bi([Ai({context:200,type:Ke.Integer,optional:true})],hc.prototype,"rsaPublicExponent",void 0);bi([Ai({context:203,type:vc,optional:true})],hc.prototype,"mgfDigest",void 0);bi([Ai({context:303,type:Ke.Null,optional:true})],hc.prototype,"rollbackResistance",void 0);bi([Ai({context:305,type:Ke.Null,optional:true})],hc.prototype,"earlyBootOnly",void 0);bi([Ai({context:400,type:Ke.Integer,optional:true})],hc.prototype,"activeDateTime",void 0);bi([Ai({context:401,type:Ke.Integer,optional:true})],hc.prototype,"originationExpireDateTime",void 0);bi([Ai({context:402,type:Ke.Integer,optional:true})],hc.prototype,"usageExpireDateTime",void 0);bi([Ai({context:405,type:Ke.Integer,optional:true})],hc.prototype,"usageCountLimit",void 0);bi([Ai({context:503,type:Ke.Null,optional:true})],hc.prototype,"noAuthRequired",void 0);bi([Ai({context:504,type:Ke.Integer,optional:true})],hc.prototype,"userAuthType",void 0);bi([Ai({context:505,type:Ke.Integer,optional:true})],hc.prototype,"authTimeout",void 0);bi([Ai({context:506,type:Ke.Null,optional:true})],hc.prototype,"allowWhileOnBody",void 0);bi([Ai({context:507,type:Ke.Null,optional:true})],hc.prototype,"trustedUserPresenceRequired",void 0);bi([Ai({context:508,type:Ke.Null,optional:true})],hc.prototype,"trustedConfirmationRequired",void 0);bi([Ai({context:509,type:Ke.Null,optional:true})],hc.prototype,"unlockedDeviceRequired",void 0);bi([Ai({context:600,type:Ke.Null,optional:true})],hc.prototype,"allApplications",void 0);bi([Ai({context:601,type:He,optional:true})],hc.prototype,"applicationId",void 0);bi([Ai({context:701,type:Ke.Integer,optional:true})],hc.prototype,"creationDateTime",void 0);bi([Ai({context:702,type:Ke.Integer,optional:true})],hc.prototype,"origin",void 0);bi([Ai({context:703,type:Ke.Null,optional:true})],hc.prototype,"rollbackResistant",void 0);bi([Ai({context:704,type:fc,optional:true})],hc.prototype,"rootOfTrust",void 0);bi([Ai({context:705,type:Ke.Integer,optional:true})],hc.prototype,"osVersion",void 0);bi([Ai({context:706,type:Ke.Integer,optional:true})],hc.prototype,"osPatchLevel",void 0);bi([Ai({context:709,type:He,optional:true})],hc.prototype,"attestationApplicationId",void 0);bi([Ai({context:710,type:He,optional:true})],hc.prototype,"attestationIdBrand",void 0);bi([Ai({context:711,type:He,optional:true})],hc.prototype,"attestationIdDevice",void 0);bi([Ai({context:712,type:He,optional:true})],hc.prototype,"attestationIdProduct",void 0);bi([Ai({context:713,type:He,optional:true})],hc.prototype,"attestationIdSerial",void 0);bi([Ai({context:714,type:He,optional:true})],hc.prototype,"attestationIdImei",void 0);bi([Ai({context:715,type:He,optional:true})],hc.prototype,"attestationIdMeid",void 0);bi([Ai({context:716,type:He,optional:true})],hc.prototype,"attestationIdManufacturer",void 0);bi([Ai({context:717,type:He,optional:true})],hc.prototype,"attestationIdModel",void 0);bi([Ai({context:718,type:Ke.Integer,optional:true})],hc.prototype,"vendorPatchLevel",void 0);bi([Ai({context:719,type:Ke.Integer,optional:true})],hc.prototype,"bootPatchLevel",void 0);bi([Ai({context:720,type:Ke.Null,optional:true})],hc.prototype,"deviceUniqueAttestation",void 0);bi([Ai({context:723,type:He,optional:true})],hc.prototype,"attestationIdSecondImei",void 0);bi([Ai({context:724,type:He,optional:true})],hc.prototype,"moduleHash",void 0);var dc;(function(t){t[t["software"]=0]="software";t[t["trustedEnvironment"]=1]="trustedEnvironment";t[t["strongBox"]=2]="strongBox"})(dc||(dc={}));var lc;(function(t){t[t["KM2"]=1]="KM2";t[t["KM3"]=2]="KM3";t[t["KM4"]=3]="KM4";t[t["KM4_1"]=4]="KM4_1";t[t["keyMint1"]=100]="keyMint1";t[t["keyMint2"]=200]="keyMint2";t[t["keyMint3"]=300]="keyMint3";t[t["keyMint4"]=400]="keyMint4"})(lc||(lc={}));var pc=function(){function t(t){if(t===void 0){t={}}this.attestationVersion=lc.KM4;this.attestationSecurityLevel=dc.software;this.keymasterVersion=0;this.keymasterSecurityLevel=dc.software;this.attestationChallenge=new He;this.uniqueId=new He;this.softwareEnforced=new hc;this.teeEnforced=new hc;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],pc.prototype,"attestationVersion",void 0);bi([Ai({type:Ke.Enumerated})],pc.prototype,"attestationSecurityLevel",void 0);bi([Ai({type:Ke.Integer})],pc.prototype,"keymasterVersion",void 0);bi([Ai({type:Ke.Enumerated})],pc.prototype,"keymasterSecurityLevel",void 0);bi([Ai({type:He})],pc.prototype,"attestationChallenge",void 0);bi([Ai({type:He})],pc.prototype,"uniqueId",void 0);bi([Ai({type:hc})],pc.prototype,"softwareEnforced",void 0);bi([Ai({type:hc})],pc.prototype,"teeEnforced",void 0);var yc=function(){function t(t){if(t===void 0){t={}}this.attestationVersion=lc.keyMint4;this.attestationSecurityLevel=dc.software;this.keyMintVersion=0;this.keyMintSecurityLevel=dc.software;this.attestationChallenge=new He;this.uniqueId=new He;this.softwareEnforced=new hc;this.hardwareEnforced=new hc;Object.assign(this,t)}t.prototype.toLegacyKeyDescription=function(){return new pc({attestationVersion:this.attestationVersion,attestationSecurityLevel:this.attestationSecurityLevel,keymasterVersion:this.keyMintVersion,keymasterSecurityLevel:this.keyMintSecurityLevel,attestationChallenge:this.attestationChallenge,uniqueId:this.uniqueId,softwareEnforced:this.softwareEnforced,teeEnforced:this.hardwareEnforced})};t.fromLegacyKeyDescription=function(e){return new t({attestationVersion:e.attestationVersion,attestationSecurityLevel:e.attestationSecurityLevel,keyMintVersion:e.keymasterVersion,keyMintSecurityLevel:e.keymasterSecurityLevel,attestationChallenge:e.attestationChallenge,uniqueId:e.uniqueId,softwareEnforced:e.softwareEnforced,hardwareEnforced:e.teeEnforced})};return t}();bi([Ai({type:Ke.Integer})],yc.prototype,"attestationVersion",void 0);bi([Ai({type:Ke.Enumerated})],yc.prototype,"attestationSecurityLevel",void 0);bi([Ai({type:Ke.Integer})],yc.prototype,"keyMintVersion",void 0);bi([Ai({type:Ke.Enumerated})],yc.prototype,"keyMintSecurityLevel",void 0);bi([Ai({type:He})],yc.prototype,"attestationChallenge",void 0);bi([Ai({type:He})],yc.prototype,"uniqueId",void 0);bi([Ai({type:hc})],yc.prototype,"softwareEnforced",void 0);bi([Ai({type:hc})],yc.prototype,"hardwareEnforced",void 0);var Sc;var Ac=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(hc);Ac=bi([Si({type:Ne.Choice})],Ac);var Cc=Sc=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Sc.prototype);return i}e.prototype.findProperty=function(t){var e=this.find((function(e){return t in e}));if(e){return e[t]}return undefined};return e}(wi);Cc=Sc=bi([Si({type:Ne.Sequence,itemType:Ac})],Cc);var mc=function(){function t(t){if(t===void 0){t={}}this.attestationVersion=lc.KM4;this.attestationSecurityLevel=dc.software;this.keymasterVersion=0;this.keymasterSecurityLevel=dc.software;this.attestationChallenge=new He;this.uniqueId=new He;this.softwareEnforced=new Cc;this.teeEnforced=new Cc;Object.assign(this,t)}Object.defineProperty(t.prototype,"keyMintVersion",{get:function(){return this.keymasterVersion},set:function(t){this.keymasterVersion=t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"keyMintSecurityLevel",{get:function(){return this.keymasterSecurityLevel},set:function(t){this.keymasterSecurityLevel=t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hardwareEnforced",{get:function(){return this.teeEnforced},set:function(t){this.teeEnforced=t},enumerable:false,configurable:true});return t}();t("a5",mc);bi([Ai({type:Ke.Integer})],mc.prototype,"attestationVersion",void 0);bi([Ai({type:Ke.Enumerated})],mc.prototype,"attestationSecurityLevel",void 0);bi([Ai({type:Ke.Integer})],mc.prototype,"keymasterVersion",void 0);bi([Ai({type:Ke.Enumerated})],mc.prototype,"keymasterSecurityLevel",void 0);bi([Ai({type:He})],mc.prototype,"attestationChallenge",void 0);bi([Ai({type:He})],mc.prototype,"uniqueId",void 0);bi([Ai({type:Cc})],mc.prototype,"softwareEnforced",void 0);bi([Ai({type:Cc})],mc.prototype,"teeEnforced",void 0);var gc=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}if("keymasterVersion"in e&&!("keyMintVersion"in e)){e.keyMintVersion=e.keymasterVersion}if("keymasterSecurityLevel"in e&&!("keyMintSecurityLevel"in e)){e.keyMintSecurityLevel=e.keymasterSecurityLevel}if("teeEnforced"in e&&!("hardwareEnforced"in e)){e.hardwareEnforced=e.teeEnforced}return t.call(this,e)||this}return e}(mc);gc=bi([Si({type:Ne.Sequence})],gc);var wc=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Ke.OctetString})],wc.prototype,"packageName",void 0);bi([Ai({type:Ke.Integer})],wc.prototype,"version",void 0);var _c=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("bB",_c);bi([Ai({type:wc,repeated:"set"})],_c.prototype,"packageInfos",void 0);bi([Ai({type:Ke.OctetString,repeated:"set"})],_c.prototype,"signatureDigests",void 0);var bc=undefined&&undefined.__decorate||function(t,e,i,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(t,e,i,r);else for(var s=t.length-1;s>=0;s--)if(o=t[s])a=(n<3?o(a):n>3?o(e,i,a):o(e,i))||a;return n>3&&a&&Object.defineProperty(e,i,a),a};var Ec=t("aH","2.23.140.3.1");var Pc=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();t("a4",Pc);bc([Ai({type:Ke.PrintableString})],Pc.prototype,"registrationSchemeIdentifier",void 0);bc([Ai({type:Ke.PrintableString})],Pc.prototype,"registrationCountry",void 0);bc([Ai({type:Ke.PrintableString,optional:true,context:0,implicit:true})],Pc.prototype,"registrationStateOrProvince",void 0);bc([Ai({type:Ke.Utf8String})],Pc.prototype,"registrationReference",void 0);
107
107
  /**
108
108
  * @license
109
109
  * Copyright (c) Peculiar Ventures, LLC.
@@ -131,5 +131,5 @@ var __extends=this&&this.__extends||function(){var t=function(e,i){t=Object.setP
131
131
  *
132
132
  * This source code is licensed under the MIT license found in the
133
133
  * LICENSE file in the root directory of this source tree.
134
- */var Qc=t("c",(function(t){if(Vc.isPem(t)){return Vc.decode(t)[0]}if(u.Convert.isHex(t)){return u.Convert.FromHex(t)}if(u.Convert.isBase64(t)){return u.Convert.FromBase64(t)}if(u.Convert.isBase64Url(t)){return u.Convert.FromBase64Url(t)}return u.Convert.FromBinary(t)}));var qc=t("m",(function(t,i){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(r){e=Wc.get();if(e.subtle){return[2,e.subtle.digest(t,i)]}return[2,undefined]}))}))}));var zc=function(){function t(t){if(t===void 0){t={}}this.acIssuer=new ji;this.acSerial=0;this.attrs=[];Object.assign(this,t)}return t}();bi([Ai({type:ji})],zc.prototype,"acIssuer",void 0);bi([Ai({type:Ke.Integer})],zc.prototype,"acSerial",void 0);bi([Ai({type:rn,repeated:"sequence"})],zc.prototype,"attrs",void 0);var Yc;var Zc=Yc=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Yc.prototype);return i}return e}(wi);Zc=Yc=bi([Si({type:Ne.Sequence,itemType:Ke.ObjectIdentifier})],Zc);var $c=function(){function t(t){if(t===void 0){t={}}this.permitUnSpecified=true;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,optional:true})],$c.prototype,"pathLenConstraint",void 0);bi([Ai({type:Zc,implicit:true,context:0,optional:true})],$c.prototype,"permittedAttrs",void 0);bi([Ai({type:Zc,implicit:true,context:1,optional:true})],$c.prototype,"excludedAttrs",void 0);bi([Ai({type:Ke.Boolean,defaultValue:true})],$c.prototype,"permitUnSpecified",void 0);var Xc=function(){function t(t){if(t===void 0){t={}}this.issuer=new Xi;this.serial=new ArrayBuffer(0);this.issuerUID=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Xi})],Xc.prototype,"issuer",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Xc.prototype,"serial",void 0);bi([Ai({type:Ke.BitString,optional:true})],Xc.prototype,"issuerUID",void 0);var Jc;(function(t){t[t["publicKey"]=0]="publicKey";t[t["publicKeyCert"]=1]="publicKeyCert";t[t["otherObjectTypes"]=2]="otherObjectTypes"})(Jc||(Jc={}));var tf=function(){function t(t){if(t===void 0){t={}}this.digestedObjectType=Jc.publicKey;this.digestAlgorithm=new An;this.objectDigest=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.Enumerated})],tf.prototype,"digestedObjectType",void 0);bi([Ai({type:Ke.ObjectIdentifier,optional:true})],tf.prototype,"otherObjectTypeID",void 0);bi([Ai({type:An})],tf.prototype,"digestAlgorithm",void 0);bi([Ai({type:Ke.BitString})],tf.prototype,"objectDigest",void 0);var ef=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Xi,optional:true})],ef.prototype,"issuerName",void 0);bi([Ai({type:Xc,context:0,implicit:true,optional:true})],ef.prototype,"baseCertificateID",void 0);bi([Ai({type:tf,context:1,implicit:true,optional:true})],ef.prototype,"objectDigestInfo",void 0);var rf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:ji,repeated:"sequence"})],rf.prototype,"v1Form",void 0);bi([Ai({type:ef,context:0,implicit:true})],rf.prototype,"v2Form",void 0);rf=bi([Si({type:Ne.Choice})],rf);var nf=function(){function t(t){if(t===void 0){t={}}this.notBeforeTime=new Date;this.notAfterTime=new Date;Object.assign(this,t)}return t}();bi([Ai({type:Ke.GeneralizedTime})],nf.prototype,"notBeforeTime",void 0);bi([Ai({type:Ke.GeneralizedTime})],nf.prototype,"notAfterTime",void 0);var af=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Xc,implicit:true,context:0,optional:true})],af.prototype,"baseCertificateID",void 0);bi([Ai({type:Xi,implicit:true,context:1,optional:true})],af.prototype,"entityName",void 0);bi([Ai({type:tf,implicit:true,context:2,optional:true})],af.prototype,"objectDigestInfo",void 0);var of;(function(t){t[t["v2"]=1]="v2"})(of||(of={}));var sf=function(){function t(t){if(t===void 0){t={}}this.version=of.v2;this.holder=new af;this.issuer=new rf;this.signature=new An;this.serialNumber=new ArrayBuffer(0);this.attrCertValidityPeriod=new nf;this.attributes=[];Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],sf.prototype,"version",void 0);bi([Ai({type:af})],sf.prototype,"holder",void 0);bi([Ai({type:rf})],sf.prototype,"issuer",void 0);bi([Ai({type:An})],sf.prototype,"signature",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],sf.prototype,"serialNumber",void 0);bi([Ai({type:nf})],sf.prototype,"attrCertValidityPeriod",void 0);bi([Ai({type:rn,repeated:"sequence"})],sf.prototype,"attributes",void 0);bi([Ai({type:Ke.BitString,optional:true})],sf.prototype,"issuerUniqueID",void 0);bi([Ai({type:bn,optional:true})],sf.prototype,"extensions",void 0);var uf=function(){function t(t){if(t===void 0){t={}}this.acinfo=new sf;this.signatureAlgorithm=new An;this.signatureValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("n",uf);bi([Ai({type:sf})],uf.prototype,"acinfo",void 0);bi([Ai({type:An})],uf.prototype,"signatureAlgorithm",void 0);bi([Ai({type:Ke.BitString})],uf.prototype,"signatureValue",void 0);var cf;(function(t){t[t["unmarked"]=1]="unmarked";t[t["unclassified"]=2]="unclassified";t[t["restricted"]=4]="restricted";t[t["confidential"]=8]="confidential";t[t["secret"]=16]="secret";t[t["topSecret"]=32]="topSecret"})(cf||(cf={}));var ff=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(je);var vf=function(){function t(t){if(t===void 0){t={}}this.type="";this.value=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier,implicit:true,context:0})],vf.prototype,"type",void 0);bi([Ai({type:Ke.Any,implicit:true,context:1})],vf.prototype,"value",void 0);var hf=function(){function t(t){if(t===void 0){t={}}this.policyId="";this.classList=new ff(cf.unclassified);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],hf.prototype,"policyId",void 0);bi([Ai({type:ff,defaultValue:new ff(cf.unclassified)})],hf.prototype,"classList",void 0);bi([Ai({type:vf,repeated:"set"})],hf.prototype,"securityCategories",void 0);var df=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:He})],df.prototype,"cotets",void 0);bi([Ai({type:Ke.ObjectIdentifier})],df.prototype,"oid",void 0);bi([Ai({type:Ke.Utf8String})],df.prototype,"string",void 0);var lf=function(){function t(t){if(t===void 0){t={}}this.values=[];Object.assign(this,t)}return t}();bi([Ai({type:Xi,implicit:true,context:0,optional:true})],lf.prototype,"policyAuthority",void 0);bi([Ai({type:df,repeated:"sequence"})],lf.prototype,"values",void 0);var pf;var yf=function(){function t(t){if(t===void 0){t={}}this.targetCertificate=new Xc;Object.assign(this,t)}return t}();bi([Ai({type:Xc})],yf.prototype,"targetCertificate",void 0);bi([Ai({type:ji,optional:true})],yf.prototype,"targetName",void 0);bi([Ai({type:tf,optional:true})],yf.prototype,"certDigestInfo",void 0);var Sf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:ji,context:0,implicit:true})],Sf.prototype,"targetName",void 0);bi([Ai({type:ji,context:1,implicit:true})],Sf.prototype,"targetGroup",void 0);bi([Ai({type:yf,context:2,implicit:true})],Sf.prototype,"targetCert",void 0);Sf=bi([Si({type:Ne.Choice})],Sf);var Af=pf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,pf.prototype);return i}return e}(wi);Af=pf=bi([Si({type:Ne.Sequence,itemType:Sf})],Af);var Cf;var mf=Cf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Cf.prototype);return i}return e}(wi);mf=Cf=bi([Si({type:Ne.Sequence,itemType:Af})],mf);var gf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Xi,implicit:true,context:0,optional:true})],gf.prototype,"roleAuthority",void 0);bi([Ai({type:ji,implicit:true,context:1})],gf.prototype,"roleName",void 0);var wf=function(){function t(t){if(t===void 0){t={}}this.service=new ji;this.ident=new ji;Object.assign(this,t)}return t}();bi([Ai({type:ji})],wf.prototype,"service",void 0);bi([Ai({type:ji})],wf.prototype,"ident",void 0);bi([Ai({type:He,optional:true})],wf.prototype,"authInfo",void 0);var _f="0.4.0.9496";var bf=t("L","".concat(_f,".6"));var Ef=t("u",function(){function t(t){if(t===void 0){t={}}this.codeAuthority=new ji;this.codeId=new ji;this.shortName="";this.shortDescription="";Object.assign(this,t)}return t}());bi([Ai({type:ji,context:0})],Ef.prototype,"codeAuthority",void 0);bi([Ai({type:ji,context:1})],Ef.prototype,"codeId",void 0);bi([Ai({type:Ke.Utf8String,context:2})],Ef.prototype,"shortName",void 0);bi([Ai({type:Ke.Utf8String,context:3})],Ef.prototype,"shortDescription",void 0);t("u",Ef=bi([Si({type:Ne.Sequence})],Ef));var Pf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Mi);Pf=bi([Si({type:Ne.Sequence})],Pf);var Df=t("X","".concat(_f,".1"));var If=t("y",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("y",If=bi([Si({type:Ne.Sequence})],If));var Bf=t("S","".concat(_f,".2"));var xf=t("x",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("x",xf=bi([Si({type:Ne.Sequence})],xf));var Tf=t("Q","".concat(_f,".3"));var Of=t("w",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("w",Of=bi([Si({type:Ne.Sequence})],Of));var kf=t("O","".concat(_f,".4"));var Mf=t("v",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("v",Mf=bi([Si({type:Ne.Sequence})],Mf));var Rf=t("J","".concat(_f,".8"));var Nf=t("I",function(){function t(t){if(t===void 0){t={}}this.location="";this.base=0;this.degree=0;Object.assign(this,t)}t.prototype.toString=function(){return"".concat(this.base," x 10^").concat(this.degree," ").concat(this.location)};return t}());bi([Ai({type:Ke.PrintableString})],Nf.prototype,"location",void 0);bi([Ai({type:Ke.Integer})],Nf.prototype,"base",void 0);bi([Ai({type:Ke.Integer})],Nf.prototype,"degree",void 0);t("I",Nf=bi([Si({type:Ne.Sequence})],Nf));var Kf=t("H","".concat(_f,".9"));var jf=t("V",function(){function t(t){if(t===void 0){t={}}this.stars5=0;this.stars4=0;this.stars3=0;this.stars2=0;this.stars1=0;Object.assign(this,t)}return t}());bi([Ai({type:Ke.Integer})],jf.prototype,"stars5",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars4",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars3",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars2",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars1",void 0);t("V",jf=bi([Si({type:Ne.Sequence})],jf));var Hf=t("M","".concat(_f,".5"));var Uf=t("T",function(){function t(t){if(t===void 0){t={}}this.DNBvsDNO=new je(0);this.DNBvsDNT=new je(0);this.DNOvsDNT=new je(0);Object.assign(this,t)}return t}());bi([Ai({type:je,context:0})],Uf.prototype,"DNBvsDNO",void 0);bi([Ai({type:je,context:1})],Uf.prototype,"DNBvsDNT",void 0);bi([Ai({type:je,context:2})],Uf.prototype,"DNOvsDNT",void 0);t("T",Uf=bi([Si({type:Ne.Sequence})],Uf));var Ff=t("K","".concat(_f,".7"));var Lf=t("W",function(){function t(t){if(t===void 0){t={}}this.assessmentAuthority=new ji;this.assessmentRef=new ji;this.assessmentLocation=new ji;this.dataStorageTerritory="";this.description="";Object.assign(this,t)}return t}());bi([Ai({type:ji,context:0})],Lf.prototype,"assessmentAuthority",void 0);bi([Ai({type:ji,context:1})],Lf.prototype,"assessmentRef",void 0);bi([Ai({type:ji,context:2})],Lf.prototype,"assessmentLocation",void 0);bi([Ai({type:Ke.PrintableString,context:3})],Lf.prototype,"dataStorageTerritory",void 0);bi([Ai({type:Ke.Utf8String,context:4})],Lf.prototype,"description",void 0);t("W",Lf=bi([Si({type:Ne.Sequence})],Lf));var Vf=function(){function t(t){if(t===void 0){t={}}this.issuer=new Mi;this.serialNumber=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Mi})],Vf.prototype,"issuer",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Vf.prototype,"serialNumber",void 0);var Gf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:un,context:0,implicit:true})],Gf.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Vf})],Gf.prototype,"issuerAndSerialNumber",void 0);Gf=bi([Si({type:Ne.Choice})],Gf);var Wf;(function(t){t[t["v0"]=0]="v0";t[t["v1"]=1]="v1";t[t["v2"]=2]="v2";t[t["v3"]=3]="v3";t[t["v4"]=4]="v4";t[t["v5"]=5]="v5"})(Wf||(Wf={}));var Qf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Qf=bi([Si({type:Ne.Sequence})],Qf);var qf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);qf=bi([Si({type:Ne.Sequence})],qf);var zf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);zf=bi([Si({type:Ne.Sequence})],zf);var Yf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Yf=bi([Si({type:Ne.Sequence})],Yf);var Zf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Zf=bi([Si({type:Ne.Sequence})],Zf);var $f=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);$f=bi([Si({type:Ne.Sequence})],$f);var Xf=function(){function t(t){if(t===void 0){t={}}this.attrType="";this.attrValues=[];Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Xf.prototype,"attrType",void 0);bi([Ai({type:Ke.Any,repeated:"set"})],Xf.prototype,"attrValues",void 0);var Jf;var tv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.sid=new Gf;this.digestAlgorithm=new Qf;this.signatureAlgorithm=new qf;this.signature=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],tv.prototype,"version",void 0);bi([Ai({type:Gf})],tv.prototype,"sid",void 0);bi([Ai({type:Qf})],tv.prototype,"digestAlgorithm",void 0);bi([Ai({type:Xf,repeated:"set",context:0,implicit:true,optional:true})],tv.prototype,"signedAttrs",void 0);bi([Ai({type:qf})],tv.prototype,"signatureAlgorithm",void 0);bi([Ai({type:He})],tv.prototype,"signature",void 0);bi([Ai({type:Xf,repeated:"set",context:1,implicit:true,optional:true})],tv.prototype,"unsignedAttrs",void 0);var ev=Jf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Jf.prototype);return i}return e}(wi);ev=Jf=bi([Si({type:Ne.Set,itemType:tv})],ev);var iv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mn);iv=bi([Si({type:Ne.Choice})],iv);var rv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(tv);rv=bi([Si({type:Ne.Sequence})],rv);var nv;var av=function(){function t(t){if(t===void 0){t={}}this.otherCertFormat="";this.otherCert=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],av.prototype,"otherCertFormat",void 0);bi([Ai({type:Ke.Any})],av.prototype,"otherCert",void 0);var ov=t("bk",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:Dn})],ov.prototype,"certificate",void 0);bi([Ai({type:uf,context:2,implicit:true})],ov.prototype,"v2AttrCert",void 0);bi([Ai({type:av,context:3,implicit:true})],ov.prototype,"other",void 0);t("bk",ov=bi([Si({type:Ne.Choice})],ov));var sv=t("bj",nv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,nv.prototype);return i}return e}(wi));t("bj",sv=nv=bi([Si({type:Ne.Set,itemType:ov})],sv));var uv=function(){function t(t){if(t===void 0){t={}}this.contentType="";this.content=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("bl",uv);bi([Ai({type:Ke.ObjectIdentifier})],uv.prototype,"contentType",void 0);bi([Ai({type:Ke.Any,context:0})],uv.prototype,"content",void 0);var cv=t("bi",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:He})],cv.prototype,"single",void 0);bi([Ai({type:Ke.Any})],cv.prototype,"any",void 0);t("bi",cv=bi([Si({type:Ne.Choice})],cv));var fv=function(){function t(t){if(t===void 0){t={}}this.eContentType="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],fv.prototype,"eContentType",void 0);bi([Ai({type:cv,context:0,optional:true})],fv.prototype,"eContent",void 0);var vv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:He,context:0,implicit:true,optional:true})],vv.prototype,"value",void 0);bi([Ai({type:He,converter:ze,context:0,implicit:true,optional:true,repeated:"sequence"})],vv.prototype,"constructedValue",void 0);vv=bi([Si({type:Ne.Choice})],vv);var hv=function(){function t(t){if(t===void 0){t={}}this.contentType="";this.contentEncryptionAlgorithm=new Yf;Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],hv.prototype,"contentType",void 0);bi([Ai({type:Yf})],hv.prototype,"contentEncryptionAlgorithm",void 0);bi([Ai({type:vv,optional:true})],hv.prototype,"encryptedContent",void 0);var dv=function(){function t(t){if(t===void 0){t={}}this.keyAttrId="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],dv.prototype,"keyAttrId",void 0);bi([Ai({type:Ke.Any,optional:true})],dv.prototype,"keyAttr",void 0);var lv;var pv=function(){function t(t){if(t===void 0){t={}}this.subjectKeyIdentifier=new un;Object.assign(this,t)}return t}();bi([Ai({type:un})],pv.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Ke.GeneralizedTime,optional:true})],pv.prototype,"date",void 0);bi([Ai({type:dv,optional:true})],pv.prototype,"other",void 0);var yv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:pv,context:0,implicit:true,optional:true})],yv.prototype,"rKeyId",void 0);bi([Ai({type:Vf,optional:true})],yv.prototype,"issuerAndSerialNumber",void 0);yv=bi([Si({type:Ne.Choice})],yv);var Sv=function(){function t(t){if(t===void 0){t={}}this.rid=new yv;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:yv})],Sv.prototype,"rid",void 0);bi([Ai({type:He})],Sv.prototype,"encryptedKey",void 0);var Av=lv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,lv.prototype);return i}return e}(wi);Av=lv=bi([Si({type:Ne.Sequence,itemType:Sv})],Av);var Cv=function(){function t(t){if(t===void 0){t={}}this.algorithm=new An;this.publicKey=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:An})],Cv.prototype,"algorithm",void 0);bi([Ai({type:Ke.BitString})],Cv.prototype,"publicKey",void 0);var mv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:un,context:0,implicit:true,optional:true})],mv.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Cv,context:1,implicit:true,optional:true})],mv.prototype,"originatorKey",void 0);bi([Ai({type:Vf,optional:true})],mv.prototype,"issuerAndSerialNumber",void 0);mv=bi([Si({type:Ne.Choice})],mv);var gv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v3;this.originator=new mv;this.keyEncryptionAlgorithm=new zf;this.recipientEncryptedKeys=new Av;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],gv.prototype,"version",void 0);bi([Ai({type:mv,context:0})],gv.prototype,"originator",void 0);bi([Ai({type:He,context:1,optional:true})],gv.prototype,"ukm",void 0);bi([Ai({type:zf})],gv.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:Av})],gv.prototype,"recipientEncryptedKeys",void 0);var wv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:un,context:0,implicit:true})],wv.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Vf})],wv.prototype,"issuerAndSerialNumber",void 0);wv=bi([Si({type:Ne.Choice})],wv);var _v=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.rid=new wv;this.keyEncryptionAlgorithm=new zf;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],_v.prototype,"version",void 0);bi([Ai({type:wv})],_v.prototype,"rid",void 0);bi([Ai({type:zf})],_v.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:He})],_v.prototype,"encryptedKey",void 0);var bv=function(){function t(t){if(t===void 0){t={}}this.keyIdentifier=new He;Object.assign(this,t)}return t}();bi([Ai({type:He})],bv.prototype,"keyIdentifier",void 0);bi([Ai({type:Ke.GeneralizedTime,optional:true})],bv.prototype,"date",void 0);bi([Ai({type:dv,optional:true})],bv.prototype,"other",void 0);var Ev=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v4;this.kekid=new bv;this.keyEncryptionAlgorithm=new zf;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Ev.prototype,"version",void 0);bi([Ai({type:bv})],Ev.prototype,"kekid",void 0);bi([Ai({type:zf})],Ev.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:He})],Ev.prototype,"encryptedKey",void 0);var Pv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.keyEncryptionAlgorithm=new zf;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Pv.prototype,"version",void 0);bi([Ai({type:$f,context:0,optional:true})],Pv.prototype,"keyDerivationAlgorithm",void 0);bi([Ai({type:zf})],Pv.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:He})],Pv.prototype,"encryptedKey",void 0);var Dv=function(){function t(t){if(t===void 0){t={}}this.oriType="";this.oriValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Dv.prototype,"oriType",void 0);bi([Ai({type:Ke.Any})],Dv.prototype,"oriValue",void 0);var Iv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:_v,optional:true})],Iv.prototype,"ktri",void 0);bi([Ai({type:gv,context:1,implicit:true,optional:true})],Iv.prototype,"kari",void 0);bi([Ai({type:Ev,context:2,implicit:true,optional:true})],Iv.prototype,"kekri",void 0);bi([Ai({type:Pv,context:3,implicit:true,optional:true})],Iv.prototype,"pwri",void 0);bi([Ai({type:Dv,context:4,implicit:true,optional:true})],Iv.prototype,"ori",void 0);Iv=bi([Si({type:Ne.Choice})],Iv);var Bv;var xv=Bv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Bv.prototype);return i}return e}(wi);xv=Bv=bi([Si({type:Ne.Set,itemType:Iv})],xv);var Tv;var Ov=function(){function t(t){if(t===void 0){t={}}this.otherRevInfoFormat="";this.otherRevInfo=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Ov.prototype,"otherRevInfoFormat",void 0);bi([Ai({type:Ke.Any})],Ov.prototype,"otherRevInfo",void 0);var kv=function(){function t(t){if(t===void 0){t={}}this.other=new Ov;Object.assign(this,t)}return t}();bi([Ai({type:Ov,context:1,implicit:true})],kv.prototype,"other",void 0);kv=bi([Si({type:Ne.Choice})],kv);var Mv=Tv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Tv.prototype);return i}return e}(wi);Mv=Tv=bi([Si({type:Ne.Set,itemType:kv})],Mv);var Rv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:sv,context:0,implicit:true,optional:true})],Rv.prototype,"certs",void 0);bi([Ai({type:Mv,context:1,implicit:true,optional:true})],Rv.prototype,"crls",void 0);var Nv;var Kv=Nv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Nv.prototype);return i}return e}(wi);Kv=Nv=bi([Si({type:Ne.Set,itemType:Xf})],Kv);var jv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.recipientInfos=new xv;this.encryptedContentInfo=new hv;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],jv.prototype,"version",void 0);bi([Ai({type:Rv,context:0,implicit:true,optional:true})],jv.prototype,"originatorInfo",void 0);bi([Ai({type:xv})],jv.prototype,"recipientInfos",void 0);bi([Ai({type:hv})],jv.prototype,"encryptedContentInfo",void 0);bi([Ai({type:Kv,context:1,implicit:true,optional:true})],jv.prototype,"unprotectedAttrs",void 0);var Hv;var Uv=Hv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Hv.prototype);return i}return e}(wi);Uv=Hv=bi([Si({type:Ne.Set,itemType:Qf})],Uv);var Fv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.digestAlgorithms=new Uv;this.encapContentInfo=new fv;this.signerInfos=new ev;Object.assign(this,t)}return t}();t("bh",Fv);bi([Ai({type:Ke.Integer})],Fv.prototype,"version",void 0);bi([Ai({type:Uv})],Fv.prototype,"digestAlgorithms",void 0);bi([Ai({type:fv})],Fv.prototype,"encapContentInfo",void 0);bi([Ai({type:sv,context:0,implicit:true,optional:true})],Fv.prototype,"certificates",void 0);bi([Ai({type:Mv,context:1,implicit:true,optional:true})],Fv.prototype,"crls",void 0);bi([Ai({type:ev})],Fv.prototype,"signerInfos",void 0);var Lv;var Vv=function(){function t(t){if(t===void 0){t={}}this.attrId="";this.attrValues=[];Object.assign(t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Vv.prototype,"attrId",void 0);bi([Ai({type:Ke.Any,repeated:"set"})],Vv.prototype,"attrValues",void 0);var Gv=Lv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Lv.prototype);return i}return e}(wi);Gv=Lv=bi([Si({type:Ne.Sequence,itemType:Vv})],Gv);var Wv;var Qv=Wv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Wv.prototype);return i}return e}(wi);Qv=Wv=bi([Si({type:Ne.Sequence,itemType:uv})],Qv);var qv=function(){function t(t){if(t===void 0){t={}}this.certId="";this.certValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],qv.prototype,"certId",void 0);bi([Ai({type:Ke.Any,context:0})],qv.prototype,"certValue",void 0);var zv=function(){function t(t){if(t===void 0){t={}}this.crlId="";this.crltValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],zv.prototype,"crlId",void 0);bi([Ai({type:Ke.Any,context:0})],zv.prototype,"crltValue",void 0);var Yv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ka);Yv=bi([Si({type:Ne.Sequence})],Yv);var Zv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Oa);Zv=bi([Si({type:Ne.Sequence})],Zv);var $v=function(){function t(t){if(t===void 0){t={}}this.secretTypeId="";this.secretValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],$v.prototype,"secretTypeId",void 0);bi([Ai({type:Ke.Any,context:0})],$v.prototype,"secretValue",void 0);var Xv=function(){function t(t){if(t===void 0){t={}}this.mac=new ma;this.macSalt=new He;this.iterations=1;Object.assign(this,t)}return t}();bi([Ai({type:ma})],Xv.prototype,"mac",void 0);bi([Ai({type:He})],Xv.prototype,"macSalt",void 0);bi([Ai({type:Ke.Integer,defaultValue:1})],Xv.prototype,"iterations",void 0);var Jv=function(){function t(t){if(t===void 0){t={}}this.version=3;this.authSafe=new uv;this.macData=new Xv;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Jv.prototype,"version",void 0);bi([Ai({type:uv})],Jv.prototype,"authSafe",void 0);bi([Ai({type:Xv,optional:true})],Jv.prototype,"macData",void 0);var th;var eh=function(){function t(t){if(t===void 0){t={}}this.bagId="";this.bagValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],eh.prototype,"bagId",void 0);bi([Ai({type:Ke.Any,context:0})],eh.prototype,"bagValue",void 0);bi([Ai({type:Vv,repeated:"set",optional:true})],eh.prototype,"bagAttributes",void 0);var ih=th=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,th.prototype);return i}return e}(wi);ih=th=bi([Si({type:Ne.Sequence,itemType:eh})],ih);var rh,nh,ah;var oh="1.2.840.113549.1.9";var sh=t("F","".concat(oh,".2"));var uh=t("G","".concat(oh,".7"));var ch=t("B","".concat(oh,".14"));var fh=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}return t.call(this,e)||this}e.prototype.toString=function(){return this.ia5String||t.prototype.toString.call(this)};return e}(Bi);bi([Ai({type:Ke.IA5String})],fh.prototype,"ia5String",void 0);fh=bi([Si({type:Ne.Choice})],fh);var vh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(uv);vh=bi([Si({type:Ne.Sequence})],vh);var hh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Jv);hh=bi([Si({type:Ne.Sequence})],hh);var dh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Oa);dh=bi([Si({type:Ne.Sequence})],dh);var lh=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.IA5String})],lh.prototype,"value",void 0);lh=bi([Si({type:Ne.Choice})],lh);var ph=t("U",function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(fh));t("U",ph=bi([Si({type:Ne.Choice})],ph));var yh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);yh=bi([Si({type:Ne.Choice})],yh);var Sh=function(){function t(t){if(t===void 0){t=new Date}this.value=t}return t}();bi([Ai({type:Ke.GeneralizedTime})],Sh.prototype,"value",void 0);Sh=bi([Si({type:Ne.Choice})],Sh);var Ah=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);Ah=bi([Si({type:Ne.Choice})],Ah);var Ch=function(){function t(t){if(t===void 0){t="M"}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.PrintableString})],Ch.prototype,"value",void 0);Ch=bi([Si({type:Ne.Choice})],Ch);var mh=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.PrintableString})],mh.prototype,"value",void 0);mh=bi([Si({type:Ne.Choice})],mh);var gh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mh);gh=bi([Si({type:Ne.Choice})],gh);var wh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);wh=bi([Si({type:Ne.Choice})],wh);var _h=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.ObjectIdentifier})],_h.prototype,"value",void 0);_h=bi([Si({type:Ne.Choice})],_h);var bh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mn);bh=bi([Si({type:Ne.Choice})],bh);var Eh=function(){function t(t){if(t===void 0){t=0}this.value=t}t.prototype.toString=function(){return this.value.toString()};return t}();bi([Ai({type:Ke.Integer})],Eh.prototype,"value",void 0);Eh=bi([Si({type:Ne.Choice})],Eh);var Ph=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(tv);Ph=bi([Si({type:Ne.Sequence})],Ph);var Dh=t("t",function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi));t("t",Dh=bi([Si({type:Ne.Choice})],Dh));var Ih=t("s",rh=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,rh.prototype);return i}return e}(bn));t("s",Ih=rh=bi([Si({type:Ne.Sequence})],Ih));var Bh=nh=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,nh.prototype);return i}return e}(wi);Bh=nh=bi([Si({type:Ne.Set,itemType:Xf})],Bh);var xh=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.BmpString})],xh.prototype,"value",void 0);xh=bi([Si({type:Ne.Choice})],xh);var Th=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Th=bi([Si({type:Ne.Sequence})],Th);var Oh=ah=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ah.prototype);return i}return e}(wi);Oh=ah=bi([Si({type:Ne.Sequence,itemType:Th})],Oh);var kh=t("z","1.3.6.1.4.1.22112.2.1");var Mh=t("r",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:Vf})],Mh.prototype,"signer",void 0);bi([Ai({type:Dn,optional:true})],Mh.prototype,"cert",void 0);t("r",Mh=bi([Si({type:Ne.Sequence})],Mh));var Rh;var Nh=Rh=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Rh.prototype);return i}return e}(wi);Nh=Rh=bi([Si({type:Ne.Sequence,itemType:rn})],Nh);var Kh=function(){function t(t){if(t===void 0){t={}}this.version=0;this.subject=new Mi;this.subjectPKInfo=new Cn;this.attributes=new Nh;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Kh.prototype,"version",void 0);bi([Ai({type:Mi})],Kh.prototype,"subject",void 0);bi([Ai({type:Cn})],Kh.prototype,"subjectPKInfo",void 0);bi([Ai({type:Nh,implicit:true,context:0})],Kh.prototype,"attributes",void 0);var jh=function(){function t(t){if(t===void 0){t={}}this.certificationRequestInfo=new Kh;this.signatureAlgorithm=new An;this.signature=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("Y",jh);bi([Ai({type:Kh})],jh.prototype,"certificationRequestInfo",void 0);bi([Ai({type:An})],jh.prototype,"signatureAlgorithm",void 0);bi([Ai({type:Ke.BitString})],jh.prototype,"signature",void 0);var Hh=globalThis.crypto;function Uh(){return Hh}var Fh=function(t){__extends(e,t);function e(e,i){var r=t.call(this,e)||this;r.code=i;r.name=r.constructor.name;if(Error.captureStackTrace){Error.captureStackTrace(r,r.constructor)}return r}return e}(Error);var Lh=function(t){__extends(e,t);function e(e,i){var r=i?" Supported: ".concat(i.join(", ")):"";return t.call(this,"Unsupported algorithm: ".concat(e,".").concat(r),"UNSUPPORTED_ALGORITHM")||this}return e}(Fh);var Vh=function(t){__extends(e,t);function e(e,i){var r=i?" Expected: ".concat(i):"";return t.call(this,"Invalid format: ".concat(e,".").concat(r),"INVALID_FORMAT")||this}return e}(Fh);var Gh=function(t){__extends(e,t);function e(e,i){var r=i?" Supported: ".concat(i.join(", ")):"";return t.call(this,"Unsupported key type: ".concat(e,".").concat(r),"UNSUPPORTED_KEY_TYPE")||this}return e}(Fh);var Wh=function(t){__extends(e,t);function e(e){var i=e?"Invalid SSH private key format: ".concat(e):"Invalid SSH private key format";return t.call(this,i,"INVALID_PRIVATE_KEY_FORMAT")||this}return e}(Fh);var Qh=function(t){__extends(e,t);function e(e){var i=e?"Encrypted SSH private keys are not supported (cipher: ".concat(e,")"):"Encrypted SSH private keys are not supported";return t.call(this,i,"ENCRYPTED_KEY_NOT_SUPPORTED")||this}return e}(Fh);var qh=function(t){__extends(e,t);function e(e){var i=e?"Invalid key data: ".concat(e):"Invalid key data";return t.call(this,i,"INVALID_KEY_DATA")||this}return e}(Fh);var zh=function(t){__extends(e,t);function e(e,i){var r=e!==undefined&&i!==undefined?" Expected ".concat(e," bytes, got ").concat(i):"";return t.call(this,"Unexpected end of data".concat(r),"UNEXPECTED_EOF")||this}return e}(Fh);var Yh=new TextEncoder;var Zh=new TextDecoder;var $h=function(){function t(t){this.buffer=t;this.offset=0}t.prototype.readUint8=function(){if(this.offset>=this.buffer.length){throw new zh(1,0)}return this.buffer[this.offset++]};t.prototype.readUint32=function(){var t=this.readUint8()<<24|this.readUint8()<<16|this.readUint8()<<8|this.readUint8();return t>>>0};t.prototype.readUint64=function(){var t=this.readUint32();var e=this.readUint32();return BigInt(t)<<32n|BigInt(e)};t.prototype.readBytes=function(t){if(t<0){throw new Vh("Invalid length: ".concat(t))}if(this.offset+t>this.buffer.length){throw new zh(t,this.buffer.length-this.offset)}var e=this.buffer.subarray(this.offset,this.offset+t);this.offset+=t;return e};t.prototype.readString=function(){var t=this.readUint32();var e=this.readBytes(t);return Zh.decode(e)};t.prototype.peekString=function(t){if(this.offset+t>this.buffer.length){throw new zh(t,this.buffer.length-this.offset)}var e=this.buffer.subarray(this.offset,this.offset+t);return Zh.decode(e)};t.prototype.readMpInt=function(t){if(t===void 0){t=false}var e=this.readUint32();var i=this.readBytes(e);if(t&&i.length>1&&i[0]===0){return i.subarray(1)}return i};t.prototype.readMpIntSsh=function(){return this.readMpInt(true)};t.prototype.remaining=function(){return this.buffer.length-this.offset};t.prototype.getOffset=function(){return this.offset};t.prototype.seek=function(t){if(t<0||t>this.buffer.length){throw new Vh("Invalid offset: ".concat(t,". Buffer length: ").concat(this.buffer.length))}this.offset=t};return t}();var Xh=function(){function t(t){if(t===void 0){t=1024}this.buffer=new Uint8Array(t);this.offset=0}t.prototype.ensureCapacity=function(t){var e=this.offset+t;if(e>this.buffer.length){var i=Math.max(e,this.buffer.length*2);var r=new Uint8Array(i);r.set(this.buffer.subarray(0,this.offset));this.buffer=r}};t.prototype.reserve=function(t){if(t>this.buffer.length){var e=new Uint8Array(t);e.set(this.buffer.subarray(0,this.offset));this.buffer=e}};t.prototype.writeUint8=function(t){this.ensureCapacity(1);this.buffer[this.offset++]=t&255};t.prototype.writeUint32=function(t){this.ensureCapacity(4);this.buffer[this.offset++]=t>>>24&255;this.buffer[this.offset++]=t>>>16&255;this.buffer[this.offset++]=t>>>8&255;this.buffer[this.offset++]=t&255};t.prototype.writeUint64=function(t){this.ensureCapacity(8);var e=Number(t>>32n);var i=Number(t&0xffffffffn);this.writeUint32(e);this.writeUint32(i)};t.prototype.writeBytes=function(t){this.ensureCapacity(t.length);this.buffer.set(t,this.offset);this.offset+=t.length};t.prototype.writeString=function(t){var e=Yh.encode(t);this.writeUint32(e.length);this.writeBytes(e)};t.prototype.writeMpInt=function(t,e){if(e===void 0){e=false}if(e&&t.length>0&&(t[0]&128)!==0){var i=new Uint8Array(t.length+1);i[0]=0;i.set(t,1);this.writeUint32(i.length);this.writeBytes(i)}else{this.writeUint32(t.length);this.writeBytes(t)}};t.prototype.writeMpIntSsh=function(t){this.writeMpInt(t,true)};t.prototype.toUint8Array=function(){return this.buffer.subarray(0,this.offset)};t.prototype.getOffset=function(){return this.offset};t.prototype.seek=function(t){if(t<0||t>this.buffer.length){throw new Vh("Invalid offset")}this.offset=t};return t}();var Jh=function(){function t(t){if(t===void 0){t="SHA-256"}this.hash="SHA-256";this.hash=t}t.prototype.importPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){e=t.blob,i=t.crypto;r=new $h(e);r.readString();n=r.readMpInt(true);a=r.readMpInt(true);o={kty:"RSA",n:u.Convert.ToBase64Url(a),e:u.Convert.ToBase64Url(n)};return[2,i.subtle.importKey("jwk",o,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])]}))}))};t.prototype.exportPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){switch(s.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("jwk",e)];case 1:r=s.sent();if(!r.n||!r.e){throw new qh("RSA JWK missing required parameters (n, e)")}n=u.BufferSourceConverter.toUint8Array(u.Convert.FromBase64Url(r.n));a=u.BufferSourceConverter.toUint8Array(u.Convert.FromBase64Url(r.e));o=new Xh;o.writeString("ssh-rsa");o.writeMpInt(a,true);o.writeMpInt(n,true);return[2,o.toUint8Array()]}}))}))};t.prototype.importPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.spki,i=t.crypto;return[2,i.subtle.importKey("spki",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])]}))}))};t.prototype.exportPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("spki",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.pkcs8,i=t.crypto;return[2,i.subtle.importKey("pkcs8",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])]}))}))};t.prototype.exportPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.privateKey,i=t.crypto;return[4,i.subtle.exportKey("pkcs8",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d,l,p,y,S,A,C,m,g,w,_,b,E,P,D,I,B;return __generator(this,(function(x){e=t.sshKey,i=t.crypto;r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=u.Convert.FromBase64(r);a=new $h(u.BufferSourceConverter.toUint8Array(n));o=a.readBytes(15);if(u.Convert.ToHex(o)!=="6f70656e7373682d6b65792d763100"){throw new Wh("invalid magic string")}s=a.readString();a.readString();a.readString();if(s!=="none"){throw new Qh(s)}c=a.readUint32();if(c!==1){throw new Wh("multiple keys not supported")}f=a.readUint32();a.readBytes(f);v=a.readUint32();h=a.readBytes(v);d=new $h(h);l=d.readUint32();p=d.readUint32();if(l!==p){throw new Wh("invalid checkints")}d.readString();y=d.readMpInt(true);S=d.readMpInt(true);A=d.readMpInt(true);C=d.readMpInt(true);m=d.readMpInt(true);g=d.readMpInt(true);d.readString();w=BigInt("0x"+u.Convert.ToHex(A));_=BigInt("0x"+u.Convert.ToHex(m));b=BigInt("0x"+u.Convert.ToHex(g));E=w%(_-1n);P=w%(b-1n);D=u.Convert.FromHex(E.toString(16).padStart(m.length*2,"0"));I=u.Convert.FromHex(P.toString(16).padStart(g.length*2,"0"));B={kty:"RSA",n:u.Convert.ToBase64Url(y),e:u.Convert.ToBase64Url(S),d:u.Convert.ToBase64Url(A),p:u.Convert.ToBase64Url(m),q:u.Convert.ToBase64Url(g),dp:u.Convert.ToBase64Url(D),dq:u.Convert.ToBase64Url(I),qi:u.Convert.ToBase64Url(C)};return[2,i.subtle.importKey("jwk",B,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])]}))}))};t.prototype.exportPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d;return __generator(this,(function(l){switch(l.label){case 0:e=t.privateKey,i=t.crypto,r=t.jwk;a=r;if(a)return[3,2];return[4,i.subtle.exportKey("jwk",e)];case 1:a=l.sent();l.label=2;case 2:n=a;if(!n.n||!n.e||!n.d||!n.p||!n.q){throw new qh("RSA JWK missing required parameters")}o=new Uint8Array(u.Convert.FromBase64Url(n.n));s=new Uint8Array(u.Convert.FromBase64Url(n.e));c=new Uint8Array(u.Convert.FromBase64Url(n.d));f=new Uint8Array(u.Convert.FromBase64Url(n.p));v=new Uint8Array(u.Convert.FromBase64Url(n.q));h=n.qi?new Uint8Array(u.Convert.FromBase64Url(n.qi)):new Uint8Array;d=new Xh;d.writeString("ssh-rsa");d.writeMpInt(o,true);d.writeMpInt(s,true);d.writeMpInt(c,true);d.writeMpInt(h,true);d.writeMpInt(f,true);d.writeMpInt(v,true);return[2,d.toUint8Array()]}}))}))};t.prototype.sign=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(c){switch(c.label){case 0:e=t.privateKey,i=t.data,r=t.crypto,n=t.hash;if(n&&n!==this.hash){throw new qh("Hash ".concat(n," not supported for this RSA algorithm"))}if(!e.extractable){throw new qh("Private key is not extractable")}return[4,this.exportPrivatePkcs8({privateKey:e,crypto:r})];case 1:a=c.sent();return[4,this.importPrivatePkcs8({pkcs8:new Uint8Array(a),crypto:r})];case 2:o=c.sent();return[4,r.subtle.sign("RSASSA-PKCS1-v1_5",o,i)];case 3:s=c.sent();return[2,u.BufferSourceConverter.toUint8Array(s)]}}))}))};t.prototype.verify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(u){switch(u.label){case 0:e=t.publicKey,i=t.signature,r=t.data,n=t.crypto,a=t.hash;if(a&&a!==this.hash){return[2,false]}if(!e.extractable){throw new qh("Public key is not extractable")}return[4,this.exportPublicSpki({publicKey:e,crypto:n})];case 1:o=u.sent();return[4,this.importPublicSpki({spki:new Uint8Array(o),crypto:n})];case 2:s=u.sent();return[2,n.subtle.verify("RSASSA-PKCS1-v1_5",s,i,r)]}}))}))};t.prototype.encodeSignature=function(t){var e=t.signature,i=t.algo;var r=new Xh;r.writeString(i);r.writeUint32(e.byteLength);r.writeBytes(e);return r.toUint8Array()};t.prototype.decodeSignature=function(t){var e=t.signature;var i=new $h(e);var r=i.readString();var n=i.readUint32();var a=i.readBytes(n);return{signature:a,algo:r}};t.prototype.supportsCryptoKey=function(t){return t.algorithm.name==="RSASSA-PKCS1-v1_5"};t.prototype.parsePublicKey=function(t){var e=t.readBytes(t.readUint32());var i=t.readBytes(t.readUint32());var r=new Xh;r.writeString("ssh-rsa");r.writeMpInt(e);r.writeMpInt(i);return{type:"ssh-rsa",keyData:r.toUint8Array()}};t.prototype.writePublicKey=function(t,e){var i=new $h(e.keyData);i.readString();var r=i.readMpInt();var n=i.readMpInt();t.writeUint32(r.length);t.writeBytes(r);t.writeUint32(n.length);t.writeBytes(n)};t.prototype.getCertificateType=function(){return"ssh-rsa-cert-v01@openssh.com"};t.prototype.getSignatureAlgo=function(){return this.hash==="SHA-256"?"rsa-sha2-256":"rsa-sha2-512"};return t}();var td=function(){function t(t,e,i){this.curveName=t;this.sshType=e;this.namedCurve=i}t.prototype.getHashAlgorithm=function(){switch(this.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:return"SHA-256"}};t.prototype.getExpectedLength=function(){switch(this.namedCurve){case"P-256":return 32;case"P-384":return 48;case"P-521":return 66;default:return 32}};t.prototype.getSignatureCoordLength=function(){return this.getExpectedLength()};t.prototype.importPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(c){e=t.blob,i=t.crypto;r=new $h(e);r.readString();n=r.readString();if(n!==this.curveName){throw new qh("ECDSA curve name ".concat(n,", expected ").concat(this.curveName))}a=r.readMpInt();o=Math.floor((a.length-1)/2);s={kty:"EC",crv:this.namedCurve,x:u.Convert.ToBase64Url(a.slice(1,1+o)),y:u.Convert.ToBase64Url(a.slice(1+o))};return[2,i.subtle.importKey("jwk",s,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])]}))}))};t.prototype.exportPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(c){switch(c.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("jwk",e)];case 1:r=c.sent();if(!r.x||!r.y){throw new qh("ECDSA JWK missing x or y parameters")}n=new Uint8Array(u.Convert.FromBase64Url(r.x));a=new Uint8Array(u.Convert.FromBase64Url(r.y));o=new Uint8Array(1+n.length+a.length);o[0]=4;o.set(n,1);o.set(a,1+n.length);s=new Xh;s.writeString(this.sshType);s.writeString(this.curveName);s.writeMpInt(o);return[2,s.toUint8Array()]}}))}))};t.prototype.importPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.spki,i=t.crypto;return[2,i.subtle.importKey("spki",e,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])]}))}))};t.prototype.exportPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("spki",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.pkcs8,i=t.crypto;return[2,i.subtle.importKey("pkcs8",e,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])]}))}))};t.prototype.exportPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.privateKey,i=t.crypto;return[4,i.subtle.exportKey("pkcs8",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.exportPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v;return __generator(this,(function(h){switch(h.label){case 0:e=t.privateKey,i=t.crypto,r=t.jwk;a=r;if(a)return[3,2];return[4,i.subtle.exportKey("jwk",e)];case 1:a=h.sent();h.label=2;case 2:n=a;if(!n.d||!n.x||!n.y){throw new qh("ECDSA private key JWK missing required parameters")}o=new Uint8Array(u.Convert.FromBase64Url(n.x));s=new Uint8Array(u.Convert.FromBase64Url(n.y));c=new Uint8Array(u.Convert.FromBase64Url(n.d));f=new Uint8Array(1+o.length+s.length);f[0]=4;f.set(o,1);f.set(s,1+o.length);v=new Xh;v.writeString(this.sshType);v.writeString(this.curveName);v.writeMpInt(f);v.writeMpInt(c);return[2,v.toUint8Array()]}}))}))};t.prototype.importPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d,l,p,y,S,A,C,m,g;return __generator(this,(function(w){e=t.sshKey,i=t.crypto;r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=u.Convert.FromBase64(r);a=new $h(u.BufferSourceConverter.toUint8Array(n));o=a.readBytes(15);if(u.Convert.ToHex(o)!=="6f70656e7373682d6b65792d763100"){throw new Wh("invalid magic string")}s=a.readString();a.readString();a.readString();if(s!=="none"){throw new Qh(s)}c=a.readUint32();if(c!==1){throw new Wh("multiple keys not supported")}f=a.readUint32();a.readBytes(f);v=a.readUint32();h=a.readBytes(v);d=new $h(h);l=d.readUint32();p=d.readUint32();if(l!==p){throw new Wh("invalid checkints")}d.readString();d.readString();y=d.readMpInt();S=d.readMpInt();d.readString();if(y[0]!==4){throw new qh("invalid ECDSA public key point format")}A=Math.floor((y.length-1)/2);C=y.slice(1,1+A);m=y.slice(1+A);g={kty:"EC",crv:this.namedCurve,x:u.Convert.ToBase64Url(C),y:u.Convert.ToBase64Url(m),d:u.Convert.ToBase64Url(S)};return[2,i.subtle.importKey("jwk",g,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])]}))}))};t.prototype.sign=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){switch(s.label){case 0:e=t.privateKey,i=t.data,r=t.crypto,n=t.hash;a=this.getHashAlgorithm();if(n&&n!==a){throw new qh("ECDSA ".concat(this.namedCurve," requires ").concat(a,", got ").concat(n))}return[4,r.subtle.sign({name:"ECDSA",hash:a},e,i)];case 1:o=s.sent();return[2,u.BufferSourceConverter.toUint8Array(o)]}}))}))};t.prototype.verify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){e=t.publicKey,i=t.signature,r=t.data,n=t.crypto,a=t.hash;o=this.getHashAlgorithm();if(a&&a!==o){throw new qh("ECDSA ".concat(this.namedCurve," requires ").concat(o,", got ").concat(a))}return[2,n.subtle.verify({name:"ECDSA",hash:o},e,i,r)]}))}))};t.prototype.encodeSignature=function(t){var e=t.signature,i=t.algo;if(i.startsWith("ecdsa-sha2-")){var r=this.getSignatureCoordLength();var n=e.subarray(0,r);var a=e.subarray(r);var o=new Xh;o.writeString(i);var s=new Xh;s.writeMpInt(n,true);s.writeMpInt(a,true);var u=s.toUint8Array();o.writeUint32(u.length);o.writeBytes(u);return o.toUint8Array()}var c=new Xh;c.writeString(i);c.writeUint32(e.byteLength);c.writeBytes(e);return c.toUint8Array()};t.prototype.decodeSignature=function(t){var e=t.signature;var i=new $h(e);var r=i.readString();var n=i.readUint32();var a=i.readBytes(n);if(r.startsWith("ecdsa-sha2-")){var o=new $h(a);var s=o.readMpInt();var u=o.readMpInt();if(s[0]===0&&s.length>1&&(s[1]&128)===0){s=s.slice(1)}if(u[0]===0&&u.length>1&&(u[1]&128)===0){u=u.slice(1)}var c=this.getExpectedLength();var f=new Uint8Array(c);var v=new Uint8Array(c);if(s.length<=c){f.set(s,c-s.length)}else{f.set(s.slice(s.length-c),0)}if(u.length<=c){v.set(u,c-u.length)}else{v.set(u.slice(u.length-c),0)}var h=new Uint8Array(__spreadArray(__spreadArray([],f,true),v,true));return{signature:h,algo:r}}return{signature:a,algo:r}};t.prototype.supportsCryptoKey=function(t){return t.algorithm.name==="ECDSA"&&t.algorithm.namedCurve===this.namedCurve};t.prototype.parsePublicKey=function(t){var e=t.readString();if(e!==this.curveName){throw new qh("ECDSA certificate curve name ".concat(e,", expected ").concat(this.curveName))}var i=t.readBytes(t.readUint32());var r=new Xh;r.writeString(this.sshType);r.writeString(e);r.writeMpInt(i);return{type:this.sshType,keyData:r.toUint8Array()}};t.prototype.writePublicKey=function(t,e){var i=new $h(e.keyData);i.readString();var r=i.readString();var n=i.readMpInt();t.writeString(r);t.writeUint32(n.length);t.writeBytes(n)};t.prototype.getCertificateType=function(){return"".concat(this.sshType,"-cert-v01@openssh.com")};t.prototype.getSignatureAlgo=function(){return this.sshType};return t}();var ed=new td("nistp256","ecdsa-sha2-nistp256","P-256");var id=new td("nistp384","ecdsa-sha2-nistp384","P-384");var rd=new td("nistp521","ecdsa-sha2-nistp521","P-521");var nd=function(){function t(){}t.prototype.importPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a;return __generator(this,(function(o){e=t.blob,i=t.crypto;r=new $h(e);r.readString();n=r.readUint32();if(n!==32){throw new qh("Ed25519 key length ".concat(n,", expected 32"))}a=r.readBytes(n);return[2,i.subtle.importKey("raw",a,"Ed25519",true,["verify"])]}))}))};t.prototype.exportPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("jwk",e)];case 1:r=o.sent();if(!r.x){throw new qh("Ed25519 JWK missing x parameter")}n=new Uint8Array(u.Convert.FromBase64Url(r.x));a=new Xh;a.writeString("ssh-ed25519");a.writeUint32(n.length);a.writeBytes(n);return[2,a.toUint8Array()]}}))}))};t.prototype.importPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.spki,i=t.crypto;return[2,i.subtle.importKey("spki",e,"Ed25519",true,["verify"])]}))}))};t.prototype.exportPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("spki",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.pkcs8,i=t.crypto;return[2,i.subtle.importKey("pkcs8",e,"Ed25519",true,["sign"])]}))}))};t.prototype.exportPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.privateKey,i=t.crypto;return[4,i.subtle.exportKey("pkcs8",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.exportPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f;return __generator(this,(function(v){switch(v.label){case 0:e=t.privateKey,i=t.crypto,r=t.jwk;a=r;if(a)return[3,2];return[4,i.subtle.exportKey("jwk",e)];case 1:a=v.sent();v.label=2;case 2:n=a;if(!n.d||!n.x){throw new qh("Ed25519 private key JWK missing required parameters")}o=new Uint8Array(u.Convert.FromBase64Url(n.d));s=new Uint8Array(u.Convert.FromBase64Url(n.x));c=new Xh;c.writeString("ssh-ed25519");c.writeUint32(s.length);c.writeBytes(s);f=new Uint8Array(64);f.set(o,0);f.set(s,32);c.writeUint32(f.length);c.writeBytes(f);return[2,c.toUint8Array()]}}))}))};t.prototype.importPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d,l,p,y,S,A,C,m,g;return __generator(this,(function(w){e=t.sshKey,i=t.crypto;r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=u.Convert.FromBase64(r);a=new $h(u.BufferSourceConverter.toUint8Array(n));o=a.readBytes(15);if(u.Convert.ToHex(o)!=="6f70656e7373682d6b65792d763100"){throw new Wh("invalid magic string")}s=a.readString();a.readString();a.readString();if(s!=="none"){throw new Qh(s)}c=a.readUint32();if(c!==1){throw new Wh("multiple keys not supported")}f=a.readUint32();a.readBytes(f);v=a.readUint32();h=a.readBytes(v);d=new $h(h);l=d.readUint32();p=d.readUint32();if(l!==p){throw new Wh("invalid checkints")}d.readString();y=d.readUint32();S=d.readBytes(y);A=d.readUint32();C=d.readBytes(A);d.readString();m=C.slice(0,32);g={kty:"OKP",crv:"Ed25519",d:u.Convert.ToBase64Url(m),x:u.Convert.ToBase64Url(S)};return[2,i.subtle.importKey("jwk",g,"Ed25519",true,["sign"])]}))}))};t.prototype.sign=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n;return __generator(this,(function(a){switch(a.label){case 0:e=t.privateKey,i=t.data,r=t.crypto;return[4,r.subtle.sign("Ed25519",e,i)];case 1:n=a.sent();return[2,u.BufferSourceConverter.toUint8Array(n)]}}))}))};t.prototype.verify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n;return __generator(this,(function(a){e=t.publicKey,i=t.signature,r=t.data,n=t.crypto;return[2,n.subtle.verify("Ed25519",e,i,r)]}))}))};t.prototype.encodeSignature=function(t){var e=t.signature,i=t.algo;var r=new Uint8Array(e);var n=new Xh;n.writeString(i);n.writeUint32(r.length);n.writeBytes(r);return n.toUint8Array()};t.prototype.decodeSignature=function(t){var e=t.signature;var i=new $h(e);var r=i.readString();var n=i.readUint32();var a=i.readBytes(n);return{signature:a,algo:r}};t.prototype.supportsCryptoKey=function(t){return t.algorithm.name==="Ed25519"};t.prototype.parsePublicKey=function(t){var e=t.readBytes(t.readUint32());var i=new Xh;i.writeString("ssh-ed25519");i.writeUint32(e.length);i.writeBytes(e);return{type:"ssh-ed25519",keyData:i.toUint8Array()}};t.prototype.writePublicKey=function(t,e){var i=new $h(e.keyData);i.readString();var r=i.readUint32();var n=i.readBytes(r);t.writeUint32(n.length);t.writeBytes(n)};t.prototype.getCertificateType=function(){return"ssh-ed25519-cert-v01@openssh.com"};t.prototype.getSignatureAlgo=function(){return"ssh-ed25519"};return t}();var ad=new Map;var od=function(){function t(){}t.get=function(t){var e=ad.get(t);if(!e){throw new Gh(t,Array.from(ad.keys()))}return e};t.register=function(t,e){ad.set(t,e)};t.getSshTypeFromCryptoKey=function(t){for(var e=0,i=ad.entries();e<i.length;e++){var r=i[e],n=r[0],a=r[1];if(a.supportsCryptoKey(t)){return n}}throw new Gh(t.algorithm.name,Array.from(ad.keys()))};t.certTypeToKeyType=function(t){var e={"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"};return e[t]};t.getSupportedCertTypes=function(){return Object.keys({"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"})};return t}();od.register("ssh-ed25519",new nd);od.register("ssh-rsa",new Jh("SHA-256"));od.register("rsa-sha2-256",new Jh("SHA-256"));od.register("rsa-sha2-512",new Jh("SHA-512"));od.register("ecdsa-sha2-nistp256",ed);od.register("ecdsa-sha2-nistp384",id);od.register("ecdsa-sha2-nistp521",rd);function sd(t){var e=typeof t==="string"?t.trim().split(/\s+/):null;if(!e||e.length<2){throw new Vh("Invalid SSH public key format")}var i=e[0];var r=new Uint8Array(u.Convert.FromBase64(e[1]));var n=e.length>2?e.slice(2).join(" "):undefined;var a=new $h(r);var o=a.readString();if(o!==i){throw new Vh("Key type mismatch")}return{type:i,keyData:r,comment:n}}function ud(t){var e=u.Convert.ToBase64(t.keyData);var i=[t.type,e];if(t.comment){i.push(t.comment)}return i.join(" ")}function cd(t){if(typeof t==="string"){var e=t.trim().split(/\s+/);if(e.length<2){throw new Vh("SSH certificate string","type base64 [comment]")}var i=e[0];var r=new Uint8Array(u.Convert.FromBase64(e[1]));var n=e.length>2?e.slice(2).join(" "):undefined;var a=new $h(r);var o=a.readString();if(o!==i){throw new Vh("certificate blob type ".concat(o),"expected ".concat(i))}return{type:i,keyData:r,comment:n}}else{var a=new $h(t);var s=a.readString();var c=t.slice(a.getOffset());return{type:s,keyData:c}}}function fd(t){var e=new $h(t);var i=e.readString();var r=e.readBytes(e.readUint32());var n=od.certTypeToKeyType(i);if(!n){throw new Lh(i,od.getSupportedCertTypes())}var a=od.get(n);var o=a.parsePublicKey(e);var s=n;var u=e.readUint64();var c=e.readUint32();var f=c===1?"user":"host";var v=e.readString();var h=e.readUint32();var d=e.readBytes(h);var l=[];if(d.length>0){var p=new $h(d);while(p.getOffset()<d.length){try{var y=p.readString();l.push(y)}catch(t){break}}}var S=e.readUint64();var A=e.readUint64();var C={};var m=e.readUint32();var g=e.readBytes(m);if(g.length>0){var w=new $h(g);while(w.getOffset()<g.length){try{var _=w.readString();var b=w.readBytes(w.readUint32());var E=b.length===0?"":Zh.decode(b);C[_]=E}catch(t){break}}}var P={};var D=e.readUint32();var I=e.readBytes(D);if(I.length>0){var B=new $h(I);while(B.getOffset()<I.length){try{var x=B.readString();var b=B.readBytes(B.readUint32());var T=b.length===0?"":Zh.decode(b);P[x]=T}catch(t){break}}}var O=e.readUint32();var k=e.readBytes(O);var M=e.readUint32();var R=e.readBytes(M);var N=new $h(R);var K=N.readString();var j={type:K,keyData:R};var H=e.readUint32();var U=e.readBytes(H);return{nonce:r,keyType:s,publicKey:o,serial:u,type:f,keyId:v,validPrincipals:l,validAfter:S,validBefore:A,criticalOptions:C,extensions:P,reserved:k,signatureKey:j,signature:U}}function vd(t){var e=u.Convert.ToBase64(t.keyData);var i=[t.type,e];if(t.comment){i.push(t.comment)}return i.join(" ")}function hd(t){var e=new $h(t);if(t.length>=6&&(new TextDecoder).decode(t.subarray(0,6))==="SSHSIG"){return dd(e)}else{return ld(e)}}function dd(t){var e=t.readBytes(6);var i=(new TextDecoder).decode(e);if(i!=="SSHSIG"){throw new Vh(i,"SSHSIG")}var r=t.readUint32();var n=t.readUint32();var a=t.readBytes(n);var o=t.readString();var s=t.readString();var u=t.readString();var c=t.readUint32();var f=t.readBytes(c);var v=new $h(f);var h=v.readString();var d=v.readUint32();var l=v.readBytes(d);return{format:"ssh-signature",algorithm:h,signature:l,version:r,publicKey:a,namespace:o,reserved:s,hashAlgorithm:u}}function ld(t){var e=t.readString();var i=t.readUint32();var r=t.readBytes(i);return{format:"legacy",algorithm:e,signature:r}}function pd(t){if(t.format==="ssh-signature"){return yd(t)}else{return Sd(t)}}function yd(t){var e=new Xh;e.writeBytes((new TextEncoder).encode("SSHSIG"));e.writeUint32(t.version||1);if(t.publicKey){e.writeUint32(t.publicKey.length);e.writeBytes(t.publicKey)}else{e.writeUint32(0)}e.writeString(t.namespace||"file");e.writeString(t.reserved||"");e.writeString(t.hashAlgorithm||"sha512");var i=new Xh;i.writeString(t.algorithm);i.writeUint32(t.signature.length);i.writeBytes(t.signature);var r=i.toUint8Array();e.writeUint32(r.length);e.writeBytes(r);return e.toUint8Array()}function Sd(t){var e=new Xh;e.writeString(t.algorithm);e.writeUint32(t.signature.length);e.writeBytes(t.signature);return e.toUint8Array()}var Ad=function(){function t(){}return t}();var Cd=function(t){__extends(e,t);function e(i){var r=t.call(this)||this;r.type=e.TYPE;r.blob=i;return r}e.prototype.getCryptoKey=function(){return __awaiter(this,arguments,void 0,(function(t){var e,i;if(t===void 0){t=Uh()}return __generator(this,(function(r){switch(r.label){case 0:if(!!this.cachedCryptoKey)return[3,2];e=od.get(this.blob.type);i=this;return[4,e.importPublicSsh({blob:this.blob.keyData,crypto:t})];case 1:i.cachedCryptoKey=r.sent();r.label=2;case 2:return[2,this.cachedCryptoKey]}}))}))};e.fromSSH=function(t){return __awaiter(this,arguments,void 0,(function(t,i){var r,n;if(i===void 0){i=Uh()}return __generator(this,(function(a){switch(a.label){case 0:r=sd(t);n=od.get(r.type);return[4,n.importPublicSsh({blob:r.keyData,crypto:i})];case 1:a.sent();return[2,new e(r)]}}))}))};e.fromSPKI=function(t,i){return __awaiter(this,arguments,void 0,(function(t,i,r){var n,a,o,s;if(r===void 0){r=Uh()}return __generator(this,(function(u){switch(u.label){case 0:n=od.get(i);return[4,n.importPublicSpki({spki:t,crypto:r})];case 1:a=u.sent();return[4,n.exportPublicSsh({publicKey:a,crypto:r})];case 2:o=u.sent();s={type:i,keyData:o};return[2,new e(s)]}}))}))};e.fromWebCrypto=function(t,i){return __awaiter(this,arguments,void 0,(function(t,i,r){var n,a,o,s;if(r===void 0){r=Uh()}return __generator(this,(function(u){switch(u.label){case 0:n=i||od.getSshTypeFromCryptoKey(t);a=od.get(n);return[4,a.exportPublicSsh({publicKey:t,crypto:r})];case 1:o=u.sent();s={type:n,keyData:o};return[2,new e(s)]}}))}))};e.prototype.export=function(){return __awaiter(this,arguments,void 0,(function(t,e){var i,r,n;if(t===void 0){t="ssh"}if(e===void 0){e=Uh()}return __generator(this,(function(a){switch(a.label){case 0:if(!(t==="ssh"))return[3,1];return[2,ud(this.blob)];case 1:if(!(t==="spki"))return[3,4];return[4,this.getCryptoKey(e)];case 2:i=a.sent();r=od.get(this.blob.type);return[4,r.exportPublicSpki({publicKey:i,crypto:e})];case 3:n=a.sent();return[2,new Uint8Array(n)];case 4:throw new Gh("Unsupported export format: ".concat(t))}}))}))};e.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.export("ssh")];case 1:t=e.sent();return[2,t]}}))}))};e.prototype.toSPKI=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.export("spki")];case 1:t=e.sent();return[2,t]}}))}))};e.prototype.toWebCrypto=function(){return __awaiter(this,arguments,void 0,(function(t){if(t===void 0){t=Uh()}return __generator(this,(function(e){return[2,this.getCryptoKey(t)]}))}))};e.prototype.verify=function(t,e,i){return __awaiter(this,arguments,void 0,(function(t,e,i,r){var n,a;if(r===void 0){r=Uh()}return __generator(this,(function(o){switch(o.label){case 0:n=od.get(t);return[4,this.toWebCrypto(r)];case 1:a=o.sent();return[2,n.verify({publicKey:a,signature:e,data:i,crypto:r})]}}))}))};Object.defineProperty(e.prototype,"keyType",{get:function(){return this.blob.type},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"comment",{get:function(){return this.blob.comment},enumerable:false,configurable:true});e.prototype.getBlob=function(){return __assign({},this.blob)};e.prototype.thumbprint=function(){return __awaiter(this,arguments,void 0,(function(t,e){var i,r,n;if(t===void 0){t="sha256"}if(e===void 0){e=Uh()}return __generator(this,(function(a){switch(a.label){case 0:i=t==="sha256"?"SHA-256":"SHA-512";r=this.blob.keyData;return[4,e.subtle.digest(i,r)];case 1:n=a.sent();return[2,new Uint8Array(n)]}}))}))};e.TYPE="public-key";return e}(Ad);var md=function(t){__extends(e,t);function e(i){var r=t.call(this)||this;r.type=e.TYPE;r.blob=i;r.format=i.format;r.algorithm=i.algorithm;r.signature=i.signature;r.version=i.version;r.namespace=i.namespace;r.reserved=i.reserved;r.hashAlgorithm=i.hashAlgorithm;if(i.publicKey){var n=new $h(i.publicKey);var a=n.readString();r.publicKey=new Cd({type:a,keyData:i.publicKey})}return r}e.parse=function(t){var i=hd(t);return new e(i)};e.fromBlob=function(t){return new e(t)};e.fromBase64=function(t){var i=new Uint8Array(u.Convert.FromBase64(t));return e.parse(i)};e.fromText=function(t){var i=t.replace(/-----BEGIN SSH SIGNATURE-----/,"").replace(/-----END SSH SIGNATURE-----/,"").replace(/[\r\n\s]/g,"");return e.fromBase64(i)};e.prototype.serialize=function(){return pd(this.blob)};e.prototype.toBase64=function(){return u.Convert.ToBase64(this.serialize())};e.prototype.toText=function(){var t=this.toBase64();var e=[];for(var i=0;i<t.length;i+=70){e.push(t.substring(i,i+70))}return __spreadArray(__spreadArray(["-----BEGIN SSH SIGNATURE-----"],e,true),["-----END SSH SIGNATURE-----"],false).join("\n")};e.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.toText()]}))}))};e.prototype.verify=function(t,e){return __awaiter(this,void 0,void 0,(function(){var i,r,n,a,o,s,u,c,f,v,h,d,l,p,y,S;return __generator(this,(function(A){switch(A.label){case 0:i=od.get(this.algorithm);return[4,e["getCryptoKey"]()];case 1:r=A.sent();n=Uh();a=t;if(!(this.format==="ssh-signature"))return[3,3];o=this.hashAlgorithm||"sha512";s=this.namespace||"file";u=this.reserved||"";c=o==="sha256"?"SHA-256":"SHA-512";return[4,n.subtle.digest(c,t)];case 2:f=A.sent();v=new Uint8Array(f);h=new Xh;h.writeBytes((new TextEncoder).encode("SSHSIG"));h.writeString(s);h.writeString(u);h.writeString(o);h.writeUint32(v.length);h.writeBytes(v);a=h.toUint8Array();A.label=3;case 3:if(this.algorithm==="rsa-sha2-256"){d="SHA-256"}else if(this.algorithm==="rsa-sha2-512"){d="SHA-512"}if(this.format==="legacy"||this.format==="ssh-signature"){p=new Xh;p.writeString(this.algorithm);p.writeUint32(this.signature.length);p.writeBytes(this.signature);y=p.toUint8Array();S=i.decodeSignature({signature:y});l=S.signature}else{l=this.signature}return[2,i.verify({publicKey:r,signature:l,data:a,crypto:n,hash:d})]}}))}))};e.fromLegacy=function(t,i){var r=od.get(t);var n=r.encodeSignature({signature:i,algo:t});var a=new $h(n);a.readString();var o=a.readUint32();var s=a.readBytes(o);return new e({format:"legacy",algorithm:t,signature:s})};e.fromSshSignature=function(t,i,r){if(r===void 0){r={}}var n={format:"ssh-signature",algorithm:t,signature:i,version:r.version||1,publicKey:r.publicKey?r.publicKey.getBlob().keyData:undefined,namespace:r.namespace||"file",reserved:r.reserved||"",hashAlgorithm:r.hashAlgorithm||"sha512"};return new e(n)};e.sign=function(t,i,r){return __awaiter(this,arguments,void 0,(function(t,i,r,n){var a,o,s,u,c,f,v,h,d,l,p,y,S,A,C,m,c,g,w,_,b;if(n===void 0){n={}}return __generator(this,(function(E){switch(E.label){case 0:a=n.format,o=a===void 0?"legacy":a,s=n.namespace,u=s===void 0?"file":s;if(!(o==="legacy"))return[3,2];return[4,i.sign(t,r)];case 1:c=E.sent();f=t||i.keyType;return[2,e.fromLegacy(f,c)];case 2:v=t;h=od.get(v);d=t==="rsa-sha2-256"?"sha256":"sha512";return[4,i.getPublicKey()];case 3:l=E.sent();p=Uh();y=d==="sha256"?"SHA-256":"SHA-512";return[4,p.subtle.digest(y,r)];case 4:S=E.sent();A=new Uint8Array(S);C=new Xh;C.writeBytes((new TextEncoder).encode("SSHSIG"));C.writeString(u);C.writeString("");C.writeString(d);C.writeUint32(A.length);C.writeBytes(A);m=C.toUint8Array();return[4,i.sign(v,m)];case 5:c=E.sent();g=h.encodeSignature({signature:c,algo:v});w=new $h(g);w.readString();_=w.readUint32();b=w.readBytes(_);return[2,e.fromSshSignature(v,b,{namespace:u,hashAlgorithm:d,publicKey:l})]}}))}))};e.TYPE="signature";return e}(Ad);var gd=(i=function(t){__extends(e,t);function e(e){var r=t.call(this)||this;r.type=i.TYPE;r._blob=e;r.data=fd(e.keyData);r._validAfter=r.data.validAfter;r._validBefore=r.data.validBefore;r.keyId=r.data.keyId;r.principals=r.data.validPrincipals;r.certType=r.data.type;r.serial=r.data.serial;r.validAfter=new Date(Number(r.data.validAfter)*1e3);r.validBefore=new Date(Number(r.data.validBefore)*1e3);r.publicKey=new Cd(r.data.publicKey);r.signatureKey=new Cd(r.data.signatureKey);r.criticalOptions=__assign({},r.data.criticalOptions);r.extensions=__assign({},r.data.extensions);return r}e.fromSSH=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){e=cd(t);return[2,new i(e)]}))}))};e.fromBlob=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,new i(t)]}))}))};e.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,vd(this._blob)]}))}))};e.prototype.toBlob=function(){return __assign({},this._blob)};Object.defineProperty(e.prototype,"blob",{get:function(){return this.toBlob()},enumerable:false,configurable:true});e.prototype.validate=function(t){if(t===void 0){t=new Date}var e=BigInt(Math.floor(t.getTime()/1e3));var i=this._validAfter;var r=this._validBefore;var n=0xffffffffffffffffn;var a=r===n?e:r;return e>=i&&e<=a};e.prototype.verify=function(t){return __awaiter(this,arguments,void 0,(function(t,e){var i,r,n,a,o;if(e===void 0){e=Uh()}return __generator(this,(function(s){switch(s.label){case 0:i=t||this.signatureKey;r=this.getSignedData();n=md.parse(this.data.signature);a=od.get(n.algorithm);return[4,i.toWebCrypto(e)];case 1:o=s.sent();return[2,a.verify({publicKey:o,signature:n.signature,data:r,crypto:e})]}}))}))};e.prototype.getSignedData=function(){var t=new $h(this._blob.keyData);t.readString();t.readBytes(t.readUint32());if(this.data.keyType==="ssh-ed25519"){t.readBytes(t.readUint32())}else if(this.data.keyType==="ssh-rsa"){t.readBytes(t.readUint32());t.readBytes(t.readUint32())}else if(this.data.keyType.startsWith("ecdsa-sha2-")){t.readString();t.readBytes(t.readUint32())}t.readUint64();t.readUint32();t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readUint64();t.readUint64();t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readBytes(t.readUint32());var e=t.getOffset();return this._blob.keyData.slice(0,e)};return e}(Ad),i.TYPE="certificate",i);var wd=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(t,i):n?n.value=i:e.set(t,i),i};var _d=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(t):r?r.value:e.get(t)};var bd;var Ed=function(){function t(t){bd.set(this,void 0);var e=cd(t.trim());wd(this,bd,new gd(e),"f");this.notBefore=_d(this,bd,"f").validAfter;this.notAfter=_d(this,bd,"f").validBefore;this.validity=co(this.notBefore,this.notAfter);this.type=[_d(this,bd,"f").blob.type,_d(this,bd,"f").certType,_d(this,bd,"f").type].join(" ");this.serialNumber=_d(this,bd,"f").serial.toString();this.keyId=_d(this,bd,"f").keyId;this.principals=_d(this,bd,"f").principals;this.extensions=_d(this,bd,"f").extensions;this.criticalOptions=_d(this,bd,"f").criticalOptions}t.prototype.parseSignatureKey=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,r;var n;return __generator(this,(function(a){switch(a.label){case 0:return[4,_d(this,bd,"f").signatureKey.toWebCrypto()];case 1:t=a.sent();e=_d(this,bd,"f").signatureKey.getBlob();return[4,_d(this,bd,"f").signatureKey.thumbprint("sha256")];case 2:i=a.sent();r=this;n={algorithm:t.algorithm.name,type:e.type};return[4,_d(this,bd,"f").signatureKey.toSSH()];case 3:r.signatureKey=(n.value=a.sent(),n.thumbprint=u.Convert.ToBase64(i),n);return[2]}}))}))};t.prototype.parsePublicKey=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,r;var n;return __generator(this,(function(a){switch(a.label){case 0:return[4,_d(this,bd,"f").publicKey.toWebCrypto()];case 1:t=a.sent();e=_d(this,bd,"f").publicKey.getBlob();return[4,_d(this,bd,"f").publicKey.thumbprint("sha256")];case 2:i=a.sent();r=this;n={algorithm:t.algorithm.name,type:e.type};return[4,_d(this,bd,"f").publicKey.toSSH()];case 3:r.publicKey=(n.value=a.sent(),n.thumbprint=u.Convert.ToBase64(i),n);return[2]}}))}))};t.prototype.toString=function(){return __awaiter(this,arguments,void 0,(function(t){if(t===void 0){t="pem"}return __generator(this,(function(t){return[2,_d(this,bd,"f").toSSH()]}))}))};Object.defineProperty(t.prototype,"commonName",{get:function(){return _d(this,bd,"f").principals.join("_")||_d(this,bd,"f").keyId||_d(this,bd,"f").certType},enumerable:false,configurable:true});t.prototype.downloadAsPub=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){switch(r.label){case 0:i=(e=c.certSSH).asPub;return[4,this.toString()];case 1:i.apply(e,[r.sent(),t||[this.commonName,"cert"].join("-")]);return[2]}}))}))};return t}();t("bm",Ed);bd=new WeakMap}}}));
135
- //# sourceMappingURL=p-kq9wAWxW.system.js.map
134
+ */var Qc=t("c",(function(t){if(Vc.isPem(t)){return Vc.decode(t)[0]}if(u.Convert.isHex(t)){return u.Convert.FromHex(t)}if(u.Convert.isBase64(t)){return u.Convert.FromBase64(t)}if(u.Convert.isBase64Url(t)){return u.Convert.FromBase64Url(t)}return u.Convert.FromBinary(t)}));var qc=t("m",(function(t,i){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(r){e=Wc.get();if(e.subtle){return[2,e.subtle.digest(t,i)]}return[2,undefined]}))}))}));var zc=function(){function t(t){if(t===void 0){t={}}this.acIssuer=new ji;this.acSerial=0;this.attrs=[];Object.assign(this,t)}return t}();bi([Ai({type:ji})],zc.prototype,"acIssuer",void 0);bi([Ai({type:Ke.Integer})],zc.prototype,"acSerial",void 0);bi([Ai({type:rn,repeated:"sequence"})],zc.prototype,"attrs",void 0);var Yc;var Zc=Yc=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Yc.prototype);return i}return e}(wi);Zc=Yc=bi([Si({type:Ne.Sequence,itemType:Ke.ObjectIdentifier})],Zc);var $c=function(){function t(t){if(t===void 0){t={}}this.permitUnSpecified=true;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,optional:true})],$c.prototype,"pathLenConstraint",void 0);bi([Ai({type:Zc,implicit:true,context:0,optional:true})],$c.prototype,"permittedAttrs",void 0);bi([Ai({type:Zc,implicit:true,context:1,optional:true})],$c.prototype,"excludedAttrs",void 0);bi([Ai({type:Ke.Boolean,defaultValue:true})],$c.prototype,"permitUnSpecified",void 0);var Xc=function(){function t(t){if(t===void 0){t={}}this.issuer=new Xi;this.serial=new ArrayBuffer(0);this.issuerUID=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Xi})],Xc.prototype,"issuer",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Xc.prototype,"serial",void 0);bi([Ai({type:Ke.BitString,optional:true})],Xc.prototype,"issuerUID",void 0);var Jc;(function(t){t[t["publicKey"]=0]="publicKey";t[t["publicKeyCert"]=1]="publicKeyCert";t[t["otherObjectTypes"]=2]="otherObjectTypes"})(Jc||(Jc={}));var tf=function(){function t(t){if(t===void 0){t={}}this.digestedObjectType=Jc.publicKey;this.digestAlgorithm=new An;this.objectDigest=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.Enumerated})],tf.prototype,"digestedObjectType",void 0);bi([Ai({type:Ke.ObjectIdentifier,optional:true})],tf.prototype,"otherObjectTypeID",void 0);bi([Ai({type:An})],tf.prototype,"digestAlgorithm",void 0);bi([Ai({type:Ke.BitString})],tf.prototype,"objectDigest",void 0);var ef=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Xi,optional:true})],ef.prototype,"issuerName",void 0);bi([Ai({type:Xc,context:0,implicit:true,optional:true})],ef.prototype,"baseCertificateID",void 0);bi([Ai({type:tf,context:1,implicit:true,optional:true})],ef.prototype,"objectDigestInfo",void 0);var rf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:ji,repeated:"sequence"})],rf.prototype,"v1Form",void 0);bi([Ai({type:ef,context:0,implicit:true})],rf.prototype,"v2Form",void 0);rf=bi([Si({type:Ne.Choice})],rf);var nf=function(){function t(t){if(t===void 0){t={}}this.notBeforeTime=new Date;this.notAfterTime=new Date;Object.assign(this,t)}return t}();bi([Ai({type:Ke.GeneralizedTime})],nf.prototype,"notBeforeTime",void 0);bi([Ai({type:Ke.GeneralizedTime})],nf.prototype,"notAfterTime",void 0);var af=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Xc,implicit:true,context:0,optional:true})],af.prototype,"baseCertificateID",void 0);bi([Ai({type:Xi,implicit:true,context:1,optional:true})],af.prototype,"entityName",void 0);bi([Ai({type:tf,implicit:true,context:2,optional:true})],af.prototype,"objectDigestInfo",void 0);var of;(function(t){t[t["v2"]=1]="v2"})(of||(of={}));var sf=function(){function t(t){if(t===void 0){t={}}this.version=of.v2;this.holder=new af;this.issuer=new rf;this.signature=new An;this.serialNumber=new ArrayBuffer(0);this.attrCertValidityPeriod=new nf;this.attributes=[];Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],sf.prototype,"version",void 0);bi([Ai({type:af})],sf.prototype,"holder",void 0);bi([Ai({type:rf})],sf.prototype,"issuer",void 0);bi([Ai({type:An})],sf.prototype,"signature",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],sf.prototype,"serialNumber",void 0);bi([Ai({type:nf})],sf.prototype,"attrCertValidityPeriod",void 0);bi([Ai({type:rn,repeated:"sequence"})],sf.prototype,"attributes",void 0);bi([Ai({type:Ke.BitString,optional:true})],sf.prototype,"issuerUniqueID",void 0);bi([Ai({type:bn,optional:true})],sf.prototype,"extensions",void 0);var uf=function(){function t(t){if(t===void 0){t={}}this.acinfo=new sf;this.signatureAlgorithm=new An;this.signatureValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("n",uf);bi([Ai({type:sf})],uf.prototype,"acinfo",void 0);bi([Ai({type:An})],uf.prototype,"signatureAlgorithm",void 0);bi([Ai({type:Ke.BitString})],uf.prototype,"signatureValue",void 0);var cf;(function(t){t[t["unmarked"]=1]="unmarked";t[t["unclassified"]=2]="unclassified";t[t["restricted"]=4]="restricted";t[t["confidential"]=8]="confidential";t[t["secret"]=16]="secret";t[t["topSecret"]=32]="topSecret"})(cf||(cf={}));var ff=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(je);var vf=function(){function t(t){if(t===void 0){t={}}this.type="";this.value=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier,implicit:true,context:0})],vf.prototype,"type",void 0);bi([Ai({type:Ke.Any,implicit:true,context:1})],vf.prototype,"value",void 0);var hf=function(){function t(t){if(t===void 0){t={}}this.policyId="";this.classList=new ff(cf.unclassified);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],hf.prototype,"policyId",void 0);bi([Ai({type:ff,defaultValue:new ff(cf.unclassified)})],hf.prototype,"classList",void 0);bi([Ai({type:vf,repeated:"set"})],hf.prototype,"securityCategories",void 0);var df=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:He})],df.prototype,"cotets",void 0);bi([Ai({type:Ke.ObjectIdentifier})],df.prototype,"oid",void 0);bi([Ai({type:Ke.Utf8String})],df.prototype,"string",void 0);var lf=function(){function t(t){if(t===void 0){t={}}this.values=[];Object.assign(this,t)}return t}();bi([Ai({type:Xi,implicit:true,context:0,optional:true})],lf.prototype,"policyAuthority",void 0);bi([Ai({type:df,repeated:"sequence"})],lf.prototype,"values",void 0);var pf;var yf=function(){function t(t){if(t===void 0){t={}}this.targetCertificate=new Xc;Object.assign(this,t)}return t}();bi([Ai({type:Xc})],yf.prototype,"targetCertificate",void 0);bi([Ai({type:ji,optional:true})],yf.prototype,"targetName",void 0);bi([Ai({type:tf,optional:true})],yf.prototype,"certDigestInfo",void 0);var Sf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:ji,context:0,implicit:true})],Sf.prototype,"targetName",void 0);bi([Ai({type:ji,context:1,implicit:true})],Sf.prototype,"targetGroup",void 0);bi([Ai({type:yf,context:2,implicit:true})],Sf.prototype,"targetCert",void 0);Sf=bi([Si({type:Ne.Choice})],Sf);var Af=pf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,pf.prototype);return i}return e}(wi);Af=pf=bi([Si({type:Ne.Sequence,itemType:Sf})],Af);var Cf;var mf=Cf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Cf.prototype);return i}return e}(wi);mf=Cf=bi([Si({type:Ne.Sequence,itemType:Af})],mf);var gf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Xi,implicit:true,context:0,optional:true})],gf.prototype,"roleAuthority",void 0);bi([Ai({type:ji,implicit:true,context:1})],gf.prototype,"roleName",void 0);var wf=function(){function t(t){if(t===void 0){t={}}this.service=new ji;this.ident=new ji;Object.assign(this,t)}return t}();bi([Ai({type:ji})],wf.prototype,"service",void 0);bi([Ai({type:ji})],wf.prototype,"ident",void 0);bi([Ai({type:He,optional:true})],wf.prototype,"authInfo",void 0);var _f="0.4.0.9496";var bf=t("L","".concat(_f,".6"));var Ef=t("u",function(){function t(t){if(t===void 0){t={}}this.codeAuthority=new ji;this.codeId=new ji;this.shortName="";this.shortDescription="";Object.assign(this,t)}return t}());bi([Ai({type:ji,context:0})],Ef.prototype,"codeAuthority",void 0);bi([Ai({type:ji,context:1})],Ef.prototype,"codeId",void 0);bi([Ai({type:Ke.Utf8String,context:2})],Ef.prototype,"shortName",void 0);bi([Ai({type:Ke.Utf8String,context:3})],Ef.prototype,"shortDescription",void 0);t("u",Ef=bi([Si({type:Ne.Sequence})],Ef));var Pf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Mi);Pf=bi([Si({type:Ne.Sequence})],Pf);var Df=t("X","".concat(_f,".1"));var If=t("y",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("y",If=bi([Si({type:Ne.Sequence})],If));var Bf=t("S","".concat(_f,".2"));var xf=t("x",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("x",xf=bi([Si({type:Ne.Sequence})],xf));var Tf=t("Q","".concat(_f,".3"));var Of=t("w",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("w",Of=bi([Si({type:Ne.Sequence})],Of));var kf=t("O","".concat(_f,".4"));var Mf=t("v",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("v",Mf=bi([Si({type:Ne.Sequence})],Mf));var Rf=t("J","".concat(_f,".8"));var Nf=t("I",function(){function t(t){if(t===void 0){t={}}this.location="";this.base=0;this.degree=0;Object.assign(this,t)}t.prototype.toString=function(){return"".concat(this.base," x 10^").concat(this.degree," ").concat(this.location)};return t}());bi([Ai({type:Ke.PrintableString})],Nf.prototype,"location",void 0);bi([Ai({type:Ke.Integer})],Nf.prototype,"base",void 0);bi([Ai({type:Ke.Integer})],Nf.prototype,"degree",void 0);t("I",Nf=bi([Si({type:Ne.Sequence})],Nf));var Kf=t("H","".concat(_f,".9"));var jf=t("V",function(){function t(t){if(t===void 0){t={}}this.stars5=0;this.stars4=0;this.stars3=0;this.stars2=0;this.stars1=0;Object.assign(this,t)}return t}());bi([Ai({type:Ke.Integer})],jf.prototype,"stars5",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars4",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars3",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars2",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars1",void 0);t("V",jf=bi([Si({type:Ne.Sequence})],jf));var Hf=t("M","".concat(_f,".5"));var Uf=t("T",function(){function t(t){if(t===void 0){t={}}this.DNBvsDNO=new je(0);this.DNBvsDNT=new je(0);this.DNOvsDNT=new je(0);Object.assign(this,t)}return t}());bi([Ai({type:je,context:0})],Uf.prototype,"DNBvsDNO",void 0);bi([Ai({type:je,context:1})],Uf.prototype,"DNBvsDNT",void 0);bi([Ai({type:je,context:2})],Uf.prototype,"DNOvsDNT",void 0);t("T",Uf=bi([Si({type:Ne.Sequence})],Uf));var Ff=t("K","".concat(_f,".7"));var Lf=t("W",function(){function t(t){if(t===void 0){t={}}this.assessmentAuthority=new ji;this.assessmentRef=new ji;this.assessmentLocation=new ji;this.dataStorageTerritory="";this.description="";Object.assign(this,t)}return t}());bi([Ai({type:ji,context:0})],Lf.prototype,"assessmentAuthority",void 0);bi([Ai({type:ji,context:1})],Lf.prototype,"assessmentRef",void 0);bi([Ai({type:ji,context:2})],Lf.prototype,"assessmentLocation",void 0);bi([Ai({type:Ke.PrintableString,context:3})],Lf.prototype,"dataStorageTerritory",void 0);bi([Ai({type:Ke.Utf8String,context:4})],Lf.prototype,"description",void 0);t("W",Lf=bi([Si({type:Ne.Sequence})],Lf));var Vf=function(){function t(t){if(t===void 0){t={}}this.issuer=new Mi;this.serialNumber=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Mi})],Vf.prototype,"issuer",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Vf.prototype,"serialNumber",void 0);var Gf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:un,context:0,implicit:true})],Gf.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Vf})],Gf.prototype,"issuerAndSerialNumber",void 0);Gf=bi([Si({type:Ne.Choice})],Gf);var Wf;(function(t){t[t["v0"]=0]="v0";t[t["v1"]=1]="v1";t[t["v2"]=2]="v2";t[t["v3"]=3]="v3";t[t["v4"]=4]="v4";t[t["v5"]=5]="v5"})(Wf||(Wf={}));var Qf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Qf=bi([Si({type:Ne.Sequence})],Qf);var qf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);qf=bi([Si({type:Ne.Sequence})],qf);var zf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);zf=bi([Si({type:Ne.Sequence})],zf);var Yf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Yf=bi([Si({type:Ne.Sequence})],Yf);var Zf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Zf=bi([Si({type:Ne.Sequence})],Zf);var $f=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);$f=bi([Si({type:Ne.Sequence})],$f);var Xf=function(){function t(t){if(t===void 0){t={}}this.attrType="";this.attrValues=[];Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Xf.prototype,"attrType",void 0);bi([Ai({type:Ke.Any,repeated:"set"})],Xf.prototype,"attrValues",void 0);var Jf;var tv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.sid=new Gf;this.digestAlgorithm=new Qf;this.signatureAlgorithm=new qf;this.signature=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],tv.prototype,"version",void 0);bi([Ai({type:Gf})],tv.prototype,"sid",void 0);bi([Ai({type:Qf})],tv.prototype,"digestAlgorithm",void 0);bi([Ai({type:Xf,repeated:"set",context:0,implicit:true,optional:true,raw:true})],tv.prototype,"signedAttrs",void 0);bi([Ai({type:qf})],tv.prototype,"signatureAlgorithm",void 0);bi([Ai({type:He})],tv.prototype,"signature",void 0);bi([Ai({type:Xf,repeated:"set",context:1,implicit:true,optional:true})],tv.prototype,"unsignedAttrs",void 0);var ev=Jf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Jf.prototype);return i}return e}(wi);ev=Jf=bi([Si({type:Ne.Set,itemType:tv})],ev);var iv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(tv);iv=bi([Si({type:Ne.Sequence})],iv);var rv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mn);rv=bi([Si({type:Ne.Choice})],rv);var nv;var av=function(){function t(t){if(t===void 0){t={}}this.otherCertFormat="";this.otherCert=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],av.prototype,"otherCertFormat",void 0);bi([Ai({type:Ke.Any})],av.prototype,"otherCert",void 0);var ov=t("bk",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:Dn})],ov.prototype,"certificate",void 0);bi([Ai({type:uf,context:2,implicit:true})],ov.prototype,"v2AttrCert",void 0);bi([Ai({type:av,context:3,implicit:true})],ov.prototype,"other",void 0);t("bk",ov=bi([Si({type:Ne.Choice})],ov));var sv=t("bj",nv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,nv.prototype);return i}return e}(wi));t("bj",sv=nv=bi([Si({type:Ne.Set,itemType:ov})],sv));var uv=function(){function t(t){if(t===void 0){t={}}this.contentType="";this.content=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("bl",uv);bi([Ai({type:Ke.ObjectIdentifier})],uv.prototype,"contentType",void 0);bi([Ai({type:Ke.Any,context:0})],uv.prototype,"content",void 0);var cv=t("bi",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:He})],cv.prototype,"single",void 0);bi([Ai({type:Ke.Any})],cv.prototype,"any",void 0);t("bi",cv=bi([Si({type:Ne.Choice})],cv));var fv=function(){function t(t){if(t===void 0){t={}}this.eContentType="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],fv.prototype,"eContentType",void 0);bi([Ai({type:cv,context:0,optional:true})],fv.prototype,"eContent",void 0);var vv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:He,context:0,implicit:true,optional:true})],vv.prototype,"value",void 0);bi([Ai({type:He,converter:ze,context:0,implicit:true,optional:true,repeated:"sequence"})],vv.prototype,"constructedValue",void 0);vv=bi([Si({type:Ne.Choice})],vv);var hv=function(){function t(t){if(t===void 0){t={}}this.contentType="";this.contentEncryptionAlgorithm=new Yf;Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],hv.prototype,"contentType",void 0);bi([Ai({type:Yf})],hv.prototype,"contentEncryptionAlgorithm",void 0);bi([Ai({type:vv,optional:true})],hv.prototype,"encryptedContent",void 0);var dv=function(){function t(t){if(t===void 0){t={}}this.keyAttrId="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],dv.prototype,"keyAttrId",void 0);bi([Ai({type:Ke.Any,optional:true})],dv.prototype,"keyAttr",void 0);var lv;var pv=function(){function t(t){if(t===void 0){t={}}this.subjectKeyIdentifier=new un;Object.assign(this,t)}return t}();bi([Ai({type:un})],pv.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Ke.GeneralizedTime,optional:true})],pv.prototype,"date",void 0);bi([Ai({type:dv,optional:true})],pv.prototype,"other",void 0);var yv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:pv,context:0,implicit:true,optional:true})],yv.prototype,"rKeyId",void 0);bi([Ai({type:Vf,optional:true})],yv.prototype,"issuerAndSerialNumber",void 0);yv=bi([Si({type:Ne.Choice})],yv);var Sv=function(){function t(t){if(t===void 0){t={}}this.rid=new yv;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:yv})],Sv.prototype,"rid",void 0);bi([Ai({type:He})],Sv.prototype,"encryptedKey",void 0);var Av=lv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,lv.prototype);return i}return e}(wi);Av=lv=bi([Si({type:Ne.Sequence,itemType:Sv})],Av);var Cv=function(){function t(t){if(t===void 0){t={}}this.algorithm=new An;this.publicKey=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:An})],Cv.prototype,"algorithm",void 0);bi([Ai({type:Ke.BitString})],Cv.prototype,"publicKey",void 0);var mv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:un,context:0,implicit:true,optional:true})],mv.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Cv,context:1,implicit:true,optional:true})],mv.prototype,"originatorKey",void 0);bi([Ai({type:Vf,optional:true})],mv.prototype,"issuerAndSerialNumber",void 0);mv=bi([Si({type:Ne.Choice})],mv);var gv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v3;this.originator=new mv;this.keyEncryptionAlgorithm=new zf;this.recipientEncryptedKeys=new Av;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],gv.prototype,"version",void 0);bi([Ai({type:mv,context:0})],gv.prototype,"originator",void 0);bi([Ai({type:He,context:1,optional:true})],gv.prototype,"ukm",void 0);bi([Ai({type:zf})],gv.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:Av})],gv.prototype,"recipientEncryptedKeys",void 0);var wv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:un,context:0,implicit:true})],wv.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Vf})],wv.prototype,"issuerAndSerialNumber",void 0);wv=bi([Si({type:Ne.Choice})],wv);var _v=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.rid=new wv;this.keyEncryptionAlgorithm=new zf;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],_v.prototype,"version",void 0);bi([Ai({type:wv})],_v.prototype,"rid",void 0);bi([Ai({type:zf})],_v.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:He})],_v.prototype,"encryptedKey",void 0);var bv=function(){function t(t){if(t===void 0){t={}}this.keyIdentifier=new He;Object.assign(this,t)}return t}();bi([Ai({type:He})],bv.prototype,"keyIdentifier",void 0);bi([Ai({type:Ke.GeneralizedTime,optional:true})],bv.prototype,"date",void 0);bi([Ai({type:dv,optional:true})],bv.prototype,"other",void 0);var Ev=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v4;this.kekid=new bv;this.keyEncryptionAlgorithm=new zf;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Ev.prototype,"version",void 0);bi([Ai({type:bv})],Ev.prototype,"kekid",void 0);bi([Ai({type:zf})],Ev.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:He})],Ev.prototype,"encryptedKey",void 0);var Pv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.keyEncryptionAlgorithm=new zf;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Pv.prototype,"version",void 0);bi([Ai({type:$f,context:0,optional:true})],Pv.prototype,"keyDerivationAlgorithm",void 0);bi([Ai({type:zf})],Pv.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:He})],Pv.prototype,"encryptedKey",void 0);var Dv=function(){function t(t){if(t===void 0){t={}}this.oriType="";this.oriValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Dv.prototype,"oriType",void 0);bi([Ai({type:Ke.Any})],Dv.prototype,"oriValue",void 0);var Iv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:_v,optional:true})],Iv.prototype,"ktri",void 0);bi([Ai({type:gv,context:1,implicit:true,optional:true})],Iv.prototype,"kari",void 0);bi([Ai({type:Ev,context:2,implicit:true,optional:true})],Iv.prototype,"kekri",void 0);bi([Ai({type:Pv,context:3,implicit:true,optional:true})],Iv.prototype,"pwri",void 0);bi([Ai({type:Dv,context:4,implicit:true,optional:true})],Iv.prototype,"ori",void 0);Iv=bi([Si({type:Ne.Choice})],Iv);var Bv;var xv=Bv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Bv.prototype);return i}return e}(wi);xv=Bv=bi([Si({type:Ne.Set,itemType:Iv})],xv);var Tv;var Ov=function(){function t(t){if(t===void 0){t={}}this.otherRevInfoFormat="";this.otherRevInfo=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Ov.prototype,"otherRevInfoFormat",void 0);bi([Ai({type:Ke.Any})],Ov.prototype,"otherRevInfo",void 0);var kv=function(){function t(t){if(t===void 0){t={}}this.other=new Ov;Object.assign(this,t)}return t}();bi([Ai({type:Ov,context:1,implicit:true})],kv.prototype,"other",void 0);kv=bi([Si({type:Ne.Choice})],kv);var Mv=Tv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Tv.prototype);return i}return e}(wi);Mv=Tv=bi([Si({type:Ne.Set,itemType:kv})],Mv);var Rv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:sv,context:0,implicit:true,optional:true})],Rv.prototype,"certs",void 0);bi([Ai({type:Mv,context:1,implicit:true,optional:true})],Rv.prototype,"crls",void 0);var Nv;var Kv=Nv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Nv.prototype);return i}return e}(wi);Kv=Nv=bi([Si({type:Ne.Set,itemType:Xf})],Kv);var jv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.recipientInfos=new xv;this.encryptedContentInfo=new hv;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],jv.prototype,"version",void 0);bi([Ai({type:Rv,context:0,implicit:true,optional:true})],jv.prototype,"originatorInfo",void 0);bi([Ai({type:xv})],jv.prototype,"recipientInfos",void 0);bi([Ai({type:hv})],jv.prototype,"encryptedContentInfo",void 0);bi([Ai({type:Kv,context:1,implicit:true,optional:true})],jv.prototype,"unprotectedAttrs",void 0);var Hv;var Uv=Hv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Hv.prototype);return i}return e}(wi);Uv=Hv=bi([Si({type:Ne.Set,itemType:Qf})],Uv);var Fv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.digestAlgorithms=new Uv;this.encapContentInfo=new fv;this.signerInfos=new ev;Object.assign(this,t)}return t}();t("bh",Fv);bi([Ai({type:Ke.Integer})],Fv.prototype,"version",void 0);bi([Ai({type:Uv})],Fv.prototype,"digestAlgorithms",void 0);bi([Ai({type:fv})],Fv.prototype,"encapContentInfo",void 0);bi([Ai({type:sv,context:0,implicit:true,optional:true})],Fv.prototype,"certificates",void 0);bi([Ai({type:Mv,context:1,implicit:true,optional:true})],Fv.prototype,"crls",void 0);bi([Ai({type:ev})],Fv.prototype,"signerInfos",void 0);var Lv;var Vv=function(){function t(t){if(t===void 0){t={}}this.attrId="";this.attrValues=[];Object.assign(t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Vv.prototype,"attrId",void 0);bi([Ai({type:Ke.Any,repeated:"set"})],Vv.prototype,"attrValues",void 0);var Gv=Lv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Lv.prototype);return i}return e}(wi);Gv=Lv=bi([Si({type:Ne.Sequence,itemType:Vv})],Gv);var Wv;var Qv=Wv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Wv.prototype);return i}return e}(wi);Qv=Wv=bi([Si({type:Ne.Sequence,itemType:uv})],Qv);var qv=function(){function t(t){if(t===void 0){t={}}this.certId="";this.certValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],qv.prototype,"certId",void 0);bi([Ai({type:Ke.Any,context:0})],qv.prototype,"certValue",void 0);var zv=function(){function t(t){if(t===void 0){t={}}this.crlId="";this.crltValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],zv.prototype,"crlId",void 0);bi([Ai({type:Ke.Any,context:0})],zv.prototype,"crltValue",void 0);var Yv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ka);Yv=bi([Si({type:Ne.Sequence})],Yv);var Zv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Oa);Zv=bi([Si({type:Ne.Sequence})],Zv);var $v=function(){function t(t){if(t===void 0){t={}}this.secretTypeId="";this.secretValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],$v.prototype,"secretTypeId",void 0);bi([Ai({type:Ke.Any,context:0})],$v.prototype,"secretValue",void 0);var Xv=function(){function t(t){if(t===void 0){t={}}this.mac=new ma;this.macSalt=new He;this.iterations=1;Object.assign(this,t)}return t}();bi([Ai({type:ma})],Xv.prototype,"mac",void 0);bi([Ai({type:He})],Xv.prototype,"macSalt",void 0);bi([Ai({type:Ke.Integer,defaultValue:1})],Xv.prototype,"iterations",void 0);var Jv=function(){function t(t){if(t===void 0){t={}}this.version=3;this.authSafe=new uv;this.macData=new Xv;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Jv.prototype,"version",void 0);bi([Ai({type:uv})],Jv.prototype,"authSafe",void 0);bi([Ai({type:Xv,optional:true})],Jv.prototype,"macData",void 0);var th;var eh=function(){function t(t){if(t===void 0){t={}}this.bagId="";this.bagValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],eh.prototype,"bagId",void 0);bi([Ai({type:Ke.Any,context:0})],eh.prototype,"bagValue",void 0);bi([Ai({type:Vv,repeated:"set",optional:true})],eh.prototype,"bagAttributes",void 0);var ih=th=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,th.prototype);return i}return e}(wi);ih=th=bi([Si({type:Ne.Sequence,itemType:eh})],ih);var rh,nh,ah;var oh="1.2.840.113549.1.9";var sh=t("F","".concat(oh,".2"));var uh=t("G","".concat(oh,".7"));var ch=t("B","".concat(oh,".14"));var fh=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}return t.call(this,e)||this}e.prototype.toString=function(){return this.ia5String||t.prototype.toString.call(this)};return e}(Bi);bi([Ai({type:Ke.IA5String})],fh.prototype,"ia5String",void 0);fh=bi([Si({type:Ne.Choice})],fh);var vh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(uv);vh=bi([Si({type:Ne.Sequence})],vh);var hh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Jv);hh=bi([Si({type:Ne.Sequence})],hh);var dh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Oa);dh=bi([Si({type:Ne.Sequence})],dh);var lh=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.IA5String})],lh.prototype,"value",void 0);lh=bi([Si({type:Ne.Choice})],lh);var ph=t("U",function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(fh));t("U",ph=bi([Si({type:Ne.Choice})],ph));var yh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);yh=bi([Si({type:Ne.Choice})],yh);var Sh=function(){function t(t){if(t===void 0){t=new Date}this.value=t}return t}();bi([Ai({type:Ke.GeneralizedTime})],Sh.prototype,"value",void 0);Sh=bi([Si({type:Ne.Choice})],Sh);var Ah=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);Ah=bi([Si({type:Ne.Choice})],Ah);var Ch=function(){function t(t){if(t===void 0){t="M"}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.PrintableString})],Ch.prototype,"value",void 0);Ch=bi([Si({type:Ne.Choice})],Ch);var mh=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.PrintableString})],mh.prototype,"value",void 0);mh=bi([Si({type:Ne.Choice})],mh);var gh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mh);gh=bi([Si({type:Ne.Choice})],gh);var wh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);wh=bi([Si({type:Ne.Choice})],wh);var _h=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.ObjectIdentifier})],_h.prototype,"value",void 0);_h=bi([Si({type:Ne.Choice})],_h);var bh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mn);bh=bi([Si({type:Ne.Choice})],bh);var Eh=function(){function t(t){if(t===void 0){t=0}this.value=t}t.prototype.toString=function(){return this.value.toString()};return t}();bi([Ai({type:Ke.Integer})],Eh.prototype,"value",void 0);Eh=bi([Si({type:Ne.Choice})],Eh);var Ph=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(tv);Ph=bi([Si({type:Ne.Sequence})],Ph);var Dh=t("t",function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi));t("t",Dh=bi([Si({type:Ne.Choice})],Dh));var Ih=t("s",rh=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,rh.prototype);return i}return e}(bn));t("s",Ih=rh=bi([Si({type:Ne.Sequence})],Ih));var Bh=nh=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,nh.prototype);return i}return e}(wi);Bh=nh=bi([Si({type:Ne.Set,itemType:Xf})],Bh);var xh=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.BmpString})],xh.prototype,"value",void 0);xh=bi([Si({type:Ne.Choice})],xh);var Th=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Th=bi([Si({type:Ne.Sequence})],Th);var Oh=ah=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ah.prototype);return i}return e}(wi);Oh=ah=bi([Si({type:Ne.Sequence,itemType:Th})],Oh);var kh=t("z","1.3.6.1.4.1.22112.2.1");var Mh=t("r",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:Vf})],Mh.prototype,"signer",void 0);bi([Ai({type:Dn,optional:true})],Mh.prototype,"cert",void 0);t("r",Mh=bi([Si({type:Ne.Sequence})],Mh));var Rh;var Nh=Rh=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Rh.prototype);return i}return e}(wi);Nh=Rh=bi([Si({type:Ne.Sequence,itemType:rn})],Nh);var Kh=function(){function t(t){if(t===void 0){t={}}this.version=0;this.subject=new Mi;this.subjectPKInfo=new Cn;this.attributes=new Nh;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Kh.prototype,"version",void 0);bi([Ai({type:Mi})],Kh.prototype,"subject",void 0);bi([Ai({type:Cn})],Kh.prototype,"subjectPKInfo",void 0);bi([Ai({type:Nh,implicit:true,context:0,optional:true})],Kh.prototype,"attributes",void 0);var jh=function(){function t(t){if(t===void 0){t={}}this.certificationRequestInfo=new Kh;this.signatureAlgorithm=new An;this.signature=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("Y",jh);bi([Ai({type:Kh,raw:true})],jh.prototype,"certificationRequestInfo",void 0);bi([Ai({type:An})],jh.prototype,"signatureAlgorithm",void 0);bi([Ai({type:Ke.BitString})],jh.prototype,"signature",void 0);var Hh=globalThis.crypto;function Uh(){return Hh}var Fh=function(t){__extends(e,t);function e(e,i){var r=t.call(this,e)||this;r.code=i;r.name=r.constructor.name;if(Error.captureStackTrace){Error.captureStackTrace(r,r.constructor)}return r}return e}(Error);var Lh=function(t){__extends(e,t);function e(e,i){var r=i?" Supported: ".concat(i.join(", ")):"";return t.call(this,"Unsupported algorithm: ".concat(e,".").concat(r),"UNSUPPORTED_ALGORITHM")||this}return e}(Fh);var Vh=function(t){__extends(e,t);function e(e,i){var r=i?" Expected: ".concat(i):"";return t.call(this,"Invalid format: ".concat(e,".").concat(r),"INVALID_FORMAT")||this}return e}(Fh);var Gh=function(t){__extends(e,t);function e(e,i){var r=i?" Supported: ".concat(i.join(", ")):"";return t.call(this,"Unsupported key type: ".concat(e,".").concat(r),"UNSUPPORTED_KEY_TYPE")||this}return e}(Fh);var Wh=function(t){__extends(e,t);function e(e){var i=e?"Invalid SSH private key format: ".concat(e):"Invalid SSH private key format";return t.call(this,i,"INVALID_PRIVATE_KEY_FORMAT")||this}return e}(Fh);var Qh=function(t){__extends(e,t);function e(e){var i=e?"Encrypted SSH private keys are not supported (cipher: ".concat(e,")"):"Encrypted SSH private keys are not supported";return t.call(this,i,"ENCRYPTED_KEY_NOT_SUPPORTED")||this}return e}(Fh);var qh=function(t){__extends(e,t);function e(e){var i=e?"Invalid key data: ".concat(e):"Invalid key data";return t.call(this,i,"INVALID_KEY_DATA")||this}return e}(Fh);var zh=function(t){__extends(e,t);function e(e,i){var r=e!==undefined&&i!==undefined?" Expected ".concat(e," bytes, got ").concat(i):"";return t.call(this,"Unexpected end of data".concat(r),"UNEXPECTED_EOF")||this}return e}(Fh);var Yh=new TextEncoder;var Zh=new TextDecoder;var $h=function(){function t(t){this.buffer=t;this.offset=0}t.prototype.readUint8=function(){if(this.offset>=this.buffer.length){throw new zh(1,0)}return this.buffer[this.offset++]};t.prototype.readUint32=function(){var t=this.readUint8()<<24|this.readUint8()<<16|this.readUint8()<<8|this.readUint8();return t>>>0};t.prototype.readUint64=function(){var t=this.readUint32();var e=this.readUint32();return BigInt(t)<<32n|BigInt(e)};t.prototype.readBytes=function(t){if(t<0){throw new Vh("Invalid length: ".concat(t))}if(this.offset+t>this.buffer.length){throw new zh(t,this.buffer.length-this.offset)}var e=this.buffer.subarray(this.offset,this.offset+t);this.offset+=t;return e};t.prototype.readString=function(){var t=this.readUint32();var e=this.readBytes(t);return Zh.decode(e)};t.prototype.peekString=function(t){if(this.offset+t>this.buffer.length){throw new zh(t,this.buffer.length-this.offset)}var e=this.buffer.subarray(this.offset,this.offset+t);return Zh.decode(e)};t.prototype.readMpInt=function(t){if(t===void 0){t=false}var e=this.readUint32();var i=this.readBytes(e);if(t&&i.length>1&&i[0]===0){return i.subarray(1)}return i};t.prototype.readMpIntSsh=function(){return this.readMpInt(true)};t.prototype.remaining=function(){return this.buffer.length-this.offset};t.prototype.getOffset=function(){return this.offset};t.prototype.seek=function(t){if(t<0||t>this.buffer.length){throw new Vh("Invalid offset: ".concat(t,". Buffer length: ").concat(this.buffer.length))}this.offset=t};return t}();var Xh=function(){function t(t){if(t===void 0){t=1024}this.buffer=new Uint8Array(t);this.offset=0}t.prototype.ensureCapacity=function(t){var e=this.offset+t;if(e>this.buffer.length){var i=Math.max(e,this.buffer.length*2);var r=new Uint8Array(i);r.set(this.buffer.subarray(0,this.offset));this.buffer=r}};t.prototype.reserve=function(t){if(t>this.buffer.length){var e=new Uint8Array(t);e.set(this.buffer.subarray(0,this.offset));this.buffer=e}};t.prototype.writeUint8=function(t){this.ensureCapacity(1);this.buffer[this.offset++]=t&255};t.prototype.writeUint32=function(t){this.ensureCapacity(4);this.buffer[this.offset++]=t>>>24&255;this.buffer[this.offset++]=t>>>16&255;this.buffer[this.offset++]=t>>>8&255;this.buffer[this.offset++]=t&255};t.prototype.writeUint64=function(t){this.ensureCapacity(8);var e=Number(t>>32n);var i=Number(t&0xffffffffn);this.writeUint32(e);this.writeUint32(i)};t.prototype.writeBytes=function(t){this.ensureCapacity(t.length);this.buffer.set(t,this.offset);this.offset+=t.length};t.prototype.writeString=function(t){var e=Yh.encode(t);this.writeUint32(e.length);this.writeBytes(e)};t.prototype.writeMpInt=function(t,e){if(e===void 0){e=false}if(e&&t.length>0&&(t[0]&128)!==0){var i=new Uint8Array(t.length+1);i[0]=0;i.set(t,1);this.writeUint32(i.length);this.writeBytes(i)}else{this.writeUint32(t.length);this.writeBytes(t)}};t.prototype.writeMpIntSsh=function(t){this.writeMpInt(t,true)};t.prototype.toUint8Array=function(){return this.buffer.subarray(0,this.offset)};t.prototype.getOffset=function(){return this.offset};t.prototype.seek=function(t){if(t<0||t>this.buffer.length){throw new Vh("Invalid offset")}this.offset=t};return t}();var Jh=function(){function t(t){if(t===void 0){t="SHA-256"}this.hash="SHA-256";this.hash=t}t.prototype.importPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){e=t.blob,i=t.crypto;r=new $h(e);r.readString();n=r.readMpInt(true);a=r.readMpInt(true);o={kty:"RSA",n:u.Convert.ToBase64Url(a),e:u.Convert.ToBase64Url(n)};return[2,i.subtle.importKey("jwk",o,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])]}))}))};t.prototype.exportPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){switch(s.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("jwk",e)];case 1:r=s.sent();if(!r.n||!r.e){throw new qh("RSA JWK missing required parameters (n, e)")}n=u.BufferSourceConverter.toUint8Array(u.Convert.FromBase64Url(r.n));a=u.BufferSourceConverter.toUint8Array(u.Convert.FromBase64Url(r.e));o=new Xh;o.writeString("ssh-rsa");o.writeMpInt(a,true);o.writeMpInt(n,true);return[2,o.toUint8Array()]}}))}))};t.prototype.importPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.spki,i=t.crypto;return[2,i.subtle.importKey("spki",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])]}))}))};t.prototype.exportPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("spki",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.pkcs8,i=t.crypto;return[2,i.subtle.importKey("pkcs8",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])]}))}))};t.prototype.exportPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.privateKey,i=t.crypto;return[4,i.subtle.exportKey("pkcs8",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d,l,p,y,S,A,C,m,g,w,_,b,E,P,D,I,B;return __generator(this,(function(x){e=t.sshKey,i=t.crypto;r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=u.Convert.FromBase64(r);a=new $h(u.BufferSourceConverter.toUint8Array(n));o=a.readBytes(15);if(u.Convert.ToHex(o)!=="6f70656e7373682d6b65792d763100"){throw new Wh("invalid magic string")}s=a.readString();a.readString();a.readString();if(s!=="none"){throw new Qh(s)}c=a.readUint32();if(c!==1){throw new Wh("multiple keys not supported")}f=a.readUint32();a.readBytes(f);v=a.readUint32();h=a.readBytes(v);d=new $h(h);l=d.readUint32();p=d.readUint32();if(l!==p){throw new Wh("invalid checkints")}d.readString();y=d.readMpInt(true);S=d.readMpInt(true);A=d.readMpInt(true);C=d.readMpInt(true);m=d.readMpInt(true);g=d.readMpInt(true);d.readString();w=BigInt("0x"+u.Convert.ToHex(A));_=BigInt("0x"+u.Convert.ToHex(m));b=BigInt("0x"+u.Convert.ToHex(g));E=w%(_-1n);P=w%(b-1n);D=u.Convert.FromHex(E.toString(16).padStart(m.length*2,"0"));I=u.Convert.FromHex(P.toString(16).padStart(g.length*2,"0"));B={kty:"RSA",n:u.Convert.ToBase64Url(y),e:u.Convert.ToBase64Url(S),d:u.Convert.ToBase64Url(A),p:u.Convert.ToBase64Url(m),q:u.Convert.ToBase64Url(g),dp:u.Convert.ToBase64Url(D),dq:u.Convert.ToBase64Url(I),qi:u.Convert.ToBase64Url(C)};return[2,i.subtle.importKey("jwk",B,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])]}))}))};t.prototype.exportPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d;return __generator(this,(function(l){switch(l.label){case 0:e=t.privateKey,i=t.crypto,r=t.jwk;a=r;if(a)return[3,2];return[4,i.subtle.exportKey("jwk",e)];case 1:a=l.sent();l.label=2;case 2:n=a;if(!n.n||!n.e||!n.d||!n.p||!n.q){throw new qh("RSA JWK missing required parameters")}o=new Uint8Array(u.Convert.FromBase64Url(n.n));s=new Uint8Array(u.Convert.FromBase64Url(n.e));c=new Uint8Array(u.Convert.FromBase64Url(n.d));f=new Uint8Array(u.Convert.FromBase64Url(n.p));v=new Uint8Array(u.Convert.FromBase64Url(n.q));h=n.qi?new Uint8Array(u.Convert.FromBase64Url(n.qi)):new Uint8Array;d=new Xh;d.writeString("ssh-rsa");d.writeMpInt(o,true);d.writeMpInt(s,true);d.writeMpInt(c,true);d.writeMpInt(h,true);d.writeMpInt(f,true);d.writeMpInt(v,true);return[2,d.toUint8Array()]}}))}))};t.prototype.sign=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(c){switch(c.label){case 0:e=t.privateKey,i=t.data,r=t.crypto,n=t.hash;if(n&&n!==this.hash){throw new qh("Hash ".concat(n," not supported for this RSA algorithm"))}if(!e.extractable){throw new qh("Private key is not extractable")}return[4,this.exportPrivatePkcs8({privateKey:e,crypto:r})];case 1:a=c.sent();return[4,this.importPrivatePkcs8({pkcs8:new Uint8Array(a),crypto:r})];case 2:o=c.sent();return[4,r.subtle.sign("RSASSA-PKCS1-v1_5",o,i)];case 3:s=c.sent();return[2,u.BufferSourceConverter.toUint8Array(s)]}}))}))};t.prototype.verify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(u){switch(u.label){case 0:e=t.publicKey,i=t.signature,r=t.data,n=t.crypto,a=t.hash;if(a&&a!==this.hash){return[2,false]}if(!e.extractable){throw new qh("Public key is not extractable")}return[4,this.exportPublicSpki({publicKey:e,crypto:n})];case 1:o=u.sent();return[4,this.importPublicSpki({spki:new Uint8Array(o),crypto:n})];case 2:s=u.sent();return[2,n.subtle.verify("RSASSA-PKCS1-v1_5",s,i,r)]}}))}))};t.prototype.encodeSignature=function(t){var e=t.signature,i=t.algo;var r=new Xh;r.writeString(i);r.writeUint32(e.byteLength);r.writeBytes(e);return r.toUint8Array()};t.prototype.decodeSignature=function(t){var e=t.signature;var i=new $h(e);var r=i.readString();var n=i.readUint32();var a=i.readBytes(n);return{signature:a,algo:r}};t.prototype.supportsCryptoKey=function(t){return t.algorithm.name==="RSASSA-PKCS1-v1_5"};t.prototype.parsePublicKey=function(t){var e=t.readBytes(t.readUint32());var i=t.readBytes(t.readUint32());var r=new Xh;r.writeString("ssh-rsa");r.writeMpInt(e);r.writeMpInt(i);return{type:"ssh-rsa",keyData:r.toUint8Array()}};t.prototype.writePublicKey=function(t,e){var i=new $h(e.keyData);i.readString();var r=i.readMpInt();var n=i.readMpInt();t.writeUint32(r.length);t.writeBytes(r);t.writeUint32(n.length);t.writeBytes(n)};t.prototype.getCertificateType=function(){return"ssh-rsa-cert-v01@openssh.com"};t.prototype.getSignatureAlgo=function(){return this.hash==="SHA-256"?"rsa-sha2-256":"rsa-sha2-512"};return t}();var td=function(){function t(t,e,i){this.curveName=t;this.sshType=e;this.namedCurve=i}t.prototype.getHashAlgorithm=function(){switch(this.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:return"SHA-256"}};t.prototype.getExpectedLength=function(){switch(this.namedCurve){case"P-256":return 32;case"P-384":return 48;case"P-521":return 66;default:return 32}};t.prototype.getSignatureCoordLength=function(){return this.getExpectedLength()};t.prototype.importPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(c){e=t.blob,i=t.crypto;r=new $h(e);r.readString();n=r.readString();if(n!==this.curveName){throw new qh("ECDSA curve name ".concat(n,", expected ").concat(this.curveName))}a=r.readMpInt();o=Math.floor((a.length-1)/2);s={kty:"EC",crv:this.namedCurve,x:u.Convert.ToBase64Url(a.slice(1,1+o)),y:u.Convert.ToBase64Url(a.slice(1+o))};return[2,i.subtle.importKey("jwk",s,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])]}))}))};t.prototype.exportPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(c){switch(c.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("jwk",e)];case 1:r=c.sent();if(!r.x||!r.y){throw new qh("ECDSA JWK missing x or y parameters")}n=new Uint8Array(u.Convert.FromBase64Url(r.x));a=new Uint8Array(u.Convert.FromBase64Url(r.y));o=new Uint8Array(1+n.length+a.length);o[0]=4;o.set(n,1);o.set(a,1+n.length);s=new Xh;s.writeString(this.sshType);s.writeString(this.curveName);s.writeMpInt(o);return[2,s.toUint8Array()]}}))}))};t.prototype.importPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.spki,i=t.crypto;return[2,i.subtle.importKey("spki",e,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])]}))}))};t.prototype.exportPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("spki",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.pkcs8,i=t.crypto;return[2,i.subtle.importKey("pkcs8",e,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])]}))}))};t.prototype.exportPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.privateKey,i=t.crypto;return[4,i.subtle.exportKey("pkcs8",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.exportPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v;return __generator(this,(function(h){switch(h.label){case 0:e=t.privateKey,i=t.crypto,r=t.jwk;a=r;if(a)return[3,2];return[4,i.subtle.exportKey("jwk",e)];case 1:a=h.sent();h.label=2;case 2:n=a;if(!n.d||!n.x||!n.y){throw new qh("ECDSA private key JWK missing required parameters")}o=new Uint8Array(u.Convert.FromBase64Url(n.x));s=new Uint8Array(u.Convert.FromBase64Url(n.y));c=new Uint8Array(u.Convert.FromBase64Url(n.d));f=new Uint8Array(1+o.length+s.length);f[0]=4;f.set(o,1);f.set(s,1+o.length);v=new Xh;v.writeString(this.sshType);v.writeString(this.curveName);v.writeMpInt(f);v.writeMpInt(c);return[2,v.toUint8Array()]}}))}))};t.prototype.importPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d,l,p,y,S,A,C,m,g;return __generator(this,(function(w){e=t.sshKey,i=t.crypto;r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=u.Convert.FromBase64(r);a=new $h(u.BufferSourceConverter.toUint8Array(n));o=a.readBytes(15);if(u.Convert.ToHex(o)!=="6f70656e7373682d6b65792d763100"){throw new Wh("invalid magic string")}s=a.readString();a.readString();a.readString();if(s!=="none"){throw new Qh(s)}c=a.readUint32();if(c!==1){throw new Wh("multiple keys not supported")}f=a.readUint32();a.readBytes(f);v=a.readUint32();h=a.readBytes(v);d=new $h(h);l=d.readUint32();p=d.readUint32();if(l!==p){throw new Wh("invalid checkints")}d.readString();d.readString();y=d.readMpInt();S=d.readMpInt();d.readString();if(y[0]!==4){throw new qh("invalid ECDSA public key point format")}A=Math.floor((y.length-1)/2);C=y.slice(1,1+A);m=y.slice(1+A);g={kty:"EC",crv:this.namedCurve,x:u.Convert.ToBase64Url(C),y:u.Convert.ToBase64Url(m),d:u.Convert.ToBase64Url(S)};return[2,i.subtle.importKey("jwk",g,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])]}))}))};t.prototype.sign=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){switch(s.label){case 0:e=t.privateKey,i=t.data,r=t.crypto,n=t.hash;a=this.getHashAlgorithm();if(n&&n!==a){throw new qh("ECDSA ".concat(this.namedCurve," requires ").concat(a,", got ").concat(n))}return[4,r.subtle.sign({name:"ECDSA",hash:a},e,i)];case 1:o=s.sent();return[2,u.BufferSourceConverter.toUint8Array(o)]}}))}))};t.prototype.verify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){e=t.publicKey,i=t.signature,r=t.data,n=t.crypto,a=t.hash;o=this.getHashAlgorithm();if(a&&a!==o){throw new qh("ECDSA ".concat(this.namedCurve," requires ").concat(o,", got ").concat(a))}return[2,n.subtle.verify({name:"ECDSA",hash:o},e,i,r)]}))}))};t.prototype.encodeSignature=function(t){var e=t.signature,i=t.algo;if(i.startsWith("ecdsa-sha2-")){var r=this.getSignatureCoordLength();var n=e.subarray(0,r);var a=e.subarray(r);var o=new Xh;o.writeString(i);var s=new Xh;s.writeMpInt(n,true);s.writeMpInt(a,true);var u=s.toUint8Array();o.writeUint32(u.length);o.writeBytes(u);return o.toUint8Array()}var c=new Xh;c.writeString(i);c.writeUint32(e.byteLength);c.writeBytes(e);return c.toUint8Array()};t.prototype.decodeSignature=function(t){var e=t.signature;var i=new $h(e);var r=i.readString();var n=i.readUint32();var a=i.readBytes(n);if(r.startsWith("ecdsa-sha2-")){var o=new $h(a);var s=o.readMpInt();var u=o.readMpInt();if(s[0]===0&&s.length>1&&(s[1]&128)===0){s=s.slice(1)}if(u[0]===0&&u.length>1&&(u[1]&128)===0){u=u.slice(1)}var c=this.getExpectedLength();var f=new Uint8Array(c);var v=new Uint8Array(c);if(s.length<=c){f.set(s,c-s.length)}else{f.set(s.slice(s.length-c),0)}if(u.length<=c){v.set(u,c-u.length)}else{v.set(u.slice(u.length-c),0)}var h=new Uint8Array(__spreadArray(__spreadArray([],f,true),v,true));return{signature:h,algo:r}}return{signature:a,algo:r}};t.prototype.supportsCryptoKey=function(t){return t.algorithm.name==="ECDSA"&&t.algorithm.namedCurve===this.namedCurve};t.prototype.parsePublicKey=function(t){var e=t.readString();if(e!==this.curveName){throw new qh("ECDSA certificate curve name ".concat(e,", expected ").concat(this.curveName))}var i=t.readBytes(t.readUint32());var r=new Xh;r.writeString(this.sshType);r.writeString(e);r.writeMpInt(i);return{type:this.sshType,keyData:r.toUint8Array()}};t.prototype.writePublicKey=function(t,e){var i=new $h(e.keyData);i.readString();var r=i.readString();var n=i.readMpInt();t.writeString(r);t.writeUint32(n.length);t.writeBytes(n)};t.prototype.getCertificateType=function(){return"".concat(this.sshType,"-cert-v01@openssh.com")};t.prototype.getSignatureAlgo=function(){return this.sshType};return t}();var ed=new td("nistp256","ecdsa-sha2-nistp256","P-256");var id=new td("nistp384","ecdsa-sha2-nistp384","P-384");var rd=new td("nistp521","ecdsa-sha2-nistp521","P-521");var nd=function(){function t(){}t.prototype.importPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a;return __generator(this,(function(o){e=t.blob,i=t.crypto;r=new $h(e);r.readString();n=r.readUint32();if(n!==32){throw new qh("Ed25519 key length ".concat(n,", expected 32"))}a=r.readBytes(n);return[2,i.subtle.importKey("raw",a,"Ed25519",true,["verify"])]}))}))};t.prototype.exportPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("jwk",e)];case 1:r=o.sent();if(!r.x){throw new qh("Ed25519 JWK missing x parameter")}n=new Uint8Array(u.Convert.FromBase64Url(r.x));a=new Xh;a.writeString("ssh-ed25519");a.writeUint32(n.length);a.writeBytes(n);return[2,a.toUint8Array()]}}))}))};t.prototype.importPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.spki,i=t.crypto;return[2,i.subtle.importKey("spki",e,"Ed25519",true,["verify"])]}))}))};t.prototype.exportPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("spki",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.pkcs8,i=t.crypto;return[2,i.subtle.importKey("pkcs8",e,"Ed25519",true,["sign"])]}))}))};t.prototype.exportPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.privateKey,i=t.crypto;return[4,i.subtle.exportKey("pkcs8",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.exportPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f;return __generator(this,(function(v){switch(v.label){case 0:e=t.privateKey,i=t.crypto,r=t.jwk;a=r;if(a)return[3,2];return[4,i.subtle.exportKey("jwk",e)];case 1:a=v.sent();v.label=2;case 2:n=a;if(!n.d||!n.x){throw new qh("Ed25519 private key JWK missing required parameters")}o=new Uint8Array(u.Convert.FromBase64Url(n.d));s=new Uint8Array(u.Convert.FromBase64Url(n.x));c=new Xh;c.writeString("ssh-ed25519");c.writeUint32(s.length);c.writeBytes(s);f=new Uint8Array(64);f.set(o,0);f.set(s,32);c.writeUint32(f.length);c.writeBytes(f);return[2,c.toUint8Array()]}}))}))};t.prototype.importPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d,l,p,y,S,A,C,m,g;return __generator(this,(function(w){e=t.sshKey,i=t.crypto;r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=u.Convert.FromBase64(r);a=new $h(u.BufferSourceConverter.toUint8Array(n));o=a.readBytes(15);if(u.Convert.ToHex(o)!=="6f70656e7373682d6b65792d763100"){throw new Wh("invalid magic string")}s=a.readString();a.readString();a.readString();if(s!=="none"){throw new Qh(s)}c=a.readUint32();if(c!==1){throw new Wh("multiple keys not supported")}f=a.readUint32();a.readBytes(f);v=a.readUint32();h=a.readBytes(v);d=new $h(h);l=d.readUint32();p=d.readUint32();if(l!==p){throw new Wh("invalid checkints")}d.readString();y=d.readUint32();S=d.readBytes(y);A=d.readUint32();C=d.readBytes(A);d.readString();m=C.slice(0,32);g={kty:"OKP",crv:"Ed25519",d:u.Convert.ToBase64Url(m),x:u.Convert.ToBase64Url(S)};return[2,i.subtle.importKey("jwk",g,"Ed25519",true,["sign"])]}))}))};t.prototype.sign=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n;return __generator(this,(function(a){switch(a.label){case 0:e=t.privateKey,i=t.data,r=t.crypto;return[4,r.subtle.sign("Ed25519",e,i)];case 1:n=a.sent();return[2,u.BufferSourceConverter.toUint8Array(n)]}}))}))};t.prototype.verify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n;return __generator(this,(function(a){e=t.publicKey,i=t.signature,r=t.data,n=t.crypto;return[2,n.subtle.verify("Ed25519",e,i,r)]}))}))};t.prototype.encodeSignature=function(t){var e=t.signature,i=t.algo;var r=new Uint8Array(e);var n=new Xh;n.writeString(i);n.writeUint32(r.length);n.writeBytes(r);return n.toUint8Array()};t.prototype.decodeSignature=function(t){var e=t.signature;var i=new $h(e);var r=i.readString();var n=i.readUint32();var a=i.readBytes(n);return{signature:a,algo:r}};t.prototype.supportsCryptoKey=function(t){return t.algorithm.name==="Ed25519"};t.prototype.parsePublicKey=function(t){var e=t.readBytes(t.readUint32());var i=new Xh;i.writeString("ssh-ed25519");i.writeUint32(e.length);i.writeBytes(e);return{type:"ssh-ed25519",keyData:i.toUint8Array()}};t.prototype.writePublicKey=function(t,e){var i=new $h(e.keyData);i.readString();var r=i.readUint32();var n=i.readBytes(r);t.writeUint32(n.length);t.writeBytes(n)};t.prototype.getCertificateType=function(){return"ssh-ed25519-cert-v01@openssh.com"};t.prototype.getSignatureAlgo=function(){return"ssh-ed25519"};return t}();var ad=new Map;var od=function(){function t(){}t.get=function(t){var e=ad.get(t);if(!e){throw new Gh(t,Array.from(ad.keys()))}return e};t.register=function(t,e){ad.set(t,e)};t.getSshTypeFromCryptoKey=function(t){for(var e=0,i=ad.entries();e<i.length;e++){var r=i[e],n=r[0],a=r[1];if(a.supportsCryptoKey(t)){return n}}throw new Gh(t.algorithm.name,Array.from(ad.keys()))};t.certTypeToKeyType=function(t){var e={"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"};return e[t]};t.getSupportedCertTypes=function(){return Object.keys({"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"})};return t}();od.register("ssh-ed25519",new nd);od.register("ssh-rsa",new Jh("SHA-256"));od.register("rsa-sha2-256",new Jh("SHA-256"));od.register("rsa-sha2-512",new Jh("SHA-512"));od.register("ecdsa-sha2-nistp256",ed);od.register("ecdsa-sha2-nistp384",id);od.register("ecdsa-sha2-nistp521",rd);function sd(t){var e=typeof t==="string"?t.trim().split(/\s+/):null;if(!e||e.length<2){throw new Vh("Invalid SSH public key format")}var i=e[0];var r=new Uint8Array(u.Convert.FromBase64(e[1]));var n=e.length>2?e.slice(2).join(" "):undefined;var a=new $h(r);var o=a.readString();if(o!==i){throw new Vh("Key type mismatch")}return{type:i,keyData:r,comment:n}}function ud(t){var e=u.Convert.ToBase64(t.keyData);var i=[t.type,e];if(t.comment){i.push(t.comment)}return i.join(" ")}function cd(t){if(typeof t==="string"){var e=t.trim().split(/\s+/);if(e.length<2){throw new Vh("SSH certificate string","type base64 [comment]")}var i=e[0];var r=new Uint8Array(u.Convert.FromBase64(e[1]));var n=e.length>2?e.slice(2).join(" "):undefined;var a=new $h(r);var o=a.readString();if(o!==i){throw new Vh("certificate blob type ".concat(o),"expected ".concat(i))}return{type:i,keyData:r,comment:n}}else{var a=new $h(t);var s=a.readString();var c=t.slice(a.getOffset());return{type:s,keyData:c}}}function fd(t){var e=new $h(t);var i=e.readString();var r=e.readBytes(e.readUint32());var n=od.certTypeToKeyType(i);if(!n){throw new Lh(i,od.getSupportedCertTypes())}var a=od.get(n);var o=a.parsePublicKey(e);var s=n;var u=e.readUint64();var c=e.readUint32();var f=c===1?"user":"host";var v=e.readString();var h=e.readUint32();var d=e.readBytes(h);var l=[];if(d.length>0){var p=new $h(d);while(p.getOffset()<d.length){try{var y=p.readString();l.push(y)}catch(t){break}}}var S=e.readUint64();var A=e.readUint64();var C={};var m=e.readUint32();var g=e.readBytes(m);if(g.length>0){var w=new $h(g);while(w.getOffset()<g.length){try{var _=w.readString();var b=w.readBytes(w.readUint32());var E=b.length===0?"":Zh.decode(b);C[_]=E}catch(t){break}}}var P={};var D=e.readUint32();var I=e.readBytes(D);if(I.length>0){var B=new $h(I);while(B.getOffset()<I.length){try{var x=B.readString();var b=B.readBytes(B.readUint32());var T=b.length===0?"":Zh.decode(b);P[x]=T}catch(t){break}}}var O=e.readUint32();var k=e.readBytes(O);var M=e.readUint32();var R=e.readBytes(M);var N=new $h(R);var K=N.readString();var j={type:K,keyData:R};var H=e.readUint32();var U=e.readBytes(H);return{nonce:r,keyType:s,publicKey:o,serial:u,type:f,keyId:v,validPrincipals:l,validAfter:S,validBefore:A,criticalOptions:C,extensions:P,reserved:k,signatureKey:j,signature:U}}function vd(t){var e=u.Convert.ToBase64(t.keyData);var i=[t.type,e];if(t.comment){i.push(t.comment)}return i.join(" ")}function hd(t){var e=new $h(t);if(t.length>=6&&(new TextDecoder).decode(t.subarray(0,6))==="SSHSIG"){return dd(e)}else{return ld(e)}}function dd(t){var e=t.readBytes(6);var i=(new TextDecoder).decode(e);if(i!=="SSHSIG"){throw new Vh(i,"SSHSIG")}var r=t.readUint32();var n=t.readUint32();var a=t.readBytes(n);var o=t.readString();var s=t.readString();var u=t.readString();var c=t.readUint32();var f=t.readBytes(c);var v=new $h(f);var h=v.readString();var d=v.readUint32();var l=v.readBytes(d);return{format:"ssh-signature",algorithm:h,signature:l,version:r,publicKey:a,namespace:o,reserved:s,hashAlgorithm:u}}function ld(t){var e=t.readString();var i=t.readUint32();var r=t.readBytes(i);return{format:"legacy",algorithm:e,signature:r}}function pd(t){if(t.format==="ssh-signature"){return yd(t)}else{return Sd(t)}}function yd(t){var e=new Xh;e.writeBytes((new TextEncoder).encode("SSHSIG"));e.writeUint32(t.version||1);if(t.publicKey){e.writeUint32(t.publicKey.length);e.writeBytes(t.publicKey)}else{e.writeUint32(0)}e.writeString(t.namespace||"file");e.writeString(t.reserved||"");e.writeString(t.hashAlgorithm||"sha512");var i=new Xh;i.writeString(t.algorithm);i.writeUint32(t.signature.length);i.writeBytes(t.signature);var r=i.toUint8Array();e.writeUint32(r.length);e.writeBytes(r);return e.toUint8Array()}function Sd(t){var e=new Xh;e.writeString(t.algorithm);e.writeUint32(t.signature.length);e.writeBytes(t.signature);return e.toUint8Array()}var Ad=function(){function t(){}return t}();var Cd=function(t){__extends(e,t);function e(i){var r=t.call(this)||this;r.type=e.TYPE;r.blob=i;return r}e.prototype.getCryptoKey=function(){return __awaiter(this,arguments,void 0,(function(t){var e,i;if(t===void 0){t=Uh()}return __generator(this,(function(r){switch(r.label){case 0:if(!!this.cachedCryptoKey)return[3,2];e=od.get(this.blob.type);i=this;return[4,e.importPublicSsh({blob:this.blob.keyData,crypto:t})];case 1:i.cachedCryptoKey=r.sent();r.label=2;case 2:return[2,this.cachedCryptoKey]}}))}))};e.fromSSH=function(t){return __awaiter(this,arguments,void 0,(function(t,i){var r,n;if(i===void 0){i=Uh()}return __generator(this,(function(a){switch(a.label){case 0:r=sd(t);n=od.get(r.type);return[4,n.importPublicSsh({blob:r.keyData,crypto:i})];case 1:a.sent();return[2,new e(r)]}}))}))};e.fromSPKI=function(t,i){return __awaiter(this,arguments,void 0,(function(t,i,r){var n,a,o,s;if(r===void 0){r=Uh()}return __generator(this,(function(u){switch(u.label){case 0:n=od.get(i);return[4,n.importPublicSpki({spki:t,crypto:r})];case 1:a=u.sent();return[4,n.exportPublicSsh({publicKey:a,crypto:r})];case 2:o=u.sent();s={type:i,keyData:o};return[2,new e(s)]}}))}))};e.fromWebCrypto=function(t,i){return __awaiter(this,arguments,void 0,(function(t,i,r){var n,a,o,s;if(r===void 0){r=Uh()}return __generator(this,(function(u){switch(u.label){case 0:n=i||od.getSshTypeFromCryptoKey(t);a=od.get(n);return[4,a.exportPublicSsh({publicKey:t,crypto:r})];case 1:o=u.sent();s={type:n,keyData:o};return[2,new e(s)]}}))}))};e.prototype.export=function(){return __awaiter(this,arguments,void 0,(function(t,e){var i,r,n;if(t===void 0){t="ssh"}if(e===void 0){e=Uh()}return __generator(this,(function(a){switch(a.label){case 0:if(!(t==="ssh"))return[3,1];return[2,ud(this.blob)];case 1:if(!(t==="spki"))return[3,4];return[4,this.getCryptoKey(e)];case 2:i=a.sent();r=od.get(this.blob.type);return[4,r.exportPublicSpki({publicKey:i,crypto:e})];case 3:n=a.sent();return[2,new Uint8Array(n)];case 4:throw new Gh("Unsupported export format: ".concat(t))}}))}))};e.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.export("ssh")];case 1:t=e.sent();return[2,t]}}))}))};e.prototype.toSPKI=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.export("spki")];case 1:t=e.sent();return[2,t]}}))}))};e.prototype.toWebCrypto=function(){return __awaiter(this,arguments,void 0,(function(t){if(t===void 0){t=Uh()}return __generator(this,(function(e){return[2,this.getCryptoKey(t)]}))}))};e.prototype.verify=function(t,e,i){return __awaiter(this,arguments,void 0,(function(t,e,i,r){var n,a;if(r===void 0){r=Uh()}return __generator(this,(function(o){switch(o.label){case 0:n=od.get(t);return[4,this.toWebCrypto(r)];case 1:a=o.sent();return[2,n.verify({publicKey:a,signature:e,data:i,crypto:r})]}}))}))};Object.defineProperty(e.prototype,"keyType",{get:function(){return this.blob.type},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"comment",{get:function(){return this.blob.comment},enumerable:false,configurable:true});e.prototype.getBlob=function(){return __assign({},this.blob)};e.prototype.thumbprint=function(){return __awaiter(this,arguments,void 0,(function(t,e){var i,r,n;if(t===void 0){t="sha256"}if(e===void 0){e=Uh()}return __generator(this,(function(a){switch(a.label){case 0:i=t==="sha256"?"SHA-256":"SHA-512";r=this.blob.keyData;return[4,e.subtle.digest(i,r)];case 1:n=a.sent();return[2,new Uint8Array(n)]}}))}))};e.TYPE="public-key";return e}(Ad);var md=function(t){__extends(e,t);function e(i){var r=t.call(this)||this;r.type=e.TYPE;r.blob=i;r.format=i.format;r.algorithm=i.algorithm;r.signature=i.signature;r.version=i.version;r.namespace=i.namespace;r.reserved=i.reserved;r.hashAlgorithm=i.hashAlgorithm;if(i.publicKey){var n=new $h(i.publicKey);var a=n.readString();r.publicKey=new Cd({type:a,keyData:i.publicKey})}return r}e.parse=function(t){var i=hd(t);return new e(i)};e.fromBlob=function(t){return new e(t)};e.fromBase64=function(t){var i=new Uint8Array(u.Convert.FromBase64(t));return e.parse(i)};e.fromText=function(t){var i=t.replace(/-----BEGIN SSH SIGNATURE-----/,"").replace(/-----END SSH SIGNATURE-----/,"").replace(/[\r\n\s]/g,"");return e.fromBase64(i)};e.prototype.serialize=function(){return pd(this.blob)};e.prototype.toBase64=function(){return u.Convert.ToBase64(this.serialize())};e.prototype.toText=function(){var t=this.toBase64();var e=[];for(var i=0;i<t.length;i+=70){e.push(t.substring(i,i+70))}return __spreadArray(__spreadArray(["-----BEGIN SSH SIGNATURE-----"],e,true),["-----END SSH SIGNATURE-----"],false).join("\n")};e.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.toText()]}))}))};e.prototype.verify=function(t,e){return __awaiter(this,void 0,void 0,(function(){var i,r,n,a,o,s,u,c,f,v,h,d,l,p,y,S;return __generator(this,(function(A){switch(A.label){case 0:i=od.get(this.algorithm);return[4,e["getCryptoKey"]()];case 1:r=A.sent();n=Uh();a=t;if(!(this.format==="ssh-signature"))return[3,3];o=this.hashAlgorithm||"sha512";s=this.namespace||"file";u=this.reserved||"";c=o==="sha256"?"SHA-256":"SHA-512";return[4,n.subtle.digest(c,t)];case 2:f=A.sent();v=new Uint8Array(f);h=new Xh;h.writeBytes((new TextEncoder).encode("SSHSIG"));h.writeString(s);h.writeString(u);h.writeString(o);h.writeUint32(v.length);h.writeBytes(v);a=h.toUint8Array();A.label=3;case 3:if(this.algorithm==="rsa-sha2-256"){d="SHA-256"}else if(this.algorithm==="rsa-sha2-512"){d="SHA-512"}if(this.format==="legacy"||this.format==="ssh-signature"){p=new Xh;p.writeString(this.algorithm);p.writeUint32(this.signature.length);p.writeBytes(this.signature);y=p.toUint8Array();S=i.decodeSignature({signature:y});l=S.signature}else{l=this.signature}return[2,i.verify({publicKey:r,signature:l,data:a,crypto:n,hash:d})]}}))}))};e.fromLegacy=function(t,i){var r=od.get(t);var n=r.encodeSignature({signature:i,algo:t});var a=new $h(n);a.readString();var o=a.readUint32();var s=a.readBytes(o);return new e({format:"legacy",algorithm:t,signature:s})};e.fromSshSignature=function(t,i,r){if(r===void 0){r={}}var n={format:"ssh-signature",algorithm:t,signature:i,version:r.version||1,publicKey:r.publicKey?r.publicKey.getBlob().keyData:undefined,namespace:r.namespace||"file",reserved:r.reserved||"",hashAlgorithm:r.hashAlgorithm||"sha512"};return new e(n)};e.sign=function(t,i,r){return __awaiter(this,arguments,void 0,(function(t,i,r,n){var a,o,s,u,c,f,v,h,d,l,p,y,S,A,C,m,c,g,w,_,b;if(n===void 0){n={}}return __generator(this,(function(E){switch(E.label){case 0:a=n.format,o=a===void 0?"legacy":a,s=n.namespace,u=s===void 0?"file":s;if(!(o==="legacy"))return[3,2];return[4,i.sign(t,r)];case 1:c=E.sent();f=t||i.keyType;return[2,e.fromLegacy(f,c)];case 2:v=t;h=od.get(v);d=t==="rsa-sha2-256"?"sha256":"sha512";return[4,i.getPublicKey()];case 3:l=E.sent();p=Uh();y=d==="sha256"?"SHA-256":"SHA-512";return[4,p.subtle.digest(y,r)];case 4:S=E.sent();A=new Uint8Array(S);C=new Xh;C.writeBytes((new TextEncoder).encode("SSHSIG"));C.writeString(u);C.writeString("");C.writeString(d);C.writeUint32(A.length);C.writeBytes(A);m=C.toUint8Array();return[4,i.sign(v,m)];case 5:c=E.sent();g=h.encodeSignature({signature:c,algo:v});w=new $h(g);w.readString();_=w.readUint32();b=w.readBytes(_);return[2,e.fromSshSignature(v,b,{namespace:u,hashAlgorithm:d,publicKey:l})]}}))}))};e.TYPE="signature";return e}(Ad);var gd=(i=function(t){__extends(e,t);function e(e){var r=t.call(this)||this;r.type=i.TYPE;r._blob=e;r.data=fd(e.keyData);r._validAfter=r.data.validAfter;r._validBefore=r.data.validBefore;r.keyId=r.data.keyId;r.principals=r.data.validPrincipals;r.certType=r.data.type;r.serial=r.data.serial;r.validAfter=new Date(Number(r.data.validAfter)*1e3);r.validBefore=new Date(Number(r.data.validBefore)*1e3);r.publicKey=new Cd(r.data.publicKey);r.signatureKey=new Cd(r.data.signatureKey);r.criticalOptions=__assign({},r.data.criticalOptions);r.extensions=__assign({},r.data.extensions);return r}e.fromSSH=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){e=cd(t);return[2,new i(e)]}))}))};e.fromBlob=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,new i(t)]}))}))};e.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,vd(this._blob)]}))}))};e.prototype.toBlob=function(){return __assign({},this._blob)};Object.defineProperty(e.prototype,"blob",{get:function(){return this.toBlob()},enumerable:false,configurable:true});e.prototype.validate=function(t){if(t===void 0){t=new Date}var e=BigInt(Math.floor(t.getTime()/1e3));var i=this._validAfter;var r=this._validBefore;var n=0xffffffffffffffffn;var a=r===n?e:r;return e>=i&&e<=a};e.prototype.verify=function(t){return __awaiter(this,arguments,void 0,(function(t,e){var i,r,n,a,o;if(e===void 0){e=Uh()}return __generator(this,(function(s){switch(s.label){case 0:i=t||this.signatureKey;r=this.getSignedData();n=md.parse(this.data.signature);a=od.get(n.algorithm);return[4,i.toWebCrypto(e)];case 1:o=s.sent();return[2,a.verify({publicKey:o,signature:n.signature,data:r,crypto:e})]}}))}))};e.prototype.getSignedData=function(){var t=new $h(this._blob.keyData);t.readString();t.readBytes(t.readUint32());if(this.data.keyType==="ssh-ed25519"){t.readBytes(t.readUint32())}else if(this.data.keyType==="ssh-rsa"){t.readBytes(t.readUint32());t.readBytes(t.readUint32())}else if(this.data.keyType.startsWith("ecdsa-sha2-")){t.readString();t.readBytes(t.readUint32())}t.readUint64();t.readUint32();t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readUint64();t.readUint64();t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readBytes(t.readUint32());var e=t.getOffset();return this._blob.keyData.slice(0,e)};return e}(Ad),i.TYPE="certificate",i);var wd=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(t,i):n?n.value=i:e.set(t,i),i};var _d=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(t):r?r.value:e.get(t)};var bd;var Ed=function(){function t(t){bd.set(this,void 0);var e=cd(u.Convert.isBase64Url(t.trim())?u.Convert.ToString(u.Convert.FromBase64Url(t.trim())):t.trim());wd(this,bd,new gd(e),"f");this.notBefore=_d(this,bd,"f").validAfter;this.notAfter=_d(this,bd,"f").validBefore;this.validity=co(this.notBefore,this.notAfter);this.type=[_d(this,bd,"f").blob.type,_d(this,bd,"f").certType,_d(this,bd,"f").type].join(" ");this.serialNumber=_d(this,bd,"f").serial.toString();this.keyId=_d(this,bd,"f").keyId;this.principals=_d(this,bd,"f").principals;this.extensions=_d(this,bd,"f").extensions;this.criticalOptions=_d(this,bd,"f").criticalOptions}t.prototype.parseSignatureKey=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,r;var n;return __generator(this,(function(a){switch(a.label){case 0:return[4,_d(this,bd,"f").signatureKey.toWebCrypto()];case 1:t=a.sent();e=_d(this,bd,"f").signatureKey.getBlob();return[4,_d(this,bd,"f").signatureKey.thumbprint("sha256")];case 2:i=a.sent();r=this;n={algorithm:t.algorithm.name,type:e.type};return[4,_d(this,bd,"f").signatureKey.toSSH()];case 3:r.signatureKey=(n.value=a.sent(),n.thumbprint=u.Convert.ToBase64(i),n);return[2]}}))}))};t.prototype.parsePublicKey=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,r;var n;return __generator(this,(function(a){switch(a.label){case 0:return[4,_d(this,bd,"f").publicKey.toWebCrypto()];case 1:t=a.sent();e=_d(this,bd,"f").publicKey.getBlob();return[4,_d(this,bd,"f").publicKey.thumbprint("sha256")];case 2:i=a.sent();r=this;n={algorithm:t.algorithm.name,type:e.type};return[4,_d(this,bd,"f").publicKey.toSSH()];case 3:r.publicKey=(n.value=a.sent(),n.thumbprint=u.Convert.ToBase64(i),n);return[2]}}))}))};t.prototype.toString=function(){return __awaiter(this,arguments,void 0,(function(t){var e;if(t===void 0){t="pem"}return __generator(this,(function(i){switch(i.label){case 0:if(!(t==="base64url"))return[3,2];return[4,_d(this,bd,"f").toSSH()];case 1:e=i.sent();return[2,u.Convert.ToBase64Url(u.Convert.FromString(e))];case 2:return[2,_d(this,bd,"f").toSSH()]}}))}))};Object.defineProperty(t.prototype,"commonName",{get:function(){return _d(this,bd,"f").principals.join("_")||_d(this,bd,"f").keyId||_d(this,bd,"f").certType},enumerable:false,configurable:true});t.prototype.downloadAsPub=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){switch(r.label){case 0:i=(e=c.certSSH).asPub;return[4,this.toString()];case 1:i.apply(e,[r.sent(),t||[this.commonName,"cert"].join("-")]);return[2]}}))}))};return t}();t("bm",Ed);bd=new WeakMap}}}));
135
+ //# sourceMappingURL=p-CLcRtCZ9.system.js.map