@peculiar/certificates-viewer 3.10.1 → 4.0.1

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 (554) hide show
  1. package/README.md +40 -64
  2. package/components/arrow_top.js +34 -0
  3. package/components/arrow_top.js.map +1 -0
  4. package/components/attribute-certificate-viewer.js +281 -0
  5. package/components/attribute-certificate-viewer.js.map +1 -0
  6. package/components/button-menu.js +64 -0
  7. package/components/button-menu.js.map +1 -0
  8. package/components/button.js +74 -0
  9. package/components/button.js.map +1 -0
  10. package/components/certificate-viewer.js +300 -0
  11. package/components/certificate-viewer.js.map +1 -0
  12. package/components/circular-progress.js +48 -0
  13. package/components/circular-progress.js.map +1 -0
  14. package/components/crl-viewer.js +263 -0
  15. package/components/crl-viewer.js.map +1 -0
  16. package/components/csr-viewer.js +233 -0
  17. package/components/csr-viewer.js.map +1 -0
  18. package/components/custom-elements.d.ts +2 -0
  19. package/{dist/esm/download-91511aeb.js → components/download.js} +2 -0
  20. package/components/download.js.map +1 -0
  21. package/components/highlight-words.js +60 -0
  22. package/components/highlight-words.js.map +1 -0
  23. package/components/index.d.ts +33 -0
  24. package/components/index.js +7 -0
  25. package/components/index.js.map +1 -0
  26. package/components/index2.js +299 -0
  27. package/components/index2.js.map +1 -0
  28. package/components/issuer_name.js +26 -0
  29. package/components/issuer_name.js.map +1 -0
  30. package/components/miscellaneous.js +13420 -0
  31. package/components/miscellaneous.js.map +1 -0
  32. package/components/package.json +9 -0
  33. package/components/peculiar-attribute-certificate-viewer.d.ts +11 -0
  34. package/components/peculiar-attribute-certificate-viewer.js +11 -0
  35. package/components/peculiar-attribute-certificate-viewer.js.map +1 -0
  36. package/components/peculiar-button-menu.d.ts +11 -0
  37. package/components/peculiar-button-menu.js +11 -0
  38. package/components/peculiar-button-menu.js.map +1 -0
  39. package/components/peculiar-certificate-decoder.d.ts +11 -0
  40. package/components/peculiar-certificate-decoder.js +234 -0
  41. package/components/peculiar-certificate-decoder.js.map +1 -0
  42. package/components/peculiar-certificate-viewer.d.ts +11 -0
  43. package/components/peculiar-certificate-viewer.js +11 -0
  44. package/components/peculiar-certificate-viewer.js.map +1 -0
  45. package/components/peculiar-certificates-viewer.d.ts +11 -0
  46. package/components/peculiar-certificates-viewer.js +382 -0
  47. package/components/peculiar-certificates-viewer.js.map +1 -0
  48. package/components/peculiar-circular-progress.d.ts +11 -0
  49. package/components/peculiar-circular-progress.js +11 -0
  50. package/components/peculiar-circular-progress.js.map +1 -0
  51. package/components/peculiar-crl-viewer.d.ts +11 -0
  52. package/components/peculiar-crl-viewer.js +11 -0
  53. package/components/peculiar-crl-viewer.js.map +1 -0
  54. package/components/peculiar-csr-viewer.d.ts +11 -0
  55. package/components/peculiar-csr-viewer.js +11 -0
  56. package/components/peculiar-csr-viewer.js.map +1 -0
  57. package/components/peculiar-highlight-words.d.ts +11 -0
  58. package/components/peculiar-highlight-words.js +11 -0
  59. package/components/peculiar-highlight-words.js.map +1 -0
  60. package/components/peculiar-text-hider.d.ts +11 -0
  61. package/components/peculiar-text-hider.js +42 -0
  62. package/components/peculiar-text-hider.js.map +1 -0
  63. package/components/subject_name.js +71 -0
  64. package/components/subject_name.js.map +1 -0
  65. package/dist/cjs/arrow_top-834fb7ec.js +37 -0
  66. package/dist/cjs/arrow_top-834fb7ec.js.map +1 -0
  67. package/dist/cjs/button-14e2b73f.js +77 -0
  68. package/dist/cjs/button-14e2b73f.js.map +1 -0
  69. package/dist/cjs/{certification_request-d5c6e32d.js → certification_request-c0cafa72.js} +236 -71
  70. package/dist/cjs/certification_request-c0cafa72.js.map +1 -0
  71. package/dist/cjs/{crl-5bce64c4.js → crl-b4322166.js} +8 -7
  72. package/dist/cjs/crl-b4322166.js.map +1 -0
  73. package/dist/cjs/download-254ddc57.js +23 -0
  74. package/dist/cjs/download-254ddc57.js.map +1 -0
  75. package/dist/cjs/{download-93f7b773.js → download-972dda8a.js} +2 -0
  76. package/dist/cjs/download-972dda8a.js.map +1 -0
  77. package/dist/cjs/index-efd561e9.js +2477 -0
  78. package/dist/cjs/index-efd561e9.js.map +1 -0
  79. package/dist/cjs/index.cjs.js +3 -1
  80. package/dist/cjs/index.cjs.js.map +1 -0
  81. package/dist/cjs/loader.cjs.js +6 -12
  82. package/dist/cjs/loader.cjs.js.map +1 -0
  83. package/dist/cjs/{miscellaneous-cac1cd8b.js → miscellaneous-806a04a5.js} +86 -70
  84. package/dist/cjs/miscellaneous-806a04a5.js.map +1 -0
  85. package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +92 -35
  86. package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js.map +1 -0
  87. package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +110 -0
  88. package/dist/cjs/peculiar-button-menu_3.cjs.entry.js.map +1 -0
  89. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +30 -19
  90. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -0
  91. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +34 -11
  92. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +1 -0
  93. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +183 -85
  94. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -0
  95. package/dist/cjs/peculiar-text-hider.cjs.entry.js +7 -13
  96. package/dist/cjs/peculiar-text-hider.cjs.entry.js.map +1 -0
  97. package/dist/cjs/peculiar.cjs.js +10 -57
  98. package/dist/cjs/peculiar.cjs.js.map +1 -0
  99. package/dist/cjs/{x509_certificate-3760e0a8.js → x509_certificate-989b1435.js} +5 -4
  100. package/dist/cjs/x509_certificate-989b1435.js.map +1 -0
  101. package/dist/collection/collection-manifest.json +12 -16
  102. package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +189 -145
  103. package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js.map +1 -0
  104. package/dist/collection/components/button/button.js +14 -126
  105. package/dist/collection/components/button/button.js.map +1 -0
  106. package/dist/collection/components/button/index.js +5 -0
  107. package/dist/collection/components/button/index.js.map +1 -0
  108. package/dist/collection/components/button-menu/button-menu.css +46 -0
  109. package/dist/collection/components/button-menu/button-menu.js +78 -0
  110. package/dist/collection/components/button-menu/button-menu.js.map +1 -0
  111. package/dist/collection/components/certificate-decoder/certificate-decoder.css +456 -44
  112. package/dist/collection/components/certificate-decoder/certificate-decoder.js +109 -101
  113. package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -0
  114. package/dist/collection/components/certificate-details-parts/attributes/activity_description_attribute.js +6 -11
  115. package/dist/collection/components/certificate-details-parts/attributes/activity_description_attribute.js.map +1 -0
  116. package/dist/collection/components/certificate-details-parts/attributes/as_string_attribute.js +5 -5
  117. package/dist/collection/components/certificate-details-parts/attributes/as_string_attribute.js.map +1 -0
  118. package/dist/collection/components/certificate-details-parts/attributes/basic_attribute.js +5 -6
  119. package/dist/collection/components/certificate-details-parts/attributes/basic_attribute.js.map +1 -0
  120. package/dist/collection/components/certificate-details-parts/attributes/challenge_password_attribute.js +5 -5
  121. package/dist/collection/components/certificate-details-parts/attributes/challenge_password_attribute.js.map +1 -0
  122. package/dist/collection/components/certificate-details-parts/attributes/index.js +16 -15
  123. package/dist/collection/components/certificate-details-parts/attributes/index.js.map +1 -0
  124. package/dist/collection/components/certificate-details-parts/attributes/insurance_value_attribute.js +5 -5
  125. package/dist/collection/components/certificate-details-parts/attributes/insurance_value_attribute.js.map +1 -0
  126. package/dist/collection/components/certificate-details-parts/attributes/name_attribute.js +5 -5
  127. package/dist/collection/components/certificate-details-parts/attributes/name_attribute.js.map +1 -0
  128. package/dist/collection/components/certificate-details-parts/attributes/name_part.js +4 -3
  129. package/dist/collection/components/certificate-details-parts/attributes/name_part.js.map +1 -0
  130. package/dist/collection/components/certificate-details-parts/attributes/type_relationship_attribute.js +5 -4
  131. package/dist/collection/components/certificate-details-parts/attributes/type_relationship_attribute.js.map +1 -0
  132. package/dist/collection/components/certificate-details-parts/attributes/unstructured_name_attribute.js +5 -5
  133. package/dist/collection/components/certificate-details-parts/attributes/unstructured_name_attribute.js.map +1 -0
  134. package/dist/collection/components/certificate-details-parts/attributes/valuation_ranking_attribute.js +5 -5
  135. package/dist/collection/components/certificate-details-parts/attributes/valuation_ranking_attribute.js.map +1 -0
  136. package/dist/collection/components/certificate-details-parts/attributes/web_gdpr_attribute.js +6 -13
  137. package/dist/collection/components/certificate-details-parts/attributes/web_gdpr_attribute.js.map +1 -0
  138. package/dist/collection/components/certificate-details-parts/basic_information.js +4 -3
  139. package/dist/collection/components/certificate-details-parts/basic_information.js.map +1 -0
  140. package/dist/collection/components/certificate-details-parts/extensions/archive_rev_info_extension.js +5 -5
  141. package/dist/collection/components/certificate-details-parts/extensions/archive_rev_info_extension.js.map +1 -0
  142. package/dist/collection/components/certificate-details-parts/extensions/as_string_extension.js +5 -5
  143. package/dist/collection/components/certificate-details-parts/extensions/as_string_extension.js.map +1 -0
  144. package/dist/collection/components/certificate-details-parts/extensions/attribute_value.js +2 -1
  145. package/dist/collection/components/certificate-details-parts/extensions/attribute_value.js.map +1 -0
  146. package/dist/collection/components/certificate-details-parts/extensions/authority_key_identifier_extension.js +10 -15
  147. package/dist/collection/components/certificate-details-parts/extensions/authority_key_identifier_extension.js.map +1 -0
  148. package/dist/collection/components/certificate-details-parts/extensions/basic_constraints_extension.js +6 -7
  149. package/dist/collection/components/certificate-details-parts/extensions/basic_constraints_extension.js.map +1 -0
  150. package/dist/collection/components/certificate-details-parts/extensions/basic_extension.js +5 -6
  151. package/dist/collection/components/certificate-details-parts/extensions/basic_extension.js.map +1 -0
  152. package/dist/collection/components/certificate-details-parts/extensions/biometric_syntax_extension.js +8 -12
  153. package/dist/collection/components/certificate-details-parts/extensions/biometric_syntax_extension.js.map +1 -0
  154. package/dist/collection/components/certificate-details-parts/extensions/ca_version_extension.js +5 -6
  155. package/dist/collection/components/certificate-details-parts/extensions/ca_version_extension.js.map +1 -0
  156. package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js +26 -27
  157. package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js.map +1 -0
  158. package/dist/collection/components/certificate-details-parts/extensions/certificate_template_extension.js +5 -7
  159. package/dist/collection/components/certificate-details-parts/extensions/certificate_template_extension.js.map +1 -0
  160. package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js +8 -13
  161. package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js.map +1 -0
  162. package/dist/collection/components/certificate-details-parts/extensions/crl_distribution_points_extension.js +4 -3
  163. package/dist/collection/components/certificate-details-parts/extensions/crl_distribution_points_extension.js.map +1 -0
  164. package/dist/collection/components/certificate-details-parts/extensions/crl_number_extension.js +6 -6
  165. package/dist/collection/components/certificate-details-parts/extensions/crl_number_extension.js.map +1 -0
  166. package/dist/collection/components/certificate-details-parts/extensions/crl_reason_extension.js +5 -5
  167. package/dist/collection/components/certificate-details-parts/extensions/crl_reason_extension.js.map +1 -0
  168. package/dist/collection/components/certificate-details-parts/extensions/enroll_cert_type_extension.js +5 -5
  169. package/dist/collection/components/certificate-details-parts/extensions/enroll_cert_type_extension.js.map +1 -0
  170. package/dist/collection/components/certificate-details-parts/extensions/entrust_version_info_extension.js +5 -6
  171. package/dist/collection/components/certificate-details-parts/extensions/entrust_version_info_extension.js.map +1 -0
  172. package/dist/collection/components/certificate-details-parts/extensions/extended_key_usage_extension.js +7 -7
  173. package/dist/collection/components/certificate-details-parts/extensions/extended_key_usage_extension.js.map +1 -0
  174. package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js +7 -6
  175. package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js.map +1 -0
  176. package/dist/collection/components/certificate-details-parts/extensions/index.js +46 -45
  177. package/dist/collection/components/certificate-details-parts/extensions/index.js.map +1 -0
  178. package/dist/collection/components/certificate-details-parts/extensions/info_access_syntax_extension.js +8 -9
  179. package/dist/collection/components/certificate-details-parts/extensions/info_access_syntax_extension.js.map +1 -0
  180. package/dist/collection/components/certificate-details-parts/extensions/issuing_distribution_point_extension.js +7 -11
  181. package/dist/collection/components/certificate-details-parts/extensions/issuing_distribution_point_extension.js.map +1 -0
  182. package/dist/collection/components/certificate-details-parts/extensions/key_usage_extension.js +5 -5
  183. package/dist/collection/components/certificate-details-parts/extensions/key_usage_extension.js.map +1 -0
  184. package/dist/collection/components/certificate-details-parts/extensions/lei_extension.js +5 -5
  185. package/dist/collection/components/certificate-details-parts/extensions/lei_extension.js.map +1 -0
  186. package/dist/collection/components/certificate-details-parts/extensions/lei_role_extennsion.js +5 -5
  187. package/dist/collection/components/certificate-details-parts/extensions/lei_role_extennsion.js.map +1 -0
  188. package/dist/collection/components/certificate-details-parts/extensions/logotype_extension.js +8 -11
  189. package/dist/collection/components/certificate-details-parts/extensions/logotype_extension.js.map +1 -0
  190. package/dist/collection/components/certificate-details-parts/extensions/name_constraints_extension.js +4 -3
  191. package/dist/collection/components/certificate-details-parts/extensions/name_constraints_extension.js.map +1 -0
  192. package/dist/collection/components/certificate-details-parts/extensions/netscape_cert_type_extension.js +5 -5
  193. package/dist/collection/components/certificate-details-parts/extensions/netscape_cert_type_extension.js.map +1 -0
  194. package/dist/collection/components/certificate-details-parts/extensions/netscape_comment_extension.js +5 -5
  195. package/dist/collection/components/certificate-details-parts/extensions/netscape_comment_extension.js.map +1 -0
  196. package/dist/collection/components/certificate-details-parts/extensions/policy_constraints_extension.js +6 -7
  197. package/dist/collection/components/certificate-details-parts/extensions/policy_constraints_extension.js.map +1 -0
  198. package/dist/collection/components/certificate-details-parts/extensions/policy_mappings_extension.js +5 -4
  199. package/dist/collection/components/certificate-details-parts/extensions/policy_mappings_extension.js.map +1 -0
  200. package/dist/collection/components/certificate-details-parts/extensions/private_key_usage_period_extension.js +6 -7
  201. package/dist/collection/components/certificate-details-parts/extensions/private_key_usage_period_extension.js.map +1 -0
  202. package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js +13 -16
  203. package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js.map +1 -0
  204. package/dist/collection/components/certificate-details-parts/extensions/subject_alternative_name_extension.js +4 -3
  205. package/dist/collection/components/certificate-details-parts/extensions/subject_alternative_name_extension.js.map +1 -0
  206. package/dist/collection/components/certificate-details-parts/extensions/subject_directory_attributes_extension.js +8 -9
  207. package/dist/collection/components/certificate-details-parts/extensions/subject_directory_attributes_extension.js.map +1 -0
  208. package/dist/collection/components/certificate-details-parts/extensions/subject_key_identifier_extension.js +10 -15
  209. package/dist/collection/components/certificate-details-parts/extensions/subject_key_identifier_extension.js.map +1 -0
  210. package/dist/collection/components/certificate-details-parts/extensions/timestamp_extension.js +7 -9
  211. package/dist/collection/components/certificate-details-parts/extensions/timestamp_extension.js.map +1 -0
  212. package/dist/collection/components/certificate-details-parts/extensions/tn_auth_list_extension.js +4 -3
  213. package/dist/collection/components/certificate-details-parts/extensions/tn_auth_list_extension.js.map +1 -0
  214. package/dist/collection/components/certificate-details-parts/holder.js +8 -11
  215. package/dist/collection/components/certificate-details-parts/holder.js.map +1 -0
  216. package/dist/collection/components/certificate-details-parts/index.js +1 -0
  217. package/dist/collection/components/certificate-details-parts/index.js.map +1 -0
  218. package/dist/collection/components/certificate-details-parts/issuer.js +5 -4
  219. package/dist/collection/components/certificate-details-parts/issuer.js.map +1 -0
  220. package/dist/collection/components/certificate-details-parts/issuer_name.js +6 -4
  221. package/dist/collection/components/certificate-details-parts/issuer_name.js.map +1 -0
  222. package/dist/collection/components/certificate-details-parts/miscellaneous.js +8 -13
  223. package/dist/collection/components/certificate-details-parts/miscellaneous.js.map +1 -0
  224. package/dist/collection/components/certificate-details-parts/public_key.js +8 -7
  225. package/dist/collection/components/certificate-details-parts/public_key.js.map +1 -0
  226. package/dist/collection/components/certificate-details-parts/revoked_certificates.js +9 -11
  227. package/dist/collection/components/certificate-details-parts/revoked_certificates.js.map +1 -0
  228. package/dist/collection/components/certificate-details-parts/row.js +13 -18
  229. package/dist/collection/components/certificate-details-parts/row.js.map +1 -0
  230. package/dist/collection/components/certificate-details-parts/signature.js +5 -4
  231. package/dist/collection/components/certificate-details-parts/signature.js.map +1 -0
  232. package/dist/collection/components/certificate-details-parts/subject_name.js +4 -3
  233. package/dist/collection/components/certificate-details-parts/subject_name.js.map +1 -0
  234. package/dist/collection/components/certificate-details-parts/thumbprints.js +4 -3
  235. package/dist/collection/components/certificate-details-parts/thumbprints.js.map +1 -0
  236. package/dist/collection/components/certificate-summary/certificate-summary.js +9 -77
  237. package/dist/collection/components/certificate-summary/certificate-summary.js.map +1 -0
  238. package/dist/collection/components/certificate-summary/index.js +5 -0
  239. package/dist/collection/components/certificate-summary/index.js.map +1 -0
  240. package/dist/collection/components/certificate-viewer/certificate-viewer.css +471 -104
  241. package/dist/collection/components/certificate-viewer/certificate-viewer.js +206 -178
  242. package/dist/collection/components/certificate-viewer/certificate-viewer.js.map +1 -0
  243. package/dist/collection/components/certificates-viewer/certificates-viewer.css +540 -267
  244. package/dist/collection/components/certificates-viewer/certificates-viewer.js +261 -266
  245. package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -0
  246. package/dist/collection/components/circular-progress/circular-progress.css +2 -11
  247. package/dist/collection/components/circular-progress/circular-progress.js +60 -63
  248. package/dist/collection/components/circular-progress/circular-progress.js.map +1 -0
  249. package/dist/collection/components/crl-viewer/crl-viewer.js +166 -139
  250. package/dist/collection/components/crl-viewer/crl-viewer.js.map +1 -0
  251. package/dist/collection/components/csr-viewer/csr-viewer.js +149 -124
  252. package/dist/collection/components/csr-viewer/csr-viewer.js.map +1 -0
  253. package/dist/collection/components/highlight-words/highlight-words.css +1 -9
  254. package/dist/collection/components/highlight-words/highlight-words.js +35 -28
  255. package/dist/collection/components/highlight-words/highlight-words.js.map +1 -0
  256. package/dist/collection/components/icons/actions.js +16 -0
  257. package/dist/collection/components/icons/actions.js.map +1 -0
  258. package/dist/collection/components/icons/arrow_bottom.js +16 -0
  259. package/dist/collection/components/icons/arrow_bottom.js.map +1 -0
  260. package/dist/collection/components/icons/arrow_top.js +16 -0
  261. package/dist/collection/components/icons/arrow_top.js.map +1 -0
  262. package/dist/collection/components/icons/cross.js +16 -0
  263. package/dist/collection/components/icons/cross.js.map +1 -0
  264. package/dist/collection/components/icons/details.js +16 -0
  265. package/dist/collection/components/icons/details.js.map +1 -0
  266. package/dist/collection/components/icons/download.js +16 -0
  267. package/dist/collection/components/icons/download.js.map +1 -0
  268. package/dist/collection/components/icons/index.js +11 -0
  269. package/dist/collection/components/icons/index.js.map +1 -0
  270. package/dist/collection/components/icons/link.js +16 -0
  271. package/dist/collection/components/icons/link.js.map +1 -0
  272. package/dist/collection/components/link/index.js +5 -0
  273. package/dist/collection/components/link/index.js.map +1 -0
  274. package/dist/collection/components/link/link.js +9 -61
  275. package/dist/collection/components/link/link.js.map +1 -0
  276. package/dist/collection/components/text-hider/text-hider.css +9 -36
  277. package/dist/collection/components/text-hider/text-hider.js +21 -68
  278. package/dist/collection/components/text-hider/text-hider.js.map +1 -0
  279. package/dist/collection/components/typography/index.js +5 -0
  280. package/dist/collection/components/typography/index.js.map +1 -0
  281. package/dist/collection/components/typography/typography.js +39 -126
  282. package/dist/collection/components/typography/typography.js.map +1 -0
  283. package/dist/collection/constants/logs.js +1 -0
  284. package/dist/collection/constants/logs.js.map +1 -0
  285. package/dist/collection/constants/oids.js +1 -0
  286. package/dist/collection/constants/oids.js.map +1 -0
  287. package/dist/collection/crypto/asn_data.js +13 -7
  288. package/dist/collection/crypto/asn_data.js.map +1 -0
  289. package/dist/collection/crypto/attribute.js +11 -10
  290. package/dist/collection/crypto/attribute.js.map +1 -0
  291. package/dist/collection/crypto/crl.js +9 -8
  292. package/dist/collection/crypto/crl.js.map +1 -0
  293. package/dist/collection/crypto/csr.js +11 -10
  294. package/dist/collection/crypto/csr.js.map +1 -0
  295. package/dist/collection/crypto/extension.js +16 -15
  296. package/dist/collection/crypto/extension.js.map +1 -0
  297. package/dist/collection/crypto/index.js +1 -0
  298. package/dist/collection/crypto/index.js.map +1 -0
  299. package/dist/collection/crypto/name.js +15 -9
  300. package/dist/collection/crypto/name.js.map +1 -0
  301. package/dist/collection/crypto/provider.js +4 -3
  302. package/dist/collection/crypto/provider.js.map +1 -0
  303. package/dist/collection/crypto/utils.js +4 -3
  304. package/dist/collection/crypto/utils.js.map +1 -0
  305. package/dist/collection/crypto/x509_attribute_certificate.js +9 -8
  306. package/dist/collection/crypto/x509_attribute_certificate.js.map +1 -0
  307. package/dist/collection/crypto/x509_certificate.js +12 -11
  308. package/dist/collection/crypto/x509_certificate.js.map +1 -0
  309. package/dist/collection/index.js +1 -0
  310. package/dist/collection/index.js.map +1 -0
  311. package/dist/collection/locales/en.json +4 -3
  312. package/dist/collection/utils/date_formatter.js +3 -2
  313. package/dist/collection/utils/date_formatter.js.map +1 -0
  314. package/dist/collection/utils/download.js +3 -2
  315. package/dist/collection/utils/download.js.map +1 -0
  316. package/dist/collection/utils/download_from_buffer.js +1 -0
  317. package/dist/collection/utils/download_from_buffer.js.map +1 -0
  318. package/dist/collection/utils/get_string_by_oid.js +2 -1
  319. package/dist/collection/utils/get_string_by_oid.js.map +1 -0
  320. package/dist/collection/utils/index.js +2 -1
  321. package/dist/collection/utils/index.js.map +1 -0
  322. package/dist/collection/utils/is_link.js +1 -0
  323. package/dist/collection/utils/is_link.js.map +1 -0
  324. package/dist/collection/utils/l10n.js +2 -1
  325. package/dist/collection/utils/l10n.js.map +1 -0
  326. package/dist/collection/utils/read_file.js +1 -0
  327. package/dist/collection/utils/read_file.js.map +1 -0
  328. package/dist/collection/utils/third_party_links.js +1 -0
  329. package/dist/collection/utils/third_party_links.js.map +1 -0
  330. package/dist/collection/utils/validator.js +1 -0
  331. package/dist/collection/utils/validator.js.map +1 -0
  332. package/dist/collection/www-copy/index.js +138 -32
  333. package/dist/esm/arrow_top-efd3a56d.js +34 -0
  334. package/dist/esm/arrow_top-efd3a56d.js.map +1 -0
  335. package/dist/esm/button-35146bdd.js +74 -0
  336. package/dist/esm/button-35146bdd.js.map +1 -0
  337. package/dist/esm/{certification_request-23cd5124.js → certification_request-5cadde9f.js} +171 -9
  338. package/dist/esm/certification_request-5cadde9f.js.map +1 -0
  339. package/dist/esm/{crl-7f23c111.js → crl-11670c3e.js} +7 -6
  340. package/dist/esm/crl-11670c3e.js.map +1 -0
  341. package/dist/esm/download-0cc3077a.js +21 -0
  342. package/dist/esm/download-0cc3077a.js.map +1 -0
  343. package/dist/esm/download-57c5bf8f.js +470 -0
  344. package/dist/esm/download-57c5bf8f.js.map +1 -0
  345. package/dist/esm/index-4079bbb5.js +2448 -0
  346. package/dist/esm/index-4079bbb5.js.map +1 -0
  347. package/dist/esm/index.js +3 -1
  348. package/dist/esm/index.js.map +1 -0
  349. package/dist/esm/loader.js +6 -12
  350. package/dist/esm/loader.js.map +1 -0
  351. package/dist/esm/{miscellaneous-c7c0d04a.js → miscellaneous-1d4e8b41.js} +53 -37
  352. package/dist/esm/miscellaneous-1d4e8b41.js.map +1 -0
  353. package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +80 -23
  354. package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -0
  355. package/dist/esm/peculiar-button-menu_3.entry.js +104 -0
  356. package/dist/esm/peculiar-button-menu_3.entry.js.map +1 -0
  357. package/dist/esm/peculiar-certificate-decoder.entry.js +30 -19
  358. package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -0
  359. package/dist/esm/peculiar-certificate-viewer.entry.js +34 -11
  360. package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -0
  361. package/dist/esm/peculiar-certificates-viewer.entry.js +183 -85
  362. package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -0
  363. package/dist/esm/peculiar-text-hider.entry.js +7 -13
  364. package/dist/esm/peculiar-text-hider.entry.js.map +1 -0
  365. package/dist/esm/peculiar.js +8 -58
  366. package/dist/esm/peculiar.js.map +1 -0
  367. package/dist/esm/{x509_certificate-d8e0af2d.js → x509_certificate-dfae6999.js} +4 -3
  368. package/dist/esm/x509_certificate-dfae6999.js.map +1 -0
  369. package/dist/esm-es5/arrow_top-efd3a56d.js +19 -0
  370. package/dist/esm-es5/arrow_top-efd3a56d.js.map +1 -0
  371. package/dist/esm-es5/button-35146bdd.js +19 -0
  372. package/dist/esm-es5/button-35146bdd.js.map +1 -0
  373. package/dist/esm-es5/certification_request-5cadde9f.js +97 -0
  374. package/dist/esm-es5/certification_request-5cadde9f.js.map +1 -0
  375. package/dist/esm-es5/crl-11670c3e.js +33 -0
  376. package/dist/esm-es5/crl-11670c3e.js.map +1 -0
  377. package/dist/esm-es5/download-0cc3077a.js +12 -0
  378. package/dist/esm-es5/download-0cc3077a.js.map +1 -0
  379. package/dist/esm-es5/download-57c5bf8f.js +19 -0
  380. package/dist/esm-es5/download-57c5bf8f.js.map +1 -0
  381. package/dist/esm-es5/index-4079bbb5.js +6 -0
  382. package/dist/esm-es5/index-4079bbb5.js.map +1 -0
  383. package/dist/esm-es5/index.js +5 -0
  384. package/dist/esm-es5/index.js.map +1 -0
  385. package/dist/esm-es5/loader.js +5 -0
  386. package/dist/esm-es5/loader.js.map +1 -0
  387. package/dist/esm-es5/miscellaneous-1d4e8b41.js +355 -0
  388. package/dist/esm-es5/miscellaneous-1d4e8b41.js.map +1 -0
  389. package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +110 -0
  390. package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -0
  391. package/dist/esm-es5/peculiar-button-menu_3.entry.js +12 -0
  392. package/dist/esm-es5/peculiar-button-menu_3.entry.js.map +1 -0
  393. package/dist/esm-es5/peculiar-certificate-decoder.entry.js +12 -0
  394. package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -0
  395. package/dist/esm-es5/peculiar-certificate-viewer.entry.js +5 -0
  396. package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -0
  397. package/dist/esm-es5/peculiar-certificates-viewer.entry.js +33 -0
  398. package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -0
  399. package/dist/esm-es5/peculiar-text-hider.entry.js +5 -0
  400. package/dist/esm-es5/peculiar-text-hider.entry.js.map +1 -0
  401. package/dist/esm-es5/peculiar.js +5 -0
  402. package/dist/esm-es5/peculiar.js.map +1 -0
  403. package/dist/esm-es5/x509_certificate-dfae6999.js +12 -0
  404. package/dist/esm-es5/x509_certificate-dfae6999.js.map +1 -0
  405. package/dist/index.js +1 -1
  406. package/dist/peculiar/index.esm.js +2 -1
  407. package/dist/peculiar/index.esm.js.map +1 -0
  408. package/dist/peculiar/locales/en.json +4 -3
  409. package/dist/peculiar/p-0b356bb5.js +6 -0
  410. package/dist/peculiar/p-0b356bb5.js.map +1 -0
  411. package/dist/peculiar/p-0bdcdbf7.system.js +355 -0
  412. package/dist/peculiar/p-0bdcdbf7.system.js.map +1 -0
  413. package/dist/peculiar/p-17e3c47b.js +12 -0
  414. package/dist/peculiar/p-17e3c47b.js.map +1 -0
  415. package/dist/peculiar/p-23555789.system.entry.js +34 -0
  416. package/dist/peculiar/p-23555789.system.entry.js.map +1 -0
  417. package/dist/peculiar/p-26981468.system.entry.js +5 -0
  418. package/dist/peculiar/p-26981468.system.entry.js.map +1 -0
  419. package/dist/peculiar/p-2fcad8cb.system.js +20 -0
  420. package/dist/peculiar/p-2fcad8cb.system.js.map +1 -0
  421. package/dist/peculiar/p-31586b23.system.js +13 -0
  422. package/dist/peculiar/p-31586b23.system.js.map +1 -0
  423. package/dist/peculiar/p-43eb3721.js +33 -0
  424. package/dist/peculiar/p-43eb3721.js.map +1 -0
  425. package/dist/peculiar/p-5823e6e8.entry.js +12 -0
  426. package/dist/peculiar/p-5823e6e8.entry.js.map +1 -0
  427. package/dist/peculiar/p-596836a7.entry.js +33 -0
  428. package/dist/peculiar/p-596836a7.entry.js.map +1 -0
  429. package/dist/peculiar/p-5aabeba7.system.js +6 -0
  430. package/dist/peculiar/p-5aabeba7.system.js.map +1 -0
  431. package/dist/peculiar/p-6667fe6e.system.js +34 -0
  432. package/dist/peculiar/p-6667fe6e.system.js.map +1 -0
  433. package/dist/peculiar/p-6e79b9c8.js +12 -0
  434. package/dist/peculiar/p-6e79b9c8.js.map +1 -0
  435. package/dist/peculiar/p-709994c1.js +19 -0
  436. package/dist/peculiar/p-709994c1.js.map +1 -0
  437. package/dist/peculiar/p-74c241e7.js +97 -0
  438. package/dist/peculiar/p-74c241e7.js.map +1 -0
  439. package/dist/peculiar/p-7ed7cd97.system.entry.js +111 -0
  440. package/dist/peculiar/p-7ed7cd97.system.entry.js.map +1 -0
  441. package/dist/peculiar/p-7f9beaa8.js +19 -0
  442. package/dist/peculiar/p-7f9beaa8.js.map +1 -0
  443. package/dist/peculiar/p-80832207.system.js +5 -0
  444. package/dist/peculiar/p-80832207.system.js.map +1 -0
  445. package/dist/peculiar/p-8748391f.system.entry.js +5 -0
  446. package/dist/peculiar/p-8748391f.system.entry.js.map +1 -0
  447. package/dist/peculiar/p-882e1281.entry.js +12 -0
  448. package/dist/peculiar/p-882e1281.entry.js.map +1 -0
  449. package/dist/peculiar/p-90459cec.entry.js +5 -0
  450. package/dist/peculiar/p-90459cec.entry.js.map +1 -0
  451. package/dist/peculiar/p-97688065.js +355 -0
  452. package/dist/peculiar/p-97688065.js.map +1 -0
  453. package/dist/peculiar/p-a053c132.js +19 -0
  454. package/dist/peculiar/p-a053c132.js.map +1 -0
  455. package/dist/peculiar/p-ae9189f6.system.js +19 -0
  456. package/dist/peculiar/p-ae9189f6.system.js.map +1 -0
  457. package/dist/peculiar/p-bd485115.system.entry.js +13 -0
  458. package/dist/peculiar/p-bd485115.system.entry.js.map +1 -0
  459. package/dist/peculiar/p-c0a298fd.system.js +97 -0
  460. package/dist/peculiar/p-c0a298fd.system.js.map +1 -0
  461. package/dist/peculiar/p-daf23673.system.js +20 -0
  462. package/dist/peculiar/p-daf23673.system.js.map +1 -0
  463. package/dist/peculiar/p-e1960173.system.js +5 -0
  464. package/dist/peculiar/p-e1960173.system.js.map +1 -0
  465. package/dist/peculiar/p-e39de121.system.entry.js +13 -0
  466. package/dist/peculiar/p-e39de121.system.entry.js.map +1 -0
  467. package/dist/peculiar/p-e6a3b4d4.system.js +13 -0
  468. package/dist/peculiar/p-e6a3b4d4.system.js.map +1 -0
  469. package/dist/peculiar/p-f3d85a5f.entry.js +110 -0
  470. package/dist/peculiar/p-f3d85a5f.entry.js.map +1 -0
  471. package/dist/peculiar/p-fd4b9a50.entry.js +5 -0
  472. package/dist/peculiar/p-fd4b9a50.entry.js.map +1 -0
  473. package/dist/peculiar/peculiar.css +1 -1
  474. package/dist/peculiar/peculiar.esm.js +2 -1
  475. package/dist/peculiar/peculiar.esm.js.map +1 -0
  476. package/dist/peculiar/peculiar.js +127 -0
  477. package/dist/types/components/attribute-certificate-viewer/attribute-certificate-viewer.d.ts +15 -3
  478. package/dist/types/components/button/button.d.ts +5 -16
  479. package/dist/types/components/button/index.d.ts +2 -0
  480. package/dist/types/components/button-menu/button-menu.d.ts +21 -0
  481. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +9 -6
  482. package/dist/types/components/certificate-details-parts/miscellaneous.d.ts +1 -1
  483. package/dist/types/components/certificate-summary/certificate-summary.d.ts +4 -3
  484. package/dist/types/components/certificate-summary/index.d.ts +1 -0
  485. package/dist/types/components/certificate-viewer/certificate-viewer.d.ts +13 -5
  486. package/dist/types/components/certificates-viewer/certificates-viewer.d.ts +22 -11
  487. package/dist/types/components/crl-viewer/crl-viewer.d.ts +13 -5
  488. package/dist/types/components/csr-viewer/csr-viewer.d.ts +13 -5
  489. package/dist/types/components/icons/actions.d.ts +12 -0
  490. package/dist/types/components/icons/arrow_bottom.d.ts +12 -0
  491. package/dist/types/components/icons/arrow_top.d.ts +12 -0
  492. package/dist/types/components/icons/cross.d.ts +12 -0
  493. package/dist/types/components/icons/details.d.ts +12 -0
  494. package/dist/types/components/icons/download.d.ts +12 -0
  495. package/dist/types/components/icons/index.d.ts +7 -0
  496. package/dist/types/components/icons/link.d.ts +12 -0
  497. package/dist/types/components/link/index.d.ts +1 -0
  498. package/dist/types/components/link/link.d.ts +6 -6
  499. package/dist/types/components/text-hider/text-hider.d.ts +0 -3
  500. package/dist/types/components/typography/index.d.ts +1 -0
  501. package/dist/types/components/typography/typography.d.ts +10 -20
  502. package/dist/types/components.d.ts +74 -175
  503. package/dist/types/crypto/attribute.d.ts +1 -1
  504. package/dist/types/crypto/extension.d.ts +1 -1
  505. package/dist/types/interface.d.ts +98 -6
  506. package/dist/types/stencil-public-runtime.d.ts +110 -23
  507. package/dist/types/utils/l10n.d.ts +5 -4
  508. package/dist/types/utils/read_file.d.ts +1 -1
  509. package/hydrate/index.d.ts +218 -0
  510. package/hydrate/index.js +22549 -0
  511. package/hydrate/package.json +6 -0
  512. package/loader/index.d.ts +10 -1
  513. package/loader/index.js +1 -1
  514. package/loader/package.json +1 -0
  515. package/package.json +6 -4
  516. package/dist/cjs/dom-f57e260e.js +0 -78
  517. package/dist/cjs/index-064e95c7.js +0 -1486
  518. package/dist/cjs/l10n-ddc7cff9.js +0 -169
  519. package/dist/cjs/peculiar-button-split_4.cjs.entry.js +0 -128
  520. package/dist/cjs/peculiar-button.cjs.entry.js +0 -40
  521. package/dist/cjs/peculiar-link.cjs.entry.js +0 -29
  522. package/dist/cjs/peculiar-typography.cjs.entry.js +0 -38
  523. package/dist/collection/components/button/button.css +0 -81
  524. package/dist/collection/components/button-split/button-split.css +0 -57
  525. package/dist/collection/components/button-split/button-split.js +0 -116
  526. package/dist/collection/components/certificate-summary/certificate-summary.css +0 -49
  527. package/dist/collection/components/link/link.css +0 -59
  528. package/dist/collection/components/typography/typography.css +0 -95
  529. package/dist/esm/dom-f1b08a97.js +0 -76
  530. package/dist/esm/index-bbd484d9.js +0 -1455
  531. package/dist/esm/l10n-d48f35ff.js +0 -165
  532. package/dist/esm/peculiar-button-split_4.entry.js +0 -121
  533. package/dist/esm/peculiar-button.entry.js +0 -36
  534. package/dist/esm/peculiar-link.entry.js +0 -25
  535. package/dist/esm/peculiar-typography.entry.js +0 -34
  536. package/dist/esm/polyfills/css-shim.js +0 -1
  537. package/dist/peculiar/p-01cea5c0.entry.js +0 -11
  538. package/dist/peculiar/p-3bfefa4a.entry.js +0 -18
  539. package/dist/peculiar/p-4e8169cb.entry.js +0 -4
  540. package/dist/peculiar/p-57b89412.entry.js +0 -4
  541. package/dist/peculiar/p-5b4eed12.entry.js +0 -4
  542. package/dist/peculiar/p-610b85e3.entry.js +0 -4
  543. package/dist/peculiar/p-6d37c8b5.entry.js +0 -4
  544. package/dist/peculiar/p-711b4e1e.js +0 -18
  545. package/dist/peculiar/p-81a88a33.js +0 -11
  546. package/dist/peculiar/p-918aeee4.entry.js +0 -4
  547. package/dist/peculiar/p-9f4ee110.js +0 -22
  548. package/dist/peculiar/p-a050e184.js +0 -69
  549. package/dist/peculiar/p-c24c26c2.js +0 -32
  550. package/dist/peculiar/p-df53fbcc.entry.js +0 -4
  551. package/dist/peculiar/p-ec250cc4.js +0 -12
  552. package/dist/peculiar/p-f7683ba5.js +0 -5
  553. package/dist/peculiar/p-fe05f51e.js +0 -79
  554. package/dist/types/components/button-split/button-split.d.ts +0 -21
