@peculiar/certificates-viewer 3.1.0 → 3.2.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 (76) hide show
  1. package/dist/cjs/{certification_request-878e786a.js → certification_request-cde57123.js} +137 -266
  2. package/dist/cjs/csr-78378ed0.js +150 -0
  3. package/dist/cjs/download-6724f3a7.js +79 -0
  4. package/dist/cjs/{download-5e7d5455.js → index-ff818d4d.js} +0 -72
  5. package/dist/cjs/index.cjs.js +2 -1
  6. package/dist/cjs/l10n-a048a686.js +145 -0
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/peculiar-attribute-certificate-viewer_2.cjs.entry.js +479 -0
  9. package/dist/cjs/peculiar-button_5.cjs.entry.js +148 -0
  10. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +173 -0
  11. package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +1 -1
  12. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +124 -0
  13. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +6 -4
  14. package/dist/cjs/peculiar.cjs.js +1 -1
  15. package/dist/cjs/public_key-2f5bd471.js +1104 -0
  16. package/dist/cjs/x509_attribute_certificate-cc325b70.js +87 -0
  17. package/dist/cjs/x509_certificate-51a97033.js +139 -0
  18. package/dist/collection/components/certificate-decoder/certificate-decoder.js +54 -23
  19. package/dist/collection/components/certificate-viewer/attributes/type_relationship_attribute.js +1 -1
  20. package/dist/collection/components/certificate-viewer/extensions/basic_constraints_extension.js +1 -1
  21. package/dist/collection/components/certificate-viewer/extensions/basic_extension.js +1 -1
  22. package/dist/collection/components/certificate-viewer/extensions/timestamp_extension.js +1 -1
  23. package/dist/collection/utils/index.js +0 -1
  24. package/dist/collection/www-copy/index.js +80 -0
  25. package/dist/esm/{certification_request-3402a181.js → certification_request-c0674647.js} +76 -205
  26. package/dist/esm/csr-c1b6a176.js +147 -0
  27. package/dist/esm/download-735fb2eb.js +76 -0
  28. package/dist/esm/{download-cf68ac2c.js → index-0ba131b0.js} +1 -71
  29. package/dist/esm/index.js +2 -1
  30. package/dist/esm/l10n-ac28fa92.js +141 -0
  31. package/dist/esm/loader.js +1 -1
  32. package/dist/esm/peculiar-attribute-certificate-viewer_2.entry.js +474 -0
  33. package/dist/esm/peculiar-button_5.entry.js +140 -0
  34. package/dist/esm/peculiar-certificate-decoder.entry.js +169 -0
  35. package/dist/esm/peculiar-certificate-summary_3.entry.js +1 -1
  36. package/dist/esm/peculiar-certificate-viewer.entry.js +120 -0
  37. package/dist/esm/peculiar-certificates-viewer.entry.js +5 -3
  38. package/dist/esm/peculiar.js +1 -1
  39. package/dist/esm/public_key-38c9ddc8.js +1089 -0
  40. package/dist/esm/x509_attribute_certificate-a6d4aa15.js +85 -0
  41. package/dist/esm/x509_certificate-12f6d344.js +137 -0
  42. package/dist/peculiar/index.esm.js +1 -1
  43. package/dist/peculiar/p-006865d7.js +4 -0
  44. package/dist/peculiar/p-17c4da7b.js +11 -0
  45. package/dist/peculiar/{p-b09a1f0b.entry.js → p-38635919.entry.js} +1 -1
  46. package/dist/peculiar/p-3f8d1008.entry.js +4 -0
  47. package/dist/peculiar/p-42da7f97.js +11 -0
  48. package/dist/peculiar/p-464e0943.js +87 -0
  49. package/dist/peculiar/p-4f4c1d30.js +12 -0
  50. package/dist/peculiar/p-6011646e.entry.js +11 -0
  51. package/dist/peculiar/p-6bfd077c.entry.js +18 -0
  52. package/dist/peculiar/p-6c510523.js +18 -0
  53. package/dist/peculiar/p-986cc770.entry.js +11 -0
  54. package/dist/peculiar/p-b765873e.js +78 -0
  55. package/dist/peculiar/p-d7a13cb4.js +18 -0
  56. package/dist/peculiar/p-dafae164.entry.js +4 -0
  57. package/dist/peculiar/peculiar.esm.js +1 -1
  58. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +13 -1
  59. package/dist/types/components.d.ts +20 -0
  60. package/dist/types/utils/index.d.ts +0 -1
  61. package/package.json +2 -3
  62. package/dist/cjs/l10n-d4a77087.js +0 -767
  63. package/dist/cjs/peculiar-attribute-certificate-viewer_9.cjs.entry.js +0 -2187
  64. package/dist/collection/utils/history.js +0 -19
  65. package/dist/collection/utils/parse_hash.js +0 -28
  66. package/dist/collection/utils/query_stringify.js +0 -21
  67. package/dist/esm/l10n-9ac63748.js +0 -762
  68. package/dist/esm/peculiar-attribute-certificate-viewer_9.entry.js +0 -2175
  69. package/dist/peculiar/p-08538084.entry.js +0 -113
  70. package/dist/peculiar/p-3fc37750.entry.js +0 -4
  71. package/dist/peculiar/p-8ad24aa3.js +0 -87
  72. package/dist/peculiar/p-99797a49.js +0 -34
  73. package/dist/peculiar/p-c774ec0b.js +0 -18
  74. package/dist/types/utils/history.d.ts +0 -9
  75. package/dist/types/utils/parse_hash.d.ts +0 -9
  76. package/dist/types/utils/query_stringify.d.ts +0 -8
