@peculiar/fortify-webcomponents
Version:
Web-components for creating CSR or Certificate and viewing certificates list using Fortify
46 lines • 27.9 kB
JavaScript
var __awaiter=this&&this.__awaiter||function(t,e,a,r){function o(t){return t instanceof a?t:new a((function(e){e(t)}))}return new(a||(a=Promise))((function(a,i){function n(t){try{s(r.next(t))}catch(t){i(t)}}function c(t){try{s(r["throw"](t))}catch(t){i(t)}}function s(t){t.done?a(t.value):o(t.value).then(n,c)}s((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,n=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return n.next=c(0),n["throw"]=c(1),n["return"]=c(2),typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function c(t){return function(e){return s([t,e])}}function s(c){if(r)throw new TypeError("Generator is already executing.");while(n&&(n=0,c[0]&&(a=0)),a)try{if(r=1,o&&(i=c[0]&2?o["return"]:c[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;if(o=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:a.label++;return{value:c[1],done:false};case 5:a.label++;o=c[1];c=[0];continue;case 7:c=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){a=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(c[0]===6&&a.label<i[1]){a.label=i[1];i=c;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(c);break}if(i[2])a.ops.pop();a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t];o=0}finally{r=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,a){if(a||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++){if(i||!(r in e)){if(!i)i=Array.prototype.slice.call(e,0,r);i[r]=e[r]}}return t.concat(i||Array.prototype.slice.call(e))};
/*!
* © Peculiar Ventures https://peculiarventures.com/ - BSD 3-Clause License
*/System.register(["./p-xc8K752f.system.js","./p-IrwgPlLQ.system.js","./p-8E_LW63I.system.js","./p-C9-FNG3w.system.js","./p-CLIsej_S.system.js","./p-Cj1Vq6tE.system.js","./p-DUtmbq_i.system.js","./p-Cwe4l13x.system.js"],(function(t){"use strict";var e,a,r,o,i,n,c,s,l,v,p,d,h;return{setters:[function(t){e=t.h;a=t.r;r=t.c;o=t.H},function(t){i=t.X},function(t){n=t.bj;c=t.bk;s=t.bl},function(t){l=t.T},function(t){v=t.B},function(t){p=t.D},function(t){d=t.A;h=t.a},null],execute:function(){
/*!
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
*/
/**
* @license
* Copyright (c) Peculiar Ventures, LLC.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var u=function(t){var a=t.certificate,r=t.showIssuer;var o=function(t,a){return e("tr",null,e("td",null,e(l,{variant:"b2",color:"gray-9"},t)),e("td",null,e(l,{variant:"b2",color:"black"},a)))};return e("table",null,e("tbody",null,o(n.getString("subjectName"),a.subjectToString()),r&&o(n.getString("issuerName"),a.issuerToString()),o(n.getString("serialNumber"),a.serialNumber),o(n.getString("version"),a.version),o(n.getString("validity"),a.validity),o(n.getString("issued"),c(a.notBefore)),o(n.getString("expired"),c(a.notAfter))))};
/*!
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
*/
/**
* @license
* Copyright (c) Peculiar Ventures, LLC.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var b=function(t){var a=t.color,r=a===void 0?"secondary":a;return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"31",fill:"none"},e("path",{fill:"var(--pv-color-".concat(r,")"),d:"M6.71 19.79a1 1 0 0 0-.33-.21 1 1 0 0 0-.76 0 1 1 0 0 0-.33.21 1 1 0 0 0-.21.33 1 1 0 0 0 .21 1.09c.097.088.209.16.33.21a.94.94 0 0 0 .76 0 1.15 1.15 0 0 0 .33-.21 1 1 0 0 0 .21-1.09 1 1 0 0 0-.21-.33ZM10 11.5h14a1 1 0 0 0 0-2H10a1 1 0 0 0 0 2Zm-3.29 3.29a1 1 0 0 0-1.09-.21 1.15 1.15 0 0 0-.33.21 1 1 0 0 0-.21.33.94.94 0 0 0 0 .76c.05.121.122.233.21.33.097.088.209.16.33.21a.94.94 0 0 0 .76 0 1.15 1.15 0 0 0 .33-.21 1.15 1.15 0 0 0 .21-.33.94.94 0 0 0 0-.76 1 1 0 0 0-.21-.33ZM24 14.5H10a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2ZM6.71 9.79a1 1 0 0 0-.33-.21 1 1 0 0 0-1.09.21 1.15 1.15 0 0 0-.21.33.94.94 0 0 0 0 .76c.05.121.122.233.21.33.097.088.209.16.33.21a1 1 0 0 0 1.09-.21 1.15 1.15 0 0 0 .21-.33.94.94 0 0 0 0-.76 1.15 1.15 0 0 0-.21-.33ZM24 19.5H10a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2Z"}))};
/*!
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
*/
/**
* @license
* Copyright (c) Peculiar Ventures, LLC.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var g=function(t){var a=t.color,r=a===void 0?"secondary":a;return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"31",fill:"none"},e("path",{fill:"var(--pv-color-".concat(r,")"),d:"M21 14.32a1 1 0 0 0-1 1v7.18a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-11a1 1 0 0 1 1-1h7.18a1 1 0 0 0 0-2H8a3 3 0 0 0-3 3v11a3 3 0 0 0 3 3h11a3 3 0 0 0 3-3v-7.18a1 1 0 0 0-1-1Zm3.92-8.2a1 1 0 0 0-.54-.54A1 1 0 0 0 24 5.5h-6a1 1 0 1 0 0 2h3.59l-10.3 10.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219L23 8.91v3.59a1 1 0 0 0 2 0v-6a1.001 1.001 0 0 0-.08-.38Z"}))};
/*!
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
*/
/**
* @license
* Copyright (c) Peculiar Ventures, LLC.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var f=function(t){var a=t.color,r=a===void 0?"gray-9":a;return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",fill:"none"},e("path",{fill:"var(--pv-color-".concat(r,")"),"fill-rule":"evenodd",d:"m16.37 15 5.442 5.44c.25.252.25.663 0 .914l-.459.457a.646.646 0 0 1-.913 0L15 16.371l-5.44 5.44a.648.648 0 0 1-.915 0l-.457-.457a.649.649 0 0 1 0-.913L13.63 15 8.188 9.56a.649.649 0 0 1 0-.914l.457-.457a.648.648 0 0 1 .915 0l5.44 5.44 5.44-5.44a.646.646 0 0 1 .913 0l.46.457c.25.25.25.662 0 .913L16.37 15Z","clip-rule":"evenodd"}))};var y=function(){return"*{-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:calc(var(--pv-size-base) * 6);min-width:calc(var(--pv-size-base) * 6);padding:0 calc(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:calc(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%;word-wrap:break-word;min-width:280px;overflow:auto;position:relative}.search_section{padding:calc(var(--pv-size-base) * 4);border-bottom:1px solid var(--pv-color-gray-4)}.input_search{height:calc(var(--pv-size-base) * 8);width:100%;outline:none;background-color:var(--pv-color-gray-1);padding:0 calc(var(--pv-size-base) * 2);border:1px solid var(--pv-color-gray-7);border-radius:4px;-webkit-transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s;transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s}.input_search::-webkit-input-placeholder{color:var(--pv-color-gray-9)}.input_search::-moz-placeholder{color:var(--pv-color-gray-9)}.input_search:-ms-input-placeholder{color:var(--pv-color-gray-9)}.input_search::-ms-input-placeholder{color:var(--pv-color-gray-9)}.input_search::placeholder{color:var(--pv-color-gray-9)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table td,table th{border-bottom:1px solid var(--pv-color-gray-4);vertical-align:top;text-align:left}table td:first-child,table th:first-child{padding-right:0;width:calc(var(--pv-size-base) * 10)}table td:last-child,table th:last-child{padding-left:0;width:calc(var(--pv-size-base) * 10)}table th{padding:calc(var(--pv-size-base) * 2) calc(var(--pv-size-base) * 4)}table th.col_action{padding:0}table td{padding:calc(var(--pv-size-base) * 4)}table tr.m_expanded{background:var(--pv-color-gray-1)}table tr.m_expanded>td{border-bottom:none}table tr.expanded_summary{background:var(--pv-color-gray-1)}table tr.expanded_summary table{table-layout:initial}table tr.expanded_summary table td{border-bottom:none;padding:calc(var(--pv-size-base) * 2)}table tr.expanded_summary table td:first-child{width:200px}table tr.expanded_summary table td:last-child{width:auto}.button_table_cell{margin-top:-3px}.status_wrapper{text-align:center;height:calc(var(--pv-size-base) * 16);vertical-align:middle}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.modal_backdrop{background:var(--pv-color-black);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0;opacity:0.5}.modal_container{background:var(--pv-color-white);width:100%;display:-ms-flexbox;display:flex;max-height:calc(100% - 60px);-ms-flex-direction:column;flex-direction:column;margin:calc(var(--pv-size-base) * 6);position:relative;outline:none;-webkit-box-shadow:var(--pv-shadow-dark-hight);box-shadow:var(--pv-shadow-dark-hight);overflow:hidden;border:0px;padding:0px;max-width:640px;border-radius:4px}.modal_header{padding:calc(var(--pv-size-base) * 3) calc(var(--pv-size-base) * 4);display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;gap:calc(var(--pv-size-base) * 2);border-bottom:1px solid var(--pv-color-gray-5)}.modal_content{-ms-flex:1 1 auto;flex:1 1 auto;overflow:auto}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tbody,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block;width:100% !important;padding:0;border:none}:host([data-mobile-screen-view=true]) thead{display:none}:host([data-mobile-screen-view=true]) table tr{padding:calc(var(--pv-size-base) * 2) 0}:host([data-mobile-screen-view=true]) table .expanded_summary{padding:0}:host([data-mobile-screen-view=true]) table .certificate_row{border-bottom:1px solid var(--pv-color-gray-5);padding:calc(var(--pv-size-base) * 2) calc(var(--pv-size-base) * 4)}:host([data-mobile-screen-view=true]) table .certificate_row_actions{padding-top:calc(var(--pv-size-base) * 6)}:host([data-mobile-screen-view=true]) table .certificate_row_actions td{display:-ms-flexbox;display:flex;-ms-flex-pack:right;justify-content:right;gap:calc(var(--pv-size-base) * 4)}:host([data-mobile-screen-view=true]) .button_table_cell{margin-top:0}"};var w=t("peculiar_certificates_viewer",function(){function t(t){var e=this;a(this,t);this.detailsOpen=r(this,"detailsOpen");this.detailsClose=r(this,"detailsClose");this.isHasRoots=false;this.certificates=[];this.filterWithSearch=true;this.highlightWithSearch=true;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.search="";this.certificatesDecoded=[];this.isDecodeInProcess=true;this.handleClickDetails=function(t){e.certificateSelectedForDetails=t;e.detailsOpen.emit(t)};this.handleModalClose=function(){e.certificateSelectedForDetails=undefined;e.detailsClose.emit()};this.handleSearch=function(t){var a=t.target;e.search=a.value.trim()}}t.prototype.handleMediaQueryChange=function(t){this.mobileScreenView=t.matches};t.prototype.componentWillLoad=function(){this.certificatesDecodeAndSet();{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};t.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};t.prototype.watchCertificates=function(t,e){if(JSON.stringify(t)!==JSON.stringify(e)){this.certificatesDecodeAndSet()}};t.prototype.certificatesDecodeAndSet=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,a,r,o,n,c;return __generator(this,(function(s){switch(s.label){case 0:t=false;if(!Array.isArray(this.certificates)){return[2]}e=[];a=0,r=this.certificates;s.label=1;case 1:if(!(a<r.length))return[3,6];o=r[a];s.label=2;case 2:s.trys.push([2,4,,5]);n=new i(o.value);return[4,n.getThumbprint("SHA-1")];case 3:s.sent();e.push({body:n,tests:o.tests,name:o.name});if(!t&&n.isRoot){t=true}return[3,5];case 4:c=s.sent();console.error("Error certificate parse:",c);return[3,5];case 5:a++;return[3,1];case 6:this.isHasRoots=t;this.isDecodeInProcess=false;this.certificatesDecoded=e;return[2]}}))}))};t.prototype.getCertificateName=function(t){if(typeof t.name==="function"){return t.name(t.body)}return t.name||t.body.commonName};t.prototype.handleClickDownloadAsPem=function(t){t.body.downloadAsPEM(this.getCertificateName(t))};t.prototype.handleClickDownloadAsDer=function(t){t.body.downloadAsDER(this.getCertificateName(t))};t.prototype.handleClickRow=function(t){var e=this.expandedRow===t;this.expandedRow=e?undefined:t};t.prototype.getMaxColSpanValue=function(){var t=5;if(!this.isHasRoots){t+=1}return t};t.prototype.renderCertificateButtonActions=function(t){var a=this;var r,o,i;var c=t.tests&&(t.tests.expired||t.tests.revoked||t.tests.valid);return e("peculiar-button-menu",{class:"button_table_cell",groups:__spreadArray([{title:n.getString("previewCertificate"),options:[{text:n.getString("viewDetails"),startIcon:e(b,null),onClick:function(){return a.handleClickDetails(t.body)}}]},{title:n.getString("downloadOptions"),options:[{text:n.getString("download.pem"),startIcon:e(p,null),onClick:function(){return a.handleClickDownloadAsPem(t)}},{text:n.getString("download.der"),startIcon:e(p,null),onClick:function(){return a.handleClickDownloadAsDer(t)}}]}],c?[{title:n.getString("testURLs"),options:__spreadArray(__spreadArray(__spreadArray([],((r=t.tests)===null||r===void 0?void 0:r.valid)?[{text:n.getString("valid"),href:t.tests.valid,startIcon:e(g,null)}]:[],true),((o=t.tests)===null||o===void 0?void 0:o.revoked)?[{text:n.getString("revoked"),href:t.tests.revoked,startIcon:e(g,null)}]:[],true),((i=t.tests)===null||i===void 0?void 0:i.expired)?[{text:n.getString("expired"),href:t.tests.expired,startIcon:e(g,null)}]:[],true)}]:[],true)})};t.prototype.renderExpandedRow=function(t){var a=this.getMaxColSpanValue()-2;return e("tr",{class:"expanded_summary"},e("td",null),e("td",{colSpan:a},e(u,{certificate:t,showIssuer:!t.isRoot})),e("td",null))};t.prototype.renderCertificatesRows=function(){var t=this;var a=this.highlightWithSearch?this.search:"";var r=[];this.certificatesDecoded.forEach((function(o,i){var c=i===t.expandedRow;var p=s[o.body.signature.algorithm]||o.body.signature.algorithm;if(t.filterWithSearch&&t.search){var u=[p,o.body.issuerCommonName,t.getCertificateName(o),o.body.thumbprints["SHA-1"]].join(" ").toLowerCase();if(u.indexOf(t.search.toLowerCase())===-1){return}}if(t.mobileScreenView){r.push([e("tr",{class:{certificate_row:true,m_expanded:c},key:o.body.thumbprints["SHA-1"]},e("td",null,e("table",null,e("tbody",null,!t.isHasRoots&&e("tr",null,e("td",null,e(l,{variant:"b2",color:"gray-9"},n.getString("issuer"))),e("td",null,e(l,{variant:"b2",color:"black"},e("peculiar-highlight-words",{search:a},o.body.issuerCommonName)))),e("tr",null,e("td",null,e(l,{variant:"b2",color:"gray-9"},n.getString("name"))),e("td",null,e(l,{variant:"b2",color:"black"},e("peculiar-highlight-words",{search:a},t.getCertificateName(o))))),e("tr",null,e("td",null,e(l,{variant:"b2",color:"gray-9"},n.getString("publicKey"))),e("td",null,e(l,{variant:"b2",color:"black"},e("peculiar-highlight-words",{search:a},p)))),e("tr",null,e("td",null,e(l,{variant:"b2",color:"gray-9"},n.getString("fingerprint")," (SHA-1)")),e("td",null,e(l,{variant:"b2",color:"black"},e("peculiar-highlight-words",{search:a},o.body.thumbprints["SHA-1"])))),c&&t.renderExpandedRow(o.body),e("tr",{class:"certificate_row_actions"},e("td",null,t.renderCertificateButtonActions(o),e(v,{startIcon:c?e(d,null):e(h,null),onClick:t.handleClickRow.bind(t,i)})))))))]);return}r.push([e("tr",{class:{m_expanded:c},key:o.body.thumbprints["SHA-1"]},e("td",null,e(v,{startIcon:c?e(d,null):e(h,null),class:"button_table_cell",onClick:t.handleClickRow.bind(t,i)})),!t.isHasRoots&&e("td",null,e(l,null,e("peculiar-highlight-words",{search:a},o.body.issuerCommonName))),e("td",null,e(l,null,e("peculiar-highlight-words",{search:a},t.getCertificateName(o)))),e("td",null,e(l,null,e("peculiar-highlight-words",{search:a},p))),e("td",null,e(l,null,e("peculiar-highlight-words",{search:a},o.body.thumbprints["SHA-1"]))),e("td",null,t.renderCertificateButtonActions(o))),c&&t.renderExpandedRow(o.body)])}));return r};t.prototype.renderCertificateDetailsModal=function(){if(!this.certificateSelectedForDetails){return null}return e("div",{class:"modal_wrapper",role:"presentation","aria-hidden":"false",part:"presentation"},e("div",{class:"modal_backdrop","aria-hidden":"true",onClick:this.handleModalClose}),e("div",{class:"modal_container",role:"dialog",part:"presentation_container"},e("header",{class:"modal_header"},e(l,{variant:"h4"},n.getString("certificateDetails")),e(v,{startIcon:e(f,null),onClick:this.handleModalClose})),e("div",{class:"modal_content"},e("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails,mobileMediaQueryString:this.mobileMediaQueryString}))))};t.prototype.renderSearch=function(){if(!this.filterWithSearch&&!this.highlightWithSearch){return null}return e("div",{class:"search_section"},e("input",{type:"search",value:"",class:"input_search t-b3 c-black",disabled:!this.certificatesDecoded.length,placeholder:"Search",onInput:this.handleSearch}))};t.prototype.renderEmptyState=function(){var t=this.getMaxColSpanValue();return e("tr",null,e("td",{class:"status_wrapper",colSpan:t},e(l,{variant:"b1"},"There are no certificates available.")))};t.prototype.renderEmptySearchState=function(){var t=this.getMaxColSpanValue();return e("tr",null,e("td",{class:"status_wrapper",colSpan:t},e(l,{variant:"b1"},"No results found for “",this.search,"“")))};t.prototype.renderLoadingState=function(){return e("div",{class:"loading_container"},e("peculiar-circular-progress",null))};t.prototype.renderTableBody=function(){if(this.isDecodeInProcess){return null}if(!this.certificatesDecoded.length){return this.renderEmptyState()}var t=this.renderCertificatesRows();if(this.search&&!t.length){return this.renderEmptySearchState()}return t};t.prototype.render=function(){return e(o,{key:"894edb33a53c1128d812c2fd7a5b230a4b13493c","data-mobile-screen-view":String(this.mobileScreenView)},this.renderSearch(),e("table",{key:"998d37ab98be6743f1564fafb4ce9fc70b79e358"},!this.mobileScreenView&&e("thead",{key:"4728e09450b6285cbc2f69cf0a0e06135910558f"},e("tr",{key:"70bf5be60e50b9d7109e27128b661044778e0ded"},e("th",{key:"cf0fef5df1b42d0bce49d3bf0af2d91b82de6d05"}),!this.isHasRoots&&e("th",{key:"59f00d345883dfb3c81a97278583821543ce6808",class:"col_issuer"},e(l,{key:"54ce8fba1ab5355ac1f82ccc3aa62945351a3632",variant:"s2"},n.getString("issuer"))),e("th",{key:"9aea7911edafca1482f31e2ca3316d2cde40fd78",class:"col_name"},e(l,{key:"2a0145b0cc56543ed4b5170a8773c3c43e5e64f9",variant:"s2"},n.getString("name"))),e("th",{key:"9eab414d9b1558d6a5b9938f55165aeca5baa54e",class:"col_public_key"},e(l,{key:"cbdcb1013bbf12ac88e63ca2d268c55854803297",variant:"s2"},n.getString("publicKey"))),e("th",{key:"06adb89146693583a0dad86644b2c8b399e25c0e",class:"col_fingerprint"},e(l,{key:"eca0440721f16953219f014edb8d3742f312f704",variant:"s2"},n.getString("fingerprint")," (SHA-1)")),e("th",{key:"56b7fdf83f5c45cf524a8cce81dbca584b9b5fa8"}))),e("tbody",{key:"01ccda1abfa846a8b0cdc00588b106398358ed88"},this.renderTableBody())),this.renderCertificateDetailsModal(),this.isDecodeInProcess&&this.renderLoadingState())};Object.defineProperty(t,"watchers",{get:function(){return{certificates:["watchCertificates"]}},enumerable:false,configurable:true});return t}());w.style=y()}}}));
//# sourceMappingURL=p-c4cabe30.system.entry.js.map