@@ -0,0 +1,104 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ import { h, r as registerInstance, H as Host, g as getElement } from './index-4079bbb5.js';
5
+ import { T as Typography, B as Button } from './button-35146bdd.js';
6
+
7
+ /**
8
+ * @license
9
+ * Copyright (c) Peculiar Ventures, LLC.
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */
14
+ const ActionsIcon = (props) => {
15
+ const { color = 'gray-10' } = props;
16
+ return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "31", fill: "none" },
17
+ h("path", { fill: `var(--pv-color-${color})`, d: "M15 13.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm14 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z" })));
18
+ };
19
+
20
+ const buttonMenuCss = ".sc-peculiar-button-menu-h{display:-ms-inline-flexbox;display:inline-flex;position:relative}.is_shown.sc-peculiar-button-menu-h .button_popover.sc-peculiar-button-menu:before{position:fixed;width:100%;height:100%;top:0;left:0;content:\"\"}.is_shown.sc-peculiar-button-menu-h .popover.sc-peculiar-button-menu{display:block}.popover.sc-peculiar-button-menu{min-width:200px;position:absolute;top:100%;right:0;border-radius:4px;z-index:1;-webkit-box-shadow:var(--pv-shadow-light-medium);box-shadow:var(--pv-shadow-light-medium);background:var(--pv-color-white);padding:var(--pv-size-base-2) 0;margin:var(--pv-size-base) 0;display:none}.button_option.sc-peculiar-button-menu{width:100%;-ms-flex-pack:start;justify-content:flex-start;border-radius:0}.group.sc-peculiar-button-menu:not(:last-child){border-bottom:1px solid var(--pv-color-gray-5);padding-bottom:var(--pv-size-base-2);margin-bottom:var(--pv-size-base)}.group_title.sc-peculiar-button-menu{line-height:var(--pv-size-base-6);padding:0 var(--pv-size-base-2)}";
21
+
22
+ const ButtonMenu = class {
23
+ constructor(hostRef) {
24
+ registerInstance(this, hostRef);
25
+ this.handleClick = () => {
26
+ this.open = !this.open;
27
+ };
28
+ this.groups = [];
29
+ this.open = false;
30
+ }
31
+ render() {
32
+ return (h(Host, { class: {
33
+ is_shown: this.open,
34
+ } }, h(Button, { class: "button_popover", onClick: this.handleClick, startIcon: h(ActionsIcon, null) }), h("div", { role: "dialog", tabIndex: -1, class: "popover", "aria-hidden": String(this.open) }, this.groups.map((group) => (h("div", { class: "group" }, h(Typography, { variant: "c2", color: "gray-9", class: "group_title" }, group.title), group.options.map((option) => (h(Button, { class: "button_option", startIcon: option.startIcon, href: option.href, onClick: (event) => {
35
+ event.stopPropagation();
36
+ this.handleClick();
37
+ if (option.onClick) {
38
+ option.onClick(event);
39
+ }
40
+ } }, option.text)))))))));
41
+ }
42
+ };
43
+ ButtonMenu.style = buttonMenuCss;
44
+
45
+ const circularProgressCss = ":host{display:block;width:100%}@-webkit-keyframes circular-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes circular-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes circular-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:100, 200;stroke-dashoffset:-15}to{stroke-dasharray:100, 200;stroke-dashoffset:-120}}@keyframes circular-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:100, 200;stroke-dashoffset:-15}to{stroke-dasharray:100, 200;stroke-dashoffset:-120}}.circle_progress{margin:0 auto}.circle_progress_svg{-webkit-animation:circular-rotate 1.4s linear infinite;animation:circular-rotate 1.4s linear infinite}.circle_progress_circle{stroke-linecap:round;-webkit-animation:circular-dash 1.4s ease-in-out infinite;animation:circular-dash 1.4s ease-in-out infinite;stroke-dasharray:80, 200;stroke-dashoffset:0;stroke:var(--pv-color-secondary)}.circle_progress_backdrop{stroke:var(--pv-color-gray-3)}";
46
+
47
+ const CircularProgress = class {
48
+ constructor(hostRef) {
49
+ registerInstance(this, hostRef);
50
+ this.box = 50;
51
+ this.size = 24;
52
+ this.width = 4;
53
+ }
54
+ render() {
55
+ return (h(Host, null, h("div", { class: "circle_progress", style: {
56
+ width: `${this.size}px`,
57
+ height: `${this.size}px`,
58
+ } }, h("svg", { class: "circle_progress_svg", viewBox: `0 0 ${this.box} ${this.box}` }, h("circle", { class: "circle_progress_backdrop", cx: this.box / 2, cy: this.box / 2, r: (this.box / 2) - 5, fill: "none", style: {
59
+ strokeWidth: `${this.width}px`,
60
+ } }), h("circle", { class: "circle_progress_circle", cx: this.box / 2, cy: this.box / 2, r: (this.box / 2) - 5, fill: "none", style: {
61
+ strokeWidth: `${this.width}px`,
62
+ } })))));
63
+ }
64
+ };
65
+ CircularProgress.style = circularProgressCss;
66
+
67
+ const highlightWordsCss = ":host{display:inline}::slotted(mark){background-color:var(--pv-color-attention-tint-4)}";
68
+
69
+ const HighlightWords = class {
70
+ constructor(hostRef) {
71
+ registerInstance(this, hostRef);
72
+ this.tag = 'mark';
73
+ this.search = undefined;
74
+ }
75
+ componentDidLoad() {
76
+ this.handleHighlightSearch();
77
+ }
78
+ componentDidUpdate() {
79
+ this.handleHighlightSearch();
80
+ }
81
+ handleHighlightSearch() {
82
+ const basicString = this.resetHighlightSearch(this.host.innerHTML);
83
+ let result = basicString;
84
+ if (this.search) {
85
+ const substring = new RegExp(`(${this.search})`, 'gi');
86
+ result = basicString.replace(substring, `<${this.tag}>$1</${this.tag}>`);
87
+ }
88
+ this.host.innerHTML = result;
89
+ }
90
+ resetHighlightSearch(source) {
91
+ // eslint-disable-next-line no-useless-escape
92
+ const substring = new RegExp(`<\/?${this.tag}>`, 'g');
93
+ return source.replace(substring, '');
94
+ }
95
+ render() {
96
+ return (h(Host, null, h("slot", null)));
97
+ }
98
+ get host() { return getElement(this); }
99
+ };
100
+ HighlightWords.style = highlightWordsCss;
101
+
102
+ export { ButtonMenu as peculiar_button_menu, CircularProgress as peculiar_circular_progress, HighlightWords as peculiar_highlight_words };
103
+
104
+ //# sourceMappingURL=peculiar-button-menu_3.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"peculiar-button-menu.peculiar-circular-progress.peculiar-highlight-words.entry.js","mappings":";;;;;;AAAA;;;;;;;AAWO,MAAM,WAAW,GAA+C,CAAC,KAAK;EAC3E,MAAM,EAAE,KAAK,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;EAEpC,QACE,WACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,IAAI,EAAC,MAAM;IAEX,YACE,IAAI,EAAE,kBAAkB,KAAK,GAAG,EAChC,CAAC,EAAC,2GAA2G,GAC7G,CACE,EACN;AACJ,CAAC;;AC3BD,MAAM,aAAa,GAAG,u/BAAu/B;;MCiChgC,UAAU;;;IAKrB,gBAAW,GAAG;MACZ,IAA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,IAAI,CAAC,MAAM,EAAE;MACf,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,CAAC,CAAC;MAEvD,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,GAAG,QAAQ,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;KAC1E;IAED,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;GAC9B;EAED,oBAAoB,CAAC,MAAc;;IAEjC,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,OAAO,IAAI,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC;IAEtD,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;GACtC;EAED,MAAM;IACJ,QACE,EAAC,IAAI,QACH,eAAQ,CACH,EACP;GACH;;;;;;;","names":[],"sources":["src/components/icons/actions.tsx","src/components/button-menu/button-menu.scss?tag=peculiar-button-menu&encapsulation=scoped","src/components/button-menu/button-menu.tsx","src/components/circular-progress/circular-progress.scss?tag=peculiar-circular-progress&encapsulation=shadow","src/components/circular-progress/circular-progress.tsx","src/components/highlight-words/highlight-words.scss?tag=peculiar-highlight-words&encapsulation=shadow","src/components/highlight-words/highlight-words.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { FunctionalComponent, h } from '@stencil/core';\nimport type { ColorType } from '../../interface';\n\nexport const ActionsIcon: FunctionalComponent<{ color?: ColorType }> = (props) => {\n const { color = 'gray-10' } = props;\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"30\"\n height=\"31\"\n fill=\"none\"\n >\n <path\n fill={`var(--pv-color-${color})`}\n d=\"M15 13.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm14 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z\"\n />\n </svg>\n );\n};\n",":host {\n display: inline-flex;\n position: relative;\n\n &.is_shown {\n .button_popover {\n &:before {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n content: '';\n }\n }\n\n .popover {\n display: block;\n }\n }\n}\n\n.popover {\n min-width: 200px;\n position: absolute;\n top: 100%;\n right: 0;\n border-radius: 4px;\n z-index: 1;\n box-shadow: var(--pv-shadow-light-medium);\n background: var(--pv-color-white);\n padding: var(--pv-size-base-2) 0;\n margin: var(--pv-size-base) 0;\n display: none;\n}\n\n.button_option {\n width: 100%;\n justify-content: flex-start;\n border-radius: 0;\n}\n\n.group {\n &:not(:last-child) {\n border-bottom: 1px solid var(--pv-color-gray-5);\n padding-bottom: var(--pv-size-base-2);\n margin-bottom: var(--pv-size-base);\n }\n}\n\n.group_title {\n line-height: var(--pv-size-base-6);\n padding: 0 var(--pv-size-base-2);\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n h,\n State,\n Prop,\n Host,\n} from '@stencil/core';\nimport { Button, ButtonProps } from '../button';\nimport { Typography } from '../typography';\nimport { ActionsIcon } from '../icons';\n\nexport interface ButtonMenuGroupOptions extends ButtonProps {\n text: string | string[];\n}\n\nexport interface ButtonMenuGroup {\n title: string | string[];\n options: ButtonMenuGroupOptions[];\n}\n\n@Component({\n tag: 'peculiar-button-menu',\n styleUrl: 'button-menu.scss',\n scoped: true,\n})\nexport class ButtonMenu {\n @Prop() groups: ButtonMenuGroup[] = [];\n\n @State() open: boolean = false;\n\n handleClick = () => {\n this.open = !this.open;\n };\n\n render() {\n return (\n <Host\n class={{\n is_shown: this.open,\n }}\n >\n <Button\n class=\"button_popover\"\n onClick={this.handleClick}\n startIcon={<ActionsIcon />}\n />\n <div\n role=\"dialog\"\n tabIndex={-1}\n class=\"popover\"\n aria-hidden={String(this.open)}\n >\n {this.groups.map((group) => (\n <div class=\"group\">\n <Typography\n variant=\"c2\"\n color=\"gray-9\"\n class=\"group_title\"\n >\n {group.title}\n </Typography>\n {group.options.map((option) => (\n <Button\n class=\"button_option\"\n startIcon={option.startIcon}\n href={option.href}\n onClick={(event) => {\n event.stopPropagation();\n\n this.handleClick();\n\n if (option.onClick) {\n option.onClick(event);\n }\n }}\n >\n {option.text}\n </Button>\n ))}\n </div>\n ))}\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: block;\n width: 100%;\n}\n\n@keyframes circular-rotate {\n to {\n transform: rotate(1turn);\n }\n}\n\n@keyframes circular-dash {\n 0% {\n stroke-dasharray: 1,200;\n stroke-dashoffset: 0;\n }\n\n 50% {\n stroke-dasharray: 100,200;\n stroke-dashoffset: -15;\n }\n\n to {\n stroke-dasharray: 100,200;\n stroke-dashoffset: -120;\n }\n}\n\n.circle_progress {\n margin: 0 auto;\n}\n\n.circle_progress_svg {\n animation: circular-rotate 1.4s linear infinite;\n}\n\n.circle_progress_circle {\n stroke-linecap: round;\n animation: circular-dash 1.4s ease-in-out infinite;\n stroke-dasharray: 80,200;\n stroke-dashoffset: 0;\n stroke: var(--pv-color-secondary);\n}\n\n.circle_progress_backdrop {\n stroke: var(--pv-color-gray-3);\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Host,\n h,\n Prop,\n} from '@stencil/core';\n\n@Component({\n tag: 'peculiar-circular-progress',\n styleUrl: 'circular-progress.scss',\n shadow: true,\n})\nexport class CircularProgress {\n /**\n * Width/height of progress circle.\n */\n @Prop() size: number = 24;\n\n /**\n * Stroke width of progress bar circle.\n */\n @Prop() width: number = 4;\n\n private box: number = 50;\n\n render() {\n return (\n <Host>\n <div\n class=\"circle_progress\"\n style={{\n width: `${this.size}px`,\n height: `${this.size}px`,\n }}\n >\n <svg\n class=\"circle_progress_svg\"\n viewBox={`0 0 ${this.box} ${this.box}`}\n >\n <circle\n class=\"circle_progress_backdrop\"\n cx={this.box / 2}\n cy={this.box / 2}\n r={(this.box / 2) - 5}\n fill=\"none\"\n style={{\n strokeWidth: `${this.width}px`,\n }}\n />\n <circle\n class=\"circle_progress_circle\"\n cx={this.box / 2}\n cy={this.box / 2}\n r={(this.box / 2) - 5}\n fill=\"none\"\n style={{\n strokeWidth: `${this.width}px`,\n }}\n />\n </svg>\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: inline;\n}\n\n::slotted(mark) {\n background-color: var(--pv-color-attention-tint-4);\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component, Host, h, Element, Prop,\n} from '@stencil/core';\n\n@Component({\n tag: 'peculiar-highlight-words',\n styleUrl: 'highlight-words.scss',\n shadow: true,\n})\nexport class HighlightWords {\n @Element() host: HTMLElement;\n\n @Prop() search: string;\n\n private tag: string = 'mark';\n\n componentDidLoad() {\n this.handleHighlightSearch();\n }\n\n componentDidUpdate() {\n this.handleHighlightSearch();\n }\n\n handleHighlightSearch() {\n const basicString = this.resetHighlightSearch(this.host.innerHTML);\n let result = basicString;\n\n if (this.search) {\n const substring = new RegExp(`(${this.search})`, 'gi');\n\n result = basicString.replace(substring, `<${this.tag}>$1</${this.tag}>`);\n }\n\n this.host.innerHTML = result;\n }\n\n resetHighlightSearch(source: string) {\n // eslint-disable-next-line no-useless-escape\n const substring = new RegExp(`<\\/?${this.tag}>`, 'g');\n\n return source.replace(substring, '');\n }\n\n render() {\n return (\n <Host>\n <slot />\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,12 +1,12 @@
1
1
  /*!
2
2
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-bbd484d9.js';
5
- import { i as isPem, a as isX509Pem, b as isPkcs10Pem, c as isX509AttributePem, d as isX509CRLPem } from './certification_request-23cd5124.js';
6
- import './l10n-d48f35ff.js';
7
- import './download-91511aeb.js';
8
- import { X as X509Certificate } from './x509_certificate-d8e0af2d.js';
9
- import { X as X509AttributeCertificate, C as CSR, a as CRL } from './crl-7f23c111.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-4079bbb5.js';
5
+ import { i as isPem, a as isX509Pem, b as isPkcs10Pem, c as isX509AttributePem, d as isX509CRLPem } from './certification_request-5cadde9f.js';
6
+ import './download-57c5bf8f.js';
7
+ import { X as X509Certificate } from './x509_certificate-dfae6999.js';
8
+ import { X as X509AttributeCertificate, C as CSR, a as CRL } from './crl-11670c3e.js';
9
+ import { T as Typography, B as Button } from './button-35146bdd.js';
10
10
 
11
11
  /**
12
12
  * @license
@@ -40,27 +40,24 @@ function readAsBinaryString(file) {
40
40
  });
41
41
  }
42
42
 
43
- const certificateDecoderCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-user-drag:none;-ms-content-zooming:none;word-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;display:block;width:100%;font-size:0}.textarea{min-height:300px;width:100%;border-radius:3px;border-width:1px;border-style:solid;padding:14px;font-family:monospace;resize:vertical;background-color:white;background-color:rgba(var(--pv-color-light-rgb), 1);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1);letter-spacing:0.03em;letter-spacing:var(--pv-letter-spacing-normal);font-size:14px;font-size:var(--pv-font-size-h7)}.controls{margin-top:10px}.button{position:relative}.button:not(:first-child){margin-left:10px}.viewer{margin-top:64px}.input_file{opacity:0;width:100%;height:100%;top:0;left:0;display:block;position:absolute}";
43
+ const certificateDecoderCss = "*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%}.textarea{min-height:300px;width:100%;border-radius:4px;border:1px solid var(--pv-color-gray-5);padding:14px;font-family:monospace;resize:vertical}.viewer{margin-top:var(--pv-size-base-12)}.controls{margin-top:var(--pv-size-base-2);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--pv-size-base-2)}.control_row{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--pv-size-base)}";
44
44
 
45
45
  const CertificateDecoder = class {
46
46
  constructor(hostRef) {
47
47
  registerInstance(this, hostRef);
48
48
  this.successParse = createEvent(this, "successParse", 7);
49
49
  this.clearCertificate = createEvent(this, "clearCertificate", 7);
50
- this.onClickDecode = () => {
50
+ this.handleClickDecode = () => {
51
51
  const { value } = this.inputPaste;
52
52
  if (value) {
53
53
  this.decode(value);
54
54
  }
55
55
  };
56
- this.onClickExample = () => {
57
- this.decode(this.certificateExample);
58
- };
59
- this.onClickClear = () => {
56
+ this.handleClickClear = () => {
60
57
  this.clearValue();
61
58
  };
62
- this.onChangeInputFile = async (e) => {
63
- const element = e.target;
59
+ this.handleChangeInputFile = async (event) => {
60
+ const element = event.target;
64
61
  if (element.files) {
65
62
  const file = await readAsBinaryString(element.files[0]);
66
63
  if (typeof file.value === 'string') {
@@ -69,10 +66,18 @@ const CertificateDecoder = class {
69
66
  element.value = '';
70
67
  }
71
68
  };
72
- this.onDropFile = async (e) => {
73
- e.stopPropagation();
74
- e.preventDefault();
75
- const element = e.dataTransfer;
69
+ this.handleChangeExample = (event) => {
70
+ if (event.target.value) {
71
+ this.decode(event.target.value);
72
+ }
73
+ else {
74
+ this.clearValue();
75
+ }
76
+ };
77
+ this.handleDropFile = async (event) => {
78
+ event.stopPropagation();
79
+ event.preventDefault();
80
+ const element = event.dataTransfer;
76
81
  if (element.files) {
77
82
  const file = await readAsBinaryString(element.files[0]);
78
83
  if (typeof file.value === 'string') {
@@ -80,6 +85,9 @@ const CertificateDecoder = class {
80
85
  }
81
86
  }
82
87
  };
88
+ this.certificateExamples = undefined;
89
+ this.defaultCertificate = undefined;
90
+ this.certificateDecoded = undefined;
83
91
  }
84
92
  componentDidLoad() {
85
93
  if (this.defaultCertificate) {
@@ -171,9 +179,12 @@ const CertificateDecoder = class {
171
179
  }
172
180
  }
173
181
  render() {
174
- return (h(Host, null, h("textarea", { placeholder: "Certificate DER or PEM", class: "textarea", ref: (el) => { this.inputPaste = el; }, onDrop: this.onDropFile }), h("div", { class: "controls" }, h("peculiar-button", { fill: "fill", class: "button", onClick: this.onClickDecode }, "Decode"), h("peculiar-button", { class: "button" }, "Choose file", h("input", { type: "file", class: "input_file", accept: "application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl", onChange: this.onChangeInputFile, value: "" })), h("peculiar-button", { class: "button", onClick: this.onClickClear }, "Clear"), this.certificateExample && (h("peculiar-button", { class: "button", onClick: this.onClickExample }, "Example"))), this.certificateDecoded instanceof X509Certificate && (h("peculiar-certificate-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof X509AttributeCertificate && (h("peculiar-attribute-certificate-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof CSR && (h("peculiar-csr-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof CRL && (h("peculiar-crl-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true }))));
182
+ var _a;
183
+ return (h(Host, null, h("textarea", { placeholder: "Certificate DER or PEM", class: "textarea t-b2 c-black", ref: (el) => { this.inputPaste = el; }, onDrop: this.handleDropFile }), h("div", { class: "controls" }, h("div", { class: "control_row" }, h(Typography, { variant: "b3", color: "secondary-tint-2" }, "Drag or load file:"), h("input", { type: "file", accept: "application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl", onChange: this.handleChangeInputFile, value: "" })), ((_a = this.certificateExamples) === null || _a === void 0 ? void 0 : _a.length) && (h("div", { class: "control_row" }, h(Typography, { variant: "b3", color: "secondary-tint-2" }, "Load examples:"), h("select", { onChange: this.handleChangeExample }, h("option", { value: "" }, "None"), this.certificateExamples.map((example) => (h("option", { value: example.value }, example.title)))))), h("div", { class: "control_row" }, h(Button, { onClick: this.handleClickDecode }, "Decode"), h(Button, { onClick: this.handleClickClear }, "Clear"))), this.certificateDecoded instanceof X509Certificate && (h("peculiar-certificate-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof X509AttributeCertificate && (h("peculiar-attribute-certificate-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof CSR && (h("peculiar-csr-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof CRL && (h("peculiar-crl-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true }))));
175
184
  }
176
185
  };
177
186
  CertificateDecoder.style = certificateDecoderCss;
178
187
 
179
188
  export { CertificateDecoder as peculiar_certificate_decoder };
189
+
190
+ //# sourceMappingURL=peculiar-certificate-decoder.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"peculiar-certificate-decoder.entry.js","mappings":";;;;;;;;;;AAAA;;;;;;;AAqBA;;;;;;;;;;;SAYgB,kBAAkB,CAAC,IAAmB;EACpD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM;IACjC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAEhC,MAAM,CAAC,MAAM,GAAG,MAAM,OAAO,CAAC;MAC5B,KAAK,EAAE,MAAM,CAAC,MAAM;MACpB,QAAQ,EAAE,IAAI,CAAC,IAAI;MACnB,QAAQ,EAAE,IAAI,CAAC,IAAI;MACnB,U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IACL,OAAO,EAAE,IAAI,CAAC,gBAAgB,YAGvB,CACL,CACF,EACL,IAAI,CAAC,kBAAkB,YAAY,eAAe,KACjD,mCACE,WAAW,EAAE,IAAI,CAAC,kBAAkB,EACpC,KAAK,EAAC,QAAQ,EACd,QAAQ,SACR,CACH,EACA,IAAI,CAAC,kBAAkB,YAAY,wBAAwB,KAC1D,6CACE,WAAW,EAAE,IAAI,CAAC,kBAAkB,EACpC,KAAK,EAAC,QAAQ,EACd,QAAQ,SACR,CACH,EACA,IAAI,CAAC,kBAAkB,YAAY,GAAG,KACrC,2BACE,WAAW,EAAE,IAAI,CAAC,kBAAkB,EACpC,KAAK,EAAC,QAAQ,EACd,QAAQ,SACR,CACH,EACA,IAAI,CAAC,kBAAkB,YAAY,GAAG,KACrC,2BACE,WAAW,EAAE,IAAI,CAAC,kBAAkB,EACpC,KAAK,EAAC,QAAQ,EACd,QAAQ,SACR,CACH,CACI,EACP;GACH;;;;;;","names":["isPem","validator.isPem","isX509Pem","validator.isX509Pem","isPkcs10Pem","validator.isPkcs10Pem","isX509AttributePem","validator.isX509AttributePem","isX509CRLPem","validator.isX509CRLPem"],"sources":["src/utils/read_file.ts","src/components/certificate-decoder/certificate-decoder.scss?tag=peculiar-certificate-decoder&encapsulation=shadow","src/components/certificate-decoder/certificate-decoder.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport type FileValue = string | ArrayBuffer | null;\nexport interface IFileDataType extends Blob {\n name?: string;\n mimeType?: string;\n lastModified?: number;\n}\nexport interface IReadFileResult {\n value: FileValue;\n fileName: string | undefined;\n fileSize: number | undefined;\n sourceMime: string | undefined;\n}\n\n/**\n * Read file as Binary string\n *\n * @example\n * ```js\n * const file = new File(['file'], 'file.pdf', { type: 'text/plain' });\n * readAsBinaryString(file)\n * .then(result => console.log('Readed success', result))\n * .catch(err => console.log('An error occured when reading file', err));\n * ```\n */\n\nexport function readAsBinaryString(file: IFileDataType): Promise<IReadFileResult> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () => resolve({\n value: reader.result,\n fileName: file.name,\n fileSize: file.size,\n sourceMime: file.type,\n });\n\n reader.onerror = () => reject(reader.error);\n\n reader.readAsBinaryString(file);\n });\n}\n\n/**\n * Read file as ArrayBuffer\n *\n * @example\n * ```js\n * const file = new File(['file'], 'file.pdf', { type: 'text/plain' });\n * readAsArrayBuffer(file)\n * .then(result => console.log('Readed success', result))\n * .catch(err => console.log('An error occured when reading file', err));\n * ```\n */\n\nexport function readAsArrayBuffer(file: IFileDataType): Promise<IReadFileResult> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () => resolve({\n value: reader.result,\n fileName: file.name,\n fileSize: file.size,\n sourceMime: file.type,\n });\n\n reader.onerror = () => reject(reader.error);\n\n reader.readAsArrayBuffer(file);\n });\n}\n\n/**\n * Read file as Data URL\n *\n * @example\n * ```js\n * const file = new File(['file'], 'file.pdf', { type: 'text/plain' });\n * readAsDataUrl(file)\n * .then(result => console.log('Readed success', result))\n * .catch(err => console.log('An error occured when reading file', err));\n * ```\n */\n\nexport function readAsDataUrl(file: IFileDataType): Promise<IReadFileResult> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () => resolve({\n value: reader.result,\n fileName: file.name,\n fileSize: file.size,\n sourceMime: file.type,\n });\n\n reader.onerror = () => reject(reader.error);\n\n reader.readAsDataURL(file);\n });\n}\n\n/**\n * Read file as Text\n *\n * @example\n * ```js\n * const file = new File(['file'], 'file.pdf', { type: 'text/plain' });\n * readAsText(file)\n * .then(result => console.log('Readed success', result))\n * .catch(err => console.log('An error occured when reading file', err));\n * ```\n */\n\nexport function readAsText(file: IFileDataType, options?: string): Promise<IReadFileResult> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () => resolve({\n value: reader.result,\n fileName: file.name,\n fileSize: file.size,\n sourceMime: file.type,\n });\n\n reader.onerror = () => reject(reader.error);\n\n reader.readAsText(file, options);\n });\n}\n","@import '../../css/base.scss';\n\n:host {\n display: block;\n width: 100%;\n}\n\n.textarea {\n min-height: 300px;\n width: 100%;\n border-radius: 4px;\n border: 1px solid var(--pv-color-gray-5);;\n padding: 14px;\n font-family: monospace;\n resize: vertical;\n}\n\n.viewer {\n margin-top: var(--pv-size-base-12);\n}\n\n.controls {\n margin-top: var(--pv-size-base-2);\n display: flex;\n flex-direction: column;\n gap: var(--pv-size-base-2);\n}\n\n.control_row {\n display: flex;\n align-items: center;\n gap: var(--pv-size-base);\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Host,\n h,\n State,\n Prop,\n Event,\n EventEmitter,\n} from '@stencil/core';\n\nimport { validator, readAsBinaryString } from '../../utils';\nimport {\n X509Certificate,\n X509AttributeCertificate,\n CSR,\n CRL,\n} from '../../crypto';\nimport { Button } from '../button';\nimport { Typography } from '../typography';\n\n@Component({\n tag: 'peculiar-certificate-decoder',\n styleUrl: 'certificate-decoder.scss',\n shadow: true,\n})\nexport class CertificateDecoder {\n private inputPaste?: HTMLTextAreaElement;\n\n /**\n * The example certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() certificateExamples?: {\n title: string;\n value: string;\n }[];\n\n /**\n * The default certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() defaultCertificate?: string;\n\n @State() certificateDecoded: X509Certificate | X509AttributeCertificate | CSR | CRL;\n\n /**\n * Emitted when the certificate has been successfully parsed.\n */\n @Event() successParse!: EventEmitter<string>;\n\n /**\n * Emitted when the certificate has been removed.\n */\n @Event() clearCertificate!: EventEmitter<void>;\n\n componentDidLoad() {\n if (this.defaultCertificate) {\n /**\n * Prevent Stencil warning about re-render\n */\n setTimeout(() => this.decode(this.defaultCertificate), 100);\n }\n }\n\n private handleClickDecode = () => {\n const { value } = this.inputPaste;\n\n if (value) {\n this.decode(value);\n }\n };\n\n private handleClickClear = () => {\n this.clearValue();\n };\n\n private handleChangeInputFile = async (event: any) => {\n const element = event.target;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n\n element.value = '';\n }\n };\n\n private handleChangeExample = (event: any) => {\n if (event.target.value) {\n this.decode(event.target.value);\n } else {\n this.clearValue();\n }\n };\n\n private handleDropFile = async (event: any) => {\n event.stopPropagation();\n event.preventDefault();\n\n const element = event.dataTransfer;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n }\n };\n\n clearValue() {\n this.inputPaste.value = '';\n this.certificateDecoded = null;\n this.clearCertificate.emit();\n }\n\n setValue(value: X509Certificate | X509AttributeCertificate | CSR | CRL) {\n this.certificateDecoded = value;\n this.inputPaste.value = value.exportAsPemFormatted();\n this.successParse.emit(value.exportAsBase64());\n }\n\n decode(certificate: string) {\n const isPem = validator.isPem(certificate);\n const isX509Pem = validator.isX509Pem(certificate);\n const isPkcs10Pem = validator.isPkcs10Pem(certificate);\n const isX509AttributePem = validator.isX509AttributePem(certificate);\n const isX509CRLPem = validator.isX509CRLPem(certificate);\n let decoded: X509Certificate | X509AttributeCertificate | CSR | CRL;\n let decodeError: Error;\n\n if (isPem && !(isX509Pem || isX509AttributePem || isPkcs10Pem || isX509CRLPem)) {\n this.clearValue();\n\n alert('Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');\n\n return;\n }\n\n try {\n if (isX509Pem) {\n decoded = new X509Certificate(certificate);\n }\n\n if (isX509AttributePem) {\n decoded = new X509AttributeCertificate(certificate);\n }\n\n if (isPkcs10Pem) {\n decoded = new CSR(certificate);\n }\n\n if (isX509CRLPem) {\n decoded = new CRL(certificate);\n }\n } catch (error) {\n decodeError = error;\n }\n\n if (!decoded) {\n try {\n decoded = new X509Certificate(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n try {\n decoded = new X509AttributeCertificate(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n try {\n decoded = new CSR(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n try {\n decoded = new CRL(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n this.clearValue();\n\n console.log(decodeError);\n alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');\n } else {\n this.setValue(decoded);\n }\n }\n\n render() {\n return (\n <Host>\n <textarea\n placeholder=\"Certificate DER or PEM\"\n class=\"textarea t-b2 c-black\"\n ref={(el) => { this.inputPaste = el; }}\n onDrop={this.handleDropFile}\n />\n <div class=\"controls\">\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Drag or load file:\n </Typography>\n <input\n type=\"file\"\n accept=\"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl\"\n onChange={this.handleChangeInputFile}\n value=\"\"\n />\n </div>\n {this.certificateExamples?.length && (\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Load examples:\n </Typography>\n <select onChange={this.handleChangeExample}>\n <option value=\"\">None</option>\n {this.certificateExamples.map((example) => (\n <option value={example.value}>\n {example.title}\n </option>\n ))}\n </select>\n </div>\n )}\n <div class=\"control_row\">\n <Button\n onClick={this.handleClickDecode}\n >\n Decode\n </Button>\n <Button\n onClick={this.handleClickClear}\n >\n Clear\n </Button>\n </div>\n </div>\n {this.certificateDecoded instanceof X509Certificate && (\n <peculiar-certificate-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof X509AttributeCertificate && (\n <peculiar-attribute-certificate-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof CSR && (\n <peculiar-csr-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof CRL && (\n <peculiar-crl-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,19 +1,19 @@
1
1
  /*!
2
2
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-bbd484d9.js';
5
- import { X as X509Certificate } from './x509_certificate-d8e0af2d.js';
6
- import './certification_request-23cd5124.js';
7
- import './download-91511aeb.js';
8
- import './l10n-d48f35ff.js';
9
- import { B as BasicInformation, f as SubjectName, I as IssuerName, P as PublicKey, S as Signature, b as Thumbprints, E as Extensions, c as getLEILink, d as getDNSNameLink, e as getIPAddressLink, M as Miscellaneous } from './miscellaneous-c7c0d04a.js';
4
+ import { r as registerInstance, h, H as Host } from './index-4079bbb5.js';
5
+ import { X as X509Certificate } from './x509_certificate-dfae6999.js';
6
+ import './certification_request-5cadde9f.js';
7
+ import './download-57c5bf8f.js';
8
+ import { B as BasicInformation, f as SubjectName, I as IssuerName, P as PublicKey, S as Signature, b as Thumbprints, E as Extensions, c as getLEILink, d as getDNSNameLink, e as getIPAddressLink, M as Miscellaneous } from './miscellaneous-1d4e8b41.js';
9
+ import { T as Typography } from './button-35146bdd.js';
10
+ import './download-0cc3077a.js';
10
11
 
11
- const certificateViewerCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;position:relative;min-width:280px;min-height:300px;background:white;background:rgba(var(--pv-color-light-rgb), 1)}th,td{border:none}table{width:100%;margin-bottom:30px;border-spacing:0;border-collapse:collapse}table table{margin-bottom:0}table .title td{border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5);padding-top:60px;padding-bottom:15px;border-bottom-width:1px;border-bottom-style:solid}table td:first-child{padding-left:30px;width:130px;padding-right:10px}table td:last-child{padding-right:30px;width:calc(100% - 130px)}table td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td.vertical_align_middle{vertical-align:middle}table .title:first-child td{padding-top:15px}table .title+tr td{padding-top:15px}table td.monospace{max-width:0}table .divider{padding-top:15px;padding-bottom:15px}.divider .bg_fill{background-color:rgba(209, 213, 217, 0.5);background-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr:last-child .divider{padding-top:0;opacity:0}.divider span{display:block;height:1px}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.interaction_text{padding:15px 0;width:300px;margin:auto;text-align:center}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{padding-right:15px;padding-left:15px;width:100%}table .title+tr td{padding-top:5px}table .title+tr td:first-child{padding-top:15px}table td.monospace{width:100%;max-width:none}}:host([data-view=mobile]) table,:host([data-view=mobile]) tr,:host([data-view=mobile]) td{display:block}:host([data-view=mobile]) table td:last-child,:host([data-view=mobile]) table td:first-child{padding-right:15px;padding-left:15px;width:100%}:host([data-view=mobile]) table .title+tr td{padding-top:5px}:host([data-view=mobile]) table .title+tr td:first-child{padding-top:15px}:host([data-view=mobile]) table td.monospace{width:100%;max-width:none}";
12
+ const certificateViewerCss = "*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";
12
13
 
13
14
  const CertificateViewer = class {
14
15
  constructor(hostRef) {
15
16
  registerInstance(this, hostRef);
16
- this.isDecodeInProcess = true;
17
17
  this.getAuthKeyIdParentLink = (value) => {
18
18
  var _a;
19
19
  return (_a = this.authKeyIdParentLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
@@ -30,9 +30,30 @@ const CertificateViewer = class {
30
30
  var _a;
31
31
  return (_a = this.subjectKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
32
32
  };
33
+ this.certificate = undefined;
34
+ this.download = undefined;
35
+ this.authKeyIdParentLink = undefined;
36
+ this.authKeyIdSiblingsLink = undefined;
37
+ this.subjectKeyIdChildrenLink = undefined;
38
+ this.subjectKeyIdSiblingsLink = undefined;
39
+ this.issuerDnLink = undefined;
40
+ this.mobileMediaQueryString = '(max-width: 900px)';
41
+ this.mobileScreenView = false;
42
+ this.isDecodeInProcess = true;
43
+ }
44
+ handleMediaQueryChange(event) {
45
+ this.mobileScreenView = event.matches;
33
46
  }
34
47
  componentWillLoad() {
35
48
  this.decodeCertificate(this.certificate);
49
+ {
50
+ this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);
51
+ this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));
52
+ this.mobileScreenView = this.mobileMediaQuery.matches;
53
+ }
54
+ }
55
+ disconnectedCallback() {
56
+ this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));
36
57
  }
37
58
  async decodeCertificate(certificate) {
38
59
  this.isDecodeInProcess = true;
@@ -77,11 +98,11 @@ const CertificateViewer = class {
77
98
  }
78
99
  // eslint-disable-next-line class-methods-use-this
79
100
  renderErrorState() {
80
- return (h("div", { class: "status_wrapper" }, h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There was an error decoding this certificate.")));
101
+ return (h("div", { class: "status_wrapper" }, h(Typography, null, "There was an error decoding this certificate.")));
81
102
  }
82
103
  // eslint-disable-next-line class-methods-use-this
83
104
  renderEmptyState() {
84
- return (h("div", { class: "status_wrapper" }, h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There is no certificate available.")));
105
+ return (h("div", { class: "status_wrapper" }, h(Typography, null, "There is no certificate available.")));
85
106
  }
86
107
  render() {
87
108
  if (this.certificateDecodeError) {
@@ -90,7 +111,7 @@ const CertificateViewer = class {
90
111
  if (!this.certificateDecoded) {
91
112
  return this.renderEmptyState();
92
113
  }
93
- return (h(Host, { "data-view": this.view }, h("table", null, h(BasicInformation, Object.assign({}, this.certificateDecoded)), h(SubjectName, { name: this.certificateDecoded.subject }), h(IssuerName, { name: this.certificateDecoded.issuer, issuerDnLink: this.getIssuerDnLink() }), h(PublicKey, { publicKey: this.certificateDecoded.publicKey }), h(Signature, { signature: this.certificateDecoded.signature }), h(Thumbprints, { thumbprints: this.certificateDecoded.thumbprints }), h(Extensions, { extensions: this.certificateDecoded.extensions, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), this.download && (h(Miscellaneous, { certificate: this.certificateDecoded })))));
114
+ return (h(Host, { "data-mobile-screen-view": String(this.mobileScreenView) }, h("table", null, h(BasicInformation, Object.assign({}, this.certificateDecoded)), h(SubjectName, { name: this.certificateDecoded.subject }), h(IssuerName, { name: this.certificateDecoded.issuer, issuerDnLink: this.getIssuerDnLink() }), h(PublicKey, { publicKey: this.certificateDecoded.publicKey }), h(Signature, { signature: this.certificateDecoded.signature }), h(Thumbprints, { thumbprints: this.certificateDecoded.thumbprints }), h(Extensions, { extensions: this.certificateDecoded.extensions, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), this.download && (h(Miscellaneous, { certificate: this.certificateDecoded })))));
94
115
  }
95
116
  static get watchers() { return {
96
117
  "certificate": ["watchCertificateAndDecode"]
@@ -99,3 +120,5 @@ const CertificateViewer = class {
99
120
  CertificateViewer.style = certificateViewerCss;
100
121
 
101
122
  export { CertificateViewer as peculiar_certificate_viewer };
123
+
124
+ //# sourceMappingURL=peculiar-certificate-viewer.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"peculiar-certificate-viewer.entry.js","mappings":";;;;;;;;;;;AAAA,MAAM,oBAAoB,GAAG,khSAAkhS;;MCyCliS,iBAAiB;;;IAsIpB,2BAAsB,GAAG,CAAC,KAAa;;MAAK,OAAA,MAAA,IAAI,CAAC,mBAAmB,0CACxE,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;KAAA,CAAC;IAE5B,6BAAwB,GAAG,CAAC,KAAa;;MAAK,OAAA,MAAA,IAAI,CAAC,qBAAqB,0CAC5E,OAAO,CAAC,e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AC,IAAI,CAAC,kBAAkB,EAAE;MAC5B,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;KAChC;IAED,QACE,EAAC,IAAI,+BACsB,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAEtD,iBACE,EAAC,gBAAgB,oBACX,IAAI,CAAC,kBAAkB,EAC3B,EAEF,EAAC,WAAW,IACV,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,OAAO,GACrC,EAEF,EAAC,UAAU,IACT,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,MAAM,EACpC,YAAY,EAAE,IAAI,CAAC,eAAe,EAAE,GACpC,EAEF,EAAC,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,kBAAkB,CAAC,SAAS,GAC5C,EAEF,EAAC,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,kBAAkB,CAAC,SAAS,GAC5C,EAEF,EAAC,WAAW,IACV,WAAW,EAAE,IAAI,CAAC,kBAAkB,CAAC,WAAW,GAChD,EAEF,EAAC,UAAU,IACT,UAAU,EAAE,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAC9C,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EACnD,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,EACvD,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,EAC7D,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,GAC7D,EAED,IAAI,CAAC,QAAQ,KACZ,EAAC,aAAa,IACZ,WAAW,EAAE,IAAI,CAAC,kBAAkB,GACpC,CACH,CACK,CACH,EACP;GACH;;;;;;;;;","names":[],"sources":["src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-certificate-viewer&encapsulation=shadow","src/components/certificate-viewer/certificate-viewer.tsx"],"sourcesContent":["@import '../../css/base.scss';\n\n:host {\n display: block;\n width: 100%;\n position: relative;\n min-width: 280px;\n min-height: 300px;\n word-wrap: break-word;\n word-break: break-word;\n}\n\nth, td {\n border: none;\n}\n\ntable {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n td {\n padding: var(--pv-size-base-2) var(--pv-size-base-4);\n vertical-align: top;\n\n &:first-child {\n width: 220px;\n }\n\n &:last-child {\n width: calc(100% - 220px)\n }\n\n &.monospace {\n max-width: 0;\n }\n\n &.divider {\n padding: var(--pv-size-base-2) 0;\n\n span {\n height: 1px;\n display: block;\n background-color: var(--pv-color-gray-4);\n }\n }\n }\n\n .title td {\n padding-top: var(--pv-size-base-6);\n padding-bottom: var(--pv-size-base-2);\n }\n\n table {\n border-left: 1px solid var(--pv-color-gray-5);\n }\n}\n\n.status_wrapper {\n min-height: inherit;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n:host([data-mobile-screen-view=\"true\"]) {\n table, tr, td {\n display: block;\n }\n\n table {\n tr {\n padding: var(--pv-size-base-2) 0;\n\n &.title {\n padding-top: var(--pv-size-base-6);\n\n td {\n padding: 0 var(--pv-size-base-4);\n }\n }\n }\n\n td {\n padding: 0 var(--pv-size-base-4);\n width: 100% !important;\n max-width: 100% !important;\n\n &.divider {\n padding: 0;\n }\n }\n }\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n h,\n Prop,\n State,\n Watch,\n Host,\n Build,\n} from '@stencil/core';\n\nimport {\n X509Certificate,\n} from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n SubjectName,\n IssuerName,\n PublicKey,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type CertificateProp = string | X509Certificate;\n\n@Component({\n tag: 'peculiar-certificate-viewer',\n styleUrl: 'certificate-viewer.scss',\n shadow: true,\n})\nexport class CertificateViewer {\n private certificateDecoded: X509Certificate;\n\n private certificateDecodeError: Error;\n\n private mobileMediaQuery: MediaQueryList;\n\n /**\n * The certificate value for decode and show details. Use PEM or DER.\n */\n @Prop({ reflect: true }) certificate: CertificateProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop({ reflect: true }) download?: boolean;\n\n /**\n * Authority Key Identifier extension parent link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.subject_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdParentLink?: string;\n\n /**\n * Authority Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdSiblingsLink?: string;\n\n /**\n * Subject Key Identifier extension children link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdChildrenLink?: string;\n\n /**\n * Subject Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://some.com/{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdSiblingsLink?: string;\n\n /**\n * Issuer DN link.\n * **NOTE**: HTML component attribute must be `issuer-dn-link`.\n */\n @Prop({ reflect: true }) issuerDnLink?: string;\n\n /**\n * Mobile media query string to control screen view change.\n * <br />\n * **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.\n * @example\n * (max-width: 900px)\n */\n @Prop({ reflect: false }) mobileMediaQueryString?: string = '(max-width: 900px)';\n\n @State() mobileScreenView: boolean = false;\n\n @State() isDecodeInProcess: boolean = true;\n\n private handleMediaQueryChange(event: MediaQueryListEvent) {\n this.mobileScreenView = event.matches;\n }\n\n componentWillLoad() {\n this.decodeCertificate(this.certificate);\n\n if (Build.isBrowser) {\n this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);\n this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));\n this.mobileScreenView = this.mobileMediaQuery.matches;\n }\n }\n\n disconnectedCallback() {\n this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));\n }\n\n private async decodeCertificate(certificate: CertificateProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof X509Certificate) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new X509Certificate(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseExtensions();\n await this.certificateDecoded.getThumbprint('SHA-1');\n await this.certificateDecoded.getThumbprint('SHA-256');\n } catch (error) {\n this.certificateDecodeError = error;\n\n console.error('Error certificate parse:', error);\n }\n\n this.isDecodeInProcess = false;\n }\n\n /**\n * Rerun decodeCertificate if previuos value not equal current value\n */\n @Watch('certificate')\n watchCertificateAndDecode(newValue: CertificateProp, oldValue: CertificateProp) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (newValue instanceof X509Certificate && oldValue instanceof X509Certificate) {\n if (newValue.serialNumber !== oldValue.serialNumber) {\n this.decodeCertificate(newValue);\n }\n }\n }\n\n private getAuthKeyIdParentLink = (value: string) => this.authKeyIdParentLink\n ?.replace('{{authKeyId}}', value);\n\n private getAuthKeyIdSiblingsLink = (value: string) => this.authKeyIdSiblingsLink\n ?.replace('{{authKeyId}}', value);\n\n private getSubjectKeyIdChildrenLink = (value: string) => this.subjectKeyIdChildrenLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getSubjectKeyIdSiblingsLink = (value: string) => this.subjectKeyIdSiblingsLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getIssuerDnLink() {\n return this.issuerDnLink;\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderErrorState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There was an error decoding this certificate.\n </Typography>\n </div>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderEmptyState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There is no certificate available.\n </Typography>\n </div>\n );\n }\n\n render() {\n if (this.certificateDecodeError) {\n return this.renderErrorState();\n }\n\n if (!this.certificateDecoded) {\n return this.renderEmptyState();\n }\n\n return (\n <Host\n data-mobile-screen-view={String(this.mobileScreenView)}\n >\n <table>\n <BasicInformation\n {...this.certificateDecoded}\n />\n\n <SubjectName\n name={this.certificateDecoded.subject}\n />\n\n <IssuerName\n name={this.certificateDecoded.issuer}\n issuerDnLink={this.getIssuerDnLink()}\n />\n\n <PublicKey\n publicKey={this.certificateDecoded.publicKey}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Extensions\n extensions={this.certificateDecoded.extensions}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n {this.download && (\n <Miscellaneous\n certificate={this.certificateDecoded}\n />\n )}\n </table>\n </Host>\n );\n }\n}\n"],"version":3}