@@ -0,0 +1,150 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ 'use strict';
5
+
6
+ const certification_request = require('./certification_request-cde57123.js');
7
+ const index = require('./index-ff818d4d.js');
8
+
9
+ /**
10
+ * @license
11
+ * Copyright (c) Peculiar Ventures, LLC.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+ class Attribute extends certification_request.AsnData {
17
+ constructor(raw) {
18
+ super(raw, certification_request.Attribute);
19
+ const asnExtnValue = this.getAsnExtnValue();
20
+ switch (this.asn.type) {
21
+ case certification_request.id_DomainNameBeneficiary:
22
+ this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameBeneficiary);
23
+ break;
24
+ case certification_request.id_DomainNameLegalRepresentative:
25
+ this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameLegalRepresentative);
26
+ break;
27
+ case certification_request.id_DomainNameOwner:
28
+ this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameOwner);
29
+ break;
30
+ case certification_request.id_DomainNameTechnicalOperator:
31
+ this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameTechnicalOperator);
32
+ break;
33
+ case certification_request.id_TypeRelationship:
34
+ this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.TypeRelationship);
35
+ break;
36
+ case certification_request.id_ActivityDescription:
37
+ this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.ActivityDescription);
38
+ break;
39
+ case certification_request.id_WebGDPR:
40
+ this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.WebGDPR);
41
+ break;
42
+ case certification_request.id_InsuranceValue:
43
+ this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.InsuranceValue);
44
+ break;
45
+ case certification_request.id_ValuationRanking:
46
+ this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.ValuationRanking);
47
+ break;
48
+ case certification_request.id_pkcs9_at_challengePassword:
49
+ this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.ChallengePassword);
50
+ break;
51
+ case certification_request.id_pkcs9_at_unstructuredName:
52
+ this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.UnstructuredName);
53
+ break;
54
+ case certification_request.id_pkcs9_at_extensionRequest: {
55
+ const extensionRequest = certification_request.AsnParser.parse(asnExtnValue, certification_request.ExtensionRequest);
56
+ this.value = extensionRequest
57
+ .map((e) => new certification_request.Extension(certification_request.AsnConvert.serialize(e)));
58
+ break;
59
+ }
60
+ default:
61
+ this.value = index.build.Convert.ToHex(asnExtnValue);
62
+ }
63
+ }
64
+ getAsnExtnValue() {
65
+ return this.asn.values[0];
66
+ }
67
+ }
68
+
69
+ /**
70
+ * @license
71
+ * Copyright (c) Peculiar Ventures, LLC.
72
+ *
73
+ * This source code is licensed under the MIT license found in the
74
+ * LICENSE file in the root directory of this source tree.
75
+ */
76
+ class CSR extends certification_request.AsnData {
77
+ constructor(raw) {
78
+ super(certification_request.certificateRawToBuffer(raw), certification_request.CertificationRequest);
79
+ this.thumbprints = {};
80
+ this.type = 'PKCS#10 Certificate Request';
81
+ const { certificationRequestInfo } = this.asn;
82
+ this.subject = new certification_request.Name(certificationRequestInfo.subject).toJSON();
83
+ this.version = certificationRequestInfo.version;
84
+ }
85
+ get publicKey() {
86
+ const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;
87
+ let params;
88
+ if (algorithm.algorithm === certification_request.id_ecPublicKey && algorithm.parameters) {
89
+ params = certification_request.AsnConvert.parse(algorithm.parameters, certification_request.ECParameters);
90
+ }
91
+ if (algorithm.algorithm === certification_request.id_rsaEncryption) {
92
+ params = certification_request.AsnConvert.parse(subjectPublicKey, certification_request.RSAPublicKey);
93
+ }
94
+ const spki = certification_request.AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);
95
+ return {
96
+ params,
97
+ value: spki,
98
+ algorithm: algorithm.algorithm,
99
+ };
100
+ }
101
+ get signature() {
102
+ const { signature, signatureAlgorithm } = this.asn;
103
+ return {
104
+ value: signature,
105
+ algorithm: signatureAlgorithm.algorithm,
106
+ };
107
+ }
108
+ get commonName() {
109
+ if (!this.subject) {
110
+ return '';
111
+ }
112
+ for (let i = 0; i < this.subject.length; i += 1) {
113
+ const name = this.subject[i];
114
+ if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {
115
+ return name.value;
116
+ }
117
+ }
118
+ return '';
119
+ }
120
+ async getThumbprint(algorithm = 'SHA-1') {
121
+ try {
122
+ const thumbprint = await certification_request.getCertificateThumbprint(algorithm, this.raw);
123
+ if (thumbprint) {
124
+ this.thumbprints[algorithm['name'] || algorithm] = index.build.Convert.ToHex(thumbprint);
125
+ }
126
+ }
127
+ catch (error) {
128
+ console.error('Error thumbprint get:', error);
129
+ }
130
+ }
131
+ parseAttributes() {
132
+ const { certificationRequestInfo } = this.asn;
133
+ if (certificationRequestInfo.attributes) {
134
+ this.attributes = certificationRequestInfo.attributes
135
+ .map((e) => new Attribute(certification_request.AsnConvert.serialize(e)));
136
+ }
137
+ }
138
+ exportAsBase64() {
139
+ return index.build.Convert.ToBase64(this.raw);
140
+ }
141
+ exportAsHexFormatted() {
142
+ return certification_request.hexFormat(index.build.Convert.ToHex(this.raw));
143
+ }
144
+ exportAsPemFormatted() {
145
+ return `-----BEGIN CERTIFICATE REQUEST-----\n${certification_request.base64Format(this.exportAsBase64())}\n-----END CERTIFICATE REQUEST-----`;
146
+ }
147
+ }
148
+
149
+ exports.Attribute = Attribute;
150
+ exports.CSR = CSR;
@@ -0,0 +1,79 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ 'use strict';
5
+
6
+ const index = require('./index-ff818d4d.js');
7
+
8
+ /**
9
+ * @license
10
+ * Copyright (c) Peculiar Ventures, LLC.
11
+ *
12
+ * This source code is licensed under the MIT license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+ /**
16
+ * Download from buffer
17
+ *
18
+ * @example
19
+ * ```js
20
+ * import { downloadFromBuffer } from './utils';
21
+ *
22
+ * downloadFromBuffer(arrayBufferValue, 'myFile', 'pdf', 'applciation/pdf');
23
+ * ```
24
+ */
25
+ function downloadFromBuffer(value, name, extension, mime = 'application/octet-stream') {
26
+ const blob = new Blob([value], { type: mime });
27
+ // @ts-ignore
28
+ if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL)
29
+ // @ts-ignore
30
+ navigator.msSaveBlob(blob, `${name}.${extension}`);
31
+ return new Promise((res) => setTimeout(res, 100));
32
+ }
33
+ const blobURL = window.URL.createObjectURL(blob);
34
+ const link = document.createElement('a');
35
+ const frame = document.createElement('iframe');
36
+ link.style.display = 'none';
37
+ frame.style.display = 'none';
38
+ frame.name = blobURL;
39
+ document.body.appendChild(frame);
40
+ link.href = blobURL;
41
+ link.target = blobURL;
42
+ link.download = `${name}.${extension}`;
43
+ document.body.appendChild(link);
44
+ link.dispatchEvent(new MouseEvent('click'));
45
+ document.body.removeChild(link);
46
+ return new Promise((res) => setTimeout(() => {
47
+ document.body.removeChild(frame);
48
+ res(undefined);
49
+ }, 100));
50
+ }
51
+
52
+ /**
53
+ * @license
54
+ * Copyright (c) Peculiar Ventures, LLC.
55
+ *
56
+ * This source code is licensed under the MIT license found in the
57
+ * LICENSE file in the root directory of this source tree.
58
+ */
59
+ class Download {
60
+ }
61
+ Download.x509 = {
62
+ asPEM: (pem, name) => {
63
+ downloadFromBuffer(index.build.Convert.FromString(pem), name, 'cer', 'application/pkix-cert');
64
+ },
65
+ asDER: (hex, name) => {
66
+ downloadFromBuffer(index.build.Convert.FromString(hex), name, 'cer', 'application/pkix-cert');
67
+ },
68
+ };
69
+ Download.pkcs10 = {
70
+ asPEM: (pem, name) => {
71
+ downloadFromBuffer(index.build.Convert.FromString(pem), name, 'csr', 'application/pkcs10');
72
+ },
73
+ asDER: (hex, name) => {
74
+ downloadFromBuffer(index.build.Convert.FromString(hex), name, 'csr', 'application/pkcs10');
75
+ },
76
+ };
77
+
78
+ exports.Download = Download;
79
+ exports.downloadFromBuffer = downloadFromBuffer;
@@ -5,50 +5,6 @@
5
5
 
