@peculiar/fortify-webcomponents
Version:
Web-components for creating CSR or Certificate and viewing certificates list using Fortify
63 lines (59 loc) • 122 kB
JavaScript
/*!
* © Peculiar Ventures https://peculiarventures.com/ - BSD 3-Clause License
*/
import{bj as t,bk as e,a9 as n,a5 as r,ah as s,ap as i,aB as a,a3 as o,ax as c,ab as u,a1 as h,J as f,M as l,bl as v,bm as d,bn as p,bo as w,bp as m,i as y,A as b,g,bq as z,br as A,bs as S,bt as E,bu as C,bv as k,bw as x,bx as P,by as O,bz as _,bA as M,bB as T,h as H,bC as $,bD as j,bE as I,bF as R,bG as N,bH as K,bI as D,bJ as W,bK as V,bL as B,bM as U,bN as F,C as L,bO as Z,a4 as G,bP as q,bQ as J,a6 as X,ai as Y,aq as Q,aC as tt,ay as et,aa as nt,bR as rt,bS as st,bT as it,bU as at,ac as ot,a2 as ct,bV as ut,bW as ht,bX as ft,bY as lt,bZ as vt,K as dt,b_ as pt,a0 as wt,b$ as mt,c0 as yt,c1 as bt,c2 as gt,c3 as zt,O as At,c4 as St,c5 as Et,c6 as Ct,c7 as kt,c8 as xt,c9 as Pt,ca as Ot,R as _t,o as Mt,cb as Tt,Y as Ht,cc as $t,cd as jt,c as It,ce as Rt,cf as Nt,p as Kt,aD as Dt,aE as Wt}from"./p-4227eec7.js";import{a as Vt}from"./p-435133f4.js";import{h as Bt}from"./p-1b1223fb.js";import{g as Ut}from"./p-3151627c.js";import{T as Ft}from"./p-9932bc13.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-189ccfa0.js").then((function(t){return t.p}))}if(!window["WebcryptoSocket"]){await import("./p-3bcf9b04.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 Yt=/Android/i;var Qt=/(?: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 se=/BB10/i;var ie=/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 ue(t){return function(e){return e.test(t)}}function he(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 s=ue(n);var i={apple:{phone:s(Zt)&&!s(ee),ipod:s(Gt),tablet:!s(Zt)&&(s(qt)||ce(e))&&!s(ee),universal:s(Jt),device:(s(Zt)||s(Gt)||s(qt)||s(Jt)||ce(e))&&!s(ee)},amazon:{phone:s(Qt),tablet:!s(Qt)&&s(te),device:s(Qt)||s(te)},android:{phone:!s(ee)&&s(Qt)||!s(ee)&&s(Xt),tablet:!s(ee)&&!s(Qt)&&!s(Xt)&&(s(te)||s(Yt)),device:!s(ee)&&(s(Qt)||s(te)||s(Xt)||s(Yt))||s(/\bokhttp\b/i)},windows:{phone:s(ee),tablet:s(ne),device:s(ee)||s(ne)},other:{blackberry:s(re),blackberry10:s(se),opera:s(ie),firefox:s(oe),chrome:s(ae),device:s(re)||s(se)||s(ie)||s(oe)||s(ae)},any:false,phone:false,tablet:false};i.any=i.apple.device||i.android.device||i.windows.device||i.other.device;i.phone=i.apple.phone||i.android.phone||i.windows.phone;i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet;return i}
/*! *****************************************************************************
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 fe;(function(e){(function(n){var r=typeof globalThis==="object"?globalThis:typeof t==="object"?t:typeof self==="object"?self:typeof this==="object"?this:c();var s=i(e);if(typeof r.Reflect!=="undefined"){s=i(r.Reflect,s)}n(s,r);if(typeof r.Reflect==="undefined"){r.Reflect=e}function i(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 s=r&&typeof Symbol.toPrimitive!=="undefined"?Symbol.toPrimitive:"@@toPrimitive";var i=r&&typeof Symbol.iterator!=="undefined"?Symbol.iterator:"@@iterator";var a=typeof Object.create==="function";var o={__proto__:[]}instanceof Array;var c=!a&&!o;var u={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 h=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:ut();var v=typeof WeakMap==="function"?WeakMap:ht();var d=r?Symbol.for("@reflect-metadata:registry"):undefined;var p=st();var w=it(p);function m(t,e,n,r){if(!R(n)){if(!L(t))throw new TypeError;if(!D(e))throw new TypeError;if(!D(r)&&!R(r)&&!N(r))throw new TypeError;if(N(r))r=undefined;n=F(n);return P(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(!D(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(!D(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(!D(e))throw new TypeError;if(!R(n))n=F(n);return O(t,e,n)}t("hasMetadata",g);function z(t,e,n){if(!D(e))throw new TypeError;if(!R(n))n=F(n);return _(t,e,n)}t("hasOwnMetadata",z);function A(t,e,n){if(!D(e))throw new TypeError;if(!R(n))n=F(n);return M(t,e,n)}t("getMetadata",A);function S(t,e,n){if(!D(e))throw new TypeError;if(!R(n))n=F(n);return T(t,e,n)}t("getOwnMetadata",S);function E(t,e){if(!D(t))throw new TypeError;if(!R(e))e=F(e);return $(t,e)}t("getMetadataKeys",E);function C(t,e){if(!D(t))throw new TypeError;if(!R(e))e=F(e);return j(t,e)}t("getOwnMetadataKeys",C);function k(t,e,n){if(!D(e))throw new TypeError;if(!R(n))n=F(n);if(!D(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",k);function x(t,e){for(var n=t.length-1;n>=0;--n){var r=t[n];var s=r(e);if(!R(s)&&!N(s)){if(!G(s))throw new TypeError;e=s}}return e}function P(t,e,n,r){for(var s=t.length-1;s>=0;--s){var i=t[s];var a=i(e,n,r);if(!R(a)&&!N(a)){if(!D(a))throw new TypeError;r=a}}return r}function O(t,e,n){var r=_(t,e,n);if(r)return true;var s=nt(e);if(!N(s))return O(t,s,n);return false}function _(t,e,n){var r=ot(e,n,false);if(R(r))return false;return B(r.OrdinaryHasOwnMetadata(t,e,n))}function M(t,e,n){var r=_(t,e,n);if(r)return T(t,e,n);var s=nt(e);if(!N(s))return M(t,s,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 s=ot(n,r,true);s.OrdinaryDefineOwnMetadata(t,e,n,r)}function $(t,e){var n=j(t,e);var r=nt(t);if(r===null)return n;var s=$(r,e);if(s.length<=0)return n;if(n.length<=0)return s;var i=new l;var a=[];for(var o=0,c=n;o<c.length;o++){var u=c[o];var h=i.has(u);if(!h){i.add(u);a.push(u)}}for(var f=0,v=s;f<v.length;f++){var u=v[f];var h=i.has(u);if(!h){i.add(u);a.push(u)}}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 N(t){return t===null}function K(t){return typeof t==="symbol"}function D(t){return typeof t==="object"?t!==null:typeof t==="function"}function W(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=e===3?"string":e===5?"number":"default";var r=X(t,s);if(r!==undefined){var i=r.call(t,n);if(D(i))throw new TypeError;return i}return V(t,n==="default"?"number":n)}function V(t,e){if(e==="string"){var n=t.toString;if(Z(n)){var r=n.call(t);if(!D(r))return r}var s=t.valueOf;if(Z(s)){var r=s.call(t);if(!D(r))return r}}else{var s=t.valueOf;if(Z(s)){var r=s.call(t);if(!D(r))return r}var i=t.toString;if(Z(i)){var r=i.call(t);if(!D(r))return r}}throw new TypeError}function B(t){return!!t}function U(t){return""+t}function F(t){var e=W(t,3);if(K(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 Y(t){var e=X(t,i);if(!Z(e))throw new TypeError;var n=e.call(t);if(!D(n))throw new TypeError;return n}function Q(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===h)return e;if(e!==h)return e;var n=t.prototype;var r=n&&Object.getPrototypeOf(n);if(r==null||r===Object.prototype)return e;var s=r.constructor;if(typeof s!=="function")return e;if(s===t)return e;return s}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 s;var i=new v;var a={registerProvider:o,getProvider:u,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(s===undefined)s=new l;s.add(e);break}}function c(e,i){if(!R(n)){if(n.isProviderFor(e,i))return n;if(!R(r)){if(r.isProviderFor(e,i))return n;if(!R(s)){var a=Y(s);while(true){var o=tt(a);if(!o){return undefined}var c=Q(o);if(c.isProviderFor(e,i)){et(a);return c}}}}}if(!R(t)&&t.isProviderFor(e,i)){return t}return undefined}function u(t,e){var n=i.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;i.set(t,n)}n.set(e,r)}return r}function h(t){if(R(t))throw new TypeError;return n===t||r===t||!R(s)&&s.has(t)}function p(t,e,n){if(!h(n)){throw new Error("Metadata provider not registered.")}var r=u(t,e);if(r!==n){if(!R(r)){return false}var s=i.get(t);if(R(s)){s=new f;i.set(t,s)}s.set(e,n)}return true}}function st(){var t;if(!R(d)&&D(e.Reflect)&&Object.isExtensible(e.Reflect)){t=e.Reflect[d]}if(R(t)){t=rt()}if(!R(d)&&D(e.Reflect)&&Object.isExtensible(e.Reflect)){Object.defineProperty(e.Reflect,d,{enumerable:false,configurable:false,writable:false,value:t})}return t}function it(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:s,OrdinaryGetOwnMetadata:i,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:c};p.registerProvider(n);return n;function r(r,s,i){var a=e.get(r);var o=false;if(R(a)){if(!i)return undefined;a=new f;e.set(r,a);o=true}var c=a.get(s);if(R(c)){if(!i)return undefined;c=new f;a.set(s,c);if(!t.setProvider(r,s,n)){a.delete(s);if(o){e.delete(r)}throw new Error("Wrong provider for target.")}}return c}function s(t,e,n){var s=r(e,n,false);if(R(s))return false;return B(s.has(t))}function i(t,e,n){var s=r(e,n,false);if(R(s))return undefined;return s.get(t)}function a(t,e,n,s){var i=r(n,s,true);i.set(t,e)}function o(t,e){var n=[];var s=r(t,e,false);if(R(s))return n;var i=s.keys();var a=Y(i);var o=0;while(true){var c=tt(a);if(!c){n.length=o;return n}var u=Q(c);try{n[o]=u}catch(t){try{et(a)}finally{throw t}}o++}}function c(t,n,s){var i=r(n,s,false);if(R(i))return false;if(!i.delete(t))return false;if(i.size===0){var a=e.get(n);if(!R(a)){a.delete(s);if(a.size===0){e.delete(a)}}}return true}}function at(t){var e=t.defineMetadata,n=t.hasOwnMetadata,r=t.getOwnMetadata,s=t.getOwnMetadataKeys,i=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(s(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:s,OrdinaryDeleteMetadata:i};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[i]=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 s=n+1;s<r;s++){this._keys[s-1]=this._keys[s];this._values[s-1]=this._values[s]}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,s)};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[i]=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 s(t,e){return t}function a(t,e){return e}function o(t,e){return[t,e]}}function ut(){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[i]=function(){return this.keys()};return t}();return t}function ht(){var t=16;var e=u.create();var r=s();return function(){function t(){this._key=s()}t.prototype.has=function(t){var e=i(t,false);return e!==undefined?u.has(e,this._key):false};t.prototype.get=function(t){var e=i(t,false);return e!==undefined?u.get(e,this._key):undefined};t.prototype.set=function(t,e){var n=i(t,true);n[this._key]=e;return this};t.prototype.delete=function(t){var e=i(t,false);return e!==undefined?delete e[this._key]:false};t.prototype.clear=function(){this._key=s()};return t}();function s(){var t;do{t="@@WeakMap@@"+c()}while(u.has(e,t));e[t]=true;return t}function i(t,e){if(!n.call(t,r)){if(!e)return undefined;Object.defineProperty(t,r,{value:u.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 s=e[r];if(r===4||r===6||r===8)n+="-";if(s<16)n+="0";n+=s.toString(16).toLowerCase()}return n}}function ft(t){t.__=undefined;delete t.__;return t}}))})(fe||(fe={}));var le;(function(t){t[t["Transient"]=0]="Transient";t[t["Singleton"]=1]="Singleton";t[t["ResolutionScoped"]=2]="ResolutionScoped";t[t["ContainerScoped"]=3]="ContainerScoped"})(le||(le={}));const ve=le;const de="injectionTokens";function pe(t){const e=Reflect.getMetadata("design:paramtypes",t)||[];const n=Reflect.getOwnMetadata(de,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 we(t,e,n,r){function s(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function o(t){try{c(r["throw"](t))}catch(t){i(t)}}function c(t){t.done?n(t.value):s(t.value).then(a,o)}c((r=r.apply(t,e||[])).next())}))}function me(t){return!!t.useClass}function ye(t){return!!t.useFactory}class be{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 s=()=>{if(!n){r=t(this.wrap());n=true}return r};return new Proxy(e,this.createHandler(s))}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 ge(t){return typeof t==="string"||typeof t==="symbol"}function ze(t){return typeof t==="object"&&"token"in t&&"multiple"in t}function Ae(t){return typeof t==="object"&&"token"in t&&"transform"in t}function Se(t){return typeof t==="function"||t instanceof be}function Ee(t){return!!t.useToken}function Ce(t){return t.useValue!=undefined}function ke(t){return me(t)||Ce(t)||Ee(t)||ye(t)}class xe{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 Pe extends xe{}class Oe{constructor(){this.scopedResolutions=new Map}}function _e(t,e){if(t===null){return`at position #${e}`}const n=t.split(",")[e].trim();return`"${n}" at position #${e}`}function Me(t,e,n=" "){return[t,...e.message.split("\n").map((t=>n+t))].join("\n")}function Te(t,e,n){const[,r=null]=t.toString().match(/constructor\(([\w, ]+)\)/)||[];const s=_e(r,e);return Me(`Cannot inject the dependency ${s} of "${t.name}" constructor. Reason:`,n)}function He(t){if(typeof t.dispose!=="function")return false;const e=t.dispose;if(e.length>0){return false}return true}class $e extends xe{}class je extends xe{}class Ie{constructor(){this.preResolution=new $e;this.postResolution=new je}}const Re=new Map;class Ne{constructor(t){this.parent=t;this._registry=new Pe;this.interceptors=new Ie;this.disposed=false;this.disposables=new Set}register(t,e,n={lifecycle:ve.Transient}){this.ensureNotDisposed();let r;if(!ke(e)){r={useClass:e}}else{r=e}if(Ee(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&&Ee(r.provider)){n=r.provider}else{n=null}}}if(n.lifecycle===ve.Singleton||n.lifecycle==ve.ContainerScoped||n.lifecycle==ve.ResolutionScoped){if(Ce(r)||ye(r)){throw new Error(`Cannot use lifecycle "${ve[n.lifecycle]}" with ValueProviders or FactoryProviders`)}}this._registry.set(t,{provider:r,options:n});return this}registerType(t,e){this.ensureNotDisposed();if(ge(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(ge(t)){if(ge(e)){return this.register(t,{useToken:e},{lifecycle:ve.Singleton})}else if(e){return this.register(t,{useClass:e},{lifecycle:ve.Singleton})}throw new Error('Cannot register a type name as a singleton without a "to" token')}let n=t;if(e&&!ge(e)){n=e}return this.register(t,{useClass:n},{lifecycle:ve.Singleton})}resolve(t,e=new Oe){this.ensureNotDisposed();const n=this.getRegistration(t);if(!n&&ge(t)){throw new Error(`Attempted to resolve unregistered dependency token: "${t.toString()}"`)}this.executePreResolutionInterceptor(t,"Single");if(n){const r=this.resolveRegistration(n,e);this.executePostResolutionInterceptor(t,r,"Single");return r}if(Se(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 s of this.interceptors.postResolution.getAll(t)){if(s.options.frequency!="Once"){r.push(s)}s.callback(t,e,n)}this.interceptors.postResolution.setAll(t,r)}}resolveRegistration(t,e){this.ensureNotDisposed();if(t.options.lifecycle===ve.ResolutionScoped&&e.scopedResolutions.has(t)){return e.scopedResolutions.get(t)}const n=t.options.lifecycle===ve.Singleton;const r=t.options.lifecycle===ve.ContainerScoped;const s=n||r;let i;if(Ce(t.provider)){i=t.provider.useValue}else if(Ee(t.provider)){i=s?t.instance||(t.instance=this.resolve(t.provider.useToken,e)):this.resolve(t.provider.useToken,e)}else if(me(t.provider)){i=s?t.instance||(t.instance=this.construct(t.provider.useClass,e)):this.construct(t.provider.useClass,e)}else if(ye(t.provider)){i=t.provider.useFactory(this)}else{i=this.construct(t.provider,e)}if(t.options.lifecycle===ve.ResolutionScoped){e.scopedResolutions.set(t,i)}return i}resolveAll(t,e=new Oe){this.ensureNotDisposed();const n=this.getAllRegistrations(t);if(!n&&ge(t)){throw new Error(`Attempted to resolve unregistered dependency token: "${t.toString()}"`)}this.executePreResolutionInterceptor(t,"All");if(n){const r=n.map((t=>this.resolveRegistration(t,e)));this.executePostResolutionInterceptor(t,r,"All");return r}const r=[this.construct(t,e)];this.executePostResolutionInterceptor(t,r,"All");return r}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=>!Ce(t.provider))).map((t=>{t.instance=undefined;return t})))}}createChildContainer(){this.ensureNotDisposed();const t=new Ne(this);for(const[e,n]of this._registry.entries()){if(n.some((({options:t})=>t.lifecycle===ve.ContainerScoped))){t._registry.setAll(e,n.map((t=>{if(t.options.lifecycle===ve.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 we(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 be){return t.createProxy((t=>this.resolve(t,e)))}const n=(()=>{const n=Re.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(He(n)){this.disposables.add(n)}return n}resolveParams(t,e){return(n,r)=>{try{if(ze(n)){if(Ae(n)){return n.multiple?this.resolve(n.transform).transform(this.resolveAll(n.token),...n.transformArgs):this.resolve(n.transform).transform(this.resolve(n.token,t),...n.transformArgs)}else{return n.multiple?this.resolveAll(n.token):this.resolve(n.token,t)}}else if(Ae(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(Te(e,r,t))}}}ensureNotDisposed(){if(this.disposed){throw new Error("This container has been disposed, you cannot interact with a disposed container")}}}const Ke=new Ne;function De(){return function(t){Re.set(t,pe(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 We="crypto.algorithm";class Ve{getAlgorithms(){return Ke.resolveAll(We)}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 v({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 Be="crypto.algorithmProvider";Ke.registerSingleton(Be,Ve);var Ue;const Fe="1.3.36.3.3.2.8.1.1";const Le=`${Fe}.1`;const Ze=`${Fe}.2`;const Ge=`${Fe}.3`;const qe=`${Fe}.4`;const Je=`${Fe}.5`;const Xe=`${Fe}.6`;const Ye=`${Fe}.7`;const Qe=`${Fe}.8`;const tn=`${Fe}.9`;const en=`${Fe}.10`;const nn=`${Fe}.11`;const rn=`${Fe}.12`;const sn=`${Fe}.13`;const an=`${Fe}.14`;const on="brainpoolP160r1";const cn="brainpoolP160t1";const un="brainpoolP192r1";const hn="brainpoolP192t1";const fn="brainpoolP224r1";const ln="brainpoolP224t1";const vn="brainpoolP256r1";const dn="brainpoolP256t1";const pn="brainpoolP320r1";const wn="brainpoolP320t1";const mn="brainpoolP384r1";const yn="brainpoolP384t1";const bn="brainpoolP512r1";const gn="brainpoolP512t1";const zn="ECDSA";let An=Ue=class t{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case zn.toLowerCase():if("hash"in t){const e=typeof t.hash==="string"?t.hash:t.hash.name;switch(e.toLowerCase()){case"sha-1":return m;case"sha-256":return w;case"sha-384":return p;case"sha-512":return d}}else if("namedCurve"in t){let e="";switch(t.namedCurve){case"P-256":e=S;break;case"K-256":e=Ue.SECP256K1;break;case"P-384":e=A;break;case"P-521":e=z;break;case on:e=Le;break;case cn:e=Ze;break;case un:e=Ge;break;case hn:e=qe;break;case fn:e=Je;break;case ln:e=Xe;break;case vn:e=Ye;break;case dn:e=Qe;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}if(e){return new v({algorithm:y,parameters:b.serialize(new g({namedCurve:e}))})}}}return null}toWebAlgorithm(t){switch(t.algorithm){case x:return{name:zn,hash:{name:"SHA-1"}};case k:return{name:zn,hash:{name:"SHA-256"}};case C:return{name:zn,hash:{name:"SHA-384"}};case E:return{name:zn,hash:{name:"SHA-512"}};case y:{if(!t.parameters){throw new TypeError("Cannot get required parameters from EC algorithm")}const e=b.parse(t.parameters,g);switch(e.namedCurve){case S:return{name:zn,namedCurve:"P-256"};case Ue.SECP256K1:return{name:zn,namedCurve:"K-256"};case A:return{name:zn,namedCurve:"P-384"};case z:return{name:zn,namedCurve:"P-521"};case Le:return{name:zn,namedCurve:on};case Ze:return{name:zn,namedCurve:cn};case Ge:return{name:zn,namedCurve:un};case qe:return{name:zn,namedCurve:hn};case Je:return{name:zn,namedCurve:fn};case Xe:return{name:zn,namedCurve:ln};case Ye:return{name:zn,namedCurve:vn};case Qe:return{name:zn,namedCurve:dn};case tn:return{name:zn,namedCurve:pn};case en:return{name:zn,namedCurve:wn};case nn:return{name:zn,namedCurve:mn};case rn:return{name:zn,namedCurve:yn};case sn:return{name:zn,namedCurve:bn};case an:return{name:zn,namedCurve:gn}}}}return null}};An.SECP256K1="1.3.132.0.10";An=Ue=e([De()],An);Ke.registerSingleton(We,An);const Sn=Symbol("name");const En=Symbol("value");class Cn{constructor(t,e={},n=""){this[Sn]=t;this[En]=n;for(const t in e){this[t]=e[t]}}}Cn.NAME=Sn;Cn.VALUE=En;class kn{static toTextObject(t){const e=new Cn("Algorithm Identifier",{},xn.toString(t.algorithm));if(t.parameters){switch(t.algorithm){case y:{const n=(new An).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 xn{static toString(t){const e=this.items[t];if(e){return e}return t}}xn.items={[P]:"sha1",[O]:"sha224",[_]:"sha256",[M]:"sha384",[T]:"sha512",[H]:"rsaEncryption",[$]:"sha1WithRSAEncryption",[j]:"sha224WithRSAEncryption",[I]:"sha256WithRSAEncryption",[R]:"sha384WithRSAEncryption",[N]:"sha512WithRSAEncryption",[y]:"ecPublicKey",[x]:"ecdsaWithSHA1",[K]:"ecdsaWithSHA224",[k]:"ecdsaWithSHA256",[C]:"ecdsaWithSHA384",[E]:"ecdsaWithSHA512",[D]:"TLS WWW server authentication",[W]:"TLS WWW client authentication",[V]:"Code Signing",[B]:"E-mail Protection",[U]:"Time Stamping",[F]:"OCSP Signing",[Vt]:"Signed Data"};class Pn{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 s="";const i=t[Cn.VALUE];if(i){s=` ${i}`}n.push(`${r}${t[Cn.NAME]}:${s}`);r=this.pad(e);for(const s in t){if(typeof s==="symbol"){continue}const i=t[s];const a=s?`${s}: `:"";if(typeof i==="string"||typeof i==="number"||typeof i==="boolean"){n.push(`${r}${a}${i}`)}else if(i instanceof Date){n.push(`${r}${a}${i.toUTCString()}`)}else if(Array.isArray(i)){for(const t of i){t[Cn.NAME]=s;n.push(...this.serializeObj(t,e))}}else if(i instanceof Cn){i[Cn.NAME]=s;n.push(...this.serializeObj(i,e))}else if(Z.isBufferSource(i)){if(s){n.push(`${r}${a}`);n.push(...this.serializeBufferSource(i,e+1))}else{n.push(...this.serializeBufferSource(i,e))}}else if("toTextObject"in i){const t=i.toTextObject();t[Cn.NAME]=s;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=Z.toUint8Array(t);const s=[];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 s=r[t++].toString(16).padStart(2,"0");e.push(s)}s.push(`${n}${e.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}Pn.oidSerializer=xn;Pn.algorithmSerializer=kn;class On{constructor(...t){if(t.length===1){const e=t[0];this.rawData=b.serialize(e);this.onInit(e)}else{const e=b.parse(t[0],t[1]);this.rawData=Z.toArrayBuffer(t[0]);this.onInit(e)}}equal(t){if(t instanceof On){return Tt(t.rawData,this.rawData)}return false}toString(t="text"){switch(t){case"asn":return b.toString(this.rawData);case"text":return Pn.serialize(this.toTextObject());case"hex":return L.ToHex(this.rawData);case"base64":return L.ToBase64(this.rawData);case"base64url":return L.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 Cn(this.getTextName(),{},t)}}On.NAME="ASN";class _n extends On{constructor(...t){let e;if(Z.isBufferSource(t[0])){e=Z.toArrayBuffer(t[0])}else{e=b.serialize(new wt({extnID:t[0],critical:t[1],extnValue:new At(Z.toArrayBuffer(t[2]))}))}super(e,wt)}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 t=this.toTextObjectEmpty(this.critical?"critical":undefined);if(t[Cn.NAME]===_n.NAME){t[Cn.NAME]=xn.toString(this.type)}return t}}var Mn;class Tn{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[Mn]="CryptoProvider";if(typeof self!=="undefined"&&typeof crypto!=="undefined"){this.set(Tn.DEFAULT,crypto)}else if(typeof global!=="undefined"&&global.crypto&&global.crypto.subtle){this.set(Tn.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=Tn.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(Tn.DEFAULT,t)}return this}}Mn=Symbol.toStringTag;Tn.DEFAULT="default";const Hn=new Tn;const $n=/^[0-2](?:\.[1-9][0-9]*)+$/;function jn(t){return new RegExp($n).test(t)}class In{constructor(t={}){this.items={};for(const e in t){this.register(e,t[e])}}get(t){return this.items[t]||null}findId(t){if(!jn(t)){return this.get(t)}return t}register(t,e){this.items[t]=e;this.items[e]=t}}const Rn=new In;Rn.register("CN","2.5.4.3");Rn.register("L","2.5.4.7");Rn.register("ST","2.5.4.8");Rn.register("O","2.5.4.10");Rn.register("OU","2.5.4.11");Rn.register("C","2.5.4.6");Rn.register("DC","0.9.2342.19200300.100.1.25");Rn.register("E","1.2.840.113549.1.9.1");Rn.register("G","2.5.4.42");Rn.register("I","2.5.4.43");Rn.register("SN","2.5.4.4");Rn.register("T","2.5.4.12");function Nn(t,e){return`\\${L.ToHex(L.FromUtf8String(e)).toUpperCase()}`}function Kn(t){return t.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Nn)}class Dn{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 In;this.asn=new St;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 St){this.asn=t}else if(Z.isBufferSource(t)){this.asn=b.parse(t,St)}else{this.asn=this.fromJSON(t)}}getField(t){const e=this.extraNames.findId(t)||Rn.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)||Rn.get(t)}toString(){return this.asn.map((t=>t.map((t=>{const e=this.getName(t.type)||t.type;const n=t.value.anyValue?`#${L.ToHex(t.value.anyValue)}`:Kn(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?`#${L.ToHex(e.value.anyValue)}`:e.value.toString())}e.push(r)}return e}fromString(t){const e=new St;const n=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let r=null;let s=",";while(r=n.exec(`${t},`)){let[,t,n]=r;const i=n[n.length-1];if(i===","||i==="+"){n=n.slice(0,n.length-1);r[3]=i}const a=r[3];t=this.getTypeOid(t);const o=this.createAttribute(t,n);if(s==="+"){e[e.length-1].push(o)}else{e.push(new Et([o]))}s=a}return e}fromJSON(t){const e=new St;for(const n of t){const t=new Et;for(const e in n){const r=this.getTypeOid(e);const s=n[e];for(const e of s){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 Ct({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=L.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(Dn.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]||Hn.get()}else{n=t[0]||Hn.get()}return await n.subtle.digest(r,this.toArrayBuffer())}}const Wn="Cannot initialize GeneralName from ASN.1 data.";const Vn=`${Wn} Unsupported string format in use.`;const Bn=`${Wn} Value doesn't match to GUID regular expression.`;const Un=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i;const Fn="1.3.6.1.4.1.311.25.1";const Ln="1.3.6.1.4.1.311.20.2.3";const Zn="dns";const Gn="dn";const qn="email";const Jn="ip";const Xn="url";const Yn="guid";const Qn="upn";const tr="id";class er extends On{constructor(...t){let e;if(t.length===2){switch(t[0]){case Gn:{const n=new Dn(t[1]).toArrayBuffer();const r=b.parse(n,St);e=new at({directoryName:r});break}case Zn:e=new at({dNSName:t[1]});break;case qn:e=new at({rfc822Name:t[1]});break;case Yn:{const n=new RegExp(Un,"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 L.ToHex(new Uint8Array(L.FromHex(t)).reverse())}return t})).join("");e=new at({otherName:new kt({typeId:Fn,value:b.serialize(new At(L.FromHex(r)))})});break}case Jn:e=new at({iPAddress:t[1]});break;case tr:e=new at({registeredID:t[1]});break;case Qn:{e=new at({otherName:new kt({typeId:Ln,value:b.serialize(xt.toASN(t[1]))})});break}case Xn:e=new at({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}}else if(Z.isBufferSource(t[0])){e=b.parse(t[0],at)}else{e=t[0]}super(e)}onInit(t){if(t.dNSName!=undefined){this.type=Zn;this.value=t.dNSName}else if(t.rfc822Name!=undefined){this.type=qn;this.value=t.rfc822Name}else if(t.iPAddress!=undefined){this.type=Jn;this.value=t.iPAddress}else if(t.uniformResourceIdentifier!=undefined){this.type=Xn;this.value=t.uniformResourceIdentifier}else if(t.registeredID!=undefined){this.type=tr;this.value=t.registeredID}else if(t.directoryName!=undefined){this.type=Gn;this.value=new Dn(t.directoryName).toString()}else if(t.otherName!=undefined){if(t.otherName.typeId===Fn){this.type=Yn;const e=b.parse(t.otherName.value,At);const n=new RegExp(Un,"i").exec(L.ToHex(e));if(!n){throw new Error(Bn)}this.value=n.slice(1).map(((t,e)=>{if(e<3){return L.ToHex(new Uint8Array(L.FromHex(t)).reverse())}return t})).join("-")}else if(t.otherName.typeId===Ln){this.type=Qn;this.value=b.parse(t.otherName.value,Pt).toString()}else{throw new Error(Vn)}}else{throw new Error(Vn)}}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case Gn:case Zn:case Yn:case Jn:case tr:case Qn:case Xn:t=this.type.toUpperCase();break;case qn:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let e=this.value;if(this.type===tr){e=xn.toString(e)}return new Cn(t,undefined,e)}}class nr extends On{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 at){n.push(e)}else{const t=b.parse(new er(e.type,e.value).rawData,at);n.push(t)}}e=new J(n)}else if(Z.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 er(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[Cn.NAME]];if(!Array.isArray(r)){r=[];t[n[Cn.NAME]]=r}r.push(n)}return t}}nr.NAME="GeneralNames";const rr="-{5}";const sr="\\n";const ir=`[^${sr}]+`;const ar=`${rr}BEGIN (${ir}(?=${rr}))${rr}`;const or=`${rr}END \\1${rr}`;const cr="\\n";const ur=`[^:${sr}]+`;const hr=`(?:[^${sr}]+${cr}(?: +[^${sr}]+${cr})*)`;const fr="[a-zA-Z0-9=+/]+";const lr=`(?:${fr}${cr})+`;const vr=`${ar}${cr}(?:((?:${ur}: ${hr})+))?${cr}?(${lr})${or}`;class dr{static isPem(t){return typeof t==="string"&&new RegExp(vr,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const e=new RegExp(vr,"g");const n=[];let r=null;while(r=e.exec(t)){const t=r[3].replace(new RegExp(`[${sr}]+`,"g"),"");const e={type:r[1],headers:[],rawData:L.FromBase64(t)};const s=r[2];if(s){const t=s.split(new RegExp(cr,"g"));let n=null;for(const r of t){const[t,s]=r.split(/:(.*)/);if(s===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:s.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(!Z.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:Z.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:Z.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 s=L.ToBase64(t.rawData);let i;let a=0;const o=Array();while(a<s.length){if(s.length-a<64){i=s.substring(a)}else{i=s.substring(a,a+64);a+=64}if(i.length!==0){o.push(i);if(i.length<64){break}}else{break}}r.push(...o);r.push(`-----END ${n}-----`);return r.join("\n")}}dr.CertificateTag="CERTIFICATE";dr.CrlTag="CRL";dr.CertificateRequestTag="CERTIFICATE REQUEST";dr.PublicKeyTag="PUBLIC KEY";dr.PrivateKeyTag="PRIVATE KEY";class pr extends On{static isAsnEncoded(t){return Z.isBufferSource(t)||typeof t==="string"}static toArrayBuffer(t){if(typeof t==="string"){if(dr.isPem(t)){return dr.decode(t)[0]}else if(L.isHex(t)){return L.FromHex(t)}else if(L.isBase64(t)){return L.FromBase64(t)}else if(L.isBase64Url(t)){return L.FromBase64Url(t)}else{throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}else{const e=L.ToBinary(t);if(dr.isPem(e)){return dr.decode(e)[0]}else if(L.isHex(e)){return L.FromHex(e)}else if(L.isBase64(e)){return L.FromBase64(e)}else if(L.isBase64Url(e)){return L.FromBase64Url(e)}return Z.toArrayBuffer(t)}}constructor(...t){if(pr.isAsnEncoded(t[0])){super(pr.toArrayBuffer(t[0]),t[1])}else{super(t[0])}}toString(t="pem"){switch(t){case"pem":return dr.encode(this.rawData,this.tag);default:return super.toString(t)}}}class wr extends pr{static async create(t,e=Hn.get()){if(t instanceof wr){return t}else if(Tn.isCryptoKey(t)){if(t.type!=="public"){throw new TypeError("Public key is required")}const n=await e.subtle.exportKey("spki",t);return new wr(n)}else if(t.publicKey){return t.publicKey}else if(Z.isBufferSource(t)){return new wr(t)}else{throw new TypeError("Unsupported PublicKeyType")}}constructor(t){if(pr.isAsnEncoded(t)){super(t,Ot)}else{super(t)}this.tag=dr.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]||Hn.get()}else{e=t[0]||Hn.get()}let s=this.rawData;const i=b.parse(this.rawData,Ot);if(i.algorithm.algorithm===bt){s=mr(i,s)}return e.subtle.importKey("spki",s,r,true,n)}onInit(t){const e=Ke.resolve(Be);const n=this.algorithm=e.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case H:{const e=b.parse(t.subjectPublicKey,_t);const r=Z.toUint8Array(e.modulus);n.publicExponent=Z.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]||Hn.get()}else{n=t[0]||Hn.get()}return await n.subtle.digest(r,this.rawData)}async getKeyIdentifier(...t){let e;let n="SHA-1";if(t.length===1){if(typeof t[0]==="string"){n=t[0];e=Hn.get()}else{e=t[0]}}else if(t.length===2){n=t[0];e=t[1]}else{e=Hn.get()}const r=b.parse(this.rawData,Ot);return await e.subtle.digest(n,r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty();const e=b.parse(this.rawData,Ot);t["Algorithm"]=Pn.serializeAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case y:t["EC Point"]=e.subjectPublicKey;break;case H:default:t["Raw Data"]=e.subjectPublicKey}return t}}function mr(t,e){t.algorithm=new v({algorithm:H,parameters:null});e=b.serialize(t);return e}class yr extends _n{static async create(t,e=false,n=Hn.get()){if("name"in t&&"serialNumber"in t){return new yr(t,e)}const r=await wr.create(t,n);const s=await r.getKeyIdentifier(n);return new yr(L.ToHex(s),e)}constructor(...t){if(Z.isBufferSource(t[0])){super(t[0])}else if(typeof t[0]==="string"){const e=new G({keyIdentifier:new q(L.FromHex(t[0]))});super(o,t[1],b.serialize(e))}else{const e=t[0];const n=e.na