@peculiar/fortify-webcomponents
Version:
Web-components for creating CSR or Certificate and viewing certificates list using Fortify
63 lines (59 loc) • 126 kB
JavaScript
/*!
* © Peculiar Ventures https://peculiarventures.com/ - BSD 3-Clause License
*/
import{k as t,bo as e,bd as n,bf as r,b9 as i,b5 as s,a$ as a,bg as o,b1 as c,bc as h,bh as u,b6 as f,H as l,F as v,bp as d,bq as p,br as w,bs as m,bt as y,a as b,i as g,E as z,bu as A,bv as S,bw as k,bx as E,by as C,bz as x,bA as M,b as P,aD as O,bB as _,bC as T,bD as H,bE as $,bF as j,bG as I,bH as R,bI as W,c as N,bJ as K,bK as D,bL as V,bM as B,aF as U,az as F,av as L,ap as Z,aG as G,bN as q,bO as J,ar as X,bP as Q,bQ as Y,bR as tt,aC as et,aH as nt,bS as rt,bT as it,bU as st,bV as at,u as ot,bW as ct,a4 as ht,bX as ut,O as ft,bY as lt,R as vt,bZ as dt,b_ as pt,bn as wt,b$ as mt,c0 as yt,q as bt,c1 as gt,c2 as zt,c3 as At,c4 as St,C as kt,c5 as Et,c6 as Ct,c7 as xt,a0 as Mt,c8 as Pt,c9 as Ot,ca as _t,cb as Tt,cc as Ht,cd as $t,ce as jt,cf as It,cg as Rt,ch as Wt,r as Nt,a_ as Kt,ao as Dt}from"./p-CDwMJyak.js";import{a as Vt}from"./p-CvvoEL7F.js";import{h as Bt}from"./p-BA3hMeq-.js";import{getString as Ut}from"./index.esm.js";import{T as Ft}from"./p-DLAyyF7V.js";
/**
* @license
* Copyright (c) Peculiar Ventures, LLC.
*
* This source code is licensed under the BSD 3-Clause license found in the
* LICENSE file in the root directory of this source tree.
*/if(!Uint8Array.prototype.slice){Object.defineProperty(Uint8Array.prototype,"slice",{value(t,e){return new Uint8Array(Array.prototype.slice.call(this,t,e))}})}const Lt=async()=>{if(!window["protobuf"]){await import("./p-SA_8Wd-A.js").then((function(t){return t.p}))}if(!window["WebcryptoSocket"]){await import("./p-MMsUlh4G.js")}};var Zt=/iPhone/i;var Gt=/iPod/i;var qt=/iPad/i;var Jt=/\biOS-universal(?:.+)Mac\b/i;var Xt=/\bAndroid(?:.+)Mobile\b/i;var Qt=/Android/i;var Yt=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i;var te=/Silk/i;var ee=/Windows Phone/i;var ne=/\bWindows(?:.+)ARM\b/i;var re=/BlackBerry/i;var ie=/BB10/i;var se=/Opera Mini/i;var ae=/\b(CriOS|Chrome)(?:.+)Mobile/i;var oe=/Mobile(?:.+)Firefox\b/i;var ce=function(t){return typeof t!=="undefined"&&t.platform==="MacIntel"&&typeof t.maxTouchPoints==="number"&&t.maxTouchPoints>1&&typeof MSStream==="undefined"};function he(t){return function(e){return e.test(t)}}function ue(t){var e={userAgent:"",platform:"",maxTouchPoints:0};if(!t&&typeof navigator!=="undefined"){e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}}else if(typeof t==="string"){e.userAgent=t}else if(t&&t.userAgent){e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}}var n=e.userAgent;var r=n.split("[FBAN");if(typeof r[1]!=="undefined"){n=r[0]}r=n.split("Twitter");if(typeof r[1]!=="undefined"){n=r[0]}var i=he(n);var s={apple:{phone:i(Zt)&&!i(ee),ipod:i(Gt),tablet:!i(Zt)&&(i(qt)||ce(e))&&!i(ee),universal:i(Jt),device:(i(Zt)||i(Gt)||i(qt)||i(Jt)||ce(e))&&!i(ee)},amazon:{phone:i(Yt),tablet:!i(Yt)&&i(te),device:i(Yt)||i(te)},android:{phone:!i(ee)&&i(Yt)||!i(ee)&&i(Xt),tablet:!i(ee)&&!i(Yt)&&!i(Xt)&&(i(te)||i(Qt)),device:!i(ee)&&(i(Yt)||i(te)||i(Xt)||i(Qt))||i(/\bokhttp\b/i)},windows:{phone:i(ee),tablet:i(ne),device:i(ee)||i(ne)},other:{blackberry:i(re),blackberry10:i(ie),opera:i(se),firefox:i(oe),chrome:i(ae),device:i(re)||i(ie)||i(se)||i(oe)||i(ae)},any:false,phone:false,tablet:false};s.any=s.apple.device||s.android.device||s.windows.device||s.other.device;s.phone=s.apple.phone||s.android.phone||s.windows.phone;s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet;return s}var fe={};
/*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var le;function ve(){if(le)return fe;le=1;var e;(function(e){(function(n){var r=typeof globalThis==="object"?globalThis:typeof t==="object"?t:typeof self==="object"?self:typeof this==="object"?this:c();var i=s(e);if(typeof r.Reflect!=="undefined"){i=s(r.Reflect,i)}n(i,r);if(typeof r.Reflect==="undefined"){r.Reflect=e}function s(t,e){return function(n,r){Object.defineProperty(t,n,{configurable:true,writable:true,value:r});if(e)e(n,r)}}function a(){try{return Function("return this;")()}catch(t){}}function o(){try{return(0,eval)("(function() { return this; })()")}catch(t){}}function c(){return a()||o()}})((function(t,e){var n=Object.prototype.hasOwnProperty;var r=typeof Symbol==="function";var i=r&&typeof Symbol.toPrimitive!=="undefined"?Symbol.toPrimitive:"@@toPrimitive";var s=r&&typeof Symbol.iterator!=="undefined"?Symbol.iterator:"@@iterator";var a=typeof Object.create==="function";var o={__proto__:[]}instanceof Array;var c=!a&&!o;var h={create:a?function(){return ft(Object.create(null))}:o?function(){return ft({__proto__:null})}:function(){return ft({})},has:c?function(t,e){return n.call(t,e)}:function(t,e){return e in t},get:c?function(t,e){return n.call(t,e)?t[e]:undefined}:function(t,e){return t[e]}};var u=Object.getPrototypeOf(Function);var f=typeof Map==="function"&&typeof Map.prototype.entries==="function"?Map:ct();var l=typeof Set==="function"&&typeof Set.prototype.entries==="function"?Set:ht();var v=typeof WeakMap==="function"?WeakMap:ut();var d=r?Symbol.for("@reflect-metadata:registry"):undefined;var p=it();var w=st(p);function m(t,e,n,r){if(!R(n)){if(!L(t))throw new TypeError;if(!K(e))throw new TypeError;if(!K(r)&&!R(r)&&!W(r))throw new TypeError;if(W(r))r=undefined;n=F(n);return M(t,e,n,r)}else{if(!L(t))throw new TypeError;if(!G(e))throw new TypeError;return x(t,e)}}t("decorate",m);function y(t,e){function n(n,r){if(!K(n))throw new TypeError;if(!R(r)&&!q(r))throw new TypeError;H(t,e,n,r)}return n}t("metadata",y);function b(t,e,n,r){if(!K(n))throw new TypeError;if(!R(r))r=F(r);return H(t,e,n,r)}t("defineMetadata",b);function g(t,e,n){if(!K(e))throw new TypeError;if(!R(n))n=F(n);return P(t,e,n)}t("hasMetadata",g);function z(t,e,n){if(!K(e))throw new TypeError;if(!R(n))n=F(n);return O(t,e,n)}t("hasOwnMetadata",z);function A(t,e,n){if(!K(e))throw new TypeError;if(!R(n))n=F(n);return _(t,e,n)}t("getMetadata",A);function S(t,e,n){if(!K(e))throw new TypeError;if(!R(n))n=F(n);return T(t,e,n)}t("getOwnMetadata",S);function k(t,e){if(!K(t))throw new TypeError;if(!R(e))e=F(e);return $(t,e)}t("getMetadataKeys",k);function E(t,e){if(!K(t))throw new TypeError;if(!R(e))e=F(e);return j(t,e)}t("getOwnMetadataKeys",E);function C(t,e,n){if(!K(e))throw new TypeError;if(!R(n))n=F(n);if(!K(e))throw new TypeError;if(!R(n))n=F(n);var r=ot(e,n,false);if(R(r))return false;return r.OrdinaryDeleteMetadata(t,e,n)}t("deleteMetadata",C);function x(t,e){for(var n=t.length-1;n>=0;--n){var r=t[n];var i=r(e);if(!R(i)&&!W(i)){if(!G(i))throw new TypeError;e=i}}return e}function M(t,e,n,r){for(var i=t.length-1;i>=0;--i){var s=t[i];var a=s(e,n,r);if(!R(a)&&!W(a)){if(!K(a))throw new TypeError;r=a}}return r}function P(t,e,n){var r=O(t,e,n);if(r)return true;var i=nt(e);if(!W(i))return P(t,i,n);return false}function O(t,e,n){var r=ot(e,n,false);if(R(r))return false;return B(r.OrdinaryHasOwnMetadata(t,e,n))}function _(t,e,n){var r=O(t,e,n);if(r)return T(t,e,n);var i=nt(e);if(!W(i))return _(t,i,n);return undefined}function T(t,e,n){var r=ot(e,n,false);if(R(r))return;return r.OrdinaryGetOwnMetadata(t,e,n)}function H(t,e,n,r){var i=ot(n,r,true);i.OrdinaryDefineOwnMetadata(t,e,n,r)}function $(t,e){var n=j(t,e);var r=nt(t);if(r===null)return n;var i=$(r,e);if(i.length<=0)return n;if(n.length<=0)return i;var s=new l;var a=[];for(var o=0,c=n;o<c.length;o++){var h=c[o];var u=s.has(h);if(!u){s.add(h);a.push(h)}}for(var f=0,v=i;f<v.length;f++){var h=v[f];var u=s.has(h);if(!u){s.add(h);a.push(h)}}return a}function j(t,e){var n=ot(t,e,false);if(!n){return[]}return n.OrdinaryOwnMetadataKeys(t,e)}function I(t){if(t===null)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return t===null?1:6;default:return 6}}function R(t){return t===undefined}function W(t){return t===null}function N(t){return typeof t==="symbol"}function K(t){return typeof t==="object"?t!==null:typeof t==="function"}function D(t,e){switch(I(t)){case 0:return t;case 1:return t;case 2:return t;case 3:return t;case 4:return t;case 5:return t}var n="string";var r=X(t,i);if(r!==undefined){var s=r.call(t,n);if(K(s))throw new TypeError;return s}return V(t)}function V(t,e){var n,r,i;{var s=t.toString;if(Z(s)){var r=s.call(t);if(!K(r))return r}var n=t.valueOf;if(Z(n)){var r=n.call(t);if(!K(r))return r}}throw new TypeError}function B(t){return!!t}function U(t){return""+t}function F(t){var e=D(t);if(N(e))return e;return U(e)}function L(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:Object.prototype.toString.call(t)==="[object Array]"}function Z(t){return typeof t==="function"}function G(t){return typeof t==="function"}function q(t){switch(I(t)){case 3:return true;case 4:return true;default:return false}}function J(t,e){return t===e||t!==t&&e!==e}function X(t,e){var n=t[e];if(n===undefined||n===null)return undefined;if(!Z(n))throw new TypeError;return n}function Q(t){var e=X(t,s);if(!Z(e))throw new TypeError;var n=e.call(t);if(!K(n))throw new TypeError;return n}function Y(t){return t.value}function tt(t){var e=t.next();return e.done?false:e}function et(t){var e=t["return"];if(e)e.call(t)}function nt(t){var e=Object.getPrototypeOf(t);if(typeof t!=="function"||t===u)return e;if(e!==u)return e;var n=t.prototype;var r=n&&Object.getPrototypeOf(n);if(r==null||r===Object.prototype)return e;var i=r.constructor;if(typeof i!=="function")return e;if(i===t)return e;return i}function rt(){var t;if(!R(d)&&typeof e.Reflect!=="undefined"&&!(d in e.Reflect)&&typeof e.Reflect.defineMetadata==="function"){t=at(e.Reflect)}var n;var r;var i;var s=new v;var a={registerProvider:o,getProvider:h,setProvider:p};return a;function o(e){if(!Object.isExtensible(a)){throw new Error("Cannot add provider to a frozen registry.")}switch(true){case t===e:break;case R(n):n=e;break;case n===e:break;case R(r):r=e;break;case r===e:break;default:if(i===undefined)i=new l;i.add(e);break}}function c(e,s){if(!R(n)){if(n.isProviderFor(e,s))return n;if(!R(r)){if(r.isProviderFor(e,s))return n;if(!R(i)){var a=Q(i);while(true){var o=tt(a);if(!o){return undefined}var c=Y(o);if(c.isProviderFor(e,s)){et(a);return c}}}}}if(!R(t)&&t.isProviderFor(e,s)){return t}return undefined}function h(t,e){var n=s.get(t);var r;if(!R(n)){r=n.get(e)}if(!R(r)){return r}r=c(t,e);if(!R(r)){if(R(n)){n=new f;s.set(t,n)}n.set(e,r)}return r}function u(t){if(R(t))throw new TypeError;return n===t||r===t||!R(i)&&i.has(t)}function p(t,e,n){if(!u(n)){throw new Error("Metadata provider not registered.")}var r=h(t,e);if(r!==n){if(!R(r)){return false}var i=s.get(t);if(R(i)){i=new f;s.set(t,i)}i.set(e,n)}return true}}function it(){var t;if(!R(d)&&K(e.Reflect)&&Object.isExtensible(e.Reflect)){t=e.Reflect[d]}if(R(t)){t=rt()}if(!R(d)&&K(e.Reflect)&&Object.isExtensible(e.Reflect)){Object.defineProperty(e.Reflect,d,{enumerable:false,configurable:false,writable:false,value:t})}return t}function st(t){var e=new v;var n={isProviderFor:function(t,n){var r=e.get(t);if(R(r))return false;return r.has(n)},OrdinaryDefineOwnMetadata:a,OrdinaryHasOwnMetadata:i,OrdinaryGetOwnMetadata:s,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:c};p.registerProvider(n);return n;function r(r,i,s){var a=e.get(r);var o=false;if(R(a)){if(!s)return undefined;a=new f;e.set(r,a);o=true}var c=a.get(i);if(R(c)){if(!s)return undefined;c=new f;a.set(i,c);if(!t.setProvider(r,i,n)){a.delete(i);if(o){e.delete(r)}throw new Error("Wrong provider for target.")}}return c}function i(t,e,n){var i=r(e,n,false);if(R(i))return false;return B(i.has(t))}function s(t,e,n){var i=r(e,n,false);if(R(i))return undefined;return i.get(t)}function a(t,e,n,i){var s=r(n,i,true);s.set(t,e)}function o(t,e){var n=[];var i=r(t,e,false);if(R(i))return n;var s=i.keys();var a=Q(s);var o=0;while(true){var c=tt(a);if(!c){n.length=o;return n}var h=Y(c);try{n[o]=h}catch(t){try{et(a)}finally{throw t}}o++}}function c(t,n,i){var s=r(n,i,false);if(R(s))return false;if(!s.delete(t))return false;if(s.size===0){var a=e.get(n);if(!R(a)){a.delete(i);if(a.size===0){e.delete(a)}}}return true}}function at(t){var e=t.defineMetadata,n=t.hasOwnMetadata,r=t.getOwnMetadata,i=t.getOwnMetadataKeys,s=t.deleteMetadata;var a=new v;var o={isProviderFor:function(t,e){var n=a.get(t);if(!R(n)&&n.has(e)){return true}if(i(t,e).length){if(R(n)){n=new l;a.set(t,n)}n.add(e);return true}return false},OrdinaryDefineOwnMetadata:e,OrdinaryHasOwnMetadata:n,OrdinaryGetOwnMetadata:r,OrdinaryOwnMetadataKeys:i,OrdinaryDeleteMetadata:s};return o}function ot(t,e,n){var r=p.getProvider(t,e);if(!R(r)){return r}if(n){if(p.setProvider(t,e,w)){return w}throw new Error("Illegal state.")}return undefined}function ct(){var t={};var e=[];var n=function(){function t(t,e,n){this._index=0;this._keys=t;this._values=e;this._selector=n}t.prototype["@@iterator"]=function(){return this};t.prototype[s]=function(){return this};t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);if(t+1>=this._keys.length){this._index=-1;this._keys=e;this._values=e}else{this._index++}return{value:n,done:false}}return{value:undefined,done:true}};t.prototype.throw=function(t){if(this._index>=0){this._index=-1;this._keys=e;this._values=e}throw t};t.prototype.return=function(t){if(this._index>=0){this._index=-1;this._keys=e;this._values=e}return{value:t,done:true}};return t}();var r=function(){function e(){this._keys=[];this._values=[];this._cacheKey=t;this._cacheIndex=-2}Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:true,configurable:true});e.prototype.has=function(t){return this._find(t,false)>=0};e.prototype.get=function(t){var e=this._find(t,false);return e>=0?this._values[e]:undefined};e.prototype.set=function(t,e){var n=this._find(t,true);this._values[n]=e;return this};e.prototype.delete=function(e){var n=this._find(e,false);if(n>=0){var r=this._keys.length;for(var i=n+1;i<r;i++){this._keys[i-1]=this._keys[i];this._values[i-1]=this._values[i]}this._keys.length--;this._values.length--;if(J(e,this._cacheKey)){this._cacheKey=t;this._cacheIndex=-2}return true}return false};e.prototype.clear=function(){this._keys.length=0;this._values.length=0;this._cacheKey=t;this._cacheIndex=-2};e.prototype.keys=function(){return new n(this._keys,this._values,i)};e.prototype.values=function(){return new n(this._keys,this._values,a)};e.prototype.entries=function(){return new n(this._keys,this._values,o)};e.prototype["@@iterator"]=function(){return this.entries()};e.prototype[s]=function(){return this.entries()};e.prototype._find=function(t,e){if(!J(this._cacheKey,t)){this._cacheIndex=-1;for(var n=0;n<this._keys.length;n++){if(J(this._keys[n],t)){this._cacheIndex=n;break}}}if(this._cacheIndex<0&&e){this._cacheIndex=this._keys.length;this._keys.push(t);this._values.push(undefined)}return this._cacheIndex};return e}();return r;function i(t,e){return t}function a(t,e){return e}function o(t,e){return[t,e]}}function ht(){var t=function(){function t(){this._map=new f}Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:true,configurable:true});t.prototype.has=function(t){return this._map.has(t)};t.prototype.add=function(t){return this._map.set(t,t),this};t.prototype.delete=function(t){return this._map.delete(t)};t.prototype.clear=function(){this._map.clear()};t.prototype.keys=function(){return this._map.keys()};t.prototype.values=function(){return this._map.keys()};t.prototype.entries=function(){return this._map.entries()};t.prototype["@@iterator"]=function(){return this.keys()};t.prototype[s]=function(){return this.keys()};return t}();return t}function ut(){var t=16;var e=h.create();var r=i();return function(){function t(){this._key=i()}t.prototype.has=function(t){var e=s(t,false);return e!==undefined?h.has(e,this._key):false};t.prototype.get=function(t){var e=s(t,false);return e!==undefined?h.get(e,this._key):undefined};t.prototype.set=function(t,e){var n=s(t,true);n[this._key]=e;return this};t.prototype.delete=function(t){var e=s(t,false);return e!==undefined?delete e[this._key]:false};t.prototype.clear=function(){this._key=i()};return t}();function i(){var t;do{t="@@WeakMap@@"+c()}while(h.has(e,t));e[t]=true;return t}function s(t,e){if(!n.call(t,r)){if(!e)return undefined;Object.defineProperty(t,r,{value:h.create()})}return t[r]}function a(t,e){for(var n=0;n<e;++n)t[n]=Math.random()*255|0;return t}function o(t){if(typeof Uint8Array==="function"){var e=new Uint8Array(t);if(typeof crypto!=="undefined"){crypto.getRandomValues(e)}else if(typeof msCrypto!=="undefined"){msCrypto.getRandomValues(e)}else{a(e,t)}return e}return a(new Array(t),t)}function c(){var e=o(t);e[6]=e[6]&79|64;e[8]=e[8]&191|128;var n="";for(var r=0;r<t;++r){var i=e[r];if(r===4||r===6||r===8)n+="-";if(i<16)n+="0";n+=i.toString(16).toLowerCase()}return n}}function ft(t){t.__=undefined;delete t.__;return t}}))})(e||(e={}));return fe}ve();var de;(function(t){t[t["Transient"]=0]="Transient";t[t["Singleton"]=1]="Singleton";t[t["ResolutionScoped"]=2]="ResolutionScoped";t[t["ContainerScoped"]=3]="ContainerScoped"})(de||(de={}));var pe=de;const we="injectionTokens";function me(t){const e=Reflect.getMetadata("design:paramtypes",t)||[];const n=Reflect.getOwnMetadata(we,t)||{};Object.keys(n).forEach((t=>{e[+t]=n[t]}));return e}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function ye(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(e,n){function s(t){try{o(r.next(t))}catch(t){n(t)}}function a(t){try{o(r["throw"](t))}catch(t){n(t)}}function o(t){t.done?e(t.value):i(t.value).then(s,a)}o((r=r.apply(t,[])).next())}))}function be(t){return!!t.useClass}function ge(t){return!!t.useFactory}class ze{constructor(t){this.wrap=t;this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}createProxy(t){const e={};let n=false;let r;const i=()=>{if(!n){r=t(this.wrap());n=true}return r};return new Proxy(e,this.createHandler(i))}createHandler(t){const e={};const n=n=>{e[n]=(...e)=>{e[0]=t();const r=Reflect[n];return r(...e)}};this.reflectMethods.forEach(n);return e}}function Ae(t){return typeof t==="string"||typeof t==="symbol"}function Se(t){return typeof t==="object"&&"token"in t&&"multiple"in t}function ke(t){return typeof t==="object"&&"token"in t&&"transform"in t}function Ee(t){return typeof t==="function"||t instanceof ze}function Ce(t){return!!t.useToken}function xe(t){return t.useValue!=undefined}function Me(t){return be(t)||xe(t)||Ce(t)||ge(t)}class Pe{constructor(){this._registryMap=new Map}entries(){return this._registryMap.entries()}getAll(t){this.ensure(t);return this._registryMap.get(t)}get(t){this.ensure(t);const e=this._registryMap.get(t);return e[e.length-1]||null}set(t,e){this.ensure(t);this._registryMap.get(t).push(e)}setAll(t,e){this._registryMap.set(t,e)}has(t){this.ensure(t);return this._registryMap.get(t).length>0}clear(){this._registryMap.clear()}ensure(t){if(!this._registryMap.has(t)){this._registryMap.set(t,[])}}}class Oe extends Pe{}class _e{constructor(){this.scopedResolutions=new Map}}function Te(t,e){if(t===null){return`at position #${e}`}const n=t.split(",")[e].trim();return`"${n}" at position #${e}`}function He(t,e,n=" "){return[t,...e.message.split("\n").map((t=>n+t))].join("\n")}function $e(t,e,n){const[,r=null]=t.toString().match(/constructor\(([\w, ]+)\)/)||[];const i=Te(r,e);return He(`Cannot inject the dependency ${i} of "${t.name}" constructor. Reason:`,n)}function je(t){if(typeof t.dispose!=="function")return false;const e=t.dispose;if(e.length>0){return false}return true}class Ie extends Pe{}class Re extends Pe{}class We{constructor(){this.preResolution=new Ie;this.postResolution=new Re}}const Ne=new Map;class Ke{constructor(t){this.parent=t;this._registry=new Oe;this.interceptors=new We;this.disposed=false;this.disposables=new Set}register(t,e,n={lifecycle:pe.Transient}){this.ensureNotDisposed();let r;if(!Me(e)){r={useClass:e}}else{r=e}if(Ce(r)){const e=[t];let n=r;while(n!=null){const t=n.useToken;if(e.includes(t)){throw new Error(`Token registration cycle detected! ${[...e,t].join(" -> ")}`)}e.push(t);const r=this._registry.get(t);if(r&&Ce(r.provider)){n=r.provider}else{n=null}}}if(n.lifecycle===pe.Singleton||n.lifecycle==pe.ContainerScoped||n.lifecycle==pe.ResolutionScoped){if(xe(r)||ge(r)){throw new Error(`Cannot use lifecycle "${pe[n.lifecycle]}" with ValueProviders or FactoryProviders`)}}this._registry.set(t,{provider:r,options:n});return this}registerType(t,e){this.ensureNotDisposed();if(Ae(e)){return this.register(t,{useToken:e})}return this.register(t,{useClass:e})}registerInstance(t,e){this.ensureNotDisposed();return this.register(t,{useValue:e})}registerSingleton(t,e){this.ensureNotDisposed();if(Ae(t)){if(Ae(e)){return this.register(t,{useToken:e},{lifecycle:pe.Singleton})}else if(e){return this.register(t,{useClass:e},{lifecycle:pe.Singleton})}throw new Error('Cannot register a type name as a singleton without a "to" token')}let n=t;if(e&&!Ae(e)){n=e}return this.register(t,{useClass:n},{lifecycle:pe.Singleton})}resolve(t,e=new _e,n=false){this.ensureNotDisposed();const r=this.getRegistration(t);if(!r&&Ae(t)){if(n){return undefined}throw new Error(`Attempted to resolve unregistered dependency token: "${t.toString()}"`)}this.executePreResolutionInterceptor(t,"Single");if(r){const n=this.resolveRegistration(r,e);this.executePostResolutionInterceptor(t,n,"Single");return n}if(Ee(t)){const n=this.construct(t,e);this.executePostResolutionInterceptor(t,n,"Single");return n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")}executePreResolutionInterceptor(t,e){if(this.interceptors.preResolution.has(t)){const n=[];for(const r of this.interceptors.preResolution.getAll(t)){if(r.options.frequency!="Once"){n.push(r)}r.callback(t,e)}this.interceptors.preResolution.setAll(t,n)}}executePostResolutionInterceptor(t,e,n){if(this.interceptors.postResolution.has(t)){const r=[];for(const i of this.interceptors.postResolution.getAll(t)){if(i.options.frequency!="Once"){r.push(i)}i.callback(t,e,n)}this.interceptors.postResolution.setAll(t,r)}}resolveRegistration(t,e){this.ensureNotDisposed();if(t.options.lifecycle===pe.ResolutionScoped&&e.scopedResolutions.has(t)){return e.scopedResolutions.get(t)}const n=t.options.lifecycle===pe.Singleton;const r=t.options.lifecycle===pe.ContainerScoped;const i=n||r;let s;if(xe(t.provider)){s=t.provider.useValue}else if(Ce(t.provider)){s=i?t.instance||(t.instance=this.resolve(t.provider.useToken,e)):this.resolve(t.provider.useToken,e)}else if(be(t.provider)){s=i?t.instance||(t.instance=this.construct(t.provider.useClass,e)):this.construct(t.provider.useClass,e)}else if(ge(t.provider)){s=t.provider.useFactory(this)}else{s=this.construct(t.provider,e)}if(t.options.lifecycle===pe.ResolutionScoped){e.scopedResolutions.set(t,s)}return s}resolveAll(t,e=new _e,n=false){this.ensureNotDisposed();const r=this.getAllRegistrations(t);if(!r&&Ae(t)){if(n){return[]}throw new Error(`Attempted to resolve unregistered dependency token: "${t.toString()}"`)}this.executePreResolutionInterceptor(t,"All");if(r){const n=r.map((t=>this.resolveRegistration(t,e)));this.executePostResolutionInterceptor(t,n,"All");return n}const i=[this.construct(t,e)];this.executePostResolutionInterceptor(t,i,"All");return i}isRegistered(t,e=false){this.ensureNotDisposed();return this._registry.has(t)||e&&(this.parent||false)&&this.parent.isRegistered(t,true)}reset(){this.ensureNotDisposed();this._registry.clear();this.interceptors.preResolution.clear();this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(const[t,e]of this._registry.entries()){this._registry.setAll(t,e.filter((t=>!xe(t.provider))).map((t=>{t.instance=undefined;return t})))}}createChildContainer(){this.ensureNotDisposed();const t=new Ke(this);for(const[e,n]of this._registry.entries()){if(n.some((({options:t})=>t.lifecycle===pe.ContainerScoped))){t._registry.setAll(e,n.map((t=>{if(t.options.lifecycle===pe.ContainerScoped){return{provider:t.provider,options:t.options}}return t})))}}return t}beforeResolution(t,e,n={frequency:"Always"}){this.interceptors.preResolution.set(t,{callback:e,options:n})}afterResolution(t,e,n={frequency:"Always"}){this.interceptors.postResolution.set(t,{callback:e,options:n})}dispose(){return ye(this,void 0,void 0,(function*(){this.disposed=true;const t=[];this.disposables.forEach((e=>{const n=e.dispose();if(n){t.push(n)}}));yield Promise.all(t)}))}getRegistration(t){if(this.isRegistered(t)){return this._registry.get(t)}if(this.parent){return this.parent.getRegistration(t)}return null}getAllRegistrations(t){if(this.isRegistered(t)){return this._registry.getAll(t)}if(this.parent){return this.parent.getAllRegistrations(t)}return null}construct(t,e){if(t instanceof ze){return t.createProxy((t=>this.resolve(t,e)))}const n=(()=>{const n=Ne.get(t);if(!n||n.length===0){if(t.length===0){return new t}else{throw new Error(`TypeInfo not known for "${t.name}"`)}}const r=n.map(this.resolveParams(e,t));return new t(...r)})();if(je(n)){this.disposables.add(n)}return n}resolveParams(t,e){return(n,r)=>{try{if(Se(n)){if(ke(n)){return n.multiple?this.resolve(n.transform).transform(this.resolveAll(n.token,new _e,n.isOptional),...n.transformArgs):this.resolve(n.transform).transform(this.resolve(n.token,t,n.isOptional),...n.transformArgs)}else{return n.multiple?this.resolveAll(n.token,new _e,n.isOptional):this.resolve(n.token,t,n.isOptional)}}else if(ke(n)){return this.resolve(n.transform,t).transform(this.resolve(n.token,t),...n.transformArgs)}return this.resolve(n,t)}catch(t){throw new Error($e(e,r,t))}}}ensureNotDisposed(){if(this.disposed){throw new Error("This container has been disposed, you cannot interact with a disposed container")}}}const De=new Ke;function Ve(t){return function(t){Ne.set(t,me(t))}}if(typeof Reflect==="undefined"||!Reflect.getMetadata){throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`)}
/*!
* MIT License
*
* Copyright (c) Peculiar Ventures. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/const Be="crypto.algorithm";class Ue{getAlgorithms(){return De.resolveAll(Be)}toAsnAlgorithm(t){for(const e of this.getAlgorithms()){const n=e.toAsnAlgorithm(t);if(n){return n}}if(/^[0-9.]+$/.test(t.name)){const e=new d({algorithm:t.name});if("parameters"in t){const n=t;e.parameters=n.parameters}return e}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(t){for(const e of this.getAlgorithms()){const n=e.toWebAlgorithm(t);if(n){return n}}const e={name:t.algorithm,parameters:t.parameters};return e}}const Fe="crypto.algorithmProvider";De.registerSingleton(Fe,Ue);var Le;const Ze="1.3.36.3.3.2.8.1.1";const Ge=`${Ze}.1`;const qe=`${Ze}.2`;const Je=`${Ze}.3`;const Xe=`${Ze}.4`;const Qe=`${Ze}.5`;const Ye=`${Ze}.6`;const tn=`${Ze}.7`;const en=`${Ze}.8`;const nn=`${Ze}.9`;const rn=`${Ze}.10`;const sn=`${Ze}.11`;const an=`${Ze}.12`;const on=`${Ze}.13`;const cn=`${Ze}.14`;const hn="brainpoolP160r1";const un="brainpoolP160t1";const fn="brainpoolP192r1";const ln="brainpoolP192t1";const vn="brainpoolP224r1";const dn="brainpoolP224t1";const pn="brainpoolP256r1";const wn="brainpoolP256t1";const mn="brainpoolP320r1";const yn="brainpoolP320t1";const bn="brainpoolP384r1";const gn="brainpoolP384t1";const zn="brainpoolP512r1";const An="brainpoolP512t1";const Sn="ECDSA";let kn=Le=class t{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case Sn.toLowerCase():if("hash"in t){const e=typeof t.hash==="string"?t.hash:t.hash.name;switch(e.toLowerCase()){case"sha-1":return y;case"sha-256":return m;case"sha-384":return w;case"sha-512":return p}}else if("namedCurve"in t){let e="";switch(t.namedCurve){case"P-256":e=k;break;case"K-256":e=Le.SECP256K1;break;case"P-384":e=S;break;case"P-521":e=A;break;case hn:e=Ge;break;case un:e=qe;break;case fn:e=Je;break;case ln:e=Xe;break;case vn:e=Qe;break;case dn:e=Ye;break;case pn:e=tn;break;case wn:e=en;break;case mn:e=nn;break;case yn:e=rn;break;case bn:e=sn;break;case gn:e=an;break;case zn:e=on;break;case An:e=cn;break}if(e){return new d({algorithm:g,parameters:b.serialize(new z({namedCurve:e}))})}}}return null}toWebAlgorithm(t){switch(t.algorithm){case M:return{name:Sn,hash:{name:"SHA-1"}};case x:return{name:Sn,hash:{name:"SHA-256"}};case C:return{name:Sn,hash:{name:"SHA-384"}};case E:return{name:Sn,hash:{name:"SHA-512"}};case g:{if(!t.parameters){throw new TypeError("Cannot get required parameters from EC algorithm")}const e=b.parse(t.parameters,z);switch(e.namedCurve){case k:return{name:Sn,namedCurve:"P-256"};case Le.SECP256K1:return{name:Sn,namedCurve:"K-256"};case S:return{name:Sn,namedCurve:"P-384"};case A:return{name:Sn,namedCurve:"P-521"};case Ge:return{name:Sn,namedCurve:hn};case qe:return{name:Sn,namedCurve:un};case Je:return{name:Sn,namedCurve:fn};case Xe:return{name:Sn,namedCurve:ln};case Qe:return{name:Sn,namedCurve:vn};case Ye:return{name:Sn,namedCurve:dn};case tn:return{name:Sn,namedCurve:pn};case en:return{name:Sn,namedCurve:wn};case nn:return{name:Sn,namedCurve:mn};case rn:return{name:Sn,namedCurve:yn};case sn:return{name:Sn,namedCurve:bn};case an:return{name:Sn,namedCurve:gn};case on:return{name:Sn,namedCurve:zn};case cn:return{name:Sn,namedCurve:An}}}}return null}};kn.SECP256K1="1.3.132.0.10";kn=Le=e([Ve()],kn);De.registerSingleton(Be,kn);const En=Symbol("name");const Cn=Symbol("value");class xn{constructor(t,e={},n=""){this[En]=t;this[Cn]=n;for(const t in e){this[t]=e[t]}}}xn.NAME=En;xn.VALUE=Cn;class Mn{static toTextObject(t){const e=new xn("Algorithm Identifier",{},Pn.toString(t.algorithm));if(t.parameters){switch(t.algorithm){case g:{const n=(new kn).toWebAlgorithm(t);if(n&&"namedCurve"in n){e["Named Curve"]=n.namedCurve}else{e["Parameters"]=t.parameters}break}default:e["Parameters"]=t.parameters}}return e}}class Pn{static toString(t){const e=this.items[t];if(e){return e}return t}}Pn.items={[B]:"sha1",[Wt]:"sha224",[V]:"sha256",[D]:"sha384",[K]:"sha512",[N]:"rsaEncryption",[W]:"sha1WithRSAEncryption",[Rt]:"sha224WithRSAEncryption",[R]:"sha256WithRSAEncryption",[I]:"sha384WithRSAEncryption",[j]:"sha512WithRSAEncryption",[g]:"ecPublicKey",[M]:"ecdsaWithSHA1",[It]:"ecdsaWithSHA224",[x]:"ecdsaWithSHA256",[C]:"ecdsaWithSHA384",[E]:"ecdsaWithSHA512",[jt]:"TLS WWW server authentication",[$t]:"TLS WWW client authentication",[Ht]:"Code Signing",[Tt]:"E-mail Protection",[_t]:"Time Stamping",[Ot]:"OCSP Signing",[Vt]:"Signed Data"};class On{static serialize(t){return this.serializeObj(t).join("\n")}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,e=0){const n=[];let r=this.pad(e++);let i="";const s=t[xn.VALUE];if(s){i=` ${s}`}n.push(`${r}${t[xn.NAME]}:${i}`);r=this.pad(e);for(const i in t){if(typeof i==="symbol"){continue}const s=t[i];const a=i?`${i}: `:"";if(typeof s==="string"||typeof s==="number"||typeof s==="boolean"){n.push(`${r}${a}${s}`)}else if(s instanceof Date){n.push(`${r}${a}${s.toUTCString()}`)}else if(Array.isArray(s)){for(const t of s){t[xn.NAME]=i;n.push(...this.serializeObj(t,e))}}else if(s instanceof xn){s[xn.NAME]=i;n.push(...this.serializeObj(s,e))}else if(P.BufferSourceConverter.isBufferSource(s)){if(i){n.push(`${r}${a}`);n.push(...this.serializeBufferSource(s,e+1))}else{n.push(...this.serializeBufferSource(s,e))}}else if("toTextObject"in s){const t=s.toTextObject();t[xn.NAME]=i;n.push(...this.serializeObj(t,e))}else{throw new TypeError("Cannot serialize data in text format. Unsupported type.")}}return n}static serializeBufferSource(t,e=0){const n=this.pad(e);const r=P.BufferSourceConverter.toUint8Array(t);const i=[];for(let t=0;t<r.length;){const e=[];for(let n=0;n<16&&t<r.length;n++){if(n===8){e.push("")}const i=r[t++].toString(16).padStart(2,"0");e.push(i)}i.push(`${n}${e.join(" ")}`)}return i}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}On.oidSerializer=Pn;On.algorithmSerializer=Mn;var _n;let Tn=class t{get rawData(){if(!gt(this,_n,"f")){zt(this,_n,b.serialize(this.asn),"f")}return gt(this,_n,"f")}constructor(...t){_n.set(this,void 0);if(P.BufferSourceConverter.isBufferSource(t[0])){this.asn=b.parse(t[0],t[1]);zt(this,_n,P.BufferSourceConverter.toArrayBuffer(t[0]),"f");this.onInit(this.asn)}else{this.asn=t[0];this.onInit(this.asn)}}equal(e){if(e instanceof t){return P.isEqual(e.rawData,this.rawData)}return false}toString(t="text"){switch(t){case"asn":return b.toString(this.rawData);case"text":return On.serialize(this.toTextObject());case"hex":return P.Convert.ToHex(this.rawData);case"base64":return P.Convert.ToBase64(this.rawData);case"base64url":return P.Convert.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){const t=this.constructor;return t.NAME}toTextObject(){const t=this.toTextObjectEmpty();t[""]=this.rawData;return t}toTextObjectEmpty(t){return new xn(this.getTextName(),{},t)}};_n=new WeakMap;Tn.NAME="ASN";let Hn=class t extends Tn{constructor(...t){let e;if(P.BufferSourceConverter.isBufferSource(t[0])){e=P.BufferSourceConverter.toArrayBuffer(t[0])}else{e=b.serialize(new ht({extnID:t[0],critical:t[1],extnValue:new ft(P.BufferSourceConverter.toArrayBuffer(t[2]))}))}super(e,ht)}onInit(t){this.type=t.extnID;this.critical=t.critical;this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();t[""]=this.value;return t}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty(this.critical?"critical":undefined);if(e[xn.NAME]===t.NAME){e[xn.NAME]=Pn.toString(this.type)}return e}};var $n;class jn{static isCryptoKeyPair(t){return t&&t.privateKey&&t.publicKey}static isCryptoKey(t){return t&&t.usages&&t.type&&t.algorithm&&t.extractable!==undefined}constructor(){this.items=new Map;this[$n]="CryptoProvider";if(typeof self!=="undefined"&&typeof crypto!=="undefined"){this.set(jn.DEFAULT,crypto)}else if(typeof global!=="undefined"&&global.crypto&&global.crypto.subtle){this.set(jn.DEFAULT,global.crypto)}}clear(){this.items.clear()}delete(t){return this.items.delete(t)}forEach(t,e){return this.items.forEach(t,e)}has(t){return this.items.has(t)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(t=jn.DEFAULT){const e=this.items.get(t.toLowerCase());if(!e){throw new Error(`Cannot get Crypto by name '${t}'`)}return e}set(t,e){if(typeof t==="string"){if(!e){throw new TypeError("Argument 'value' is required")}this.items.set(t.toLowerCase(),e)}else{this.items.set(jn.DEFAULT,t)}return this}}$n=Symbol.toStringTag;jn.DEFAULT="default";const In=new jn;const Rn=/^[0-2](?:\.[1-9][0-9]*)+$/;function Wn(t){return new RegExp(Rn).test(t)}class Nn{constructor(t={}){this.items={};for(const e in t){this.register(e,t[e])}}get(t){return this.items[t]||null}findId(t){if(!Wn(t)){return this.get(t)}return t}register(t,e){this.items[t]=e;this.items[e]=t}}const Kn=new Nn;Kn.register("CN","2.5.4.3");Kn.register("L","2.5.4.7");Kn.register("ST","2.5.4.8");Kn.register("O","2.5.4.10");Kn.register("OU","2.5.4.11");Kn.register("C","2.5.4.6");Kn.register("DC","0.9.2342.19200300.100.1.25");Kn.register("E","1.2.840.113549.1.9.1");Kn.register("G","2.5.4.42");Kn.register("I","2.5.4.43");Kn.register("SN","2.5.4.4");Kn.register("T","2.5.4.12");function Dn(t,e){return`\\${P.Convert.ToHex(P.Convert.FromUtf8String(e)).toUpperCase()}`}function Vn(t){return t.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Dn)}class Bn{static isASCII(t){for(let e=0;e<t.length;e++){const n=t.charCodeAt(e);if(n>255){return false}}return true}static isPrintableString(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(t)}constructor(t,e={}){this.extraNames=new Nn;this.asn=new wt;for(const t in e){if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];this.extraNames.register(t,n)}}if(typeof t==="string"){this.asn=this.fromString(t)}else if(t instanceof wt){this.asn=t}else if(P.BufferSourceConverter.isBufferSource(t)){this.asn=b.parse(t,wt)}else{this.asn=this.fromJSON(t)}}getField(t){const e=this.extraNames.findId(t)||Kn.findId(t);const n=[];for(const t of this.asn){for(const r of t){if(r.type===e){n.push(r.value.toString())}}}return n}getName(t){return this.extraNames.get(t)||Kn.get(t)}toString(){return this.asn.map((t=>t.map((t=>{const e=this.getName(t.type)||t.type;const n=t.value.anyValue?`#${P.Convert.ToHex(t.value.anyValue)}`:Vn(t.value.toString());return`${e}=${n}`})).join("+"))).join(", ")}toJSON(){var t;const e=[];for(const n of this.asn){const r={};for(const e of n){const n=this.getName(e.type)||e.type;(t=r[n])!==null&&t!==void 0?t:r[n]=[];r[n].push(e.value.anyValue?`#${P.Convert.ToHex(e.value.anyValue)}`:e.value.toString())}e.push(r)}return e}fromString(t){const e=new wt;const n=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let r=null;let i=",";while(r=n.exec(`${t},`)){let[,t,n]=r;const s=n[n.length-1];if(s===","||s==="+"){n=n.slice(0,n.length-1);r[3]=s}const a=r[3];t=this.getTypeOid(t);const o=this.createAttribute(t,n);if(i==="+"){e[e.length-1].push(o)}else{e.push(new At([o]))}i=a}return e}fromJSON(t){const e=new wt;for(const n of t){const t=new At;for(const e in n){const r=this.getTypeOid(e);const i=n[e];for(const e of i){const n=this.createAttribute(r,e);t.push(n)}}e.push(t)}return e}getTypeOid(t){if(!/[\d.]+/.test(t)){t=this.getName(t)||""}if(!t){throw new Error(`Cannot get OID for name type '${t}'`)}return t}createAttribute(t,e){const n=new St({type:t});if(typeof e==="object"){for(const t in e){switch(t){case"ia5String":n.value.ia5String=e[t];break;case"utf8String":n.value.utf8String=e[t];break;case"universalString":n.value.universalString=e[t];break;case"bmpString":n.value.bmpString=e[t];break;case"printableString":n.value.printableString=e[t];break}}}else if(e[0]==="#"){n.value.anyValue=P.Convert.FromHex(e.slice(1))}else{const r=this.processStringValue(e);if(t===this.getName("E")||t===this.getName("DC")){n.value.ia5String=r}else{if(Bn.isPrintableString(r)){n.value.printableString=r}else{n.value.utf8String=r}}}return n}processStringValue(t){const e=/"(.*?[^\\])?"/.exec(t);if(e){t=e[1]}return t.replace(/\\0a/gi,"\n").replace(/\\0d/gi,"\r").replace(/\\0g/gi,"\t").replace(/\\(.)/g,"$1")}toArrayBuffer(){return b.serialize(this.asn)}async getThumbprint(...t){var e;let n;let r="SHA-1";if(t.length>=1&&!((e=t[0])===null||e===void 0?void 0:e.subtle)){r=t[0]||r;n=t[1]||In.get()}else{n=t[0]||In.get()}return await n.subtle.digest(r,this.toArrayBuffer())}}const Un="Cannot initialize GeneralName from ASN.1 data.";const Fn=`${Un} Unsupported string format in use.`;const Ln=`${Un} Value doesn't match to GUID regular expression.`;const Zn=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i;const Gn="1.3.6.1.4.1.311.25.1";const qn="1.3.6.1.4.1.311.20.2.3";const Jn="dns";const Xn="dn";const Qn="email";const Yn="ip";const tr="url";const er="guid";const nr="upn";const rr="id";class ir extends Tn{constructor(...t){let e;if(t.length===2){switch(t[0]){case Xn:{const n=new Bn(t[1]).toArrayBuffer();const r=b.parse(n,wt);e=new tt({directoryName:r});break}case Jn:e=new tt({dNSName:t[1]});break;case Qn:e=new tt({rfc822Name:t[1]});break;case er:{const n=new RegExp(Zn,"i").exec(t[1]);if(!n){throw new Error("Cannot parse GUID value. Value doesn't match to regular expression")}const r=n.slice(1).map(((t,e)=>{if(e<3){return P.Convert.ToHex(new Uint8Array(P.Convert.FromHex(t)).reverse())}return t})).join("");e=new tt({otherName:new dt({typeId:Gn,value:b.serialize(new ft(P.Convert.FromHex(r)))})});break}case Yn:e=new tt({iPAddress:t[1]});break;case rr:e=new tt({registeredID:t[1]});break;case nr:{e=new tt({otherName:new dt({typeId:qn,value:b.serialize(pt.toASN(t[1]))})});break}case tr:e=new tt({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}}else if(P.BufferSourceConverter.isBufferSource(t[0])){e=b.parse(t[0],tt)}else{e=t[0]}super(e)}onInit(t){if(t.dNSName!=undefined){this.type=Jn;this.value=t.dNSName}else if(t.rfc822Name!=undefined){this.type=Qn;this.value=t.rfc822Name}else if(t.iPAddress!=undefined){this.type=Yn;this.value=t.iPAddress}else if(t.uniformResourceIdentifier!=undefined){this.type=tr;this.value=t.uniformResourceIdentifier}else if(t.registeredID!=undefined){this.type=rr;this.value=t.registeredID}else if(t.directoryName!=undefined){this.type=Xn;this.value=new Bn(t.directoryName).toString()}else if(t.otherName!=undefined){if(t.otherName.typeId===Gn){this.type=er;const e=b.parse(t.otherName.value,ft);const n=new RegExp(Zn,"i").exec(P.Convert.ToHex(e));if(!n){throw new Error(Ln)}this.value=n.slice(1).map(((t,e)=>{if(e<3){return P.Convert.ToHex(new Uint8Array(P.Convert.FromHex(t)).reverse())}return t})).join("-")}else if(t.otherName.typeId===qn){this.type=nr;this.value=b.parse(t.otherName.value,mt).toString()}else{throw new Error(Fn)}}else{throw new Error(Fn)}}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case Xn:case Jn:case er:case Yn:case rr:case nr:case tr:t=this.type.toUpperCase();break;case Qn:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let e=this.value;if(this.type===rr){e=Pn.toString(e)}return new xn(t,undefined,e)}}class sr extends Tn{constructor(t){let e;if(t instanceof J){e=t}else if(Array.isArray(t)){const n=[];for(const e of t){if(e instanceof tt){n.push(e)}else{const t=b.parse(new ir(e.type,e.value).rawData,tt);n.push(t)}}e=new J(n)}else if(P.BufferSourceConverter.isBufferSource(t)){e=b.parse(t,J)}else{throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments")}super(e)}onInit(t){const e=[];for(const n of t){let t=null;try{t=new ir(n)}catch{continue}e.push(t)}this.items=e}toJSON(){return this.items.map((t=>t.toJSON()))}toTextObject(){const t=super.toTextObjectEmpty();for(const e of this.items){const n=e.toTextObject();let r=t[n[xn.NAME]];if(!Array.isArray(r)){r=[];t[n[xn.NAME]]=r}r.push(n)}return t}}sr.NAME="GeneralNames";const ar="-{5}";const or="\\n";const cr=`[^${or}]+`;const hr=`${ar}BEGIN (${cr}(?=${ar}))${ar}`;const ur=`${ar}END \\1${ar}`;const fr="\\n";const lr=`[^:${or}]+`;const vr=`(?:[^${or}]+${fr}(?: +[^${or}]+${fr})*)`;const dr="[a-zA-Z0-9=+/]+";const pr=`(?:${dr}${fr})+`;const wr=`${hr}${fr}(?:((?:${lr}: ${vr})+))?${fr}?(${pr})${ur}`;class mr{static isPem(t){return typeof t==="string"&&new RegExp(wr,"g").test(t.replace(/\r/g,""))}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const e=new RegExp(wr,"g");const n=[];let r=null;while(r=e.exec(t)){const t=r[3].replace(new RegExp(`[${or}]+`,"g"),"");const e={type:r[1],headers:[],rawData:P.Convert.FromBase64(t)};const i=r[2];if(i){const t=i.split(new RegExp(fr,"g"));let n=null;for(const r of t){const[t,i]=r.split(/:(.*)/);if(i===undefined){if(!n){throw new Error("Cannot parse PEM string. Incorrect header value")}n.value+=t.trim()}else{if(n){e.headers.push(n)}n={key:t,value:i.trim()}}}if(n){e.headers.push(n)}}n.push(e)}return n}static decode(t){const e=this.decodeWithHeaders(t);return e.map((t=>t.rawData))}static decodeFirst(t){const e=this.decode(t);if(!e.length){throw new RangeError("PEM string doesn't contain any objects")}return e[0]}static encode(t,e){if(Array.isArray(t)){const n=new Array;if(e){t.forEach((t=>{if(!P.BufferSourceConverter.isBufferSource(t)){throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource")}n.push(this.encodeStruct({type:e,rawData:P.BufferSourceConverter.toArrayBuffer(t)}))}))}else{t.forEach((t=>{if(!("type"in t)){throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut")}n.push(this.encodeStruct(t))}))}return n.join("\n")}else{if(!e){throw new Error("Required argument 'tag' is missed")}return this.encodeStruct({type:e,rawData:P.BufferSourceConverter.toArrayBuffer(t)})}}static encodeStruct(t){var e;const n=t.type.toLocaleUpperCase();const r=[];r.push(`-----BEGIN ${n}-----`);if((e=t.headers)===null||e===void 0?void 0:e.length){for(const e of t.headers){r.push(`${e.key}: ${e.value}`)}r.push("")}const i=P.Convert.ToBase64(t.rawData);let s;let a=0;const o=Array();while(a<i.length){if(i.length-a<64){s=i.substring(a)}else{s=i.substring(a,a+64);a+=64}if(s.length!==0){o.push(s);if(s.length<64){break}}else{break}}r.push(...o);r.push(`-----END ${n}-----`);return r.join("\n")}}mr.CertificateTag="CERTIFICATE";mr.CrlTag="CRL";mr.CertificateRequestTag="CERTIFICATE REQUEST";mr.PublicKeyTag="PUBLIC KEY";mr.PrivateKeyTag="PRIVATE KEY";class yr extends Tn{static isAsnEncoded(t){return P.BufferSourceConverter.isBufferSource(t)||typeof t==="string"}static toArrayBuffer(t){if(typeof t==="string"){if(mr.isPem(t)){return mr.decode(t)[0]}else if(P.Convert.isHex(t)){return P.Convert.FromHex(t)}else if(P.Convert.isBase64(t)){return P.Convert.FromBase64(t)}else if(P.Convert.isBase64Url(t)){return P.Convert.FromBase64Url(t)}else{throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}else{const e=P.BufferSourceConverter.toUint8Array(t);if(e.length>0&&e[0]===48){return P.BufferSourceConverter.toArrayBuffer(t)}const n=P.Convert.ToBinary(t);if(mr.isPem(n)){return mr.decode(n)[0]}else if(P.Convert.isHex(n)){return P.Convert.FromHex(n)}else if(P.Convert.isBase64(n)){return P.Convert.FromBase64(n)}else if(P.Convert.isBase64Url(n)){return P.Convert.FromBase64Url(n)}throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}constructor(...t){if(yr.isAsnEncoded(t[0])){super(yr.toArrayBuffer(t[0]),t[1])}else{super(t[0])}}toString(t="pem"){switch(t){case"pem":return mr.encode(this.rawData,this.tag);default:return super.toString(t)}}}class br extends yr{static async create(t,e=In.get()){if(t instanceof br){return t}else if(jn.isCryptoKey(t)){if(t.type!=="public"){throw new TypeError("Public key is required")}const n=await e.subtle.exportKey("spki",t);return new br(n)}else if(t.publicKey){return t.publicKey}else if(P.BufferSourceConverter.isBufferSource(t)){return new br(t)}else{throw new TypeError("Unsupported PublicKeyType")}}constructor(t){if(yr.isAsnEncoded(t)){super(t,lt)}else{super(t)}this.tag=mr.PublicKeyTag}async export(...t){let e;let n=["verify"];let r={hash:"SHA-256",...this.algorithm};if(t.length>1){r=t[0]||r;n=t[1]||n;e=t[2]||In.get()}else{e=t[0]||In.get()}let i=this.rawData;const s=b.parse(this.rawData,lt);if(s.algorithm.algorithm===$){i=gr(s,i)}return e.subtle.importKey("spki",i,r,true,n)}onInit(t){const e=De.resolve(Fe);const n=this.algorithm=e.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case N:{const e=b.parse(t.subjectPublicKey,vt);const r=P.BufferSourceConverter.toUint8Array(e.modulus);n.publicExponent=P.BufferSourceConverter.toUint8Array(e.publicExponent);n.modulusLength=(!r[0]?r.slice(1):r).byteLength<<3;break}}}async getThumbprint(...t){var e;let n;let r="SHA-1";if(t.length>=1&&!((e=t[0])===null||e===void 0?void 0:e.subtle)){r=t[0]||r;n=t[1]||In.get()}else{n=t[0]||In.get()}return await n.subtle.digest(r,this.rawData)}async