6
6
  const _commonjsHelpers = require('./_commonjsHelpers-cb1f949a.js');
7
7
 
8
- /**
9
- * @license
10
- * Copyright (c) Peculiar Ventures, LLC.
11
- *
12
- * This source code is licensed under the MIT license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- */
15
- /**
16
- * Download from buffer
17
- *
18
- * @example
19
- * ```js
20
- * import { downloadFromBuffer } from './utils';
21
- *
22
- * downloadFromBuffer(arrayBufferValue, 'myFile', 'pdf', 'applciation/pdf');
23
- * ```
24
- */
25
- function downloadFromBuffer(value, name, extension, mime = 'application/octet-stream') {
26
- const blob = new Blob([value], { type: mime });
27
- // @ts-ignore
28
- if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL)
29
- // @ts-ignore
30
- navigator.msSaveBlob(blob, `${name}.${extension}`);
31
- return new Promise((res) => setTimeout(res, 100));
32
- }
33
- const blobURL = window.URL.createObjectURL(blob);
34
- const link = document.createElement('a');
35
- const frame = document.createElement('iframe');
36
- link.style.display = 'none';
37
- frame.style.display = 'none';
38
- frame.name = blobURL;
39
- document.body.appendChild(frame);
40
- link.href = blobURL;
41
- link.target = blobURL;
42
- link.download = `${name}.${extension}`;
43
- document.body.appendChild(link);
44
- link.dispatchEvent(new MouseEvent('click'));
45
- document.body.removeChild(link);
46
- return new Promise((res) => setTimeout(() => {
47
- document.body.removeChild(frame);
48
- res(undefined);
49
- }, 100));
50
- }
51
-
52
8
  var build = _commonjsHelpers.createCommonjsModule(function (module, exports) {
53
9
 
54
10
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -407,32 +363,4 @@ exports.combine = combine;
407
363
  exports.isEqual = isEqual;
408
364
  });
409
365
 
410
- /**
411
- * @license
412
- * Copyright (c) Peculiar Ventures, LLC.
413
- *
414
- * This source code is licensed under the MIT license found in the
415
- * LICENSE file in the root directory of this source tree.
416
- */
417
- class Download {
418
- }
419
- Download.x509 = {
420
- asPEM: (pem, name) => {
421
- downloadFromBuffer(build.Convert.FromString(pem), name, 'cer', 'application/pkix-cert');
422
- },
423
- asDER: (hex, name) => {
424
- downloadFromBuffer(build.Convert.FromString(hex), name, 'cer', 'application/pkix-cert');
425
- },
426
- };
427
- Download.pkcs10 = {
428
- asPEM: (pem, name) => {
429
- downloadFromBuffer(build.Convert.FromString(pem), name, 'csr', 'application/pkcs10');
430
- },
431
- asDER: (hex, name) => {
432
- downloadFromBuffer(build.Convert.FromString(hex), name, 'csr', 'application/pkcs10');
433
- },
434
- };
435
-
436
- exports.Download = Download;
437
366
  exports.build = build;
438
- exports.downloadFromBuffer = downloadFromBuffer;
@@ -5,7 +5,8 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const download = require('./download-5e7d5455.js');
8
+ const download = require('./download-6724f3a7.js');
9
+ require('./index-ff818d4d.js');
9
10
  require('./_commonjsHelpers-cb1f949a.js');
10
11
 
11
12
 
@@ -0,0 +1,145 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ 'use strict';
5
+
6
+ const _commonjsHelpers = require('./_commonjsHelpers-cb1f949a.js');
7
+
8
+ var dayjs_min = _commonjsHelpers.createCommonjsModule(function (module, exports) {
9
+ !function(t,e){module.exports=e();}(_commonjsHelpers.commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
10
+ });
11
+
12
+ var relativeTime = _commonjsHelpers.createCommonjsModule(function (module, exports) {
13
+ !function(r,e){module.exports=e();}(_commonjsHelpers.commonjsGlobal,(function(){return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return "function"==typeof M?M(a):M.replace("%s",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)};}}));
14
+ });
15
+
16
+ /**
17
+ * @license
18
+ * Copyright (c) Peculiar Ventures, LLC.
19
+ *
20
+ * This source code is licensed under the MIT license found in the
21
+ * LICENSE file in the root directory of this source tree.
22
+ */
23
+ dayjs_min.extend(relativeTime);
24
+ const dateShort = (date) => (new Date(date).toUTCString());
25
+ const dateDiff = (dateStart, dateEnd) => {
26
+ if (!dateStart || !dateEnd) {
27
+ return '';
28
+ }
29
+ const start = dayjs_min(dateStart);
30
+ const end = dayjs_min(dateEnd);
31
+ return start.to(end, true);
32
+ };
33
+
34
+ const basicInformation = "Basic Information";
35
+ const subjectName = "Subject Name";
36
+ const issuerName = "Issuer Name";
37
+ const publicKeyInfo = "Public Key Info";
38
+ const signature = "Signature";
39
+ const extensions = "Extensions";
40
+ const miscellaneous = "Miscellaneous";
41
+ const download = "Download";
42
+ const serialNumber = "Serial Number";
43
+ const version = "Version";
44
+ const validity = "Validity";
45
+ const issued = "Issued";
46
+ const expired = "Expired";
47
+ const algorithm = "Algorithm";
48
+ const namedCurve = "Named Curve";
49
+ const exponent = "Exponent";
50
+ const modulus = "Modulus";
51
+ const value = "Value";
52
+ const valid = "Valid";
53
+ const revoked = "Revoked";
54
+ const issuer = "Issuer";
55
+ const name = "Name";
56
+ const publicKey = "Public Key";
57
+ const fingerprint = "Fingerprint";
58
+ const fingerprints = "Fingerprints";
59
+ const actions = "Actions";
60
+ const details = "Details";
61
+ const testURLs = "Test URLs";
62
+ const certificateDetails = "Certificate Details";
63
+ const holder = "Holder";
64
+ const digestInfo = "Digest Info";
65
+ const type = "Type";
66
+ const en = {
67
+ basicInformation: basicInformation,
68
+ subjectName: subjectName,
69
+ issuerName: issuerName,
70
+ publicKeyInfo: publicKeyInfo,
71
+ signature: signature,
72
+ extensions: extensions,
73
+ miscellaneous: miscellaneous,
74
+ download: download,
75
+ "download.pem": "Download PEM",
76
+ "download.der": "Download DER",
77
+ serialNumber: serialNumber,
78
+ version: version,
79
+ validity: validity,
80
+ issued: issued,
81
+ expired: expired,
82
+ algorithm: algorithm,
83
+ namedCurve: namedCurve,
84
+ exponent: exponent,
85
+ modulus: modulus,
86
+ value: value,
87
+ valid: valid,
88
+ revoked: revoked,
89
+ issuer: issuer,
90
+ name: name,
91
+ publicKey: publicKey,
92
+ fingerprint: fingerprint,
93
+ fingerprints: fingerprints,
94
+ actions: actions,
95
+ details: details,
96
+ testURLs: testURLs,
97
+ certificateDetails: certificateDetails,
98
+ holder: holder,
99
+ digestInfo: digestInfo,
100
+ type: type
101
+ };
102
+
103
+ /**
104
+ * @license
105
+ * Copyright (c) Peculiar Ventures, LLC.
106
+ *
107
+ * This source code is licensed under the MIT license found in the
108
+ * LICENSE file in the root directory of this source tree.
109
+ */
110
+ const MESSAGES_ALL = {
111
+ en,
112
+ };
113
+ class Localization {
114
+ constructor() {
115
+ this.setLocale = (locale) => {
116
+ this.locale = locale && MESSAGES_ALL[locale] ? locale : 'en';
117
+ };
118
+ this.getLocale = () => this.locale;
119
+ const language = window.navigator.language.slice(0, 2).toLowerCase();
120
+ this.setLocale(language);
121
+ }
122
+ getString(id, replacer) {
123
+ const value = MESSAGES_ALL[this.locale][id];
124
+ if (!value) {
125
+ return '';
126
+ }
127
+ if (!replacer) {
128
+ return value;
129
+ }
130
+ const splitted = value.split(replacer.pattern);
131
+ if (splitted.length > 1) {
132
+ return [
133
+ splitted[0],
134
+ replacer.replacer,
135
+ splitted[1],
136
+ ];
137
+ }
138
+ return value;
139
+ }
140
+ }
141
+ const l10n = new Localization();
142
+
143
+ exports.dateDiff = dateDiff;
144
+ exports.dateShort = dateShort;
145
+ exports.l10n = l10n;
@@ -17,7 +17,7 @@ const patchEsm = () => {
17
17
  const defineCustomElements = (win, options) => {
18
18
  if (typeof window === 'undefined') return Promise.resolve();
19
19
  return patchEsm().then(() => {
20
- return index.bootstrapLazy([["peculiar-attribute-certificate-viewer_9.cjs",[[1,"peculiar-certificate-decoder",{"certificateExample":[1,"certificate-example"],"certificateDecoded":[32]}],[1,"peculiar-attribute-certificate-viewer",{"certificate":[1],"download":[4],"authKeyIdParentLink":[513,"auth-key-id-parent-link"],"authKeyIdSiblingsLink":[513,"auth-key-id-siblings-link"],"subjectKeyIdChildrenLink":[513,"subject-key-id-children-link"],"subjectKeyIdSiblingsLink":[513,"subject-key-id-siblings-link"],"isDecodeInProcess":[32]}],[1,"peculiar-csr-viewer",{"certificate":[513],"download":[4],"subjectKeyIdChildrenLink":[513,"subject-key-id-children-link"],"subjectKeyIdSiblingsLink":[513,"subject-key-id-siblings-link"],"view":[513],"isDecodeInProcess":[32]}],[1,"peculiar-certificate-viewer",{"certificate":[513],"download":[516],"authKeyIdParentLink":[513,"auth-key-id-parent-link"],"authKeyIdSiblingsLink":[513,"auth-key-id-siblings-link"],"subjectKeyIdChildrenLink":[513,"subject-key-id-children-link"],"subjectKeyIdSiblingsLink":[513,"subject-key-id-siblings-link"],"issuerDnLink":[513,"issuer-dn-link"],"view":[513],"isDecodeInProcess":[32]}],[1,"peculiar-button-split",{"onClick":[16],"fill":[1],"actions":[16],"open":[32]}],[1,"peculiar-text-hider",{"opened":[1540]},[[0,"textExpand","textExpandHandler"]]],[1,"peculiar-link",{"href":[513],"type":[513]}],[1,"peculiar-typography",{"type":[513],"color":[1],"align":[1],"ellipsis":[4],"monospace":[4]}],[1,"peculiar-button",{"fill":[1],"disabled":[516],"href":[1],"target":[1],"onClick":[16]}]]],["peculiar-certificate-summary_3.cjs",[[1,"peculiar-certificate-summary",{"certificate":[16],"showIssuer":[4,"show-issuer"]}],[1,"peculiar-circular-progress",{"size":[2],"width":[2]}],[1,"peculiar-highlight-words",{"search":[1]}]]],["peculiar-certificates-viewer.cjs",[[1,"peculiar-certificates-viewer",{"certificates":[16],"filterWithSearch":[4,"filter-with-search"],"highlightWithSearch":[4,"highlight-with-search"],"search":[32],"certificatesDecoded":[32],"expandedRow":[32],"certificateSelectedForDetails":[32],"isDecodeInProcess":[32]}]]]], options);
20
+ return index.bootstrapLazy([["peculiar-button_5.cjs",[[1,"peculiar-button-split",{"onClick":[16],"fill":[1],"actions":[16],"open":[32]}],[1,"peculiar-text-hider",{"opened":[1540]},[[0,"textExpand","textExpandHandler"]]],[1,"peculiar-link",{"href":[513],"type":[513]}],[1,"peculiar-typography",{"type":[513],"color":[1],"align":[1],"ellipsis":[4],"monospace":[4]}],[1,"peculiar-button",{"fill":[1],"disabled":[516],"href":[1],"target":[1],"onClick":[16]}]]],["peculiar-certificates-viewer.cjs",[[1,"peculiar-certificates-viewer",{"certificates":[16],"filterWithSearch":[4,"filter-with-search"],"highlightWithSearch":[4,"highlight-with-search"],"search":[32],"certificatesDecoded":[32],"expandedRow":[32],"certificateSelectedForDetails":[32],"isDecodeInProcess":[32]}]]],["peculiar-attribute-certificate-viewer_2.cjs",[[1,"peculiar-attribute-certificate-viewer",{"certificate":[1],"download":[4],"authKeyIdParentLink":[513,"auth-key-id-parent-link"],"authKeyIdSiblingsLink":[513,"auth-key-id-siblings-link"],"subjectKeyIdChildrenLink":[513,"subject-key-id-children-link"],"subjectKeyIdSiblingsLink":[513,"subject-key-id-siblings-link"],"isDecodeInProcess":[32]}],[1,"peculiar-csr-viewer",{"certificate":[513],"download":[4],"subjectKeyIdChildrenLink":[513,"subject-key-id-children-link"],"subjectKeyIdSiblingsLink":[513,"subject-key-id-siblings-link"],"view":[513],"isDecodeInProcess":[32]}]]],["peculiar-certificate-viewer.cjs",[[1,"peculiar-certificate-viewer",{"certificate":[513],"download":[516],"authKeyIdParentLink":[513,"auth-key-id-parent-link"],"authKeyIdSiblingsLink":[513,"auth-key-id-siblings-link"],"subjectKeyIdChildrenLink":[513,"subject-key-id-children-link"],"subjectKeyIdSiblingsLink":[513,"subject-key-id-siblings-link"],"issuerDnLink":[513,"issuer-dn-link"],"view":[513],"isDecodeInProcess":[32]}]]],["peculiar-certificate-decoder.cjs",[[1,"peculiar-certificate-decoder",{"certificateExample":[1,"certificate-example"],"defaultCertificate":[1,"default-certificate"],"certificateDecoded":[32]}]]],["peculiar-certificate-summary_3.cjs",[[1,"peculiar-certificate-summary",{"certificate":[16],"showIssuer":[4,"show-issuer"]}],[1,"peculiar-circular-progress",{"size":[2],"width":[2]}],[1,"peculiar-highlight-words",{"search":[1]}]]]], options);
21
21
  });
22
22
  };
23
23