@learncard/init 2.3.19 → 2.3.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,151 +1,2 @@
1
- "use strict";var xE=Object.create;var zd=Object.defineProperty;var PE=Object.getOwnPropertyDescriptor;var IE=Object.getOwnPropertyNames;var OE=Object.getPrototypeOf,BE=Object.prototype.hasOwnProperty;var u=(r,e)=>zd(r,"name",{value:e,configurable:!0});var NE=(r,e)=>{for(var t in e)zd(r,t,{get:e[t],enumerable:!0})},S1=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of IE(e))!BE.call(r,i)&&i!==t&&zd(r,i,{get:()=>e[i],enumerable:!(n=PE(e,i))||n.enumerable});return r};var Zn=(r,e,t)=>(t=r!=null?xE(OE(r)):{},S1(e||!r||!r.__esModule?zd(t,"default",{value:r,enumerable:!0}):t,r)),TE=r=>S1(zd({},"__esModule",{value:!0}),r);var xB={};NE(xB,{customLearnCard:()=>Lh,didWebLearnCardFromSeed:()=>g1,didWebNetworkLearnCardFromSeed:()=>m1,emptyLearnCard:()=>Dh,initLearnCard:()=>kB,learnCardFromApiUrl:()=>w1,learnCardFromSeed:()=>v1,networkLearnCardFromApiKey:()=>b1,networkLearnCardFromSeed:()=>y1});module.exports=TE(xB);var A1=require("@learncard/core");var Lh=u(async({debug:r}={})=>(0,A1.generateLearnCard)({debug:r}),"customLearnCard");var C1=require("@learncard/core"),E1=require("@learncard/dynamic-loader-plugin"),k1=require("@learncard/crypto-plugin"),x1=require("@learncard/didkit-plugin"),P1=require("@learncard/expiration-plugin"),I1=require("@learncard/vc-templates-plugin"),O1=require("@learncard/chapi-plugin"),B1=require("@learncard/learn-card-plugin");var Dh=u(async({didkit:r,allowRemoteContexts:e=!1,debug:t}={})=>{let i=await(await(await(0,C1.generateLearnCard)({debug:t})).addPlugin(E1.DynamicLoaderPlugin)).addPlugin(k1.CryptoPlugin),a=u(async()=>r==="node"?(await import("@learncard/didkit-plugin-node")).getDidKitPlugin:x1.getDidKitPlugin,"getDidkit"),s=await i.addPlugin(await(await a())(r==="node"?void 0:r,e)),f=await(await(await s.addPlugin((0,P1.expirationPlugin)(s))).addPlugin((0,I1.getVCTemplatesPlugin)())).addPlugin(await(0,O1.getCHAPIPlugin)());return f.addPlugin((0,B1.getLearnCardPlugin)(f))},"emptyLearnCard");var i8=require("@learncard/core"),a8=require("@learncard/dynamic-loader-plugin"),o8=require("@learncard/crypto-plugin"),s8=require("@learncard/didkit-plugin"),u8=require("@learncard/didkey-plugin"),c8=require("@learncard/encryption-plugin"),d8=require("@learncard/vc-plugin"),f8=require("@learncard/vc-templates-plugin"),l8=require("@learncard/learn-cloud-plugin"),p8=require("@learncard/expiration-plugin"),h8=require("@learncard/ethereum-plugin"),v8=require("@learncard/vpqr-plugin"),y8=require("@learncard/chapi-plugin"),g8=require("@learncard/learn-card-plugin");var RE=Object.create,el=Object.defineProperty,jE=Object.getOwnPropertyDescriptor,Nw=Object.getOwnPropertyNames,LE=Object.getPrototypeOf,DE=Object.prototype.hasOwnProperty,ME=u((r,e,t)=>e in r?el(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"),o=u((r,e)=>el(r,"name",{value:e,configurable:!0}),"__name"),se=u((r,e)=>u(function(){return e||(0,r[Nw(r)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),Tw=u((r,e)=>{for(var t in e)el(r,t,{get:e[t],enumerable:!0})},"__export"),VE=u((r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Nw(e))!DE.call(r,i)&&i!==t&&el(r,i,{get:u(()=>e[i],"get"),enumerable:!(n=jE(e,i))||n.enumerable});return r},"__copyProps"),$n=u((r,e,t)=>(t=r!=null?RE(LE(r)):{},VE(e||!r||!r.__esModule?el(t,"default",{value:r,enumerable:!0}):t,r)),"__toESM"),y=u((r,e,t)=>ME(r,typeof e!="symbol"?e+"":e,t),"__publicField"),UE=se({"../../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js"(){"use strict";var r;(function(e){(function(t){var n=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:d(),i=a(e);typeof n.Reflect<"u"&&(i=a(n.Reflect,i)),t(i,n),typeof n.Reflect>"u"&&(n.Reflect=e);function a(f,l){return function(p,v){Object.defineProperty(f,p,{configurable:!0,writable:!0,value:v}),l&&l(p,v)}}u(a,"makeExporter"),o(a,"makeExporter");function s(){try{return Function("return this;")()}catch{}}u(s,"functionThis"),o(s,"functionThis");function c(){try{return(0,eval)("(function() { return this; })()")}catch{}}u(c,"indirectEvalThis"),o(c,"indirectEvalThis");function d(){return s()||c()}u(d,"sloppyModeThis"),o(d,"sloppyModeThis")})(function(t,n){var i=Object.prototype.hasOwnProperty,a=typeof Symbol=="function",s=a&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",c=a&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",d=typeof Object.create=="function",f={__proto__:[]}instanceof Array,l=!d&&!f,p={create:d?function(){return yn(Object.create(null))}:f?function(){return yn({__proto__:null})}:function(){return yn({})},has:l?function(x,I){return i.call(x,I)}:function(x,I){return I in x},get:l?function(x,I){return i.call(x,I)?x[I]:void 0}:function(x,I){return x[I]}},v=Object.getPrototypeOf(Function),b=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Ht(),g=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Xn(),A=typeof WeakMap=="function"?WeakMap:Jd(),w=a?Symbol.for("@reflect-metadata:registry"):void 0,C=Ir(),B=vn(C);function T(x,I,R,q){if(ee(R)){if(!F(x))throw new TypeError;if(!Q(I))throw new TypeError;return Oe(x,I)}else{if(!F(x))throw new TypeError;if(!Ee(I))throw new TypeError;if(!Ee(q)&&!ee(q)&&!et(q))throw new TypeError;return et(q)&&(q=void 0),R=N(R),Pe(x,I,R,q)}}u(T,"decorate"),o(T,"decorate"),t("decorate",T);function M(x,I){function R(q,G){if(!Ee(q))throw new TypeError;if(!ee(G)&&!Se(G))throw new TypeError;ut(x,I,q,G)}return u(R,"decorator"),o(R,"decorator"),R}u(M,"metadata"),o(M,"metadata"),t("metadata",M);function O(x,I,R,q){if(!Ee(R))throw new TypeError;return ee(q)||(q=N(q)),ut(x,I,R,q)}u(O,"defineMetadata"),o(O,"defineMetadata"),t("defineMetadata",O);function E(x,I,R){if(!Ee(I))throw new TypeError;return ee(R)||(R=N(R)),Je(x,I,R)}u(E,"hasMetadata"),o(E,"hasMetadata"),t("hasMetadata",E);function P(x,I,R){if(!Ee(I))throw new TypeError;return ee(R)||(R=N(R)),Me(x,I,R)}u(P,"hasOwnMetadata"),o(P,"hasOwnMetadata"),t("hasOwnMetadata",P);function L(x,I,R){if(!Ee(I))throw new TypeError;return ee(R)||(R=N(R)),Xe(x,I,R)}u(L,"getMetadata"),o(L,"getMetadata"),t("getMetadata",L);function V(x,I,R){if(!Ee(I))throw new TypeError;return ee(R)||(R=N(R)),Ye(x,I,R)}u(V,"getOwnMetadata"),o(V,"getOwnMetadata"),t("getOwnMetadata",V);function Y(x,I){if(!Ee(x))throw new TypeError;return ee(I)||(I=N(I)),Ze(x,I)}u(Y,"getMetadataKeys"),o(Y,"getMetadataKeys"),t("getMetadataKeys",Y);function oe(x,I){if(!Ee(x))throw new TypeError;return ee(I)||(I=N(I)),Ot(x,I)}u(oe,"getOwnMetadataKeys"),o(oe,"getOwnMetadataKeys"),t("getOwnMetadataKeys",oe);function be(x,I,R){if(!Ee(I))throw new TypeError;if(ee(R)||(R=N(R)),!Ee(I))throw new TypeError;ee(R)||(R=N(R));var q=Gt(I,R,!1);return ee(q)?!1:q.OrdinaryDeleteMetadata(x,I,R)}u(be,"deleteMetadata"),o(be,"deleteMetadata"),t("deleteMetadata",be);function Oe(x,I){for(var R=x.length-1;R>=0;--R){var q=x[R],G=q(I);if(!ee(G)&&!et(G)){if(!Q(G))throw new TypeError;I=G}}return I}u(Oe,"DecorateConstructor"),o(Oe,"DecorateConstructor");function Pe(x,I,R,q){for(var G=x.length-1;G>=0;--G){var De=x[G],Ve=De(I,R,q);if(!ee(Ve)&&!et(Ve)){if(!Ee(Ve))throw new TypeError;q=Ve}}return q}u(Pe,"DecorateProperty"),o(Pe,"DecorateProperty");function Je(x,I,R){var q=Me(x,I,R);if(q)return!0;var G=Wr(I);return et(G)?!1:Je(x,G,R)}u(Je,"OrdinaryHasMetadata"),o(Je,"OrdinaryHasMetadata");function Me(x,I,R){var q=Gt(I,R,!1);return ee(q)?!1:U(q.OrdinaryHasOwnMetadata(x,I,R))}u(Me,"OrdinaryHasOwnMetadata"),o(Me,"OrdinaryHasOwnMetadata");function Xe(x,I,R){var q=Me(x,I,R);if(q)return Ye(x,I,R);var G=Wr(I);if(!et(G))return Xe(x,G,R)}u(Xe,"OrdinaryGetMetadata"),o(Xe,"OrdinaryGetMetadata");function Ye(x,I,R){var q=Gt(I,R,!1);if(!ee(q))return q.OrdinaryGetOwnMetadata(x,I,R)}u(Ye,"OrdinaryGetOwnMetadata"),o(Ye,"OrdinaryGetOwnMetadata");function ut(x,I,R,q){var G=Gt(R,q,!0);G.OrdinaryDefineOwnMetadata(x,I,R,q)}u(ut,"OrdinaryDefineOwnMetadata"),o(ut,"OrdinaryDefineOwnMetadata");function Ze(x,I){var R=Ot(x,I),q=Wr(x);if(q===null)return R;var G=Ze(q,I);if(G.length<=0)return R;if(R.length<=0)return G;for(var De=new g,Ve=[],fe=0,K=R;fe<K.length;fe++){var J=K[fe],Z=De.has(J);Z||(De.add(J),Ve.push(J))}for(var te=0,ge=G;te<ge.length;te++){var J=ge[te],Z=De.has(J);Z||(De.add(J),Ve.push(J))}return Ve}u(Ze,"OrdinaryMetadataKeys"),o(Ze,"OrdinaryMetadataKeys");function Ot(x,I){var R=Gt(x,I,!1);return R?R.OrdinaryOwnMetadataKeys(x,I):[]}u(Ot,"OrdinaryOwnMetadataKeys"),o(Ot,"OrdinaryOwnMetadataKeys");function me(x){if(x===null)return 1;switch(typeof x){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return x===null?1:6;default:return 6}}u(me,"Type"),o(me,"Type");function ee(x){return x===void 0}u(ee,"IsUndefined"),o(ee,"IsUndefined");function et(x){return x===null}u(et,"IsNull"),o(et,"IsNull");function Bt(x){return typeof x=="symbol"}u(Bt,"IsSymbol"),o(Bt,"IsSymbol");function Ee(x){return typeof x=="object"?x!==null:typeof x=="function"}u(Ee,"IsObject"),o(Ee,"IsObject");function S(x,I){switch(me(x)){case 0:return x;case 1:return x;case 2:return x;case 3:return x;case 4:return x;case 5:return x}var R=I===3?"string":I===5?"number":"default",q=tt(x,s);if(q!==void 0){var G=q.call(x,R);if(Ee(G))throw new TypeError;return G}return _(x,R==="default"?"number":R)}u(S,"ToPrimitive"),o(S,"ToPrimitive");function _(x,I){if(I==="string"){var R=x.toString;if(re(R)){var q=R.call(x);if(!Ee(q))return q}var G=x.valueOf;if(re(G)){var q=G.call(x);if(!Ee(q))return q}}else{var G=x.valueOf;if(re(G)){var q=G.call(x);if(!Ee(q))return q}var De=x.toString;if(re(De)){var q=De.call(x);if(!Ee(q))return q}}throw new TypeError}u(_,"OrdinaryToPrimitive"),o(_,"OrdinaryToPrimitive");function U(x){return!!x}u(U,"ToBoolean"),o(U,"ToBoolean");function j(x){return""+x}u(j,"ToString"),o(j,"ToString");function N(x){var I=S(x,3);return Bt(I)?I:j(I)}u(N,"ToPropertyKey"),o(N,"ToPropertyKey");function F(x){return Array.isArray?Array.isArray(x):x instanceof Object?x instanceof Array:Object.prototype.toString.call(x)==="[object Array]"}u(F,"IsArray"),o(F,"IsArray");function re(x){return typeof x=="function"}u(re,"IsCallable"),o(re,"IsCallable");function Q(x){return typeof x=="function"}u(Q,"IsConstructor"),o(Q,"IsConstructor");function Se(x){switch(me(x)){case 3:return!0;case 4:return!0;default:return!1}}u(Se,"IsPropertyKey"),o(Se,"IsPropertyKey");function xe(x,I){return x===I||x!==x&&I!==I}u(xe,"SameValueZero"),o(xe,"SameValueZero");function tt(x,I){var R=x[I];if(R!=null){if(!re(R))throw new TypeError;return R}}u(tt,"GetMethod"),o(tt,"GetMethod");function Te(x){var I=tt(x,c);if(!re(I))throw new TypeError;var R=I.call(x);if(!Ee(R))throw new TypeError;return R}u(Te,"GetIterator"),o(Te,"GetIterator");function at(x){return x.value}u(at,"IteratorValue"),o(at,"IteratorValue");function $t(x){var I=x.next();return I.done?!1:I}u($t,"IteratorStep"),o($t,"IteratorStep");function qt(x){var I=x.return;I&&I.call(x)}u(qt,"IteratorClose"),o(qt,"IteratorClose");function Wr(x){var I=Object.getPrototypeOf(x);if(typeof x!="function"||x===v||I!==v)return I;var R=x.prototype,q=R&&Object.getPrototypeOf(R);if(q==null||q===Object.prototype)return I;var G=q.constructor;return typeof G!="function"||G===x?I:G}u(Wr,"OrdinaryGetPrototypeOf"),o(Wr,"OrdinaryGetPrototypeOf");function Pr(){var x;!ee(w)&&typeof n.Reflect<"u"&&!(w in n.Reflect)&&typeof n.Reflect.defineMetadata=="function"&&(x=Jr(n.Reflect));var I,R,q,G=new A,De={registerProvider:Ve,getProvider:K,setProvider:Z};return De;function Ve(te){if(!Object.isExtensible(De))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case x===te:break;case ee(I):I=te;break;case I===te:break;case ee(R):R=te;break;case R===te:break;default:q===void 0&&(q=new g),q.add(te);break}}function fe(te,ge){if(!ee(I)){if(I.isProviderFor(te,ge))return I;if(!ee(R)){if(R.isProviderFor(te,ge))return I;if(!ee(q))for(var Re=Te(q);;){var ze=$t(Re);if(!ze)return;var Xt=at(ze);if(Xt.isProviderFor(te,ge))return qt(Re),Xt}}}if(!ee(x)&&x.isProviderFor(te,ge))return x}function K(te,ge){var Re=G.get(te),ze;return ee(Re)||(ze=Re.get(ge)),ee(ze)&&(ze=fe(te,ge),ee(ze)||(ee(Re)&&(Re=new b,G.set(te,Re)),Re.set(ge,ze))),ze}function J(te){if(ee(te))throw new TypeError;return I===te||R===te||!ee(q)&&q.has(te)}function Z(te,ge,Re){if(!J(Re))throw new Error("Metadata provider not registered.");var ze=K(te,ge);if(ze!==Re){if(!ee(ze))return!1;var Xt=G.get(te);ee(Xt)&&(Xt=new b,G.set(te,Xt)),Xt.set(ge,Re)}return!0}}u(Pr,"CreateMetadataRegistry"),o(Pr,"CreateMetadataRegistry");function Ir(){var x;return!ee(w)&&Ee(n.Reflect)&&Object.isExtensible(n.Reflect)&&(x=n.Reflect[w]),ee(x)&&(x=Pr()),!ee(w)&&Ee(n.Reflect)&&Object.isExtensible(n.Reflect)&&Object.defineProperty(n.Reflect,w,{enumerable:!1,configurable:!1,writable:!1,value:x}),x}u(Ir,"GetOrCreateMetadataRegistry"),o(Ir,"GetOrCreateMetadataRegistry");function vn(x){var I=new A,R={isProviderFor:o(function(J,Z){var te=I.get(J);return ee(te)?!1:te.has(Z)},"isProviderFor"),OrdinaryDefineOwnMetadata:Ve,OrdinaryHasOwnMetadata:G,OrdinaryGetOwnMetadata:De,OrdinaryOwnMetadataKeys:fe,OrdinaryDeleteMetadata:K};return C.registerProvider(R),R;function q(J,Z,te){var ge=I.get(J),Re=!1;if(ee(ge)){if(!te)return;ge=new b,I.set(J,ge),Re=!0}var ze=ge.get(Z);if(ee(ze)){if(!te)return;if(ze=new b,ge.set(Z,ze),!x.setProvider(J,Z,R))throw ge.delete(Z),Re&&I.delete(J),new Error("Wrong provider for target.")}return ze}u(q,"GetOrCreateMetadataMap"),o(q,"GetOrCreateMetadataMap");function G(J,Z,te){var ge=q(Z,te,!1);return ee(ge)?!1:U(ge.has(J))}u(G,"OrdinaryHasOwnMetadata2"),o(G,"OrdinaryHasOwnMetadata");function De(J,Z,te){var ge=q(Z,te,!1);if(!ee(ge))return ge.get(J)}u(De,"OrdinaryGetOwnMetadata2"),o(De,"OrdinaryGetOwnMetadata");function Ve(J,Z,te,ge){var Re=q(te,ge,!0);Re.set(J,Z)}u(Ve,"OrdinaryDefineOwnMetadata2"),o(Ve,"OrdinaryDefineOwnMetadata");function fe(J,Z){var te=[],ge=q(J,Z,!1);if(ee(ge))return te;for(var Re=ge.keys(),ze=Te(Re),Xt=0;;){var _1=$t(ze);if(!_1)return te.length=Xt,te;var EE=at(_1);try{te[Xt]=EE}catch(kE){try{qt(ze)}finally{throw kE}}Xt++}}u(fe,"OrdinaryOwnMetadataKeys2"),o(fe,"OrdinaryOwnMetadataKeys");function K(J,Z,te){var ge=q(Z,te,!1);if(ee(ge)||!ge.delete(J))return!1;if(ge.size===0){var Re=I.get(Z);ee(Re)||(Re.delete(te),Re.size===0&&I.delete(Re))}return!0}u(K,"OrdinaryDeleteMetadata"),o(K,"OrdinaryDeleteMetadata")}u(vn,"CreateMetadataProvider"),o(vn,"CreateMetadataProvider");function Jr(x){var I=x.defineMetadata,R=x.hasOwnMetadata,q=x.getOwnMetadata,G=x.getOwnMetadataKeys,De=x.deleteMetadata,Ve=new A,fe={isProviderFor:o(function(K,J){var Z=Ve.get(K);return!ee(Z)&&Z.has(J)?!0:G(K,J).length?(ee(Z)&&(Z=new g,Ve.set(K,Z)),Z.add(J),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:I,OrdinaryHasOwnMetadata:R,OrdinaryGetOwnMetadata:q,OrdinaryOwnMetadataKeys:G,OrdinaryDeleteMetadata:De};return fe}u(Jr,"CreateFallbackProvider"),o(Jr,"CreateFallbackProvider");function Gt(x,I,R){var q=C.getProvider(x,I);if(!ee(q))return q;if(R){if(C.setProvider(x,I,B))return B;throw new Error("Illegal state.")}}u(Gt,"GetMetadataProvider"),o(Gt,"GetMetadataProvider");function Ht(){var x={},I=[],R=(function(){function fe(K,J,Z){this._index=0,this._keys=K,this._values=J,this._selector=Z}return u(fe,"MapIterator2"),o(fe,"MapIterator"),fe.prototype["@@iterator"]=function(){return this},fe.prototype[c]=function(){return this},fe.prototype.next=function(){var K=this._index;if(K>=0&&K<this._keys.length){var J=this._selector(this._keys[K],this._values[K]);return K+1>=this._keys.length?(this._index=-1,this._keys=I,this._values=I):this._index++,{value:J,done:!1}}return{value:void 0,done:!0}},fe.prototype.throw=function(K){throw this._index>=0&&(this._index=-1,this._keys=I,this._values=I),K},fe.prototype.return=function(K){return this._index>=0&&(this._index=-1,this._keys=I,this._values=I),{value:K,done:!0}},fe})(),q=(function(){function fe(){this._keys=[],this._values=[],this._cacheKey=x,this._cacheIndex=-2}return u(fe,"Map3"),o(fe,"Map"),Object.defineProperty(fe.prototype,"size",{get:o(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),fe.prototype.has=function(K){return this._find(K,!1)>=0},fe.prototype.get=function(K){var J=this._find(K,!1);return J>=0?this._values[J]:void 0},fe.prototype.set=function(K,J){var Z=this._find(K,!0);return this._values[Z]=J,this},fe.prototype.delete=function(K){var J=this._find(K,!1);if(J>=0){for(var Z=this._keys.length,te=J+1;te<Z;te++)this._keys[te-1]=this._keys[te],this._values[te-1]=this._values[te];return this._keys.length--,this._values.length--,xe(K,this._cacheKey)&&(this._cacheKey=x,this._cacheIndex=-2),!0}return!1},fe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=x,this._cacheIndex=-2},fe.prototype.keys=function(){return new R(this._keys,this._values,G)},fe.prototype.values=function(){return new R(this._keys,this._values,De)},fe.prototype.entries=function(){return new R(this._keys,this._values,Ve)},fe.prototype["@@iterator"]=function(){return this.entries()},fe.prototype[c]=function(){return this.entries()},fe.prototype._find=function(K,J){if(!xe(this._cacheKey,K)){this._cacheIndex=-1;for(var Z=0;Z<this._keys.length;Z++)if(xe(this._keys[Z],K)){this._cacheIndex=Z;break}}return this._cacheIndex<0&&J&&(this._cacheIndex=this._keys.length,this._keys.push(K),this._values.push(void 0)),this._cacheIndex},fe})();return q;function G(fe,K){return fe}function De(fe,K){return K}function Ve(fe,K){return[fe,K]}}u(Ht,"CreateMapPolyfill"),o(Ht,"CreateMapPolyfill");function Xn(){var x=(function(){function I(){this._map=new b}return u(I,"Set4"),o(I,"Set"),Object.defineProperty(I.prototype,"size",{get:o(function(){return this._map.size},"get"),enumerable:!0,configurable:!0}),I.prototype.has=function(R){return this._map.has(R)},I.prototype.add=function(R){return this._map.set(R,R),this},I.prototype.delete=function(R){return this._map.delete(R)},I.prototype.clear=function(){this._map.clear()},I.prototype.keys=function(){return this._map.keys()},I.prototype.values=function(){return this._map.keys()},I.prototype.entries=function(){return this._map.entries()},I.prototype["@@iterator"]=function(){return this.keys()},I.prototype[c]=function(){return this.keys()},I})();return x}u(Xn,"CreateSetPolyfill"),o(Xn,"CreateSetPolyfill");function Jd(){var x=16,I=p.create(),R=q();return(function(){function K(){this._key=q()}return u(K,"WeakMap2"),o(K,"WeakMap"),K.prototype.has=function(J){var Z=G(J,!1);return Z!==void 0?p.has(Z,this._key):!1},K.prototype.get=function(J){var Z=G(J,!1);return Z!==void 0?p.get(Z,this._key):void 0},K.prototype.set=function(J,Z){var te=G(J,!0);return te[this._key]=Z,this},K.prototype.delete=function(J){var Z=G(J,!1);return Z!==void 0?delete Z[this._key]:!1},K.prototype.clear=function(){this._key=q()},K})();function q(){var K;do K="@@WeakMap@@"+fe();while(p.has(I,K));return I[K]=!0,K}function G(K,J){if(!i.call(K,R)){if(!J)return;Object.defineProperty(K,R,{value:p.create()})}return K[R]}function De(K,J){for(var Z=0;Z<J;++Z)K[Z]=Math.random()*255|0;return K}function Ve(K){if(typeof Uint8Array=="function"){var J=new Uint8Array(K);return typeof crypto<"u"?crypto.getRandomValues(J):typeof msCrypto<"u"?msCrypto.getRandomValues(J):De(J,K),J}return De(new Array(K),K)}function fe(){var K=Ve(x);K[6]=K[6]&79|64,K[8]=K[8]&191|128;for(var J="",Z=0;Z<x;++Z){var te=K[Z];(Z===4||Z===6||Z===8)&&(J+="-"),te<16&&(J+="0"),J+=te.toString(16).toLowerCase()}return J}}u(Jd,"CreateWeakMapPolyfill"),o(Jd,"CreateWeakMapPolyfill");function yn(x){return x.__=void 0,delete x.__,x}u(yn,"MakeDictionary"),o(yn,"MakeDictionary")})})(r||(r={}))}}),tl=se({"../../../node_modules/.pnpm/pvtsutils@1.3.6/node_modules/pvtsutils/build/index.js"(r){"use strict";var C,B,T,M;var e="[object ArrayBuffer]",t=(C=class{static isArrayBuffer(E){return Object.prototype.toString.call(E)===e}static toArrayBuffer(E){return this.isArrayBuffer(E)?E:E.byteLength===E.buffer.byteLength||E.byteOffset===0&&E.byteLength===E.buffer.byteLength?E.buffer:this.toUint8Array(E.buffer).slice(E.byteOffset,E.byteOffset+E.byteLength).buffer}static toUint8Array(E){return this.toView(E,Uint8Array)}static toView(E,P){if(E.constructor===P)return E;if(this.isArrayBuffer(E))return new P(E);if(this.isArrayBufferView(E))return new P(E.buffer,E.byteOffset,E.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(E){return this.isArrayBufferView(E)||this.isArrayBuffer(E)}static isArrayBufferView(E){return ArrayBuffer.isView(E)||E&&this.isArrayBuffer(E.buffer)}static isEqual(E,P){let L=C.toUint8Array(E),V=C.toUint8Array(P);if(L.length!==V.byteLength)return!1;for(let Y=0;Y<L.length;Y++)if(L[Y]!==V[Y])return!1;return!0}static concat(...E){let P;Array.isArray(E[0])&&!(E[1]instanceof Function)||Array.isArray(E[0])&&E[1]instanceof Function?P=E[0]:E[E.length-1]instanceof Function?P=E.slice(0,E.length-1):P=E;let L=0;for(let oe of P)L+=oe.byteLength;let V=new Uint8Array(L),Y=0;for(let oe of P){let be=this.toUint8Array(oe);V.set(be,Y),Y+=be.length}return E[E.length-1]instanceof Function?this.toView(V,E[E.length-1]):V.buffer}},u(C,"_BufferSourceConverter"),C);o(t,"BufferSourceConverter");var n=t,i="string",a=/^[0-9a-f\s]+$/i,s=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,c=/^[a-zA-Z0-9-_]+$/,d=(B=class{static fromString(E){let P=unescape(encodeURIComponent(E)),L=new Uint8Array(P.length);for(let V=0;V<P.length;V++)L[V]=P.charCodeAt(V);return L.buffer}static toString(E){let P=n.toUint8Array(E),L="";for(let Y=0;Y<P.length;Y++)L+=String.fromCharCode(P[Y]);return decodeURIComponent(escape(L))}},u(B,"_Utf8Converter"),B);o(d,"Utf8Converter");var f=d,l=(T=class{static toString(E,P=!1){let L=n.toArrayBuffer(E),V=new DataView(L),Y="";for(let oe=0;oe<L.byteLength;oe+=2){let be=V.getUint16(oe,P);Y+=String.fromCharCode(be)}return Y}static fromString(E,P=!1){let L=new ArrayBuffer(E.length*2),V=new DataView(L);for(let Y=0;Y<E.length;Y++)V.setUint16(Y*2,E.charCodeAt(Y),P);return L}},u(T,"_Utf16Converter"),T);o(l,"Utf16Converter");var p=l,v=(M=class{static isHex(E){return typeof E===i&&a.test(E)}static isBase64(E){return typeof E===i&&s.test(E)}static isBase64Url(E){return typeof E===i&&c.test(E)}static ToString(E,P="utf8"){let L=n.toUint8Array(E);switch(P.toLowerCase()){case"utf8":return this.ToUtf8String(L);case"binary":return this.ToBinary(L);case"hex":return this.ToHex(L);case"base64":return this.ToBase64(L);case"base64url":return this.ToBase64Url(L);case"utf16le":return p.toString(L,!0);case"utf16":case"utf16be":return p.toString(L);default:throw new Error(`Unknown type of encoding '${P}'`)}}static FromString(E,P="utf8"){if(!E)return new ArrayBuffer(0);switch(P.toLowerCase()){case"utf8":return this.FromUtf8String(E);case"binary":return this.FromBinary(E);case"hex":return this.FromHex(E);case"base64":return this.FromBase64(E);case"base64url":return this.FromBase64Url(E);case"utf16le":return p.fromString(E,!0);case"utf16":case"utf16be":return p.fromString(E);default:throw new Error(`Unknown type of encoding '${P}'`)}}static ToBase64(E){let P=n.toUint8Array(E);if(typeof btoa<"u"){let L=this.ToString(P,"binary");return btoa(L)}else return Buffer.from(P).toString("base64")}static FromBase64(E){let P=this.formatString(E);if(!P)return new ArrayBuffer(0);if(!M.isBase64(P))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(P)):new Uint8Array(Buffer.from(P,"base64")).buffer}static FromBase64Url(E){let P=this.formatString(E);if(!P)return new ArrayBuffer(0);if(!M.isBase64Url(P))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(P.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(E){return this.ToBase64(E).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(E,P=M.DEFAULT_UTF8_ENCODING){switch(P){case"ascii":return this.FromBinary(E);case"utf8":return f.fromString(E);case"utf16":case"utf16be":return p.fromString(E);case"utf16le":case"usc2":return p.fromString(E,!0);default:throw new Error(`Unknown type of encoding '${P}'`)}}static ToUtf8String(E,P=M.DEFAULT_UTF8_ENCODING){switch(P){case"ascii":return this.ToBinary(E);case"utf8":return f.toString(E);case"utf16":case"utf16be":return p.toString(E);case"utf16le":case"usc2":return p.toString(E,!0);default:throw new Error(`Unknown type of encoding '${P}'`)}}static FromBinary(E){let P=E.length,L=new Uint8Array(P);for(let V=0;V<P;V++)L[V]=E.charCodeAt(V);return L.buffer}static ToBinary(E){let P=n.toUint8Array(E),L="";for(let V=0;V<P.length;V++)L+=String.fromCharCode(P[V]);return L}static ToHex(E){let P=n.toUint8Array(E),L="",V=P.length;for(let Y=0;Y<V;Y++){let oe=P[Y];oe<16&&(L+="0"),L+=oe.toString(16)}return L}static FromHex(E){let P=this.formatString(E);if(!P)return new ArrayBuffer(0);if(!M.isHex(P))throw new TypeError("Argument 'hexString' is not HEX encoded");P.length%2&&(P=`0${P}`);let L=new Uint8Array(P.length/2);for(let V=0;V<P.length;V=V+2){let Y=P.slice(V,V+2);L[V/2]=parseInt(Y,16)}return L.buffer}static ToUtf16String(E,P=!1){return p.toString(E,P)}static FromUtf16String(E,P=!1){return p.fromString(E,P)}static Base64Padding(E){let P=4-E.length%4;if(P<4)for(let L=0;L<P;L++)E+="=";return E}static formatString(E){return E?.replace(/[\n\r\t ]/g,"")||""}},u(M,"_Convert"),M);o(v,"Convert");var b=v;b.DEFAULT_UTF8_ENCODING="utf8";function g(O,...E){let P=arguments[0];for(let L=1;L<arguments.length;L++){let V=arguments[L];for(let Y in V)P[Y]=V[Y]}return P}u(g,"assign"),o(g,"assign");function A(...O){let E=O.map(V=>V.byteLength).reduce((V,Y)=>V+Y),P=new Uint8Array(E),L=0;return O.map(V=>new Uint8Array(V)).forEach(V=>{for(let Y of V)P[L++]=Y}),P.buffer}u(A,"combine2"),o(A,"combine");function w(O,E){if(!(O&&E)||O.byteLength!==E.byteLength)return!1;let P=new Uint8Array(O),L=new Uint8Array(E);for(let V=0;V<O.byteLength;V++)if(P[V]!==L[V])return!1;return!0}u(w,"isEqual2"),o(w,"isEqual"),r.BufferSourceConverter=n,r.Convert=b,r.assign=g,r.combine=A,r.isEqual=w}}),Rw=se({"../../../node_modules/.pnpm/safe-regex@2.1.1/node_modules/safe-regex/lib/analyzer.js"(r,e){"use strict";var s,c;var t=(s=class{constructor(f){this.heuristic_replimit=f}},u(s,"_AnalyzerOptions"),s);o(t,"AnalyzerOptions");var n=t,i=(c=class{constructor(f){this.options=f}isVulnerable(f){return!1}genAttackString(f){return null}},u(c,"_Analyzer"),c);o(i,"Analyzer");var a=i;e.exports=function(d,f){let l=null,p=null;try{d instanceof RegExp?l=d:typeof d=="string"?l=new RegExp(d):l=new RegExp(String(d)),p=regexpTree.parse(l)}catch{return!1}let v=0,b=0,g=0;return regexpTree.traverse(p,{Repetition:{pre({node:A}){g++,v++,b<v&&(b=v)},post({node:A}){v--}}}),b<=1&&g<=f},e.exports={AnalyzerOptions:n,Analyzer:a}}}),$E=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/compat-transpiler/transforms/compat-dotall-s-transform.js"(r,e){"use strict";e.exports={_hasUFlag:!1,shouldRun:o(u(function(n){var i=n.flags.includes("s");return i?(n.flags=n.flags.replace("s",""),this._hasUFlag=n.flags.includes("u"),!0):!1},"shouldRun"),"shouldRun"),Char:o(u(function(n){var i=n.node;if(!(i.kind!=="meta"||i.value!==".")){var a="\\uFFFF",s="\uFFFF";this._hasUFlag&&(a="\\u{10FFFF}",s="\u{10FFFF}"),n.replace({type:"CharacterClass",expressions:[{type:"ClassRange",from:{type:"Char",value:"\\0",kind:"decimal",symbol:"\0"},to:{type:"Char",value:a,kind:"unicode",symbol:s}}]})}},"Char"),"Char")}}}),qE=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/compat-transpiler/transforms/compat-named-capturing-groups-transform.js"(r,e){"use strict";e.exports={_groupNames:{},init:o(u(function(){this._groupNames={}},"init"),"init"),getExtra:o(u(function(){return this._groupNames},"getExtra"),"getExtra"),Group:o(u(function(n){var i=n.node;i.name&&(this._groupNames[i.name]=i.number,delete i.name,delete i.nameRaw)},"Group"),"Group"),Backreference:o(u(function(n){var i=n.node;i.kind==="name"&&(i.kind="number",i.reference=i.number,delete i.referenceRaw)},"Backreference"),"Backreference")}}}),HE=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/compat-transpiler/transforms/compat-x-flag-transform.js"(r,e){"use strict";e.exports={RegExp:o(u(function(n){var i=n.node;i.flags.includes("x")&&(i.flags=i.flags.replace("x",""))},"RegExp2"),"RegExp")}}}),FE=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/compat-transpiler/transforms/index.js"(r,e){"use strict";e.exports={dotAll:$E(),namedCapturingGroups:qE(),xFlag:HE()}}}),jw=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/generator/index.js"(r,e){"use strict";function t(i){return i?n[i.type](i):""}u(t,"gen"),o(t,"gen");var n={RegExp:o(u(function(a){return"/"+t(a.body)+"/"+a.flags},"RegExp2"),"RegExp"),Alternative:o(u(function(a){return(a.expressions||[]).map(t).join("")},"Alternative"),"Alternative"),Disjunction:o(u(function(a){return t(a.left)+"|"+t(a.right)},"Disjunction"),"Disjunction"),Group:o(u(function(a){var s=t(a.expression);return a.capturing?a.name?"(?<"+(a.nameRaw||a.name)+">"+s+")":"("+s+")":"(?:"+s+")"},"Group"),"Group"),Backreference:o(u(function(a){switch(a.kind){case"number":return"\\"+a.reference;case"name":return"\\k<"+(a.referenceRaw||a.reference)+">";default:throw new TypeError("Unknown Backreference kind: "+a.kind)}},"Backreference"),"Backreference"),Assertion:o(u(function(a){switch(a.kind){case"^":case"$":case"\\b":case"\\B":return a.kind;case"Lookahead":{var s=t(a.assertion);return a.negative?"(?!"+s+")":"(?="+s+")"}case"Lookbehind":{var c=t(a.assertion);return a.negative?"(?<!"+c+")":"(?<="+c+")"}default:throw new TypeError("Unknown Assertion kind: "+a.kind)}},"Assertion"),"Assertion"),CharacterClass:o(u(function(a){var s=a.expressions.map(t).join("");return a.negative?"[^"+s+"]":"["+s+"]"},"CharacterClass"),"CharacterClass"),ClassRange:o(u(function(a){return t(a.from)+"-"+t(a.to)},"ClassRange"),"ClassRange"),Repetition:o(u(function(a){return""+t(a.expression)+t(a.quantifier)},"Repetition"),"Repetition"),Quantifier:o(u(function(a){var s=void 0,c=a.greedy?"":"?";switch(a.kind){case"+":case"?":case"*":s=a.kind;break;case"Range":a.from===a.to?s="{"+a.from+"}":a.to?s="{"+a.from+","+a.to+"}":s="{"+a.from+",}";break;default:throw new TypeError("Unknown Quantifier kind: "+a.kind)}return""+s+c},"Quantifier"),"Quantifier"),Char:o(u(function(a){var s=a.value;switch(a.kind){case"simple":return a.escaped?"\\"+s:s;case"hex":case"unicode":case"oct":case"decimal":case"control":case"meta":return s;default:throw new TypeError("Unknown Char kind: "+a.kind)}},"Char"),"Char"),UnicodeProperty:o(u(function(a){var s=a.negative?"P":"p",c=void 0;return!a.shorthand&&!a.binary?c=a.name+"=":c="","\\"+s+"{"+c+a.value+"}"},"UnicodeProperty"),"UnicodeProperty")};e.exports={generate:t}}}),KE=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/parser/unicode/parser-unicode-properties.js"(r,e){"use strict";var t={General_Category:"gc",Script:"sc",Script_Extensions:"scx"},n=l(t),i={ASCII:"ASCII",ASCII_Hex_Digit:"AHex",Alphabetic:"Alpha",Any:"Any",Assigned:"Assigned",Bidi_Control:"Bidi_C",Bidi_Mirrored:"Bidi_M",Case_Ignorable:"CI",Cased:"Cased",Changes_When_Casefolded:"CWCF",Changes_When_Casemapped:"CWCM",Changes_When_Lowercased:"CWL",Changes_When_NFKC_Casefolded:"CWKCF",Changes_When_Titlecased:"CWT",Changes_When_Uppercased:"CWU",Dash:"Dash",Default_Ignorable_Code_Point:"DI",Deprecated:"Dep",Diacritic:"Dia",Emoji:"Emoji",Emoji_Component:"Emoji_Component",Emoji_Modifier:"Emoji_Modifier",Emoji_Modifier_Base:"Emoji_Modifier_Base",Emoji_Presentation:"Emoji_Presentation",Extended_Pictographic:"Extended_Pictographic",Extender:"Ext",Grapheme_Base:"Gr_Base",Grapheme_Extend:"Gr_Ext",Hex_Digit:"Hex",IDS_Binary_Operator:"IDSB",IDS_Trinary_Operator:"IDST",ID_Continue:"IDC",ID_Start:"IDS",Ideographic:"Ideo",Join_Control:"Join_C",Logical_Order_Exception:"LOE",Lowercase:"Lower",Math:"Math",Noncharacter_Code_Point:"NChar",Pattern_Syntax:"Pat_Syn",Pattern_White_Space:"Pat_WS",Quotation_Mark:"QMark",Radical:"Radical",Regional_Indicator:"RI",Sentence_Terminal:"STerm",Soft_Dotted:"SD",Terminal_Punctuation:"Term",Unified_Ideograph:"UIdeo",Uppercase:"Upper",Variation_Selector:"VS",White_Space:"space",XID_Continue:"XIDC",XID_Start:"XIDS"},a=l(i),s={Cased_Letter:"LC",Close_Punctuation:"Pe",Connector_Punctuation:"Pc",Control:["Cc","cntrl"],Currency_Symbol:"Sc",Dash_Punctuation:"Pd",Decimal_Number:["Nd","digit"],Enclosing_Mark:"Me",Final_Punctuation:"Pf",Format:"Cf",Initial_Punctuation:"Pi",Letter:"L",Letter_Number:"Nl",Line_Separator:"Zl",Lowercase_Letter:"Ll",Mark:["M","Combining_Mark"],Math_Symbol:"Sm",Modifier_Letter:"Lm",Modifier_Symbol:"Sk",Nonspacing_Mark:"Mn",Number:"N",Open_Punctuation:"Ps",Other:"C",Other_Letter:"Lo",Other_Number:"No",Other_Punctuation:"Po",Other_Symbol:"So",Paragraph_Separator:"Zp",Private_Use:"Co",Punctuation:["P","punct"],Separator:"Z",Space_Separator:"Zs",Spacing_Mark:"Mc",Surrogate:"Cs",Symbol:"S",Titlecase_Letter:"Lt",Unassigned:"Cn",Uppercase_Letter:"Lu"},c=l(s),d={Adlam:"Adlm",Ahom:"Ahom",Anatolian_Hieroglyphs:"Hluw",Arabic:"Arab",Armenian:"Armn",Avestan:"Avst",Balinese:"Bali",Bamum:"Bamu",Bassa_Vah:"Bass",Batak:"Batk",Bengali:"Beng",Bhaiksuki:"Bhks",Bopomofo:"Bopo",Brahmi:"Brah",Braille:"Brai",Buginese:"Bugi",Buhid:"Buhd",Canadian_Aboriginal:"Cans",Carian:"Cari",Caucasian_Albanian:"Aghb",Chakma:"Cakm",Cham:"Cham",Cherokee:"Cher",Common:"Zyyy",Coptic:["Copt","Qaac"],Cuneiform:"Xsux",Cypriot:"Cprt",Cyrillic:"Cyrl",Deseret:"Dsrt",Devanagari:"Deva",Dogra:"Dogr",Duployan:"Dupl",Egyptian_Hieroglyphs:"Egyp",Elbasan:"Elba",Ethiopic:"Ethi",Georgian:"Geor",Glagolitic:"Glag",Gothic:"Goth",Grantha:"Gran",Greek:"Grek",Gujarati:"Gujr",Gunjala_Gondi:"Gong",Gurmukhi:"Guru",Han:"Hani",Hangul:"Hang",Hanifi_Rohingya:"Rohg",Hanunoo:"Hano",Hatran:"Hatr",Hebrew:"Hebr",Hiragana:"Hira",Imperial_Aramaic:"Armi",Inherited:["Zinh","Qaai"],Inscriptional_Pahlavi:"Phli",Inscriptional_Parthian:"Prti",Javanese:"Java",Kaithi:"Kthi",Kannada:"Knda",Katakana:"Kana",Kayah_Li:"Kali",Kharoshthi:"Khar",Khmer:"Khmr",Khojki:"Khoj",Khudawadi:"Sind",Lao:"Laoo",Latin:"Latn",Lepcha:"Lepc",Limbu:"Limb",Linear_A:"Lina",Linear_B:"Linb",Lisu:"Lisu",Lycian:"Lyci",Lydian:"Lydi",Mahajani:"Mahj",Makasar:"Maka",Malayalam:"Mlym",Mandaic:"Mand",Manichaean:"Mani",Marchen:"Marc",Medefaidrin:"Medf",Masaram_Gondi:"Gonm",Meetei_Mayek:"Mtei",Mende_Kikakui:"Mend",Meroitic_Cursive:"Merc",Meroitic_Hieroglyphs:"Mero",Miao:"Plrd",Modi:"Modi",Mongolian:"Mong",Mro:"Mroo",Multani:"Mult",Myanmar:"Mymr",Nabataean:"Nbat",New_Tai_Lue:"Talu",Newa:"Newa",Nko:"Nkoo",Nushu:"Nshu",Ogham:"Ogam",Ol_Chiki:"Olck",Old_Hungarian:"Hung",Old_Italic:"Ital",Old_North_Arabian:"Narb",Old_Permic:"Perm",Old_Persian:"Xpeo",Old_Sogdian:"Sogo",Old_South_Arabian:"Sarb",Old_Turkic:"Orkh",Oriya:"Orya",Osage:"Osge",Osmanya:"Osma",Pahawh_Hmong:"Hmng",Palmyrene:"Palm",Pau_Cin_Hau:"Pauc",Phags_Pa:"Phag",Phoenician:"Phnx",Psalter_Pahlavi:"Phlp",Rejang:"Rjng",Runic:"Runr",Samaritan:"Samr",Saurashtra:"Saur",Sharada:"Shrd",Shavian:"Shaw",Siddham:"Sidd",SignWriting:"Sgnw",Sinhala:"Sinh",Sogdian:"Sogd",Sora_Sompeng:"Sora",Soyombo:"Soyo",Sundanese:"Sund",Syloti_Nagri:"Sylo",Syriac:"Syrc",Tagalog:"Tglg",Tagbanwa:"Tagb",Tai_Le:"Tale",Tai_Tham:"Lana",Tai_Viet:"Tavt",Takri:"Takr",Tamil:"Taml",Tangut:"Tang",Telugu:"Telu",Thaana:"Thaa",Thai:"Thai",Tibetan:"Tibt",Tifinagh:"Tfng",Tirhuta:"Tirh",Ugaritic:"Ugar",Vai:"Vaii",Warang_Citi:"Wara",Yi:"Yiii",Zanabazar_Square:"Zanb"},f=l(d);function l(O){var E={};for(var P in O)if(O.hasOwnProperty(P)){var L=O[P];if(Array.isArray(L))for(var V=0;V<L.length;V++)E[L[V]]=P;else E[L]=P}return E}u(l,"inverseMap"),o(l,"inverseMap");function p(O){return t.hasOwnProperty(O)||n.hasOwnProperty(O)||i.hasOwnProperty(O)||a.hasOwnProperty(O)}u(p,"isValidName"),o(p,"isValidName");function v(O,E){return g(O)?w(E):A(O)?C(E):!1}u(v,"isValidValue"),o(v,"isValidValue");function b(O){return n.hasOwnProperty(O)||a.hasOwnProperty(O)}u(b,"isAlias"),o(b,"isAlias");function g(O){return O==="General_Category"||O=="gc"}u(g,"isGeneralCategoryName"),o(g,"isGeneralCategoryName");function A(O){return O==="Script"||O==="Script_Extensions"||O==="sc"||O==="scx"}u(A,"isScriptCategoryName"),o(A,"isScriptCategoryName");function w(O){return s.hasOwnProperty(O)||c.hasOwnProperty(O)}u(w,"isGeneralCategoryValue"),o(w,"isGeneralCategoryValue");function C(O){return d.hasOwnProperty(O)||f.hasOwnProperty(O)}u(C,"isScriptCategoryValue"),o(C,"isScriptCategoryValue");function B(O){return i.hasOwnProperty(O)||a.hasOwnProperty(O)}u(B,"isBinaryPropertyName"),o(B,"isBinaryPropertyName");function T(O){return n.hasOwnProperty(O)?n[O]:a.hasOwnProperty(O)?a[O]:null}u(T,"getCanonicalName"),o(T,"getCanonicalName");function M(O){return c.hasOwnProperty(O)?c[O]:f.hasOwnProperty(O)?f[O]:a.hasOwnProperty(O)?a[O]:null}u(M,"getCanonicalValue"),o(M,"getCanonicalValue"),e.exports={isAlias:b,isValidName:p,isValidValue:v,isGeneralCategoryValue:w,isScriptCategoryValue:C,isBinaryPropertyName:B,getCanonicalName:T,getCanonicalValue:M,NON_BINARY_PROP_NAMES_TO_ALIASES:t,NON_BINARY_ALIASES_TO_PROP_NAMES:n,BINARY_PROP_NAMES_TO_ALIASES:i,BINARY_ALIASES_TO_PROP_NAMES:a,GENERAL_CATEGORY_VALUE_TO_ALIASES:s,GENERAL_CATEGORY_VALUE_ALIASES_TO_VALUES:c,SCRIPT_VALUE_TO_ALIASES:d,SCRIPT_VALUE_ALIASES_TO_VALUE:f}}}),WE=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/parser/generated/regexp-tree.js"(r,e){"use strict";var t=(function(){function S(_,U){var j=[],N=!0,F=!1,re=void 0;try{for(var Q=_[Symbol.iterator](),Se;!(N=(Se=Q.next()).done)&&(j.push(Se.value),!(U&&j.length===U));N=!0);}catch(xe){F=!0,re=xe}finally{try{!N&&Q.return&&Q.return()}finally{if(F)throw re}}return j}return u(S,"sliceIterator"),o(S,"sliceIterator"),function(_,U){if(Array.isArray(_))return _;if(Symbol.iterator in Object(_))return S(_,U);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})();function n(S){if(Array.isArray(S)){for(var _=0,U=Array(S.length);_<S.length;_++)U[_]=S[_];return U}else return Array.from(S)}u(n,"_toConsumableArray"),o(n,"_toConsumableArray");var i=void 0,a=void 0,s={},c=void 0,d=void 0;function f(S,_){return s.options.captureLocations?!S||!_?S||_:{startOffset:S.startOffset,endOffset:_.endOffset,startLine:S.startLine,endLine:_.endLine,startColumn:S.startColumn,endColumn:_.endColumn}:null}u(f,"yyloc"),o(f,"yyloc");var l="$",p=[[-1,1,function(S,_){d=f(_,_),c=S}],[0,4,function(S,_,U,j,N,F,re,Q){d=f(N,Q),c=me({type:"RegExp",body:_,flags:Oe(j)},ee(N,Q||re))}],[1,1,function(S,_){d=f(_,_),c=S}],[1,0,function(){d=null,c=""}],[2,1,function(S,_){d=f(_,_),c=S}],[2,2,function(S,_,U,j){d=f(U,j),c=S+_}],[3,1,function(S,_){d=f(_,_),c=S}],[4,1,function(S,_){d=f(_,_),c=S}],[4,3,function(S,_,U,j,N,F){d=f(j,F);var re=null;N&&(re=ee(j||N,F||N)),c=me({type:"Disjunction",left:S,right:U},re)}],[5,1,function(S,_){if(d=f(_,_),S.length===0){c=null;return}S.length===1?c=me(S[0],d):c=me({type:"Alternative",expressions:S},d)}],[6,0,function(){d=null,c=[]}],[6,2,function(S,_,U,j){d=f(U,j),c=S.concat(_)}],[7,1,function(S,_){d=f(_,_),c=me(Object.assign({type:"Assertion"},S),d)}],[7,2,function(S,_,U,j){d=f(U,j),c=S,_&&(c=me({type:"Repetition",expression:S,quantifier:_},d))}],[8,1,function(S,_){d=f(_,_),c={kind:"^"}}],[8,1,function(S,_){d=f(_,_),c={kind:"$"}}],[8,1,function(S,_){d=f(_,_),c={kind:"\\b"}}],[8,1,function(S,_){d=f(_,_),c={kind:"\\B"}}],[8,3,function(S,_,U,j,N,F){d=f(j,F),c={kind:"Lookahead",assertion:_}}],[8,3,function(S,_,U,j,N,F){d=f(j,F),c={kind:"Lookahead",negative:!0,assertion:_}}],[8,3,function(S,_,U,j,N,F){d=f(j,F),c={kind:"Lookbehind",assertion:_}}],[8,3,function(S,_,U,j,N,F){d=f(j,F),c={kind:"Lookbehind",negative:!0,assertion:_}}],[9,1,function(S,_){d=f(_,_),c=S}],[9,1,function(S,_){d=f(_,_),c=S}],[9,1,function(S,_){d=f(_,_),c=S}],[10,1,function(S,_){d=f(_,_),c=oe(S,"simple",d)}],[10,1,function(S,_){d=f(_,_),c=oe(S.slice(1),"simple",d),c.escaped=!0}],[10,1,function(S,_){d=f(_,_),c=oe(S,"unicode",d),c.isSurrogatePair=!0}],[10,1,function(S,_){d=f(_,_),c=oe(S,"unicode",d)}],[10,1,function(S,_){d=f(_,_),c=Y(S,d)}],[10,1,function(S,_){d=f(_,_),c=oe(S,"control",d)}],[10,1,function(S,_){d=f(_,_),c=oe(S,"hex",d)}],[10,1,function(S,_){d=f(_,_),c=oe(S,"oct",d)}],[10,1,function(S,_){d=f(_,_),c=Pe(S,d)}],[10,1,function(S,_){d=f(_,_),c=oe(S,"meta",d)}],[10,1,function(S,_){d=f(_,_),c=oe(S,"meta",d)}],[10,1,function(S,_){d=f(_,_),c=Ot(S,_)}],[11,1,function(S,_){d=f(_,_),c=S}],[11,0],[12,1,function(S,_){d=f(_,_),c=S}],[12,2,function(S,_,U,j){d=f(U,j),S.greedy=!1,c=S}],[13,1,function(S,_){d=f(_,_),c=me({type:"Quantifier",kind:S,greedy:!0},d)}],[13,1,function(S,_){d=f(_,_),c=me({type:"Quantifier",kind:S,greedy:!0},d)}],[13,1,function(S,_){d=f(_,_),c=me({type:"Quantifier",kind:S,greedy:!0},d)}],[13,1,function(S,_){d=f(_,_);var U=P(S);c=me({type:"Quantifier",kind:"Range",from:U[0],to:U[0],greedy:!0},d)}],[13,1,function(S,_){d=f(_,_),c=me({type:"Quantifier",kind:"Range",from:P(S)[0],greedy:!0},d)}],[13,1,function(S,_){d=f(_,_);var U=P(S);c=me({type:"Quantifier",kind:"Range",from:U[0],to:U[1],greedy:!0},d)}],[14,1,function(S,_){d=f(_,_),c=S}],[14,1,function(S,_){d=f(_,_),c=S}],[15,3,function(S,_,U,j,N,F){d=f(j,F);var re=String(S),Q=Ze(re);if(!s.options.allowGroupNameDuplicates&&O.hasOwnProperty(Q))throw new SyntaxError('Duplicate of the named group "'+Q+'".');O[Q]=S.groupNumber,c=me({type:"Group",capturing:!0,name:Q,nameRaw:re,number:S.groupNumber,expression:_},d)}],[15,3,function(S,_,U,j,N,F){d=f(j,F),c=me({type:"Group",capturing:!0,number:S.groupNumber,expression:_},d)}],[16,3,function(S,_,U,j,N,F){d=f(j,F),c=me({type:"Group",capturing:!1,expression:_},d)}],[17,3,function(S,_,U,j,N,F){d=f(j,F),c=me({type:"CharacterClass",negative:!0,expressions:_},d)}],[17,3,function(S,_,U,j,N,F){d=f(j,F),c=me({type:"CharacterClass",expressions:_},d)}],[18,0,function(){d=null,c=[]}],[18,1,function(S,_){d=f(_,_),c=S}],[19,1,function(S,_){d=f(_,_),c=[S]}],[19,2,function(S,_,U,j){d=f(U,j),c=[S].concat(_)}],[19,4,function(S,_,U,j,N,F,re,Q){d=f(N,Q),L(S,U),c=[me({type:"ClassRange",from:S,to:U},ee(N,re))],j&&(c=c.concat(j))}],[20,1,function(S,_){d=f(_,_),c=S}],[20,2,function(S,_,U,j){d=f(U,j),c=[S].concat(_)}],[20,4,function(S,_,U,j,N,F,re,Q){d=f(N,Q),L(S,U),c=[me({type:"ClassRange",from:S,to:U},ee(N,re))],j&&(c=c.concat(j))}],[21,1,function(S,_){d=f(_,_),c=oe(S,"simple",d)}],[21,1,function(S,_){d=f(_,_),c=S}],[22,1,function(S,_){d=f(_,_),c=S}],[22,1,function(S,_){d=f(_,_),c=oe(S,"meta",d)}]],v={SLASH:"23",CHAR:"24",BAR:"25",BOS:"26",EOS:"27",ESC_b:"28",ESC_B:"29",POS_LA_ASSERT:"30",R_PAREN:"31",NEG_LA_ASSERT:"32",POS_LB_ASSERT:"33",NEG_LB_ASSERT:"34",ESC_CHAR:"35",U_CODE_SURROGATE:"36",U_CODE:"37",U_PROP_VALUE_EXP:"38",CTRL_CH:"39",HEX_CODE:"40",OCT_CODE:"41",DEC_CODE:"42",META_CHAR:"43",ANY:"44",NAMED_GROUP_REF:"45",Q_MARK:"46",STAR:"47",PLUS:"48",RANGE_EXACT:"49",RANGE_OPEN:"50",RANGE_CLOSED:"51",NAMED_CAPTURE_GROUP:"52",L_PAREN:"53",NON_CAPTURE_GROUP:"54",NEG_CLASS:"55",R_BRACKET:"56",L_BRACKET:"57",DASH:"58",$:"59"},b=[{0:1,23:"s2"},{59:"acc"},{3:3,4:4,5:5,6:6,23:"r10",24:"r10",25:"r10",26:"r10",27:"r10",28:"r10",29:"r10",30:"r10",32:"r10",33:"r10",34:"r10",35:"r10",36:"r10",37:"r10",38:"r10",39:"r10",40:"r10",41:"r10",42:"r10",43:"r10",44:"r10",45:"r10",52:"r10",53:"r10",54:"r10",55:"r10",57:"r10"},{23:"s7"},{23:"r6",25:"s12"},{23:"r7",25:"r7",31:"r7"},{7:14,8:15,9:16,10:25,14:27,15:42,16:43,17:26,23:"r9",24:"s28",25:"r9",26:"s17",27:"s18",28:"s19",29:"s20",30:"s21",31:"r9",32:"s22",33:"s23",34:"s24",35:"s29",36:"s30",37:"s31",38:"s32",39:"s33",40:"s34",41:"s35",42:"s36",43:"s37",44:"s38",45:"s39",52:"s44",53:"s45",54:"s46",55:"s40",57:"s41"},{1:8,2:9,24:"s10",59:"r3"},{59:"r1"},{24:"s11",59:"r2"},{24:"r4",59:"r4"},{24:"r5",59:"r5"},{5:13,6:6,23:"r10",24:"r10",25:"r10",26:"r10",27:"r10",28:"r10",29:"r10",30:"r10",31:"r10",32:"r10",33:"r10",34:"r10",35:"r10",36:"r10",37:"r10",38:"r10",39:"r10",40:"r10",41:"r10",42:"r10",43:"r10",44:"r10",45:"r10",52:"r10",53:"r10",54:"r10",55:"r10",57:"r10"},{23:"r8",25:"r8",31:"r8"},{23:"r11",24:"r11",25:"r11",26:"r11",27:"r11",28:"r11",29:"r11",30:"r11",31:"r11",32:"r11",33:"r11",34:"r11",35:"r11",36:"r11",37:"r11",38:"r11",39:"r11",40:"r11",41:"r11",42:"r11",43:"r11",44:"r11",45:"r11",52:"r11",53:"r11",54:"r11",55:"r11",57:"r11"},{23:"r12",24:"r12",25:"r12",26:"r12",27:"r12",28:"r12",29:"r12",30:"r12",31:"r12",32:"r12",33:"r12",34:"r12",35:"r12",36:"r12",37:"r12",38:"r12",39:"r12",40:"r12",41:"r12",42:"r12",43:"r12",44:"r12",45:"r12",52:"r12",53:"r12",54:"r12",55:"r12",57:"r12"},{11:47,12:48,13:49,23:"r38",24:"r38",25:"r38",26:"r38",27:"r38",28:"r38",29:"r38",30:"r38",31:"r38",32:"r38",33:"r38",34:"r38",35:"r38",36:"r38",37:"r38",38:"r38",39:"r38",40:"r38",41:"r38",42:"r38",43:"r38",44:"r38",45:"r38",46:"s52",47:"s50",48:"s51",49:"s53",50:"s54",51:"s55",52:"r38",53:"r38",54:"r38",55:"r38",57:"r38"},{23:"r14",24:"r14",25:"r14",26:"r14",27:"r14",28:"r14",29:"r14",30:"r14",31:"r14",32:"r14",33:"r14",34:"r14",35:"r14",36:"r14",37:"r14",38:"r14",39:"r14",40:"r14",41:"r14",42:"r14",43:"r14",44:"r14",45:"r14",52:"r14",53:"r14",54:"r14",55:"r14",57:"r14"},{23:"r15",24:"r15",25:"r15",26:"r15",27:"r15",28:"r15",29:"r15",30:"r15",31:"r15",32:"r15",33:"r15",34:"r15",35:"r15",36:"r15",37:"r15",38:"r15",39:"r15",40:"r15",41:"r15",42:"r15",43:"r15",44:"r15",45:"r15",52:"r15",53:"r15",54:"r15",55:"r15",57:"r15"},{23:"r16",24:"r16",25:"r16",26:"r16",27:"r16",28:"r16",29:"r16",30:"r16",31:"r16",32:"r16",33:"r16",34:"r16",35:"r16",36:"r16",37:"r16",38:"r16",39:"r16",40:"r16",41:"r16",42:"r16",43:"r16",44:"r16",45:"r16",52:"r16",53:"r16",54:"r16",55:"r16",57:"r16"},{23:"r17",24:"r17",25:"r17",26:"r17",27:"r17",28:"r17",29:"r17",30:"r17",31:"r17",32:"r17",33:"r17",34:"r17",35:"r17",36:"r17",37:"r17",38:"r17",39:"r17",40:"r17",41:"r17",42:"r17",43:"r17",44:"r17",45:"r17",52:"r17",53:"r17",54:"r17",55:"r17",57:"r17"},{4:57,5:5,6:6,24:"r10",25:"r10",26:"r10",27:"r10",28:"r10",29:"r10",30:"r10",31:"r10",32:"r10",33:"r10",34:"r10",35:"r10",36:"r10",37:"r10",38:"r10",39:"r10",40:"r10",41:"r10",42:"r10",43:"r10",44:"r10",45:"r10",52:"r10",53:"r10",54:"r10",55:"r10",57:"r10"},{4:59,5:5,6:6,24:"r10",25:"r10",26:"r10",27:"r10",28:"r10",29:"r10",30:"r10",31:"r10",32:"r10",33:"r10",34:"r10",35:"r10",36:"r10",37:"r10",38:"r10",39:"r10",40:"r10",41:"r10",42:"r10",43:"r10",44:"r10",45:"r10",52:"r10",53:"r10",54:"r10",55:"r10",57:"r10"},{4:61,5:5,6:6,24:"r10",25:"r10",26:"r10",27:"r10",28:"r10",29:"r10",30:"r10",31:"r10",32:"r10",33:"r10",34:"r10",35:"r10",36:"r10",37:"r10",38:"r10",39:"r10",40:"r10",41:"r10",42:"r10",43:"r10",44:"r10",45:"r10",52:"r10",53:"r10",54:"r10",55:"r10",57:"r10"},{4:63,5:5,6:6,24:"r10",25:"r10",26:"r10",27:"r10",28:"r10",29:"r10",30:"r10",31:"r10",32:"r10",33:"r10",34:"r10",35:"r10",36:"r10",37:"r10",38:"r10",39:"r10",40:"r10",41:"r10",42:"r10",43:"r10",44:"r10",45:"r10",52:"r10",53:"r10",54:"r10",55:"r10",57:"r10"},{23:"r22",24:"r22",25:"r22",26:"r22",27:"r22",28:"r22",29:"r22",30:"r22",31:"r22",32:"r22",33:"r22",34:"r22",35:"r22",36:"r22",37:"r22",38:"r22",39:"r22",40:"r22",41:"r22",42:"r22",43:"r22",44:"r22",45:"r22",46:"r22",47:"r22",48:"r22",49:"r22",50:"r22",51:"r22",52:"r22",53:"r22",54:"r22",55:"r22",57:"r22"},{23:"r23",24:"r23",25:"r23",26:"r23",27:"r23",28:"r23",29:"r23",30:"r23",31:"r23",32:"r23",33:"r23",34:"r23",35:"r23",36:"r23",37:"r23",38:"r23",39:"r23",40:"r23",41:"r23",42:"r23",43:"r23",44:"r23",45:"r23",46:"r23",47:"r23",48:"r23",49:"r23",50:"r23",51:"r23",52:"r23",53:"r23",54:"r23",55:"r23",57:"r23"},{23:"r24",24:"r24",25:"r24",26:"r24",27:"r24",28:"r24",29:"r24",30:"r24",31:"r24",32:"r24",33:"r24",34:"r24",35:"r24",36:"r24",37:"r24",38:"r24",39:"r24",40:"r24",41:"r24",42:"r24",43:"r24",44:"r24",45:"r24",46:"r24",47:"r24",48:"r24",49:"r24",50:"r24",51:"r24",52:"r24",53:"r24",54:"r24",55:"r24",57:"r24"},{23:"r25",24:"r25",25:"r25",26:"r25",27:"r25",28:"r25",29:"r25",30:"r25",31:"r25",32:"r25",33:"r25",34:"r25",35:"r25",36:"r25",37:"r25",38:"r25",39:"r25",40:"r25",41:"r25",42:"r25",43:"r25",44:"r25",45:"r25",46:"r25",47:"r25",48:"r25",49:"r25",50:"r25",51:"r25",52:"r25",53:"r25",54:"r25",55:"r25",56:"r25",57:"r25",58:"r25"},{23:"r26",24:"r26",25:"r26",26:"r26",27:"r26",28:"r26",29:"r26",30:"r26",31:"r26",32:"r26",33:"r26",34:"r26",35:"r26",36:"r26",37:"r26",38:"r26",39:"r26",40:"r26",41:"r26",42:"r26",43:"r26",44:"r26",45:"r26",46:"r26",47:"r26",48:"r26",49:"r26",50:"r26",51:"r26",52:"r26",53:"r26",54:"r26",55:"r26",56:"r26",57:"r26",58:"r26"},{23:"r27",24:"r27",25:"r27",26:"r27",27:"r27",28:"r27",29:"r27",30:"r27",31:"r27",32:"r27",33:"r27",34:"r27",35:"r27",36:"r27",37:"r27",38:"r27",39:"r27",40:"r27",41:"r27",42:"r27",43:"r27",44:"r27",45:"r27",46:"r27",47:"r27",48:"r27",49:"r27",50:"r27",51:"r27",52:"r27",53:"r27",54:"r27",55:"r27",56:"r27",57:"r27",58:"r27"},{23:"r28",24:"r28",25:"r28",26:"r28",27:"r28",28:"r28",29:"r28",30:"r28",31:"r28",32:"r28",33:"r28",34:"r28",35:"r28",36:"r28",37:"r28",38:"r28",39:"r28",40:"r28",41:"r28",42:"r28",43:"r28",44:"r28",45:"r28",46:"r28",47:"r28",48:"r28",49:"r28",50:"r28",51:"r28",52:"r28",53:"r28",54:"r28",55:"r28",56:"r28",57:"r28",58:"r28"},{23:"r29",24:"r29",25:"r29",26:"r29",27:"r29",28:"r29",29:"r29",30:"r29",31:"r29",32:"r29",33:"r29",34:"r29",35:"r29",36:"r29",37:"r29",38:"r29",39:"r29",40:"r29",41:"r29",42:"r29",43:"r29",44:"r29",45:"r29",46:"r29",47:"r29",48:"r29",49:"r29",50:"r29",51:"r29",52:"r29",53:"r29",54:"r29",55:"r29",56:"r29",57:"r29",58:"r29"},{23:"r30",24:"r30",25:"r30",26:"r30",27:"r30",28:"r30",29:"r30",30:"r30",31:"r30",32:"r30",33:"r30",34:"r30",35:"r30",36:"r30",37:"r30",38:"r30",39:"r30",40:"r30",41:"r30",42:"r30",43:"r30",44:"r30",45:"r30",46:"r30",47:"r30",48:"r30",49:"r30",50:"r30",51:"r30",52:"r30",53:"r30",54:"r30",55:"r30",56:"r30",57:"r30",58:"r30"},{23:"r31",24:"r31",25:"r31",26:"r31",27:"r31",28:"r31",29:"r31",30:"r31",31:"r31",32:"r31",33:"r31",34:"r31",35:"r31",36:"r31",37:"r31",38:"r31",39:"r31",40:"r31",41:"r31",42:"r31",43:"r31",44:"r31",45:"r31",46:"r31",47:"r31",48:"r31",49:"r31",50:"r31",51:"r31",52:"r31",53:"r31",54:"r31",55:"r31",56:"r31",57:"r31",58:"r31"},{23:"r32",24:"r32",25:"r32",26:"r32",27:"r32",28:"r32",29:"r32",30:"r32",31:"r32",32:"r32",33:"r32",34:"r32",35:"r32",36:"r32",37:"r32",38:"r32",39:"r32",40:"r32",41:"r32",42:"r32",43:"r32",44:"r32",45:"r32",46:"r32",47:"r32",48:"r32",49:"r32",50:"r32",51:"r32",52:"r32",53:"r32",54:"r32",55:"r32",56:"r32",57:"r32",58:"r32"},{23:"r33",24:"r33",25:"r33",26:"r33",27:"r33",28:"r33",29:"r33",30:"r33",31:"r33",32:"r33",33:"r33",34:"r33",35:"r33",36:"r33",37:"r33",38:"r33",39:"r33",40:"r33",41:"r33",42:"r33",43:"r33",44:"r33",45:"r33",46:"r33",47:"r33",48:"r33",49:"r33",50:"r33",51:"r33",52:"r33",53:"r33",54:"r33",55:"r33",56:"r33",57:"r33",58:"r33"},{23:"r34",24:"r34",25:"r34",26:"r34",27:"r34",28:"r34",29:"r34",30:"r34",31:"r34",32:"r34",33:"r34",34:"r34",35:"r34",36:"r34",37:"r34",38:"r34",39:"r34",40:"r34",41:"r34",42:"r34",43:"r34",44:"r34",45:"r34",46:"r34",47:"r34",48:"r34",49:"r34",50:"r34",51:"r34",52:"r34",53:"r34",54:"r34",55:"r34",56:"r34",57:"r34",58:"r34"},{23:"r35",24:"r35",25:"r35",26:"r35",27:"r35",28:"r35",29:"r35",30:"r35",31:"r35",32:"r35",33:"r35",34:"r35",35:"r35",36:"r35",37:"r35",38:"r35",39:"r35",40:"r35",41:"r35",42:"r35",43:"r35",44:"r35",45:"r35",46:"r35",47:"r35",48:"r35",49:"r35",50:"r35",51:"r35",52:"r35",53:"r35",54:"r35",55:"r35",56:"r35",57:"r35",58:"r35"},{23:"r36",24:"r36",25:"r36",26:"r36",27:"r36",28:"r36",29:"r36",30:"r36",31:"r36",32:"r36",33:"r36",34:"r36",35:"r36",36:"r36",37:"r36",38:"r36",39:"r36",40:"r36",41:"r36",42:"r36",43:"r36",44:"r36",45:"r36",46:"r36",47:"r36",48:"r36",49:"r36",50:"r36",51:"r36",52:"r36",53:"r36",54:"r36",55:"r36",56:"r36",57:"r36",58:"r36"},{10:70,18:65,19:66,21:67,22:69,24:"s28",28:"s71",35:"s29",36:"s30",37:"s31",38:"s32",39:"s33",40:"s34",41:"s35",42:"s36",43:"s37",44:"s38",45:"s39",56:"r54",58:"s68"},{10:70,18:83,19:66,21:67,22:69,24:"s28",28:"s71",35:"s29",36:"s30",37:"s31",38:"s32",39:"s33",40:"s34",41:"s35",42:"s36",43:"s37",44:"s38",45:"s39",56:"r54",58:"s68"},{23:"r47",24:"r47",25:"r47",26:"r47",27:"r47",28:"r47",29:"r47",30:"r47",31:"r47",32:"r47",33:"r47",34:"r47",35:"r47",36:"r47",37:"r47",38:"r47",39:"r47",40:"r47",41:"r47",42:"r47",43:"r47",44:"r47",45:"r47",46:"r47",47:"r47",48:"r47",49:"r47",50:"r47",51:"r47",52:"r47",53:"r47",54:"r47",55:"r47",57:"r47"},{23:"r48",24:"r48",25:"r48",26:"r48",27:"r48",28:"r48",29:"r48",30:"r48",31:"r48",32:"r48",33:"r48",34:"r48",35:"r48",36:"r48",37:"r48",38:"r48",39:"r48",40:"r48",41:"r48",42:"r48",43:"r48",44:"r48",45:"r48",46:"r48",47:"r48",48:"r48",49:"r48",50:"r48",51:"r48",52:"r48",53:"r48",54:"r48",55:"r48",57:"r48"},{4:85,5:5,6:6,24:"r10",25:"r10",26:"r10",27:"r10",28:"r10",29:"r10",30:"r10",31:"r10",32:"r10",33:"r10",34:"r10",35:"r10",36:"r10",37:"r10",38:"r10",39:"r10",40:"r10",41:"r10",42:"r10",43:"r10",44:"r10",45:"r10",52:"r10",53:"r10",54:"r10",55:"r10",57:"r10"},{4:87,5:5,6:6,24:"r10",25:"r10",26:"r10",27:"r10",28:"r10",29:"r10",30:"r10",31:"r10",32:"r10",33:"r10",34:"r10",35:"r10",36:"r10",37:"r10",38:"r10",39:"r10",40:"r10",41:"r10",42:"r10",43:"r10",44:"r10",45:"r10",52:"r10",53:"r10",54:"r10",55:"r10",57:"r10"},{4:89,5:5,6:6,24:"r10",25:"r10",26:"r10",27:"r10",28:"r10",29:"r10",30:"r10",31:"r10",32:"r10",33:"r10",34:"r10",35:"r10",36:"r10",37:"r10",38:"r10",39:"r10",40:"r10",41:"r10",42:"r10",43:"r10",44:"r10",45:"r10",52:"r10",53:"r10",54:"r10",55:"r10",57:"r10"},{23:"r13",24:"r13",25:"r13",26:"r13",27:"r13",28:"r13",29:"r13",30:"r13",31:"r13",32:"r13",33:"r13",34:"r13",35:"r13",36:"r13",37:"r13",38:"r13",39:"r13",40:"r13",41:"r13",42:"r13",43:"r13",44:"r13",45:"r13",52:"r13",53:"r13",54:"r13",55:"r13",57:"r13"},{23:"r37",24:"r37",25:"r37",26:"r37",27:"r37",28:"r37",29:"r37",30:"r37",31:"r37",32:"r37",33:"r37",34:"r37",35:"r37",36:"r37",37:"r37",38:"r37",39:"r37",40:"r37",41:"r37",42:"r37",43:"r37",44:"r37",45:"r37",52:"r37",53:"r37",54:"r37",55:"r37",57:"r37"},{23:"r39",24:"r39",25:"r39",26:"r39",27:"r39",28:"r39",29:"r39",30:"r39",31:"r39",32:"r39",33:"r39",34:"r39",35:"r39",36:"r39",37:"r39",38:"r39",39:"r39",40:"r39",41:"r39",42:"r39",43:"r39",44:"r39",45:"r39",46:"s56",52:"r39",53:"r39",54:"r39",55:"r39",57:"r39"},{23:"r41",24:"r41",25:"r41",26:"r41",27:"r41",28:"r41",29:"r41",30:"r41",31:"r41",32:"r41",33:"r41",34:"r41",35:"r41",36:"r41",37:"r41",38:"r41",39:"r41",40:"r41",41:"r41",42:"r41",43:"r41",44:"r41",45:"r41",46:"r41",52:"r41",53:"r41",54:"r41",55:"r41",57:"r41"},{23:"r42",24:"r42",25:"r42",26:"r42",27:"r42",28:"r42",29:"r42",30:"r42",31:"r42",32:"r42",33:"r42",34:"r42",35:"r42",36:"r42",37:"r42",38:"r42",39:"r42",40:"r42",41:"r42",42:"r42",43:"r42",44:"r42",45:"r42",46:"r42",52:"r42",53:"r42",54:"r42",55:"r42",57:"r42"},{23:"r43",24:"r43",25:"r43",26:"r43",27:"r43",28:"r43",29:"r43",30:"r43",31:"r43",32:"r43",33:"r43",34:"r43",35:"r43",36:"r43",37:"r43",38:"r43",39:"r43",40:"r43",41:"r43",42:"r43",43:"r43",44:"r43",45:"r43",46:"r43",52:"r43",53:"r43",54:"r43",55:"r43",57:"r43"},{23:"r44",24:"r44",25:"r44",26:"r44",27:"r44",28:"r44",29:"r44",30:"r44",31:"r44",32:"r44",33:"r44",34:"r44",35:"r44",36:"r44",37:"r44",38:"r44",39:"r44",40:"r44",41:"r44",42:"r44",43:"r44",44:"r44",45:"r44",46:"r44",52:"r44",53:"r44",54:"r44",55:"r44",57:"r44"},{23:"r45",24:"r45",25:"r45",26:"r45",27:"r45",28:"r45",29:"r45",30:"r45",31:"r45",32:"r45",33:"r45",34:"r45",35:"r45",36:"r45",37:"r45",38:"r45",39:"r45",40:"r45",41:"r45",42:"r45",43:"r45",44:"r45",45:"r45",46:"r45",52:"r45",53:"r45",54:"r45",55:"r45",57:"r45"},{23:"r46",24:"r46",25:"r46",26:"r46",27:"r46",28:"r46",29:"r46",30:"r46",31:"r46",32:"r46",33:"r46",34:"r46",35:"r46",36:"r46",37:"r46",38:"r46",39:"r46",40:"r46",41:"r46",42:"r46",43:"r46",44:"r46",45:"r46",46:"r46",52:"r46",53:"r46",54:"r46",55:"r46",57:"r46"},{23:"r40",24:"r40",25:"r40",26:"r40",27:"r40",28:"r40",29:"r40",30:"r40",31:"r40",32:"r40",33:"r40",34:"r40",35:"r40",36:"r40",37:"r40",38:"r40",39:"r40",40:"r40",41:"r40",42:"r40",43:"r40",44:"r40",45:"r40",52:"r40",53:"r40",54:"r40",55:"r40",57:"r40"},{25:"s12",31:"s58"},{23:"r18",24:"r18",25:"r18",26:"r18",27:"r18",28:"r18",29:"r18",30:"r18",31:"r18",32:"r18",33:"r18",34:"r18",35:"r18",36:"r18",37:"r18",38:"r18",39:"r18",40:"r18",41:"r18",42:"r18",43:"r18",44:"r18",45:"r18",52:"r18",53:"r18",54:"r18",55:"r18",57:"r18"},{25:"s12",31:"s60"},{23:"r19",24:"r19",25:"r19",26:"r19",27:"r19",28:"r19",29:"r19",30:"r19",31:"r19",32:"r19",33:"r19",34:"r19",35:"r19",36:"r19",37:"r19",38:"r19",39:"r19",40:"r19",41:"r19",42:"r19",43:"r19",44:"r19",45:"r19",52:"r19",53:"r19",54:"r19",55:"r19",57:"r19"},{25:"s12",31:"s62"},{23:"r20",24:"r20",25:"r20",26:"r20",27:"r20",28:"r20",29:"r20",30:"r20",31:"r20",32:"r20",33:"r20",34:"r20",35:"r20",36:"r20",37:"r20",38:"r20",39:"r20",40:"r20",41:"r20",42:"r20",43:"r20",44:"r20",45:"r20",52:"r20",53:"r20",54:"r20",55:"r20",57:"r20"},{25:"s12",31:"s64"},{23:"r21",24:"r21",25:"r21",26:"r21",27:"r21",28:"r21",29:"r21",30:"r21",31:"r21",32:"r21",33:"r21",34:"r21",35:"r21",36:"r21",37:"r21",38:"r21",39:"r21",40:"r21",41:"r21",42:"r21",43:"r21",44:"r21",45:"r21",52:"r21",53:"r21",54:"r21",55:"r21",57:"r21"},{56:"s72"},{56:"r55"},{10:70,20:73,21:75,22:76,24:"s28",28:"s71",35:"s29",36:"s30",37:"s31",38:"s32",39:"s33",40:"s34",41:"s35",42:"s36",43:"s37",44:"s38",45:"s39",56:"r56",58:"s74"},{24:"r62",28:"r62",35:"r62",36:"r62",37:"r62",38:"r62",39:"r62",40:"r62",41:"r62",42:"r62",43:"r62",44:"r62",45:"r62",56:"r62",58:"r62"},{24:"r63",28:"r63",35:"r63",36:"r63",37:"r63",38:"r63",39:"r63",40:"r63",41:"r63",42:"r63",43:"r63",44:"r63",45:"r63",56:"r63",58:"r63"},{24:"r64",28:"r64",35:"r64",36:"r64",37:"r64",38:"r64",39:"r64",40:"r64",41:"r64",42:"r64",43:"r64",44:"r64",45:"r64",56:"r64",58:"r64"},{24:"r65",28:"r65",35:"r65",36:"r65",37:"r65",38:"r65",39:"r65",40:"r65",41:"r65",42:"r65",43:"r65",44:"r65",45:"r65",56:"r65",58:"r65"},{23:"r52",24:"r52",25:"r52",26:"r52",27:"r52",28:"r52",29:"r52",30:"r52",31:"r52",32:"r52",33:"r52",34:"r52",35:"r52",36:"r52",37:"r52",38:"r52",39:"r52",40:"r52",41:"r52",42:"r52",43:"r52",44:"r52",45:"r52",46:"r52",47:"r52",48:"r52",49:"r52",50:"r52",51:"r52",52:"r52",53:"r52",54:"r52",55:"r52",57:"r52"},{56:"r57"},{10:70,21:77,22:69,24:"s28",28:"s71",35:"s29",36:"s30",37:"s31",38:"s32",39:"s33",40:"s34",41:"s35",42:"s36",43:"s37",44:"s38",45:"s39",56:"r62",58:"s68"},{56:"r59"},{10:70,20:79,21:75,22:76,24:"s28",28:"s71",35:"s29",36:"s30",37:"s31",38:"s32",39:"s33",40:"s34",41:"s35",42:"s36",43:"s37",44:"s38",45:"s39",56:"r63",58:"s80"},{10:70,18:78,19:66,21:67,22:69,24:"s28",28:"s71",35:"s29",36:"s30",37:"s31",38:"s32",39:"s33",40:"s34",41:"s35",42:"s36",43:"s37",44:"s38",45:"s39",56:"r54",58:"s68"},{56:"r58"},{56:"r60"},{10:70,21:81,22:69,24:"s28",28:"s71",35:"s29",36:"s30",37:"s31",38:"s32",39:"s33",40:"s34",41:"s35",42:"s36",43:"s37",44:"s38",45:"s39",56:"r62",58:"s68"},{10:70,18:82,19:66,21:67,22:69,24:"s28",28:"s71",35:"s29",36:"s30",37:"s31",38:"s32",39:"s33",40:"s34",41:"s35",42:"s36",43:"s37",44:"s38",45:"s39",56:"r54",58:"s68"},{56:"r61"},{56:"s84"},{23:"r53",24:"r53",25:"r53",26:"r53",27:"r53",28:"r53",29:"r53",30:"r53",31:"r53",32:"r53",33:"r53",34:"r53",35:"r53",36:"r53",37:"r53",38:"r53",39:"r53",40:"r53",41:"r53",42:"r53",43:"r53",44:"r53",45:"r53",46:"r53",47:"r53",48:"r53",49:"r53",50:"r53",51:"r53",52:"r53",53:"r53",54:"r53",55:"r53",57:"r53"},{25:"s12",31:"s86"},{23:"r49",24:"r49",25:"r49",26:"r49",27:"r49",28:"r49",29:"r49",30:"r49",31:"r49",32:"r49",33:"r49",34:"r49",35:"r49",36:"r49",37:"r49",38:"r49",39:"r49",40:"r49",41:"r49",42:"r49",43:"r49",44:"r49",45:"r49",46:"r49",47:"r49",48:"r49",49:"r49",50:"r49",51:"r49",52:"r49",53:"r49",54:"r49",55:"r49",57:"r49"},{25:"s12",31:"s88"},{23:"r50",24:"r50",25:"r50",26:"r50",27:"r50",28:"r50",29:"r50",30:"r50",31:"r50",32:"r50",33:"r50",34:"r50",35:"r50",36:"r50",37:"r50",38:"r50",39:"r50",40:"r50",41:"r50",42:"r50",43:"r50",44:"r50",45:"r50",46:"r50",47:"r50",48:"r50",49:"r50",50:"r50",51:"r50",52:"r50",53:"r50",54:"r50",55:"r50",57:"r50"},{25:"s12",31:"s90"},{23:"r51",24:"r51",25:"r51",26:"r51",27:"r51",28:"r51",29:"r51",30:"r51",31:"r51",32:"r51",33:"r51",34:"r51",35:"r51",36:"r51",37:"r51",38:"r51",39:"r51",40:"r51",41:"r51",42:"r51",43:"r51",44:"r51",45:"r51",46:"r51",47:"r51",48:"r51",49:"r51",50:"r51",51:"r51",52:"r51",53:"r51",54:"r51",55:"r51",57:"r51"}],g=[],A=void 0,w=[[/^#[^\n]+/,function(){}],[/^\s+/,function(){}],[/^-/,function(){return"DASH"}],[/^\//,function(){return"CHAR"}],[/^#/,function(){return"CHAR"}],[/^\|/,function(){return"CHAR"}],[/^\./,function(){return"CHAR"}],[/^\{/,function(){return"CHAR"}],[/^\{\d+\}/,function(){return"RANGE_EXACT"}],[/^\{\d+,\}/,function(){return"RANGE_OPEN"}],[/^\{\d+,\d+\}/,function(){return"RANGE_CLOSED"}],[/^\\k<(([\u0041-\u005a\u0061-\u007a\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376-\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4-\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09f0-\u09f1\u09fc\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0af9\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60-\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0cf1-\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e46\u0e81-\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5-\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a-\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd-\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5-\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]|\ud800[\udc00-\udc0b\udc0d-\udc26\udc28-\udc3a\udc3c-\udc3d\udc3f-\udc4d\udc50-\udc5d\udc80-\udcfa\udd40-\udd74\ude80-\ude9c\udea0-\uded0\udf00-\udf1f\udf2d-\udf4a\udf50-\udf75\udf80-\udf9d\udfa0-\udfc3\udfc8-\udfcf\udfd1-\udfd5]|\ud801[\udc00-\udc9d\udcb0-\udcd3\udcd8-\udcfb\udd00-\udd27\udd30-\udd63\ude00-\udf36\udf40-\udf55\udf60-\udf67]|\ud802[\udc00-\udc05\udc08\udc0a-\udc35\udc37-\udc38\udc3c\udc3f-\udc55\udc60-\udc76\udc80-\udc9e\udce0-\udcf2\udcf4-\udcf5\udd00-\udd15\udd20-\udd39\udd80-\uddb7\uddbe-\uddbf\ude00\ude10-\ude13\ude15-\ude17\ude19-\ude35\ude60-\ude7c\ude80-\ude9c\udec0-\udec7\udec9-\udee4\udf00-\udf35\udf40-\udf55\udf60-\udf72\udf80-\udf91]|\ud803[\udc00-\udc48\udc80-\udcb2\udcc0-\udcf2\udd00-\udd23\udf00-\udf1c\udf27\udf30-\udf45\udfe0-\udff6]|\ud804[\udc03-\udc37\udc83-\udcaf\udcd0-\udce8\udd03-\udd26\udd44\udd50-\udd72\udd76\udd83-\uddb2\uddc1-\uddc4\uddda\udddc\ude00-\ude11\ude13-\ude2b\ude80-\ude86\ude88\ude8a-\ude8d\ude8f-\ude9d\ude9f-\udea8\udeb0-\udede\udf05-\udf0c\udf0f-\udf10\udf13-\udf28\udf2a-\udf30\udf32-\udf33\udf35-\udf39\udf3d\udf50\udf5d-\udf61]|\ud805[\udc00-\udc34\udc47-\udc4a\udc5f\udc80-\udcaf\udcc4-\udcc5\udcc7\udd80-\uddae\uddd8-\udddb\ude00-\ude2f\ude44\ude80-\udeaa\udeb8\udf00-\udf1a]|\ud806[\udc00-\udc2b\udca0-\udcdf\udcff\udda0-\udda7\uddaa-\uddd0\udde1\udde3\ude00\ude0b-\ude32\ude3a\ude50\ude5c-\ude89\ude9d\udec0-\udef8]|\ud807[\udc00-\udc08\udc0a-\udc2e\udc40\udc72-\udc8f\udd00-\udd06\udd08-\udd09\udd0b-\udd30\udd46\udd60-\udd65\udd67-\udd68\udd6a-\udd89\udd98\udee0-\udef2]|\ud808[\udc00-\udf99]|\ud809[\udc00-\udc6e\udc80-\udd43]|\ud80c[\udc00-\udfff]|\ud80d[\udc00-\udc2e]|\ud811[\udc00-\ude46]|\ud81a[\udc00-\ude38\ude40-\ude5e\uded0-\udeed\udf00-\udf2f\udf40-\udf43\udf63-\udf77\udf7d-\udf8f]|\ud81b[\ude40-\ude7f\udf00-\udf4a\udf50\udf93-\udf9f\udfe0-\udfe1\udfe3]|\ud81c[\udc00-\udfff]|\ud81d[\udc00-\udfff]|\ud81e[\udc00-\udfff]|\ud81f[\udc00-\udfff]|\ud820[\udc00-\udfff]|\ud821[\udc00-\udff7]|\ud822[\udc00-\udef2]|\ud82c[\udc00-\udd1e\udd50-\udd52\udd64-\udd67\udd70-\udefb]|\ud82f[\udc00-\udc6a\udc70-\udc7c\udc80-\udc88\udc90-\udc99]|\ud835[\udc00-\udc54\udc56-\udc9c\udc9e-\udc9f\udca2\udca5-\udca6\udca9-\udcac\udcae-\udcb9\udcbb\udcbd-\udcc3\udcc5-\udd05\udd07-\udd0a\udd0d-\udd14\udd16-\udd1c\udd1e-\udd39\udd3b-\udd3e\udd40-\udd44\udd46\udd4a-\udd50\udd52-\udea5\udea8-\udec0\udec2-\udeda\udedc-\udefa\udefc-\udf14\udf16-\udf34\udf36-\udf4e\udf50-\udf6e\udf70-\udf88\udf8a-\udfa8\udfaa-\udfc2\udfc4-\udfcb]|\ud838[\udd00-\udd2c\udd37-\udd3d\udd4e\udec0-\udeeb]|\ud83a[\udc00-\udcc4\udd00-\udd43\udd4b]|\ud83b[\ude00-\ude03\ude05-\ude1f\ude21-\ude22\ude24\ude27\ude29-\ude32\ude34-\ude37\ude39\ude3b\ude42\ude47\ude49\ude4b\ude4d-\ude4f\ude51-\ude52\ude54\ude57\ude59\ude5b\ude5d\ude5f\ude61-\ude62\ude64\ude67-\ude6a\ude6c-\ude72\ude74-\ude77\ude79-\ude7c\ude7e\ude80-\ude89\ude8b-\ude9b\udea1-\udea3\udea5-\udea9\udeab-\udebb]|\ud840[\udc00-\udfff]|\ud841[\udc00-\udfff]|\ud842[\udc00-\udfff]|\ud843[\udc00-\udfff]|\ud844[\udc00-\udfff]|\ud845[\udc00-\udfff]|\ud846[\udc00-\udfff]|\ud847[\udc00-\udfff]|\ud848[\udc00-\udfff]|\ud849[\udc00-\udfff]|\ud84a[\udc00-\udfff]|\ud84b[\udc00-\udfff]|\ud84c[\udc00-\udfff]|\ud84d[\udc00-\udfff]|\ud84e[\udc00-\udfff]|\ud84f[\udc00-\udfff]|\ud850[\udc00-\udfff]|\ud851[\udc00-\udfff]|\ud852[\udc00-\udfff]|\ud853[\udc00-\udfff]|\ud854[\udc00-\udfff]|\ud855[\udc00-\udfff]|\ud856[\udc00-\udfff]|\ud857[\udc00-\udfff]|\ud858[\udc00-\udfff]|\ud859[\udc00-\udfff]|\ud85a[\udc00-\udfff]|\ud85b[\udc00-\udfff]|\ud85c[\udc00-\udfff]|\ud85d[\udc00-\udfff]|\ud85e[\udc00-\udfff]|\ud85f[\udc00-\udfff]|\ud860[\udc00-\udfff]|\ud861[\udc00-\udfff]|\ud862[\udc00-\udfff]|\ud863[\udc00-\udfff]|\ud864[\udc00-\udfff]|\ud865[\udc00-\udfff]|\ud866[\udc00-\udfff]|\ud867[\udc00-\udfff]|\ud868[\udc00-\udfff]|\ud869[\udc00-\uded6\udf00-\udfff]|\ud86a[\udc00-\udfff]|\ud86b[\udc00-\udfff]|\ud86c[\udc00-\udfff]|\ud86d[\udc00-\udf34\udf40-\udfff]|\ud86e[\udc00-\udc1d\udc20-\udfff]|\ud86f[\udc00-\udfff]|\ud870[\udc00-\udfff]|\ud871[\udc00-\udfff]|\ud872[\udc00-\udfff]|\ud873[\udc00-\udea1\udeb0-\udfff]|\ud874[\udc00-\udfff]|\ud875[\udc00-\udfff]|\ud876[\udc00-\udfff]|\ud877[\udc00-\udfff]|\ud878[\udc00-\udfff]|\ud879[\udc00-\udfff]|\ud87a[\udc00-\udfe0]|\ud87e[\udc00-\ude1d])|[$_]|(\\u[0-9a-fA-F]{4}|\\u\{[0-9a-fA-F]{1,}\}))(([\u0030-\u0039\u0041-\u005a\u005f\u0061-\u007a\u00aa\u00b5\u00b7\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376-\u0377\u037a-\u037d\u037f\u0386-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u05d0-\u05ea\u05ef-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u07fd\u0800-\u082d\u0840-\u085b\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u08d3-\u08e1\u08e3-\u0963\u0966-\u096f\u0971-\u0983\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7-\u09c8\u09cb-\u09ce\u09d7\u09dc-\u09dd\u09df-\u09e3\u09e6-\u09f1\u09fc\u09fe\u0a01-\u0a03\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a3c\u0a3e-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0af9-\u0aff\u0b01-\u0b03\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47-\u0b48\u0b4b-\u0b4d\u0b56-\u0b57\u0b5c-\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82-\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c00-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c58-\u0c5a\u0c60-\u0c63\u0c66-\u0c6f\u0c80-\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5-\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1-\u0cf2\u0d00-\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d54-\u0d57\u0d5f-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82-\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2-\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18-\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1369-\u1371\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772-\u1773\u1780-\u17d3\u17d7\u17dc-\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1878\u1880-\u18aa\u18b0-\u18f5\u1900-\u191e\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19da\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1ab0-\u1abd\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1cd0-\u1cd2\u1cd4-\u1cfa\u1d00-\u1df9\u1dfb-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u203f-\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua827\ua840-\ua873\ua880-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua8fd-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\ua9e0-\ua9fe\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabea\uabec-\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe2f\ufe33-\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]|\ud800[\udc00-\udc0b\udc0d-\udc26\udc28-\udc3a\udc3c-\udc3d\udc3f-\udc4d\udc50-\udc5d\udc80-\udcfa\udd40-\udd74\uddfd\ude80-\ude9c\udea0-\uded0\udee0\udf00-\udf1f\udf2d-\udf4a\udf50-\udf7a\udf80-\udf9d\udfa0-\udfc3\udfc8-\udfcf\udfd1-\udfd5]|\ud801[\udc00-\udc9d\udca0-\udca9\udcb0-\udcd3\udcd8-\udcfb\udd00-\udd27\udd30-\udd63\ude00-\udf36\udf40-\udf55\udf60-\udf67]|\ud802[\udc00-\udc05\udc08\udc0a-\udc35\udc37-\udc38\udc3c\udc3f-\udc55\udc60-\udc76\udc80-\udc9e\udce0-\udcf2\udcf4-\udcf5\udd00-\udd15\udd20-\udd39\udd80-\uddb7\uddbe-\uddbf\ude00-\ude03\ude05-\ude06\ude0c-\ude13\ude15-\ude17\ude19-\ude35\ude38-\ude3a\ude3f\ude60-\ude7c\ude80-\ude9c\udec0-\udec7\udec9-\udee6\udf00-\udf35\udf40-\udf55\udf60-\udf72\udf80-\udf91]|\ud803[\udc00-\udc48\udc80-\udcb2\udcc0-\udcf2\udd00-\udd27\udd30-\udd39\udf00-\udf1c\udf27\udf30-\udf50\udfe0-\udff6]|\ud804[\udc00-\udc46\udc66-\udc6f\udc7f-\udcba\udcd0-\udce8\udcf0-\udcf9\udd00-\udd34\udd36-\udd3f\udd44-\udd46\udd50-\udd73\udd76\udd80-\uddc4\uddc9-\uddcc\uddd0-\uddda\udddc\ude00-\ude11\ude13-\ude37\ude3e\ude80-\ude86\ude88\ude8a-\ude8d\ude8f-\ude9d\ude9f-\udea8\udeb0-\udeea\udef0-\udef9\udf00-\udf03\udf05-\udf0c\udf0f-\udf10\udf13-\udf28\udf2a-\udf30\udf32-\udf33\udf35-\udf39\udf3b-\udf44\udf47-\udf48\udf4b-\udf4d\udf50\udf57\udf5d-\udf63\udf66-\udf6c\udf70-\udf74]|\ud805[\udc00-\udc4a\udc50-\udc59\udc5e-\udc5f\udc80-\udcc5\udcc7\udcd0-\udcd9\udd80-\uddb5\uddb8-\uddc0\uddd8-\udddd\ude00-\ude40\ude44\ude50-\ude59\ude80-\udeb8\udec0-\udec9\udf00-\udf1a\udf1d-\udf2b\udf30-\udf39]|\ud806[\udc00-\udc3a\udca0-\udce9\udcff\udda0-\udda7\uddaa-\uddd7\uddda-\udde1\udde3-\udde4\ude00-\ude3e\ude47\ude50-\ude99\ude9d\udec0-\udef8]|\ud807[\udc00-\udc08\udc0a-\udc36\udc38-\udc40\udc50-\udc59\udc72-\udc8f\udc92-\udca7\udca9-\udcb6\udd00-\udd06\udd08-\udd09\udd0b-\udd36\udd3a\udd3c-\udd3d\udd3f-\udd47\udd50-\udd59\udd60-\udd65\udd67-\udd68\udd6a-\udd8e\udd90-\udd91\udd93-\udd98\udda0-\udda9\udee0-\udef6]|\ud808[\udc00-\udf99]|\ud809[\udc00-\udc6e\udc80-\udd43]|\ud80c[\udc00-\udfff]|\ud80d[\udc00-\udc2e]|\ud811[\udc00-\ude46]|\ud81a[\udc00-\ude38\ude40-\ude5e\ude60-\ude69\uded0-\udeed\udef0-\udef4\udf00-\udf36\udf40-\udf43\udf50-\udf59\udf63-\udf77\udf7d-\udf8f]|\ud81b[\ude40-\ude7f\udf00-\udf4a\udf4f-\udf87\udf8f-\udf9f\udfe0-\udfe1\udfe3]|\ud81c[\udc00-\udfff]|\ud81d[\udc00-\udfff]|\ud81e[\udc00-\udfff]|\ud81f[\udc00-\udfff]|\ud820[\udc00-\udfff]|\ud821[\udc00-\udff7]|\ud822[\udc00-\udef2]|\ud82c[\udc00-\udd1e\udd50-\udd52\udd64-\udd67\udd70-\udefb]|\ud82f[\udc00-\udc6a\udc70-\udc7c\udc80-\udc88\udc90-\udc99\udc9d-\udc9e]|\ud834[\udd65-\udd69\udd6d-\udd72\udd7b-\udd82\udd85-\udd8b\uddaa-\uddad\ude42-\ude44]|\ud835[\udc00-\udc54\udc56-\udc9c\udc9e-\udc9f\udca2\udca5-\udca6\udca9-\udcac\udcae-\udcb9\udcbb\udcbd-\udcc3\udcc5-\udd05\udd07-\udd0a\udd0d-\udd14\udd16-\udd1c\udd1e-\udd39\udd3b-\udd3e\udd40-\udd44\udd46\udd4a-\udd50\udd52-\udea5\udea8-\udec0\udec2-\udeda\udedc-\udefa\udefc-\udf14\udf16-\udf34\udf36-\udf4e\udf50-\udf6e\udf70-\udf88\udf8a-\udfa8\udfaa-\udfc2\udfc4-\udfcb\udfce-\udfff]|\ud836[\ude00-\ude36\ude3b-\ude6c\ude75\ude84\ude9b-\ude9f\udea1-\udeaf]|\ud838[\udc00-\udc06\udc08-\udc18\udc1b-\udc21\udc23-\udc24\udc26-\udc2a\udd00-\udd2c\udd30-\udd3d\udd40-\udd49\udd4e\udec0-\udef9]|\ud83a[\udc00-\udcc4\udcd0-\udcd6\udd00-\udd4b\udd50-\udd59]|\ud83b[\ude00-\ude03\ude05-\ude1f\ude21-\ude22\ude24\ude27\ude29-\ude32\ude34-\ude37\ude39\ude3b\ude42\ude47\ude49\ude4b\ude4d-\ude4f\ude51-\ude52\ude54\ude57\ude59\ude5b\ude5d\ude5f\ude61-\ude62\ude64\ude67-\ude6a\ude6c-\ude72\ude74-\ude77\ude79-\ude7c\ude7e\ude80-\ude89\ude8b-\ude9b\udea1-\udea3\udea5-\udea9\udeab-\udebb]|\ud840[\udc00-\udfff]|\ud841[\udc00-\udfff]|\ud842[\udc00-\udfff]|\ud843[\udc00-\udfff]|\ud844[\udc00-\udfff]|\ud845[\udc00-\udfff]|\ud846[\udc00-\udfff]|\ud847[\udc00-\udfff]|\ud848[\udc00-\udfff]|\ud849[\udc00-\udfff]|\ud84a[\udc00-\udfff]|\ud84b[\udc00-\udfff]|\ud84c[\udc00-\udfff]|\ud84d[\udc00-\udfff]|\ud84e[\udc00-\udfff]|\ud84f[\udc00-\udfff]|\ud850[\udc00-\udfff]|\ud851[\udc00-\udfff]|\ud852[\udc00-\udfff]|\ud853[\udc00-\udfff]|\ud854[\udc00-\udfff]|\ud855[\udc00-\udfff]|\ud856[\udc00-\udfff]|\ud857[\udc00-\udfff]|\ud858[\udc00-\udfff]|\ud859[\udc00-\udfff]|\ud85a[\udc00-\udfff]|\ud85b[\udc00-\udfff]|\ud85c[\udc00-\udfff]|\ud85d[\udc00-\udfff]|\ud85e[\udc00-\udfff]|\ud85f[\udc00-\udfff]|\ud860[\udc00-\udfff]|\ud861[\udc00-\udfff]|\ud862[\udc00-\udfff]|\ud863[\udc00-\udfff]|\ud864[\udc00-\udfff]|\ud865[\udc00-\udfff]|\ud866[\udc00-\udfff]|\ud867[\udc00-\udfff]|\ud868[\udc00-\udfff]|\ud869[\udc00-\uded6\udf00-\udfff]|\ud86a[\udc00-\udfff]|\ud86b[\udc00-\udfff]|\ud86c[\udc00-\udfff]|\ud86d[\udc00-\udf34\udf40-\udfff]|\ud86e[\udc00-\udc1d\udc20-\udfff]|\ud86f[\udc00-\udfff]|\ud870[\udc00-\udfff]|\ud871[\udc00-\udfff]|\ud872[\udc00-\udfff]|\ud873[\udc00-\udea1\udeb0-\udfff]|\ud874[\udc00-\udfff]|\ud875[\udc00-\udfff]|\ud876[\udc00-\udfff]|\ud877[\udc00-\udfff]|\ud878[\udc00-\udfff]|\ud879[\udc00-\udfff]|\ud87a[\udc00-\udfe0]|\ud87e[\udc00-\ude1d]|\udb40[\udd00-\uddef])|[$_]|(\\u[0-9a-fA-F]{4}|\\u\{[0-9a-fA-F]{1,}\})|[\u200c\u200d])*>/,function(){var S=i.slice(3,-1);return Ye(S,this.getCurrentState()),"NAMED_GROUP_REF"}],[/^\\b/,function(){return"ESC_b"}],[/^\\B/,function(){return"ESC_B"}],[/^\\c[a-zA-Z]/,function(){return"CTRL_CH"}],[/^\\0\d{1,2}/,function(){return"OCT_CODE"}],[/^\\0/,function(){return"DEC_CODE"}],[/^\\\d{1,3}/,function(){return"DEC_CODE"}],[/^\\u[dD][89abAB][0-9a-fA-F]{2}\\u[dD][c-fC-F][0-9a-fA-F]{2}/,function(){return"U_CODE_SURROGATE"}],[/^\\u\{[0-9a-fA-F]{1,}\}/,function(){return"U_CODE"}],[/^\\u[0-9a-fA-F]{4}/,function(){return"U_CODE"}],[/^\\[pP]\{\w+(?:=\w+)?\}/,function(){return"U_PROP_VALUE_EXP"}],[/^\\x[0-9a-fA-F]{2}/,function(){return"HEX_CODE"}],[/^\\[tnrdDsSwWvf]/,function(){return"META_CHAR"}],[/^\\\//,function(){return"ESC_CHAR"}],[/^\\[ #]/,function(){return"ESC_CHAR"}],[/^\\[\^\$\.\*\+\?\(\)\\\[\]\{\}\|\/]/,function(){return"ESC_CHAR"}],[/^\\[^*?+\[()\\|]/,function(){var S=this.getCurrentState();if(S==="u_class"&&i==="\\-")return"ESC_CHAR";if(S==="u"||S==="xu"||S==="u_class")throw new SyntaxError("invalid Unicode escape "+i);return"ESC_CHAR"}],[/^\(/,function(){return"CHAR"}],[/^\)/,function(){return"CHAR"}],[/^\(\?=/,function(){return"POS_LA_ASSERT"}],[/^\(\?!/,function(){return"NEG_LA_ASSERT"}],[/^\(\?<=/,function(){return"POS_LB_ASSERT"}],[/^\(\?<!/,function(){return"NEG_LB_ASSERT"}],[/^\(\?:/,function(){return"NON_CAPTURE_GROUP"}],[/^\(\?<(([\u0041-\u005a\u0061-\u007a\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376-\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4-\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09f0-\u09f1\u09fc\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0af9\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60-\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0cf1-\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e46\u0e81-\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5-\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a-\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd-\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5-\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]|\ud800[\udc00-\udc0b\udc0d-\udc26\udc28-\udc3a\udc3c-\udc3d\udc3f-\udc4d\udc50-\udc5d\udc80-\udcfa\udd40-\udd74\ude80-\ude9c\udea0-\uded0\udf00-\udf1f\udf2d-\udf4a\udf50-\udf75\udf80-\udf9d\udfa0-\udfc3\udfc8-\udfcf\udfd1-\udfd5]|\ud801[\udc00-\udc9d\udcb0-\udcd3\udcd8-\udcfb\udd00-\udd27\udd30-\udd63\ude00-\udf36\udf40-\udf55\udf60-\udf67]|\ud802[\udc00-\udc05\udc08\udc0a-\udc35\udc37-\udc38\udc3c\udc3f-\udc55\udc60-\udc76\udc80-\udc9e\udce0-\udcf2\udcf4-\udcf5\udd00-\udd15\udd20-\udd39\udd80-\uddb7\uddbe-\uddbf\ude00\ude10-\ude13\ude15-\ude17\ude19-\ude35\ude60-\ude7c\ude80-\ude9c\udec0-\udec7\udec9-\udee4\udf00-\udf35\udf40-\udf55\udf60-\udf72\udf80-\udf91]|\ud803[\udc00-\udc48\udc80-\udcb2\udcc0-\udcf2\udd00-\udd23\udf00-\udf1c\udf27\udf30-\udf45\udfe0-\udff6]|\ud804[\udc03-\udc37\udc83-\udcaf\udcd0-\udce8\udd03-\udd26\udd44\udd50-\udd72\udd76\udd83-\uddb2\uddc1-\uddc4\uddda\udddc\ude00-\ude11\ude13-\ude2b\ude80-\ude86\ude88\ude8a-\ude8d\ude8f-\ude9d\ude9f-\udea8\udeb0-\udede\udf05-\udf0c\udf0f-\udf10\udf13-\udf28\udf2a-\udf30\udf32-\udf33\udf35-\udf39\udf3d\udf50\udf5d-\udf61]|\ud805[\udc00-\udc34\udc47-\udc4a\udc5f\udc80-\udcaf\udcc4-\udcc5\udcc7\udd80-\uddae\uddd8-\udddb\ude00-\ude2f\ude44\ude80-\udeaa\udeb8\udf00-\udf1a]|\ud806[\udc00-\udc2b\udca0-\udcdf\udcff\udda0-\udda7\uddaa-\uddd0\udde1\udde3\ude00\ude0b-\ude32\ude3a\ude50\ude5c-\ude89\ude9d\udec0-\udef8]|\ud807[\udc00-\udc08\udc0a-\udc2e\udc40\udc72-\udc8f\udd00-\udd06\udd08-\udd09\udd0b-\udd30\udd46\udd60-\udd65\udd67-\udd68\udd6a-\udd89\udd98\udee0-\udef2]|\ud808[\udc00-\udf99]|\ud809[\udc00-\udc6e\udc80-\udd43]|\ud80c[\udc00-\udfff]|\ud80d[\udc00-\udc2e]|\ud811[\udc00-\ude46]|\ud81a[\udc00-\ude38\ude40-\ude5e\uded0-\udeed\udf00-\udf2f\udf40-\udf43\udf63-\udf77\udf7d-\udf8f]|\ud81b[\ude40-\ude7f\udf00-\udf4a\udf50\udf93-\udf9f\udfe0-\udfe1\udfe3]|\ud81c[\udc00-\udfff]|\ud81d[\udc00-\udfff]|\ud81e[\udc00-\udfff]|\ud81f[\udc00-\udfff]|\ud820[\udc00-\udfff]|\ud821[\udc00-\udff7]|\ud822[\udc00-\udef2]|\ud82c[\udc00-\udd1e\udd50-\udd52\udd64-\udd67\udd70-\udefb]|\ud82f[\udc00-\udc6a\udc70-\udc7c\udc80-\udc88\udc90-\udc99]|\ud835[\udc00-\udc54\udc56-\udc9c\udc9e-\udc9f\udca2\udca5-\udca6\udca9-\udcac\udcae-\udcb9\udcbb\udcbd-\udcc3\udcc5-\udd05\udd07-\udd0a\udd0d-\udd14\udd16-\udd1c\udd1e-\udd39\udd3b-\udd3e\udd40-\udd44\udd46\udd4a-\udd50\udd52-\udea5\udea8-\udec0\udec2-\udeda\udedc-\udefa\udefc-\udf14\udf16-\udf34\udf36-\udf4e\udf50-\udf6e\udf70-\udf88\udf8a-\udfa8\udfaa-\udfc2\udfc4-\udfcb]|\ud838[\udd00-\udd2c\udd37-\udd3d\udd4e\udec0-\udeeb]|\ud83a[\udc00-\udcc4\udd00-\udd43\udd4b]|\ud83b[\ude00-\ude03\ude05-\ude1f\ude21-\ude22\ude24\ude27\ude29-\ude32\ude34-\ude37\ude39\ude3b\ude42\ude47\ude49\ude4b\ude4d-\ude4f\ude51-\ude52\ude54\ude57\ude59\ude5b\ude5d\ude5f\ude61-\ude62\ude64\ude67-\ude6a\ude6c-\ude72\ude74-\ude77\ude79-\ude7c\ude7e\ude80-\ude89\ude8b-\ude9b\udea1-\udea3\udea5-\udea9\udeab-\udebb]|\ud840[\udc00-\udfff]|\ud841[\udc00-\udfff]|\ud842[\udc00-\udfff]|\ud843[\udc00-\udfff]|\ud844[\udc00-\udfff]|\ud845[\udc00-\udfff]|\ud846[\udc00-\udfff]|\ud847[\udc00-\udfff]|\ud848[\udc00-\udfff]|\ud849[\udc00-\udfff]|\ud84a[\udc00-\udfff]|\ud84b[\udc00-\udfff]|\ud84c[\udc00-\udfff]|\ud84d[\udc00-\udfff]|\ud84e[\udc00-\udfff]|\ud84f[\udc00-\udfff]|\ud850[\udc00-\udfff]|\ud851[\udc00-\udfff]|\ud852[\udc00-\udfff]|\ud853[\udc00-\udfff]|\ud854[\udc00-\udfff]|\ud855[\udc00-\udfff]|\ud856[\udc00-\udfff]|\ud857[\udc00-\udfff]|\ud858[\udc00-\udfff]|\ud859[\udc00-\udfff]|\ud85a[\udc00-\udfff]|\ud85b[\udc00-\udfff]|\ud85c[\udc00-\udfff]|\ud85d[\udc00-\udfff]|\ud85e[\udc00-\udfff]|\ud85f[\udc00-\udfff]|\ud860[\udc00-\udfff]|\ud861[\udc00-\udfff]|\ud862[\udc00-\udfff]|\ud863[\udc00-\udfff]|\ud864[\udc00-\udfff]|\ud865[\udc00-\udfff]|\ud866[\udc00-\udfff]|\ud867[\udc00-\udfff]|\ud868[\udc00-\udfff]|\ud869[\udc00-\uded6\udf00-\udfff]|\ud86a[\udc00-\udfff]|\ud86b[\udc00-\udfff]|\ud86c[\udc00-\udfff]|\ud86d[\udc00-\udf34\udf40-\udfff]|\ud86e[\udc00-\udc1d\udc20-\udfff]|\ud86f[\udc00-\udfff]|\ud870[\udc00-\udfff]|\ud871[\udc00-\udfff]|\ud872[\udc00-\udfff]|\ud873[\udc00-\udea1\udeb0-\udfff]|\ud874[\udc00-\udfff]|\ud875[\udc00-\udfff]|\ud876[\udc00-\udfff]|\ud877[\udc00-\udfff]|\ud878[\udc00-\udfff]|\ud879[\udc00-\udfff]|\ud87a[\udc00-\udfe0]|\ud87e[\udc00-\ude1d])|[$_]|(\\u[0-9a-fA-F]{4}|\\u\{[0-9a-fA-F]{1,}\}))(([\u0030-\u0039\u0041-\u005a\u005f\u0061-\u007a\u00aa\u00b5\u00b7\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376-\u0377\u037a-\u037d\u037f\u0386-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u05d0-\u05ea\u05ef-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u07fd\u0800-\u082d\u0840-\u085b\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u08d3-\u08e1\u08e3-\u0963\u0966-\u096f\u0971-\u0983\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7-\u09c8\u09cb-\u09ce\u09d7\u09dc-\u09dd\u09df-\u09e3\u09e6-\u09f1\u09fc\u09fe\u0a01-\u0a03\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a3c\u0a3e-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0af9-\u0aff\u0b01-\u0b03\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47-\u0b48\u0b4b-\u0b4d\u0b56-\u0b57\u0b5c-\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82-\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c00-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c58-\u0c5a\u0c60-\u0c63\u0c66-\u0c6f\u0c80-\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5-\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1-\u0cf2\u0d00-\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d54-\u0d57\u0d5f-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82-\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2-\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18-\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1369-\u1371\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772-\u1773\u1780-\u17d3\u17d7\u17dc-\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1878\u1880-\u18aa\u18b0-\u18f5\u1900-\u191e\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19da\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1ab0-\u1abd\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1cd0-\u1cd2\u1cd4-\u1cfa\u1d00-\u1df9\u1dfb-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u203f-\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua827\ua840-\ua873\ua880-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua8fd-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\ua9e0-\ua9fe\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabea\uabec-\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe2f\ufe33-\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]|\ud800[\udc00-\udc0b\udc0d-\udc26\udc28-\udc3a\udc3c-\udc3d\udc3f-\udc4d\udc50-\udc5d\udc80-\udcfa\udd40-\udd74\uddfd\ude80-\ude9c\udea0-\uded0\udee0\udf00-\udf1f\udf2d-\udf4a\udf50-\udf7a\udf80-\udf9d\udfa0-\udfc3\udfc8-\udfcf\udfd1-\udfd5]|\ud801[\udc00-\udc9d\udca0-\udca9\udcb0-\udcd3\udcd8-\udcfb\udd00-\udd27\udd30-\udd63\ude00-\udf36\udf40-\udf55\udf60-\udf67]|\ud802[\udc00-\udc05\udc08\udc0a-\udc35\udc37-\udc38\udc3c\udc3f-\udc55\udc60-\udc76\udc80-\udc9e\udce0-\udcf2\udcf4-\udcf5\udd00-\udd15\udd20-\udd39\udd80-\uddb7\uddbe-\uddbf\ude00-\ude03\ude05-\ude06\ude0c-\ude13\ude15-\ude17\ude19-\ude35\ude38-\ude3a\ude3f\ude60-\ude7c\ude80-\ude9c\udec0-\udec7\udec9-\udee6\udf00-\udf35\udf40-\udf55\udf60-\udf72\udf80-\udf91]|\ud803[\udc00-\udc48\udc80-\udcb2\udcc0-\udcf2\udd00-\udd27\udd30-\udd39\udf00-\udf1c\udf27\udf30-\udf50\udfe0-\udff6]|\ud804[\udc00-\udc46\udc66-\udc6f\udc7f-\udcba\udcd0-\udce8\udcf0-\udcf9\udd00-\udd34\udd36-\udd3f\udd44-\udd46\udd50-\udd73\udd76\udd80-\uddc4\uddc9-\uddcc\uddd0-\uddda\udddc\ude00-\ude11\ude13-\ude37\ude3e\ude80-\ude86\ude88\ude8a-\ude8d\ude8f-\ude9d\ude9f-\udea8\udeb0-\udeea\udef0-\udef9\udf00-\udf03\udf05-\udf0c\udf0f-\udf10\udf13-\udf28\udf2a-\udf30\udf32-\udf33\udf35-\udf39\udf3b-\udf44\udf47-\udf48\udf4b-\udf4d\udf50\udf57\udf5d-\udf63\udf66-\udf6c\udf70-\udf74]|\ud805[\udc00-\udc4a\udc50-\udc59\udc5e-\udc5f\udc80-\udcc5\udcc7\udcd0-\udcd9\udd80-\uddb5\uddb8-\uddc0\uddd8-\udddd\ude00-\ude40\ude44\ude50-\ude59\ude80-\udeb8\udec0-\udec9\udf00-\udf1a\udf1d-\udf2b\udf30-\udf39]|\ud806[\udc00-\udc3a\udca0-\udce9\udcff\udda0-\udda7\uddaa-\uddd7\uddda-\udde1\udde3-\udde4\ude00-\ude3e\ude47\ude50-\ude99\ude9d\udec0-\udef8]|\ud807[\udc00-\udc08\udc0a-\udc36\udc38-\udc40\udc50-\udc59\udc72-\udc8f\udc92-\udca7\udca9-\udcb6\udd00-\udd06\udd08-\udd09\udd0b-\udd36\udd3a\udd3c-\udd3d\udd3f-\udd47\udd50-\udd59\udd60-\udd65\udd67-\udd68\udd6a-\udd8e\udd90-\udd91\udd93-\udd98\udda0-\udda9\udee0-\udef6]|\ud808[\udc00-\udf99]|\ud809[\udc00-\udc6e\udc80-\udd43]|\ud80c[\udc00-\udfff]|\ud80d[\udc00-\udc2e]|\ud811[\udc00-\ude46]|\ud81a[\udc00-\ude38\ude40-\ude5e\ude60-\ude69\uded0-\udeed\udef0-\udef4\udf00-\udf36\udf40-\udf43\udf50-\udf59\udf63-\udf77\udf7d-\udf8f]|\ud81b[\ude40-\ude7f\udf00-\udf4a\udf4f-\udf87\udf8f-\udf9f\udfe0-\udfe1\udfe3]|\ud81c[\udc00-\udfff]|\ud81d[\udc00-\udfff]|\ud81e[\udc00-\udfff]|\ud81f[\udc00-\udfff]|\ud820[\udc00-\udfff]|\ud821[\udc00-\udff7]|\ud822[\udc00-\udef2]|\ud82c[\udc00-\udd1e\udd50-\udd52\udd64-\udd67\udd70-\udefb]|\ud82f[\udc00-\udc6a\udc70-\udc7c\udc80-\udc88\udc90-\udc99\udc9d-\udc9e]|\ud834[\udd65-\udd69\udd6d-\udd72\udd7b-\udd82\udd85-\udd8b\uddaa-\uddad\ude42-\ude44]|\ud835[\udc00-\udc54\udc56-\udc9c\udc9e-\udc9f\udca2\udca5-\udca6\udca9-\udcac\udcae-\udcb9\udcbb\udcbd-\udcc3\udcc5-\udd05\udd07-\udd0a\udd0d-\udd14\udd16-\udd1c\udd1e-\udd39\udd3b-\udd3e\udd40-\udd44\udd46\udd4a-\udd50\udd52-\udea5\udea8-\udec0\udec2-\udeda\udedc-\udefa\udefc-\udf14\udf16-\udf34\udf36-\udf4e\udf50-\udf6e\udf70-\udf88\udf8a-\udfa8\udfaa-\udfc2\udfc4-\udfcb\udfce-\udfff]|\ud836[\ude00-\ude36\ude3b-\ude6c\ude75\ude84\ude9b-\ude9f\udea1-\udeaf]|\ud838[\udc00-\udc06\udc08-\udc18\udc1b-\udc21\udc23-\udc24\udc26-\udc2a\udd00-\udd2c\udd30-\udd3d\udd40-\udd49\udd4e\udec0-\udef9]|\ud83a[\udc00-\udcc4\udcd0-\udcd6\udd00-\udd4b\udd50-\udd59]|\ud83b[\ude00-\ude03\ude05-\ude1f\ude21-\ude22\ude24\ude27\ude29-\ude32\ude34-\ude37\ude39\ude3b\ude42\ude47\ude49\ude4b\ude4d-\ude4f\ude51-\ude52\ude54\ude57\ude59\ude5b\ude5d\ude5f\ude61-\ude62\ude64\ude67-\ude6a\ude6c-\ude72\ude74-\ude77\ude79-\ude7c\ude7e\ude80-\ude89\ude8b-\ude9b\udea1-\udea3\udea5-\udea9\udeab-\udebb]|\ud840[\udc00-\udfff]|\ud841[\udc00-\udfff]|\ud842[\udc00-\udfff]|\ud843[\udc00-\udfff]|\ud844[\udc00-\udfff]|\ud845[\udc00-\udfff]|\ud846[\udc00-\udfff]|\ud847[\udc00-\udfff]|\ud848[\udc00-\udfff]|\ud849[\udc00-\udfff]|\ud84a[\udc00-\udfff]|\ud84b[\udc00-\udfff]|\ud84c[\udc00-\udfff]|\ud84d[\udc00-\udfff]|\ud84e[\udc00-\udfff]|\ud84f[\udc00-\udfff]|\ud850[\udc00-\udfff]|\ud851[\udc00-\udfff]|\ud852[\udc00-\udfff]|\ud853[\udc00-\udfff]|\ud854[\udc00-\udfff]|\ud855[\udc00-\udfff]|\ud856[\udc00-\udfff]|\ud857[\udc00-\udfff]|\ud858[\udc00-\udfff]|\ud859[\udc00-\udfff]|\ud85a[\udc00-\udfff]|\ud85b[\udc00-\udfff]|\ud85c[\udc00-\udfff]|\ud85d[\udc00-\udfff]|\ud85e[\udc00-\udfff]|\ud85f[\udc00-\udfff]|\ud860[\udc00-\udfff]|\ud861[\udc00-\udfff]|\ud862[\udc00-\udfff]|\ud863[\udc00-\udfff]|\ud864[\udc00-\udfff]|\ud865[\udc00-\udfff]|\ud866[\udc00-\udfff]|\ud867[\udc00-\udfff]|\ud868[\udc00-\udfff]|\ud869[\udc00-\uded6\udf00-\udfff]|\ud86a[\udc00-\udfff]|\ud86b[\udc00-\udfff]|\ud86c[\udc00-\udfff]|\ud86d[\udc00-\udf34\udf40-\udfff]|\ud86e[\udc00-\udc1d\udc20-\udfff]|\ud86f[\udc00-\udfff]|\ud870[\udc00-\udfff]|\ud871[\udc00-\udfff]|\ud872[\udc00-\udfff]|\ud873[\udc00-\udea1\udeb0-\udfff]|\ud874[\udc00-\udfff]|\ud875[\udc00-\udfff]|\ud876[\udc00-\udfff]|\ud877[\udc00-\udfff]|\ud878[\udc00-\udfff]|\ud879[\udc00-\udfff]|\ud87a[\udc00-\udfe0]|\ud87e[\udc00-\ude1d]|\udb40[\udd00-\uddef])|[$_]|(\\u[0-9a-fA-F]{4}|\\u\{[0-9a-fA-F]{1,}\})|[\u200c\u200d])*>/,function(){return i=i.slice(3,-1),Ye(i,this.getCurrentState()),"NAMED_CAPTURE_GROUP"}],[/^\(/,function(){return"L_PAREN"}],[/^\)/,function(){return"R_PAREN"}],[/^[*?+[^$]/,function(){return"CHAR"}],[/^\\\]/,function(){return"ESC_CHAR"}],[/^\]/,function(){return this.popState(),"R_BRACKET"}],[/^\^/,function(){return"BOS"}],[/^\$/,function(){return"EOS"}],[/^\*/,function(){return"STAR"}],[/^\?/,function(){return"Q_MARK"}],[/^\+/,function(){return"PLUS"}],[/^\|/,function(){return"BAR"}],[/^\./,function(){return"ANY"}],[/^\//,function(){return"SLASH"}],[/^[^*?+\[()\\|]/,function(){return"CHAR"}],[/^\[\^/,function(){var S=this.getCurrentState();return this.pushState(S==="u"||S==="xu"?"u_class":"class"),"NEG_CLASS"}],[/^\[/,function(){var S=this.getCurrentState();return this.pushState(S==="u"||S==="xu"?"u_class":"class"),"L_BRACKET"}]],C={INITIAL:[8,9,10,11,12,13,14,15,16,17,20,22,23,24,26,27,30,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48,49,50,51],u:[8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27,30,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48,49,50,51],xu:[0,1,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,30,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48,49,50,51],x:[0,1,8,9,10,11,12,13,14,15,16,17,20,22,23,24,26,27,30,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48,49,50,51],u_class:[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],class:[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,20,22,23,24,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]},B={type:l,value:""};A={initString:o(u(function(_){return this._string=_,this._cursor=0,this._states=["INITIAL"],this._tokensQueue=[],this._currentLine=1,this._currentColumn=0,this._currentLineBeginOffset=0,this._tokenStartOffset=0,this._tokenEndOffset=0,this._tokenStartLine=1,this._tokenEndLine=1,this._tokenStartColumn=0,this._tokenEndColumn=0,this},"initString"),"initString"),getStates:o(u(function(){return this._states},"getStates"),"getStates"),getCurrentState:o(u(function(){return this._states[this._states.length-1]},"getCurrentState"),"getCurrentState"),pushState:o(u(function(_){this._states.push(_)},"pushState"),"pushState"),begin:o(u(function(_){this.pushState(_)},"begin"),"begin"),popState:o(u(function(){return this._states.length>1?this._states.pop():this._states[0]},"popState"),"popState"),getNextToken:o(u(function(){if(this._tokensQueue.length>0)return this.onToken(this._toToken(this._tokensQueue.shift()));if(!this.hasMoreTokens())return this.onToken(B);for(var _=this._string.slice(this._cursor),U=C[this.getCurrentState()],j=0;j<U.length;j++){var N=U[j],F=w[N],re=this._match(_,F[0]);if(_===""&&re===""&&this._cursor++,re!==null){i=re,a=i.length;var Q=F[1].call(this);if(!Q)return this.getNextToken();if(Array.isArray(Q)){var Se=Q.slice(1);if(Q=Q[0],Se.length>0){var xe;(xe=this._tokensQueue).unshift.apply(xe,n(Se))}}return this.onToken(this._toToken(Q,i))}}if(this.isEOF())return this._cursor++,B;this.throwUnexpectedToken(_[0],this._currentLine,this._currentColumn)},"getNextToken"),"getNextToken"),throwUnexpectedToken:o(u(function(_,U,j){var N=this._string.split(`
2
- `)[U-1],F="";if(N){var re=" ".repeat(j);F=`
3
-
4
- `+N+`
5
- `+re+`^
6
- `}throw new SyntaxError(F+'Unexpected token: "'+_+'" '+("at "+U+":"+j+"."))},"throwUnexpectedToken"),"throwUnexpectedToken"),getCursor:o(u(function(){return this._cursor},"getCursor"),"getCursor"),getCurrentLine:o(u(function(){return this._currentLine},"getCurrentLine"),"getCurrentLine"),getCurrentColumn:o(u(function(){return this._currentColumn},"getCurrentColumn"),"getCurrentColumn"),_captureLocation:o(u(function(_){var U=/\n/g;this._tokenStartOffset=this._cursor,this._tokenStartLine=this._currentLine,this._tokenStartColumn=this._tokenStartOffset-this._currentLineBeginOffset;for(var j=void 0;(j=U.exec(_))!==null;)this._currentLine++,this._currentLineBeginOffset=this._tokenStartOffset+j.index+1;this._tokenEndOffset=this._cursor+_.length,this._tokenEndLine=this._currentLine,this._tokenEndColumn=this._currentColumn=this._tokenEndOffset-this._currentLineBeginOffset},"_captureLocation"),"_captureLocation"),_toToken:o(u(function(_){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return{type:_,value:U,startOffset:this._tokenStartOffset,endOffset:this._tokenEndOffset,startLine:this._tokenStartLine,endLine:this._tokenEndLine,startColumn:this._tokenStartColumn,endColumn:this._tokenEndColumn}},"_toToken"),"_toToken"),isEOF:o(u(function(){return this._cursor===this._string.length},"isEOF"),"isEOF"),hasMoreTokens:o(u(function(){return this._cursor<=this._string.length},"hasMoreTokens"),"hasMoreTokens"),_match:o(u(function(_,U){var j=_.match(U);return j?(this._captureLocation(j[0]),this._cursor+=j[0].length,j[0]):null},"_match"),"_match"),onToken:o(u(function(_){return _},"onToken"),"onToken")},s.lexer=A,s.tokenizer=A,s.options={captureLocations:!0};var T={setOptions:o(u(function(_){return s.options=_,this},"setOptions"),"setOptions"),getOptions:o(u(function(){return s.options},"getOptions"),"getOptions"),parse:o(u(function(_,U){if(!A)throw new Error("Tokenizer instance wasn't specified.");A.initString(_);var j=s.options;U&&(s.options=Object.assign({},s.options,U)),T.onParseBegin(_,A,s.options),g.length=0,g.push(0);var N=A.getNextToken(),F=null;do{N||(s.options=j,Bt());var re=g[g.length-1],Q=v[N.type];b[re].hasOwnProperty(Q)||(s.options=j,et(N));var Se=b[re][Q];if(Se[0]==="s"){var xe=null;s.options.captureLocations&&(xe={startOffset:N.startOffset,endOffset:N.endOffset,startLine:N.startLine,endLine:N.endLine,startColumn:N.startColumn,endColumn:N.endColumn}),F=this.onShift(N),g.push({symbol:v[F.type],semanticValue:F.value,loc:xe},Number(Se.slice(1))),N=A.getNextToken()}else if(Se[0]==="r"){var tt=Se.slice(1),Te=p[tt],at=typeof Te[2]=="function",$t=at?[]:null,qt=at&&s.options.captureLocations?[]:null;if(Te[1]!==0)for(var Wr=Te[1];Wr-- >0;){g.pop();var Pr=g.pop();at&&($t.unshift(Pr.semanticValue),qt&&qt.unshift(Pr.loc))}var Ir={symbol:Te[0]};if(at){i=F?F.value:null,a=F?F.value.length:null;var vn=qt!==null?$t.concat(qt):$t;Te[2].apply(Te,n(vn)),Ir.semanticValue=c,qt&&(Ir.loc=d)}var Jr=g[g.length-1],Gt=Te[0];g.push(Ir,b[Jr][Gt])}else if(Se==="acc"){g.pop();var Ht=g.pop();return(g.length!==1||g[0]!==0||A.hasMoreTokens())&&(s.options=j,et(N)),Ht.hasOwnProperty("semanticValue")?(s.options=j,T.onParseEnd(Ht.semanticValue),Ht.semanticValue):(T.onParseEnd(),s.options=j,!0)}}while(A.hasMoreTokens()||g.length>1)},"parse4"),"parse"),setTokenizer:o(u(function(_){return A=_,T},"setTokenizer"),"setTokenizer"),getTokenizer:o(u(function(){return A},"getTokenizer"),"getTokenizer"),onParseBegin:o(u(function(_,U,j){},"onParseBegin"),"onParseBegin"),onParseEnd:o(u(function(_){},"onParseEnd"),"onParseEnd"),onShift:o(u(function(_){return _},"onShift"),"onShift")},M=0,O={},E="";T.onParseBegin=function(S,_){E=S,M=0,O={};var U=S.lastIndexOf("/"),j=S.slice(U);j.includes("x")&&j.includes("u")?_.pushState("xu"):(j.includes("x")&&_.pushState("x"),j.includes("u")&&_.pushState("u"))},T.onShift=function(S){return(S.type==="L_PAREN"||S.type==="NAMED_CAPTURE_GROUP")&&(S.value=new String(S.value),S.value.groupNumber=++M),S};function P(S){var _=S.match(/\d+/g).map(Number);if(Number.isFinite(_[1])&&_[1]<_[0])throw new SyntaxError("Numbers out of order in "+S+" quantifier");return _}u(P,"getRange"),o(P,"getRange");function L(S,_){if(S.kind==="control"||_.kind==="control"||!isNaN(S.codePoint)&&!isNaN(_.codePoint)&&S.codePoint>_.codePoint)throw new SyntaxError("Range "+S.value+"-"+_.value+" out of order in character class")}u(L,"checkClassRange"),o(L,"checkClassRange");var V=KE();function Y(S,_){var U=S[1]==="P",j=S.indexOf("="),N=S.slice(3,j!==-1?j:-1),F=void 0,re=j===-1&&V.isGeneralCategoryValue(N),Q=j===-1&&V.isBinaryPropertyName(N);if(re)F=N,N="General_Category";else if(Q)F=N;else{if(!V.isValidName(N))throw new SyntaxError("Invalid unicode property name: "+N+".");if(F=S.slice(j+1,-1),!V.isValidValue(N,F))throw new SyntaxError("Invalid "+N+" unicode property value: "+F+".")}return me({type:"UnicodeProperty",name:N,value:F,negative:U,shorthand:re,binary:Q,canonicalName:V.getCanonicalName(N)||N,canonicalValue:V.getCanonicalValue(F)||F},_)}u(Y,"UnicodeProperty"),o(Y,"UnicodeProperty");function oe(S,_,U){var j=void 0,N=void 0;switch(_){case"decimal":{N=Number(S.slice(1)),j=String.fromCodePoint(N);break}case"oct":{N=parseInt(S.slice(1),8),j=String.fromCodePoint(N);break}case"hex":case"unicode":{if(S.lastIndexOf("\\u")>0){var F=S.split("\\u").slice(1),re=t(F,2),Q=re[0],Se=re[1];Q=parseInt(Q,16),Se=parseInt(Se,16),N=(Q-55296)*1024+(Se-56320)+65536,j=String.fromCodePoint(N)}else{var xe=S.slice(2).replace("{","");if(N=parseInt(xe,16),N>1114111)throw new SyntaxError("Bad character escape sequence: "+S);j=String.fromCodePoint(N)}break}case"meta":{switch(S){case"\\t":j=" ",N=j.codePointAt(0);break;case"\\n":j=`
7
- `,N=j.codePointAt(0);break;case"\\r":j="\r",N=j.codePointAt(0);break;case"\\v":j="\v",N=j.codePointAt(0);break;case"\\f":j="\f",N=j.codePointAt(0);break;case"\\b":j="\b",N=j.codePointAt(0);case"\\0":j="\0",N=0;case".":j=".",N=NaN;break;default:N=NaN}break}case"simple":{j=S,N=j.codePointAt(0);break}}return me({type:"Char",value:S,kind:_,symbol:j,codePoint:N},U)}u(oe,"Char"),o(oe,"Char");var be="gimsuxy";function Oe(S){var _=new Set,U=!0,j=!1,N=void 0;try{for(var F=S[Symbol.iterator](),re;!(U=(re=F.next()).done);U=!0){var Q=re.value;if(_.has(Q)||!be.includes(Q))throw new SyntaxError("Invalid flags: "+S);_.add(Q)}}catch(Se){j=!0,N=Se}finally{try{!U&&F.return&&F.return()}finally{if(j)throw N}}return S.split("").sort().join("")}u(Oe,"checkFlags"),o(Oe,"checkFlags");function Pe(S,_){var U=Number(S.slice(1));return U>0&&U<=M?me({type:"Backreference",kind:"number",number:U,reference:U},_):oe(S,"decimal",_)}u(Pe,"GroupRefOrDecChar"),o(Pe,"GroupRefOrDecChar");var Je=/^\\u[0-9a-fA-F]{4}/,Me=/^\\u\{[0-9a-fA-F]{1,}\}/,Xe=/\\u\{[0-9a-fA-F]{1,}\}/;function Ye(S,_){var U=Xe.test(S),j=_==="u"||_==="xu"||_==="u_class";if(U&&!j)throw new SyntaxError('invalid group Unicode name "'+S+'", use `u` flag.');return S}u(Ye,"validateUnicodeGroupName"),o(Ye,"validateUnicodeGroupName");var ut=/\\u(?:([dD][89aAbB][0-9a-fA-F]{2})\\u([dD][c-fC-F][0-9a-fA-F]{2})|([dD][89aAbB][0-9a-fA-F]{2})|([dD][c-fC-F][0-9a-fA-F]{2})|([0-9a-ce-fA-CE-F][0-9a-fA-F]{3}|[dD][0-7][0-9a-fA-F]{2})|\{(0*(?:[0-9a-fA-F]{1,5}|10[0-9a-fA-F]{4}))\})/;function Ze(S){return S.replace(new RegExp(ut,"g"),function(_,U,j,N,F,re,Q){return U?String.fromCodePoint(parseInt(U,16),parseInt(j,16)):N?String.fromCodePoint(parseInt(N,16)):F?String.fromCodePoint(parseInt(F,16)):re?String.fromCodePoint(parseInt(re,16)):Q?String.fromCodePoint(parseInt(Q,16)):_})}u(Ze,"decodeUnicodeGroupName"),o(Ze,"decodeUnicodeGroupName");function Ot(S,_){var U=S.slice(3,-1),j=Ze(U);if(O.hasOwnProperty(j))return me({type:"Backreference",kind:"name",number:O[j],reference:j,referenceRaw:U},_);var N=null,F=null,re=null,Q=null;_&&(N=_.startOffset,F=_.startLine,re=_.endLine,Q=_.startColumn);var Se=/^[\w$<>]/,xe=void 0,tt=[oe(S.slice(1,2),"simple",N?{startLine:F,endLine:re,startColumn:Q,startOffset:N,endOffset:N+=2,endColumn:Q+=2}:null)];for(tt[0].escaped=!0,S=S.slice(2);S.length>0;){var Te=null;(Te=S.match(Je))||(Te=S.match(Me))?(N&&(xe={startLine:F,endLine:re,startColumn:Q,startOffset:N,endOffset:N+=Te[0].length,endColumn:Q+=Te[0].length}),tt.push(oe(Te[0],"unicode",xe)),S=S.slice(Te[0].length)):(Te=S.match(Se))&&(N&&(xe={startLine:F,endLine:re,startColumn:Q,startOffset:N,endOffset:++N,endColumn:++Q}),tt.push(oe(Te[0],"simple",xe)),S=S.slice(1))}return tt}u(Ot,"NamedGroupRefOrChars"),o(Ot,"NamedGroupRefOrChars");function me(S,_){return s.options.captureLocations&&(S.loc={source:E.slice(_.startOffset,_.endOffset),start:{line:_.startLine,column:_.startColumn,offset:_.startOffset},end:{line:_.endLine,column:_.endColumn,offset:_.endOffset}}),S}u(me,"Node"),o(me,"Node");function ee(S,_){return s.options.captureLocations?{startOffset:S.startOffset,endOffset:_.endOffset,startLine:S.startLine,endLine:_.endLine,startColumn:S.startColumn,endColumn:_.endColumn}:null}u(ee,"loc"),o(ee,"loc");function et(S){S.type===l&&Bt(),A.throwUnexpectedToken(S.value,S.startLine,S.startColumn)}u(et,"unexpectedToken"),o(et,"unexpectedToken");function Bt(){Ee("Unexpected end of input.")}u(Bt,"unexpectedEndOfInput"),o(Bt,"unexpectedEndOfInput");function Ee(S){throw new SyntaxError(S)}u(Ee,"parseError"),o(Ee,"parseError"),e.exports=T}}),Up=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/parser/index.js"(r,e){"use strict";var t=WE(),n=t.parse.bind(t);t.parse=function(i,a){return n(""+i,a)},t.setOptions({captureLocations:!1}),e.exports=t}}),Vg=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/traverse/node-path.js"(r,e){"use strict";var t=(function(){function d(f,l){for(var p=0;p<l.length;p++){var v=l[p];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}return u(d,"defineProperties"),o(d,"defineProperties"),function(f,l,p){return l&&d(f.prototype,l),p&&d(f,p),f}})();function n(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}u(n,"_classCallCheck"),o(n,"_classCallCheck");var i="expressions",a="expression",s=(function(){function d(f){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;n(this,d),this.node=f,this.parentPath=l,this.parent=l?l.node:null,this.property=p,this.index=v}return u(d,"NodePath2"),o(d,"NodePath"),t(d,[{key:"_enforceProp",value:o(u(function(l){if(!this.node.hasOwnProperty(l))throw new Error("Node of type "+this.node.type+` doesn't have "`+l+'" collection.')},"_enforceProp"),"_enforceProp")},{key:"setChild",value:o(u(function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,b=void 0;return p!=null?(v||(v=i),this._enforceProp(v),this.node[v][p]=l,b=d.getForNode(l,this,v,p)):(v||(v=a),this._enforceProp(v),this.node[v]=l,b=d.getForNode(l,this,v,null)),b},"setChild"),"setChild")},{key:"appendChild",value:o(u(function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;p||(p=i),this._enforceProp(p);var v=this.node[p].length;return this.setChild(l,v,p)},"appendChild"),"appendChild")},{key:"insertChildAt",value:o(u(function(l,p){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:i;this._enforceProp(v),this.node[v].splice(p,0,l),p<=d.getTraversingIndex()&&d.updateTraversingIndex(1),this._rebuildIndex(this.node,v)},"insertChildAt"),"insertChildAt")},{key:"remove",value:o(u(function(){if(!this.isRemoved()&&(d.registry.delete(this.node),this.node=null,!!this.parent)){if(this.index!==null){this.parent[this.property].splice(this.index,1),this.index<=d.getTraversingIndex()&&d.updateTraversingIndex(-1),this._rebuildIndex(this.parent,this.property),this.index=null,this.property=null;return}delete this.parent[this.property],this.property=null}},"remove"),"remove")},{key:"_rebuildIndex",value:o(u(function(l,p){for(var v=d.getForNode(l),b=0;b<l[p].length;b++){var g=d.getForNode(l[p][b],v,p,b);g.index=b}},"_rebuildIndex"),"_rebuildIndex")},{key:"isRemoved",value:o(u(function(){return this.node===null},"isRemoved"),"isRemoved")},{key:"replace",value:o(u(function(l){return d.registry.delete(this.node),this.node=l,this.parent?(this.index!==null?this.parent[this.property][this.index]=l:this.parent[this.property]=l,d.getForNode(l,this.parentPath,this.property,this.index)):null},"replace"),"replace")},{key:"update",value:o(u(function(l){Object.assign(this.node,l)},"update"),"update")},{key:"getParent",value:o(u(function(){return this.parentPath},"getParent"),"getParent")},{key:"getChild",value:o(u(function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.node.expressions?d.getForNode(this.node.expressions[l],this,i,l):this.node.expression&&l==0?d.getForNode(this.node.expression,this,a):null},"getChild"),"getChild")},{key:"hasEqualSource",value:o(u(function(l){return JSON.stringify(this.node,c)===JSON.stringify(l.node,c)},"hasEqualSource"),"hasEqualSource")},{key:"jsonEncode",value:o(u(function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=l.format,v=l.useLoc;return JSON.stringify(this.node,v?null:c,p)},"jsonEncode"),"jsonEncode")},{key:"getPreviousSibling",value:o(u(function(){return!this.parent||this.index==null?null:d.getForNode(this.parent[this.property][this.index-1],d.getForNode(this.parent),this.property,this.index-1)},"getPreviousSibling"),"getPreviousSibling")},{key:"getNextSibling",value:o(u(function(){return!this.parent||this.index==null?null:d.getForNode(this.parent[this.property][this.index+1],d.getForNode(this.parent),this.property,this.index+1)},"getNextSibling"),"getNextSibling")}],[{key:"getForNode",value:o(u(function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1;if(!l)return null;d.registry.has(l)||d.registry.set(l,new d(l,p,v,b==-1?null:b));var g=d.registry.get(l);return p!==null&&(g.parentPath=p,g.parent=g.parentPath.node),v!==null&&(g.property=v),b>=0&&(g.index=b),g},"getForNode"),"getForNode")},{key:"initRegistry",value:o(u(function(){d.registry||(d.registry=new Map),d.registry.clear()},"initRegistry"),"initRegistry")},{key:"updateTraversingIndex",value:o(u(function(l){return d.traversingIndexStack[d.traversingIndexStack.length-1]+=l},"updateTraversingIndex"),"updateTraversingIndex")},{key:"getTraversingIndex",value:o(u(function(){return d.traversingIndexStack[d.traversingIndexStack.length-1]},"getTraversingIndex"),"getTraversingIndex")}]),d})();s.initRegistry(),s.traversingIndexStack=[];function c(d,f){if(d!=="loc")return f}u(c,"jsonSkipLoc"),o(c,"jsonSkipLoc"),e.exports=s}}),Lw=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/traverse/index.js"(r,e){"use strict";var t=Vg();function n(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=a.pre,c=a.post,d=a.skipProperty;function f(l,p,v,b){if(!(!l||typeof l.type!="string")){var g=void 0;if(s&&(g=s(l,p,v,b)),g!==!1){p&&p[v]&&(isNaN(b)?l=p[v]:l=p[v][b]);for(var A in l)if(l.hasOwnProperty(A)){if(d?d(A,l):A[0]==="$")continue;var w=l[A];if(Array.isArray(w)){var C=0;for(t.traversingIndexStack.push(C);C<w.length;)f(w[C],l,A,C),C=t.updateTraversingIndex(1);t.traversingIndexStack.pop()}else f(w,l,A)}}c&&c(l,p,v,b)}}u(f,"visit"),o(f,"visit"),f(i,null)}u(n,"astTraverse"),o(n,"astTraverse"),e.exports={traverse:o(u(function(a,s){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{asNodes:!1};Array.isArray(s)||(s=[s]),s=s.filter(function(f){return typeof f.shouldRun!="function"?!0:f.shouldRun(a)}),t.initRegistry(),s.forEach(function(f){typeof f.init=="function"&&f.init(a)});function d(f,l,p,v){var b=t.getForNode(l),g=t.getForNode(f,b,p,v);return g}u(d,"getPathFor"),o(d,"getPathFor"),n(a,{pre:o(u(function(l,p,v,b){var g=void 0;c.asNodes||(g=d(l,p,v,b));var A=!0,w=!1,C=void 0;try{for(var B=s[Symbol.iterator](),T;!(A=(T=B.next()).done);A=!0){var M=T.value;if(typeof M["*"]=="function")if(g){if(!g.isRemoved()){var O=M["*"](g);if(O===!1)return!1}}else M["*"](l,p,v,b);var E=void 0;if(typeof M[l.type]=="function"?E=M[l.type]:typeof M[l.type]=="object"&&typeof M[l.type].pre=="function"&&(E=M[l.type].pre),E)if(g){if(!g.isRemoved()){var P=E.call(M,g);if(P===!1)return!1}}else E.call(M,l,p,v,b)}}catch(L){w=!0,C=L}finally{try{!A&&B.return&&B.return()}finally{if(w)throw C}}},"pre"),"pre"),post:o(u(function(l,p,v,b){if(l){var g=void 0;c.asNodes||(g=d(l,p,v,b));var A=!0,w=!1,C=void 0;try{for(var B=s[Symbol.iterator](),T;!(A=(T=B.next()).done);A=!0){var M=T.value,O=void 0;if(typeof M[l.type]=="object"&&typeof M[l.type].post=="function"&&(O=M[l.type].post),O)if(g){if(!g.isRemoved()){var E=O.call(M,g);if(E===!1)return!1}}else O.call(M,l,p,v,b)}}catch(P){w=!0,C=P}finally{try{!A&&B.return&&B.return()}finally{if(w)throw C}}}},"post"),"post"),skipProperty:o(u(function(l){return l==="loc"},"skipProperty"),"skipProperty")})},"traverse"),"traverse")}}}),Ug=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/transform/index.js"(r,e){"use strict";var t=(function(){function d(f,l){for(var p=0;p<l.length;p++){var v=l[p];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}return u(d,"defineProperties"),o(d,"defineProperties"),function(f,l,p){return l&&d(f.prototype,l),p&&d(f,p),f}})();function n(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}u(n,"_classCallCheck"),o(n,"_classCallCheck");var i=jw(),a=Up(),s=Lw(),c=(function(){function d(f){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;n(this,d),this._ast=f,this._source=null,this._string=null,this._regexp=null,this._extra=l}return u(d,"TransformResult2"),o(d,"TransformResult"),t(d,[{key:"getAST",value:o(u(function(){return this._ast},"getAST"),"getAST")},{key:"setExtra",value:o(u(function(l){this._extra=l},"setExtra"),"setExtra")},{key:"getExtra",value:o(u(function(){return this._extra},"getExtra"),"getExtra")},{key:"toRegExp",value:o(u(function(){return this._regexp||(this._regexp=new RegExp(this.getSource(),this._ast.flags)),this._regexp},"toRegExp"),"toRegExp")},{key:"getSource",value:o(u(function(){return this._source||(this._source=i.generate(this._ast.body)),this._source},"getSource"),"getSource")},{key:"getFlags",value:o(u(function(){return this._ast.flags},"getFlags"),"getFlags")},{key:"toString",value:o(u(function(){return this._string||(this._string=i.generate(this._ast)),this._string},"toString"),"toString")}]),d})();e.exports={TransformResult:c,transform:o(u(function(f,l){var p=f;return f instanceof RegExp&&(f=""+f),typeof f=="string"&&(p=a.parse(f,{captureLocations:!0})),s.traverse(p,l),new c(p)},"transform2"),"transform")}}}),JE=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/compat-transpiler/index.js"(r,e){"use strict";var t=FE(),n=Ug();e.exports={transform:o(u(function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=s.length>0?s:Object.keys(t),d=void 0,f={};return c.forEach(function(l){if(!t.hasOwnProperty(l))throw new Error("Unknown compat-transform: "+l+". Available transforms are: "+Object.keys(t).join(", "));var p=t[l];d=n.transform(a,p),a=d.getAST(),typeof p.getExtra=="function"&&(f[l]=p.getExtra())}),d.setExtra(f),d},"transform2"),"transform")}}}),zE=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/utils/clone.js"(r,e){"use strict";e.exports=o(u(function t(n){if(n===null||typeof n!="object")return n;var i=void 0;Array.isArray(n)?i=[]:i={};for(var a in n)i[a]=t(n[a]);return i},"clone"),"clone")}}),GE=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/char-surrogate-pair-to-single-unicode-transform.js"(r,e){"use strict";e.exports={shouldRun:o(u(function(n){return n.flags.includes("u")},"shouldRun"),"shouldRun"),Char:o(u(function(n){var i=n.node;i.kind!=="unicode"||!i.isSurrogatePair||isNaN(i.codePoint)||(i.value="\\u{"+i.codePoint.toString(16)+"}",delete i.isSurrogatePair)},"Char"),"Char")}}}),XE=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/char-code-to-simple-char-transform.js"(r,e){"use strict";var t="A".codePointAt(0),n="Z".codePointAt(0),i="a".codePointAt(0),a="z".codePointAt(0),s="0".codePointAt(0),c="9".codePointAt(0);e.exports={Char:o(u(function(v){var b=v.node,g=v.parent;if(!(isNaN(b.codePoint)||b.kind==="simple")&&!(g.type==="ClassRange"&&!d(g))&&f(b.codePoint)){var A=String.fromCodePoint(b.codePoint),w={type:"Char",kind:"simple",value:A,symbol:A,codePoint:b.codePoint};l(A,g.type)&&(w.escaped=!0),v.replace(w)}},"Char"),"Char")};function d(p){var v=p.from,b=p.to;return v.codePoint>=s&&v.codePoint<=c&&b.codePoint>=s&&b.codePoint<=c||v.codePoint>=t&&v.codePoint<=n&&b.codePoint>=t&&b.codePoint<=n||v.codePoint>=i&&v.codePoint<=a&&b.codePoint>=i&&b.codePoint<=a}u(d,"isSimpleRange"),o(d,"isSimpleRange");function f(p){return p>=32&&p<=126}u(f,"isPrintableASCIIChar"),o(f,"isPrintableASCIIChar");function l(p,v){return v==="ClassRange"||v==="CharacterClass"?/[\]\\^-]/.test(p):/[*[()+?^$./\\|{}]/.test(p)}u(l,"needsEscape"),o(l,"needsEscape")}}),ZE=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/char-case-insensitive-lowercase-transform.js"(r,e){"use strict";var t="A".codePointAt(0),n="Z".codePointAt(0);e.exports={_AZClassRanges:null,_hasUFlag:!1,init:o(u(function(d){this._AZClassRanges=new Set,this._hasUFlag=d.flags.includes("u")},"init"),"init"),shouldRun:o(u(function(d){return d.flags.includes("i")},"shouldRun"),"shouldRun"),Char:o(u(function(d){var f=d.node,l=d.parent;if(!isNaN(f.codePoint)&&!(!this._hasUFlag&&f.codePoint>=4096)){if(l.type==="ClassRange"){if(!this._AZClassRanges.has(l)&&!i(l))return;this._AZClassRanges.add(l)}var p=f.symbol.toLowerCase();p!==f.symbol&&(f.value=a(p,f),f.symbol=p,f.codePoint=p.codePointAt(0))}},"Char"),"Char")};function i(c){var d=c.from,f=c.to;return d.codePoint>=t&&d.codePoint<=n&&f.codePoint>=t&&f.codePoint<=n}u(i,"isAZClassRange"),o(i,"isAZClassRange");function a(c,d){var f=c.codePointAt(0);if(d.kind==="decimal")return"\\"+f;if(d.kind==="oct")return"\\0"+f.toString(8);if(d.kind==="hex")return"\\x"+f.toString(16);if(d.kind==="unicode")if(d.isSurrogatePair){var l=s(f),p=l.lead,v=l.trail;return"\\u"+"0".repeat(4-p.length)+p+"\\u"+"0".repeat(4-v.length)+v}else{if(d.value.includes("{"))return"\\u{"+f.toString(16)+"}";var b=f.toString(16);return"\\u"+"0".repeat(4-b.length)+b}return c}u(a,"displaySymbolAsValue"),o(a,"displaySymbolAsValue");function s(c){var d=Math.floor((c-65536)/1024)+55296,f=(c-65536)%1024+56320;return{lead:d.toString(16),trail:f.toString(16)}}u(s,"getSurrogatePairFromCodePoint"),o(s,"getSurrogatePairFromCodePoint")}}),QE=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/char-class-remove-duplicates-transform.js"(r,e){"use strict";e.exports={CharacterClass:o(u(function(n){for(var i=n.node,a={},s=0;s<i.expressions.length;s++){var c=n.getChild(s),d=c.jsonEncode();a.hasOwnProperty(d)&&(c.remove(),s--),a[d]=!0}},"CharacterClass"),"CharacterClass")}}}),$g=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/transform/utils.js"(r,e){"use strict";function t(s){if(Array.isArray(s)){for(var c=0,d=Array(s.length);c<s.length;c++)d[c]=s[c];return d}else return Array.from(s)}u(t,"_toConsumableArray"),o(t,"_toConsumableArray");function n(s){if(s.type!=="Disjunction")throw new TypeError('Expected "Disjunction" node, got "'+s.type+'"');var c=[];return s.left&&s.left.type==="Disjunction"?c.push.apply(c,t(n(s.left)).concat([s.right])):c.push(s.left,s.right),c}u(n,"disjunctionToList"),o(n,"disjunctionToList");function i(s){return s.reduce(function(c,d){return{type:"Disjunction",left:c,right:d}})}u(i,"listToDisjunction"),o(i,"listToDisjunction");function a(s){s.kind==="*"?s.kind="+":s.kind==="+"?(s.kind="Range",s.from=2,delete s.to):s.kind==="?"?(s.kind="Range",s.from=1,s.to=2):s.kind==="Range"&&(s.from+=1,s.to&&(s.to+=1))}u(a,"increaseQuantifierByOne"),o(a,"increaseQuantifierByOne"),e.exports={disjunctionToList:n,listToDisjunction:i,increaseQuantifierByOne:a}}}),YE=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/quantifiers-merge-transform.js"(r,e){"use strict";var t=$g(),n=t.increaseQuantifierByOne;e.exports={Repetition:o(u(function(c){var d=c.node,f=c.parent;if(!(f.type!=="Alternative"||!c.index)){var l=c.getPreviousSibling();if(l)if(l.node.type==="Repetition"){if(!l.getChild().hasEqualSource(c.getChild()))return;var p=a(l.node.quantifier),v=p.from,b=p.to,g=a(d.quantifier),A=g.from,w=g.to;if(l.node.quantifier.greedy!==d.quantifier.greedy&&!i(l.node.quantifier)&&!i(d.quantifier))return;d.quantifier.kind="Range",d.quantifier.from=v+A,b&&w?d.quantifier.to=b+w:delete d.quantifier.to,(i(l.node.quantifier)||i(d.quantifier))&&(d.quantifier.greedy=!0),l.remove()}else{if(!l.hasEqualSource(c.getChild()))return;n(d.quantifier),l.remove()}}},"Repetition"),"Repetition")};function i(s){return s.greedy&&(s.kind==="+"||s.kind==="*"||s.kind==="Range"&&!s.to)}u(i,"isGreedyOpenRange"),o(i,"isGreedyOpenRange");function a(s){var c=void 0,d=void 0;return s.kind==="*"?c=0:s.kind==="+"?c=1:s.kind==="?"?(c=0,d=1):(c=s.from,s.to&&(d=s.to)),{from:c,to:d}}u(a,"extractFromTo"),o(a,"extractFromTo")}}),ek=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/quantifier-range-to-symbol-transform.js"(r,e){"use strict";e.exports={Quantifier:o(u(function(s){var c=s.node;c.kind==="Range"&&(t(s),n(s),i(s))},"Quantifier"),"Quantifier")};function t(a){var s=a.node;s.from!==0||s.to||(s.kind="*",delete s.from)}u(t,"rewriteOpenZero"),o(t,"rewriteOpenZero");function n(a){var s=a.node;s.from!==1||s.to||(s.kind="+",delete s.from)}u(n,"rewriteOpenOne"),o(n,"rewriteOpenOne");function i(a){var s=a.node;s.from!==1||s.to!==1||a.parentPath.replace(a.parentPath.node.expression)}u(i,"rewriteExactOne"),o(i,"rewriteExactOne")}}),tk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/char-class-classranges-to-chars-transform.js"(r,e){"use strict";e.exports={ClassRange:o(u(function(n){var i=n.node;i.from.codePoint===i.to.codePoint?n.replace(i.from):i.from.codePoint===i.to.codePoint-1&&(n.getParent().insertChildAt(i.to,n.index+1),n.replace(i.from))},"ClassRange"),"ClassRange")}}}),rk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/char-class-to-meta-transform.js"(r,e){"use strict";function t(g){if(Array.isArray(g)){for(var A=0,w=Array(g.length);A<g.length;A++)w[A]=g[A];return w}else return Array.from(g)}u(t,"_toConsumableArray"),o(t,"_toConsumableArray"),e.exports={_hasIFlag:!1,_hasUFlag:!1,init:o(u(function(A){this._hasIFlag=A.flags.includes("i"),this._hasUFlag=A.flags.includes("u")},"init"),"init"),CharacterClass:o(u(function(A){n(A),i(A,this._hasIFlag,this._hasUFlag),s(A)},"CharacterClass"),"CharacterClass")};function n(g){var A=g.node;A.expressions.forEach(function(w,C){c(w)&&g.getChild(C).replace({type:"Char",value:"\\d",kind:"meta"})})}u(n,"rewriteNumberRanges"),o(n,"rewriteNumberRanges");function i(g,A,w){var C=g.node,B=null,T=null,M=null,O=null,E=null,P=null;C.expressions.forEach(function(L,V){f(L,"\\d")?B=g.getChild(V):l(L)?T=g.getChild(V):p(L)?M=g.getChild(V):v(L)?O=g.getChild(V):A&&w&&b(L,383)?E=g.getChild(V):A&&w&&b(L,8490)&&(P=g.getChild(V))}),B&&(T&&M||A&&(T||M))&&O&&(!w||!A||E&&P)&&(B.replace({type:"Char",value:"\\w",kind:"meta"}),T&&T.remove(),M&&M.remove(),O.remove(),E&&E.remove(),P&&P.remove())}u(i,"rewriteWordRanges"),o(i,"rewriteWordRanges");var a=[function(g){return d(g," ")}].concat(t(["\\f","\\n","\\r","\\t","\\v"].map(function(g){return function(A){return f(A,g)}})),t([160,5760,8232,8233,8239,8287,12288,65279].map(function(g){return function(A){return b(A,g)}})),[function(g){return g.type==="ClassRange"&&b(g.from,8192)&&b(g.to,8202)}]);function s(g){var A=g.node;if(!(A.expressions.length<a.length||!a.every(function(C){return A.expressions.some(function(B){return C(B)})}))){var w=A.expressions.find(function(C){return f(C,"\\n")});w.value="\\s",w.symbol=void 0,w.codePoint=NaN,A.expressions.map(function(C,B){return a.some(function(T){return T(C)})?g.getChild(B):void 0}).filter(Boolean).forEach(function(C){return C.remove()})}}u(s,"rewriteWhitespaceRanges"),o(s,"rewriteWhitespaceRanges");function c(g){return g.type==="ClassRange"&&g.from.value==="0"&&g.to.value==="9"}u(c,"isFullNumberRange"),o(c,"isFullNumberRange");function d(g,A){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"simple";return g.type==="Char"&&g.value===A&&g.kind===w}u(d,"isChar"),o(d,"isChar");function f(g,A){return d(g,A,"meta")}u(f,"isMetaChar"),o(f,"isMetaChar");function l(g){return g.type==="ClassRange"&&g.from.value==="a"&&g.to.value==="z"}u(l,"isLowerCaseRange"),o(l,"isLowerCaseRange");function p(g){return g.type==="ClassRange"&&g.from.value==="A"&&g.to.value==="Z"}u(p,"isUpperCaseRange"),o(p,"isUpperCaseRange");function v(g){return g.type==="Char"&&g.value==="_"&&g.kind==="simple"}u(v,"isUnderscore"),o(v,"isUnderscore");function b(g,A){return g.type==="Char"&&g.kind==="unicode"&&g.codePoint===A}u(b,"isCodePoint"),o(b,"isCodePoint")}}),nk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/char-class-to-single-char-transform.js"(r,e){"use strict";e.exports={CharacterClass:o(u(function(d){var f=d.node;if(!(f.expressions.length!==1||!a(d)||!t(f.expressions[0]))){var l=f.expressions[0],p=l.value,v=l.kind,b=l.escaped;if(f.negative){if(!n(p))return;p=i(p)}d.replace({type:"Char",value:p,kind:v,escaped:b||s(p)})}},"CharacterClass"),"CharacterClass")};function t(c){return c.type==="Char"&&c.value!=="\\b"}u(t,"isAppropriateChar"),o(t,"isAppropriateChar");function n(c){return/^\\[dwsDWS]$/.test(c)}u(n,"isMeta"),o(n,"isMeta");function i(c){return/[dws]/.test(c)?c.toUpperCase():c.toLowerCase()}u(i,"getInverseMeta"),o(i,"getInverseMeta");function a(c){var d=c.parent,f=c.index;if(d.type!=="Alternative")return!0;var l=d.expressions[f-1];return l==null?!0:!(l.type==="Backreference"&&l.kind==="number"||l.type==="Char"&&l.kind==="decimal")}u(a,"hasAppropriateSiblings"),o(a,"hasAppropriateSiblings");function s(c){return/[*[()+?$./{}|]/.test(c)}u(s,"shouldEscape"),o(s,"shouldEscape")}}),ik=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/char-escape-unescape-transform.js"(r,e){"use strict";e.exports={_hasXFlag:!1,init:o(u(function(l){this._hasXFlag=l.flags.includes("x")},"init"),"init"),Char:o(u(function(l){var p=l.node;p.escaped&&t(l,this._hasXFlag)&&delete p.escaped},"Char"),"Char")};function t(f,l){var p=f.node.value,v=f.index,b=f.parent;return b.type!=="CharacterClass"&&b.type!=="ClassRange"?!i(p,v,b,l):!n(p,v,b)}u(t,"shouldUnescape"),o(t,"shouldUnescape");function n(f,l,p){return f==="^"?l===0&&!p.negative:f==="-"?!0:/[\]\\]/.test(f)}u(n,"preservesInCharClass"),o(n,"preservesInCharClass");function i(f,l,p,v){return f==="{"?c(l,p):f==="}"?d(l,p):v&&/[ #]/.test(f)?!0:/[*[()+?^$./\\|]/.test(f)}u(i,"preservesEscape"),o(i,"preservesEscape");function a(f,l,p){for(var v=f,b=(p?v>=0:v<l.expressions.length)&&l.expressions[v];b&&b.type==="Char"&&b.kind==="simple"&&!b.escaped&&/\d/.test(b.value);)p?v--:v++,b=(p?v>=0:v<l.expressions.length)&&l.expressions[v];return Math.abs(f-v)}u(a,"consumeNumbers"),o(a,"consumeNumbers");function s(f,l){return f&&f.type==="Char"&&f.kind==="simple"&&!f.escaped&&f.value===l}u(s,"isSimpleChar"),o(s,"isSimpleChar");function c(f,l){if(f==null)return!1;var p=a(f+1,l),v=f+p+1,b=v<l.expressions.length&&l.expressions[v];if(p){if(s(b,"}"))return!0;if(s(b,","))return p=a(v+1,l),v=v+p+1,b=v<l.expressions.length&&l.expressions[v],s(b,"}")}return!1}u(c,"preservesOpeningCurlyBraceEscape"),o(c,"preservesOpeningCurlyBraceEscape");function d(f,l){if(f==null)return!1;var p=a(f-1,l,!0),v=f-p-1,b=v>=0&&l.expressions[v];return p&&s(b,"{")?!0:s(b,",")?(p=a(v-1,l,!0),v=v-p-1,b=v<l.expressions.length&&l.expressions[v],p&&s(b,"{")):!1}u(d,"preservesClosingCurlyBraceEscape"),o(d,"preservesClosingCurlyBraceEscape")}}),ak=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/char-class-classranges-merge-transform.js"(r,e){"use strict";e.exports={_hasIUFlags:!1,init:o(u(function(C){this._hasIUFlags=C.flags.includes("i")&&C.flags.includes("u")},"init"),"init"),CharacterClass:o(u(function(C){var B=C.node,T=B.expressions,M=[];T.forEach(function(L){i(L)&&M.push(L.value)}),T.sort(t);for(var O=0;O<T.length;O++){var E=T[O];if(s(E,M,this._hasIUFlags)||p(E,T[O-1])||v(E,T[O+1]))T.splice(O,1),O--;else{var P=g(E,O,T);T.splice(O-P+1,P),O-=P}}},"CharacterClass"),"CharacterClass")};function t(w,C){var B=n(w),T=n(C);if(B===T){if(w.type==="ClassRange"&&C.type!=="ClassRange")return-1;if(C.type==="ClassRange"&&w.type!=="ClassRange")return 1;if(w.type==="ClassRange"&&C.type==="ClassRange")return n(w.to)-n(C.to);if(i(w)&&i(C)||a(w)&&a(C))return w.value<C.value?-1:1}return B-T}u(t,"sortCharClass"),o(t,"sortCharClass");function n(w){return w.type==="Char"?w.value==="-"||w.kind==="control"?1/0:w.kind==="meta"&&isNaN(w.codePoint)?-1:w.codePoint:w.from.codePoint}u(n,"getSortValue"),o(n,"getSortValue");function i(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return w.type==="Char"&&w.kind==="meta"&&(C?w.value===C:/^\\[dws]$/i.test(w.value))}u(i,"isMeta"),o(i,"isMeta");function a(w){return w.type==="Char"&&w.kind==="control"}u(a,"isControl"),o(a,"isControl");function s(w,C,B){for(var T=0;T<C.length;T++)if(c(w,C[T],B))return!0;return!1}u(s,"fitsInMetas"),o(s,"fitsInMetas");function c(w,C,B){return w.type==="ClassRange"?c(w.from,C,B)&&c(w.to,C,B):C==="\\S"&&(i(w,"\\w")||i(w,"\\d"))||C==="\\D"&&(i(w,"\\W")||i(w,"\\s"))||C==="\\w"&&i(w,"\\d")||C==="\\W"&&i(w,"\\s")?!0:w.type!=="Char"||isNaN(w.codePoint)?!1:C==="\\s"?d(w):C==="\\S"?!d(w):C==="\\d"?f(w):C==="\\D"?!f(w):C==="\\w"?l(w,B):C==="\\W"?!l(w,B):!1}u(c,"fitsInMeta"),o(c,"fitsInMeta");function d(w){return w.codePoint===9||w.codePoint===10||w.codePoint===11||w.codePoint===12||w.codePoint===13||w.codePoint===32||w.codePoint===160||w.codePoint===5760||w.codePoint>=8192&&w.codePoint<=8202||w.codePoint===8232||w.codePoint===8233||w.codePoint===8239||w.codePoint===8287||w.codePoint===12288||w.codePoint===65279}u(d,"fitsInMetaS"),o(d,"fitsInMetaS");function f(w){return w.codePoint>=48&&w.codePoint<=57}u(f,"fitsInMetaD"),o(f,"fitsInMetaD");function l(w,C){return f(w)||w.codePoint>=65&&w.codePoint<=90||w.codePoint>=97&&w.codePoint<=122||w.value==="_"||C&&(w.codePoint===383||w.codePoint===8490)}u(l,"fitsInMetaW"),o(l,"fitsInMetaW");function p(w,C){if(C&&C.type==="ClassRange"){if(b(w,C))return!0;if(A(w)&&C.to.codePoint===w.codePoint-1)return C.to=w,!0;if(w.type==="ClassRange"&&w.from.codePoint<=C.to.codePoint+1&&w.to.codePoint>=C.from.codePoint-1)return w.from.codePoint<C.from.codePoint&&(C.from=w.from),w.to.codePoint>C.to.codePoint&&(C.to=w.to),!0}return!1}u(p,"combinesWithPrecedingClassRange"),o(p,"combinesWithPrecedingClassRange");function v(w,C){return C&&C.type==="ClassRange"&&A(w)&&C.from.codePoint===w.codePoint+1?(C.from=w,!0):!1}u(v,"combinesWithFollowingClassRange"),o(v,"combinesWithFollowingClassRange");function b(w,C){return w.type==="Char"&&isNaN(w.codePoint)?!1:w.type==="ClassRange"?b(w.from,C)&&b(w.to,C):w.codePoint>=C.from.codePoint&&w.codePoint<=C.to.codePoint}u(b,"fitsInClassRange"),o(b,"fitsInClassRange");function g(w,C,B){if(!A(w))return 0;for(var T=0;C>0;){var M=B[C],O=B[C-1];if(A(O)&&O.codePoint===M.codePoint-1)T++,C--;else break}return T>1?(B[C]={type:"ClassRange",from:B[C],to:w},T):0}u(g,"charCombinesWithPrecedingChars"),o(g,"charCombinesWithPrecedingChars");function A(w){return w&&w.type==="Char"&&!isNaN(w.codePoint)&&(l(w,!1)||w.kind==="unicode"||w.kind==="hex"||w.kind==="oct"||w.kind==="decimal")}u(A,"isMetaWCharOrCode"),o(A,"isMetaWCharOrCode")}}),ok=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/disjunction-remove-duplicates-transform.js"(r,e){"use strict";var t=Vg(),n=$g(),i=n.disjunctionToList,a=n.listToDisjunction;e.exports={Disjunction:o(u(function(c){var d=c.node,f={},l=i(d).filter(function(p){var v=p?t.getForNode(p).jsonEncode():"null";return f.hasOwnProperty(v)?!1:(f[v]=p,!0)});c.replace(a(l))},"Disjunction"),"Disjunction")}}}),sk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/group-single-chars-to-char-class.js"(r,e){"use strict";e.exports={Disjunction:o(u(function(a){var s=a.node,c=a.parent;if(t[c.type]){var d=new Map;if(!(!n(s,d)||!d.size)){var f={type:"CharacterClass",expressions:Array.from(d.keys()).sort().map(function(l){return d.get(l)})};t[c.type](a.getParent(),f)}}},"Disjunction"),"Disjunction")};var t={RegExp:o(u(function(a,s){var c=a.node;c.body=s},"RegExp2"),"RegExp"),Group:o(u(function(a,s){var c=a.node;c.capturing?c.expression=s:a.replace(s)},"Group"),"Group")};function n(i,a){if(!i)return!1;var s=i.type;if(s==="Disjunction"){var c=i.left,d=i.right;return n(c,a)&&n(d,a)}else if(s==="Char"){if(i.kind==="meta"&&i.symbol===".")return!1;var f=i.value;return a.set(f,i),!0}else if(s==="CharacterClass"&&!i.negative)return i.expressions.every(function(l){return n(l,a)});return!1}u(n,"shouldProcess"),o(n,"shouldProcess")}}),uk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/remove-empty-group-transform.js"(r,e){"use strict";e.exports={Group:o(u(function(n){var i=n.node,a=n.parent,s=n.getChild();i.capturing||s||(a.type==="Repetition"?n.getParent().replace(i):a.type!=="RegExp"&&n.remove())},"Group"),"Group")}}}),ck=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/ungroup-transform.js"(r,e){"use strict";function t(i){if(Array.isArray(i)){for(var a=0,s=Array(i.length);a<i.length;a++)s[a]=i[a];return s}else return Array.from(i)}u(t,"_toConsumableArray"),o(t,"_toConsumableArray"),e.exports={Group:o(u(function(a){var s=a.node,c=a.parent,d=a.getChild();if(!(s.capturing||!d)&&n(a)&&!(d.node.type==="Disjunction"&&c.type!=="RegExp")&&!(c.type==="Repetition"&&d.node.type!=="Char"&&d.node.type!=="CharacterClass"))if(d.node.type==="Alternative"){var f=a.getParent();f.node.type==="Alternative"&&f.replace({type:"Alternative",expressions:[].concat(t(c.expressions.slice(0,a.index)),t(d.node.expressions),t(c.expressions.slice(a.index+1)))})}else a.replace(d.node)},"Group"),"Group")};function n(i){var a=i.parent,s=i.index;if(a.type!=="Alternative")return!0;var c=a.expressions[s-1];return c==null?!0:!(c.type==="Backreference"&&c.kind==="number"||c.type==="Char"&&c.kind==="decimal")}u(n,"hasAppropriateSiblings"),o(n,"hasAppropriateSiblings")}}),dk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/combine-repeating-patterns-transform.js"(r,e){"use strict";function t(f){if(Array.isArray(f)){for(var l=0,p=Array(f.length);l<f.length;l++)p[l]=f[l];return p}else return Array.from(f)}u(t,"_toConsumableArray"),o(t,"_toConsumableArray");var n=Vg(),i=$g(),a=i.increaseQuantifierByOne;e.exports={Alternative:o(u(function(l){for(var p=l.node,v=1;v<p.expressions.length;){var b=l.getChild(v);if(v=Math.max(1,s(l,b,v)),v>=p.expressions.length||(b=l.getChild(v),v=Math.max(1,c(l,b,v)),v>=p.expressions.length))break;b=l.getChild(v),v=Math.max(1,d(l,b,v)),v++}},"Alternative"),"Alternative")};function s(f,l,p){for(var v=f.node,b=Math.ceil(p/2),g=0;g<b;){var A=p-2*g-1,w=void 0,C=void 0;if(g===0?(w=l,C=f.getChild(A)):(w=n.getForNode({type:"Alternative",expressions:[].concat(t(v.expressions.slice(p-g,p)),[l.node])}),C=n.getForNode({type:"Alternative",expressions:[].concat(t(v.expressions.slice(A,p-g)))})),w.hasEqualSource(C)){for(var B=0;B<2*g+1;B++)f.getChild(A).remove();return l.replace({type:"Repetition",expression:g===0&&w.node.type!=="Repetition"?w.node:{type:"Group",capturing:!1,expression:w.node},quantifier:{type:"Quantifier",kind:"Range",from:2,to:2,greedy:!0}}),A}g++}return p}u(s,"combineRepeatingPatternLeft"),o(s,"combineRepeatingPatternLeft");function c(f,l,p){for(var v=f.node,b=0;b<p;){var g=f.getChild(b);if(g.node.type==="Repetition"&&g.node.quantifier.greedy){var A=g.getChild(),w=void 0;if(A.node.type==="Group"&&!A.node.capturing&&(A=A.getChild()),b+1===p?(w=l,w.node.type==="Group"&&!w.node.capturing&&(w=w.getChild())):w=n.getForNode({type:"Alternative",expressions:[].concat(t(v.expressions.slice(b+1,p+1)))}),A.hasEqualSource(w)){for(var C=b;C<p;C++)f.getChild(b+1).remove();return a(g.node.quantifier),b}}b++}return p}u(c,"combineWithPreviousRepetition"),o(c,"combineWithPreviousRepetition");function d(f,l,p){var v=f.node;if(l.node.type==="Repetition"&&l.node.quantifier.greedy){var b=l.getChild(),g=void 0;b.node.type==="Group"&&!b.node.capturing&&(b=b.getChild());var A=void 0;if(b.node.type==="Alternative"?(A=b.node.expressions.length,g=n.getForNode({type:"Alternative",expressions:[].concat(t(v.expressions.slice(p-A,p)))})):(A=1,g=f.getChild(p-1),g.node.type==="Group"&&!g.node.capturing&&(g=g.getChild())),g.hasEqualSource(b)){for(var w=p-A;w<p;w++)f.getChild(p-A).remove();return a(l.node.quantifier),p-A}}return p}u(d,"combineRepetitionWithPrevious"),o(d,"combineRepetitionWithPrevious")}}),fk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/transforms/index.js"(r,e){"use strict";e.exports=new Map([["charSurrogatePairToSingleUnicode",GE()],["charCodeToSimpleChar",XE()],["charCaseInsensitiveLowerCaseTransform",ZE()],["charClassRemoveDuplicates",QE()],["quantifiersMerge",YE()],["quantifierRangeToSymbol",ek()],["charClassClassrangesToChars",tk()],["charClassToMeta",rk()],["charClassToSingleChar",nk()],["charEscapeUnescape",ik()],["charClassClassrangesMerge",ak()],["disjunctionRemoveDuplicates",ok()],["groupSingleCharsToCharClass",sk()],["removeEmptyGroup",uk()],["ungroup",ck()],["combineRepeatingPatterns",dk()]])}}),lk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/optimizer/index.js"(r,e){"use strict";var t=zE(),n=Up(),i=Ug(),a=fk();e.exports={optimize:o(u(function(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=d.whitelist,l=f===void 0?[]:f,p=d.blacklist,v=p===void 0?[]:p,b=l.length>0?l:Array.from(a.keys()),g=b.filter(function(B){return!v.includes(B)}),A=c;c instanceof RegExp&&(c=""+c),typeof c=="string"&&(A=n.parse(c));var w=new i.TransformResult(A),C=void 0;do C=w.toString(),A=t(w.getAST()),g.forEach(function(B){if(!a.has(B))throw new Error("Unknown optimization-transform: "+B+". Available transforms are: "+Array.from(a.keys()).join(", "));var T=a.get(B),M=i.transform(A,T);M.toString()!==w.toString()&&(M.toString().length<=w.toString().length?w=M:A=t(w.getAST()))});while(w.toString()!==C);return w},"optimize"),"optimize")}}}),$p=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/interpreter/finite-automaton/special-symbols.js"(r,e){"use strict";var t="\u03B5",n=t+"*";e.exports={EPSILON:t,EPSILON_CLOSURE:n}}}),Dw=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/interpreter/finite-automaton/nfa/nfa.js"(r,e){"use strict";var t=(function(){function l(p,v){var b=[],g=!0,A=!1,w=void 0;try{for(var C=p[Symbol.iterator](),B;!(g=(B=C.next()).done)&&(b.push(B.value),!(v&&b.length===v));g=!0);}catch(T){A=!0,w=T}finally{try{!g&&C.return&&C.return()}finally{if(A)throw w}}return b}return u(l,"sliceIterator"),o(l,"sliceIterator"),function(p,v){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return l(p,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),n=(function(){function l(p,v){for(var b=0;b<v.length;b++){var g=v[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return u(l,"defineProperties"),o(l,"defineProperties"),function(p,v,b){return v&&l(p.prototype,v),b&&l(p,b),p}})();function i(l){if(Array.isArray(l)){for(var p=0,v=Array(l.length);p<l.length;p++)v[p]=l[p];return v}else return Array.from(l)}u(i,"_toConsumableArray"),o(i,"_toConsumableArray");function a(l,p){if(!(l instanceof p))throw new TypeError("Cannot call a class as a function")}u(a,"_classCallCheck"),o(a,"_classCallCheck");var s=$p(),c=s.EPSILON,d=s.EPSILON_CLOSURE,f=(function(){function l(p,v){a(this,l),this.in=p,this.out=v}return u(l,"NFA2"),o(l,"NFA"),n(l,[{key:"matches",value:o(u(function(v){return this.in.matches(v)},"matches"),"matches")},{key:"getAlphabet",value:o(u(function(){if(!this._alphabet){this._alphabet=new Set;var v=this.getTransitionTable();for(var b in v){var g=v[b];for(var A in g)A!==d&&this._alphabet.add(A)}}return this._alphabet},"getAlphabet"),"getAlphabet")},{key:"getAcceptingStates",value:o(u(function(){return this._acceptingStates||this.getTransitionTable(),this._acceptingStates},"getAcceptingStates"),"getAcceptingStates")},{key:"getAcceptingStateNumbers",value:o(u(function(){if(!this._acceptingStateNumbers){this._acceptingStateNumbers=new Set;var v=!0,b=!1,g=void 0;try{for(var A=this.getAcceptingStates()[Symbol.iterator](),w;!(v=(w=A.next()).done);v=!0){var C=w.value;this._acceptingStateNumbers.add(C.number)}}catch(B){b=!0,g=B}finally{try{!v&&A.return&&A.return()}finally{if(b)throw g}}}return this._acceptingStateNumbers},"getAcceptingStateNumbers"),"getAcceptingStateNumbers")},{key:"getTransitionTable",value:o(u(function(){var v=this;if(!this._transitionTable){this._transitionTable={},this._acceptingStates=new Set;var b=new Set,g=new Set,A=o(u(function w(C){if(!b.has(C)){b.add(C),C.number=b.size,v._transitionTable[C.number]={},C.accepting&&v._acceptingStates.add(C);var B=C.getTransitions(),T=!0,M=!1,O=void 0;try{for(var E=B[Symbol.iterator](),P;!(T=(P=E.next()).done);T=!0){var L=P.value,V=t(L,2),Y=V[0],oe=V[1],be=[];g.add(Y);var Oe=!0,Pe=!1,Je=void 0;try{for(var Me=oe[Symbol.iterator](),Xe;!(Oe=(Xe=Me.next()).done);Oe=!0){var Ye=Xe.value;w(Ye),be.push(Ye.number)}}catch(ut){Pe=!0,Je=ut}finally{try{!Oe&&Me.return&&Me.return()}finally{if(Pe)throw Je}}v._transitionTable[C.number][Y]=be}}catch(ut){M=!0,O=ut}finally{try{!T&&E.return&&E.return()}finally{if(M)throw O}}}},"visitState2"),"visitState");A(this.in),b.forEach(function(w){delete v._transitionTable[w.number][c],v._transitionTable[w.number][d]=[].concat(i(w.getEpsilonClosure())).map(function(C){return C.number})})}return this._transitionTable},"getTransitionTable"),"getTransitionTable")}]),l})();e.exports=f}}),pk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/interpreter/finite-automaton/dfa/dfa-minimizer.js"(r,e){"use strict";var t=(function(){function l(p,v){var b=[],g=!0,A=!1,w=void 0;try{for(var C=p[Symbol.iterator](),B;!(g=(B=C.next()).done)&&(b.push(B.value),!(v&&b.length===v));g=!0);}catch(T){A=!0,w=T}finally{try{!g&&C.return&&C.return()}finally{if(A)throw w}}return b}return u(l,"sliceIterator"),o(l,"sliceIterator"),function(p,v){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return l(p,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})();function n(l){return Array.isArray(l)?l:Array.from(l)}u(n,"_toArray"),o(n,"_toArray");function i(l){if(Array.isArray(l)){for(var p=0,v=Array(l.length);p<l.length;p++)v[p]=l[p];return v}else return Array.from(l)}u(i,"_toConsumableArray"),o(i,"_toConsumableArray");var a=null;function s(l){var p=l.getTransitionTable(),v=Object.keys(p),b=l.getAlphabet(),g=l.getAcceptingStateNumbers();a={};var A=new Set;v.forEach(function(N){N=Number(N);var F=g.has(N);F?a[N]=g:(A.add(N),a[N]=A)});var w=[[A,g].filter(function(N){return N.size>0})],C=void 0,B=void 0;C=w[w.length-1],B=w[w.length-2];for(var T=o(u(function(){var F={},re=!0,Q=!1,Se=void 0;try{for(var xe=C[Symbol.iterator](),tt;!(re=(tt=xe.next()).done);re=!0){var Te=tt.value,at={},$t=n(Te),qt=$t[0],Wr=$t.slice(1);at[qt]=new Set([qt]);var Pr=!0,Ir=!1,vn=void 0;try{e:for(var Jr=Wr[Symbol.iterator](),Gt;!(Pr=(Gt=Jr.next()).done);Pr=!0){var Ht=Gt.value,Xn=!0,Jd=!1,yn=void 0;try{for(var x=Object.keys(at)[Symbol.iterator](),I;!(Xn=(I=x.next()).done);Xn=!0){var R=I.value;if(d(Ht,R,p,b)){at[R].add(Ht),at[Ht]=at[R];continue e}}}catch(G){Jd=!0,yn=G}finally{try{!Xn&&x.return&&x.return()}finally{if(Jd)throw yn}}at[Ht]=new Set([Ht])}}catch(G){Ir=!0,vn=G}finally{try{!Pr&&Jr.return&&Jr.return()}finally{if(Ir)throw vn}}Object.assign(F,at)}}catch(G){Q=!0,Se=G}finally{try{!re&&xe.return&&xe.return()}finally{if(Q)throw Se}}a=F;var q=new Set(Object.keys(F).map(function(G){return F[G]}));w.push([].concat(i(q))),C=w[w.length-1],B=w[w.length-2]},"_loop2"),"_loop");!c(C,B);)T();var M=new Map,O=1;C.forEach(function(N){return M.set(N,O++)});var E={},P=new Set,L=o(u(function(F,re){var Q=!0,Se=!1,xe=void 0;try{for(var tt=F[Symbol.iterator](),Te;!(Q=(Te=tt.next()).done);Q=!0){var at=Te.value;g.has(at)&&P.add(re)}}catch($t){Se=!0,xe=$t}finally{try{!Q&&tt.return&&tt.return()}finally{if(Se)throw xe}}},"updateAcceptingStates2"),"updateAcceptingStates"),V=!0,Y=!1,oe=void 0;try{for(var be=M.entries()[Symbol.iterator](),Oe;!(V=(Oe=be.next()).done);V=!0){var Pe=Oe.value,Je=t(Pe,2),Me=Je[0],Xe=Je[1];E[Xe]={};var Ye=!0,ut=!1,Ze=void 0;try{for(var Ot=b[Symbol.iterator](),me;!(Ye=(me=Ot.next()).done);Ye=!0){var ee=me.value;L(Me,Xe);var et=void 0,Bt=!0,Ee=!1,S=void 0;try{for(var _=Me[Symbol.iterator](),U;!(Bt=(U=_.next()).done);Bt=!0){var j=U.value;if(et=p[j][ee],et)break}}catch(N){Ee=!0,S=N}finally{try{!Bt&&_.return&&_.return()}finally{if(Ee)throw S}}et&&(E[Xe][ee]=M.get(a[et]))}}catch(N){ut=!0,Ze=N}finally{try{!Ye&&Ot.return&&Ot.return()}finally{if(ut)throw Ze}}}}catch(N){Y=!0,oe=N}finally{try{!V&&be.return&&be.return()}finally{if(Y)throw oe}}return l.setTransitionTable(E),l.setAcceptingStateNumbers(P),l}u(s,"minimize"),o(s,"minimize");function c(l,p){if(!p||l.length!==p.length)return!1;for(var v=0;v<l.length;v++){var b=l[v],g=p[v];if(b.size!==g.size||[].concat(i(b)).sort().join(",")!==[].concat(i(g)).sort().join(","))return!1}return!0}u(c,"sameRow"),o(c,"sameRow");function d(l,p,v,b){var g=!0,A=!1,w=void 0;try{for(var C=b[Symbol.iterator](),B;!(g=(B=C.next()).done);g=!0){var T=B.value;if(!f(l,p,v,T))return!1}}catch(M){A=!0,w=M}finally{try{!g&&C.return&&C.return()}finally{if(A)throw w}}return!0}u(d,"areEquivalent"),o(d,"areEquivalent");function f(l,p,v,b){if(!a[l]||!a[p])return!1;var g=v[l][b],A=v[p][b];return!g&&!A?!0:a[l].has(g)&&a[p].has(A)}u(f,"goToSameSet"),o(f,"goToSameSet"),e.exports={minimize:s}}}),hk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/interpreter/finite-automaton/dfa/dfa.js"(r,e){"use strict";var t=(function(){function f(l,p){for(var v=0;v<p.length;v++){var b=p[v];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(l,b.key,b)}}return u(f,"defineProperties"),o(f,"defineProperties"),function(l,p,v){return p&&f(l.prototype,p),v&&f(l,v),l}})();function n(f){if(Array.isArray(f)){for(var l=0,p=Array(f.length);l<f.length;l++)p[l]=f[l];return p}else return Array.from(f)}u(n,"_toConsumableArray"),o(n,"_toConsumableArray");function i(f,l){if(!(f instanceof l))throw new TypeError("Cannot call a class as a function")}u(i,"_classCallCheck"),o(i,"_classCallCheck");var a=pk(),s=$p(),c=s.EPSILON_CLOSURE,d=(function(){function f(l){i(this,f),this._nfa=l}return u(f,"DFA2"),o(f,"DFA"),t(f,[{key:"minimize",value:o(u(function(){this.getTransitionTable(),this._originalAcceptingStateNumbers=this._acceptingStateNumbers,this._originalTransitionTable=this._transitionTable,a.minimize(this)},"minimize"),"minimize")},{key:"getAlphabet",value:o(u(function(){return this._nfa.getAlphabet()},"getAlphabet"),"getAlphabet")},{key:"getAcceptingStateNumbers",value:o(u(function(){return this._acceptingStateNumbers||this.getTransitionTable(),this._acceptingStateNumbers},"getAcceptingStateNumbers"),"getAcceptingStateNumbers")},{key:"getOriginaAcceptingStateNumbers",value:o(u(function(){return this._originalAcceptingStateNumbers||this.getTransitionTable(),this._originalAcceptingStateNumbers},"getOriginaAcceptingStateNumbers"),"getOriginaAcceptingStateNumbers")},{key:"setTransitionTable",value:o(u(function(p){this._transitionTable=p},"setTransitionTable"),"setTransitionTable")},{key:"setAcceptingStateNumbers",value:o(u(function(p){this._acceptingStateNumbers=p},"setAcceptingStateNumbers"),"setAcceptingStateNumbers")},{key:"getTransitionTable",value:o(u(function(){var p=this;if(this._transitionTable)return this._transitionTable;var v=this._nfa.getTransitionTable(),b=Object.keys(v);this._acceptingStateNumbers=new Set;for(var g=v[b[0]][c],A=[g],w=this.getAlphabet(),C=this._nfa.getAcceptingStateNumbers(),B={},T=o(u(function(j){var N=!0,F=!1,re=void 0;try{for(var Q=C[Symbol.iterator](),Se;!(N=(Se=Q.next()).done);N=!0){var xe=Se.value;if(j.indexOf(xe)!==-1){p._acceptingStateNumbers.add(j.join(","));break}}}catch(tt){F=!0,re=tt}finally{try{!N&&Q.return&&Q.return()}finally{if(F)throw re}}},"updateAcceptingStates2"),"updateAcceptingStates");A.length>0;){var M=A.shift(),O=M.join(",");B[O]={};var E=!0,P=!1,L=void 0;try{for(var V=w[Symbol.iterator](),Y;!(E=(Y=V.next()).done);E=!0){var oe=Y.value,be=[];T(M);var Oe=!0,Pe=!1,Je=void 0;try{for(var Me=M[Symbol.iterator](),Xe;!(Oe=(Xe=Me.next()).done);Oe=!0){var Ye=Xe.value,ut=v[Ye][oe];if(ut){var Ze=!0,Ot=!1,me=void 0;try{for(var ee=ut[Symbol.iterator](),et;!(Ze=(et=ee.next()).done);Ze=!0){var Bt=et.value;v[Bt]&&be.push.apply(be,n(v[Bt][c]))}}catch(U){Ot=!0,me=U}finally{try{!Ze&&ee.return&&ee.return()}finally{if(Ot)throw me}}}}}catch(U){Pe=!0,Je=U}finally{try{!Oe&&Me.return&&Me.return()}finally{if(Pe)throw Je}}var Ee=new Set(be),S=[].concat(n(Ee));if(S.length>0){var _=S.join(",");B[O][oe]=_,B.hasOwnProperty(_)||A.unshift(S)}}}catch(U){P=!0,L=U}finally{try{!E&&V.return&&V.return()}finally{if(P)throw L}}}return this._transitionTable=this._remapStateNumbers(B)},"getTransitionTable"),"getTransitionTable")},{key:"_remapStateNumbers",value:o(u(function(p){var v={};this._originalTransitionTable=p;var b={};Object.keys(p).forEach(function(L,V){v[L]=V+1});for(var g in p){var A=p[g],w={};for(var C in A)w[C]=v[A[C]];b[v[g]]=w}this._originalAcceptingStateNumbers=this._acceptingStateNumbers,this._acceptingStateNumbers=new Set;var B=!0,T=!1,M=void 0;try{for(var O=this._originalAcceptingStateNumbers[Symbol.iterator](),E;!(B=(E=O.next()).done);B=!0){var P=E.value;this._acceptingStateNumbers.add(v[P])}}catch(L){T=!0,M=L}finally{try{!B&&O.return&&O.return()}finally{if(T)throw M}}return b},"_remapStateNumbers"),"_remapStateNumbers")},{key:"getOriginalTransitionTable",value:o(u(function(){return this._originalTransitionTable||this.getTransitionTable(),this._originalTransitionTable},"getOriginalTransitionTable"),"getOriginalTransitionTable")},{key:"matches",value:o(u(function(p){for(var v=1,b=0,g=this.getTransitionTable();p[b];)if(v=g[v][p[b++]],!v)return!1;return!!this.getAcceptingStateNumbers().has(v)},"matches"),"matches")}]),f})();e.exports=d}}),vk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/interpreter/finite-automaton/state.js"(r,e){"use strict";var t=(function(){function a(s,c){for(var d=0;d<c.length;d++){var f=c[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(s,f.key,f)}}return u(a,"defineProperties"),o(a,"defineProperties"),function(s,c,d){return c&&a(s.prototype,c),d&&a(s,d),s}})();function n(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}u(n,"_classCallCheck"),o(n,"_classCallCheck");var i=(function(){function a(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=s.accepting,d=c===void 0?!1:c;n(this,a),this._transitions=new Map,this.accepting=d}return u(a,"State2"),o(a,"State"),t(a,[{key:"getTransitions",value:o(u(function(){return this._transitions},"getTransitions"),"getTransitions")},{key:"addTransition",value:o(u(function(c,d){return this.getTransitionsOnSymbol(c).add(d),this},"addTransition"),"addTransition")},{key:"getTransitionsOnSymbol",value:o(u(function(c){var d=this._transitions.get(c);return d||(d=new Set,this._transitions.set(c,d)),d},"getTransitionsOnSymbol"),"getTransitionsOnSymbol")}]),a})();e.exports=i}}),yk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/interpreter/finite-automaton/nfa/nfa-state.js"(r,e){"use strict";var t=(function(){function l(p,v){for(var b=0;b<v.length;b++){var g=v[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return u(l,"defineProperties"),o(l,"defineProperties"),function(p,v,b){return v&&l(p.prototype,v),b&&l(p,b),p}})();function n(l,p){if(!(l instanceof p))throw new TypeError("Cannot call a class as a function")}u(n,"_classCallCheck"),o(n,"_classCallCheck");function i(l,p){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:l}u(i,"_possibleConstructorReturn"),o(i,"_possibleConstructorReturn");function a(l,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);l.prototype=Object.create(p&&p.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(l,p):l.__proto__=p)}u(a,"_inherits"),o(a,"_inherits");var s=vk(),c=$p(),d=c.EPSILON,f=(function(l){a(p,l);function p(){return n(this,p),i(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return u(p,"NFAState2"),o(p,"NFAState"),t(p,[{key:"matches",value:o(u(function(b){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;if(g.has(this))return!1;if(g.add(this),b.length===0){if(this.accepting)return!0;var A=!0,w=!1,C=void 0;try{for(var B=this.getTransitionsOnSymbol(d)[Symbol.iterator](),T;!(A=(T=B.next()).done);A=!0){var M=T.value;if(M.matches("",g))return!0}}catch(Ze){w=!0,C=Ze}finally{try{!A&&B.return&&B.return()}finally{if(w)throw C}}return!1}var O=b[0],E=b.slice(1),P=this.getTransitionsOnSymbol(O),L=!0,V=!1,Y=void 0;try{for(var oe=P[Symbol.iterator](),be;!(L=(be=oe.next()).done);L=!0){var Oe=be.value;if(Oe.matches(E))return!0}}catch(Ze){V=!0,Y=Ze}finally{try{!L&&oe.return&&oe.return()}finally{if(V)throw Y}}var Pe=!0,Je=!1,Me=void 0;try{for(var Xe=this.getTransitionsOnSymbol(d)[Symbol.iterator](),Ye;!(Pe=(Ye=Xe.next()).done);Pe=!0){var ut=Ye.value;if(ut.matches(b,g))return!0}}catch(Ze){Je=!0,Me=Ze}finally{try{!Pe&&Xe.return&&Xe.return()}finally{if(Je)throw Me}}return!1},"matches"),"matches")},{key:"getEpsilonClosure",value:o(u(function(){var b=this;return this._epsilonClosure||(function(){var g=b.getTransitionsOnSymbol(d),A=b._epsilonClosure=new Set;A.add(b);var w=!0,C=!1,B=void 0;try{for(var T=g[Symbol.iterator](),M;!(w=(M=T.next()).done);w=!0){var O=M.value;if(!A.has(O)){A.add(O);var E=O.getEpsilonClosure();E.forEach(function(P){return A.add(P)})}}}catch(P){C=!0,B=P}finally{try{!w&&T.return&&T.return()}finally{if(C)throw B}}})(),this._epsilonClosure},"getEpsilonClosure"),"getEpsilonClosure")}]),p})(s);e.exports=f}}),Mw=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/interpreter/finite-automaton/nfa/builders.js"(r,e){"use strict";var t=Dw(),n=yk(),i=$p(),a=i.EPSILON;function s(w){var C=new n,B=new n({accepting:!0});return new t(C.addTransition(w,B),B)}u(s,"char"),o(s,"char");function c(){return s(a)}u(c,"e"),o(c,"e");function d(w,C){return w.out.accepting=!1,C.out.accepting=!0,w.out.addTransition(a,C.in),new t(w.in,C.out)}u(d,"altPair"),o(d,"altPair");function f(w){for(var C=arguments.length,B=Array(C>1?C-1:0),T=1;T<C;T++)B[T-1]=arguments[T];var M=!0,O=!1,E=void 0;try{for(var P=B[Symbol.iterator](),L;!(M=(L=P.next()).done);M=!0){var V=L.value;w=d(w,V)}}catch(Y){O=!0,E=Y}finally{try{!M&&P.return&&P.return()}finally{if(O)throw E}}return w}u(f,"alt"),o(f,"alt");function l(w,C){var B=new n,T=new n;return B.addTransition(a,w.in),B.addTransition(a,C.in),T.accepting=!0,w.out.accepting=!1,C.out.accepting=!1,w.out.addTransition(a,T),C.out.addTransition(a,T),new t(B,T)}u(l,"orPair"),o(l,"orPair");function p(w){for(var C=arguments.length,B=Array(C>1?C-1:0),T=1;T<C;T++)B[T-1]=arguments[T];var M=!0,O=!1,E=void 0;try{for(var P=B[Symbol.iterator](),L;!(M=(L=P.next()).done);M=!0){var V=L.value;w=l(w,V)}}catch(Y){O=!0,E=Y}finally{try{!M&&P.return&&P.return()}finally{if(O)throw E}}return w}u(p,"or"),o(p,"or");function v(w){var C=new n,B=new n({accepting:!0});return C.addTransition(a,w.in),C.addTransition(a,B),w.out.accepting=!1,w.out.addTransition(a,B),B.addTransition(a,w.in),new t(C,B)}u(v,"repExplicit"),o(v,"repExplicit");function b(w){return w.in.addTransition(a,w.out),w.out.addTransition(a,w.in),w}u(b,"rep"),o(b,"rep");function g(w){return w.out.addTransition(a,w.in),w}u(g,"plusRep"),o(g,"plusRep");function A(w){return w.in.addTransition(a,w.out),w}u(A,"questionRep"),o(A,"questionRep"),e.exports={alt:f,char:s,e:c,or:p,rep:b,repExplicit:v,plusRep:g,questionRep:A}}}),gk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/interpreter/finite-automaton/nfa/nfa-from-regexp.js"(r,e){"use strict";function t(b){if(Array.isArray(b)){for(var g=0,A=Array(b.length);g<b.length;g++)A[g]=b[g];return A}else return Array.from(b)}u(t,"_toConsumableArray"),o(t,"_toConsumableArray");var n=Up(),i=Mw(),a=i.alt,s=i.char,c=i.or,d=i.rep,f=i.plusRep,l=i.questionRep;function p(b){if(b&&!v[b.type])throw new Error(b.type+" is not supported in NFA/DFA interpreter.");return b?v[b.type](b):""}u(p,"gen"),o(p,"gen");var v={RegExp:o(u(function(g){if(g.flags!=="")throw new Error("NFA/DFA: Flags are not supported yet.");return p(g.body)},"RegExp2"),"RegExp"),Alternative:o(u(function(g){var A=(g.expressions||[]).map(p);return a.apply(void 0,t(A))},"Alternative"),"Alternative"),Disjunction:o(u(function(g){return c(p(g.left),p(g.right))},"Disjunction"),"Disjunction"),Repetition:o(u(function(g){switch(g.quantifier.kind){case"*":return d(p(g.expression));case"+":return f(p(g.expression));case"?":return l(p(g.expression));default:throw new Error("Unknown repeatition: "+g.quantifier.kind+".")}},"Repetition"),"Repetition"),Char:o(u(function(g){if(g.kind!=="simple")throw new Error("NFA/DFA: Only simple chars are supported yet.");return s(g.value)},"Char"),"Char"),Group:o(u(function(g){return p(g.expression)},"Group"),"Group")};e.exports={build:o(u(function(g){var A=g;return g instanceof RegExp&&(g=""+g),typeof g=="string"&&(A=n.parse(g,{captureLocations:!0})),p(A)},"build"),"build")}}}),mk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/interpreter/finite-automaton/index.js"(r,e){"use strict";var t=Dw(),n=hk(),i=gk(),a=Mw();e.exports={NFA:t,DFA:n,builders:a,toNFA:o(u(function(c){return i.build(c)},"toNFA"),"toNFA"),toDFA:o(u(function(c){return new n(this.toNFA(c))},"toDFA"),"toDFA"),test:o(u(function(c,d){return this.toDFA(c).matches(d)},"test"),"test")}}}),bk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/compat-transpiler/runtime/index.js"(r,e){"use strict";var t=(function(){function a(s,c){for(var d=0;d<c.length;d++){var f=c[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(s,f.key,f)}}return u(a,"defineProperties"),o(a,"defineProperties"),function(s,c,d){return c&&a(s.prototype,c),d&&a(s,d),s}})();function n(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}u(n,"_classCallCheck"),o(n,"_classCallCheck");var i=(function(){function a(s,c){var d=c.flags,f=c.groups,l=c.source;n(this,a),this._re=s,this._groups=f,this.flags=d,this.source=l||s.source,this.dotAll=d.includes("s"),this.global=s.global,this.ignoreCase=s.ignoreCase,this.multiline=s.multiline,this.sticky=s.sticky,this.unicode=s.unicode}return u(a,"RegExpTree2"),o(a,"RegExpTree"),t(a,[{key:"test",value:o(u(function(c){return this._re.test(c)},"test"),"test")},{key:"compile",value:o(u(function(c){return this._re.compile(c)},"compile"),"compile")},{key:"toString",value:o(u(function(){return this._toStringResult||(this._toStringResult="/"+this.source+"/"+this.flags),this._toStringResult},"toString"),"toString")},{key:"exec",value:o(u(function(c){var d=this._re.exec(c);if(!this._groups||!d)return d;d.groups={};for(var f in this._groups){var l=this._groups[f];d.groups[f]=d[l]}return d},"exec"),"exec")}]),a})();e.exports={RegExpTree:i}}}),wk=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/dist/regexp-tree.js"(r,e){"use strict";var t=JE(),n=jw(),i=lk(),a=Up(),s=Ug(),c=Lw(),d=mk(),f=bk(),l=f.RegExpTree,p={parser:a,fa:d,TransformResult:s.TransformResult,parse:o(u(function(b,g){return a.parse(""+b,g)},"parse4"),"parse"),traverse:o(u(function(b,g,A){return c.traverse(b,g,A)},"traverse"),"traverse"),transform:o(u(function(b,g){return s.transform(b,g)},"transform2"),"transform"),generate:o(u(function(b){return n.generate(b)},"generate"),"generate"),toRegExp:o(u(function(b){var g=this.compatTranspile(b);return new RegExp(g.getSource(),g.getFlags())},"toRegExp"),"toRegExp"),optimize:o(u(function(b,g){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=A.blacklist;return i.optimize(b,{whitelist:g,blacklist:w})},"optimize"),"optimize"),compatTranspile:o(u(function(b,g){return t.transform(b,g)},"compatTranspile"),"compatTranspile"),exec:o(u(function(b,g){if(typeof b=="string"){var A=this.compatTranspile(b),w=A.getExtra();w.namedCapturingGroups?b=new l(A.toRegExp(),{flags:A.getFlags(),source:A.getSource(),groups:w.namedCapturingGroups}):b=A.toRegExp()}return b.exec(g)},"exec"),"exec")};e.exports=p}}),_k=se({"../../../node_modules/.pnpm/regexp-tree@0.1.27/node_modules/regexp-tree/index.js"(r,e){"use strict";e.exports=wk()}}),Sk=se({"../../../node_modules/.pnpm/safe-regex@2.1.1/node_modules/safe-regex/lib/heuristic-analyzer.js"(r,e){"use strict";var s;var t=_k(),n=Rw(),i=(s=class extends n.Analyzer{constructor(d){super(d)}isVulnerable(d){return this._measureStarHeight(d)>1||this._measureRepetitions(d)>this.options.heuristic_replimit}genAttackString(d){return null}_measureStarHeight(d){let f=0,l=0,p=t.parse(d);return t.traverse(p,{Repetition:{pre({node:v}){f++,l<f&&(l=f)},post({node:v}){f--}}}),l}_measureRepetitions(d){let f=0,l=t.parse(d);return t.traverse(l,{Repetition:{pre({node:p}){f++}}}),f}},u(s,"_HeuristicAnalyzer"),s);o(i,"HeuristicAnalyzer");var a=i;e.exports=a}}),Ak=se({"../../../node_modules/.pnpm/safe-regex@2.1.1/node_modules/safe-regex/lib/analyzer-family.js"(r,e){"use strict";var t=Sk();e.exports=[t]}}),Ck=se({"../../../node_modules/.pnpm/safe-regex@2.1.1/node_modules/safe-regex/index.js"(r,e){"use strict";var v;var t=Rw(),n=Ak(),i=25,a=!0,s=!1,c=(v=class{constructor(g,A){this.regExp=g,this.analyzerOptions=A}},u(v,"_Args"),v);o(c,"Args");var d=c;function f(b,g){try{let A=l(b,g);return p(A).find(C=>C)?s:a}catch{return!1}}u(f,"safeRegex2"),o(f,"safeRegex");function l(b,g){g||(g={});let A=g.limit===void 0?i:g.limit,w=new t.AnalyzerOptions(A),C=null;return b instanceof RegExp?C=b:typeof b=="string"?C=new RegExp(b):C=new RegExp(String(b)),new d(C,w)}u(l,"buildArgs"),o(l,"buildArgs");function p(b){let g=[],A;for(A of n)try{let w=new A(b.analyzerOptions);g.push(w.isVulnerable(b.regExp))}catch{g.push(!1)}return g}u(p,"askAnalyzersIfVulnerable"),o(p,"askAnalyzersIfVulnerable"),e.exports=f}}),Jl="urn:ietf:params:oauth:grant-type:pre-authorized_code";var fi,Vw=(fi=class extends Error{constructor(e,t){super(t),this.name="CredentialOfferParseError",this.code=e}},u(fi,"_CredentialOfferParseError"),fi);o(Vw,"CredentialOfferParseError");var Ge=Vw,Nr=o(r=>typeof r=="string"&&r.length>0,"isNonEmptyString"),Uw=o(r=>{if(!r||typeof r!="object"||Array.isArray(r))throw new Ge("invalid_json","Credential offer must be a JSON object");let e=r;if(!Nr(e.credential_issuer))throw new Ge("missing_issuer","Credential offer is missing `credential_issuer`");let t=e.credential_issuer;if(Array.isArray(e.credential_configuration_ids)){let n=e.credential_configuration_ids.filter(Nr);if(n.length===0)throw new Ge("missing_credentials","Credential offer `credential_configuration_ids` is empty");return{credential_issuer:t,credential_configuration_ids:n,grants:N1(e.grants)}}if(Array.isArray(e.credentials)){let i=e.credentials.map(a=>{if(typeof a=="string")return a;if(typeof a=="object"&&a!==null){let s=a;if(Nr(s.id))return s.id;if(Array.isArray(s.types)&&s.types.length>0&&Nr(s.types[0]))return s.types[0]}return null}).filter(Nr);if(i.length===0)throw new Ge("missing_credentials","Credential offer `credentials` array did not contain any resolvable identifiers");return{credential_issuer:t,credential_configuration_ids:i,grants:N1(e.grants,{legacy:!0})}}throw new Ge("missing_credentials","Credential offer must include `credential_configuration_ids` (Draft 13) or `credentials` (Draft 11)")},"normalizeCredentialOffer"),N1=o((r,e={})=>{if(r==null)return;if(typeof r!="object"||Array.isArray(r))throw new Ge("invalid_grants","`grants` must be a JSON object");let t=r,n={},i=t[Jl];if(i&&typeof i=="object"&&!Array.isArray(i)){let s=i,c=s["pre-authorized_code"];if(!Nr(c))throw new Ge("invalid_grants","Pre-authorized code grant is missing `pre-authorized_code`");let d={"pre-authorized_code":c,interval:typeof s.interval=="number"?s.interval:void 0,authorization_server:Nr(s.authorization_server)?s.authorization_server:void 0};s.tx_code&&typeof s.tx_code=="object"&&!Array.isArray(s.tx_code)?d.tx_code=s.tx_code:e.legacy&&s.user_pin_required===!0&&(d.tx_code={}),n[Jl]=d}let a=t.authorization_code;if(a&&typeof a=="object"&&!Array.isArray(a)){let s=a;n.authorization_code={issuer_state:Nr(s.issuer_state)?s.issuer_state:void 0,authorization_server:Nr(s.authorization_server)?s.authorization_server:void 0}}if(Object.keys(n).length!==0)return n},"normalizeGrants"),T1=o(r=>{if(typeof r!="string"||r.trim().length===0)throw new Ge("invalid_uri","Offer URI must be a non-empty string");let e=kk(r.trim()),t=e.get("credential_offer"),n=e.get("credential_offer_uri");if(t&&n)throw new Ge("both_offer_and_uri","Credential offer URI must contain exactly one of `credential_offer` or `credential_offer_uri`, not both");if(n){if(!$w(n))throw new Ge("invalid_uri","`credential_offer_uri` must be an absolute https:// URL");return{kind:"by_reference",uri:n}}if(t){let i;try{i=JSON.parse(t)}catch{throw new Ge("invalid_json","`credential_offer` value is not valid JSON")}return{kind:"by_value",offer:Uw(i)}}throw new Ge("missing_offer","Credential offer URI must contain `credential_offer` or `credential_offer_uri`")},"parseCredentialOfferUri"),Ek=o(async(r,e=globalThis.fetch)=>{if(typeof e!="function")throw new Ge("invalid_uri","No fetch implementation available to resolve credential_offer_uri");if(!$w(r))throw new Ge("invalid_uri","credential_offer_uri must be an absolute https:// URL");let t;try{t=await e(r,{method:"GET"})}catch(i){throw new Ge("invalid_uri",`Failed to fetch credential_offer_uri: ${i instanceof Error?i.message:String(i)}`)}if(!t.ok)throw new Ge("invalid_uri",`credential_offer_uri returned ${t.status} ${t.statusText}`);let n;try{n=await t.json()}catch{throw new Ge("invalid_json","credential_offer_uri response was not valid JSON")}return{kind:"by_value",offer:Uw(n)}},"resolveCredentialOfferByReference"),kk=o(r=>{let e=r.indexOf("?");if(e!==-1)return new URLSearchParams(r.slice(e+1));if(r.includes("://")||/^[a-z][a-z0-9+.-]*:/i.test(r))throw new Ge("invalid_uri","Offer URI has no query string");if(r.includes("="))return new URLSearchParams(r);throw new Ge("invalid_uri","Offer URI has no query string")},"extractSearchParams"),$w=o(r=>{try{return new URL(r).protocol==="https:"}catch{return!1}},"isHttpsUrl"),li,qw=(li=class extends Error{constructor(e,t,n={}){super(t),this.name="VciError",this.code=e,this.status=n.status,this.body=n.body,n.cause!==void 0&&(this.cause=n.cause)}},u(li,"_VciError"),li);o(qw,"VciError");var ie=qw,xk="/.well-known/openid-credential-issuer",Pk="/.well-known/oauth-authorization-server",Ik="/.well-known/openid-configuration",Hw=o(async(r,e=globalThis.fetch)=>{if(typeof e!="function")throw new ie("metadata_fetch_failed","No fetch implementation available for issuer metadata");let t=ty(r,xk),n=await Nk(t,e,"metadata_fetch_failed");if(!Ww(n))throw new ie("metadata_invalid","Issuer metadata response was not a JSON object",{body:n});if(typeof n.credential_issuer!="string"||n.credential_issuer.length===0)throw new ie("metadata_invalid","Issuer metadata is missing `credential_issuer`",{body:n});if(typeof n.credential_endpoint!="string"||n.credential_endpoint.length===0)throw new ie("metadata_invalid","Issuer metadata is missing `credential_endpoint`",{body:n});if(!Ok(n.credential_issuer,r))throw new ie("metadata_issuer_mismatch",`Issuer metadata advertises \`credential_issuer\` as ${n.credential_issuer} but was fetched for ${r}`,{body:n});return n},"fetchCredentialIssuerMetadata"),Fw=o(async(r,e=globalThis.fetch)=>{if(typeof e!="function")throw new ie("metadata_fetch_failed","No fetch implementation available for authorization-server metadata");let t=ty(r,Pk),n=o(async a=>{let s;try{s=await e(a,{method:"GET"})}catch{return null}if(!s.ok)return null;try{return await s.json()}catch{return null}},"tryUrl"),i=await n(t);if(i==null){let a=ty(r,Ik);i=await n(a)}if(i==null)throw new ie("metadata_fetch_failed",`Authorization server metadata not reachable at ${t} or the OIDC fallback`);if(!Ww(i))throw new ie("metadata_invalid","Authorization server metadata was not a JSON object",{body:i});if(typeof i.token_endpoint!="string"||i.token_endpoint.length===0)throw new ie("metadata_invalid","Authorization server metadata is missing `token_endpoint`",{body:i});return i},"fetchAuthorizationServerMetadata"),Kw=o((r,e)=>e&&e.length>0?e:Array.isArray(r.authorization_servers)&&r.authorization_servers.length>0&&typeof r.authorization_servers[0]=="string"?r.authorization_servers[0]:r.credential_issuer,"resolveAuthorizationServer"),ty=o((r,e)=>{let t=r.length;for(;t>0&&r.charCodeAt(t-1)===47;)t--;return`${r.slice(0,t)}${e}`},"joinWellKnown"),Ok=o((r,e)=>R1(r)===R1(e),"originsMatch"),R1=o(r=>{let e=r.length;for(;e>0&&r.charCodeAt(e-1)===47;)e--;let t=r.slice(0,e),n=t.indexOf("://");if(n<=0)return t;let i=t.slice(0,n);return Bk(i)?`${i.toLowerCase()}${t.slice(n)}`:t},"normalizeIssuerId"),Bk=o(r=>{if(r.length===0)return!1;for(let e=0;e<r.length;e++){let t=r.charCodeAt(e),n=t>=65&&t<=90,i=t>=97&&t<=122;if(!n&&!i)return!1}return!0},"isAsciiAlpha"),Ww=o(r=>typeof r=="object"&&r!==null&&!Array.isArray(r),"isObject"),Nk=o(async(r,e,t)=>{let n;try{n=await e(r,{method:"GET"})}catch(i){throw new ie(t,`Failed to fetch ${r}: ${i instanceof Error?i.message:String(i)}`,{cause:i})}if(!n.ok)throw new ie(t,`Fetch of ${r} returned ${n.status} ${n.statusText}`,{status:n.status});try{return await n.json()}catch(i){throw new ie(t,`Response from ${r} was not valid JSON`,{cause:i})}},"getJson"),Tk=o(async r=>{let{tokenEndpoint:e,preAuthorizedCode:t,txCode:n,clientId:i}=r,a=r.fetchImpl??globalThis.fetch;if(typeof a!="function")throw new ie("token_request_failed","No fetch implementation available for token exchange");let s=new URLSearchParams;s.set("grant_type",Jl),s.set("pre-authorized_code",t),typeof n=="string"&&n.length>0&&s.set("tx_code",n),typeof i=="string"&&i.length>0&&s.set("client_id",i);let c;try{c=await a(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:s.toString()})}catch(f){throw new ie("token_request_failed",`Token endpoint ${e} unreachable: ${f instanceof Error?f.message:String(f)}`,{cause:f})}let d;try{d=await c.json()}catch(f){throw new ie("token_response_invalid",`Token endpoint ${e} returned non-JSON body`,{status:c.status,cause:f})}if(!c.ok){let f=d,l=typeof f?.error=="string"?f.error:"unknown",p=typeof f?.error_description=="string"?`: ${f.error_description}`:"";throw new ie("token_request_failed",`Token endpoint returned ${c.status} (${l})${p}`,{status:c.status,body:d})}if(!Rk(d))throw new ie("token_response_invalid","Token endpoint response is missing required `access_token` / `token_type`",{status:c.status,body:d});return d},"exchangePreAuthorizedCode"),Rk=o(r=>{if(typeof r!="object"||r===null)return!1;let e=r;return typeof e.access_token=="string"&&e.access_token.length>0&&typeof e.token_type=="string"&&e.token_type.length>0},"isTokenResponse"),Be=crypto,ar=o(r=>r instanceof CryptoKey,"isCryptoKey"),jk=o(async(r,e)=>{let t=`SHA-${r.slice(-3)}`;return new Uint8Array(await Be.subtle.digest(t,e))},"digest"),Lk=jk,yt=new TextEncoder,Dr=new TextDecoder,zl=2**32;function dn(...r){let e=r.reduce((i,{length:a})=>i+a,0),t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}u(dn,"concat");o(dn,"concat");function Jw(r,e){return dn(yt.encode(r),new Uint8Array([0]),e)}u(Jw,"p2s");o(Jw,"p2s");function Gl(r,e,t){if(e<0||e>=zl)throw new RangeError(`value must be >= 0 and <= ${zl-1}. Received ${e}`);r.set([e>>>24,e>>>16,e>>>8,e&255],t)}u(Gl,"writeUInt32BE");o(Gl,"writeUInt32BE");function zw(r){let e=Math.floor(r/zl),t=r%zl,n=new Uint8Array(8);return Gl(n,e,0),Gl(n,t,4),n}u(zw,"uint64be");o(zw,"uint64be");function qp(r){let e=new Uint8Array(4);return Gl(e,r),e}u(qp,"uint32be");o(qp,"uint32be");function Ul(r){return dn(qp(r.length),r)}u(Ul,"lengthAndInput");o(Ul,"lengthAndInput");async function Gw(r,e,t){let n=Math.ceil((e>>3)/32),i=new Uint8Array(n*32);for(let a=0;a<n;a++){let s=new Uint8Array(4+r.length+t.length);s.set(qp(a+1)),s.set(r,4),s.set(t,4+r.length),i.set(await Lk("sha256",s),a*32)}return i.slice(0,e>>3)}u(Gw,"concatKdf");o(Gw,"concatKdf");var Xw=o(r=>{let e=r;typeof e=="string"&&(e=yt.encode(e));let t=32768,n=[];for(let i=0;i<e.length;i+=t)n.push(String.fromCharCode.apply(null,e.subarray(i,i+t)));return btoa(n.join(""))},"encodeBase64"),wt=o(r=>Xw(r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),"encode"),Zw=o(r=>{let e=atob(r),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},"decodeBase64"),Yr=o(r=>{let e=r;e instanceof Uint8Array&&(e=Dr.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return Zw(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}},"decode"),pi,Qw=(pi=class extends Error{constructor(e,t){super(e,t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},u(pi,"_JOSEError"),pi);o(Qw,"JOSEError");var _t=Qw;_t.code="ERR_JOSE_GENERIC";var hi,Yw=(hi=class extends _t{constructor(e,t,n="unspecified",i="unspecified"){super(e,{cause:{claim:n,reason:i,payload:t}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=n,this.reason=i,this.payload=t}},u(hi,"_JWTClaimValidationFailed"),hi);o(Yw,"JWTClaimValidationFailed");var Zt=Yw;Zt.code="ERR_JWT_CLAIM_VALIDATION_FAILED";var vi,e2=(vi=class extends _t{constructor(e,t,n="unspecified",i="unspecified"){super(e,{cause:{claim:n,reason:i,payload:t}}),this.code="ERR_JWT_EXPIRED",this.claim=n,this.reason=i,this.payload=t}},u(vi,"_JWTExpired"),vi);o(e2,"JWTExpired");var ry=e2;ry.code="ERR_JWT_EXPIRED";var yi,t2=(yi=class extends _t{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}},u(yi,"_JOSEAlgNotAllowed"),yi);o(t2,"JOSEAlgNotAllowed");var r2=t2;r2.code="ERR_JOSE_ALG_NOT_ALLOWED";var gi,n2=(gi=class extends _t{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}},u(gi,"_JOSENotSupported"),gi);o(n2,"JOSENotSupported");var ot=n2;ot.code="ERR_JOSE_NOT_SUPPORTED";var mi,i2=(mi=class extends _t{constructor(e="decryption operation failed",t){super(e,t),this.code="ERR_JWE_DECRYPTION_FAILED"}},u(mi,"_JWEDecryptionFailed"),mi);o(i2,"JWEDecryptionFailed");var Dk=i2;Dk.code="ERR_JWE_DECRYPTION_FAILED";var bi,a2=(bi=class extends _t{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}},u(bi,"_JWEInvalid"),bi);o(a2,"JWEInvalid");var Tr=a2;Tr.code="ERR_JWE_INVALID";var wi,o2=(wi=class extends _t{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}},u(wi,"_JWSInvalid"),wi);o(o2,"JWSInvalid");var $e=o2;$e.code="ERR_JWS_INVALID";var _i,s2=(_i=class extends _t{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}},u(_i,"_JWTInvalid"),_i);o(s2,"JWTInvalid");var er=s2;er.code="ERR_JWT_INVALID";var Si,u2=(Si=class extends _t{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}},u(Si,"_JWKInvalid"),Si);o(u2,"JWKInvalid");var Mk=u2;Mk.code="ERR_JWK_INVALID";var Ai,c2=(Ai=class extends _t{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}},u(Ai,"_JWKSInvalid"),Ai);o(c2,"JWKSInvalid");var Vk=c2;Vk.code="ERR_JWKS_INVALID";var Ci,d2=(Ci=class extends _t{constructor(e="no applicable key found in the JSON Web Key Set",t){super(e,t),this.code="ERR_JWKS_NO_MATCHING_KEY"}},u(Ci,"_JWKSNoMatchingKey"),Ci);o(d2,"JWKSNoMatchingKey");var Uk=d2;Uk.code="ERR_JWKS_NO_MATCHING_KEY";var Ei,f2=(Ei=class extends _t{constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}},u(Ei,"_JWKSMultipleMatchingKeys"),Ei);o(f2,"JWKSMultipleMatchingKeys");var $k=f2;$k.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";var ki,l2=(ki=class extends _t{constructor(e="request timed out",t){super(e,t),this.code="ERR_JWKS_TIMEOUT"}},u(ki,"_JWKSTimeout"),ki);o(l2,"JWKSTimeout");var qk=l2;qk.code="ERR_JWKS_TIMEOUT";var xi,p2=(xi=class extends _t{constructor(e="signature verification failed",t){super(e,t),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}},u(xi,"_JWSSignatureVerificationFailed"),xi);o(p2,"JWSSignatureVerificationFailed");var h2=p2;h2.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";var qg=Be.getRandomValues.bind(Be);function Hg(r){switch(r){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new ot(`Unsupported JWE Algorithm: ${r}`)}}u(Hg,"bitLength");o(Hg,"bitLength");var Hk=o(r=>qg(new Uint8Array(Hg(r)>>3)),"default"),Fk=o((r,e)=>{if(e.length<<3!==Hg(r))throw new Tr("Invalid Initialization Vector length")},"checkIvLength"),Kk=Fk,Wk=o((r,e)=>{let t=r.byteLength<<3;if(t!==e)throw new Tr(`Invalid Content Encryption Key length. Expected ${e} bits, got ${t} bits`)},"checkCekLength"),j1=Wk;function rt(r,e="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${r}`)}u(rt,"unusable");o(rt,"unusable");function pr(r,e){return r.name===e}u(pr,"isAlgorithm");o(pr,"isAlgorithm");function Sf(r){return parseInt(r.name.slice(4),10)}u(Sf,"getHashLength");o(Sf,"getHashLength");function v2(r){switch(r){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}u(v2,"getNamedCurve");o(v2,"getNamedCurve");function Fg(r,e){if(e.length&&!e.some(t=>r.usages.includes(t))){let t="CryptoKey does not support this operation, its usages must include ";if(e.length>2){let n=e.pop();t+=`one of ${e.join(", ")}, or ${n}.`}else e.length===2?t+=`one of ${e[0]} or ${e[1]}.`:t+=`${e[0]}.`;throw new TypeError(t)}}u(Fg,"checkUsage");o(Fg,"checkUsage");function y2(r,e,...t){switch(e){case"HS256":case"HS384":case"HS512":{if(!pr(r.algorithm,"HMAC"))throw rt("HMAC");let n=parseInt(e.slice(2),10);if(Sf(r.algorithm.hash)!==n)throw rt(`SHA-${n}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!pr(r.algorithm,"RSASSA-PKCS1-v1_5"))throw rt("RSASSA-PKCS1-v1_5");let n=parseInt(e.slice(2),10);if(Sf(r.algorithm.hash)!==n)throw rt(`SHA-${n}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!pr(r.algorithm,"RSA-PSS"))throw rt("RSA-PSS");let n=parseInt(e.slice(2),10);if(Sf(r.algorithm.hash)!==n)throw rt(`SHA-${n}`,"algorithm.hash");break}case"EdDSA":{if(r.algorithm.name!=="Ed25519"&&r.algorithm.name!=="Ed448")throw rt("Ed25519 or Ed448");break}case"Ed25519":{if(!pr(r.algorithm,"Ed25519"))throw rt("Ed25519");break}case"ES256":case"ES384":case"ES512":{if(!pr(r.algorithm,"ECDSA"))throw rt("ECDSA");let n=v2(e);if(r.algorithm.namedCurve!==n)throw rt(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}Fg(r,t)}u(y2,"checkSigCryptoKey");o(y2,"checkSigCryptoKey");function On(r,e,...t){switch(e){case"A128GCM":case"A192GCM":case"A256GCM":{if(!pr(r.algorithm,"AES-GCM"))throw rt("AES-GCM");let n=parseInt(e.slice(1,4),10);if(r.algorithm.length!==n)throw rt(n,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!pr(r.algorithm,"AES-KW"))throw rt("AES-KW");let n=parseInt(e.slice(1,4),10);if(r.algorithm.length!==n)throw rt(n,"algorithm.length");break}case"ECDH":{switch(r.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw rt("ECDH, X25519, or X448")}break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!pr(r.algorithm,"PBKDF2"))throw rt("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!pr(r.algorithm,"RSA-OAEP"))throw rt("RSA-OAEP");let n=parseInt(e.slice(9),10)||1;if(Sf(r.algorithm.hash)!==n)throw rt(`SHA-${n}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}Fg(r,t)}u(On,"checkEncCryptoKey");o(On,"checkEncCryptoKey");function Kg(r,e,...t){if(t=t.filter(Boolean),t.length>2){let n=t.pop();r+=`one of type ${t.join(", ")}, or ${n}.`}else t.length===2?r+=`one of type ${t[0]} or ${t[1]}.`:r+=`of type ${t[0]}.`;return e==null?r+=` Received ${e}`:typeof e=="function"&&e.name?r+=` Received function ${e.name}`:typeof e=="object"&&e!=null&&e.constructor?.name&&(r+=` Received an instance of ${e.constructor.name}`),r}u(Kg,"message");o(Kg,"message");var Wt=o((r,...e)=>Kg("Key must be ",r,...e),"default");function Wg(r,e,...t){return Kg(`Key for the ${r} algorithm must be `,e,...t)}u(Wg,"withAlg");o(Wg,"withAlg");var g2=o(r=>ar(r)?!0:r?.[Symbol.toStringTag]==="KeyObject","default"),Lt=["CryptoKey"],Jk=o((...r)=>{let e=r.filter(Boolean);if(e.length===0||e.length===1)return!0;let t;for(let n of e){let i=Object.keys(n);if(!t||t.size===0){t=new Set(i);continue}for(let a of i){if(t.has(a))return!1;t.add(a)}}return!0},"isDisjoint"),Jg=Jk;function m2(r){return typeof r=="object"&&r!==null}u(m2,"isObjectLike");o(m2,"isObjectLike");function Mr(r){if(!m2(r)||Object.prototype.toString.call(r)!=="[object Object]")return!1;if(Object.getPrototypeOf(r)===null)return!0;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}u(Mr,"isObject2");o(Mr,"isObject");var zk=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]],b2=zk;function w2(r,e){if(r.algorithm.length!==parseInt(e.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${e}`)}u(w2,"checkKeySize");o(w2,"checkKeySize");function _2(r,e,t){if(ar(r))return On(r,e,t),r;if(r instanceof Uint8Array)return Be.subtle.importKey("raw",r,"AES-KW",!0,[t]);throw new TypeError(Wt(r,...Lt,"Uint8Array"))}u(_2,"getCryptoKey");o(_2,"getCryptoKey");var ny=o(async(r,e,t)=>{let n=await _2(e,r,"wrapKey");w2(n,r);let i=await Be.subtle.importKey("raw",t,...b2);return new Uint8Array(await Be.subtle.wrapKey("raw",i,n,"AES-KW"))},"wrap");async function S2(r,e,t,n,i=new Uint8Array(0),a=new Uint8Array(0)){if(!ar(r))throw new TypeError(Wt(r,...Lt));if(On(r,"ECDH"),!ar(e))throw new TypeError(Wt(e,...Lt));On(e,"ECDH","deriveBits");let s=dn(Ul(yt.encode(t)),Ul(i),Ul(a),qp(n)),c;r.algorithm.name==="X25519"?c=256:r.algorithm.name==="X448"?c=448:c=Math.ceil(parseInt(r.algorithm.namedCurve.substr(-3),10)/8)<<3;let d=new Uint8Array(await Be.subtle.deriveBits({name:r.algorithm.name,public:r},e,c));return Gw(d,n,s)}u(S2,"deriveKey");o(S2,"deriveKey");async function A2(r){if(!ar(r))throw new TypeError(Wt(r,...Lt));return Be.subtle.generateKey(r.algorithm,!0,["deriveBits"])}u(A2,"generateEpk");o(A2,"generateEpk");function C2(r){if(!ar(r))throw new TypeError(Wt(r,...Lt));return["P-256","P-384","P-521"].includes(r.algorithm.namedCurve)||r.algorithm.name==="X25519"||r.algorithm.name==="X448"}u(C2,"ecdhAllowed");o(C2,"ecdhAllowed");function E2(r){if(!(r instanceof Uint8Array)||r.length<8)throw new Tr("PBES2 Salt Input must be 8 or more octets")}u(E2,"checkP2s");o(E2,"checkP2s");function k2(r,e){if(r instanceof Uint8Array)return Be.subtle.importKey("raw",r,"PBKDF2",!1,["deriveBits"]);if(ar(r))return On(r,e,"deriveBits","deriveKey"),r;throw new TypeError(Wt(r,...Lt,"Uint8Array"))}u(k2,"getCryptoKey2");o(k2,"getCryptoKey");async function x2(r,e,t,n){E2(r);let i=Jw(e,r),a=parseInt(e.slice(13,16),10),s={hash:`SHA-${e.slice(8,11)}`,iterations:t,name:"PBKDF2",salt:i},c={length:a,name:"AES-KW"},d=await k2(n,e);if(d.usages.includes("deriveBits"))return new Uint8Array(await Be.subtle.deriveBits(s,d,a));if(d.usages.includes("deriveKey"))return Be.subtle.deriveKey(s,d,c,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}u(x2,"deriveKey2");o(x2,"deriveKey");var Gk=o(async(r,e,t,n=2048,i=qg(new Uint8Array(16)))=>{let a=await x2(i,r,n,e);return{encryptedKey:await ny(r.slice(-6),a,t),p2c:n,p2s:wt(i)}},"encrypt");function iy(r){switch(r){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new ot(`alg ${r} is not supported either by JOSE or your javascript runtime`)}}u(iy,"subtleRsaEs");o(iy,"subtleRsaEs");var zg=o((r,e)=>{if(r.startsWith("RS")||r.startsWith("PS")){let{modulusLength:t}=e.algorithm;if(typeof t!="number"||t<2048)throw new TypeError(`${r} requires key modulusLength to be 2048 bits or larger`)}},"default"),Xk=o(async(r,e,t)=>{if(!ar(e))throw new TypeError(Wt(e,...Lt));if(On(e,r,"encrypt","wrapKey"),zg(r,e),e.usages.includes("encrypt"))return new Uint8Array(await Be.subtle.encrypt(iy(r),e,t));if(e.usages.includes("wrapKey")){let n=await Be.subtle.importKey("raw",t,...b2);return new Uint8Array(await Be.subtle.wrapKey("raw",n,e,iy(r)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},"encrypt");function qn(r){return Mr(r)&&typeof r.kty=="string"}u(qn,"isJWK");o(qn,"isJWK");function P2(r){return r.kty!=="oct"&&typeof r.d=="string"}u(P2,"isPrivateJWK");o(P2,"isPrivateJWK");function I2(r){return r.kty!=="oct"&&typeof r.d>"u"}u(I2,"isPublicJWK");o(I2,"isPublicJWK");function O2(r){return qn(r)&&r.kty==="oct"&&typeof r.k=="string"}u(O2,"isSecretJWK");o(O2,"isSecretJWK");function B2(r){let e,t;switch(r.kty){case"RSA":{switch(r.alg){case"PS256":case"PS384":case"PS512":e={name:"RSA-PSS",hash:`SHA-${r.alg.slice(-3)}`},t=r.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":e={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${r.alg.slice(-3)}`},t=r.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":e={name:"RSA-OAEP",hash:`SHA-${parseInt(r.alg.slice(-3),10)||1}`},t=r.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new ot('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(r.alg){case"ES256":e={name:"ECDSA",namedCurve:"P-256"},t=r.d?["sign"]:["verify"];break;case"ES384":e={name:"ECDSA",namedCurve:"P-384"},t=r.d?["sign"]:["verify"];break;case"ES512":e={name:"ECDSA",namedCurve:"P-521"},t=r.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:"ECDH",namedCurve:r.crv},t=r.d?["deriveBits"]:[];break;default:throw new ot('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(r.alg){case"Ed25519":e={name:"Ed25519"},t=r.d?["sign"]:["verify"];break;case"EdDSA":e={name:r.crv},t=r.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:r.crv},t=r.d?["deriveBits"]:[];break;default:throw new ot('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new ot('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:t}}u(B2,"subtleMapping");o(B2,"subtleMapping");var Zk=o(async r=>{if(!r.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:e,keyUsages:t}=B2(r),n=[e,r.ext??!1,r.key_ops??t],i={...r};return delete i.alg,delete i.use,Be.subtle.importKey("jwk",i,...n)},"parse"),N2=Zk,T2=o(r=>Yr(r),"exportKeyValue"),Qn,Yn,R2=o(r=>r?.[Symbol.toStringTag]==="KeyObject","isKeyObject"),Xl=o(async(r,e,t,n,i=!1)=>{let a=r.get(e);if(a?.[n])return a[n];let s=await N2({...t,alg:n});return i&&Object.freeze(e),a?a[n]=s:r.set(e,{[n]:s}),s},"importAndCache"),Qk=o((r,e)=>{if(R2(r)){let t=r.export({format:"jwk"});return delete t.d,delete t.dp,delete t.dq,delete t.p,delete t.q,delete t.qi,t.k?T2(t.k):(Yn||(Yn=new WeakMap),Xl(Yn,r,t,e))}return qn(r)?r.k?Yr(r.k):(Yn||(Yn=new WeakMap),Xl(Yn,r,r,e,!0)):r},"normalizePublicKey"),Yk=o((r,e)=>{if(R2(r)){let t=r.export({format:"jwk"});return t.k?T2(t.k):(Qn||(Qn=new WeakMap),Xl(Qn,r,t,e))}return qn(r)?r.k?Yr(r.k):(Qn||(Qn=new WeakMap),Xl(Qn,r,r,e,!0)):r},"normalizePrivateKey"),ay={normalizePublicKey:Qk,normalizePrivateKey:Yk};function Gg(r){switch(r){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new ot(`Unsupported JWE Algorithm: ${r}`)}}u(Gg,"bitLength2");o(Gg,"bitLength");var Gd=o(r=>qg(new Uint8Array(Gg(r)>>3)),"default"),ex=o((r,e)=>{let t=(r.match(/.{1,64}/g)||[]).join(`
8
- `);return`-----BEGIN ${e}-----
9
- ${t}
10
- -----END ${e}-----`},"default"),zr=o((r,e,t=0)=>{t===0&&(e.unshift(e.length),e.unshift(6));let n=r.indexOf(e[0],t);if(n===-1)return!1;let i=r.subarray(n,n+e.length);return i.length!==e.length?!1:i.every((a,s)=>a===e[s])||zr(r,e,n+1)},"findOid"),L1=o(r=>{switch(!0){case zr(r,[42,134,72,206,61,3,1,7]):return"P-256";case zr(r,[43,129,4,0,34]):return"P-384";case zr(r,[43,129,4,0,35]):return"P-521";case zr(r,[43,101,110]):return"X25519";case zr(r,[43,101,111]):return"X448";case zr(r,[43,101,112]):return"Ed25519";case zr(r,[43,101,113]):return"Ed448";default:throw new ot("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},"getNamedCurve"),tx=o(async(r,e,t,n,i)=>{let a,s,c=new Uint8Array(atob(t.replace(r,"")).split("").map(f=>f.charCodeAt(0))),d=e==="spki";switch(n){case"PS256":case"PS384":case"PS512":a={name:"RSA-PSS",hash:`SHA-${n.slice(-3)}`},s=d?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":a={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${n.slice(-3)}`},s=d?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":a={name:"RSA-OAEP",hash:`SHA-${parseInt(n.slice(-3),10)||1}`},s=d?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":a={name:"ECDSA",namedCurve:"P-256"},s=d?["verify"]:["sign"];break;case"ES384":a={name:"ECDSA",namedCurve:"P-384"},s=d?["verify"]:["sign"];break;case"ES512":a={name:"ECDSA",namedCurve:"P-521"},s=d?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let f=L1(c);a=f.startsWith("P-")?{name:"ECDH",namedCurve:f}:{name:f},s=d?[]:["deriveBits"];break}case"Ed25519":a={name:"Ed25519"},s=d?["verify"]:["sign"];break;case"EdDSA":a={name:L1(c)},s=d?["verify"]:["sign"];break;default:throw new ot('Invalid or unsupported "alg" (Algorithm) value')}return Be.subtle.importKey(e,c,a,i?.extractable??!1,s)},"genericImport"),rx=o((r,e,t)=>tx(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",r,e,t),"fromSPKI");function oy(r){let e=[],t=0;for(;t<r.length;){let n=Xg(r.subarray(t));e.push(n),t+=n.byteLength}return e}u(oy,"getElement");o(oy,"getElement");function Xg(r){let e=0,t=r[0]&31;if(e++,t===31){for(t=0;r[e]>=128;)t=t*128+r[e]-128,e++;t=t*128+r[e]-128,e++}let n=0;if(r[e]<128)n=r[e],e++;else if(n===128){for(n=0;r[e+n]!==0||r[e+n+1]!==0;){if(n>r.byteLength)throw new TypeError("invalid indefinite form length");n++}let a=e+n+2;return{byteLength:a,contents:r.subarray(e,e+n),raw:r.subarray(0,a)}}else{let a=r[e]&127;e++,n=0;for(let s=0;s<a;s++)n=n*256+r[e],e++}let i=e+n;return{byteLength:i,contents:r.subarray(e,i),raw:r.subarray(0,i)}}u(Xg,"parseElement");o(Xg,"parseElement");function j2(r){let e=oy(oy(Xg(r).contents)[0].contents);return Xw(e[e[0].raw[0]===160?6:5].raw)}u(j2,"spkiFromX509");o(j2,"spkiFromX509");function L2(r){let e=r.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g,""),t=Zw(e);return ex(j2(t),"PUBLIC KEY")}u(L2,"getSPKI");o(L2,"getSPKI");var nx=o((r,e,t)=>{let n;try{n=L2(r)}catch(i){throw new TypeError("Failed to parse the X.509 certificate",{cause:i})}return rx(n,e,t)},"fromX509");async function Zg(r,e,t){if(typeof r!="string"||r.indexOf("-----BEGIN CERTIFICATE-----")!==0)throw new TypeError('"x509" must be X.509 formatted string');return nx(r,e,t)}u(Zg,"importX509");o(Zg,"importX509");async function rl(r,e){if(!Mr(r))throw new TypeError("JWK must be an object");switch(e||(e=r.alg),r.kty){case"oct":if(typeof r.k!="string"||!r.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Yr(r.k);case"RSA":if("oth"in r&&r.oth!==void 0)throw new ot('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return N2({...r,alg:e});default:throw new ot('Unsupported "kty" (Key Type) Parameter value')}}u(rl,"importJWK");o(rl,"importJWK");var ti=o(r=>r?.[Symbol.toStringTag],"tag"),sy=o((r,e,t)=>{if(e.use!==void 0&&e.use!=="sig")throw new TypeError("Invalid key for this operation, when present its use must be sig");if(e.key_ops!==void 0&&e.key_ops.includes?.(t)!==!0)throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${t}`);if(e.alg!==void 0&&e.alg!==r)throw new TypeError(`Invalid key for this operation, when present its alg must be ${r}`);return!0},"jwkMatchesOp"),ix=o((r,e,t,n)=>{if(!(e instanceof Uint8Array)){if(n&&qn(e)){if(O2(e)&&sy(r,e,t))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!g2(e))throw new TypeError(Wg(r,e,...Lt,"Uint8Array",n?"JSON Web Key":null));if(e.type!=="secret")throw new TypeError(`${ti(e)} instances for symmetric algorithms must be of type "secret"`)}},"symmetricTypeCheck"),ax=o((r,e,t,n)=>{if(n&&qn(e))switch(t){case"sign":if(P2(e)&&sy(r,e,t))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(I2(e)&&sy(r,e,t))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!g2(e))throw new TypeError(Wg(r,e,...Lt,n?"JSON Web Key":null));if(e.type==="secret")throw new TypeError(`${ti(e)} instances for asymmetric algorithms must not be of type "secret"`);if(t==="sign"&&e.type==="public")throw new TypeError(`${ti(e)} instances for asymmetric algorithm signing must be of type "private"`);if(t==="decrypt"&&e.type==="public")throw new TypeError(`${ti(e)} instances for asymmetric algorithm decryption must be of type "private"`);if(e.algorithm&&t==="verify"&&e.type==="private")throw new TypeError(`${ti(e)} instances for asymmetric algorithm verifying must be of type "public"`);if(e.algorithm&&t==="encrypt"&&e.type==="private")throw new TypeError(`${ti(e)} instances for asymmetric algorithm encryption must be of type "public"`)},"asymmetricTypeCheck");function Qg(r,e,t,n){e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?ix(e,t,n,r):ax(e,t,n,r)}u(Qg,"checkKeyType");o(Qg,"checkKeyType");var ox=Qg.bind(void 0,!1),uy=Qg.bind(void 0,!0);async function D2(r,e,t,n,i){if(!(t instanceof Uint8Array))throw new TypeError(Wt(t,"Uint8Array"));let a=parseInt(r.slice(1,4),10),s=await Be.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["encrypt"]),c=await Be.subtle.importKey("raw",t.subarray(0,a>>3),{hash:`SHA-${a<<1}`,name:"HMAC"},!1,["sign"]),d=new Uint8Array(await Be.subtle.encrypt({iv:n,name:"AES-CBC"},s,e)),f=dn(i,n,d,zw(i.length<<3)),l=new Uint8Array((await Be.subtle.sign("HMAC",c,f)).slice(0,a>>3));return{ciphertext:d,tag:l,iv:n}}u(D2,"cbcEncrypt");o(D2,"cbcEncrypt");async function M2(r,e,t,n,i){let a;t instanceof Uint8Array?a=await Be.subtle.importKey("raw",t,"AES-GCM",!1,["encrypt"]):(On(t,r,"encrypt"),a=t);let s=new Uint8Array(await Be.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},a,e)),c=s.slice(-16);return{ciphertext:s.slice(0,-16),tag:c,iv:n}}u(M2,"gcmEncrypt");o(M2,"gcmEncrypt");var sx=o(async(r,e,t,n,i)=>{if(!ar(t)&&!(t instanceof Uint8Array))throw new TypeError(Wt(t,...Lt,"Uint8Array"));switch(n?Kk(r,n):n=Hk(r),r){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&j1(t,parseInt(r.slice(-3),10)),D2(r,e,t,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&j1(t,parseInt(r.slice(1,4),10)),M2(r,e,t,n,i);default:throw new ot("Unsupported JWE Content Encryption Algorithm")}},"encrypt"),V2=sx;async function U2(r,e,t,n){let i=r.slice(0,7),a=await V2(i,t,e,n,new Uint8Array(0));return{encryptedKey:a.ciphertext,iv:wt(a.iv),tag:wt(a.tag)}}u(U2,"wrap2");o(U2,"wrap");function $2(r,e,t,n,i){if(i.crit!==void 0&&n?.crit===void 0)throw new r('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||n.crit===void 0)return new Set;if(!Array.isArray(n.crit)||n.crit.length===0||n.crit.some(s=>typeof s!="string"||s.length===0))throw new r('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a;t!==void 0?a=new Map([...Object.entries(t),...e.entries()]):a=e;for(let s of n.crit){if(!a.has(s))throw new ot(`Extension Header Parameter "${s}" is not recognized`);if(i[s]===void 0)throw new r(`Extension Header Parameter "${s}" is missing`);if(a.get(s)&&n[s]===void 0)throw new r(`Extension Header Parameter "${s}" MUST be integrity protected`)}return new Set(n.crit)}u($2,"validateCrit");o($2,"validateCrit");var Yg=$2,ux=o((r,e)=>{if(e!==void 0&&(!Array.isArray(e)||e.some(t=>typeof t!="string")))throw new TypeError(`"${r}" option must be an array of strings`);if(e)return new Set(e)},"validateAlgorithms"),cx=ux,dx=Symbol(),fx=o(async r=>{if(r instanceof Uint8Array)return{kty:"oct",k:wt(r)};if(!ar(r))throw new TypeError(Wt(r,...Lt,"Uint8Array"));if(!r.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:e,key_ops:t,alg:n,use:i,...a}=await Be.subtle.exportKey("jwk",r);return a},"keyToJWK"),lx=fx;async function q2(r){return lx(r)}u(q2,"exportJWK");o(q2,"exportJWK");async function H2(r,e,t,n,i={}){let a,s,c;switch(ox(r,t,"encrypt"),t=await ay.normalizePublicKey?.(t,r)||t,r){case"dir":{c=t;break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!C2(t))throw new ot("ECDH with the provided key is not allowed or not supported by your javascript runtime");let{apu:d,apv:f}=i,{epk:l}=i;l||(l=(await A2(t)).privateKey);let{x:p,y:v,crv:b,kty:g}=await q2(l),A=await S2(t,l,r==="ECDH-ES"?e:r,r==="ECDH-ES"?Gg(e):parseInt(r.slice(-5,-2),10),d,f);if(s={epk:{x:p,crv:b,kty:g}},g==="EC"&&(s.epk.y=v),d&&(s.apu=wt(d)),f&&(s.apv=wt(f)),r==="ECDH-ES"){c=A;break}c=n||Gd(e);let w=r.slice(-6);a=await ny(w,A,c);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{c=n||Gd(e),a=await Xk(r,t,c);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{c=n||Gd(e);let{p2c:d,p2s:f}=i;({encryptedKey:a,...s}=await Gk(r,t,c,d,f));break}case"A128KW":case"A192KW":case"A256KW":{c=n||Gd(e),a=await ny(r,t,c);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{c=n||Gd(e);let{iv:d}=i;({encryptedKey:a,...s}=await U2(r,t,c,d));break}default:throw new ot('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:c,encryptedKey:a,parameters:s}}u(H2,"encryptKeyManagement");o(H2,"encryptKeyManagement");var px=H2,Pi,F2=(Pi=class{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new Tr("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Jg(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new Tr("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");let n={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(Yg(Tr,new Map,t?.crit,this._protectedHeader,n),n.zip!==void 0)throw new ot('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg:i,enc:a}=n;if(typeof i!="string"||!i)throw new Tr('JWE "alg" (Algorithm) Header Parameter missing or invalid');if(typeof a!="string"||!a)throw new Tr('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let s;if(this._cek&&(i==="dir"||i==="ECDH-ES"))throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${i}`);let c;{let A;({cek:c,encryptedKey:s,parameters:A}=await px(i,a,e,this._cek,this._keyManagementParameters)),A&&(t&&dx in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...A}:this.setUnprotectedHeader(A):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...A}:this.setProtectedHeader(A))}let d,f,l;this._protectedHeader?f=yt.encode(wt(JSON.stringify(this._protectedHeader))):f=yt.encode(""),this._aad?(l=wt(this._aad),d=dn(f,yt.encode("."),yt.encode(l))):d=f;let{ciphertext:p,tag:v,iv:b}=await V2(a,this._plaintext,c,this._iv,d),g={ciphertext:wt(p)};return b&&(g.iv=wt(b)),v&&(g.tag=wt(v)),s&&(g.encrypted_key=wt(s)),l&&(g.aad=l),this._protectedHeader&&(g.protected=Dr.decode(f)),this._sharedUnprotectedHeader&&(g.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(g.header=this._unprotectedHeader),g}},u(Pi,"_FlattenedEncrypt"),Pi);o(F2,"FlattenedEncrypt");var hx=F2;function em(r,e){let t=`SHA-${r.slice(-3)}`;switch(r){case"HS256":case"HS384":case"HS512":return{hash:t,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:t,name:"RSA-PSS",saltLength:r.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:t,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:t,name:"ECDSA",namedCurve:e.namedCurve};case"Ed25519":return{name:"Ed25519"};case"EdDSA":return{name:e.name};default:throw new ot(`alg ${r} is not supported either by JOSE or your javascript runtime`)}}u(em,"subtleDsa");o(em,"subtleDsa");async function tm(r,e,t){if(t==="sign"&&(e=await ay.normalizePrivateKey(e,r)),t==="verify"&&(e=await ay.normalizePublicKey(e,r)),ar(e))return y2(e,r,t),e;if(e instanceof Uint8Array){if(!r.startsWith("HS"))throw new TypeError(Wt(e,...Lt));return Be.subtle.importKey("raw",e,{hash:`SHA-${r.slice(-3)}`,name:"HMAC"},!1,[t])}throw new TypeError(Wt(e,...Lt,"Uint8Array","JSON Web Key"))}u(tm,"getCryptoKey3");o(tm,"getCryptoKey");var vx=o(async(r,e,t,n)=>{let i=await tm(r,e,"verify");zg(r,i);let a=em(r,i.algorithm);try{return await Be.subtle.verify(a,i,t,n)}catch{return!1}},"verify"),yx=vx;async function K2(r,e,t){if(!Mr(r))throw new $e("Flattened JWS must be an object");if(r.protected===void 0&&r.header===void 0)throw new $e('Flattened JWS must have either of the "protected" or "header" members');if(r.protected!==void 0&&typeof r.protected!="string")throw new $e("JWS Protected Header incorrect type");if(r.payload===void 0)throw new $e("JWS Payload missing");if(typeof r.signature!="string")throw new $e("JWS Signature missing or incorrect type");if(r.header!==void 0&&!Mr(r.header))throw new $e("JWS Unprotected Header incorrect type");let n={};if(r.protected)try{let A=Yr(r.protected);n=JSON.parse(Dr.decode(A))}catch{throw new $e("JWS Protected Header is invalid")}if(!Jg(n,r.header))throw new $e("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let i={...n,...r.header},a=Yg($e,new Map([["b64",!0]]),t?.crit,n,i),s=!0;if(a.has("b64")&&(s=n.b64,typeof s!="boolean"))throw new $e('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:c}=i;if(typeof c!="string"||!c)throw new $e('JWS "alg" (Algorithm) Header Parameter missing or invalid');let d=t&&cx("algorithms",t.algorithms);if(d&&!d.has(c))throw new r2('"alg" (Algorithm) Header Parameter value not allowed');if(s){if(typeof r.payload!="string")throw new $e("JWS Payload must be a string")}else if(typeof r.payload!="string"&&!(r.payload instanceof Uint8Array))throw new $e("JWS Payload must be a string or an Uint8Array instance");let f=!1;typeof e=="function"?(e=await e(n,r),f=!0,uy(c,e,"verify"),qn(e)&&(e=await rl(e,c))):uy(c,e,"verify");let l=dn(yt.encode(r.protected??""),yt.encode("."),typeof r.payload=="string"?yt.encode(r.payload):r.payload),p;try{p=Yr(r.signature)}catch{throw new $e("Failed to base64url decode the signature")}if(!await yx(c,e,p,l))throw new h2;let b;if(s)try{b=Yr(r.payload)}catch{throw new $e("Failed to base64url decode the payload")}else typeof r.payload=="string"?b=yt.encode(r.payload):b=r.payload;let g={payload:b};return r.protected!==void 0&&(g.protectedHeader=n),r.header!==void 0&&(g.unprotectedHeader=r.header),f?{...g,key:e}:g}u(K2,"flattenedVerify");o(K2,"flattenedVerify");async function W2(r,e,t){if(r instanceof Uint8Array&&(r=Dr.decode(r)),typeof r!="string")throw new $e("Compact JWS must be a string or Uint8Array");let{0:n,1:i,2:a,length:s}=r.split(".");if(s!==3)throw new $e("Invalid Compact JWS");let c=await K2({payload:i,protected:n,signature:a},e,t),d={payload:c.payload,protectedHeader:c.protectedHeader};return typeof e=="function"?{...d,key:c.key}:d}u(W2,"compactVerify");o(W2,"compactVerify");var Gr=o(r=>Math.floor(r.getTime()/1e3),"default"),J2=60,z2=J2*60,rm=z2*24,gx=rm*7,mx=rm*365.25,bx=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Af=o(r=>{let e=bx.exec(r);if(!e||e[4]&&e[1])throw new TypeError("Invalid time period format");let t=parseFloat(e[2]),n=e[3].toLowerCase(),i;switch(n){case"sec":case"secs":case"second":case"seconds":case"s":i=Math.round(t);break;case"minute":case"minutes":case"min":case"mins":case"m":i=Math.round(t*J2);break;case"hour":case"hours":case"hr":case"hrs":case"h":i=Math.round(t*z2);break;case"day":case"days":case"d":i=Math.round(t*rm);break;case"week":case"weeks":case"w":i=Math.round(t*gx);break;default:i=Math.round(t*mx);break}return e[1]==="-"||e[4]==="ago"?-i:i},"default"),D1=o(r=>r.toLowerCase().replace(/^application\//,""),"normalizeTyp"),wx=o((r,e)=>typeof r=="string"?e.includes(r):Array.isArray(r)?e.some(Set.prototype.has.bind(new Set(r))):!1,"checkAudiencePresence"),_x=o((r,e,t={})=>{let n;try{n=JSON.parse(Dr.decode(e))}catch{}if(!Mr(n))throw new er("JWT Claims Set must be a top-level JSON object");let{typ:i}=t;if(i&&(typeof r.typ!="string"||D1(r.typ)!==D1(i)))throw new Zt('unexpected "typ" JWT header value',n,"typ","check_failed");let{requiredClaims:a=[],issuer:s,subject:c,audience:d,maxTokenAge:f}=t,l=[...a];f!==void 0&&l.push("iat"),d!==void 0&&l.push("aud"),c!==void 0&&l.push("sub"),s!==void 0&&l.push("iss");for(let g of new Set(l.reverse()))if(!(g in n))throw new Zt(`missing required "${g}" claim`,n,g,"missing");if(s&&!(Array.isArray(s)?s:[s]).includes(n.iss))throw new Zt('unexpected "iss" claim value',n,"iss","check_failed");if(c&&n.sub!==c)throw new Zt('unexpected "sub" claim value',n,"sub","check_failed");if(d&&!wx(n.aud,typeof d=="string"?[d]:d))throw new Zt('unexpected "aud" claim value',n,"aud","check_failed");let p;switch(typeof t.clockTolerance){case"string":p=Af(t.clockTolerance);break;case"number":p=t.clockTolerance;break;case"undefined":p=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate:v}=t,b=Gr(v||new Date);if((n.iat!==void 0||f)&&typeof n.iat!="number")throw new Zt('"iat" claim must be a number',n,"iat","invalid");if(n.nbf!==void 0){if(typeof n.nbf!="number")throw new Zt('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>b+p)throw new Zt('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(n.exp!==void 0){if(typeof n.exp!="number")throw new Zt('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=b-p)throw new ry('"exp" claim timestamp check failed',n,"exp","check_failed")}if(f){let g=b-n.iat,A=typeof f=="number"?f:Af(f);if(g-p>A)throw new ry('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(g<0-p)throw new Zt('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n},"default");async function Hp(r,e,t){let n=await W2(r,e,t);if(n.protectedHeader.crit?.includes("b64")&&n.protectedHeader.b64===!1)throw new er("JWTs MUST NOT use unencoded payload");let a={payload:_x(n.protectedHeader,n.payload,t),protectedHeader:n.protectedHeader};return typeof e=="function"?{...a,key:n.key}:a}u(Hp,"jwtVerify");o(Hp,"jwtVerify");var Ii,G2=(Ii=class{constructor(e){this._flattened=new hx(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){let n=await this._flattened.encrypt(e,t);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(".")}},u(Ii,"_CompactEncrypt"),Ii);o(G2,"CompactEncrypt");var Sx=G2,Ax=o(async(r,e,t)=>{let n=await tm(r,e,"sign");zg(r,n);let i=await Be.subtle.sign(em(r,n.algorithm),n,t);return new Uint8Array(i)},"sign"),Cx=Ax,Oi,X2=(Oi=class{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new $e("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Jg(this._protectedHeader,this._unprotectedHeader))throw new $e("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...this._protectedHeader,...this._unprotectedHeader},i=Yg($e,new Map([["b64",!0]]),t?.crit,this._protectedHeader,n),a=!0;if(i.has("b64")&&(a=this._protectedHeader.b64,typeof a!="boolean"))throw new $e('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new $e('JWS "alg" (Algorithm) Header Parameter missing or invalid');uy(s,e,"sign");let c=this._payload;a&&(c=yt.encode(wt(c)));let d;this._protectedHeader?d=yt.encode(wt(JSON.stringify(this._protectedHeader))):d=yt.encode("");let f=dn(d,yt.encode("."),c),l=await Cx(s,e,f),p={signature:wt(l),payload:""};return a&&(p.payload=Dr.decode(c)),this._unprotectedHeader&&(p.header=this._unprotectedHeader),this._protectedHeader&&(p.protected=Dr.decode(d)),p}},u(Oi,"_FlattenedSign"),Oi);o(X2,"FlattenedSign");var Ex=X2,Bi,Z2=(Bi=class{constructor(e){this._flattened=new Ex(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){let n=await this._flattened.sign(e,t);if(n.payload===void 0)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${n.protected}.${n.payload}.${n.signature}`}},u(Bi,"_CompactSign"),Bi);o(Z2,"CompactSign");var kx=Z2;function Xr(r,e){if(!Number.isFinite(e))throw new TypeError(`Invalid ${r} input`);return e}u(Xr,"validateInput");o(Xr,"validateInput");var Ni,Q2=(Ni=class{constructor(e={}){if(!Mr(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return typeof e=="number"?this._payload={...this._payload,nbf:Xr("setNotBefore",e)}:e instanceof Date?this._payload={...this._payload,nbf:Xr("setNotBefore",Gr(e))}:this._payload={...this._payload,nbf:Gr(new Date)+Af(e)},this}setExpirationTime(e){return typeof e=="number"?this._payload={...this._payload,exp:Xr("setExpirationTime",e)}:e instanceof Date?this._payload={...this._payload,exp:Xr("setExpirationTime",Gr(e))}:this._payload={...this._payload,exp:Gr(new Date)+Af(e)},this}setIssuedAt(e){return typeof e>"u"?this._payload={...this._payload,iat:Gr(new Date)}:e instanceof Date?this._payload={...this._payload,iat:Xr("setIssuedAt",Gr(e))}:typeof e=="string"?this._payload={...this._payload,iat:Xr("setIssuedAt",Gr(new Date)+Af(e))}:this._payload={...this._payload,iat:Xr("setIssuedAt",e)},this}},u(Ni,"_ProduceJWT"),Ni);o(Q2,"ProduceJWT");var xx=Q2,Ti,Y2=(Ti=class extends xx{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){let n=new kx(yt.encode(JSON.stringify(this._payload)));if(n.setProtectedHeader(this._protectedHeader),Array.isArray(this._protectedHeader?.crit)&&this._protectedHeader.crit.includes("b64")&&this._protectedHeader.b64===!1)throw new er("JWTs MUST NOT use unencoded payload");return n.sign(e,t)}},u(Ti,"_SignJWT"),Ti);o(Y2,"SignJWT");var Px=Y2,e_=Yr;function t_(r){let e;if(typeof r=="string"){let t=r.split(".");(t.length===3||t.length===5)&&([e]=t)}else if(typeof r=="object"&&r)if("protected"in r)e=r.protected;else throw new TypeError("Token does not contain a Protected Header");try{if(typeof e!="string"||!e)throw new Error;let t=JSON.parse(Dr.decode(e_(e)));if(!Mr(t))throw new Error;return t}catch{throw new TypeError("Invalid Token or Protected Header formatting")}}u(t_,"decodeProtectedHeader");o(t_,"decodeProtectedHeader");function r_(r){if(typeof r!="string")throw new er("JWTs must use Compact JWS serialization, JWT must be a string");let{1:e,length:t}=r.split(".");if(t===5)throw new er("Only JWTs using Compact JWS serialization can be decoded");if(t!==3)throw new er("Invalid JWT");if(!e)throw new er("JWTs must contain a payload");let n;try{n=e_(e)}catch{throw new er("Failed to base64url decode the payload")}let i;try{i=JSON.parse(Dr.decode(n))}catch{throw new er("Failed to parse the decoded payload as JSON")}if(!Mr(i))throw new er("Invalid JWT Claims Set");return i}u(r_,"decodeJwt");o(r_,"decodeJwt");var Ix="openid4vci-proof+jwt",n_=o(async r=>{let{signer:e,audience:t,nonce:n,clientId:i}=r,a=r.now??(()=>Math.floor(Date.now()/1e3));if(typeof t!="string"||t.length===0)throw new ie("proof_signing_failed","Proof JWT `audience` must be a non-empty string");let s={alg:e.alg,kid:e.kid,typ:Ix},c={aud:t,iat:a()};typeof n=="string"&&n.length>0&&(c.nonce=n),typeof i=="string"&&i.length>0&&(c.iss=i);try{return await e.sign(s,c)}catch(d){throw new ie("proof_signing_failed",`Failed to sign proof JWT: ${d instanceof Error?d.message:String(d)}`,{cause:d})}},"buildProofJwt"),i_=o(async r=>{let{keypair:e,kid:t}=r;if(e.kty!=="OKP"||e.crv!=="Ed25519")throw new ie("proof_signing_failed",`createJoseEd25519Signer only supports Ed25519 OKP keys (got kty=${e.kty}, crv=${e.crv})`);let n=await rl({kty:e.kty,crv:e.crv,x:e.x,d:e.d},"EdDSA");return{alg:"EdDSA",kid:t,sign:o(async(i,a)=>new Px(a).setProtectedHeader({...i,alg:"EdDSA"}).sign(n),"sign")}},"createJoseEd25519Signer"),a_=o(async r=>{let{credentialEndpoint:e,accessToken:t,tokenType:n="Bearer",credentialIdentifier:i,format:a,proofJwt:s,extra:c}=r,d=r.fetchImpl??globalThis.fetch;if(typeof d!="function")throw new ie("credential_request_failed","No fetch implementation available for credential request");let f=typeof i=="string"&&i.length>0,l=typeof a=="string"&&a.length>0;if(!f&&!l)throw new ie("credential_request_failed","requestCredential requires either `credentialIdentifier` (from authorization_details) or `format`");let p={proof:{proof_type:"jwt",jwt:s}};f?p.credential_identifier=i:(p.format=a,c&&Object.assign(p,c));let v;try{v=await d(e,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`${n} ${t}`},body:JSON.stringify(p)})}catch(g){throw new ie("credential_request_failed",`Credential endpoint ${e} unreachable: ${g instanceof Error?g.message:String(g)}`,{cause:g})}let b;try{b=await v.json()}catch(g){throw new ie("credential_response_invalid",`Credential endpoint ${e} returned non-JSON body`,{status:v.status,cause:g})}if(!v.ok){let g=b,A=typeof g?.error=="string"?g.error:"unknown",w=typeof g?.error_description=="string"?`: ${g.error_description}`:"";throw new ie("credential_request_failed",`Credential endpoint returned ${v.status} (${A})${w}`,{status:v.status,body:b})}if(typeof b!="object"||b===null)throw new ie("credential_response_invalid","Credential endpoint response was not a JSON object",{status:v.status,body:b});return b},"requestCredential"),M1=o(async r=>{let{offer:e,signer:t}=r,n=r.options??{},i=r.fetchImpl??globalThis.fetch,a=e.grants?.[Jl];if(!a)throw new ie("unsupported_grant","acceptCredentialOffer currently only handles the pre-authorized_code grant. For authorization_code flows, use slice-4 APIs (not yet shipped).");if(a.tx_code&&!n.txCode)throw new ie("tx_code_required","Offer requires a transaction code but none was supplied in options.txCode");let s=n.configurationIds&&n.configurationIds.length>0?n.configurationIds.filter(C=>e.credential_configuration_ids.includes(C)):e.credential_configuration_ids;if(s.length===0)throw new ie("unsupported_format","No credential configuration ids in the offer matched the caller-supplied filter");let c=await Hw(e.credential_issuer,i),d=Kw(c,a.authorization_server),f=await Fw(d,i),l=await Tk({tokenEndpoint:f.token_endpoint,preAuthorizedCode:a["pre-authorized_code"],txCode:n.txCode,clientId:n.clientId,fetchImpl:i}),p=await n_({signer:t,audience:e.credential_issuer,nonce:l.c_nonce,clientId:n.clientId}),v=[],b,g=l.c_nonce,A=l.c_nonce_expires_in,w=Tx(l.authorization_details);for(let C of s){let B=Ox(c,C),T=Bx(B),M=w.get(C)??[],O=M.length>0?M.map(E=>({credentialIdentifier:E})):[{credentialIdentifier:void 0}];for(let E of O){let P=await a_({credentialEndpoint:c.credential_endpoint,accessToken:l.access_token,tokenType:l.token_type,credentialIdentifier:E.credentialIdentifier,format:E.credentialIdentifier?void 0:T,extra:E.credentialIdentifier?void 0:Nx(B,T),proofJwt:p,fetchImpl:i});if(!P.credential&&!Array.isArray(P.credentials))throw new ie("unsupported_format","Credential endpoint returned neither `credential` nor `credentials`; deferred issuance not supported yet",{body:P});if(P.credential!==void 0&&v.push({format:T,credential:P.credential,configuration_id:C}),Array.isArray(P.credentials))for(let L of P.credentials)L&&typeof L=="object"&&"credential"in L&&v.push({format:T,credential:L.credential,configuration_id:C});typeof P.notification_id=="string"&&(b=P.notification_id),typeof P.c_nonce=="string"&&(g=P.c_nonce,A=typeof P.c_nonce_expires_in=="number"?P.c_nonce_expires_in:void 0)}}return{credentials:v,notification_id:b,c_nonce:g,c_nonce_expires_in:A}},"acceptCredentialOffer"),Ox=o((r,e)=>{let t=r.credential_configurations_supported;if(!t||typeof t!="object"||!(e in t))return;let n=t[e];if(!(!n||typeof n!="object"))return n},"getConfigurationDefinition"),Bx=o(r=>r&&typeof r.format=="string"&&r.format.length>0?r.format:"jwt_vc_json","inferFormatFromDefinition"),Nx=o((r,e)=>{if(r&&(e==="jwt_vc_json"||e==="jwt_vc_json-ld"||e==="ldp_vc")){let t=r.credential_definition;if(t&&typeof t=="object")return{credential_definition:t}}},"buildFormatSpecificBody"),Tx=o(r=>{let e=new Map;if(!Array.isArray(r))return e;for(let t of r){if(!t||typeof t!="object")continue;let n=t,i=n.credential_configuration_id,a=n.credential_identifiers;if(typeof i!="string"||!Array.isArray(a))continue;let s=a.filter(c=>typeof c=="string");s.length>0&&e.set(i,s)}return e},"indexAuthorizationDetails"),Ri,o_=(Ri=class extends Error{constructor(e,t){super(t),this.name="PkceError",this.code=e}},u(Ri,"_PkceError"),Ri);o(o_,"PkceError");var Fp=o_,Rx=o(async(r={})=>{let e=r.byteLength??32;if(e<24||e>96)throw new Fp("invalid_verifier",`PKCE byteLength must be between 24 and 96 (got ${e})`);let t=s_(Lx(e)),n=await jx(t);return{verifier:t,challenge:n,method:"S256"}},"generatePkcePair"),jx=o(async r=>{if(typeof r!="string"||r.length<24)throw new Fp("invalid_verifier","PKCE verifier must be a base64url string with \u226524 chars");let e=new TextEncoder().encode(r),t=await Dx().digest("SHA-256",e);return s_(new Uint8Array(t))},"computeS256Challenge");var s_=o(r=>{if(typeof Buffer<"u")return Buffer.from(r).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},"toB64url"),Lx=o(r=>{let e=new Uint8Array(r);return u_().getRandomValues(e),e},"getRandomBytes"),u_=o(()=>{let r=globalThis.crypto;if(!r)throw new Fp("invalid_verifier","Web Crypto API not available in this runtime");return r},"getCrypto"),Dx=o(()=>{let r=u_().subtle;if(!r)throw new Fp("invalid_verifier","crypto.subtle not available in this runtime");return r},"getSubtle"),c_="authorization_code",Mx=o(async r=>{let e=r.fetchImpl??globalThis.fetch;if(!r.clientId||r.clientId.length===0)throw new ie("token_request_failed","beginAuthCodeFlow requires a non-empty `clientId` \u2014 the AS cannot track the request otherwise");if(!r.redirectUri||r.redirectUri.length===0)throw new ie("token_request_failed","beginAuthCodeFlow requires a non-empty `redirectUri`");let t=r.offer.grants?.[c_];if(!t)throw new ie("unsupported_grant","Offer does not advertise the authorization_code grant. Use acceptCredentialOffer for pre-auth offers.");let n=Hx(r.offer,r.configurationIds),i=await Hw(r.offer.credential_issuer,e),a=Kw(i,t.authorization_server),s=await Fw(a,e);if(typeof s.authorization_endpoint!="string")throw new ie("metadata_invalid","Authorization server metadata is missing `authorization_endpoint` \u2014 cannot run auth_code flow");let c=await Rx(),d=zx(),f=Ux({authorizationEndpoint:s.authorization_endpoint,clientId:r.clientId,redirectUri:r.redirectUri,configurationIds:n,scope:r.scope,pkce:c,state:d,issuerState:typeof t.issuer_state=="string"?t.issuer_state:void 0}),l={version:1,issuer:r.offer.credential_issuer,tokenEndpoint:s.token_endpoint,credentialEndpoint:i.credential_endpoint,configurationIds:n,redirectUri:r.redirectUri,clientId:r.clientId,state:d,pkceVerifier:c.verifier,pkceMethod:c.method,credentialConfigurations:i.credential_configurations_supported??{}};return{authorizationUrl:f,flowHandle:l}},"beginAuthCodeFlow"),Vx=o(async r=>{let{flowHandle:e,code:t,signer:n}=r,i=r.fetchImpl??globalThis.fetch;if(r.state&&r.state!==e.state)throw new ie("token_request_failed",`State parameter mismatch (callback state=${r.state}, expected ${e.state})`);let a=await $x({tokenEndpoint:e.tokenEndpoint,code:t,codeVerifier:e.pkceVerifier,clientId:e.clientId,redirectUri:e.redirectUri,fetchImpl:i}),s=await n_({signer:n,audience:e.issuer,nonce:a.c_nonce,clientId:e.clientId});return qx({flowHandle:e,tokenResponse:a,proofJwt:s,fetchImpl:i})},"completeAuthCodeFlow"),Ux=o(r=>{let e=new URL(r.authorizationEndpoint);e.searchParams.set("response_type","code"),e.searchParams.set("client_id",r.clientId),e.searchParams.set("redirect_uri",r.redirectUri),e.searchParams.set("code_challenge",r.pkce.challenge),e.searchParams.set("code_challenge_method",r.pkce.method),e.searchParams.set("state",r.state);let t=r.configurationIds.map(n=>({type:"openid_credential",credential_configuration_id:n}));return e.searchParams.set("authorization_details",JSON.stringify(t)),r.scope&&e.searchParams.set("scope",r.scope),r.issuerState&&e.searchParams.set("issuer_state",r.issuerState),e.toString()},"buildAuthorizationUrl"),$x=o(async r=>{let{tokenEndpoint:e,code:t,codeVerifier:n,clientId:i,redirectUri:a}=r,s=r.fetchImpl??globalThis.fetch;if(typeof s!="function")throw new ie("token_request_failed","No fetch implementation available for authorization_code token exchange");let c=new URLSearchParams;c.set("grant_type",c_),c.set("code",t),c.set("code_verifier",n),c.set("client_id",i),c.set("redirect_uri",a);let d;try{d=await s(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:c.toString()})}catch(l){throw new ie("token_request_failed",`Token endpoint ${e} unreachable: ${l instanceof Error?l.message:String(l)}`,{cause:l})}let f;try{f=await d.json()}catch(l){throw new ie("token_response_invalid",`Token endpoint ${e} returned non-JSON body`,{status:d.status,cause:l})}if(!d.ok){let l=f,p=typeof l?.error=="string"?l.error:"unknown",v=typeof l?.error_description=="string"?`: ${l.error_description}`:"";throw new ie("token_request_failed",`Token endpoint returned ${d.status} (${p})${v}`,{status:d.status,body:f})}if(!Jx(f))throw new ie("token_response_invalid","Token endpoint response is missing required `access_token` / `token_type`",{status:d.status,body:f});return f},"exchangeAuthorizationCode"),qx=o(async r=>{let e=[],t,n=r.tokenResponse.c_nonce,i=r.tokenResponse.c_nonce_expires_in,a=Wx(r.tokenResponse.authorization_details);for(let s of r.flowHandle.configurationIds){let c=r.flowHandle.credentialConfigurations[s],d=Fx(c),f=a.get(s)??[],l=f.length>0?f.map(p=>({credentialIdentifier:p})):[{credentialIdentifier:void 0}];for(let p of l){let v=await a_({credentialEndpoint:r.flowHandle.credentialEndpoint,accessToken:r.tokenResponse.access_token,tokenType:r.tokenResponse.token_type,credentialIdentifier:p.credentialIdentifier,format:p.credentialIdentifier?void 0:d,extra:p.credentialIdentifier?void 0:Kx(c,d),proofJwt:r.proofJwt,fetchImpl:r.fetchImpl});if(!v.credential&&!Array.isArray(v.credentials))throw new ie("unsupported_format","Credential endpoint returned neither `credential` nor `credentials`; deferred issuance not supported yet",{body:v});if(v.credential!==void 0&&e.push({format:d,credential:v.credential,configuration_id:s}),Array.isArray(v.credentials))for(let b of v.credentials)b&&typeof b=="object"&&"credential"in b&&e.push({format:d,credential:b.credential,configuration_id:s});typeof v.notification_id=="string"&&(t=v.notification_id),typeof v.c_nonce=="string"&&(n=v.c_nonce,i=typeof v.c_nonce_expires_in=="number"?v.c_nonce_expires_in:void 0)}}return{credentials:e,notification_id:t,c_nonce:n,c_nonce_expires_in:i}},"fetchCredentialsForToken"),Hx=o((r,e)=>{let t=e&&e.length>0?e.filter(n=>r.credential_configuration_ids.includes(n)):r.credential_configuration_ids;if(t.length===0)throw new ie("unsupported_format","No credential configuration ids matched the caller-supplied filter");return t},"filterConfigurationIds"),Fx=o(r=>r&&typeof r=="object"&&typeof r.format=="string"?r.format:"jwt_vc_json","inferFormat"),Kx=o((r,e)=>{if(!(!r||typeof r!="object")&&(e==="jwt_vc_json"||e==="jwt_vc_json-ld"||e==="ldp_vc")){let t=r.credential_definition;if(t&&typeof t=="object")return{credential_definition:t}}},"formatSpecificBody"),Wx=o(r=>{let e=new Map;if(!Array.isArray(r))return e;for(let t of r){if(!t||typeof t!="object")continue;let n=t,i=n.credential_configuration_id,a=n.credential_identifiers;if(typeof i!="string"||!Array.isArray(a))continue;let s=a.filter(c=>typeof c=="string");s.length>0&&e.set(i,s)}return e},"indexAuthorizationDetails"),Jx=o(r=>{if(typeof r!="object"||r===null)return!1;let e=r;return typeof e.access_token=="string"&&e.access_token.length>0&&typeof e.token_type=="string"&&e.token_type.length>0},"isTokenResponse"),zx=o(()=>{let r=globalThis.crypto;if(!r)throw new Error("Web Crypto API not available in this runtime");let e=new Uint8Array(16);r.getRandomValues(e);let t="";for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,"0");return t},"randomId"),Gx=o((r,e)=>{switch(e){case"jwt_vc_json":case"jwt_vc":case"jwt_vc_json-ld":return Xx(r,e);case"ldp_vc":if(!d_(r))throw new ie("unsupported_format",`ldp_vc credential was not a JSON-LD object (received ${typeof r})`);return{vc:r,rawFormat:e};default:throw new ie("unsupported_format",`Credential format "${e}" is not yet supported by the openid4vc plugin`)}},"normalizeIssuedCredential"),Xx=o((r,e)=>{if(typeof r!="string")throw new ie("unsupported_format",`${e} credential must be a compact JWS string (received ${typeof r})`);let t;try{t=r_(r)}catch(l){throw new ie("unsupported_format",`Failed to decode ${e} credential as a JWT: ${l instanceof Error?l.message:String(l)}`,{cause:l})}let n=t.vc;if(!d_(n))throw new ie("unsupported_format",`${e} credential JWT is missing the required \`vc\` claim`);let i={...n};if(typeof t.jti=="string"&&!i.id&&(i.id=t.jti),typeof t.iss=="string"&&!Qx(i)&&(i.issuer=t.iss),typeof t.sub=="string")if(i.credentialSubject&&!Array.isArray(i.credentialSubject)){let l=i.credentialSubject;l.id||(l.id=t.sub)}else i.credentialSubject||(i.credentialSubject={id:t.sub});let a=typeof t.nbf=="number"?t.nbf:typeof t.iat=="number"?t.iat:void 0;a!==void 0&&!i.issuanceDate&&!i.validFrom&&(i.issuanceDate=new Date(a*1e3).toISOString()),typeof t.exp=="number"&&!i.expirationDate&&!i.validUntil&&(i.expirationDate=new Date(t.exp*1e3).toISOString());let s=i.issuanceDate??(typeof i.validFrom=="string"?i.validFrom:void 0)??new Date().toISOString(),c=Zx(i.issuer)??(typeof t.iss=="string"?t.iss:void 0),d;try{let l=t_(r);typeof l?.kid=="string"&&l.kid.length>0&&(d=l.kid)}catch{}let f=d?d.startsWith("#")&&c?`${c}${d}`:d:c?`${c}#0`:"urn:openid4vci:unknown-verification-method";return i.proof={type:"JwtProof2020",created:s,proofPurpose:"assertionMethod",verificationMethod:f,jwt:r},{vc:i,rawFormat:e,jwt:r}},"decodeJwtVc"),Zx=o(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"){let e=r.id;if(typeof e=="string"&&e.length>0)return e}},"pickIssuerId"),d_=o(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!1;let e=r;return"@context"in e||"type"in e||"credentialSubject"in e},"isVcObject"),Qx=o(r=>r.issuer?typeof r.issuer=="string"?r.issuer.length>0:typeof r.issuer=="object"&&r.issuer!==null?typeof r.issuer.id=="string"&&r.issuer.id.length>0:!1:!1,"hasIssuer"),Yx="LearnCloud",e6=o(async(r,e,t={})=>{let n=t.storage??Yx,i=t.encrypt??!0,a=t.makeId??l6,s=t.upload??u6(r,n,i),c=t.addToIndex??c6(r,n),d=[],f=[];for(let l=0;l<e.credentials.length;l++){let p=e.credentials[l];try{let v=Gx(p.credential,p.format),b=await d6(s,v.vc),g=a(),A={id:g,uri:b,category:t6(t.category,v.vc,l),...Ll(t.title,v.vc,l)&&{title:Ll(t.title,v.vc,l)},...Ll(t.imgUrl,v.vc,l)&&{imgUrl:Ll(t.imgUrl,v.vc,l)},__v:1};await f6(c,A),d.push({uri:b,recordId:g,vc:v.vc,configurationId:p.configuration_id,format:v.rawFormat})}catch(v){f.push({configurationId:p.configuration_id,format:p.format,error:v instanceof ie?v:new ie("store_failed",`Unexpected error while storing credential: ${v instanceof Error?v.message:String(v)}`,{cause:v})})}}return{stored:d,failures:f}},"storeAcceptedCredentials"),t6=o((r,e,t)=>typeof r=="string"?r:typeof r=="function"?r(e,t):r6(e),"resolveCategory"),Ll=o((r,e,t)=>{if(typeof r=="string")return r;if(typeof r=="function")return r(e,t)},"resolveOptional"),r6=o(r=>{let e=s6(r.type);return e.some(Dl(n6))?"ID":e.some(Dl(i6))?"Achievement":e.some(Dl(a6))?"Work":e.some(Dl(o6))?"Learning History":"Achievement"},"defaultCategoryFor"),n6=["IdentityCredential","VerifiableId","MobileDriversLicense"],i6=["OpenBadgeCredential","AchievementCredential","UniversityDegreeCredential","MicroCredential"],a6=["EmploymentCredential","WorkExperienceCredential"],o6=["CourseCompletionCredential","LearningHistoryCredential"],Dl=o(r=>e=>r.includes(e),"matchesAny"),s6=o(r=>Array.isArray(r)?r.filter(e=>typeof e=="string"):typeof r=="string"?[r]:[],"toTypeArray"),u6=o((r,e,t)=>{let i=r.store?.[e];if(!i)throw new ie("store_plane_missing",`LearnCard has no store plugin named "${e}" \u2014 did you forget to add @learncard/learn-cloud-plugin?`);if(t&&typeof i.uploadEncrypted=="function")return a=>i.uploadEncrypted(a);if(typeof i.upload=="function")return a=>i.upload(a);throw new ie("store_plane_missing",`Store plugin "${e}" implements neither \`upload\` nor \`uploadEncrypted\``)},"resolveUpload"),c6=o((r,e)=>{let n=r.index?.[e];if(!n||typeof n.add!="function")throw new ie("index_plane_missing",`LearnCard has no index plugin named "${e}" exposing an \`add\` method`);return i=>n.add(i)},"resolveAddToIndex"),d6=o(async(r,e)=>{let t;try{t=await r(e)}catch(n){throw new ie("store_failed",`Store plane rejected the credential upload: ${n instanceof Error?n.message:String(n)}`,{cause:n})}if(typeof t!="string"||t.length===0)throw new ie("store_failed","Store plane upload returned an empty URI \u2014 refusing to index an unresolvable credential");return t},"safeUpload"),f6=o(async(r,e)=>{try{await r(e)}catch(t){throw new ie("index_failed",`Index plane rejected the credential record: ${t instanceof Error?t.message:String(t)}`,{cause:t})}},"safeAddToIndex"),l6=o(()=>{let r=globalThis.crypto;if(r&&typeof r.randomUUID=="function")return r.randomUUID();let e=new Uint8Array(16),t=globalThis.crypto;if(t&&typeof t.getRandomValues=="function")t.getRandomValues(e);else for(let n=0;n<e.length;n++)e[n]=Math.floor(Math.random()*256);return Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")},"defaultMakeId"),ji,f_=(ji=class extends Error{constructor(e,t,n){super(t),this.name="VpError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}},u(ji,"_VpError"),ji);o(f_,"VpError");var we=f_,TB=$n(UE()),nl={};Tw(nl,{Any:u(()=>Vr,"Any"),BaseBlock:u(()=>st,"BaseBlock"),BaseStringBlock:u(()=>am,"BaseStringBlock"),BitString:u(()=>tn,"BitString"),BmpString:u(()=>sl,"BmpString"),Boolean:u(()=>il,"Boolean"),CharacterString:u(()=>yl,"CharacterString"),Choice:u(()=>zp,"Choice"),Constructed:u(()=>qe,"Constructed"),DATE:u(()=>dm,"DATE"),DateTime:u(()=>lm,"DateTime"),Duration:u(()=>pm,"Duration"),EndOfContent:u(()=>om,"EndOfContent"),Enumerated:u(()=>al,"Enumerated"),GeneralString:u(()=>vl,"GeneralString"),GeneralizedTime:u(()=>gl,"GeneralizedTime"),GraphicString:u(()=>hl,"GraphicString"),HexBlock:u(()=>cr,"HexBlock"),IA5String:u(()=>pl,"IA5String"),Integer:u(()=>Wn,"Integer"),Null:u(()=>or,"Null"),NumericString:u(()=>cl,"NumericString"),ObjectIdentifier:u(()=>ol,"ObjectIdentifier"),OctetString:u(()=>nr,"OctetString"),Primitive:u(()=>Fn,"Primitive"),PrintableString:u(()=>dl,"PrintableString"),RawData:u(()=>_6,"RawData"),RelativeObjectIdentifier:u(()=>cm,"RelativeObjectIdentifier"),Repeated:u(()=>jf,"Repeated"),Sequence:u(()=>it,"Sequence"),Set:u(()=>pt,"Set"),TIME:u(()=>hm,"TIME"),TeletexString:u(()=>fl,"TeletexString"),TimeOfDay:u(()=>fm,"TimeOfDay"),UTCTime:u(()=>Bd,"UTCTime"),UniversalString:u(()=>ul,"UniversalString"),Utf8String:u(()=>Er,"Utf8String"),ValueBlock:u(()=>St,"ValueBlock"),VideotexString:u(()=>ll,"VideotexString"),ViewWriter:u(()=>Wp,"ViewWriter"),VisibleString:u(()=>Od,"VisibleString"),compareSchema:u(()=>tr,"compareSchema"),fromBER:u(()=>Ft,"fromBER"),verifySchema:u(()=>g3,"verifySchema")});var ye=$n(tl());function Bn(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}u(Bn,"utilFromBase");o(Bn,"utilFromBase");function sn(r,e,t=-1){let n=t,i=r,a=0,s=Math.pow(2,e);for(let c=1;c<8;c++){if(r<s){let d;if(n<0)d=new ArrayBuffer(c),a=c;else{if(n<c)return new ArrayBuffer(0);d=new ArrayBuffer(n),a=n}let f=new Uint8Array(d);for(let l=c-1;l>=0;l--){let p=Math.pow(2,l*e);f[a-l-1]=Math.floor(i/p),i-=f[a-l-1]*p}return d}s*=Math.pow(2,e)}return new ArrayBuffer(0)}u(sn,"utilToBase");o(sn,"utilToBase");function Zl(...r){let e=0,t=0;for(let a of r)e+=a.length;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let a of r)i.set(a,t),t+=a.length;return i}u(Zl,"utilConcatView");o(Zl,"utilConcatView");function nm(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let c=r[0]===255&&r[1]&128,d=r[0]===0&&(r[1]&128)===0;(c||d)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let c=0;c<this.valueHex.byteLength;c++)t[c]=0;t[0]=r[0]&128;let n=Bn(t,8),i=new ArrayBuffer(this.valueHex.byteLength),a=new Uint8Array(i);for(let c=0;c<this.valueHex.byteLength;c++)a[c]=r[c];return a[0]&=127,Bn(a,8)-n}u(nm,"utilDecodeTC");o(nm,"utilDecodeTC");function l_(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let s=t-e,c=sn(s,8,n),d=new Uint8Array(c);return d[0]|=128,c}let i=sn(e,8,n),a=new Uint8Array(i);if(a[0]&128){let s=i.slice(0),c=new Uint8Array(s);i=new ArrayBuffer(i.byteLength+1),a=new Uint8Array(i);for(let d=0;d<s.byteLength;d++)a[d+1]=c[d];a[0]=0}return i}t*=Math.pow(2,8)}return new ArrayBuffer(0)}u(l_,"utilEncodeTC");o(l_,"utilEncodeTC");function p_(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}u(p_,"isEqualBuffer");o(p_,"isEqualBuffer");function Ct(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,i=new Array(n);for(let s=0;s<n;s++)i[s]="0";return i.join("").concat(t)}u(Ct,"padNumber");o(Ct,"padNumber");var RB=Math.log(2);function Tf(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}u(Tf,"assertBigInt");o(Tf,"assertBigInt");function Kp(r){let e=0,t=0;for(let i=0;i<r.length;i++){let a=r[i];e+=a.byteLength}let n=new Uint8Array(e);for(let i=0;i<r.length;i++){let a=r[i];n.set(new Uint8Array(a),t),t+=a.byteLength}return n.buffer}u(Kp,"concat2");o(Kp,"concat");function Cr(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}u(Cr,"checkBufferParams");o(Cr,"checkBufferParams");var Li,h_=(Li=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Kp(this.items)}},u(Li,"_ViewWriter"),Li);o(h_,"ViewWriter");var Wp=h_,Xd=[new Uint8Array([1])],V1="0123456789",Mh="name",U1="valueHexView",p6="isHexOnly",h6="idBlock",v6="tagClass",y6="tagNumber",g6="isConstructed",m6="fromBER",b6="toBER",w6="local",Et="",ur=new ArrayBuffer(0),Jp=new Uint8Array(0),Rf="EndOfContent",v_="OCTET STRING",y_="BIT STRING";function cr(r){var n;var e,t;return t=(e=(n=class extends r{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(a){this.valueHexView=new Uint8Array(a)}constructor(...a){var s;super(...a);let c=a[0]||{};this.isHexOnly=(s=c.isHexOnly)!==null&&s!==void 0?s:!1,this.valueHexView=c.valueHex?ye.BufferSourceConverter.toUint8Array(c.valueHex):Jp}fromBER(a,s,c){let d=a instanceof ArrayBuffer?new Uint8Array(a):a;if(!Cr(this,d,s,c))return-1;let f=s+c;return this.valueHexView=d.subarray(s,f),this.valueHexView.length?(this.blockLength=c,f):(this.warnings.push("Zero buffer length"),s)}toBER(a=!1){return this.isHexOnly?a?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",ur)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:ye.Convert.ToHex(this.valueHexView)}}},u(n,"_a111"),n),o(e,"Some"),e),t.NAME="hexBlock",t}u(cr,"HexBlock");o(cr,"HexBlock");var Di,g_=(Di=class{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=Et,warnings:n=[],valueBeforeDecode:i=Jp}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=ye.BufferSourceConverter.toUint8Array(i)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:ye.Convert.ToHex(this.valueBeforeDecodeView)}}},u(Di,"_LocalBaseBlock"),Di);o(g_,"LocalBaseBlock");var Hn=g_;Hn.NAME="baseBlock";var Mi,m_=(Mi=class extends Hn{fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}},u(Mi,"_ValueBlock"),Mi);o(m_,"ValueBlock");var St=m_;St.NAME="valueBlock";var Vi,b_=(Vi=class extends cr(Hn){constructor({idBlock:e={}}={}){var t,n,i,a;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?ye.BufferSourceConverter.toUint8Array(e.valueHex):Jp,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(i=e.tagNumber)!==null&&i!==void 0?i:-1,this.isConstructed=(a=e.isConstructed)!==null&&a!==void 0?a:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",ur}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let i=new Uint8Array(1);if(!e){let a=this.tagNumber;a&=31,t|=a,i[0]=t}return i.buffer}if(!this.isHexOnly){let i=sn(this.tagNumber,7),a=new Uint8Array(i),s=i.byteLength,c=new Uint8Array(s+1);if(c[0]=t|31,!e){for(let d=0;d<s-1;d++)c[d+1]=a[d]|128;c[s]=a[s-1]}return c.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let i=this.valueHexView;for(let a=0;a<i.length-1;a++)n[a+1]=i[a]|128;n[this.valueHexView.byteLength]=i[i.length-1]}return n.buffer}fromBER(e,t,n){let i=ye.BufferSourceConverter.toUint8Array(e);if(!Cr(this,i,t,n))return-1;let a=i.subarray(t,t+n);if(a.length===0)return this.error="Zero buffer length",-1;switch(a[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(a[0]&32)===32,this.isHexOnly=!1;let c=a[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let d=1,f=this.valueHexView=new Uint8Array(255),l=255;for(;a[d]&128;){if(f[d-1]=a[d]&127,d++,d>=a.length)return this.error="End of input reached before message was fully decoded",-1;if(d===l){l+=255;let v=new Uint8Array(l);for(let b=0;b<f.length;b++)v[b]=f[b];f=this.valueHexView=new Uint8Array(l)}}this.blockLength=d+1,f[d-1]=a[d]&127;let p=new Uint8Array(d);for(let v=0;v<d;v++)p[v]=f[v];f=this.valueHexView=new Uint8Array(d),f.set(p),this.blockLength<=9?this.tagNumber=Bn(f,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}},u(Vi,"_LocalIdentificationBlock"),Vi);o(b_,"LocalIdentificationBlock");var w_=b_;w_.NAME="identificationBlock";var Ui,__=(Ui=class extends Hn{constructor({lenBlock:e={}}={}){var t,n,i;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(i=e.length)!==null&&i!==void 0?i:0}fromBER(e,t,n){let i=ye.BufferSourceConverter.toUint8Array(e);if(!Cr(this,i,t,n))return-1;let a=i.subarray(t,t+n);if(a.length===0)return this.error="Zero buffer length",-1;if(a[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=a[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(a[0]&128),this.longFormUsed===!1)return this.length=a[0],this.blockLength=1,t+this.blockLength;let s=a[0]&127;if(s>8)return this.error="Too big integer",-1;if(s+1>a.length)return this.error="End of input reached before message was fully decoded",-1;let c=t+1,d=i.subarray(c,c+s);return d[s-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Bn(d,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=s+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let i=sn(this.length,8);if(i.byteLength>127)return this.error="Too big length",ur;if(t=new ArrayBuffer(i.byteLength+1),e)return t;let a=new Uint8Array(i);n=new Uint8Array(t),n[0]=i.byteLength|128;for(let s=0;s<i.byteLength;s++)n[s+1]=a[s];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}},u(Ui,"_LocalLengthBlock"),Ui);o(__,"LocalLengthBlock");var S_=__;S_.NAME="lengthBlock";var W={},$i,A_=($i=class extends Hn{constructor({name:e=Et,optional:t=!1,primitiveSchema:n,...i}={},a){super(i),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new w_(i),this.lenBlock=new S_(i),this.valueBlock=a?new a(i):new St(i)}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}toBER(e,t){let n=t||new Wp;t||im(this);let i=this.idBlock.toBER(e);if(n.write(i),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let a=this.valueBlock.toBER(e);this.lenBlock.length=a.byteLength;let s=this.lenBlock.toBER(e);n.write(s),n.write(a)}return t?ur:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():ye.Convert.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=ye.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return p_(t,n)}},u($i,"_BaseBlock"),$i);o(A_,"BaseBlock");var st=A_;st.NAME="BaseBlock";function im(r){var e;if(r instanceof W.Constructed)for(let t of r.valueBlock.value)im(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}u(im,"prepareIndefiniteForm");o(im,"prepareIndefiniteForm");var qi,C_=(qi=class extends st{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Et,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}},u(qi,"_BaseStringBlock"),qi);o(C_,"BaseStringBlock");var am=C_;am.NAME="BaseStringBlock";var Hi,E_=(Hi=class extends cr(St){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}},u(Hi,"_LocalPrimitiveValueBlock"),Hi);o(E_,"LocalPrimitiveValueBlock");var k_=E_;k_.NAME="PrimitiveValueBlock";var x_,Fi,P_=(Fi=class extends st{constructor(e={}){super(e,k_),this.idBlock.isConstructed=!1}},u(Fi,"_Primitive"),Fi);o(P_,"Primitive");var Fn=P_;x_=Fn;W.Primitive=x_;Fn.NAME="PRIMITIVE";function I_(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}u(I_,"localChangeType");o(I_,"localChangeType");function Kn(r,e=0,t=r.length){let n=e,i=new st({},St),a=new Hn;if(!Cr(a,r,e,t))return i.error=a.error,{offset:-1,result:i};if(!r.subarray(e,e+t).length)return i.error="Zero buffer length",{offset:-1,result:i};let c=i.idBlock.fromBER(r,e,t);if(i.idBlock.warnings.length&&i.warnings.concat(i.idBlock.warnings),c===-1)return i.error=i.idBlock.error,{offset:-1,result:i};if(e=c,t-=i.idBlock.blockLength,c=i.lenBlock.fromBER(r,e,t),i.lenBlock.warnings.length&&i.warnings.concat(i.lenBlock.warnings),c===-1)return i.error=i.lenBlock.error,{offset:-1,result:i};if(e=c,t-=i.lenBlock.blockLength,!i.idBlock.isConstructed&&i.lenBlock.isIndefiniteForm)return i.error="Indefinite length form used for primitive encoding form",{offset:-1,result:i};let d=st;switch(i.idBlock.tagClass){case 1:if(i.idBlock.tagNumber>=37&&i.idBlock.isHexOnly===!1)return i.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:i};switch(i.idBlock.tagNumber){case 0:if(i.idBlock.isConstructed&&i.lenBlock.length>0)return i.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:i};d=W.EndOfContent;break;case 1:d=W.Boolean;break;case 2:d=W.Integer;break;case 3:d=W.BitString;break;case 4:d=W.OctetString;break;case 5:d=W.Null;break;case 6:d=W.ObjectIdentifier;break;case 10:d=W.Enumerated;break;case 12:d=W.Utf8String;break;case 13:d=W.RelativeObjectIdentifier;break;case 14:d=W.TIME;break;case 15:return i.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:i};case 16:d=W.Sequence;break;case 17:d=W.Set;break;case 18:d=W.NumericString;break;case 19:d=W.PrintableString;break;case 20:d=W.TeletexString;break;case 21:d=W.VideotexString;break;case 22:d=W.IA5String;break;case 23:d=W.UTCTime;break;case 24:d=W.GeneralizedTime;break;case 25:d=W.GraphicString;break;case 26:d=W.VisibleString;break;case 27:d=W.GeneralString;break;case 28:d=W.UniversalString;break;case 29:d=W.CharacterString;break;case 30:d=W.BmpString;break;case 31:d=W.DATE;break;case 32:d=W.TimeOfDay;break;case 33:d=W.DateTime;break;case 34:d=W.Duration;break;default:{let f=i.idBlock.isConstructed?new W.Constructed:new W.Primitive;f.idBlock=i.idBlock,f.lenBlock=i.lenBlock,f.warnings=i.warnings,i=f}}break;case 2:case 3:case 4:default:d=i.idBlock.isConstructed?W.Constructed:W.Primitive}return i=I_(i,d),c=i.fromBER(r,e,i.lenBlock.isIndefiniteForm?t:i.lenBlock.length),i.valueBeforeDecodeView=r.subarray(n,n+i.blockLength),{offset:c,result:i}}u(Kn,"localFromBER");o(Kn,"localFromBER");function Ft(r){if(!r.byteLength){let e=new st({},St);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Kn(ye.BufferSourceConverter.toUint8Array(r).slice(),0,r.byteLength)}u(Ft,"fromBER");o(Ft,"fromBER");function O_(r,e){return r?1:e}u(O_,"checkLen");o(O_,"checkLen");var Ki,B_=(Ki=class extends St{constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let i=ye.BufferSourceConverter.toUint8Array(e);if(!Cr(this,i,t,n))return-1;if(this.valueBeforeDecodeView=i.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let a=t;for(;O_(this.isIndefiniteForm,n)>0;){let s=Kn(i,a,n);if(s.offset===-1)return this.error=s.result.error,this.warnings.concat(s.result.warnings),-1;if(a=s.offset,this.blockLength+=s.result.blockLength,n-=s.result.blockLength,this.value.push(s.result),this.isIndefiniteForm&&s.result.constructor.NAME===Rf)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Rf?this.value.pop():this.warnings.push("No EndOfContent block encoded")),a}toBER(e,t){let n=t||new Wp;for(let i=0;i<this.value.length;i++)this.value[i].toBER(e,n);return t?ur:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}},u(Ki,"_LocalConstructedValueBlock"),Ki);o(B_,"LocalConstructedValueBlock");var en=B_;en.NAME="ConstructedValueBlock";var N_,Wi,T_=(Wi=class extends st{constructor(e={}){super(e,en),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
11
- `).map(i=>` ${i}`).join(`
12
- `));let t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
13
- ${e.join(`
14
- `)}`:`${t} :`}},u(Wi,"_Constructed"),Wi);o(T_,"Constructed");var qe=T_;N_=qe;W.Constructed=N_;qe.NAME="CONSTRUCTED";var Ji,R_=(Ji=class extends St{fromBER(e,t,n){return t}toBER(e){return ur}},u(Ji,"_LocalEndOfContentValueBlock"),Ji);o(R_,"LocalEndOfContentValueBlock");var j_=R_;j_.override="EndOfContentValueBlock";var L_,zi,D_=(zi=class extends st{constructor(e={}){super(e,j_),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}},u(zi,"_EndOfContent"),zi);o(D_,"EndOfContent");var om=D_;L_=om;W.EndOfContent=L_;om.NAME=Rf;var M_,Gi,V_=(Gi=class extends st{constructor(e={}){super(e,St),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,n){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=n,t+n>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+n}toBER(e,t){let n=new ArrayBuffer(2);if(!e){let i=new Uint8Array(n);i[0]=5,i[1]=0}return t&&t.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}},u(Gi,"_Null"),Gi);o(V_,"Null");var or=V_;M_=or;W.Null=M_;or.NAME="NULL";var Xi,U_=(Xi=class extends cr(St){get value(){for(let e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=ye.BufferSourceConverter.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,n){let i=ye.BufferSourceConverter.toUint8Array(e);return Cr(this,i,t,n)?(this.valueHexView=i.subarray(t,t+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,nm.call(this),this.blockLength=n,t+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}},u(Xi,"_LocalBooleanValueBlock"),Xi);o(U_,"LocalBooleanValueBlock");var $_=U_;$_.NAME="BooleanValueBlock";var q_,Zi,H_=(Zi=class extends st{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,$_),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}},u(Zi,"_Boolean"),Zi);o(H_,"Boolean");var il=H_;q_=il;W.Boolean=q_;il.NAME="BOOLEAN";var Qi,F_=(Qi=class extends cr(en){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,n){let i=0;if(this.isConstructed){if(this.isHexOnly=!1,i=en.prototype.fromBER.call(this,e,t,n),i===-1)return i;for(let a=0;a<this.value.length;a++){let s=this.value[a].constructor.NAME;if(s===Rf){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(s!==v_)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,i=super.fromBER(e,t,n),this.blockLength=n;return i}toBER(e,t){return this.isConstructed?en.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}},u(Qi,"_LocalOctetStringValueBlock"),Qi);o(F_,"LocalOctetStringValueBlock");var K_=F_;K_.NAME="OctetStringValueBlock";var sm,Yi,W_=(Yi=class extends st{constructor({idBlock:e={},lenBlock:t={},...n}={}){var i,a;(i=n.isConstructed)!==null&&i!==void 0||(n.isConstructed=!!(!((a=n.value)===null||a===void 0)&&a.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},K_),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){let a=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+n);try{if(a.byteLength){let s=Kn(a,0,a.byteLength);s.offset!==-1&&s.offset===n&&(this.valueBlock.value=[s.result])}}catch{}}return super.fromBER(e,t,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return qe.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,t=ye.Convert.ToHex(this.valueBlock.valueHexView);return`${e} : ${t}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let t of this.valueBlock.value)t instanceof sm&&e.push(t.valueBlock.valueHexView);return ye.BufferSourceConverter.concat(e)}},u(Yi,"_OctetString"),Yi);o(W_,"OctetString");var nr=W_;sm=nr;W.OctetString=sm;nr.NAME=v_;var ea,J_=(ea=class extends cr(en){constructor({unusedBits:e=0,isConstructed:t=!1,...n}={}){super(n),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,n){if(!n)return t;let i=-1;if(this.isConstructed){if(i=en.prototype.fromBER.call(this,e,t,n),i===-1)return i;for(let c of this.value){let d=c.constructor.NAME;if(d===Rf){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(d!==y_)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let f=c.valueBlock;if(this.unusedBits>0&&f.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=f.unusedBits}return i}let a=ye.BufferSourceConverter.toUint8Array(e);if(!Cr(this,a,t,n))return-1;let s=a.subarray(t,t+n);if(this.unusedBits=s[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let c=s.subarray(1);try{if(c.byteLength){let d=Kn(c,0,c.byteLength);d.offset!==-1&&d.offset===n-1&&(this.value=[d.result])}}catch{}}return this.valueHexView=s.subarray(1),this.blockLength=s.length,t+n}toBER(e,t){if(this.isConstructed)return en.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return ur;let n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}},u(ea,"_LocalBitStringValueBlock"),ea);o(J_,"LocalBitStringValueBlock");var z_=J_;z_.NAME="BitStringValueBlock";var G_,ta,X_=(ta=class extends st{constructor({idBlock:e={},lenBlock:t={},...n}={}){var i,a;(i=n.isConstructed)!==null&&i!==void 0||(n.isConstructed=!!(!((a=n.value)===null||a===void 0)&&a.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},z_),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return qe.prototype.onAsciiEncoding.call(this);{let e=[],t=this.valueBlock.valueHexView;for(let s of t)e.push(s.toString(2).padStart(8,"0"));let n=e.join(""),i=this.constructor.NAME,a=n.substring(0,n.length-this.valueBlock.unusedBits);return`${i} : ${a}`}}},u(ta,"_BitString"),ta);o(X_,"BitString");var tn=X_;G_=tn;W.BitString=G_;tn.NAME=y_;var Z_;function Q_(r,e){let t=new Uint8Array([0]),n=new Uint8Array(r),i=new Uint8Array(e),a=n.slice(0),s=a.length-1,c=i.slice(0),d=c.length-1,f=0,l=d<s?s:d,p=0;for(let v=l;v>=0;v--,p++){switch(!0){case p<c.length:f=a[s-p]+c[d-p]+t[0];break;default:f=a[s-p]+t[0]}switch(t[0]=f/10,!0){case p>=a.length:a=Zl(new Uint8Array([f%10]),a);break;default:a[s-p]=f%10}}return t[0]>0&&(a=Zl(t,a)),a}u(Q_,"viewAdd");o(Q_,"viewAdd");function cy(r){if(r>=Xd.length)for(let e=Xd.length;e<=r;e++){let t=new Uint8Array([0]),n=Xd[e-1].slice(0);for(let i=n.length-1;i>=0;i--){let a=new Uint8Array([(n[i]<<1)+t[0]]);t[0]=a[0]/10,n[i]=a[0]%10}t[0]>0&&(n=Zl(t,n)),Xd.push(n)}return Xd[r]}u(cy,"power2");o(cy,"power2");function Y_(r,e){let t=0,n=new Uint8Array(r),i=new Uint8Array(e),a=n.slice(0),s=a.length-1,c=i.slice(0),d=c.length-1,f,l=0;for(let p=d;p>=0;p--,l++)switch(f=a[s-l]-c[d-l]-t,!0){case f<0:t=1,a[s-l]=f+10;break;default:t=0,a[s-l]=f}if(t>0)for(let p=s-d+1;p>=0;p--,l++)if(f=a[s-l]-t,f<0)t=1,a[s-l]=f+10;else{t=0,a[s-l]=f;break}return a.slice()}u(Y_,"viewSub");o(Y_,"viewSub");var ra,eS=(ra=class extends cr(St){setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=nm.call(this)))}constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(l_(e))}get valueDec(){return this._valueDec}fromDER(e,t,n,i=0){let a=this.fromBER(e,t,n);if(a===-1)return a;let s=this.valueHexView;return s[0]===0&&(s[1]&128)!==0?this.valueHexView=s.subarray(1):i!==0&&s.length<i&&(i-s.length>1&&(i=s.length+1),this.valueHexView=s.subarray(i-s.length)),a}toDER(e=!1){let t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{let n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(t,1),this.valueHexView=n}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,n){let i=super.fromBER(e,t,n);return i===-1||this.setValueHex(),i}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){let e=this.valueHexView.length*8-1,t=new Uint8Array(this.valueHexView.length*8/3),n=0,i,a=this.valueHexView,s="",c=!1;for(let d=a.byteLength-1;d>=0;d--){i=a[d];for(let f=0;f<8;f++){if((i&1)===1)switch(n){case e:t=Y_(cy(n),t),s="-";break;default:t=Q_(t,cy(n))}n++,i>>=1}}for(let d=0;d<t.length;d++)t[d]&&(c=!0),c&&(s+=V1.charAt(t[d]));return c===!1&&(s+=V1.charAt(0)),s}},u(ra,"_LocalIntegerValueBlock"),ra);o(eS,"LocalIntegerValueBlock");var um=eS;Z_=um;um.NAME="IntegerValueBlock";Object.defineProperty(Z_.prototype,"valueHex",{set:o(function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},"set"),get:o(function(){return this.valueHexView.slice().buffer},"get")});var Cf,na,tS=(na=class extends st{constructor(e={}){super(e,um),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Tf(),BigInt(this.valueBlock.toString())}static fromBigInt(e){Tf();let t=BigInt(e),n=new Wp,i=t.toString(16).replace(/^-/,""),a=new Uint8Array(ye.Convert.FromHex(i));if(t<0){let c=new Uint8Array(a.length+(a[0]&128?1:0));c[0]|=128;let f=BigInt(`0x${ye.Convert.ToHex(c)}`)+t,l=ye.BufferSourceConverter.toUint8Array(ye.Convert.FromHex(f.toString(16)));l[0]|=128,n.write(l)}else a[0]&128&&n.write(new Uint8Array([0])),n.write(a);return new Cf({valueHex:n.final()})}convertToDER(){let e=new Cf({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Cf({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}},u(na,"_Integer"),na);o(tS,"Integer");var Wn=tS;Cf=Wn;W.Integer=Cf;Wn.NAME="INTEGER";var rS,ia,nS=(ia=class extends Wn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}},u(ia,"_Enumerated"),ia);o(nS,"Enumerated");var al=nS;rS=al;W.Enumerated=rS;al.NAME="ENUMERATED";var aa,iS=(aa=class extends cr(St){constructor({valueDec:e=-1,isFirstSid:t=!1,...n}={}){super(n),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,n){if(!n)return t;let i=ye.BufferSourceConverter.toUint8Array(e);if(!Cr(this,i,t,n))return-1;let a=i.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let c=0;c<n&&(this.valueHexView[c]=a[c]&127,this.blockLength++,(a[c]&128)!==0);c++);let s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)s[c]=this.valueHexView[c];return this.valueHexView=s,(a[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Bn(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){Tf();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;let n=new Uint8Array(t.length/7);for(let i=0;i<n.length;i++)n[i]=parseInt(t.slice(i*7,i*7+7),2)+(i+1<n.length?128:0);this.fromBER(n.buffer,0,n.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let i=this.valueHexView,a=new Uint8Array(this.blockLength);for(let s=0;s<this.blockLength-1;s++)a[s]=i[s]|128;return a[this.blockLength-1]=i[this.blockLength-1],a.buffer}let t=sn(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",ur;let n=new Uint8Array(t.byteLength);if(!e){let i=new Uint8Array(t),a=t.byteLength-1;for(let s=0;s<a;s++)n[s]=i[s]|128;n[a]=i[a]}return n}toString(){let e="";if(this.isHexOnly)e=ye.Convert.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}},u(aa,"_LocalSidValueBlock"),aa);o(iS,"LocalSidValueBlock");var dy=iS;dy.NAME="sidBlock";var oa,aS=(oa=class extends St{constructor({value:e=Et,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let i=t;for(;n>0;){let a=new dy;if(i=a.fromBER(e,i,n),i===-1)return this.blockLength=0,this.error=a.error,i;this.value.length===0&&(a.isFirstSid=!0),this.blockLength+=a.blockLength,n-=a.blockLength,this.value.push(a)}return i}toBER(e){let t=[];for(let n=0;n<this.value.length;n++){let i=this.value[n].toBER(e);if(i.byteLength===0)return this.error=this.value[n].error,ur;t.push(i)}return Kp(t)}fromString(e){this.value=[];let t=0,n=0,i="",a=!1;do if(n=e.indexOf(".",t),n===-1?i=e.substring(t):i=e.substring(t,n),t=n+1,a){let s=this.value[0],c=0;switch(s.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}let d=parseInt(i,10);if(isNaN(d))return;s.valueDec=d+c,a=!1}else{let s=new dy;if(i>Number.MAX_SAFE_INTEGER){Tf();let c=BigInt(i);s.valueBigInt=c}else if(s.valueDec=parseInt(i,10),isNaN(s.valueDec))return;this.value.length||(s.isFirstSid=!0,a=!0),this.value.push(s)}while(n!==-1)}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let i=this.value[n].toString();n!==0&&(e=`${e}.`),t?(i=`{${i}}`,this.value[n].isFirstSid?e=`2.{${i} - 80}`:e+=i):e+=i}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}},u(oa,"_LocalObjectIdentifierValueBlock"),oa);o(aS,"LocalObjectIdentifierValueBlock");var oS=aS;oS.NAME="ObjectIdentifierValueBlock";var sS,sa,uS=(sa=class extends st{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,oS),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}},u(sa,"_ObjectIdentifier"),sa);o(uS,"ObjectIdentifier");var ol=uS;sS=ol;W.ObjectIdentifier=sS;ol.NAME="OBJECT IDENTIFIER";var ua,cS=(ua=class extends cr(Hn){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,n){if(n===0)return t;let i=ye.BufferSourceConverter.toUint8Array(e);if(!Cr(this,i,t,n))return-1;let a=i.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let c=0;c<n&&(this.valueHexView[c]=a[c]&127,this.blockLength++,(a[c]&128)!==0);c++);let s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)s[c]=this.valueHexView[c];return this.valueHexView=s,(a[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Bn(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let i=this.valueHexView,a=new Uint8Array(this.blockLength);for(let s=0;s<this.blockLength-1;s++)a[s]=i[s]|128;return a[this.blockLength-1]=i[this.blockLength-1],a.buffer}let t=sn(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",ur;let n=new Uint8Array(t.byteLength);if(!e){let i=new Uint8Array(t),a=t.byteLength-1;for(let s=0;s<a;s++)n[s]=i[s]|128;n[a]=i[a]}return n.buffer}toString(){let e="";return this.isHexOnly?e=ye.Convert.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}},u(ua,"_LocalRelativeSidValueBlock"),ua);o(cS,"LocalRelativeSidValueBlock");var fy=cS;fy.NAME="relativeSidBlock";var ca,dS=(ca=class extends St{constructor({value:e=Et,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let i=t;for(;n>0;){let a=new fy;if(i=a.fromBER(e,i,n),i===-1)return this.blockLength=0,this.error=a.error,i;this.blockLength+=a.blockLength,n-=a.blockLength,this.value.push(a)}return i}toBER(e,t){let n=[];for(let i=0;i<this.value.length;i++){let a=this.value[i].toBER(e);if(a.byteLength===0)return this.error=this.value[i].error,ur;n.push(a)}return Kp(n)}fromString(e){this.value=[];let t=0,n=0,i="";do{n=e.indexOf(".",t),n===-1?i=e.substring(t):i=e.substring(t,n),t=n+1;let a=new fy;if(a.valueDec=parseInt(i,10),isNaN(a.valueDec))return!0;this.value.push(a)}while(n!==-1);return!0}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let i=this.value[n].toString();n!==0&&(e=`${e}.`),t&&(i=`{${i}}`),e+=i}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}},u(ca,"_LocalRelativeObjectIdentifierValueBlock"),ca);o(dS,"LocalRelativeObjectIdentifierValueBlock");var fS=dS;fS.NAME="RelativeObjectIdentifierValueBlock";var lS,da,pS=(da=class extends st{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,fS),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}},u(da,"_RelativeObjectIdentifier"),da);o(pS,"RelativeObjectIdentifier");var cm=pS;lS=cm;W.RelativeObjectIdentifier=lS;cm.NAME="RelativeObjectIdentifier";var hS,fa,vS=(fa=class extends qe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}},u(fa,"_Sequence"),fa);o(vS,"Sequence");var it=vS;hS=it;W.Sequence=hS;it.NAME="SEQUENCE";var yS,la,gS=(la=class extends qe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}},u(la,"_Set"),la);o(gS,"Set");var pt=gS;yS=pt;W.Set=yS;pt.NAME="SET";var pa,mS=(pa=class extends cr(St){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Et}toJSON(){return{...super.toJSON(),value:this.value}}},u(pa,"_LocalStringValueBlock"),pa);o(mS,"LocalStringValueBlock");var bS=mS;bS.NAME="StringValueBlock";var ha,wS=(ha=class extends bS{},u(ha,"_LocalSimpleStringValueBlock"),ha);o(wS,"LocalSimpleStringValueBlock");var _S=wS;_S.NAME="SimpleStringValueBlock";var va,SS=(va=class extends am{constructor({...e}={}){super(e,_S)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,ye.BufferSourceConverter.toUint8Array(e))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);this.valueBlock.value=e}},u(va,"_LocalSimpleStringBlock"),va);o(SS,"LocalSimpleStringBlock");var Dt=SS;Dt.NAME="SIMPLE STRING";var ya,AS=(ya=class extends Dt{fromBuffer(e){this.valueBlock.valueHexView=ye.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=ye.Convert.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=ye.Convert.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(ye.Convert.FromUtf8String(e)),this.valueBlock.value=e}},u(ya,"_LocalUtf8StringValueBlock"),ya);o(AS,"LocalUtf8StringValueBlock");var CS=AS;CS.NAME="Utf8StringValueBlock";var ES,ga,kS=(ga=class extends CS{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}},u(ga,"_Utf8String"),ga);o(kS,"Utf8String");var Er=kS;ES=Er;W.Utf8String=ES;Er.NAME="UTF8String";var ma,xS=(ma=class extends Dt{fromBuffer(e){this.valueBlock.value=ye.Convert.ToUtf16String(e),this.valueBlock.valueHexView=ye.BufferSourceConverter.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(ye.Convert.FromUtf16String(e))}},u(ma,"_LocalBmpStringValueBlock"),ma);o(xS,"LocalBmpStringValueBlock");var PS=xS;PS.NAME="BmpStringValueBlock";var IS,ba,OS=(ba=class extends PS{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}},u(ba,"_BmpString"),ba);o(OS,"BmpString");var sl=OS;IS=sl;W.BmpString=IS;sl.NAME="BMPString";var wa,BS=(wa=class extends Dt{fromBuffer(e){let t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),n=new Uint8Array(t);for(let i=0;i<n.length;i+=4)n[i]=n[i+3],n[i+1]=n[i+2],n[i+2]=0,n[i+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let i=0;i<t;i++){let a=sn(e.charCodeAt(i),8),s=new Uint8Array(a);if(s.length>4)continue;let c=4-s.length;for(let d=s.length-1;d>=0;d--)n[i*4+d+c]=s[d]}this.valueBlock.value=e}},u(wa,"_LocalUniversalStringValueBlock"),wa);o(BS,"LocalUniversalStringValueBlock");var NS=BS;NS.NAME="UniversalStringValueBlock";var TS,_a,RS=(_a=class extends NS{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}},u(_a,"_UniversalString"),_a);o(RS,"UniversalString");var ul=RS;TS=ul;W.UniversalString=TS;ul.NAME="UniversalString";var jS,Sa,LS=(Sa=class extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}},u(Sa,"_NumericString"),Sa);o(LS,"NumericString");var cl=LS;jS=cl;W.NumericString=jS;cl.NAME="NumericString";var DS,Aa,MS=(Aa=class extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}},u(Aa,"_PrintableString"),Aa);o(MS,"PrintableString");var dl=MS;DS=dl;W.PrintableString=DS;dl.NAME="PrintableString";var VS,Ca,US=(Ca=class extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}},u(Ca,"_TeletexString"),Ca);o(US,"TeletexString");var fl=US;VS=fl;W.TeletexString=VS;fl.NAME="TeletexString";var $S,Ea,qS=(Ea=class extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}},u(Ea,"_VideotexString"),Ea);o(qS,"VideotexString");var ll=qS;$S=ll;W.VideotexString=$S;ll.NAME="VideotexString";var HS,ka,FS=(ka=class extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}},u(ka,"_IA5String"),ka);o(FS,"IA5String");var pl=FS;HS=pl;W.IA5String=HS;pl.NAME="IA5String";var KS,xa,WS=(xa=class extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}},u(xa,"_GraphicString"),xa);o(WS,"GraphicString");var hl=WS;KS=hl;W.GraphicString=KS;hl.NAME="GraphicString";var JS,Pa,zS=(Pa=class extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}},u(Pa,"_VisibleString"),Pa);o(zS,"VisibleString");var Od=zS;JS=Od;W.VisibleString=JS;Od.NAME="VisibleString";var GS,Ia,XS=(Ia=class extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}},u(Ia,"_GeneralString"),Ia);o(XS,"GeneralString");var vl=XS;GS=vl;W.GeneralString=GS;vl.NAME="GeneralString";var ZS,Oa,QS=(Oa=class extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}},u(Oa,"_CharacterString"),Oa);o(QS,"CharacterString");var yl=QS;ZS=yl;W.CharacterString=ZS;yl.NAME="CharacterString";var YS,Ba,e3=(Ba=class extends Od{constructor({value:e,valueDate:t,...n}={}){if(super(n),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let i=0;i<e.length;i++)this.valueBlock.valueHexView[i]=e.charCodeAt(i)}t&&(this.fromDate(t),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,ye.BufferSourceConverter.toUint8Array(e)))}toBuffer(){let e=this.toString(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return t}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){let n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(n===null){this.error="Wrong input string for conversion";return}let i=parseInt(n[1],10);i>=50?this.year=1900+i:this.year=2e3+i,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[6],10)}toString(e="iso"){if(e==="iso"){let t=new Array(7);return t[0]=Ct(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=Ct(this.month,2),t[2]=Ct(this.day,2),t[3]=Ct(this.hour,2),t[4]=Ct(this.minute,2),t[5]=Ct(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}},u(Ba,"_UTCTime"),Ba);o(e3,"UTCTime");var Bd=e3;YS=Bd;W.UTCTime=YS;Bd.NAME="UTCTime";var t3,Na,r3=(Na=class extends Bd{constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){let e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let t=!1,n="",i="",a=0,s,c=0,d=0;if(e[e.length-1]==="Z")n=e.substring(0,e.length-1),t=!0;else{let p=new Number(e[e.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");n=e}if(t){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,v=n.indexOf("+"),b="";if(v===-1&&(v=n.indexOf("-"),p=-1),v!==-1){if(b=n.substring(v+1),n=n.substring(0,v),b.length!==2&&b.length!==4)throw new Error("Wrong input string for conversion");let g=parseInt(b.substring(0,2),10);if(isNaN(g.valueOf()))throw new Error("Wrong input string for conversion");if(c=p*g,b.length===4){if(g=parseInt(b.substring(2,4),10),isNaN(g.valueOf()))throw new Error("Wrong input string for conversion");d=p*g}}}let f=n.indexOf(".");if(f===-1&&(f=n.indexOf(",")),f!==-1){let p=new Number(`0${n.substring(f)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");a=p.valueOf(),i=n.substring(0,f)}else i=n;switch(!0){case i.length===8:if(s=/(\d{4})(\d{2})(\d{2})/ig,f!==-1)throw new Error("Wrong input string for conversion");break;case i.length===10:if(s=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let p=60*a;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case i.length===12:if(s=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let p=60*a;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case i.length===14:if(s=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let p=1e3*a;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}let l=s.exec(i);if(l===null)throw new Error("Wrong input string for conversion");for(let p=1;p<l.length;p++)switch(p){case 1:this.year=parseInt(l[p],10);break;case 2:this.month=parseInt(l[p],10);break;case 3:this.day=parseInt(l[p],10);break;case 4:this.hour=parseInt(l[p],10)+c;break;case 5:this.minute=parseInt(l[p],10)+d;break;case 6:this.second=parseInt(l[p],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){let p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let t=[];return t.push(Ct(this.year,4)),t.push(Ct(this.month,2)),t.push(Ct(this.day,2)),t.push(Ct(this.hour,2)),t.push(Ct(this.minute,2)),t.push(Ct(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(Ct(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}},u(Na,"_GeneralizedTime"),Na);o(r3,"GeneralizedTime");var gl=r3;t3=gl;W.GeneralizedTime=t3;gl.NAME="GeneralizedTime";var n3,Ta,i3=(Ta=class extends Er{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}},u(Ta,"_DATE"),Ta);o(i3,"DATE");var dm=i3;n3=dm;W.DATE=n3;dm.NAME="DATE";var a3,Ra,o3=(Ra=class extends Er{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}},u(Ra,"_TimeOfDay"),Ra);o(o3,"TimeOfDay");var fm=o3;a3=fm;W.TimeOfDay=a3;fm.NAME="TimeOfDay";var s3,ja,u3=(ja=class extends Er{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}},u(ja,"_DateTime"),ja);o(u3,"DateTime");var lm=u3;s3=lm;W.DateTime=s3;lm.NAME="DateTime";var c3,La,d3=(La=class extends Er{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}},u(La,"_Duration"),La);o(d3,"Duration");var pm=d3;c3=pm;W.Duration=c3;pm.NAME="Duration";var f3,Da,l3=(Da=class extends Er{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}},u(Da,"_TIME"),Da);o(l3,"TIME");var hm=l3;f3=hm;W.TIME=f3;hm.NAME="TIME";var Ma,p3=(Ma=class{constructor({name:e=Et,optional:t=!1}={}){this.name=e,this.optional=t}},u(Ma,"_Any"),Ma);o(p3,"Any");var Vr=p3,Va,h3=(Va=class extends Vr{constructor({value:e=[],...t}={}){super(t),this.value=e}},u(Va,"_Choice"),Va);o(h3,"Choice");var zp=h3,Ua,v3=(Ua=class extends Vr{constructor({value:e=new Vr,local:t=!1,...n}={}){super(n),this.value=e,this.local=t}},u(Ua,"_Repeated"),Ua);o(v3,"Repeated");var jf=v3,$a,y3=($a=class{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=ye.BufferSourceConverter.toUint8Array(e)}constructor({data:e=Jp}={}){this.dataView=ye.BufferSourceConverter.toUint8Array(e)}fromBER(e,t,n){let i=t+n;return this.dataView=ye.BufferSourceConverter.toUint8Array(e).subarray(t,i),i}toBER(e){return this.dataView.slice().buffer}},u($a,"_RawData"),$a);o(y3,"RawData");var _6=y3;function tr(r,e,t){if(t instanceof zp){for(let a of t.value)if(tr(r,e,a).verified)return{verified:!0,result:r};{let a={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(Mh)&&(a.name=t.name),a}}if(t instanceof Vr)return t.hasOwnProperty(Mh)&&(r[t.name]=e),{verified:!0,result:r};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(h6 in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(m6 in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(b6 in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let n=t.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(t.idBlock.fromBER(n,0,n.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(t.idBlock.hasOwnProperty(v6)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(y6)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(g6)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(p6 in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:r};if(t.idBlock.isHexOnly){if(!(U1 in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let a=t.idBlock.valueHexView,s=e.idBlock.valueHexView;if(a.length!==s.length)return{verified:!1,result:r};for(let c=0;c<a.length;c++)if(a[c]!==s[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Et),t.name&&(r[t.name]=e)),t instanceof W.Constructed){let a=0,s={verified:!1,result:{error:"Unknown error"}},c=t.valueBlock.value.length;if(c>0&&t.valueBlock.value[0]instanceof jf&&(c=e.valueBlock.value.length),c===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let d=!0;for(let f=0;f<t.valueBlock.value.length;f++)d=d&&(t.valueBlock.value[f].optional||!1);return d?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Et),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let d=0;d<c;d++)if(d-a>=e.valueBlock.value.length){if(t.valueBlock.value[d].optional===!1){let f={verified:!1,result:r};return r.error="Inconsistent length between ASN.1 data and schema",t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Et),t.name&&(delete r[t.name],f.name=t.name)),f}}else if(t.valueBlock.value[0]instanceof jf){if(s=tr(r,e.valueBlock.value[d],t.valueBlock.value[0].value),s.verified===!1)if(t.valueBlock.value[0].optional)a++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Et),t.name&&delete r[t.name]),s;if(Mh in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let f={};w6 in t.valueBlock.value[0]&&t.valueBlock.value[0].local?f=e:f=r,typeof f[t.valueBlock.value[0].name]>"u"&&(f[t.valueBlock.value[0].name]=[]),f[t.valueBlock.value[0].name].push(e.valueBlock.value[d])}}else if(s=tr(r,e.valueBlock.value[d-a],t.valueBlock.value[d]),s.verified===!1)if(t.valueBlock.value[d].optional)a++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Et),t.name&&delete r[t.name]),s;if(s.verified===!1){let d={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Et),t.name&&(delete r[t.name],d.name=t.name)),d}return{verified:!0,result:r}}if(t.primitiveSchema&&U1 in e.valueBlock){let a=Kn(e.valueBlock.valueHexView);if(a.offset===-1){let s={verified:!1,result:a.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Et),t.name&&(delete r[t.name],s.name=t.name)),s}return tr(r,a.result,t.primitiveSchema)}return{verified:!0,result:r}}u(tr,"compareSchema");o(tr,"compareSchema");function g3(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};let t=Kn(ye.BufferSourceConverter.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:tr(t.result,t.result,e)}u(g3,"verifySchema");o(g3,"verifySchema");var ct;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(ct||(ct={}));var Ie;(function(r){r[r.Any=1]="Any",r[r.Boolean=2]="Boolean",r[r.OctetString=3]="OctetString",r[r.BitString=4]="BitString",r[r.Integer=5]="Integer",r[r.Enumerated=6]="Enumerated",r[r.ObjectIdentifier=7]="ObjectIdentifier",r[r.Utf8String=8]="Utf8String",r[r.BmpString=9]="BmpString",r[r.UniversalString=10]="UniversalString",r[r.NumericString=11]="NumericString",r[r.PrintableString=12]="PrintableString",r[r.TeletexString=13]="TeletexString",r[r.VideotexString=14]="VideotexString",r[r.IA5String=15]="IA5String",r[r.GraphicString=16]="GraphicString",r[r.VisibleString=17]="VisibleString",r[r.GeneralString=18]="GeneralString",r[r.CharacterString=19]="CharacterString",r[r.UTCTime=20]="UTCTime",r[r.GeneralizedTime=21]="GeneralizedTime",r[r.DATE=22]="DATE",r[r.TimeOfDay=23]="TimeOfDay",r[r.DateTime=24]="DateTime",r[r.Duration=25]="Duration",r[r.TIME=26]="TIME",r[r.Null=27]="Null"})(Ie||(Ie={}));var jB=$n(tl()),$1=$n(tl()),qa,m3=(qa=class{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):$1.BufferSourceConverter.isBufferSource(e)?this.buffer=$1.BufferSourceConverter.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof nr))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new nr({valueHex:this.buffer})}toSchema(e){return new nr({name:e})}},u(qa,"_OctetString2"),qa);o(m3,"OctetString");var ly=m3,S6={fromASN:o(r=>r instanceof or?null:r.valueBeforeDecodeView,"fromASN"),toASN:o(r=>{if(r===null)return new or;let e=Ft(r);if(e.result.error)throw new Error(e.result.error);return e.result},"toASN")},A6={fromASN:o(r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,"fromASN"),toASN:o(r=>new Wn({value:+r}),"toASN")},C6={fromASN:o(r=>r.valueBlock.valueDec,"fromASN"),toASN:o(r=>new al({value:r}),"toASN")},E6={fromASN:o(r=>r.valueBlock.valueHexView,"fromASN"),toASN:o(r=>new tn({valueHex:r}),"toASN")},k6={fromASN:o(r=>r.valueBlock.toString(),"fromASN"),toASN:o(r=>new ol({value:r}),"toASN")},x6={fromASN:o(r=>r.valueBlock.value,"fromASN"),toASN:o(r=>new il({value:r}),"toASN")},P6={fromASN:o(r=>r.valueBlock.valueHexView,"fromASN"),toASN:o(r=>new nr({valueHex:r}),"toASN")};function Mt(r){return{fromASN:o(e=>e.valueBlock.value,"fromASN"),toASN:o(e=>new r({value:e}),"toASN")}}u(Mt,"createStringConverter");o(Mt,"createStringConverter");var b3=Mt(Er),I6=Mt(sl),O6=Mt(ul),B6=Mt(cl),N6=Mt(dl),T6=Mt(fl),R6=Mt(ll),j6=Mt(pl),L6=Mt(hl),D6=Mt(Od),M6=Mt(vl),V6=Mt(yl),U6={fromASN:o(r=>r.toDate(),"fromASN"),toASN:o(r=>new Bd({valueDate:r}),"toASN")},$6={fromASN:o(r=>r.toDate(),"fromASN"),toASN:o(r=>new gl({valueDate:r}),"toASN")},q6={fromASN:o(()=>null,"fromASN"),toASN:o(()=>new or,"toASN")};function Ef(r){switch(r){case Ie.Any:return S6;case Ie.BitString:return E6;case Ie.BmpString:return I6;case Ie.Boolean:return x6;case Ie.CharacterString:return V6;case Ie.Enumerated:return C6;case Ie.GeneralString:return M6;case Ie.GeneralizedTime:return $6;case Ie.GraphicString:return L6;case Ie.IA5String:return j6;case Ie.Integer:return A6;case Ie.Null:return q6;case Ie.NumericString:return B6;case Ie.ObjectIdentifier:return k6;case Ie.OctetString:return P6;case Ie.PrintableString:return N6;case Ie.TeletexString:return T6;case Ie.UTCTime:return U6;case Ie.UniversalString:return O6;case Ie.Utf8String:return b3;case Ie.VideotexString:return R6;case Ie.VisibleString:return D6;default:return null}}u(Ef,"defaultConverter");o(Ef,"defaultConverter");function gr(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:gr(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}u(gr,"isConvertible");o(gr,"isConvertible");function vm(r){var e;if(r){let t=Object.getPrototypeOf(r);return((e=t?.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:vm(t)}return!1}u(vm,"isTypeOfArray");o(vm,"isTypeOfArray");function w3(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<r.byteLength;i++)if(t[i]!==n[i])return!1;return!0}u(w3,"isArrayEqual");o(w3,"isArrayEqual");var Ha,_3=(Ha=class{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,t=!1){let n=this.items.get(e);if(!n)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(t&&!n.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return n}cache(e){let t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){let t={type:ct.Sequence,items:{}},n=this.findParentSchema(e);return n&&(Object.assign(t,n),t.items=Object.assign({},t.items,n.items)),t}create(e,t){let n=this.items.get(e)||this.createDefault(e),i=[];for(let a in n.items){let s=n.items[a],c=t?a:"",d;if(typeof s.type=="number"){let l=Ie[s.type],p=nl[l];if(!p)throw new Error(`Cannot get ASN1 class by name '${l}'`);d=new p({name:c})}else gr(s.type)?d=new s.type().toSchema(c):s.optional?this.get(s.type).type===ct.Choice?d=new Vr({name:c}):(d=this.create(s.type,!1),d.name=c):d=new Vr({name:c});let f=!!s.optional||s.defaultValue!==void 0;if(s.repeated){d.name="";let l=s.repeated==="set"?pt:it;d=new l({name:"",value:[new jf({name:c,value:d})]})}if(s.context!==null&&s.context!==void 0)if(s.implicit)if(typeof s.type=="number"||gr(s.type)){let l=s.repeated?qe:Fn;i.push(new l({name:c,optional:f,idBlock:{tagClass:3,tagNumber:s.context}}))}else{this.cache(s.type);let l=!!s.repeated,p=l?d:this.get(s.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,i.push(new qe({name:l?"":c,optional:f,idBlock:{tagClass:3,tagNumber:s.context},value:p}))}else i.push(new qe({optional:f,idBlock:{tagClass:3,tagNumber:s.context},value:[d]}));else d.optional=f,i.push(d)}switch(n.type){case ct.Sequence:return new it({value:i,name:""});case ct.Set:return new pt({value:i,name:""});case ct.Choice:return new zp({value:i,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,t){return this.items.set(e,t),this}findParentSchema(e){let t=Object.getPrototypeOf(e);return t?this.items.get(t)||this.findParentSchema(t):null}},u(Ha,"_AsnSchemaStorage"),Ha);o(_3,"AsnSchemaStorage");var H6=_3,Or=new H6,Fa,S3=(Fa=class extends Error{constructor(){super(...arguments),this.schemas=[]}},u(Fa,"_AsnSchemaValidationError"),Fa);o(S3,"AsnSchemaValidationError");var Zd=S3,Ka,A3=(Ka=class{static parse(e,t){let n=Ft(e);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,t)}static fromASN(e,t){try{if(gr(t))return new t().fromASN(e);let n=Or.get(t);Or.cache(t);let i=n.schema,a=this.handleChoiceTypes(e,n,t,i);if(a?.result)return a.result;a?.targetSchema&&(i=a.targetSchema);let s=this.handleSequenceTypes(e,n,t,i),c=new t;return vm(t)?this.handleArrayTypes(e,n,t):(this.processSchemaItems(n,s,c),c)}catch(n){throw n instanceof Zd&&n.schemas.push(t.name),n}}static handleChoiceTypes(e,t,n,i){if(e.constructor===qe&&t.type===ct.Choice&&e.idBlock.tagClass===3)for(let a in t.items){let s=t.items[a];if(s.context===e.idBlock.tagNumber&&s.implicit&&typeof s.type=="function"&&Or.has(s.type)){let c=Or.get(s.type);if(c&&c.type===ct.Sequence){let d=new it;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in d.valueBlock){d.valueBlock.value=e.valueBlock.value;let f=this.fromASN(d,s.type),l=new n;return l[a]=f,{result:l}}}}}else if(e.constructor===qe&&t.type!==ct.Choice){let a=new qe({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(let s in t.items)delete e[s];return{targetSchema:a}}return null}static handleSequenceTypes(e,t,n,i){if(t.type===ct.Sequence){let a=tr({},e,i);if(!a.verified)throw new Zd(`Data does not match to ${n.name} ASN1 schema.${a.result.error?` ${a.result.error}`:""}`);return a}else{let a=tr({},e,i);if(!a.verified)throw new Zd(`Data does not match to ${n.name} ASN1 schema.${a.result.error?` ${a.result.error}`:""}`);return a}}static processRepeatedField(e,t,n){let i=e.slice(t);if(i.length===1&&i[0].constructor.name==="Sequence"){let a=i[0];a.valueBlock&&a.valueBlock.value&&Array.isArray(a.valueBlock.value)&&(i=a.valueBlock.value)}if(typeof n.type=="number"){let a=Ef(n.type);if(!a)throw new Error(`No converter for ASN.1 type ${n.type}`);return i.filter(s=>s&&s.valueBlock).map(s=>{try{return a.fromASN(s)}catch{return}}).filter(s=>s!==void 0)}else return i.filter(a=>a&&a.valueBlock).map(a=>{try{return this.fromASN(a,n.type)}catch{return}}).filter(a=>a!==void 0)}static processPrimitiveField(e,t){let n=Ef(t.type);if(!n)throw new Error(`No converter for ASN.1 type ${t.type}`);return n.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&Or.has(e.type)&&Or.get(e.type).type===ct.Choice}static processOptionalChoiceField(e,t){try{return{processed:!0,value:this.fromASN(e,t.type)}}catch(n){if(n instanceof Zd&&/Wrong values for Choice type/.test(n.message))return{processed:!1};throw n}}static handleArrayTypes(e,t,n){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let i=t.itemType;if(typeof i=="number"){let a=Ef(i);if(!a)throw new Error(`Cannot get default converter for array item of ${n.name} ASN1 schema`);return n.from(e.valueBlock.value,s=>a.fromASN(s))}else return n.from(e.valueBlock.value,a=>this.fromASN(a,i))}static processSchemaItems(e,t,n){for(let i in e.items){let a=t.result[i];if(!a)continue;let s=e.items[i],c=s.type,d;typeof c=="number"||gr(c)?d=this.processPrimitiveSchemaItem(a,s,c):d=this.processComplexSchemaItem(a,s,c),d&&typeof d=="object"&&"value"in d&&"raw"in d?(n[i]=d.value,n[`${i}Raw`]=d.raw):n[i]=d}}static processPrimitiveSchemaItem(e,t,n){var i;let a=(i=t.converter)!==null&&i!==void 0?i:gr(n)?new n:null;if(!a)throw new Error("Converter is empty");return t.repeated?this.processRepeatedPrimitiveItem(e,t,a):this.processSinglePrimitiveItem(e,t,n,a)}static processRepeatedPrimitiveItem(e,t,n){if(t.implicit){let i=t.repeated==="sequence"?it:pt,a=new i;a.valueBlock=e.valueBlock;let s=Ft(a.toBER(!1));if(s.offset===-1)throw new Error(`Cannot parse the child item. ${s.result.error}`);if(!("value"in s.result.valueBlock&&Array.isArray(s.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let c=s.result.valueBlock.value;return Array.from(c,d=>n.fromASN(d))}else return Array.from(e,i=>n.fromASN(i))}static processSinglePrimitiveItem(e,t,n,i){let a=e;if(t.implicit){let s;if(gr(n))s=new n().toSchema("");else{let c=Ie[n],d=nl[c];if(!d)throw new Error(`Cannot get '${c}' class from asn1js module`);s=new d}s.valueBlock=a.valueBlock,a=Ft(s.toBER(!1)).result}return i.fromASN(a)}static processComplexSchemaItem(e,t,n){if(t.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,i=>this.fromASN(i,n))}else{let i=this.handleImplicitTagging(e,t,n);if(this.isOptionalChoiceField(t))try{return this.fromASN(i,n)}catch(a){if(a instanceof Zd&&/Wrong values for Choice type/.test(a.message))return;throw a}else{let a=this.fromASN(i,n);return t.raw?{value:a,raw:e.valueBeforeDecodeView}:a}}}static handleImplicitTagging(e,t,n){if(t.implicit&&typeof t.context=="number"){let i=Or.get(n);if(i.type===ct.Sequence){let a=new it;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in a.valueBlock)return a.valueBlock.value=e.valueBlock.value,a}else if(i.type===ct.Set){let a=new pt;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in a.valueBlock)return a.valueBlock.value=e.valueBlock.value,a}}return e}},u(Ka,"_AsnParser"),Ka);o(A3,"AsnParser");var F6=A3,bn,C3=(bn=class{static serialize(e){return e instanceof st?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&gr(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");let t=e.constructor,n=Or.get(t);Or.cache(t);let i=[];if(n.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof n.itemType=="number"){let s=Ef(n.itemType);if(!s)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);i=e.map(c=>s.toASN(c))}else i=e.map(s=>this.toAsnItem({type:n.itemType},"[]",t,s))}else for(let s in n.items){let c=n.items[s],d=e[s];if(d===void 0||c.defaultValue===d||typeof c.defaultValue=="object"&&typeof d=="object"&&w3(this.serialize(c.defaultValue),this.serialize(d)))continue;let f=bn.toAsnItem(c,s,t,d);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||gr(c.type))){let l={};l.valueHex=f instanceof or?f.valueBeforeDecodeView:f.valueBlock.toBER(),i.push(new Fn({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...l}))}else i.push(new qe({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:f.valueBlock.value}));else i.push(new qe({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[f]}));else c.repeated?i=i.concat(f):i.push(f)}let a;switch(n.type){case ct.Sequence:a=new it({value:i});break;case ct.Set:a=new pt({value:i});break;case ct.Choice:if(!i[0])throw new Error(`Schema '${t.name}' has wrong data. Choice cannot be empty.`);a=i[0];break}return a}static toAsnItem(e,t,n,i){let a;if(typeof e.type=="number"){let s=e.converter;if(!s)throw new Error(`Property '${t}' doesn't have converter for type ${Ie[e.type]} in schema '${n.name}'`);if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");let c=Array.from(i,f=>s.toASN(f)),d=e.repeated==="sequence"?it:pt;a=new d({value:c})}else a=s.toASN(i)}else if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");let s=Array.from(i,d=>this.toASN(d)),c=e.repeated==="sequence"?it:pt;a=new c({value:s})}else a=this.toASN(i);return a}},u(bn,"_AsnSerializer"),bn);o(C3,"AsnSerializer");var K6=C3,q1=$n(tl()),wn,E3=(wn=class{static serialize(e){return K6.serialize(e)}static parse(e,t){return F6.parse(e,t)}static toString(e){let t=q1.BufferSourceConverter.isBufferSource(e)?q1.BufferSourceConverter.toArrayBuffer(e):wn.serialize(e),n=Ft(t);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}},u(wn,"_AsnConvert"),wn);o(E3,"AsnConvert");var X=E3;function h(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}u(h,"__decorate");o(h,"__decorate");function ce(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}u(ce,"__classPrivateFieldGet");o(ce,"__classPrivateFieldGet");function je(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t}u(je,"__classPrivateFieldSet");o(je,"__classPrivateFieldSet");var W6="[object ArrayBuffer]",J6="[object SharedArrayBuffer]";function ym(r){return Object.prototype.toString.call(r)}u(ym,"tagOf");o(ym,"tagOf");function k3(r){if(ArrayBuffer.isView(r))return!0;if(!r||typeof r!="object")return!1;let e=r;return typeof e.byteOffset=="number"&&typeof e.byteLength=="number"&&Gp(e.buffer)}u(k3,"isArrayBufferViewLike");o(k3,"isArrayBufferViewLike");function gm(r){return ym(r)===W6}u(gm,"isArrayBuffer");o(gm,"isArrayBuffer");function x3(r){return typeof SharedArrayBuffer<"u"&&ym(r)===J6}u(x3,"isSharedArrayBuffer");o(x3,"isSharedArrayBuffer");function Gp(r){return gm(r)||x3(r)}u(Gp,"isArrayBufferLike");o(Gp,"isArrayBufferLike");function P3(r){return k3(r)}u(P3,"isArrayBufferView");o(P3,"isArrayBufferView");function ml(r){return Gp(r)||P3(r)}u(ml,"isBufferSource");o(ml,"isBufferSource");function mm(r){if(!ml(r))throw new TypeError("Expected ArrayBuffer, SharedArrayBuffer, or ArrayBufferView")}u(mm,"assertBufferSource");o(mm,"assertBufferSource");function Lf(r){return mm(r),Gp(r)?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}u(Lf,"toUint8Array");o(Lf,"toUint8Array");function Jt(r){if(mm(r),gm(r))return r;let e=new ArrayBuffer(r.byteLength);return new Uint8Array(e).set(Lf(r)),e}u(Jt,"toArrayBuffer");o(Jt,"toArrayBuffer");function I3(r,e,t={}){let n=Lf(r),i=Lf(e);if(!t.constantTime&&n.byteLength!==i.byteLength)return!1;let a=Math.max(n.byteLength,i.byteLength),s=n.byteLength^i.byteLength;for(let c=0;c<a;c++)s|=(n[c]??0)^(i[c]??0);return s===0}u(I3,"equal");o(I3,"equal");var D;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(D||(D={}));var k;(function(r){r[r.Any=1]="Any",r[r.Boolean=2]="Boolean",r[r.OctetString=3]="OctetString",r[r.BitString=4]="BitString",r[r.Integer=5]="Integer",r[r.Enumerated=6]="Enumerated",r[r.ObjectIdentifier=7]="ObjectIdentifier",r[r.Utf8String=8]="Utf8String",r[r.BmpString=9]="BmpString",r[r.UniversalString=10]="UniversalString",r[r.NumericString=11]="NumericString",r[r.PrintableString=12]="PrintableString",r[r.TeletexString=13]="TeletexString",r[r.VideotexString=14]="VideotexString",r[r.IA5String=15]="IA5String",r[r.GraphicString=16]="GraphicString",r[r.VisibleString=17]="VisibleString",r[r.GeneralString=18]="GeneralString",r[r.CharacterString=19]="CharacterString",r[r.UTCTime=20]="UTCTime",r[r.GeneralizedTime=21]="GeneralizedTime",r[r.DATE=22]="DATE",r[r.TimeOfDay=23]="TimeOfDay",r[r.DateTime=24]="DateTime",r[r.Duration=25]="Duration",r[r.TIME=26]="TIME",r[r.Null=27]="Null"})(k||(k={}));var Wa,O3=(Wa=class{constructor(e,t=0){if(y(this,"unusedBits",0),y(this,"value",new ArrayBuffer(0)),e)if(typeof e=="number")this.fromNumber(e);else if(ml(e))this.unusedBits=t,this.value=Jt(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof tn))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=Jt(e.valueBlock.valueHex),this}toASN(){return new tn({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new tn({name:e})}toNumber(){let e="",t=new Uint8Array(this.value);for(let n of t)e+=n.toString(2).padStart(8,"0");return e=e.split("").reverse().join(""),this.unusedBits&&(e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(e,2)}fromNumber(e){let t=e.toString(2),n=t.length+7>>3;this.unusedBits=(n<<3)-t.length;let i=new Uint8Array(n);t=t.padStart(n<<3,"0").split("").reverse().join("");let a=0;for(;a<n;)i[a]=parseInt(t.slice(a<<3,(a<<3)+8),2),a++;this.value=i.buffer}},u(Wa,"_BitString2"),Wa);o(O3,"BitString");var Xp=O3,Ja,B3=(Ja=class{constructor(e){y(this,"buffer"),typeof e=="number"?this.buffer=new ArrayBuffer(e):ml(e)?this.buffer=Jt(e):Array.isArray(e)?this.buffer=new Uint8Array(e).buffer:this.buffer=new ArrayBuffer(0)}get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}fromASN(e){if(!(e instanceof nr))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=Jt(e.valueBlock.valueHex),this}toASN(){return new nr({valueHex:this.buffer})}toSchema(e){return new nr({name:e})}},u(Ja,"_OctetString3"),Ja);o(B3,"OctetString");var Ce=B3,z6={fromASN:o(r=>r instanceof or?null:Jt(r.valueBeforeDecodeView),"fromASN"),toASN:o(r=>{if(r===null)return new or;let e=Ft(r);if(e.result.error)throw new Error(e.result.error);return e.result},"toASN")},G6={fromASN:o(r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,"fromASN"),toASN:o(r=>new Wn({value:+r}),"toASN")},X6={fromASN:o(r=>r.valueBlock.valueDec,"fromASN"),toASN:o(r=>new al({value:r}),"toASN")},Le={fromASN:o(r=>Jt(r.valueBlock.valueHexView),"fromASN"),toASN:o(r=>new Wn({valueHex:r}),"toASN")},Z6={fromASN:o(r=>Jt(r.valueBlock.valueHexView),"fromASN"),toASN:o(r=>new tn({valueHex:r}),"toASN")},Q6={fromASN:o(r=>r.valueBlock.toString(),"fromASN"),toASN:o(r=>new ol({value:r}),"toASN")},Y6={fromASN:o(r=>r.valueBlock.value,"fromASN"),toASN:o(r=>new il({value:r}),"toASN")},Ql={fromASN:o(r=>Jt(r.valueBlock.valueHexView),"fromASN"),toASN:o(r=>new nr({valueHex:r}),"toASN")},eP={fromASN:o(r=>new Ce(r.getValue()),"fromASN"),toASN:o(r=>r.toASN(),"toASN")};function Vt(r){return{fromASN:o(e=>e.valueBlock.value,"fromASN"),toASN:o(e=>new r({value:e}),"toASN")}}u(Vt,"createStringConverter2");o(Vt,"createStringConverter");var tP=Vt(Er),rP=Vt(sl),nP=Vt(ul),iP=Vt(cl),aP=Vt(dl),oP=Vt(fl),sP=Vt(ll),uP=Vt(pl),cP=Vt(hl),dP=Vt(Od),fP=Vt(vl),lP=Vt(yl),pP={fromASN:o(r=>r.toDate(),"fromASN"),toASN:o(r=>new Bd({valueDate:r}),"toASN")},hP={fromASN:o(r=>r.toDate(),"fromASN"),toASN:o(r=>new gl({valueDate:r}),"toASN")},vP={fromASN:o(()=>null,"fromASN"),toASN:o(()=>new or,"toASN")};function oi(r){switch(r){case k.Any:return z6;case k.BitString:return Z6;case k.BmpString:return rP;case k.Boolean:return Y6;case k.CharacterString:return lP;case k.Enumerated:return X6;case k.GeneralString:return fP;case k.GeneralizedTime:return hP;case k.GraphicString:return cP;case k.IA5String:return uP;case k.Integer:return G6;case k.Null:return vP;case k.NumericString:return iP;case k.ObjectIdentifier:return Q6;case k.OctetString:return Ql;case k.PrintableString:return aP;case k.TeletexString:return oP;case k.UTCTime:return pP;case k.UniversalString:return nP;case k.Utf8String:return tP;case k.VideotexString:return sP;case k.VisibleString:return dP;default:return null}}u(oi,"defaultConverter2");o(oi,"defaultConverter");function mr(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:mr(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}u(mr,"isConvertible2");o(mr,"isConvertible");function bm(r){if(r){let e=Object.getPrototypeOf(r);return e?.prototype?.constructor===Array?!0:bm(e)}return!1}u(bm,"isTypeOfArray2");o(bm,"isTypeOfArray");function N3(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<r.byteLength;i++)if(t[i]!==n[i])return!1;return!0}u(N3,"isArrayEqual2");o(N3,"isArrayEqual");var za,T3=(za=class{constructor(){y(this,"items",new WeakMap)}has(e){return this.items.has(e)}get(e,t=!1){let n=this.items.get(e);if(!n)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(t&&!n.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return n}cache(e){let t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){let t={type:D.Sequence,items:{}},n=this.findParentSchema(e);return n&&(Object.assign(t,n),t.items=Object.assign({},t.items,n.items)),t}create(e,t){let n=this.items.get(e)||this.createDefault(e),i=[];for(let a in n.items){let s=n.items[a],c=t?a:"",d;if(typeof s.type=="number"){let l=k[s.type],p=nl[l];if(!p)throw new Error(`Cannot get ASN1 class by name '${l}'`);d=new p({name:c})}else mr(s.type)?d=new s.type().toSchema(c):s.optional?this.get(s.type).type===D.Choice?d=new Vr({name:c}):(d=this.create(s.type,!1),d.name=c):d=new Vr({name:c});let f=!!s.optional||s.defaultValue!==void 0;if(s.repeated){d.name="";let l=s.repeated==="set"?pt:it;d=new l({name:"",value:[new jf({name:c,value:d})]})}if(s.context!==null&&s.context!==void 0)if(s.implicit)if(typeof s.type=="number"||mr(s.type)){let l=s.repeated?qe:Fn;i.push(new l({name:c,optional:f,idBlock:{tagClass:3,tagNumber:s.context}}))}else{this.cache(s.type);let l=!!s.repeated,p=l?d:this.get(s.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,i.push(new qe({name:l?"":c,optional:f,idBlock:{tagClass:3,tagNumber:s.context},value:p}))}else i.push(new qe({optional:f,idBlock:{tagClass:3,tagNumber:s.context},value:[d]}));else d.optional=f,i.push(d)}switch(n.type){case D.Sequence:return new it({value:i,name:""});case D.Set:return new pt({value:i,name:""});case D.Choice:return new zp({value:i,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,t){return this.items.set(e,t),this}findParentSchema(e){let t=Object.getPrototypeOf(e);return t?this.items.get(t)||this.findParentSchema(t):null}},u(za,"_AsnSchemaStorage2"),za);o(T3,"AsnSchemaStorage");var yP=T3,dt=new yP,$=o(r=>e=>{let t;dt.has(e)?t=dt.get(e):(t=dt.createDefault(e),dt.set(e,t)),Object.assign(t,r)},"AsnType"),m=o(r=>(e,t)=>{let n;dt.has(e.constructor)?n=dt.get(e.constructor):(n=dt.createDefault(e.constructor),dt.set(e.constructor,n));let i=Object.assign({},r);if(typeof i.type=="number"&&!i.converter){let a=oi(r.type);if(!a)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);i.converter=a}i.raw=r.raw,n.items[t]=i},"AsnProp"),Ga,R3=(Ga=class extends Error{constructor(){super(...arguments),y(this,"schemas",[])}},u(Ga,"_AsnSchemaValidationError2"),Ga);o(R3,"AsnSchemaValidationError");var Qd=R3,Xa,j3=(Xa=class{static parse(e,t){let n=Ft(Jt(e));if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,t)}static fromASN(e,t){try{if(mr(t))return new t().fromASN(e);let n=dt.get(t);dt.cache(t);let i=n.schema,a=this.handleChoiceTypes(e,n,t,i);if(a?.result)return a.result;a?.targetSchema&&(i=a.targetSchema);let s=this.handleSequenceTypes(e,n,t,i),c=new t;return bm(t)?this.handleArrayTypes(e,n,t):(this.processSchemaItems(n,s,c),c)}catch(n){throw n instanceof Qd&&n.schemas.push(t.name),n}}static handleChoiceTypes(e,t,n,i){if(e.constructor===qe&&t.type===D.Choice&&e.idBlock.tagClass===3)for(let a in t.items){let s=t.items[a];if(s.context===e.idBlock.tagNumber&&s.implicit&&typeof s.type=="function"&&dt.has(s.type)){let c=dt.get(s.type);if(c&&c.type===D.Sequence){let d=new it;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in d.valueBlock){d.valueBlock.value=e.valueBlock.value;let f=this.fromASN(d,s.type),l=new n;return l[a]=f,{result:l}}}}}else if(e.constructor===qe&&t.type!==D.Choice){let a=new qe({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(let s in t.items)delete e[s];return{targetSchema:a}}return null}static handleSequenceTypes(e,t,n,i){if(t.type===D.Sequence){let a=tr({},e,i);if(!a.verified)throw new Qd(`Data does not match to ${n.name} ASN1 schema.${a.result.error?` ${a.result.error}`:""}`);return a}else{let a=tr({},e,i);if(!a.verified)throw new Qd(`Data does not match to ${n.name} ASN1 schema.${a.result.error?` ${a.result.error}`:""}`);return a}}static processRepeatedField(e,t,n){let i=e.slice(t);if(i.length===1&&i[0].constructor.name==="Sequence"){let a=i[0];a.valueBlock&&a.valueBlock.value&&Array.isArray(a.valueBlock.value)&&(i=a.valueBlock.value)}if(typeof n.type=="number"){let a=oi(n.type);if(!a)throw new Error(`No converter for ASN.1 type ${n.type}`);return i.filter(s=>s&&s.valueBlock).map(s=>{try{return a.fromASN(s)}catch{return}}).filter(s=>s!==void 0)}else return i.filter(a=>a&&a.valueBlock).map(a=>{try{return this.fromASN(a,n.type)}catch{return}}).filter(a=>a!==void 0)}static processPrimitiveField(e,t){let n=oi(t.type);if(!n)throw new Error(`No converter for ASN.1 type ${t.type}`);return n.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&dt.has(e.type)&&dt.get(e.type).type===D.Choice}static processOptionalChoiceField(e,t){try{return{processed:!0,value:this.fromASN(e,t.type)}}catch(n){if(n instanceof Qd&&/Wrong values for Choice type/.test(n.message))return{processed:!1};throw n}}static handleArrayTypes(e,t,n){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let i=t.itemType;if(typeof i=="number"){let a=oi(i);if(!a)throw new Error(`Cannot get default converter for array item of ${n.name} ASN1 schema`);return n.from(e.valueBlock.value,s=>a.fromASN(s))}else return n.from(e.valueBlock.value,a=>this.fromASN(a,i))}static processSchemaItems(e,t,n){for(let i in e.items){let a=t.result[i];if(!a)continue;let s=e.items[i],c=s.type,d;typeof c=="number"||mr(c)?d=this.processPrimitiveSchemaItem(a,s,c):d=this.processComplexSchemaItem(a,s,c),d&&typeof d=="object"&&"value"in d&&"raw"in d?(n[i]=d.value,n[`${i}Raw`]=d.raw):n[i]=d}}static processPrimitiveSchemaItem(e,t,n){let i=t.converter??(mr(n)?new n:null);if(!i)throw new Error("Converter is empty");return t.repeated?this.processRepeatedPrimitiveItem(e,t,i):this.processSinglePrimitiveItem(e,t,n,i)}static processRepeatedPrimitiveItem(e,t,n){if(t.implicit){let i=t.repeated==="sequence"?it:pt,a=new i;a.valueBlock=e.valueBlock;let s=Ft(a.toBER(!1));if(s.offset===-1)throw new Error(`Cannot parse the child item. ${s.result.error}`);if(!("value"in s.result.valueBlock&&Array.isArray(s.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let c=s.result.valueBlock.value;return Array.from(c,d=>n.fromASN(d))}else return Array.from(e,i=>n.fromASN(i))}static processSinglePrimitiveItem(e,t,n,i){let a=e;if(t.implicit){let s;if(mr(n))s=new n().toSchema("");else{let c=k[n],d=nl[c];if(!d)throw new Error(`Cannot get '${c}' class from asn1js module`);s=new d}s.valueBlock=a.valueBlock,a=Ft(s.toBER(!1)).result}return i.fromASN(a)}static processComplexSchemaItem(e,t,n){if(t.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,i=>this.fromASN(i,n))}else{let i=this.handleImplicitTagging(e,t,n);if(this.isOptionalChoiceField(t))try{return this.fromASN(i,n)}catch(a){if(a instanceof Qd&&/Wrong values for Choice type/.test(a.message))return;throw a}else{let a=this.fromASN(i,n);return t.raw?{value:a,raw:e.valueBeforeDecodeView}:a}}}static handleImplicitTagging(e,t,n){if(t.implicit&&typeof t.context=="number"){let i=dt.get(n);if(i.type===D.Sequence){let a=new it;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in a.valueBlock)return a.valueBlock.value=e.valueBlock.value,a}else if(i.type===D.Set){let a=new pt;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in a.valueBlock)return a.valueBlock.value=e.valueBlock.value,a}}return e}},u(Xa,"_AsnParser2"),Xa);o(j3,"AsnParser");var gP=j3,_n,L3=(_n=class{static serialize(e){return e instanceof st?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&mr(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");let t=e.constructor,n=dt.get(t);dt.cache(t);let i=[];if(n.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof n.itemType=="number"){let s=oi(n.itemType);if(!s)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);i=e.map(c=>s.toASN(c))}else i=e.map(s=>this.toAsnItem({type:n.itemType},"[]",t,s))}else for(let s in n.items){let c=n.items[s],d=e[s];if(d===void 0||c.defaultValue===d||typeof c.defaultValue=="object"&&typeof d=="object"&&N3(this.serialize(c.defaultValue),this.serialize(d)))continue;let f=_n.toAsnItem(c,s,t,d);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||mr(c.type))){let l={};l.valueHex=f instanceof or?Jt(f.valueBeforeDecodeView):f.valueBlock.toBER(),i.push(new Fn({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...l}))}else i.push(new qe({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:f.valueBlock.value}));else i.push(new qe({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[f]}));else c.repeated?i=i.concat(f):i.push(f)}let a;switch(n.type){case D.Sequence:a=new it({value:i});break;case D.Set:a=new pt({value:i});break;case D.Choice:if(!i[0])throw new Error(`Schema '${t.name}' has wrong data. Choice cannot be empty.`);a=i[0];break}return a}static toAsnItem(e,t,n,i){let a;if(typeof e.type=="number"){let s=e.converter;if(!s)throw new Error(`Property '${t}' doesn't have converter for type ${k[e.type]} in schema '${n.name}'`);if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");let c=Array.from(i,f=>s.toASN(f)),d=e.repeated==="sequence"?it:pt;a=new d({value:c})}else a=s.toASN(i)}else if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");let s=Array.from(i,d=>this.toASN(d)),c=e.repeated==="sequence"?it:pt;a=new c({value:s})}else a=this.toASN(i);return a}},u(_n,"_AsnSerializer2"),_n);o(L3,"AsnSerializer");var mP=L3,Za,D3=(Za=class extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(let t of e)this.push(t)}}},u(Za,"_AsnArray"),Za);o(D3,"AsnArray");var ke=D3,Sn,M3=(Sn=class{static serialize(e){return mP.serialize(e)}static parse(e,t){return gP.parse(e,t)}static toString(e){let t=ml(e)?Jt(e):Sn.serialize(e),n=Ft(t);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}},u(Sn,"_AsnConvert2"),Sn);o(M3,"AsnConvert");var Nd=M3,wm={};Tw(wm,{decode:u(()=>Qp,"decode"),encode:u(()=>Zp,"encode"),format:u(()=>Am,"format"),formats:u(()=>J3,"formats"),hex:u(()=>_P,"hex"),is:u(()=>_m,"is"),normalize:u(()=>Td,"normalize"),parse:u(()=>Sm,"parse")});var bP=/^[0-9a-f]$/i,wP=[" "," ",`
15
- `,"\r",":","-","."];function V3(r){return r.separators==="none"?[]:!r.separators||r.separators==="common"?wP:r.separators}u(V3,"resolveSeparators");o(V3,"resolveSeparators");function U3(r){if(!r)throw new TypeError("Hex separators must be non-empty strings")}u(U3,"validateSeparator");o(U3,"validateSeparator");function $3(r,e,t){for(let n of t)if(r.startsWith(n,e))return n}u($3,"matchSeparator");o($3,"matchSeparator");function q3(r){let e=/[A-F]/.test(r),t=/[a-f]/.test(r);return e&&!t?"upper":"lower"}u(q3,"detectCase");o(q3,"detectCase");function H3(r){let e=/\r\n|\n/.exec(r);if(e)return e[0]===`\r
16
- `?`\r
17
- `:`
18
- `}u(H3,"detectLineSeparator");o(H3,"detectLineSeparator");function py(r){return r.replace(/[^0-9a-f]/gi,"")}u(py,"compactForDetection");o(py,"compactForDetection");function F3(r){let e=r.match(/[0-9A-Fa-f]+|[^0-9A-Fa-f]+/g)??[];if(e.length<3)return;let t=e.filter((s,c)=>c%2===0),n=e.filter((s,c)=>c%2===1),i=n[0];if(!i||n.some(s=>s!==i)||t.some(s=>s.length===0||s.length%2!==0))return;let a=t[0]?.length??0;if(a&&!t.slice(0,-1).some(s=>s.length!==a)&&!((t[t.length-1]?.length??0)>a))return{size:a/2,separator:i}}u(F3,"detectGroup");o(F3,"detectGroup");function K3(r){let e=r.trim(),t=/^0x/i.test(e)?"0x":"",n=t?e.slice(2):e,i=H3(n),a=n.split(/\r\n|\n/).filter(f=>f.length>0),s=a[0]?.trim()??"",c=F3(s),d={case:q3(e),prefix:t};if(c&&(d.group=c),i&&a.length>1){let f=py(a[0]??"").length/2;f>0&&a.slice(0,-1).every(l=>py(l).length/2===f)&&(d.line={bytesPerLine:f,separator:i})}return d}u(K3,"detectFormat");o(K3,"detectFormat");function W3(r,e){let t=e.allowPrefix??!0,n=[...V3(e)].sort((c,d)=>d.length-c.length);for(let c of n)U3(c);let i=r.trim();if(/^0x/i.test(i)){if(!t)throw new TypeError("Hexadecimal text must not include a 0x prefix");i=i.slice(2)}let a="",s=!1;for(let c=0;c<i.length;){let d=i[c]??"";if(bP.test(d)){a+=d,s=!1,c+=1;continue}let f=$3(i,c,n);if(!f)throw new TypeError("Input is not valid hexadecimal text");if(e.strict&&(s||a.length===0))throw new TypeError("Hexadecimal text contains misplaced separators");s=!0,c+=f.length}if(e.strict&&s&&a.length>0)throw new TypeError("Hexadecimal text must not end with a separator");if(a.length%2!==0){if(!e.allowOddLength)throw new TypeError("Hexadecimal text must contain an even number of characters");a=`0${a}`}return a.toLowerCase()}u(W3,"normalizeText");o(W3,"normalizeText");function hy(r,e){if(!e)return r.join("");if(!Number.isInteger(e.size)||e.size<1)throw new RangeError("Hex group size must be a positive integer");let t=[];for(let n=0;n<r.length;n+=e.size)t.push(r.slice(n,n+e.size).join(""));return t.join(e.separator)}u(hy,"groupPairs");o(hy,"groupPairs");function Td(r,e={}){return W3(r,e)}u(Td,"normalize");o(Td,"normalize");function _m(r,e={}){if(typeof r!="string")return!1;try{return Td(r,e),!0}catch{return!1}}u(_m,"is");o(_m,"is");function Zp(r,e={}){let t=Lf(r),n=e.case??"lower",i=Array.from(t,s=>{let c=s.toString(16).padStart(2,"0");return n==="upper"?c.toUpperCase():c}),a="";if(e.line){let s=e.line.bytesPerLine;if(!Number.isInteger(s)||s<1)throw new RangeError("Hex bytesPerLine must be a positive integer");let c=e.line.separator??`
19
- `,d=[];for(let f=0;f<i.length;f+=s)d.push(hy(i.slice(f,f+s),e.group));a=d.join(c)}else a=hy(i,e.group);return`${e.prefix??""}${a}`}u(Zp,"encode2");o(Zp,"encode");function Qp(r,e={}){let t=Td(r,e),n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}u(Qp,"decode3");o(Qp,"decode");function Sm(r,e={}){let t=Td(r,e);return{bytes:Qp(t),format:K3(r),normalized:t}}u(Sm,"parse2");o(Sm,"parse");function Am(r,e){return Zp(r,e)}u(Am,"format");o(Am,"format");var J3={compact:Object.freeze({}),upper:Object.freeze({case:"upper"}),colon:Object.freeze({group:{size:1,separator:":"}}),colonUpper:Object.freeze({case:"upper",group:{size:1,separator:":"}}),groupsOf4:Object.freeze({group:{size:4,separator:" "}}),prefixed:Object.freeze({prefix:"0x"})},_P={encode:Zp,decode:Qp,format:Am,formats:J3,is:_m,normalize:Td,parse:Sm},Qa,z3=(Qa=class{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){let t=e.split(".");if(t.length!==4)throw new Error("Invalid IPv4 address");return t.map(n=>{let i=parseInt(n,10);if(isNaN(i)||i<0||i>255)throw new Error("Invalid IPv4 address part");return i})}static parseIPv6(e){let n=this.expandIPv6(e).split(":");if(n.length!==8)throw new Error("Invalid IPv6 address");return n.reduce((i,a)=>{let s=parseInt(a,16);if(isNaN(s)||s<0||s>65535)throw new Error("Invalid IPv6 address part");return i.push(s>>8&255),i.push(s&255),i},[])}static expandIPv6(e){if(!e.includes("::"))return e;let t=e.split("::");if(t.length>2)throw new Error("Invalid IPv6 address");let n=t[0]?t[0].split(":"):[],i=t[1]?t[1].split(":"):[],a=8-(n.length+i.length);if(a<0)throw new Error("Invalid IPv6 address");return[...n,...Array(a).fill("0"),...i].join(":")}static formatIPv6(e){let t=[];for(let n=0;n<16;n+=2)t.push((e[n]<<8|e[n+1]).toString(16));return this.compressIPv6(t.join(":"))}static compressIPv6(e){let t=e.split(":"),n=-1,i=0,a=-1,s=0;for(let c=0;c<t.length;c++)t[c]==="0"?(a===-1&&(a=c),s++):(s>i&&(n=a,i=s),a=-1,s=0);if(s>i&&(n=a,i=s),i>1){let c=t.slice(0,n).join(":"),d=t.slice(n+i).join(":");return`${c}::${d}`}return e}static parseCIDR(e){let[t,n]=e.split("/"),i=parseInt(n,10);if(this.isIPv4(t)){if(i<0||i>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(t),i]}else{if(i<0||i>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(t),i]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;let t=parseInt(e.slice(8),16).toString(2).split("").reduce((i,a)=>i+ +a,0),n=e.slice(0,8).replace(/(.{2})/g,i=>`${parseInt(i,16)}.`);return n=n.slice(0,-1),`${n}/${t}`}static toString(e){let t=new Uint8Array(e);if(t.length===4)return Array.from(t).join(".");if(t.length===16)return this.formatIPv6(t);if(t.length===8||t.length===32){let n=t.length/2,i=t.slice(0,n),a=t.slice(n);if(t.every(d=>d===0))return t.length===8?"0.0.0.0/0":"::/0";let c=a.reduce((d,f)=>d+(f.toString(2).match(/1/g)||[]).length,0);return t.length===8?`${Array.from(i).join(".")}/${c}`:`${this.formatIPv6(i)}/${c}`}return this.decodeIP(wm.encode(e))}static fromString(e){if(e.includes("/")){let[n,i]=this.parseCIDR(e),a=new Uint8Array(n.length),s=i;for(let d=0;d<a.length;d++)s>=8?(a[d]=255,s-=8):s>0&&(a[d]=255<<8-s,s=0);let c=new Uint8Array(n.length*2);return c.set(n,0),c.set(a,n.length),c.buffer}let t=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(t).buffer}},u(Qa,"_IpConverter"),Qa);o(z3,"IpConverter");var H1=z3,vy,yy,gy,Vh,Ya,ht=(Vh=(Ya=class{constructor(e={}){y(this,"teletexString"),y(this,"printableString"),y(this,"universalString"),y(this,"utf8String"),y(this,"bmpString"),Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}},u(Ya,"_a2"),Ya),o(Vh,"DirectoryString"),Vh);h([m({type:k.TeletexString})],ht.prototype,"teletexString",void 0);h([m({type:k.PrintableString})],ht.prototype,"printableString",void 0);h([m({type:k.UniversalString})],ht.prototype,"universalString",void 0);h([m({type:k.Utf8String})],ht.prototype,"utf8String",void 0);h([m({type:k.BmpString})],ht.prototype,"bmpString",void 0);ht=h([$({type:D.Choice})],ht);var Uh,eo,ld=(Uh=(eo=class extends ht{constructor(e={}){super(e),y(this,"ia5String"),y(this,"anyValue"),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?wm.encode(this.anyValue):super.toString())}},u(eo,"_a3"),eo),o(Uh,"AttributeValue"),Uh);h([m({type:k.IA5String})],ld.prototype,"ia5String",void 0);h([m({type:k.Any})],ld.prototype,"anyValue",void 0);ld=h([$({type:D.Choice})],ld);var to,G3=(to=class{constructor(e={}){y(this,"type",""),y(this,"value",new ld),Object.assign(this,e)}},u(to,"_AttributeTypeAndValue"),to);o(G3,"AttributeTypeAndValue");var Yp=G3;h([m({type:k.ObjectIdentifier})],Yp.prototype,"type",void 0);h([m({type:ld})],Yp.prototype,"value",void 0);var $h,ro,pd=vy=($h=(ro=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,vy.prototype)}},u(ro,"_a4"),ro),o($h,"RelativeDistinguishedName"),$h);pd=vy=h([$({type:D.Set,itemType:Yp})],pd);var qh,no,my=yy=(qh=(no=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,yy.prototype)}},u(no,"_a5"),no),o(qh,"RDNSequence"),qh);my=yy=h([$({type:D.Sequence,itemType:pd})],my);var Hh,io,nt=gy=(Hh=(io=class extends my{constructor(e){super(e),Object.setPrototypeOf(this,gy.prototype)}},u(io,"_a6"),io),o(Hh,"Name"),Hh);nt=gy=h([$({type:D.Sequence})],nt);var SP={fromASN:o(r=>H1.toString(Ql.fromASN(r)),"fromASN"),toASN:o(r=>Ql.toASN(H1.fromString(r)),"toASN")},ao,X3=(ao=class{constructor(e={}){y(this,"typeId",""),y(this,"value",new ArrayBuffer(0)),Object.assign(this,e)}},u(ao,"_OtherName"),ao);o(X3,"OtherName");var Df=X3;h([m({type:k.ObjectIdentifier})],Df.prototype,"typeId",void 0);h([m({type:k.Any,context:0})],Df.prototype,"value",void 0);var oo,Z3=(oo=class{constructor(e={}){y(this,"nameAssigner"),y(this,"partyName",new ht),Object.assign(this,e)}},u(oo,"_EDIPartyName"),oo);o(Z3,"EDIPartyName");var Cm=Z3;h([m({type:ht,optional:!0,context:0,implicit:!0})],Cm.prototype,"nameAssigner",void 0);h([m({type:ht,context:1,implicit:!0})],Cm.prototype,"partyName",void 0);var Fh,so,de=(Fh=(so=class{constructor(e={}){y(this,"otherName"),y(this,"rfc822Name"),y(this,"dNSName"),y(this,"x400Address"),y(this,"directoryName"),y(this,"ediPartyName"),y(this,"uniformResourceIdentifier"),y(this,"iPAddress"),y(this,"registeredID"),Object.assign(this,e)}},u(so,"_a7"),so),o(Fh,"GeneralName"),Fh);h([m({type:Df,context:0,implicit:!0})],de.prototype,"otherName",void 0);h([m({type:k.IA5String,context:1,implicit:!0})],de.prototype,"rfc822Name",void 0);h([m({type:k.IA5String,context:2,implicit:!0})],de.prototype,"dNSName",void 0);h([m({type:k.Any,context:3,implicit:!0})],de.prototype,"x400Address",void 0);h([m({type:nt,context:4,implicit:!1})],de.prototype,"directoryName",void 0);h([m({type:Cm,context:5})],de.prototype,"ediPartyName",void 0);h([m({type:k.IA5String,context:6,implicit:!0})],de.prototype,"uniformResourceIdentifier",void 0);h([m({type:k.OctetString,context:7,implicit:!0,converter:SP})],de.prototype,"iPAddress",void 0);h([m({type:k.ObjectIdentifier,context:8,implicit:!0})],de.prototype,"registeredID",void 0);de=h([$({type:D.Choice})],de);var Rd="1.3.6.1.5.5.7",bl=`${Rd}.1`,Q3=`${Rd}.2`,jd=`${Rd}.3`,eh=`${Rd}.48`,LB=`${Q3}.1`,DB=`${Q3}.2`,F1=`${eh}.1`,K1=`${eh}.2`,W1=`${eh}.3`,J1=`${eh}.5`,He="2.5.29",by,wy=`${bl}.1`,uo,Y3=(uo=class{constructor(e={}){y(this,"accessMethod",""),y(this,"accessLocation",new de),Object.assign(this,e)}},u(uo,"_AccessDescription"),uo);o(Y3,"AccessDescription");var wl=Y3;h([m({type:k.ObjectIdentifier})],wl.prototype,"accessMethod",void 0);h([m({type:de})],wl.prototype,"accessLocation",void 0);var Kh,co,ai=by=(Kh=(co=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,by.prototype)}},u(co,"_a8"),co),o(Kh,"AuthorityInfoAccessSyntax"),Kh);ai=by=h([$({type:D.Sequence,itemType:wl})],ai);var _y=`${He}.35`,fo,eA=(fo=class extends Ce{},u(fo,"_KeyIdentifier"),fo);o(eA,"KeyIdentifier");var Em=eA,lo,tA=(lo=class{constructor(e={}){y(this,"keyIdentifier"),y(this,"authorityCertIssuer"),y(this,"authorityCertSerialNumber"),e&&Object.assign(this,e)}},u(lo,"_AuthorityKeyIdentifier"),lo);o(tA,"AuthorityKeyIdentifier");var mn=tA;h([m({type:Em,context:0,optional:!0,implicit:!0})],mn.prototype,"keyIdentifier",void 0);h([m({type:de,context:1,optional:!0,implicit:!0,repeated:"sequence"})],mn.prototype,"authorityCertIssuer",void 0);h([m({type:k.Integer,context:2,optional:!0,implicit:!0,converter:Le})],mn.prototype,"authorityCertSerialNumber",void 0);var rA=`${He}.19`,po,nA=(po=class{constructor(e={}){y(this,"cA",!1),y(this,"pathLenConstraint"),Object.assign(this,e)}},u(po,"_BasicConstraints"),po);o(nA,"BasicConstraints");var Yl=nA;h([m({type:k.Boolean,defaultValue:!1})],Yl.prototype,"cA",void 0);h([m({type:k.Integer,optional:!0})],Yl.prototype,"pathLenConstraint",void 0);var Sy,Wh,ho,gt=Sy=(Wh=(ho=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Sy.prototype)}},u(ho,"_a9"),ho),o(Wh,"GeneralNames"),Wh);gt=Sy=h([$({type:D.Sequence,itemType:de})],gt);var Ay,MB=`${He}.29`,Jh,vo,z1=Ay=(Jh=(vo=class extends gt{constructor(e){super(e),Object.setPrototypeOf(this,Ay.prototype)}},u(vo,"_a10"),vo),o(Jh,"CertificateIssuer"),Jh);z1=Ay=h([$({type:D.Sequence})],z1);var Cy,km=`${He}.32`,VB=`${km}.0`,zh,yo,Ur=(zh=(yo=class{constructor(e={}){y(this,"ia5String"),y(this,"visibleString"),y(this,"bmpString"),y(this,"utf8String"),Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}},u(yo,"_a11"),yo),o(zh,"DisplayText"),zh);h([m({type:k.IA5String})],Ur.prototype,"ia5String",void 0);h([m({type:k.VisibleString})],Ur.prototype,"visibleString",void 0);h([m({type:k.BmpString})],Ur.prototype,"bmpString",void 0);h([m({type:k.Utf8String})],Ur.prototype,"utf8String",void 0);Ur=h([$({type:D.Choice})],Ur);var go,iA=(go=class{constructor(e={}){y(this,"organization",new Ur),y(this,"noticeNumbers",[]),Object.assign(this,e)}},u(go,"_NoticeReference"),go);o(iA,"NoticeReference");var xm=iA;h([m({type:Ur})],xm.prototype,"organization",void 0);h([m({type:k.Integer,repeated:"sequence"})],xm.prototype,"noticeNumbers",void 0);var mo,aA=(mo=class{constructor(e={}){y(this,"noticeRef"),y(this,"explicitText"),Object.assign(this,e)}},u(mo,"_UserNotice"),mo);o(aA,"UserNotice");var Pm=aA;h([m({type:xm,optional:!0})],Pm.prototype,"noticeRef",void 0);h([m({type:Ur,optional:!0})],Pm.prototype,"explicitText",void 0);var Gh,bo,ep=(Gh=(bo=class{constructor(e={}){y(this,"cPSuri"),y(this,"userNotice"),Object.assign(this,e)}},u(bo,"_a12"),bo),o(Gh,"Qualifier"),Gh);h([m({type:k.IA5String})],ep.prototype,"cPSuri",void 0);h([m({type:Pm})],ep.prototype,"userNotice",void 0);ep=h([$({type:D.Choice})],ep);var wo,oA=(wo=class{constructor(e={}){y(this,"policyQualifierId",""),y(this,"qualifier",new ArrayBuffer(0)),Object.assign(this,e)}},u(wo,"_PolicyQualifierInfo"),wo);o(oA,"PolicyQualifierInfo");var Im=oA;h([m({type:k.ObjectIdentifier})],Im.prototype,"policyQualifierId",void 0);h([m({type:k.Any})],Im.prototype,"qualifier",void 0);var _o,sA=(_o=class{constructor(e={}){y(this,"policyIdentifier",""),y(this,"policyQualifiers"),Object.assign(this,e)}},u(_o,"_PolicyInformation"),_o);o(sA,"PolicyInformation");var th=sA;h([m({type:k.ObjectIdentifier})],th.prototype,"policyIdentifier",void 0);h([m({type:Im,repeated:"sequence",optional:!0})],th.prototype,"policyQualifiers",void 0);var Xh,So,tp=Cy=(Xh=(So=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Cy.prototype)}},u(So,"_a13"),So),o(Xh,"CertificatePolicies"),Xh);tp=Cy=h([$({type:D.Sequence,itemType:th})],tp);var UB=`${He}.20`,Zh,Ao,rp=(Zh=(Ao=class{constructor(e=0){y(this,"value"),this.value=e}},u(Ao,"_a14"),Ao),o(Zh,"CRLNumber"),Zh);h([m({type:k.Integer})],rp.prototype,"value",void 0);rp=h([$({type:D.Choice})],rp);var $B=`${He}.27`,Qh,Co,G1=(Qh=(Co=class extends rp{},u(Co,"_a15"),Co),o(Qh,"BaseCRLNumber"),Qh);G1=h([$({type:D.Choice})],G1);var Ey,ky=`${He}.31`,Qt;(function(r){r[r.unused=1]="unused",r[r.keyCompromise=2]="keyCompromise",r[r.cACompromise=4]="cACompromise",r[r.affiliationChanged=8]="affiliationChanged",r[r.superseded=16]="superseded",r[r.cessationOfOperation=32]="cessationOfOperation",r[r.certificateHold=64]="certificateHold",r[r.privilegeWithdrawn=128]="privilegeWithdrawn",r[r.aACompromise=256]="aACompromise"})(Qt||(Qt={}));var Eo,uA=(Eo=class extends Xp{toJSON(){let e=[],t=this.toNumber();return t&Qt.aACompromise&&e.push("aACompromise"),t&Qt.affiliationChanged&&e.push("affiliationChanged"),t&Qt.cACompromise&&e.push("cACompromise"),t&Qt.certificateHold&&e.push("certificateHold"),t&Qt.cessationOfOperation&&e.push("cessationOfOperation"),t&Qt.keyCompromise&&e.push("keyCompromise"),t&Qt.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&Qt.superseded&&e.push("superseded"),t&Qt.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}},u(Eo,"_Reason"),Eo);o(uA,"Reason");var cA=uA,Yh,ko,Nn=(Yh=(ko=class{constructor(e={}){y(this,"fullName"),y(this,"nameRelativeToCRLIssuer"),Object.assign(this,e)}},u(ko,"_a16"),ko),o(Yh,"DistributionPointName"),Yh);h([m({type:de,context:0,repeated:"sequence",implicit:!0})],Nn.prototype,"fullName",void 0);h([m({type:pd,context:1,implicit:!0})],Nn.prototype,"nameRelativeToCRLIssuer",void 0);Nn=h([$({type:D.Choice})],Nn);var xo,dA=(xo=class{constructor(e={}){y(this,"distributionPoint"),y(this,"reasons"),y(this,"cRLIssuer"),Object.assign(this,e)}},u(xo,"_DistributionPoint"),xo);o(dA,"DistributionPoint");var Ld=dA;h([m({type:Nn,context:0,optional:!0})],Ld.prototype,"distributionPoint",void 0);h([m({type:cA,context:1,optional:!0,implicit:!0})],Ld.prototype,"reasons",void 0);h([m({type:de,context:2,optional:!0,repeated:"sequence",implicit:!0})],Ld.prototype,"cRLIssuer",void 0);var e0,Po,si=Ey=(e0=(Po=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Ey.prototype)}},u(Po,"_a17"),Po),o(e0,"CRLDistributionPoints"),e0);si=Ey=h([$({type:D.Sequence,itemType:Ld})],si);var xy,qB=`${He}.46`,t0,Io,X1=xy=(t0=(Io=class extends si{constructor(e){super(e),Object.setPrototypeOf(this,xy.prototype)}},u(Io,"_a18"),Io),o(t0,"FreshestCRL"),t0);X1=xy=h([$({type:D.Sequence,itemType:Ld})],X1);var HB=`${He}.28`,hr,Om=(hr=class{constructor(e={}){y(this,"distributionPoint"),y(this,"onlyContainsUserCerts",hr.ONLY),y(this,"onlyContainsCACerts",hr.ONLY),y(this,"onlySomeReasons"),y(this,"indirectCRL",hr.ONLY),y(this,"onlyContainsAttributeCerts",hr.ONLY),Object.assign(this,e)}},u(hr,"_IssuingDistributionPoint"),hr);o(Om,"IssuingDistributionPoint");y(Om,"ONLY",!1);var wr=Om;h([m({type:Nn,context:0,optional:!0})],wr.prototype,"distributionPoint",void 0);h([m({type:k.Boolean,context:1,defaultValue:wr.ONLY,implicit:!0})],wr.prototype,"onlyContainsUserCerts",void 0);h([m({type:k.Boolean,context:2,defaultValue:wr.ONLY,implicit:!0})],wr.prototype,"onlyContainsCACerts",void 0);h([m({type:cA,context:3,optional:!0,implicit:!0})],wr.prototype,"onlySomeReasons",void 0);h([m({type:k.Boolean,context:4,defaultValue:wr.ONLY,implicit:!0})],wr.prototype,"indirectCRL",void 0);h([m({type:k.Boolean,context:5,defaultValue:wr.ONLY,implicit:!0})],wr.prototype,"onlyContainsAttributeCerts",void 0);var FB=`${He}.21`,kf;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})(kf||(kf={}));var r0,Oo,Py=(r0=(Oo=class{constructor(e=kf.unspecified){y(this,"reason",kf.unspecified),this.reason=e}toJSON(){return kf[this.reason]}toString(){return this.toJSON()}},u(Oo,"_a19"),Oo),o(r0,"CRLReason"),r0);h([m({type:k.Enumerated})],Py.prototype,"reason",void 0);Py=h([$({type:D.Choice})],Py);var Iy,Bm=`${He}.37`,n0,Bo,np=Iy=(n0=(Bo=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Iy.prototype)}},u(Bo,"_a20"),Bo),o(n0,"ExtendedKeyUsage"),n0);np=Iy=h([$({type:D.Sequence,itemType:k.ObjectIdentifier})],np);var KB=`${Bm}.0`,AP=`${jd}.1`,CP=`${jd}.2`,EP=`${jd}.3`,kP=`${jd}.4`,xP=`${jd}.8`,PP=`${jd}.9`,WB=`${He}.54`,i0,No,Oy=(i0=(No=class{constructor(e=new ArrayBuffer(0)){y(this,"value"),this.value=e}},u(No,"_a21"),No),o(i0,"InhibitAnyPolicy"),i0);h([m({type:k.Integer,converter:Le})],Oy.prototype,"value",void 0);Oy=h([$({type:D.Choice})],Oy);var JB=`${He}.24`,a0,To,By=(a0=(To=class{constructor(e){y(this,"value",new Date),e&&(this.value=e)}},u(To,"_a22"),To),o(a0,"InvalidityDate"),a0);h([m({type:k.GeneralizedTime})],By.prototype,"value",void 0);By=h([$({type:D.Choice})],By);var Ny,fA=`${He}.18`,o0,Ro,Z1=Ny=(o0=(Ro=class extends gt{constructor(e){super(e),Object.setPrototypeOf(this,Ny.prototype)}},u(Ro,"_a23"),Ro),o(o0,"IssueAlternativeName"),o0);Z1=Ny=h([$({type:D.Sequence})],Z1);var lA=`${He}.15`,Yt;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(Yt||(Yt={}));var jo,pA=(jo=class extends Xp{toJSON(){let e=this.toNumber(),t=[];return e&Yt.cRLSign&&t.push("crlSign"),e&Yt.dataEncipherment&&t.push("dataEncipherment"),e&Yt.decipherOnly&&t.push("decipherOnly"),e&Yt.digitalSignature&&t.push("digitalSignature"),e&Yt.encipherOnly&&t.push("encipherOnly"),e&Yt.keyAgreement&&t.push("keyAgreement"),e&Yt.keyCertSign&&t.push("keyCertSign"),e&Yt.keyEncipherment&&t.push("keyEncipherment"),e&Yt.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}},u(jo,"_KeyUsage"),jo);o(pA,"KeyUsage");var s0=pA,Ty,zB=`${He}.30`,Lo,hA=(Lo=class{constructor(e={}){y(this,"base",new de),y(this,"minimum",0),y(this,"maximum"),Object.assign(this,e)}},u(Lo,"_GeneralSubtree"),Lo);o(hA,"GeneralSubtree");var rh=hA;h([m({type:de})],rh.prototype,"base",void 0);h([m({type:k.Integer,context:0,defaultValue:0,implicit:!0})],rh.prototype,"minimum",void 0);h([m({type:k.Integer,context:1,optional:!0,implicit:!0})],rh.prototype,"maximum",void 0);var u0,Do,ip=Ty=(u0=(Do=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Ty.prototype)}},u(Do,"_a24"),Do),o(u0,"GeneralSubtrees"),u0);ip=Ty=h([$({type:D.Sequence,itemType:rh})],ip);var Mo,vA=(Mo=class{constructor(e={}){y(this,"permittedSubtrees"),y(this,"excludedSubtrees"),Object.assign(this,e)}},u(Mo,"_NameConstraints"),Mo);o(vA,"NameConstraints");var yA=vA;h([m({type:ip,context:0,optional:!0,implicit:!0})],yA.prototype,"permittedSubtrees",void 0);h([m({type:ip,context:1,optional:!0,implicit:!0})],yA.prototype,"excludedSubtrees",void 0);var GB=`${He}.36`,Vo,gA=(Vo=class{constructor(e={}){y(this,"requireExplicitPolicy"),y(this,"inhibitPolicyMapping"),Object.assign(this,e)}},u(Vo,"_PolicyConstraints"),Vo);o(gA,"PolicyConstraints");var mA=gA;h([m({type:k.Integer,context:0,implicit:!0,optional:!0,converter:Le})],mA.prototype,"requireExplicitPolicy",void 0);h([m({type:k.Integer,context:1,implicit:!0,optional:!0,converter:Le})],mA.prototype,"inhibitPolicyMapping",void 0);var Ry,XB=`${He}.33`,Uo,bA=(Uo=class{constructor(e={}){y(this,"issuerDomainPolicy",""),y(this,"subjectDomainPolicy",""),Object.assign(this,e)}},u(Uo,"_PolicyMapping"),Uo);o(bA,"PolicyMapping");var Nm=bA;h([m({type:k.ObjectIdentifier})],Nm.prototype,"issuerDomainPolicy",void 0);h([m({type:k.ObjectIdentifier})],Nm.prototype,"subjectDomainPolicy",void 0);var c0,$o,Q1=Ry=(c0=($o=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Ry.prototype)}},u($o,"_a25"),$o),o(c0,"PolicyMappings"),c0);Q1=Ry=h([$({type:D.Sequence,itemType:Nm})],Q1);var jy,wA=`${He}.17`,d0,qo,Ly=jy=(d0=(qo=class extends gt{constructor(e){super(e),Object.setPrototypeOf(this,jy.prototype)}},u(qo,"_a26"),qo),o(d0,"SubjectAlternativeName"),d0);Ly=jy=h([$({type:D.Sequence})],Ly);var Ho,_A=(Ho=class{constructor(e={}){y(this,"type",""),y(this,"values",[]),Object.assign(this,e)}},u(Ho,"_Attribute"),Ho);o(_A,"Attribute");var $r=_A;h([m({type:k.ObjectIdentifier})],$r.prototype,"type",void 0);h([m({type:k.Any,repeated:"set"})],$r.prototype,"values",void 0);var Dy,ZB=`${He}.9`,f0,Fo,Y1=Dy=(f0=(Fo=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Dy.prototype)}},u(Fo,"_a27"),Fo),o(f0,"SubjectDirectoryAttributes"),f0);Y1=Dy=h([$({type:D.Sequence,itemType:$r})],Y1);var SA=`${He}.14`,Ko,AA=(Ko=class extends Em{},u(Ko,"_SubjectKeyIdentifier"),Ko);o(AA,"SubjectKeyIdentifier");var rn=AA,QB=`${He}.16`,Wo,CA=(Wo=class{constructor(e={}){y(this,"notBefore"),y(this,"notAfter"),Object.assign(this,e)}},u(Wo,"_PrivateKeyUsagePeriod"),Wo);o(CA,"PrivateKeyUsagePeriod");var EA=CA;h([m({type:k.GeneralizedTime,context:0,implicit:!0,optional:!0})],EA.prototype,"notBefore",void 0);h([m({type:k.GeneralizedTime,context:1,implicit:!0,optional:!0})],EA.prototype,"notAfter",void 0);var xf;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(xf||(xf={}));var Jo,kA=(Jo=class extends Xp{toJSON(){let e=[],t=this.toNumber();return t&xf.pKIXCertificate&&e.push("pKIXCertificate"),t&xf.newExtensions&&e.push("newExtensions"),t&xf.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}},u(Jo,"_EntrustInfo"),Jo);o(kA,"EntrustInfo");var xA=kA,zo,PA=(zo=class{constructor(e={}){y(this,"entrustVers",""),y(this,"entrustInfoFlags",new xA),Object.assign(this,e)}},u(zo,"_EntrustVersionInfo"),zo);o(PA,"EntrustVersionInfo");var IA=PA;h([m({type:k.GeneralString})],IA.prototype,"entrustVers",void 0);h([m({type:xA})],IA.prototype,"entrustInfoFlags",void 0);var My,YB=`${bl}.11`,l0,Go,eb=My=(l0=(Go=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,My.prototype)}},u(Go,"_a28"),Go),o(l0,"SubjectInfoAccessSyntax"),l0);eb=My=h([$({type:D.Sequence,itemType:wl})],eb);var An,OA=(An=class{constructor(e={}){y(this,"algorithm",""),y(this,"parameters"),Object.assign(this,e)}isEqual(e){return e instanceof An&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&I3(e.parameters,this.parameters)||e.parameters===this.parameters)}},u(An,"_AlgorithmIdentifier"),An);o(OA,"AlgorithmIdentifier");var z=OA;h([m({type:k.ObjectIdentifier})],z.prototype,"algorithm",void 0);h([m({type:k.Any,optional:!0})],z.prototype,"parameters",void 0);var Xo,BA=(Xo=class{constructor(e={}){y(this,"algorithm",new z),y(this,"subjectPublicKey",new ArrayBuffer(0)),Object.assign(this,e)}},u(Xo,"_SubjectPublicKeyInfo"),Xo);o(BA,"SubjectPublicKeyInfo");var br=BA;h([m({type:z})],br.prototype,"algorithm",void 0);h([m({type:k.BitString})],br.prototype,"subjectPublicKey",void 0);var p0,Zo,lt=(p0=(Zo=class{constructor(e){if(y(this,"utcTime"),y(this,"generalTime"),e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){let t=new Date(e);t.setMilliseconds(0),t.getUTCFullYear()>2049?this.generalTime=t:this.utcTime=t}else Object.assign(this,e)}getTime(){let e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}},u(Zo,"_a29"),Zo),o(p0,"Time"),p0);h([m({type:k.UTCTime})],lt.prototype,"utcTime",void 0);h([m({type:k.GeneralizedTime})],lt.prototype,"generalTime",void 0);lt=h([$({type:D.Choice})],lt);var Qo,NA=(Qo=class{constructor(e){y(this,"notBefore",new lt(new Date)),y(this,"notAfter",new lt(new Date)),e&&(this.notBefore=new lt(e.notBefore),this.notAfter=new lt(e.notAfter))}},u(Qo,"_Validity"),Qo);o(NA,"Validity");var nh=NA;h([m({type:lt})],nh.prototype,"notBefore",void 0);h([m({type:lt})],nh.prototype,"notAfter",void 0);var Vy,Cn,Tm=(Cn=class{constructor(e={}){y(this,"extnID",""),y(this,"critical",Cn.CRITICAL),y(this,"extnValue",new Ce),Object.assign(this,e)}},u(Cn,"_Extension"),Cn);o(Tm,"Extension");y(Tm,"CRITICAL",!1);var _r=Tm;h([m({type:k.ObjectIdentifier})],_r.prototype,"extnID",void 0);h([m({type:k.Boolean,defaultValue:_r.CRITICAL})],_r.prototype,"critical",void 0);h([m({type:Ce})],_r.prototype,"extnValue",void 0);var h0,Yo,Tn=Vy=(h0=(Yo=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Vy.prototype)}},u(Yo,"_a30"),Yo),o(h0,"Extensions"),h0);Tn=Vy=h([$({type:D.Sequence,itemType:_r})],Tn);var hd;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(hd||(hd={}));var es,TA=(es=class{constructor(e={}){y(this,"version",hd.v1),y(this,"serialNumber",new ArrayBuffer(0)),y(this,"signature",new z),y(this,"issuer",new nt),y(this,"validity",new nh),y(this,"subject",new nt),y(this,"subjectPublicKeyInfo",new br),y(this,"issuerUniqueID"),y(this,"subjectUniqueID"),y(this,"extensions"),Object.assign(this,e)}},u(es,"_TBSCertificate"),es);o(TA,"TBSCertificate");var zt=TA;h([m({type:k.Integer,context:0,defaultValue:hd.v1})],zt.prototype,"version",void 0);h([m({type:k.Integer,converter:Le})],zt.prototype,"serialNumber",void 0);h([m({type:z})],zt.prototype,"signature",void 0);h([m({type:nt})],zt.prototype,"issuer",void 0);h([m({type:nh})],zt.prototype,"validity",void 0);h([m({type:nt})],zt.prototype,"subject",void 0);h([m({type:br})],zt.prototype,"subjectPublicKeyInfo",void 0);h([m({type:k.BitString,context:1,implicit:!0,optional:!0})],zt.prototype,"issuerUniqueID",void 0);h([m({type:k.BitString,context:2,implicit:!0,optional:!0})],zt.prototype,"subjectUniqueID",void 0);h([m({type:Tn,context:3,optional:!0})],zt.prototype,"extensions",void 0);var ts,RA=(ts=class{constructor(e={}){y(this,"tbsCertificate",new zt),y(this,"tbsCertificateRaw"),y(this,"signatureAlgorithm",new z),y(this,"signatureValue",new ArrayBuffer(0)),Object.assign(this,e)}},u(ts,"_Certificate"),ts);o(RA,"Certificate");var vd=RA;h([m({type:zt,raw:!0})],vd.prototype,"tbsCertificate",void 0);h([m({type:z})],vd.prototype,"signatureAlgorithm",void 0);h([m({type:k.BitString})],vd.prototype,"signatureValue",void 0);var rs,jA=(rs=class{constructor(e={}){y(this,"userCertificate",new ArrayBuffer(0)),y(this,"revocationDate",new lt),y(this,"crlEntryExtensions"),Object.assign(this,e)}},u(rs,"_RevokedCertificate"),rs);o(jA,"RevokedCertificate");var ih=jA;h([m({type:k.Integer,converter:Le})],ih.prototype,"userCertificate",void 0);h([m({type:lt})],ih.prototype,"revocationDate",void 0);h([m({type:_r,optional:!0,repeated:"sequence"})],ih.prototype,"crlEntryExtensions",void 0);var ns,LA=(ns=class{constructor(e={}){y(this,"version"),y(this,"signature",new z),y(this,"issuer",new nt),y(this,"thisUpdate",new lt),y(this,"nextUpdate"),y(this,"revokedCertificates"),y(this,"crlExtensions"),Object.assign(this,e)}},u(ns,"_TBSCertList"),ns);o(LA,"TBSCertList");var Fr=LA;h([m({type:k.Integer,optional:!0})],Fr.prototype,"version",void 0);h([m({type:z})],Fr.prototype,"signature",void 0);h([m({type:nt})],Fr.prototype,"issuer",void 0);h([m({type:lt})],Fr.prototype,"thisUpdate",void 0);h([m({type:lt,optional:!0})],Fr.prototype,"nextUpdate",void 0);h([m({type:ih,repeated:"sequence",optional:!0})],Fr.prototype,"revokedCertificates",void 0);h([m({type:_r,optional:!0,context:0,repeated:"sequence"})],Fr.prototype,"crlExtensions",void 0);var is,DA=(is=class{constructor(e={}){y(this,"tbsCertList",new Fr),y(this,"tbsCertListRaw"),y(this,"signatureAlgorithm",new z),y(this,"signature",new ArrayBuffer(0)),Object.assign(this,e)}},u(is,"_CertificateList"),is);o(DA,"CertificateList");var Rm=DA;h([m({type:Fr,raw:!0})],Rm.prototype,"tbsCertList",void 0);h([m({type:z})],Rm.prototype,"signatureAlgorithm",void 0);h([m({type:k.BitString})],Rm.prototype,"signature",void 0);var H=$n(tl()),as,MA=(as=class{constructor(e={}){y(this,"issuer",new nt),y(this,"serialNumber",new ArrayBuffer(0)),Object.assign(this,e)}},u(as,"_IssuerAndSerialNumber"),as);o(MA,"IssuerAndSerialNumber");var Dd=MA;h([m({type:nt})],Dd.prototype,"issuer",void 0);h([m({type:k.Integer,converter:Le})],Dd.prototype,"serialNumber",void 0);var v0,os,yd=(v0=(os=class{constructor(e={}){y(this,"subjectKeyIdentifier"),y(this,"issuerAndSerialNumber"),Object.assign(this,e)}},u(os,"_a31"),os),o(v0,"SignerIdentifier"),v0);h([m({type:rn,context:0,implicit:!0})],yd.prototype,"subjectKeyIdentifier",void 0);h([m({type:Dd})],yd.prototype,"issuerAndSerialNumber",void 0);yd=h([$({type:D.Choice})],yd);var qr;(function(r){r[r.v0=0]="v0",r[r.v1=1]="v1",r[r.v2=2]="v2",r[r.v3=3]="v3",r[r.v4=4]="v4",r[r.v5=5]="v5"})(qr||(qr={}));var y0,ss,Mf=(y0=(ss=class extends z{},u(ss,"_a32"),ss),o(y0,"DigestAlgorithmIdentifier"),y0);Mf=h([$({type:D.Sequence})],Mf);var g0,us,ap=(g0=(us=class extends z{},u(us,"_a33"),us),o(g0,"SignatureAlgorithmIdentifier"),g0);ap=h([$({type:D.Sequence})],ap);var m0,cs,Sr=(m0=(cs=class extends z{},u(cs,"_a34"),cs),o(m0,"KeyEncryptionAlgorithmIdentifier"),m0);Sr=h([$({type:D.Sequence})],Sr);var b0,ds,op=(b0=(ds=class extends z{},u(ds,"_a35"),ds),o(b0,"ContentEncryptionAlgorithmIdentifier"),b0);op=h([$({type:D.Sequence})],op);var w0,fs,tb=(w0=(fs=class extends z{},u(fs,"_a36"),fs),o(w0,"MessageAuthenticationCodeAlgorithm"),w0);tb=h([$({type:D.Sequence})],tb);var _0,ls,Uy=(_0=(ls=class extends z{},u(ls,"_a37"),ls),o(_0,"KeyDerivationAlgorithmIdentifier"),_0);Uy=h([$({type:D.Sequence})],Uy);var ps,VA=(ps=class{constructor(e={}){y(this,"attrType",""),y(this,"attrValues",[]),Object.assign(this,e)}},u(ps,"_Attribute2"),ps);o(VA,"Attribute");var Md=VA;h([m({type:k.ObjectIdentifier})],Md.prototype,"attrType",void 0);h([m({type:k.Any,repeated:"set"})],Md.prototype,"attrValues",void 0);var $y,hs,UA=(hs=class{constructor(e={}){y(this,"version",qr.v0),y(this,"sid",new yd),y(this,"digestAlgorithm",new Mf),y(this,"signedAttrs"),y(this,"signedAttrsRaw"),y(this,"signatureAlgorithm",new ap),y(this,"signature",new Ce),y(this,"unsignedAttrs"),Object.assign(this,e)}},u(hs,"_SignerInfo"),hs);o(UA,"SignerInfo");var kr=UA;h([m({type:k.Integer})],kr.prototype,"version",void 0);h([m({type:yd})],kr.prototype,"sid",void 0);h([m({type:Mf})],kr.prototype,"digestAlgorithm",void 0);h([m({type:Md,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],kr.prototype,"signedAttrs",void 0);h([m({type:ap})],kr.prototype,"signatureAlgorithm",void 0);h([m({type:Ce})],kr.prototype,"signature",void 0);h([m({type:Md,repeated:"set",context:1,implicit:!0,optional:!0})],kr.prototype,"unsignedAttrs",void 0);var S0,vs,sp=$y=(S0=(vs=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,$y.prototype)}},u(vs,"_a38"),vs),o(S0,"SignerInfos"),S0);sp=$y=h([$({type:D.Set,itemType:kr})],sp);var A0,ys,rb=(A0=(ys=class extends kr{},u(ys,"_a39"),ys),o(A0,"CounterSignature"),A0);rb=h([$({type:D.Sequence})],rb);var C0,gs,nb=(C0=(gs=class extends lt{},u(gs,"_a40"),gs),o(C0,"SigningTime"),C0);nb=h([$({type:D.Choice})],nb);var ms,$A=(ms=class{constructor(e={}){y(this,"acIssuer",new de),y(this,"acSerial",0),y(this,"attrs",[]),Object.assign(this,e)}},u(ms,"_ACClearAttrs"),ms);o($A,"ACClearAttrs");var jm=$A;h([m({type:de})],jm.prototype,"acIssuer",void 0);h([m({type:k.Integer})],jm.prototype,"acSerial",void 0);h([m({type:$r,repeated:"sequence"})],jm.prototype,"attrs",void 0);var qy,E0,bs,up=qy=(E0=(bs=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,qy.prototype)}},u(bs,"_a41"),bs),o(E0,"AttrSpec"),E0);up=qy=h([$({type:D.Sequence,itemType:k.ObjectIdentifier})],up);var ws,qA=(ws=class{constructor(e={}){y(this,"pathLenConstraint"),y(this,"permittedAttrs"),y(this,"excludedAttrs"),y(this,"permitUnSpecified",!0),Object.assign(this,e)}},u(ws,"_AAControls"),ws);o(qA,"AAControls");var ah=qA;h([m({type:k.Integer,optional:!0})],ah.prototype,"pathLenConstraint",void 0);h([m({type:up,implicit:!0,context:0,optional:!0})],ah.prototype,"permittedAttrs",void 0);h([m({type:up,implicit:!0,context:1,optional:!0})],ah.prototype,"excludedAttrs",void 0);h([m({type:k.Boolean,defaultValue:!0})],ah.prototype,"permitUnSpecified",void 0);var _s,HA=(_s=class{constructor(e={}){y(this,"issuer",new gt),y(this,"serial",new ArrayBuffer(0)),y(this,"issuerUID",new ArrayBuffer(0)),Object.assign(this,e)}},u(_s,"_IssuerSerial"),_s);o(HA,"IssuerSerial");var Jn=HA;h([m({type:gt})],Jn.prototype,"issuer",void 0);h([m({type:k.Integer,converter:Le})],Jn.prototype,"serial",void 0);h([m({type:k.BitString,optional:!0})],Jn.prototype,"issuerUID",void 0);var Hy;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(Hy||(Hy={}));var Ss,FA=(Ss=class{constructor(e={}){y(this,"digestedObjectType",Hy.publicKey),y(this,"otherObjectTypeID"),y(this,"digestAlgorithm",new z),y(this,"objectDigest",new ArrayBuffer(0)),Object.assign(this,e)}},u(Ss,"_ObjectDigestInfo"),Ss);o(FA,"ObjectDigestInfo");var zn=FA;h([m({type:k.Enumerated})],zn.prototype,"digestedObjectType",void 0);h([m({type:k.ObjectIdentifier,optional:!0})],zn.prototype,"otherObjectTypeID",void 0);h([m({type:z})],zn.prototype,"digestAlgorithm",void 0);h([m({type:k.BitString})],zn.prototype,"objectDigest",void 0);var As,KA=(As=class{constructor(e={}){y(this,"issuerName"),y(this,"baseCertificateID"),y(this,"objectDigestInfo"),Object.assign(this,e)}},u(As,"_V2Form"),As);o(KA,"V2Form");var oh=KA;h([m({type:gt,optional:!0})],oh.prototype,"issuerName",void 0);h([m({type:Jn,context:0,implicit:!0,optional:!0})],oh.prototype,"baseCertificateID",void 0);h([m({type:zn,context:1,implicit:!0,optional:!0})],oh.prototype,"objectDigestInfo",void 0);var k0,Cs,gd=(k0=(Cs=class{constructor(e={}){y(this,"v1Form"),y(this,"v2Form"),Object.assign(this,e)}},u(Cs,"_a42"),Cs),o(k0,"AttCertIssuer"),k0);h([m({type:de,repeated:"sequence"})],gd.prototype,"v1Form",void 0);h([m({type:oh,context:0,implicit:!0})],gd.prototype,"v2Form",void 0);gd=h([$({type:D.Choice})],gd);var Es,WA=(Es=class{constructor(e={}){y(this,"notBeforeTime",new Date),y(this,"notAfterTime",new Date),Object.assign(this,e)}},u(Es,"_AttCertValidityPeriod"),Es);o(WA,"AttCertValidityPeriod");var sh=WA;h([m({type:k.GeneralizedTime})],sh.prototype,"notBeforeTime",void 0);h([m({type:k.GeneralizedTime})],sh.prototype,"notAfterTime",void 0);var ks,JA=(ks=class{constructor(e={}){y(this,"baseCertificateID"),y(this,"entityName"),y(this,"objectDigestInfo"),Object.assign(this,e)}},u(ks,"_Holder"),ks);o(JA,"Holder");var _l=JA;h([m({type:Jn,implicit:!0,context:0,optional:!0})],_l.prototype,"baseCertificateID",void 0);h([m({type:gt,implicit:!0,context:1,optional:!0})],_l.prototype,"entityName",void 0);h([m({type:zn,implicit:!0,context:2,optional:!0})],_l.prototype,"objectDigestInfo",void 0);var Fy;(function(r){r[r.v2=1]="v2"})(Fy||(Fy={}));var xs,zA=(xs=class{constructor(e={}){y(this,"version",Fy.v2),y(this,"holder",new _l),y(this,"issuer",new gd),y(this,"signature",new z),y(this,"serialNumber",new ArrayBuffer(0)),y(this,"attrCertValidityPeriod",new sh),y(this,"attributes",[]),y(this,"issuerUniqueID"),y(this,"extensions"),Object.assign(this,e)}},u(xs,"_AttributeCertificateInfo"),xs);o(zA,"AttributeCertificateInfo");var dr=zA;h([m({type:k.Integer})],dr.prototype,"version",void 0);h([m({type:_l})],dr.prototype,"holder",void 0);h([m({type:gd})],dr.prototype,"issuer",void 0);h([m({type:z})],dr.prototype,"signature",void 0);h([m({type:k.Integer,converter:Le})],dr.prototype,"serialNumber",void 0);h([m({type:sh})],dr.prototype,"attrCertValidityPeriod",void 0);h([m({type:$r,repeated:"sequence"})],dr.prototype,"attributes",void 0);h([m({type:k.BitString,optional:!0})],dr.prototype,"issuerUniqueID",void 0);h([m({type:Tn,optional:!0})],dr.prototype,"extensions",void 0);var Ps,GA=(Ps=class{constructor(e={}){y(this,"acinfo",new dr),y(this,"signatureAlgorithm",new z),y(this,"signatureValue",new ArrayBuffer(0)),Object.assign(this,e)}},u(Ps,"_AttributeCertificate"),Ps);o(GA,"AttributeCertificate");var uh=GA;h([m({type:dr})],uh.prototype,"acinfo",void 0);h([m({type:z})],uh.prototype,"signatureAlgorithm",void 0);h([m({type:k.BitString})],uh.prototype,"signatureValue",void 0);var cp;(function(r){r[r.unmarked=1]="unmarked",r[r.unclassified=2]="unclassified",r[r.restricted=4]="restricted",r[r.confidential=8]="confidential",r[r.secret=16]="secret",r[r.topSecret=32]="topSecret"})(cp||(cp={}));var Is,XA=(Is=class extends Xp{},u(Is,"_ClassList"),Is);o(XA,"ClassList");var Ky=XA,Os,ZA=(Os=class{constructor(e={}){y(this,"type",""),y(this,"value",new ArrayBuffer(0)),Object.assign(this,e)}},u(Os,"_SecurityCategory"),Os);o(ZA,"SecurityCategory");var Lm=ZA;h([m({type:k.ObjectIdentifier,implicit:!0,context:0})],Lm.prototype,"type",void 0);h([m({type:k.Any,implicit:!0,context:1})],Lm.prototype,"value",void 0);var Bs,QA=(Bs=class{constructor(e={}){y(this,"policyId",""),y(this,"classList",new Ky(cp.unclassified)),y(this,"securityCategories"),Object.assign(this,e)}},u(Bs,"_Clearance"),Bs);o(QA,"Clearance");var Dm=QA;h([m({type:k.ObjectIdentifier})],Dm.prototype,"policyId",void 0);h([m({type:Ky,defaultValue:new Ky(cp.unclassified)})],Dm.prototype,"classList",void 0);h([m({type:Lm,repeated:"set"})],Dm.prototype,"securityCategories",void 0);var Ns,YA=(Ns=class{constructor(e={}){y(this,"cotets"),y(this,"oid"),y(this,"string"),Object.assign(this,e)}},u(Ns,"_IetfAttrSyntaxValueChoices"),Ns);o(YA,"IetfAttrSyntaxValueChoices");var ch=YA;h([m({type:Ce})],ch.prototype,"cotets",void 0);h([m({type:k.ObjectIdentifier})],ch.prototype,"oid",void 0);h([m({type:k.Utf8String})],ch.prototype,"string",void 0);var Ts,e4=(Ts=class{constructor(e={}){y(this,"policyAuthority"),y(this,"values",[]),Object.assign(this,e)}},u(Ts,"_IetfAttrSyntax"),Ts);o(e4,"IetfAttrSyntax");var t4=e4;h([m({type:gt,implicit:!0,context:0,optional:!0})],t4.prototype,"policyAuthority",void 0);h([m({type:ch,repeated:"sequence"})],t4.prototype,"values",void 0);var e9=`${bl}.4`,t9=`${bl}.6`,r9=`${bl}.10`,n9=`${He}.55`,Sl=`${Rd}.10`,i9=`${Sl}.1`,a9=`${Sl}.2`,o9=`${Sl}.3`,s9=`${Sl}.4`,u9=`${Sl}.6`,r4="2.5.4",c9=`${r4}.72`,Wy,Rs,n4=(Rs=class{constructor(e={}){y(this,"targetCertificate",new Jn),y(this,"targetName"),y(this,"certDigestInfo"),Object.assign(this,e)}},u(Rs,"_TargetCert"),Rs);o(n4,"TargetCert");var dh=n4;h([m({type:Jn})],dh.prototype,"targetCertificate",void 0);h([m({type:de,optional:!0})],dh.prototype,"targetName",void 0);h([m({type:zn,optional:!0})],dh.prototype,"certDigestInfo",void 0);var x0,js,md=(x0=(js=class{constructor(e={}){y(this,"targetName"),y(this,"targetGroup"),y(this,"targetCert"),Object.assign(this,e)}},u(js,"_a43"),js),o(x0,"Target"),x0);h([m({type:de,context:0,implicit:!0})],md.prototype,"targetName",void 0);h([m({type:de,context:1,implicit:!0})],md.prototype,"targetGroup",void 0);h([m({type:dh,context:2,implicit:!0})],md.prototype,"targetCert",void 0);md=h([$({type:D.Choice})],md);var P0,Ls,Jy=Wy=(P0=(Ls=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Wy.prototype)}},u(Ls,"_a44"),Ls),o(P0,"Targets"),P0);Jy=Wy=h([$({type:D.Sequence,itemType:md})],Jy);var zy,I0,Ds,ib=zy=(I0=(Ds=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,zy.prototype)}},u(Ds,"_a45"),Ds),o(I0,"ProxyInfo"),I0);ib=zy=h([$({type:D.Sequence,itemType:Jy})],ib);var Ms,i4=(Ms=class{constructor(e={}){y(this,"roleAuthority"),y(this,"roleName"),Object.assign(this,e)}},u(Ms,"_RoleSyntax"),Ms);o(i4,"RoleSyntax");var a4=i4;h([m({type:gt,implicit:!0,context:0,optional:!0})],a4.prototype,"roleAuthority",void 0);h([m({type:de,implicit:!0,context:1})],a4.prototype,"roleName",void 0);var Vs,o4=(Vs=class{constructor(e={}){y(this,"service",new de),y(this,"ident",new de),y(this,"authInfo"),Object.assign(this,e)}},u(Vs,"_SvceAuthInfo"),Vs);o(o4,"SvceAuthInfo");var Mm=o4;h([m({type:de})],Mm.prototype,"service",void 0);h([m({type:de})],Mm.prototype,"ident",void 0);h([m({type:Ce,optional:!0})],Mm.prototype,"authInfo",void 0);var Gy,Us,s4=(Us=class{constructor(e={}){y(this,"otherCertFormat",""),y(this,"otherCert",new ArrayBuffer(0)),Object.assign(this,e)}},u(Us,"_OtherCertificateFormat"),Us);o(s4,"OtherCertificateFormat");var Vm=s4;h([m({type:k.ObjectIdentifier})],Vm.prototype,"otherCertFormat",void 0);h([m({type:k.Any})],Vm.prototype,"otherCert",void 0);var O0,$s,bd=(O0=($s=class{constructor(e={}){y(this,"certificate"),y(this,"v2AttrCert"),y(this,"other"),Object.assign(this,e)}},u($s,"_a46"),$s),o(O0,"CertificateChoices"),O0);h([m({type:vd})],bd.prototype,"certificate",void 0);h([m({type:uh,context:2,implicit:!0})],bd.prototype,"v2AttrCert",void 0);h([m({type:Vm,context:3,implicit:!0})],bd.prototype,"other",void 0);bd=h([$({type:D.Choice})],bd);var B0,qs,dp=Gy=(B0=(qs=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Gy.prototype)}},u(qs,"_a47"),qs),o(B0,"CertificateSet"),B0);dp=Gy=h([$({type:D.Set,itemType:bd})],dp);var Hs,u4=(Hs=class{constructor(e={}){y(this,"contentType",""),y(this,"content",new ArrayBuffer(0)),Object.assign(this,e)}},u(Hs,"_ContentInfo"),Hs);o(u4,"ContentInfo");var Vd=u4;h([m({type:k.ObjectIdentifier})],Vd.prototype,"contentType",void 0);h([m({type:k.Any,context:0})],Vd.prototype,"content",void 0);var N0,Fs,Vf=(N0=(Fs=class{constructor(e={}){y(this,"single"),y(this,"any"),Object.assign(this,e)}},u(Fs,"_a48"),Fs),o(N0,"EncapsulatedContent"),N0);h([m({type:Ce})],Vf.prototype,"single",void 0);h([m({type:k.Any})],Vf.prototype,"any",void 0);Vf=h([$({type:D.Choice})],Vf);var Ks,c4=(Ks=class{constructor(e={}){y(this,"eContentType",""),y(this,"eContent"),Object.assign(this,e)}},u(Ks,"_EncapsulatedContentInfo"),Ks);o(c4,"EncapsulatedContentInfo");var fh=c4;h([m({type:k.ObjectIdentifier})],fh.prototype,"eContentType",void 0);h([m({type:Vf,context:0,optional:!0})],fh.prototype,"eContent",void 0);var T0,Ws,Uf=(T0=(Ws=class{constructor(e={}){y(this,"value"),y(this,"constructedValue"),Object.assign(this,e)}},u(Ws,"_a49"),Ws),o(T0,"EncryptedContent"),T0);h([m({type:Ce,context:0,implicit:!0,optional:!0})],Uf.prototype,"value",void 0);h([m({type:Ce,converter:eP,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Uf.prototype,"constructedValue",void 0);Uf=h([$({type:D.Choice})],Uf);var Js,d4=(Js=class{constructor(e={}){y(this,"contentType",""),y(this,"contentEncryptionAlgorithm",new op),y(this,"encryptedContent"),Object.assign(this,e)}},u(Js,"_EncryptedContentInfo"),Js);o(d4,"EncryptedContentInfo");var Al=d4;h([m({type:k.ObjectIdentifier})],Al.prototype,"contentType",void 0);h([m({type:op})],Al.prototype,"contentEncryptionAlgorithm",void 0);h([m({type:Uf,optional:!0})],Al.prototype,"encryptedContent",void 0);var zs,f4=(zs=class{constructor(e={}){y(this,"keyAttrId",""),y(this,"keyAttr"),Object.assign(this,e)}},u(zs,"_OtherKeyAttribute"),zs);o(f4,"OtherKeyAttribute");var lh=f4;h([m({type:k.ObjectIdentifier})],lh.prototype,"keyAttrId",void 0);h([m({type:k.Any,optional:!0})],lh.prototype,"keyAttr",void 0);var Xy,Gs,l4=(Gs=class{constructor(e={}){y(this,"subjectKeyIdentifier",new rn),y(this,"date"),y(this,"other"),Object.assign(this,e)}},u(Gs,"_RecipientKeyIdentifier"),Gs);o(l4,"RecipientKeyIdentifier");var ph=l4;h([m({type:rn})],ph.prototype,"subjectKeyIdentifier",void 0);h([m({type:k.GeneralizedTime,optional:!0})],ph.prototype,"date",void 0);h([m({type:lh,optional:!0})],ph.prototype,"other",void 0);var R0,Xs,wd=(R0=(Xs=class{constructor(e={}){y(this,"rKeyId"),y(this,"issuerAndSerialNumber"),Object.assign(this,e)}},u(Xs,"_a50"),Xs),o(R0,"KeyAgreeRecipientIdentifier"),R0);h([m({type:ph,context:0,implicit:!0,optional:!0})],wd.prototype,"rKeyId",void 0);h([m({type:Dd,optional:!0})],wd.prototype,"issuerAndSerialNumber",void 0);wd=h([$({type:D.Choice})],wd);var Zs,p4=(Zs=class{constructor(e={}){y(this,"rid",new wd),y(this,"encryptedKey",new Ce),Object.assign(this,e)}},u(Zs,"_RecipientEncryptedKey"),Zs);o(p4,"RecipientEncryptedKey");var Um=p4;h([m({type:wd})],Um.prototype,"rid",void 0);h([m({type:Ce})],Um.prototype,"encryptedKey",void 0);var j0,Qs,fp=Xy=(j0=(Qs=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Xy.prototype)}},u(Qs,"_a51"),Qs),o(j0,"RecipientEncryptedKeys"),j0);fp=Xy=h([$({type:D.Sequence,itemType:Um})],fp);var Ys,h4=(Ys=class{constructor(e={}){y(this,"algorithm",new z),y(this,"publicKey",new ArrayBuffer(0)),Object.assign(this,e)}},u(Ys,"_OriginatorPublicKey"),Ys);o(h4,"OriginatorPublicKey");var $m=h4;h([m({type:z})],$m.prototype,"algorithm",void 0);h([m({type:k.BitString})],$m.prototype,"publicKey",void 0);var L0,eu,Rn=(L0=(eu=class{constructor(e={}){y(this,"subjectKeyIdentifier"),y(this,"originatorKey"),y(this,"issuerAndSerialNumber"),Object.assign(this,e)}},u(eu,"_a52"),eu),o(L0,"OriginatorIdentifierOrKey"),L0);h([m({type:rn,context:0,implicit:!0,optional:!0})],Rn.prototype,"subjectKeyIdentifier",void 0);h([m({type:$m,context:1,implicit:!0,optional:!0})],Rn.prototype,"originatorKey",void 0);h([m({type:Dd,optional:!0})],Rn.prototype,"issuerAndSerialNumber",void 0);Rn=h([$({type:D.Choice})],Rn);var tu,v4=(tu=class{constructor(e={}){y(this,"version",qr.v3),y(this,"originator",new Rn),y(this,"ukm"),y(this,"keyEncryptionAlgorithm",new Sr),y(this,"recipientEncryptedKeys",new fp),Object.assign(this,e)}},u(tu,"_KeyAgreeRecipientInfo"),tu);o(v4,"KeyAgreeRecipientInfo");var Ud=v4;h([m({type:k.Integer})],Ud.prototype,"version",void 0);h([m({type:Rn,context:0})],Ud.prototype,"originator",void 0);h([m({type:Ce,context:1,optional:!0})],Ud.prototype,"ukm",void 0);h([m({type:Sr})],Ud.prototype,"keyEncryptionAlgorithm",void 0);h([m({type:fp})],Ud.prototype,"recipientEncryptedKeys",void 0);var D0,ru,_d=(D0=(ru=class{constructor(e={}){y(this,"subjectKeyIdentifier"),y(this,"issuerAndSerialNumber"),Object.assign(this,e)}},u(ru,"_a53"),ru),o(D0,"RecipientIdentifier"),D0);h([m({type:rn,context:0,implicit:!0})],_d.prototype,"subjectKeyIdentifier",void 0);h([m({type:Dd})],_d.prototype,"issuerAndSerialNumber",void 0);_d=h([$({type:D.Choice})],_d);var nu,y4=(nu=class{constructor(e={}){y(this,"version",qr.v0),y(this,"rid",new _d),y(this,"keyEncryptionAlgorithm",new Sr),y(this,"encryptedKey",new Ce),Object.assign(this,e)}},u(nu,"_KeyTransRecipientInfo"),nu);o(y4,"KeyTransRecipientInfo");var Cl=y4;h([m({type:k.Integer})],Cl.prototype,"version",void 0);h([m({type:_d})],Cl.prototype,"rid",void 0);h([m({type:Sr})],Cl.prototype,"keyEncryptionAlgorithm",void 0);h([m({type:Ce})],Cl.prototype,"encryptedKey",void 0);var iu,g4=(iu=class{constructor(e={}){y(this,"keyIdentifier",new Ce),y(this,"date"),y(this,"other"),Object.assign(this,e)}},u(iu,"_KEKIdentifier"),iu);o(g4,"KEKIdentifier");var El=g4;h([m({type:Ce})],El.prototype,"keyIdentifier",void 0);h([m({type:k.GeneralizedTime,optional:!0})],El.prototype,"date",void 0);h([m({type:lh,optional:!0})],El.prototype,"other",void 0);var au,m4=(au=class{constructor(e={}){y(this,"version",qr.v4),y(this,"kekid",new El),y(this,"keyEncryptionAlgorithm",new Sr),y(this,"encryptedKey",new Ce),Object.assign(this,e)}},u(au,"_KEKRecipientInfo"),au);o(m4,"KEKRecipientInfo");var kl=m4;h([m({type:k.Integer})],kl.prototype,"version",void 0);h([m({type:El})],kl.prototype,"kekid",void 0);h([m({type:Sr})],kl.prototype,"keyEncryptionAlgorithm",void 0);h([m({type:Ce})],kl.prototype,"encryptedKey",void 0);var ou,b4=(ou=class{constructor(e={}){y(this,"version",qr.v0),y(this,"keyDerivationAlgorithm"),y(this,"keyEncryptionAlgorithm",new Sr),y(this,"encryptedKey",new Ce),Object.assign(this,e)}},u(ou,"_PasswordRecipientInfo"),ou);o(b4,"PasswordRecipientInfo");var xl=b4;h([m({type:k.Integer})],xl.prototype,"version",void 0);h([m({type:Uy,context:0,optional:!0})],xl.prototype,"keyDerivationAlgorithm",void 0);h([m({type:Sr})],xl.prototype,"keyEncryptionAlgorithm",void 0);h([m({type:Ce})],xl.prototype,"encryptedKey",void 0);var su,w4=(su=class{constructor(e={}){y(this,"oriType",""),y(this,"oriValue",new ArrayBuffer(0)),Object.assign(this,e)}},u(su,"_OtherRecipientInfo"),su);o(w4,"OtherRecipientInfo");var qm=w4;h([m({type:k.ObjectIdentifier})],qm.prototype,"oriType",void 0);h([m({type:k.Any})],qm.prototype,"oriValue",void 0);var M0,uu,un=(M0=(uu=class{constructor(e={}){y(this,"ktri"),y(this,"kari"),y(this,"kekri"),y(this,"pwri"),y(this,"ori"),Object.assign(this,e)}},u(uu,"_a54"),uu),o(M0,"RecipientInfo"),M0);h([m({type:Cl,optional:!0})],un.prototype,"ktri",void 0);h([m({type:Ud,context:1,implicit:!0,optional:!0})],un.prototype,"kari",void 0);h([m({type:kl,context:2,implicit:!0,optional:!0})],un.prototype,"kekri",void 0);h([m({type:xl,context:3,implicit:!0,optional:!0})],un.prototype,"pwri",void 0);h([m({type:qm,context:4,implicit:!0,optional:!0})],un.prototype,"ori",void 0);un=h([$({type:D.Choice})],un);var Zy,V0,cu,lp=Zy=(V0=(cu=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Zy.prototype)}},u(cu,"_a55"),cu),o(V0,"RecipientInfos"),V0);lp=Zy=h([$({type:D.Set,itemType:un})],lp);var Qy,_4=`${Rd}.16`,d9=`${_4}.2`,f9=`${_4}.4`,du,S4=(du=class{constructor(e={}){y(this,"otherRevInfoFormat",""),y(this,"otherRevInfo",new ArrayBuffer(0)),Object.assign(this,e)}},u(du,"_OtherRevocationInfoFormat"),du);o(S4,"OtherRevocationInfoFormat");var hh=S4;h([m({type:k.ObjectIdentifier})],hh.prototype,"otherRevInfoFormat",void 0);h([m({type:k.Any})],hh.prototype,"otherRevInfo",void 0);var U0,fu,pp=(U0=(fu=class{constructor(e={}){y(this,"other",new hh),Object.assign(this,e)}},u(fu,"_a56"),fu),o(U0,"RevocationInfoChoice"),U0);h([m({type:hh,context:1,implicit:!0})],pp.prototype,"other",void 0);pp=h([$({type:D.Choice})],pp);var $0,lu,hp=Qy=($0=(lu=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Qy.prototype)}},u(lu,"_a57"),lu),o($0,"RevocationInfoChoices"),$0);hp=Qy=h([$({type:D.Set,itemType:pp})],hp);var pu,A4=(pu=class{constructor(e={}){y(this,"certs"),y(this,"crls"),Object.assign(this,e)}},u(pu,"_OriginatorInfo"),pu);o(A4,"OriginatorInfo");var Hm=A4;h([m({type:dp,context:0,implicit:!0,optional:!0})],Hm.prototype,"certs",void 0);h([m({type:hp,context:1,implicit:!0,optional:!0})],Hm.prototype,"crls",void 0);var Yy,q0,hu,eg=Yy=(q0=(hu=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Yy.prototype)}},u(hu,"_a58"),hu),o(q0,"UnprotectedAttributes"),q0);eg=Yy=h([$({type:D.Set,itemType:Md})],eg);var vu,C4=(vu=class{constructor(e={}){y(this,"version",qr.v0),y(this,"originatorInfo"),y(this,"recipientInfos",new lp),y(this,"encryptedContentInfo",new Al),y(this,"unprotectedAttrs"),Object.assign(this,e)}},u(vu,"_EnvelopedData"),vu);o(C4,"EnvelopedData");var Pl=C4;h([m({type:k.Integer})],Pl.prototype,"version",void 0);h([m({type:Hm,context:0,implicit:!0,optional:!0})],Pl.prototype,"originatorInfo",void 0);h([m({type:lp})],Pl.prototype,"recipientInfos",void 0);h([m({type:Al})],Pl.prototype,"encryptedContentInfo",void 0);h([m({type:eg,context:1,implicit:!0,optional:!0})],Pl.prototype,"unprotectedAttrs",void 0);var IP="1.2.840.113549.1.7.2",tg,H0,yu,vp=tg=(H0=(yu=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,tg.prototype)}},u(yu,"_a59"),yu),o(H0,"DigestAlgorithmIdentifiers"),H0);vp=tg=h([$({type:D.Set,itemType:Mf})],vp);var gu,E4=(gu=class{constructor(e={}){y(this,"version",qr.v0),y(this,"digestAlgorithms",new vp),y(this,"encapContentInfo",new fh),y(this,"certificates"),y(this,"crls"),y(this,"signerInfos",new sp),Object.assign(this,e)}},u(gu,"_SignedData"),gu);o(E4,"SignedData");var $d=E4;h([m({type:k.Integer})],$d.prototype,"version",void 0);h([m({type:vp})],$d.prototype,"digestAlgorithms",void 0);h([m({type:fh})],$d.prototype,"encapContentInfo",void 0);h([m({type:dp,context:0,implicit:!0,optional:!0})],$d.prototype,"certificates",void 0);h([m({type:hp,context:1,implicit:!0,optional:!0})],$d.prototype,"crls",void 0);h([m({type:sp})],$d.prototype,"signerInfos",void 0);var $f="1.2.840.10045.2.1",Fm="1.2.840.10045.4.1",k4="1.2.840.10045.4.3.1",Km="1.2.840.10045.4.3.2",Wm="1.2.840.10045.4.3.3",Jm="1.2.840.10045.4.3.4",ab="1.2.840.10045.3.1.7",ob="1.3.132.0.34",sb="1.3.132.0.35";function qd(r){return new z({algorithm:r})}u(qd,"create");o(qd,"create");var OP=qd(Fm),l9=qd(k4),BP=qd(Km),NP=qd(Wm),TP=qd(Jm),F0,mu,qf=(F0=(mu=class{constructor(e={}){y(this,"fieldType"),y(this,"parameters"),Object.assign(this,e)}},u(mu,"_a60"),mu),o(F0,"FieldID"),F0);h([m({type:k.ObjectIdentifier})],qf.prototype,"fieldType",void 0);h([m({type:k.Any})],qf.prototype,"parameters",void 0);qf=h([$({type:D.Sequence})],qf);var bu,x4=(bu=class extends Ce{},u(bu,"_ECPoint"),bu);o(x4,"ECPoint");var RP=x4,K0,wu,Sd=(K0=(wu=class{constructor(e={}){y(this,"a"),y(this,"b"),y(this,"seed"),Object.assign(this,e)}},u(wu,"_a61"),wu),o(K0,"Curve"),K0);h([m({type:k.OctetString})],Sd.prototype,"a",void 0);h([m({type:k.OctetString})],Sd.prototype,"b",void 0);h([m({type:k.BitString,optional:!0})],Sd.prototype,"seed",void 0);Sd=h([$({type:D.Sequence})],Sd);var rg;(function(r){r[r.ecpVer1=1]="ecpVer1"})(rg||(rg={}));var W0,_u,Hr=(W0=(_u=class{constructor(e={}){y(this,"version",rg.ecpVer1),y(this,"fieldID"),y(this,"curve"),y(this,"base"),y(this,"order"),y(this,"cofactor"),Object.assign(this,e)}},u(_u,"_a62"),_u),o(W0,"SpecifiedECDomain"),W0);h([m({type:k.Integer})],Hr.prototype,"version",void 0);h([m({type:qf})],Hr.prototype,"fieldID",void 0);h([m({type:Sd})],Hr.prototype,"curve",void 0);h([m({type:RP})],Hr.prototype,"base",void 0);h([m({type:k.Integer,converter:Le})],Hr.prototype,"order",void 0);h([m({type:k.Integer,optional:!0})],Hr.prototype,"cofactor",void 0);Hr=h([$({type:D.Sequence})],Hr);var J0,Su,cn=(J0=(Su=class{constructor(e={}){y(this,"namedCurve"),y(this,"implicitCurve"),y(this,"specifiedCurve"),Object.assign(this,e)}},u(Su,"_a63"),Su),o(J0,"ECParameters"),J0);h([m({type:k.ObjectIdentifier})],cn.prototype,"namedCurve",void 0);h([m({type:k.Null})],cn.prototype,"implicitCurve",void 0);h([m({type:Hr})],cn.prototype,"specifiedCurve",void 0);cn=h([$({type:D.Choice})],cn);var Au,P4=(Au=class{constructor(e={}){y(this,"version",1),y(this,"privateKey",new Ce),y(this,"parameters"),y(this,"publicKey"),Object.assign(this,e)}},u(Au,"_ECPrivateKey"),Au);o(P4,"ECPrivateKey");var vh=P4;h([m({type:k.Integer})],vh.prototype,"version",void 0);h([m({type:Ce})],vh.prototype,"privateKey",void 0);h([m({type:cn,context:0,optional:!0})],vh.prototype,"parameters",void 0);h([m({type:k.BitString,context:1,optional:!0})],vh.prototype,"publicKey",void 0);var Cu,I4=(Cu=class{constructor(e={}){y(this,"r",new ArrayBuffer(0)),y(this,"s",new ArrayBuffer(0)),Object.assign(this,e)}},u(Cu,"_ECDSASigValue"),Cu);o(I4,"ECDSASigValue");var yp=I4;h([m({type:k.Integer,converter:Le})],yp.prototype,"r",void 0);h([m({type:k.Integer,converter:Le})],yp.prototype,"s",void 0);var Pt="1.2.840.113549.1.1",jn=`${Pt}.1`,jP=`${Pt}.7`,LP=`${Pt}.9`,Pf=`${Pt}.10`,DP=`${Pt}.2`,MP=`${Pt}.4`,gp=`${Pt}.5`,VP=`${Pt}.14`,ng=`${Pt}.11`,mp=`${Pt}.12`,bp=`${Pt}.13`,O4=`${Pt}.15`,B4=`${Pt}.16`,wp="1.3.14.3.2.26",N4="2.16.840.1.101.3.4.2.4",_p="2.16.840.1.101.3.4.2.1",Sp="2.16.840.1.101.3.4.2.2",Ap="2.16.840.1.101.3.4.2.3",UP="2.16.840.1.101.3.4.2.5",$P="2.16.840.1.101.3.4.2.6",qP="1.2.840.113549.2.2",HP="1.2.840.113549.2.5",yh=`${Pt}.8`;function Qe(r){return new z({algorithm:r,parameters:null})}u(Qe,"create2");o(Qe,"create");var p9=Qe(qP),h9=Qe(HP),Ln=Qe(wp),v9=Qe(N4),y9=Qe(_p),g9=Qe(Sp),m9=Qe(Ap),b9=Qe(UP),w9=Qe($P),T4=new z({algorithm:yh,parameters:Nd.serialize(Ln)}),R4=new z({algorithm:LP,parameters:Nd.serialize(Ql.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))}),_9=Qe(jn),S9=Qe(DP),A9=Qe(MP),C9=Qe(gp),E9=Qe(O4),k9=Qe(B4),x9=Qe(mp),P9=Qe(bp),I9=Qe(O4),O9=Qe(B4),Eu,j4=(Eu=class{constructor(e={}){y(this,"hashAlgorithm",new z(Ln)),y(this,"maskGenAlgorithm",new z({algorithm:yh,parameters:Nd.serialize(Ln)})),y(this,"pSourceAlgorithm",new z(R4)),Object.assign(this,e)}},u(Eu,"_RsaEsOaepParams"),Eu);o(j4,"RsaEsOaepParams");var gh=j4;h([m({type:z,context:0,defaultValue:Ln})],gh.prototype,"hashAlgorithm",void 0);h([m({type:z,context:1,defaultValue:T4})],gh.prototype,"maskGenAlgorithm",void 0);h([m({type:z,context:2,defaultValue:R4})],gh.prototype,"pSourceAlgorithm",void 0);var B9=new z({algorithm:jP,parameters:Nd.serialize(new gh)}),ku,L4=(ku=class{constructor(e={}){y(this,"hashAlgorithm",new z(Ln)),y(this,"maskGenAlgorithm",new z({algorithm:yh,parameters:Nd.serialize(Ln)})),y(this,"saltLength",20),y(this,"trailerField",1),Object.assign(this,e)}},u(ku,"_RsaSaPssParams"),ku);o(L4,"RsaSaPssParams");var Dn=L4;h([m({type:z,context:0,defaultValue:Ln})],Dn.prototype,"hashAlgorithm",void 0);h([m({type:z,context:1,defaultValue:T4})],Dn.prototype,"maskGenAlgorithm",void 0);h([m({type:k.Integer,context:2,defaultValue:20})],Dn.prototype,"saltLength",void 0);h([m({type:k.Integer,context:3,defaultValue:1})],Dn.prototype,"trailerField",void 0);var N9=new z({algorithm:Pf,parameters:Nd.serialize(new Dn)}),xu,D4=(xu=class{constructor(e={}){y(this,"digestAlgorithm",new z),y(this,"digest",new Ce),Object.assign(this,e)}},u(xu,"_DigestInfo"),xu);o(D4,"DigestInfo");var mh=D4;h([m({type:z})],mh.prototype,"digestAlgorithm",void 0);h([m({type:Ce})],mh.prototype,"digest",void 0);var ig,Pu,M4=(Pu=class{constructor(e={}){y(this,"prime",new ArrayBuffer(0)),y(this,"exponent",new ArrayBuffer(0)),y(this,"coefficient",new ArrayBuffer(0)),Object.assign(this,e)}},u(Pu,"_OtherPrimeInfo"),Pu);o(M4,"OtherPrimeInfo");var bh=M4;h([m({type:k.Integer,converter:Le})],bh.prototype,"prime",void 0);h([m({type:k.Integer,converter:Le})],bh.prototype,"exponent",void 0);h([m({type:k.Integer,converter:Le})],bh.prototype,"coefficient",void 0);var z0,Iu,ag=ig=(z0=(Iu=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,ig.prototype)}},u(Iu,"_a64"),Iu),o(z0,"OtherPrimeInfos"),z0);ag=ig=h([$({type:D.Sequence,itemType:bh})],ag);var Ou,V4=(Ou=class{constructor(e={}){y(this,"version",0),y(this,"modulus",new ArrayBuffer(0)),y(this,"publicExponent",new ArrayBuffer(0)),y(this,"privateExponent",new ArrayBuffer(0)),y(this,"prime1",new ArrayBuffer(0)),y(this,"prime2",new ArrayBuffer(0)),y(this,"exponent1",new ArrayBuffer(0)),y(this,"exponent2",new ArrayBuffer(0)),y(this,"coefficient",new ArrayBuffer(0)),y(this,"otherPrimeInfos"),Object.assign(this,e)}},u(Ou,"_RSAPrivateKey"),Ou);o(V4,"RSAPrivateKey");var xr=V4;h([m({type:k.Integer})],xr.prototype,"version",void 0);h([m({type:k.Integer,converter:Le})],xr.prototype,"modulus",void 0);h([m({type:k.Integer,converter:Le})],xr.prototype,"publicExponent",void 0);h([m({type:k.Integer,converter:Le})],xr.prototype,"privateExponent",void 0);h([m({type:k.Integer,converter:Le})],xr.prototype,"prime1",void 0);h([m({type:k.Integer,converter:Le})],xr.prototype,"prime2",void 0);h([m({type:k.Integer,converter:Le})],xr.prototype,"exponent1",void 0);h([m({type:k.Integer,converter:Le})],xr.prototype,"exponent2",void 0);h([m({type:k.Integer,converter:Le})],xr.prototype,"coefficient",void 0);h([m({type:ag,optional:!0})],xr.prototype,"otherPrimeInfos",void 0);var Bu,U4=(Bu=class{constructor(e={}){y(this,"modulus",new ArrayBuffer(0)),y(this,"publicExponent",new ArrayBuffer(0)),Object.assign(this,e)}},u(Bu,"_RSAPublicKey"),Bu);o(U4,"RSAPublicKey");var zm=U4;h([m({type:k.Integer,converter:Le})],zm.prototype,"modulus",void 0);h([m({type:k.Integer,converter:Le})],zm.prototype,"publicExponent",void 0);var og;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(og||(og={}));var At=og,sg=o(function(r,e){return sg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},sg(r,e)},"extendStatics");function wh(r,e){sg(r,e);function t(){this.constructor=r}u(t,"__"),o(t,"__"),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}u(wh,"__extends");o(wh,"__extends");function $4(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return u(i,"adopt"),o(i,"adopt"),new(t||(t=Promise))(function(a,s){function c(l){try{f(n.next(l))}catch(p){s(p)}}u(c,"fulfilled"),o(c,"fulfilled");function d(l){try{f(n.throw(l))}catch(p){s(p)}}u(d,"rejected"),o(d,"rejected");function f(l){l.done?a(l.value):i(l.value).then(c,d)}u(f,"step"),o(f,"step"),f((n=n.apply(r,e||[])).next())})}u($4,"__awaiter");o($4,"__awaiter");function q4(r,e){var t={label:0,sent:o(function(){if(a[0]&1)throw a[1];return a[1]},"sent"),trys:[],ops:[]},n,i,a,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(f){return function(l){return d([f,l])}}function d(f){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,i=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){t.label=f[1];break}if(f[0]===6&&t.label<a[1]){t.label=a[1],a=f;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(f);break}a[2]&&t.ops.pop(),t.trys.pop();continue}f=e.call(r,t)}catch(l){f=[6,l],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}u(q4,"__generator");o(q4,"__generator");function Yd(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:o(function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}u(Yd,"__values");o(Yd,"__values");function Hf(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(c){s={error:c}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return a}u(Hf,"__read");o(Hf,"__read");function Zr(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Hf(arguments[e]));return r}u(Zr,"__spread");o(Zr,"__spread");var FP="injectionTokens";function H4(r){var e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(FP,r)||{};return Object.keys(t).forEach(function(n){e[+n]=t[n]}),e}u(H4,"getParamInfo");o(H4,"getParamInfo");function Gm(r){return!!r.useClass}u(Gm,"isClassProvider");o(Gm,"isClassProvider");function Cp(r){return!!r.useFactory}u(Cp,"isFactoryProvider");o(Cp,"isFactoryProvider");var F4=(function(){function r(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return u(r,"DelayedConstructor2"),o(r,"DelayedConstructor"),r.prototype.createProxy=function(e){var t=this,n={},i=!1,a,s=o(function(){return i||(a=e(t.wrap()),i=!0),a},"delayedObject");return new Proxy(n,this.createHandler(s))},r.prototype.createHandler=function(e){var t={},n=o(function(i){t[i]=function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];a[0]=e();var c=Reflect[i];return c.apply(void 0,Zr(a))}},"install");return this.reflectMethods.forEach(n),t},r})();function gn(r){return typeof r=="string"||typeof r=="symbol"}u(gn,"isNormalToken");o(gn,"isNormalToken");function K4(r){return typeof r=="object"&&"token"in r&&"multiple"in r}u(K4,"isTokenDescriptor");o(K4,"isTokenDescriptor");function ug(r){return typeof r=="object"&&"token"in r&&"transform"in r}u(ug,"isTransformDescriptor");o(ug,"isTransformDescriptor");function W4(r){return typeof r=="function"||r instanceof F4}u(W4,"isConstructorToken");o(W4,"isConstructorToken");function If(r){return!!r.useToken}u(If,"isTokenProvider");o(If,"isTokenProvider");function Of(r){return r.useValue!=null}u(Of,"isValueProvider");o(Of,"isValueProvider");function J4(r){return Gm(r)||Of(r)||If(r)||Cp(r)}u(J4,"isProvider");o(J4,"isProvider");var KP=(function(){function r(){this._registryMap=new Map}return u(r,"RegistryBase2"),o(r,"RegistryBase"),r.prototype.entries=function(){return this._registryMap.entries()},r.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},r.prototype.get=function(e){this.ensure(e);var t=this._registryMap.get(e);return t[t.length-1]||null},r.prototype.set=function(e,t){this.ensure(e),this._registryMap.get(e).push(t)},r.prototype.setAll=function(e,t){this._registryMap.set(e,t)},r.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},r.prototype.clear=function(){this._registryMap.clear()},r.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},r})(),Xm=KP,WP=(function(r){wh(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return u(e,"Registry2"),o(e,"Registry"),e})(Xm),JP=WP,zP=(function(){function r(){this.scopedResolutions=new Map}return u(r,"ResolutionContext2"),o(r,"ResolutionContext"),r})(),Ml=zP;function z4(r,e){if(r===null)return"at position #"+e;var t=r.split(",")[e].trim();return'"'+t+'" at position #'+e}u(z4,"formatDependency");o(z4,"formatDependency");function G4(r,e,t){return t===void 0&&(t=" "),Zr([r],e.message.split(`
20
- `).map(function(n){return t+n})).join(`
21
- `)}u(G4,"composeErrorMessage");o(G4,"composeErrorMessage");function X4(r,e,t){var n=Hf(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),i=n[1],a=i===void 0?null:i,s=z4(a,e);return G4("Cannot inject the dependency "+s+' of "'+r.name+'" constructor. Reason:',t)}u(X4,"formatErrorCtor");o(X4,"formatErrorCtor");function Z4(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}u(Z4,"isDisposable");o(Z4,"isDisposable");var GP=(function(r){wh(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return u(e,"PreResolutionInterceptors2"),o(e,"PreResolutionInterceptors"),e})(Xm),XP=(function(r){wh(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return u(e,"PostResolutionInterceptors2"),o(e,"PostResolutionInterceptors"),e})(Xm),ZP=(function(){function r(){this.preResolution=new GP,this.postResolution=new XP}return u(r,"Interceptors2"),o(r,"Interceptors"),r})(),QP=ZP,Q4=new Map,YP=(function(){function r(e){this.parent=e,this._registry=new JP,this.interceptors=new QP,this.disposed=!1,this.disposables=new Set}return u(r,"InternalDependencyContainer2"),o(r,"InternalDependencyContainer"),r.prototype.register=function(e,t,n){n===void 0&&(n={lifecycle:At.Transient}),this.ensureNotDisposed();var i;if(J4(t)?i=t:i={useClass:t},If(i))for(var a=[e],s=i;s!=null;){var c=s.useToken;if(a.includes(c))throw new Error("Token registration cycle detected! "+Zr(a,[c]).join(" -> "));a.push(c);var d=this._registry.get(c);d&&If(d.provider)?s=d.provider:s=null}if((n.lifecycle===At.Singleton||n.lifecycle==At.ContainerScoped||n.lifecycle==At.ResolutionScoped)&&(Of(i)||Cp(i)))throw new Error('Cannot use lifecycle "'+At[n.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:i,options:n}),this},r.prototype.registerType=function(e,t){return this.ensureNotDisposed(),gn(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})},r.prototype.registerInstance=function(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})},r.prototype.registerSingleton=function(e,t){if(this.ensureNotDisposed(),gn(e)){if(gn(t))return this.register(e,{useToken:t},{lifecycle:At.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:At.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var n=e;return t&&!gn(t)&&(n=t),this.register(e,{useClass:n},{lifecycle:At.Singleton})},r.prototype.resolve=function(e,t,n){t===void 0&&(t=new Ml),n===void 0&&(n=!1),this.ensureNotDisposed();var i=this.getRegistration(e);if(!i&&gn(e)){if(n)return;throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"Single"),i){var a=this.resolveRegistration(i,t);return this.executePostResolutionInterceptor(e,a,"Single"),a}if(W4(e)){var a=this.construct(e,t);return this.executePostResolutionInterceptor(e,a,"Single"),a}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},r.prototype.executePreResolutionInterceptor=function(e,t){var n,i;if(this.interceptors.preResolution.has(e)){var a=[];try{for(var s=Yd(this.interceptors.preResolution.getAll(e)),c=s.next();!c.done;c=s.next()){var d=c.value;d.options.frequency!="Once"&&a.push(d),d.callback(e,t)}}catch(f){n={error:f}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}this.interceptors.preResolution.setAll(e,a)}},r.prototype.executePostResolutionInterceptor=function(e,t,n){var i,a;if(this.interceptors.postResolution.has(e)){var s=[];try{for(var c=Yd(this.interceptors.postResolution.getAll(e)),d=c.next();!d.done;d=c.next()){var f=d.value;f.options.frequency!="Once"&&s.push(f),f.callback(e,t,n)}}catch(l){i={error:l}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}this.interceptors.postResolution.setAll(e,s)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===At.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var n=e.options.lifecycle===At.Singleton,i=e.options.lifecycle===At.ContainerScoped,a=n||i,s;return Of(e.provider)?s=e.provider.useValue:If(e.provider)?s=a?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):Gm(e.provider)?s=a?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Cp(e.provider)?s=e.provider.useFactory(this):s=this.construct(e.provider,t),e.options.lifecycle===At.ResolutionScoped&&t.scopedResolutions.set(e,s),s},r.prototype.resolveAll=function(e,t,n){var i=this;t===void 0&&(t=new Ml),n===void 0&&(n=!1),this.ensureNotDisposed();var a=this.getAllRegistrations(e);if(!a&&gn(e)){if(n)return[];throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"All"),a){var s=a.map(function(d){return i.resolveRegistration(d,t)});return this.executePostResolutionInterceptor(e,s,"All"),s}var c=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,c,"All"),c},r.prototype.isRegistered=function(e,t){return t===void 0&&(t=!1),this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},r.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},r.prototype.clearInstances=function(){var e,t;this.ensureNotDisposed();try{for(var n=Yd(this._registry.entries()),i=n.next();!i.done;i=n.next()){var a=Hf(i.value,2),s=a[0],c=a[1];this._registry.setAll(s,c.filter(function(d){return!Of(d.provider)}).map(function(d){return d.instance=void 0,d}))}}catch(d){e={error:d}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},r.prototype.createChildContainer=function(){var e,t;this.ensureNotDisposed();var n=new r(this);try{for(var i=Yd(this._registry.entries()),a=i.next();!a.done;a=i.next()){var s=Hf(a.value,2),c=s[0],d=s[1];d.some(function(f){var l=f.options;return l.lifecycle===At.ContainerScoped})&&n._registry.setAll(c,d.map(function(f){return f.options.lifecycle===At.ContainerScoped?{provider:f.provider,options:f.options}:f}))}}catch(f){e={error:f}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n},r.prototype.beforeResolution=function(e,t,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:n})},r.prototype.afterResolution=function(e,t,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:n})},r.prototype.dispose=function(){return $4(this,void 0,void 0,function(){var e;return q4(this,function(t){switch(t.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(n){var i=n.dispose();i&&e.push(i)}),[4,Promise.all(e)];case 1:return t.sent(),[2]}})})},r.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},r.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},r.prototype.construct=function(e,t){var n=this;if(e instanceof F4)return e.createProxy(function(a){return n.resolve(a,t)});var i=(function(){var a=Q4.get(e);if(!a||a.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var s=a.map(n.resolveParams(t,e));return new(e.bind.apply(e,Zr([void 0],s)))})();return Z4(i)&&this.disposables.add(i),i},r.prototype.resolveParams=function(e,t){var n=this;return function(i,a){var s,c,d;try{return K4(i)?ug(i)?i.multiple?(s=n.resolve(i.transform)).transform.apply(s,Zr([n.resolveAll(i.token,new Ml,i.isOptional)],i.transformArgs)):(c=n.resolve(i.transform)).transform.apply(c,Zr([n.resolve(i.token,e,i.isOptional)],i.transformArgs)):i.multiple?n.resolveAll(i.token,new Ml,i.isOptional):n.resolve(i.token,e,i.isOptional):ug(i)?(d=n.resolve(i.transform,e)).transform.apply(d,Zr([n.resolve(i.token,e)],i.transformArgs)):n.resolve(i,e)}catch(f){throw new Error(X4(t,a,f))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r})(),vt=new YP;function Y4(r){return function(e){Q4.set(e,H4(e)),r&&r.token&&(Array.isArray(r.token)?r.token.forEach(function(t){vt.register(t,e)}):vt.register(r.token,e))}}u(Y4,"injectable");o(Y4,"injectable");var _h=Y4;if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var cg,Nu,eC=(Nu=class{constructor(e={}){y(this,"attrId",""),y(this,"attrValues",[]),Object.assign(e)}},u(Nu,"_PKCS12Attribute"),Nu);o(eC,"PKCS12Attribute");var Sh=eC;h([m({type:k.ObjectIdentifier})],Sh.prototype,"attrId",void 0);h([m({type:k.Any,repeated:"set"})],Sh.prototype,"attrValues",void 0);var G0,Tu,ub=cg=(G0=(Tu=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,cg.prototype)}},u(Tu,"_a65"),Tu),o(G0,"PKCS12AttrSet"),G0);ub=cg=h([$({type:D.Sequence,itemType:Sh})],ub);var dg,X0,Ru,cb=dg=(X0=(Ru=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,dg.prototype)}},u(Ru,"_a66"),Ru),o(X0,"AuthenticatedSafe"),X0);cb=dg=h([$({type:D.Sequence,itemType:Vd})],cb);var eI="1.2.840.113549",tI=`${eI}.1`,tC=`${tI}.12`,Hd=`${tC}.1`,T9=`${Hd}.1`,R9=`${Hd}.2`,j9=`${Hd}.3`,L9=`${Hd}.4`,D9=`${Hd}.5`,M9=`${Hd}.6`,Fd=`${tC}.10.1`,V9=`${Fd}.1`,U9=`${Fd}.2`,$9=`${Fd}.3`,q9=`${Fd}.4`,H9=`${Fd}.5`,F9=`${Fd}.6`,rC="1.2.840.113549.1.9",ju,nC=(ju=class{constructor(e={}){y(this,"certId",""),y(this,"certValue",new ArrayBuffer(0)),Object.assign(this,e)}},u(ju,"_CertBag"),ju);o(nC,"CertBag");var iC=nC;h([m({type:k.ObjectIdentifier})],iC.prototype,"certId",void 0);h([m({type:k.Any,context:0})],iC.prototype,"certValue",void 0);var aC=`${rC}.22`,K9=`${aC}.1`,W9=`${aC}.2`,Lu,oC=(Lu=class{constructor(e={}){y(this,"crlId",""),y(this,"crltValue",new ArrayBuffer(0)),Object.assign(this,e)}},u(Lu,"_CRLBag"),Lu);o(oC,"CRLBag");var sC=oC;h([m({type:k.ObjectIdentifier})],sC.prototype,"crlId",void 0);h([m({type:k.Any,context:0})],sC.prototype,"crltValue",void 0);var rI=`${rC}.23`,J9=`${rI}.1`,Du,uC=(Du=class extends Ce{},u(Du,"_EncryptedData"),Du);o(uC,"EncryptedData");var cC=uC,Mu,dC=(Mu=class{constructor(e={}){y(this,"encryptionAlgorithm",new z),y(this,"encryptedData",new cC),Object.assign(this,e)}},u(Mu,"_EncryptedPrivateKeyInfo"),Mu);o(dC,"EncryptedPrivateKeyInfo");var Ah=dC;h([m({type:z})],Ah.prototype,"encryptionAlgorithm",void 0);h([m({type:cC})],Ah.prototype,"encryptedData",void 0);var fg,lg;(function(r){r[r.v1=0]="v1"})(lg||(lg={}));var Vu,fC=(Vu=class extends Ce{},u(Vu,"_PrivateKey"),Vu);o(fC,"PrivateKey");var lC=fC,Z0,Uu,pg=fg=(Z0=(Uu=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,fg.prototype)}},u(Uu,"_a67"),Uu),o(Z0,"Attributes"),Z0);pg=fg=h([$({type:D.Sequence,itemType:$r})],pg);var $u,pC=($u=class{constructor(e={}){y(this,"version",lg.v1),y(this,"privateKeyAlgorithm",new z),y(this,"privateKey",new lC),y(this,"attributes"),Object.assign(this,e)}},u($u,"_PrivateKeyInfo"),$u);o(pC,"PrivateKeyInfo");var Il=pC;h([m({type:k.Integer})],Il.prototype,"version",void 0);h([m({type:z})],Il.prototype,"privateKeyAlgorithm",void 0);h([m({type:lC})],Il.prototype,"privateKey",void 0);h([m({type:pg,implicit:!0,context:0,optional:!0})],Il.prototype,"attributes",void 0);var Q0,qu,db=(Q0=(qu=class extends Il{},u(qu,"_a68"),qu),o(Q0,"KeyBag"),Q0);db=h([$({type:D.Sequence})],db);var Y0,Hu,fb=(Y0=(Hu=class extends Ah{},u(Hu,"_a69"),Hu),o(Y0,"PKCS8ShroudedKeyBag"),Y0);fb=h([$({type:D.Sequence})],fb);var Fu,hC=(Fu=class{constructor(e={}){y(this,"secretTypeId",""),y(this,"secretValue",new ArrayBuffer(0)),Object.assign(this,e)}},u(Fu,"_SecretBag"),Fu);o(hC,"SecretBag");var vC=hC;h([m({type:k.ObjectIdentifier})],vC.prototype,"secretTypeId",void 0);h([m({type:k.Any,context:0})],vC.prototype,"secretValue",void 0);var Ku,yC=(Ku=class{constructor(e={}){y(this,"mac",new mh),y(this,"macSalt",new Ce),y(this,"iterations",1),Object.assign(this,e)}},u(Ku,"_MacData"),Ku);o(yC,"MacData");var Ol=yC;h([m({type:mh})],Ol.prototype,"mac",void 0);h([m({type:Ce})],Ol.prototype,"macSalt",void 0);h([m({type:k.Integer,defaultValue:1})],Ol.prototype,"iterations",void 0);var Wu,gC=(Wu=class{constructor(e={}){y(this,"version",3),y(this,"authSafe",new Vd),y(this,"macData",new Ol),Object.assign(this,e)}},u(Wu,"_PFX"),Wu);o(gC,"PFX");var Ch=gC;h([m({type:k.Integer})],Ch.prototype,"version",void 0);h([m({type:Vd})],Ch.prototype,"authSafe",void 0);h([m({type:Ol,optional:!0})],Ch.prototype,"macData",void 0);var hg,Ju,mC=(Ju=class{constructor(e={}){y(this,"bagId",""),y(this,"bagValue",new ArrayBuffer(0)),y(this,"bagAttributes"),Object.assign(this,e)}},u(Ju,"_SafeBag"),Ju);o(mC,"SafeBag");var Eh=mC;h([m({type:k.ObjectIdentifier})],Eh.prototype,"bagId",void 0);h([m({type:k.Any,context:0})],Eh.prototype,"bagValue",void 0);h([m({type:Sh,repeated:"set",optional:!0})],Eh.prototype,"bagAttributes",void 0);var ev,zu,lb=hg=(ev=(zu=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,hg.prototype)}},u(zu,"_a70"),zu),o(ev,"SafeContents"),ev);lb=hg=h([$({type:D.Sequence,itemType:Eh})],lb);var vg,yg,gg,We="1.2.840.113549.1.9",z9=`${We}.0`,bC=`${We}.24`,Bl=`${We}.25`,wC=`${We}.26`,_C=`${We}.27`,G9=`${bC}.1`,X9=`${bC}.2`,Z9=`${We}.1`,Q9=`${We}.2`,Y9=`${We}.3`,eN=`${We}.4`,tN=`${We}.5`,rN=`${We}.6`,SC=`${We}.7`,nN=`${We}.8`,iN=`${We}.9`,aN=`${We}.13`,Zm=`${We}.14`,oN=`${We}.15`,sN=`${We}.20`,uN=`${We}.21`,cN=`${Bl}.1`,dN=`${Bl}.2`,fN=`${Bl}.3`,lN=`${Bl}.4`,pN=`${Bl}.5`,Nl="1.3.6.1.5.5.7.9",hN=`${Nl}.1`,vN=`${Nl}.2`,yN=`${Nl}.3`,gN=`${Nl}.4`,mN=`${Nl}.5`,bN=`${wC}.1`,wN=`${wC}.2`,_N=`${_C}.1`,SN=`${_C}.2`,AN=`${We}.16`,CN=`${We}.22`,EN=`${We}.23`,kN=`${r4}.65`,tv,Gu,Ep=(tv=(Gu=class extends ht{constructor(e={}){super(e),y(this,"ia5String")}toString(){return{}.toString(),this.ia5String||super.toString()}},u(Gu,"_a71"),Gu),o(tv,"PKCS9String"),tv);h([m({type:k.IA5String})],Ep.prototype,"ia5String",void 0);Ep=h([$({type:D.Choice})],Ep);var rv,Xu,pb=(rv=(Xu=class extends Vd{},u(Xu,"_a72"),Xu),o(rv,"Pkcs7PDU"),rv);pb=h([$({type:D.Sequence})],pb);var nv,Zu,hb=(nv=(Zu=class extends Ch{},u(Zu,"_a73"),Zu),o(nv,"UserPKCS12"),nv);hb=h([$({type:D.Sequence})],hb);var iv,Qu,vb=(iv=(Qu=class extends Ah{},u(Qu,"_a74"),Qu),o(iv,"EncryptedPrivateKeyInfo"),iv);vb=h([$({type:D.Sequence})],vb);var av,Yu,mg=(av=(Yu=class{constructor(e=""){y(this,"value"),this.value=e}toString(){return this.value}},u(Yu,"_a75"),Yu),o(av,"EmailAddress"),av);h([m({type:k.IA5String})],mg.prototype,"value",void 0);mg=h([$({type:D.Choice})],mg);var ov,ec,yb=(ov=(ec=class extends Ep{},u(ec,"_a76"),ec),o(ov,"UnstructuredName"),ov);yb=h([$({type:D.Choice})],yb);var sv,tc,gb=(sv=(tc=class extends ht{},u(tc,"_a77"),tc),o(sv,"UnstructuredAddress"),sv);gb=h([$({type:D.Choice})],gb);var uv,rc,bg=(uv=(rc=class{constructor(e=new Date){y(this,"value"),this.value=e}},u(rc,"_a78"),rc),o(uv,"DateOfBirth"),uv);h([m({type:k.GeneralizedTime})],bg.prototype,"value",void 0);bg=h([$({type:D.Choice})],bg);var cv,nc,mb=(cv=(nc=class extends ht{},u(nc,"_a79"),nc),o(cv,"PlaceOfBirth"),cv);mb=h([$({type:D.Choice})],mb);var dv,ic,wg=(dv=(ic=class{constructor(e="M"){y(this,"value"),this.value=e}toString(){return this.value}},u(ic,"_a80"),ic),o(dv,"Gender"),dv);h([m({type:k.PrintableString})],wg.prototype,"value",void 0);wg=h([$({type:D.Choice})],wg);var fv,ac,kp=(fv=(ac=class{constructor(e=""){y(this,"value"),this.value=e}toString(){return this.value}},u(ac,"_a81"),ac),o(fv,"CountryOfCitizenship"),fv);h([m({type:k.PrintableString})],kp.prototype,"value",void 0);kp=h([$({type:D.Choice})],kp);var lv,oc,bb=(lv=(oc=class extends kp{},u(oc,"_a82"),oc),o(lv,"CountryOfResidence"),lv);bb=h([$({type:D.Choice})],bb);var pv,sc,wb=(pv=(sc=class extends ht{},u(sc,"_a83"),sc),o(pv,"Pseudonym"),pv);wb=h([$({type:D.Choice})],wb);var hv,uc,_g=(hv=(uc=class{constructor(e=""){y(this,"value"),this.value=e}toString(){return this.value}},u(uc,"_a84"),uc),o(hv,"ContentType"),hv);h([m({type:k.ObjectIdentifier})],_g.prototype,"value",void 0);_g=h([$({type:D.Choice})],_g);var vv,cc,_b=(vv=(cc=class extends lt{},u(cc,"_a85"),cc),o(vv,"SigningTime"),vv);_b=h([$({type:D.Choice})],_b);var yv,dc,Sg=(yv=(dc=class{constructor(e=0){y(this,"value"),this.value=e}toString(){return this.value.toString()}},u(dc,"_a86"),dc),o(yv,"SequenceNumber"),yv);h([m({type:k.Integer})],Sg.prototype,"value",void 0);Sg=h([$({type:D.Choice})],Sg);var gv,fc,Sb=(gv=(fc=class extends kr{},u(fc,"_a87"),fc),o(gv,"CounterSignature"),gv);Sb=h([$({type:D.Sequence})],Sb);var mv,lc,xp=(mv=(lc=class extends ht{},u(lc,"_a88"),lc),o(mv,"ChallengePassword"),mv);xp=h([$({type:D.Choice})],xp);var bv,pc,Ab=vg=(bv=(pc=class extends Tn{constructor(e){super(e),Object.setPrototypeOf(this,vg.prototype)}},u(pc,"_a89"),pc),o(bv,"ExtensionRequest"),bv);Ab=vg=h([$({type:D.Sequence})],Ab);var wv,hc,Cb=yg=(wv=(hc=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,yg.prototype)}},u(hc,"_a90"),hc),o(wv,"ExtendedCertificateAttributes"),wv);Cb=yg=h([$({type:D.Set,itemType:Md})],Cb);var _v,vc,Ag=(_v=(vc=class{constructor(e=""){y(this,"value"),this.value=e}toString(){return this.value}},u(vc,"_a91"),vc),o(_v,"FriendlyName"),_v);h([m({type:k.BmpString})],Ag.prototype,"value",void 0);Ag=h([$({type:D.Choice})],Ag);var Sv,yc,Cg=(Sv=(yc=class extends z{},u(yc,"_a92"),yc),o(Sv,"SMIMECapability"),Sv);Cg=h([$({type:D.Sequence})],Cg);var Av,gc,Eb=gg=(Av=(gc=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,gg.prototype)}},u(gc,"_a93"),gc),o(Av,"SMIMECapabilities"),Av);Eb=gg=h([$({type:D.Sequence,itemType:Cg})],Eb);var Eg,Cv,mc,Pp=Eg=(Cv=(mc=class extends ke{constructor(e){super(e),Object.setPrototypeOf(this,Eg.prototype)}},u(mc,"_a94"),mc),o(Cv,"Attributes"),Cv);Pp=Eg=h([$({type:D.Sequence,itemType:$r})],Pp);var bc,AC=(bc=class{constructor(e={}){y(this,"version",0),y(this,"subject",new nt),y(this,"subjectPKInfo",new br),y(this,"attributes",new Pp),Object.assign(this,e)}},u(bc,"_CertificationRequestInfo"),bc);o(AC,"CertificationRequestInfo");var Kd=AC;h([m({type:k.Integer})],Kd.prototype,"version",void 0);h([m({type:nt})],Kd.prototype,"subject",void 0);h([m({type:br})],Kd.prototype,"subjectPKInfo",void 0);h([m({type:Pp,implicit:!0,context:0,optional:!0})],Kd.prototype,"attributes",void 0);var wc,CC=(wc=class{constructor(e={}){y(this,"certificationRequestInfo",new Kd),y(this,"certificationRequestInfoRaw"),y(this,"signatureAlgorithm",new z),y(this,"signature",new ArrayBuffer(0)),Object.assign(this,e)}},u(wc,"_CertificationRequest"),wc);o(CC,"CertificationRequest");var Ff=CC;h([m({type:Kd,raw:!0})],Ff.prototype,"certificationRequestInfo",void 0);h([m({type:z})],Ff.prototype,"signatureAlgorithm",void 0);h([m({type:k.BitString})],Ff.prototype,"signature",void 0);var Tl="crypto.algorithm",_c,EC=(_c=class{getAlgorithms(){return vt.resolveAll(Tl)}toAsnAlgorithm(e){({...e});for(let t of this.getAlgorithms()){let n=t.toAsnAlgorithm(e);if(n)return n}if(/^[0-9.]+$/.test(e.name)){let t=new z({algorithm:e.name});if("parameters"in e){let n=e;t.parameters=n.parameters}return t}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(let n of this.getAlgorithms()){let i=n.toWebAlgorithm(e);if(i)return i}return{name:e.algorithm,parameters:e.parameters}}},u(_c,"_AlgorithmProvider"),_c);o(EC,"AlgorithmProvider");var nI=EC,Ad="crypto.algorithmProvider";vt.registerSingleton(Ad,nI);var $l,It="1.3.36.3.3.2.8.1.1",kb=`${It}.1`,xb=`${It}.2`,Pb=`${It}.3`,Ib=`${It}.4`,Ob=`${It}.5`,Bb=`${It}.6`,Nb=`${It}.7`,Tb=`${It}.8`,Rb=`${It}.9`,jb=`${It}.10`,Lb=`${It}.11`,Db=`${It}.12`,Mb=`${It}.13`,Vb=`${It}.14`,Ub="brainpoolP160r1",$b="brainpoolP160t1",qb="brainpoolP192r1",Hb="brainpoolP192t1",Fb="brainpoolP224r1",Kb="brainpoolP224t1",Wb="brainpoolP256r1",Jb="brainpoolP256t1",zb="brainpoolP320r1",Gb="brainpoolP320t1",Xb="brainpoolP384r1",Zb="brainpoolP384t1",Qb="brainpoolP512r1",Yb="brainpoolP512t1",Ue="ECDSA",Ev,Sc,Kf=$l=(Ev=(Sc=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case Ue.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return OP;case"sha-256":return BP;case"sha-384":return NP;case"sha-512":return TP}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=ab;break;case"K-256":t=$l.SECP256K1;break;case"P-384":t=ob;break;case"P-521":t=sb;break;case Ub:t=kb;break;case $b:t=xb;break;case qb:t=Pb;break;case Hb:t=Ib;break;case Fb:t=Ob;break;case Kb:t=Bb;break;case Wb:t=Nb;break;case Jb:t=Tb;break;case zb:t=Rb;break;case Gb:t=jb;break;case Xb:t=Lb;break;case Zb:t=Db;break;case Qb:t=Mb;break;case Yb:t=Vb;break}if(t)return new z({algorithm:$f,parameters:X.serialize(new cn({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case Fm:return{name:Ue,hash:{name:"SHA-1"}};case Km:return{name:Ue,hash:{name:"SHA-256"}};case Wm:return{name:Ue,hash:{name:"SHA-384"}};case Jm:return{name:Ue,hash:{name:"SHA-512"}};case $f:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(X.parse(e.parameters,cn).namedCurve){case ab:return{name:Ue,namedCurve:"P-256"};case $l.SECP256K1:return{name:Ue,namedCurve:"K-256"};case ob:return{name:Ue,namedCurve:"P-384"};case sb:return{name:Ue,namedCurve:"P-521"};case kb:return{name:Ue,namedCurve:Ub};case xb:return{name:Ue,namedCurve:$b};case Pb:return{name:Ue,namedCurve:qb};case Ib:return{name:Ue,namedCurve:Hb};case Ob:return{name:Ue,namedCurve:Fb};case Bb:return{name:Ue,namedCurve:Kb};case Nb:return{name:Ue,namedCurve:Wb};case Tb:return{name:Ue,namedCurve:Jb};case Rb:return{name:Ue,namedCurve:zb};case jb:return{name:Ue,namedCurve:Gb};case Lb:return{name:Ue,namedCurve:Xb};case Db:return{name:Ue,namedCurve:Zb};case Mb:return{name:Ue,namedCurve:Qb};case Vb:return{name:Ue,namedCurve:Yb}}}}return null}},u(Sc,"_a95"),Sc),o(Ev,"EcAlgorithm"),Ev);Kf.SECP256K1="1.3.132.0.10";Kf=$l=h([_h()],Kf);vt.registerSingleton(Tl,Kf);var kC=Symbol("name"),xC=Symbol("value"),Ac,PC=(Ac=class{constructor(e,t={},n=""){this[kC]=e,this[xC]=n;for(let i in t)this[i]=t[i]}},u(Ac,"_TextObject"),Ac);o(PC,"TextObject");var _e=PC;_e.NAME=kC;_e.VALUE=xC;var Cc,IC=(Cc=class{static toTextObject(e){let t=new _e("Algorithm Identifier",{},fn.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case $f:{let n=new Kf().toWebAlgorithm(e);n&&"namedCurve"in n?t["Named Curve"]=n.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}},u(Cc,"_DefaultAlgorithmSerializer"),Cc);o(IC,"DefaultAlgorithmSerializer");var iI=IC,Ec,OC=(Ec=class{static toString(e){let t=this.items[e];return t||e}},u(Ec,"_OidSerializer"),Ec);o(OC,"OidSerializer");var fn=OC;fn.items={[wp]:"sha1",[N4]:"sha224",[_p]:"sha256",[Sp]:"sha384",[Ap]:"sha512",[jn]:"rsaEncryption",[gp]:"sha1WithRSAEncryption",[VP]:"sha224WithRSAEncryption",[ng]:"sha256WithRSAEncryption",[mp]:"sha384WithRSAEncryption",[bp]:"sha512WithRSAEncryption",[$f]:"ecPublicKey",[Fm]:"ecdsaWithSHA1",[k4]:"ecdsaWithSHA224",[Km]:"ecdsaWithSHA256",[Wm]:"ecdsaWithSHA384",[Jm]:"ecdsaWithSHA512",[AP]:"TLS WWW server authentication",[CP]:"TLS WWW client authentication",[EP]:"Code Signing",[kP]:"E-mail Protection",[xP]:"Time Stamping",[PP]:"OCSP Signing",[IP]:"Signed Data"};var kc,BC=(kc=class{static serialize(e){return this.serializeObj(e).join(`
22
- `)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){let n=[],i=this.pad(t++),a="",s=e[_e.VALUE];s&&(a=` ${s}`),n.push(`${i}${e[_e.NAME]}:${a}`),i=this.pad(t);for(let c in e){if(typeof c=="symbol")continue;let d=e[c],f=c?`${c}: `:"";if(typeof d=="string"||typeof d=="number"||typeof d=="boolean")n.push(`${i}${f}${d}`);else if(d instanceof Date)n.push(`${i}${f}${d.toUTCString()}`);else if(Array.isArray(d))for(let l of d)l[_e.NAME]=c,n.push(...this.serializeObj(l,t));else if(d instanceof _e)d[_e.NAME]=c,n.push(...this.serializeObj(d,t));else if(H.BufferSourceConverter.isBufferSource(d))c?(n.push(`${i}${f}`),n.push(...this.serializeBufferSource(d,t+1))):n.push(...this.serializeBufferSource(d,t));else if("toTextObject"in d){let l=d.toTextObject();l[_e.NAME]=c,n.push(...this.serializeObj(l,t))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return n}static serializeBufferSource(e,t=0){let n=this.pad(t),i=H.BufferSourceConverter.toUint8Array(e),a=[];for(let s=0;s<i.length;){let c=[];for(let d=0;d<16&&s<i.length;d++){d===8&&c.push("");let f=i[s++].toString(16).padStart(2,"0");c.push(f)}a.push(`${n}${c.join(" ")}`)}return a}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}},u(kc,"_TextConverter"),kc);o(BC,"TextConverter");var Mn=BC;Mn.oidSerializer=fn;Mn.algorithmSerializer=iI;var ri,En,NC=(En=class{get rawData(){return ce(this,ri,"f")||je(this,ri,X.serialize(this.asn),"f"),ce(this,ri,"f")}constructor(...e){ri.set(this,void 0),H.BufferSourceConverter.isBufferSource(e[0])?(this.asn=X.parse(e[0],e[1]),je(this,ri,H.BufferSourceConverter.toArrayBuffer(e[0]),"f"),this.onInit(this.asn)):(this.asn=e[0],this.onInit(this.asn))}equal(e){return e instanceof En?(0,H.isEqual)(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return X.toString(this.rawData);case"text":return Mn.serialize(this.toTextObject());case"hex":return H.Convert.ToHex(this.rawData);case"base64":return H.Convert.ToBase64(this.rawData);case"base64url":return H.Convert.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){let e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new _e(this.getTextName(),{},e)}},u(En,"_AsnData"),En);o(NC,"AsnData");var Wd=NC;ri=new WeakMap;Wd.NAME="ASN";var kn,TC=(kn=class extends Wd{constructor(...e){let t;H.BufferSourceConverter.isBufferSource(e[0])?t=H.BufferSourceConverter.toArrayBuffer(e[0]):t=X.serialize(new _r({extnID:e[0],critical:e[1],extnValue:new ly(H.BufferSourceConverter.toArrayBuffer(e[2]))})),super(t,_r)}onInit(e){this.type=e.extnID,this.critical=e.critical,this.value=e.extnValue.buffer}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.value,e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty(this.critical?"critical":void 0);return e[_e.NAME]===kn.NAME&&(e[_e.NAME]=fn.toString(this.type)),e}},u(kn,"_Extension2"),kn);o(TC,"Extension");var fr=TC,RC,vr,jC=(vr=class{static isCryptoKeyPair(e){return e&&e.privateKey&&e.publicKey}static isCryptoKey(e){return e&&e.usages&&e.type&&e.algorithm&&e.extractable!==void 0}constructor(){this.items=new Map,this[RC]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(vr.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(vr.DEFAULT,global.crypto)}clear(){this.items.clear()}delete(e){return this.items.delete(e)}forEach(e,t){return this.items.forEach(e,t)}has(e){return this.items.has(e)}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(e=vr.DEFAULT){let t=this.items.get(e.toLowerCase());if(!t)throw new Error(`Cannot get Crypto by name '${e}'`);return t}set(e,t){if(typeof e=="string"){if(!t)throw new TypeError("Argument 'value' is required");this.items.set(e.toLowerCase(),t)}else this.items.set(vr.DEFAULT,e);return this}},u(vr,"_CryptoProvider"),vr);o(jC,"CryptoProvider");var Qm=jC;RC=Symbol.toStringTag;Qm.DEFAULT="default";var bt=new Qm,aI=/^[0-2](?:\.[1-9][0-9]*)+$/;function LC(r){return new RegExp(aI).test(r)}u(LC,"isOID");o(LC,"isOID");var xc,DC=(xc=class{constructor(e={}){this.items={};for(let t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return LC(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}},u(xc,"_NameIdentifier"),xc);o(DC,"NameIdentifier");var MC=DC,kt=new MC;kt.register("CN","2.5.4.3");kt.register("L","2.5.4.7");kt.register("ST","2.5.4.8");kt.register("O","2.5.4.10");kt.register("OU","2.5.4.11");kt.register("C","2.5.4.6");kt.register("DC","0.9.2342.19200300.100.1.25");kt.register("E","1.2.840.113549.1.9.1");kt.register("G","2.5.4.42");kt.register("I","2.5.4.43");kt.register("SN","2.5.4.4");kt.register("T","2.5.4.12");function VC(r,e){return`\\${H.Convert.ToHex(H.Convert.FromUtf8String(e)).toUpperCase()}`}u(VC,"replaceUnknownCharacter");o(VC,"replaceUnknownCharacter");function UC(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,VC)}u(UC,"escape2");o(UC,"escape");var xn,$C=(xn=class{static isASCII(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!1;return!0}static isPrintableString(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e)}constructor(e,t={}){this.extraNames=new MC,this.asn=new nt;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n];this.extraNames.register(n,i)}typeof e=="string"?this.asn=this.fromString(e):e instanceof nt?this.asn=e:H.BufferSourceConverter.isBufferSource(e)?this.asn=X.parse(e,nt):this.asn=this.fromJSON(e)}getField(e){let t=this.extraNames.findId(e)||kt.findId(e),n=[];for(let i of this.asn)for(let a of i)a.type===t&&n.push(a.value.toString());return n}getName(e){return this.extraNames.get(e)||kt.get(e)}toString(){return this.asn.map(e=>e.map(t=>{let n=this.getName(t.type)||t.type,i=t.value.anyValue?`#${H.Convert.ToHex(t.value.anyValue)}`:UC(t.value.toString());return`${n}=${i}`}).join("+")).join(", ")}toJSON(){var e;let t=[];for(let n of this.asn){let i={};for(let a of n){let s=this.getName(a.type)||a.type;(e=i[s])!==null&&e!==void 0||(i[s]=[]),i[s].push(a.value.anyValue?`#${H.Convert.ToHex(a.value.anyValue)}`:a.value.toString())}t.push(i)}return t}fromString(e){let t=new nt,n=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g,i=null,a=",";for(;i=n.exec(`${e},`);){let[,s,c]=i,d=c[c.length-1];(d===","||d==="+")&&(c=c.slice(0,c.length-1),i[3]=d);let f=i[3];s=this.getTypeOid(s);let l=this.createAttribute(s,c);a==="+"?t[t.length-1].push(l):t.push(new pd([l])),a=f}return t}fromJSON(e){let t=new nt;for(let n of e){let i=new pd;for(let a in n){let s=this.getTypeOid(a),c=n[a];for(let d of c){let f=this.createAttribute(s,d);i.push(f)}}t.push(i)}return t}getTypeOid(e){if(/[\d.]+/.test(e)||(e=this.getName(e)||""),!e)throw new Error(`Cannot get OID for name type '${e}'`);return e}createAttribute(e,t){let n=new Yp({type:e});if(typeof t=="object")for(let i in t)switch(i){case"ia5String":n.value.ia5String=t[i];break;case"utf8String":n.value.utf8String=t[i];break;case"universalString":n.value.universalString=t[i];break;case"bmpString":n.value.bmpString=t[i];break;case"printableString":n.value.printableString=t[i];break}else if(t[0]==="#")n.value.anyValue=H.Convert.FromHex(t.slice(1));else{let i=this.processStringValue(t);e===this.getName("E")||e===this.getName("DC")?n.value.ia5String=i:xn.isPrintableString(i)?n.value.printableString=i:n.value.utf8String=i}return n}processStringValue(e){let t=/"(.*?[^\\])?"/.exec(e);return t&&(e=t[1]),e.replace(/\\0a/ig,`
23
- `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return X.serialize(this.asn)}async getThumbprint(...e){var t;let n,i="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(i=e[0]||i,n=e[1]||bt.get()):n=e[0]||bt.get(),await n.subtle.digest(i,this.toArrayBuffer())}},u(xn,"_Name"),xn);o($C,"Name");var Wf=$C,qC="Cannot initialize GeneralName from ASN.1 data.",ew=`${qC} Unsupported string format in use.`,oI=`${qC} Value doesn't match to GUID regular expression.`,tw=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,rw="1.3.6.1.4.1.311.25.1",nw="1.3.6.1.4.1.311.20.2.3",kv="dns",xv="dn",Pv="email",Iv="ip",Ov="url",Bv="guid",Nv="upn",Vl="id",Pc,HC=(Pc=class extends Wd{constructor(...e){let t;if(e.length===2)switch(e[0]){case xv:{let n=new Wf(e[1]).toArrayBuffer(),i=X.parse(n,nt);t=new de({directoryName:i});break}case kv:t=new de({dNSName:e[1]});break;case Pv:t=new de({rfc822Name:e[1]});break;case Bv:{let n=new RegExp(tw,"i").exec(e[1]);if(!n)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");let i=n.slice(1).map((a,s)=>s<3?H.Convert.ToHex(new Uint8Array(H.Convert.FromHex(a)).reverse()):a).join("");t=new de({otherName:new Df({typeId:rw,value:X.serialize(new ly(H.Convert.FromHex(i)))})});break}case Iv:t=new de({iPAddress:e[1]});break;case Vl:t=new de({registeredID:e[1]});break;case Nv:{t=new de({otherName:new Df({typeId:nw,value:X.serialize(b3.toASN(e[1]))})});break}case Ov:t=new de({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else H.BufferSourceConverter.isBufferSource(e[0])?t=X.parse(e[0],de):t=e[0];super(t)}onInit(e){if(e.dNSName!=null)this.type=kv,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=Pv,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=Iv,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=Ov,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=Vl,this.value=e.registeredID;else if(e.directoryName!=null)this.type=xv,this.value=new Wf(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===rw){this.type=Bv;let t=X.parse(e.otherName.value,ly),n=new RegExp(tw,"i").exec(H.Convert.ToHex(t));if(!n)throw new Error(oI);this.value=n.slice(1).map((i,a)=>a<3?H.Convert.ToHex(new Uint8Array(H.Convert.FromHex(i)).reverse()):i).join("-")}else if(e.otherName.typeId===nw)this.type=Nv,this.value=X.parse(e.otherName.value,ht).toString();else throw new Error(ew);else throw new Error(ew)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case xv:case kv:case Bv:case Iv:case Vl:case Nv:case Ov:e=this.type.toUpperCase();break;case Pv:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===Vl&&(t=fn.toString(t)),new _e(e,void 0,t)}},u(Pc,"_GeneralName"),Pc);o(HC,"GeneralName");var Qr=HC,Ic,FC=(Ic=class extends Wd{constructor(e){let t;if(e instanceof gt)t=e;else if(Array.isArray(e)){let n=[];for(let i of e)if(i instanceof de)n.push(i);else{let a=X.parse(new Qr(i.type,i.value).rawData,de);n.push(a)}t=new gt(n)}else if(H.BufferSourceConverter.isBufferSource(e))t=X.parse(e,gt);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(t)}onInit(e){let t=[];for(let n of e){let i=null;try{i=new Qr(n)}catch{continue}t.push(i)}this.items=t}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){let e=super.toTextObjectEmpty();for(let t of this.items){let n=t.toTextObject(),i=e[n[_e.NAME]];Array.isArray(i)||(i=[],e[n[_e.NAME]]=i),i.push(n)}return e}},u(Ic,"_GeneralNames"),Ic);o(FC,"GeneralNames");var Vn=FC;Vn.NAME="GeneralNames";var Bf="-{5}",Jf="\\n",sI=`[^${Jf}]+`,uI=`${Bf}BEGIN (${sI}(?=${Bf}))${Bf}`,cI=`${Bf}END \\1${Bf}`,Cd="\\n",dI=`[^:${Jf}]+`,fI=`(?:[^${Jf}]+${Cd}(?: +[^${Jf}]+${Cd})*)`,lI="[a-zA-Z0-9=+/]+",pI=`(?:${lI}${Cd})+`,iw=`${uI}${Cd}(?:((?:${dI}: ${fI})+))?${Cd}?(${pI})${cI}`,Oc,KC=(Oc=class{static isPem(e){return typeof e=="string"&&new RegExp(iw,"g").test(e.replace(/\r/g,""))}static decodeWithHeaders(e){e=e.replace(/\r/g,"");let t=new RegExp(iw,"g"),n=[],i=null;for(;i=t.exec(e);){let a=i[3].replace(new RegExp(`[${Jf}]+`,"g"),""),s={type:i[1],headers:[],rawData:H.Convert.FromBase64(a)},c=i[2];if(c){let d=c.split(new RegExp(Cd,"g")),f=null;for(let l of d){let[p,v]=l.split(/:(.*)/);if(v===void 0){if(!f)throw new Error("Cannot parse PEM string. Incorrect header value");f.value+=p.trim()}else f&&s.headers.push(f),f={key:p,value:v.trim()}}f&&s.headers.push(f)}n.push(s)}return n}static decode(e){return this.decodeWithHeaders(e).map(n=>n.rawData)}static decodeFirst(e){let t=this.decode(e);if(!t.length)throw new RangeError("PEM string doesn't contain any objects");return t[0]}static encode(e,t){if(Array.isArray(e)){let n=new Array;return t?e.forEach(i=>{if(!H.BufferSourceConverter.isBufferSource(i))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");n.push(this.encodeStruct({type:t,rawData:H.BufferSourceConverter.toArrayBuffer(i)}))}):e.forEach(i=>{if(!("type"in i))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");n.push(this.encodeStruct(i))}),n.join(`
24
- `)}else{if(!t)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:H.BufferSourceConverter.toArrayBuffer(e)})}}static encodeStruct(e){var t;let n=e.type.toLocaleUpperCase(),i=[];if(i.push(`-----BEGIN ${n}-----`),!((t=e.headers)===null||t===void 0)&&t.length){for(let f of e.headers)i.push(`${f.key}: ${f.value}`);i.push("")}let a=H.Convert.ToBase64(e.rawData),s,c=0,d=Array();for(;c<a.length&&(a.length-c<64?s=a.substring(c):(s=a.substring(c,c+64),c+=64),s.length!==0);)if(d.push(s),s.length<64)break;return i.push(...d),i.push(`-----END ${n}-----`),i.join(`
25
- `)}},u(Oc,"_PemConverter"),Oc);o(KC,"PemConverter");var Tt=KC;Tt.CertificateTag="CERTIFICATE";Tt.CrlTag="CRL";Tt.CertificateRequestTag="CERTIFICATE REQUEST";Tt.PublicKeyTag="PUBLIC KEY";Tt.PrivateKeyTag="PRIVATE KEY";var an,WC=(an=class extends Wd{static isAsnEncoded(e){return H.BufferSourceConverter.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(Tt.isPem(e))return Tt.decode(e)[0];if(H.Convert.isHex(e))return H.Convert.FromHex(e);if(H.Convert.isBase64(e))return H.Convert.FromBase64(e);if(H.Convert.isBase64Url(e))return H.Convert.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{let t=H.BufferSourceConverter.toUint8Array(e);if(t.length>0&&t[0]===48)return H.BufferSourceConverter.toArrayBuffer(e);let n=H.Convert.ToBinary(e);if(Tt.isPem(n))return Tt.decode(n)[0];if(H.Convert.isHex(n))return H.Convert.FromHex(n);if(H.Convert.isBase64(n))return H.Convert.FromBase64(n);if(H.Convert.isBase64Url(n))return H.Convert.FromBase64Url(n);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}constructor(...e){an.isAsnEncoded(e[0])?super(an.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return Tt.encode(this.rawData,this.tag);default:return super.toString(e)}}},u(an,"_PemData"),an);o(WC,"PemData");var Ed=WC,Lr,JC=(Lr=class extends Ed{static async create(e,t=bt.get()){if(e instanceof Lr)return e;if(Qm.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");let n=await t.subtle.exportKey("spki",e);return new Lr(n)}else{if(e.publicKey)return e.publicKey;if(H.BufferSourceConverter.isBufferSource(e))return new Lr(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){Ed.isAsnEncoded(e)?super(e,br):super(e),this.tag=Tt.PublicKeyTag}async export(...e){let t,n=["verify"],i={hash:"SHA-256",...this.algorithm};e.length>1?(i=e[0]||i,n=e[1]||n,t=e[2]||bt.get()):t=e[0]||bt.get();let a=this.rawData,s=X.parse(this.rawData,br);return s.algorithm.algorithm===Pf&&(a=zC(s,a)),t.subtle.importKey("spki",a,i,!0,n)}onInit(e){let t=vt.resolve(Ad),n=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case jn:{let i=X.parse(e.subjectPublicKey,zm),a=H.BufferSourceConverter.toUint8Array(i.modulus);n.publicExponent=H.BufferSourceConverter.toUint8Array(i.publicExponent),n.modulusLength=(a[0]?a:a.slice(1)).byteLength<<3;break}}}async getThumbprint(...e){var t;let n,i="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(i=e[0]||i,n=e[1]||bt.get()):n=e[0]||bt.get(),await n.subtle.digest(i,this.rawData)}async getKeyIdentifier(...e){let t,n="SHA-1";e.length===1?typeof e[0]=="string"?(n=e[0],t=bt.get()):t=e[0]:e.length===2?(n=e[0],t=e[1]):t=bt.get();let i=X.parse(this.rawData,br);return await t.subtle.digest(n,i.subjectPublicKey)}toTextObject(){let e=this.toTextObjectEmpty(),t=X.parse(this.rawData,br);switch(e.Algorithm=Mn.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case $f:e["EC Point"]=t.subjectPublicKey;break;case jn:default:e["Raw Data"]=t.subjectPublicKey}return e}},u(Lr,"_PublicKey"),Lr);o(JC,"PublicKey");var ui=JC;function zC(r,e){return r.algorithm=new z({algorithm:jn,parameters:null}),e=X.serialize(r),e}u(zC,"convertSpkiToRsaPkcs1");o(zC,"convertSpkiToRsaPkcs1");var on,GC=(on=class extends fr{static async create(e,t=!1,n=bt.get()){if("name"in e&&"serialNumber"in e)return new on(e,t);let a=await(await ui.create(e,n)).getKeyIdentifier(n);return new on(H.Convert.ToHex(a),t)}constructor(...e){if(H.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){let t=new mn({keyIdentifier:new Em(H.Convert.FromHex(e[0]))});super(_y,e[1],X.serialize(t))}else{let t=e[0],n=t.name instanceof Vn?X.parse(t.name.rawData,gt):t.name,i=new mn({authorityCertIssuer:n,authorityCertSerialNumber:H.Convert.FromHex(t.serialNumber)});super(_y,e[1],X.serialize(i))}}onInit(e){super.onInit(e);let t=X.parse(e.extnValue,mn);t.keyIdentifier&&(this.keyId=H.Convert.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?H.Convert.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){let e=this.toTextObjectWithoutValue(),t=X.parse(this.value,mn);return t.authorityCertIssuer&&(e["Authority Issuer"]=new Vn(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}},u(on,"_AuthorityKeyIdentifierExtension"),on);o(GC,"AuthorityKeyIdentifierExtension");var XC=GC;XC.NAME="Authority Key Identifier";var Bc,ZC=(Bc=class extends fr{constructor(...e){if(H.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let t=X.parse(this.value,Yl);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{let t=new Yl({cA:e[0],pathLenConstraint:e[1]});super(rA,e[2],X.serialize(t)),this.ca=e[0],this.pathLength=e[1]}}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ca&&(e.CA=this.ca),this.pathLength!==void 0&&(e["Path Length"]=this.pathLength),e}},u(Bc,"_BasicConstraintsExtension"),Bc);o(ZC,"BasicConstraintsExtension");var QC=ZC;QC.NAME="Basic Constraints";var aw;(function(r){r.serverAuth="1.3.6.1.5.5.7.3.1",r.clientAuth="1.3.6.1.5.5.7.3.2",r.codeSigning="1.3.6.1.5.5.7.3.3",r.emailProtection="1.3.6.1.5.5.7.3.4",r.timeStamping="1.3.6.1.5.5.7.3.8",r.ocspSigning="1.3.6.1.5.5.7.3.9"})(aw||(aw={}));var Nc,YC=(Nc=class extends fr{constructor(...e){if(H.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let t=X.parse(this.value,np);this.usages=t.map(n=>n)}else{let t=new np(e[0]);super(Bm,e[1],X.serialize(t)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>fn.toString(t)).join(", "),e}},u(Nc,"_ExtendedKeyUsageExtension"),Nc);o(YC,"ExtendedKeyUsageExtension");var e5=YC;e5.NAME="Extended Key Usages";var ow;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(ow||(ow={}));var Tc,t5=(Tc=class extends fr{constructor(...e){if(H.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let t=X.parse(this.value,s0);this.usages=t.toNumber()}else{let t=new s0(e[0]);super(lA,e[1],X.serialize(t)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue(),t=X.parse(this.value,s0);return e[""]=t.toJSON().join(", "),e}},u(Tc,"_KeyUsagesExtension"),Tc);o(t5,"KeyUsagesExtension");var r5=t5;r5.NAME="Key Usages";var Pn,n5=(Pn=class extends fr{static async create(e,t=!1,n=bt.get()){let a=await(await ui.create(e,n)).getKeyIdentifier(n);return new Pn(H.Convert.ToHex(a),t)}constructor(...e){if(H.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let t=X.parse(this.value,rn);this.keyId=H.Convert.ToHex(t)}else{let t=typeof e[0]=="string"?H.Convert.FromHex(e[0]):e[0],n=new rn(t);super(SA,e[1],X.serialize(n)),this.keyId=H.Convert.ToHex(t)}}toTextObject(){let e=this.toTextObjectWithoutValue(),t=X.parse(this.value,rn);return e[""]=t,e}},u(Pn,"_SubjectKeyIdentifierExtension"),Pn);o(n5,"SubjectKeyIdentifierExtension");var i5=n5;i5.NAME="Subject Key Identifier";var Rc,a5=(Rc=class extends fr{constructor(...e){H.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(wA,e[1],new Vn(e[0]||[]).rawData)}onInit(e){super.onInit(e);let t=X.parse(e.extnValue,Ly);this.names=new Vn(t)}toTextObject(){let e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(let n in t)e[n]=t[n];return e}},u(Rc,"_SubjectAlternativeNameExtension"),Rc);o(a5,"SubjectAlternativeNameExtension");var Ym=a5;Ym.NAME="Subject Alternative Name";var jc,o5=(jc=class{static register(e,t){this.items.set(e,t)}static create(e){let t=new fr(e),n=this.items.get(t.type);return n?new n(e):t}},u(jc,"_ExtensionFactory"),jc);o(o5,"ExtensionFactory");var Ut=o5;Ut.items=new Map;var Lc,s5=(Lc=class extends fr{constructor(...e){var t;if(H.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let n=X.parse(this.value,tp);this.policies=n.map(i=>i.policyIdentifier)}else{let n=e[0],i=(t=e[1])!==null&&t!==void 0?t:!1,a=new tp(n.map(s=>new th({policyIdentifier:s})));super(km,i,X.serialize(a)),this.policies=n}}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new _e("",{},fn.toString(t))),e}},u(Lc,"_CertificatePolicyExtension"),Lc);o(s5,"CertificatePolicyExtension");var u5=s5;u5.NAME="Certificate Policies";Ut.register(km,u5);var Dc,c5=(Dc=class extends fr{constructor(...e){var t;if(H.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){let i=e[0].map(s=>new Ld({distributionPoint:new Nn({fullName:[new de({uniformResourceIdentifier:s})]})})),a=new si(i);super(ky,e[1],X.serialize(a))}else{let n=new si(e[0]);super(ky,e[1],X.serialize(n))}(t=this.distributionPoints)!==null&&t!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);let t=X.parse(e.extnValue,si);this.distributionPoints=t}toTextObject(){let e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(t=>{var n;let i={};return t.distributionPoint&&(i[""]=(n=t.distributionPoint.fullName)===null||n===void 0?void 0:n.map(a=>new Qr(a).toString()).join(", ")),t.reasons&&(i.Reasons=t.reasons.toString()),t.cRLIssuer&&(i["CRL Issuer"]=t.cRLIssuer.map(a=>a.toString()).join(", ")),i}),e}},u(Dc,"_CRLDistributionPointsExtension"),Dc);o(c5,"CRLDistributionPointsExtension");var d5=c5;d5.NAME="CRL Distribution Points";var Mc,f5=(Mc=class extends fr{constructor(...e){var t,n,i,a;if(H.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof ai){let s=new ai(e[0]);super(wy,e[1],X.serialize(s))}else{let s=e[0],c=new ai;tf(c,s,F1,"ocsp"),tf(c,s,K1,"caIssuers"),tf(c,s,W1,"timeStamping"),tf(c,s,J1,"caRepository"),super(wy,e[1],X.serialize(c))}(t=this.ocsp)!==null&&t!==void 0||(this.ocsp=[]),(n=this.caIssuers)!==null&&n!==void 0||(this.caIssuers=[]),(i=this.timeStamping)!==null&&i!==void 0||(this.timeStamping=[]),(a=this.caRepository)!==null&&a!==void 0||(this.caRepository=[])}onInit(e){super.onInit(e),this.ocsp=[],this.caIssuers=[],this.timeStamping=[],this.caRepository=[],X.parse(e.extnValue,ai).forEach(n=>{switch(n.accessMethod){case F1:this.ocsp.push(new Qr(n.accessLocation));break;case K1:this.caIssuers.push(new Qr(n.accessLocation));break;case W1:this.timeStamping.push(new Qr(n.accessLocation));break;case J1:this.caRepository.push(new Qr(n.accessLocation));break}})}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ocsp.length&&ef(e,"OCSP",this.ocsp),this.caIssuers.length&&ef(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&ef(e,"Time Stamping",this.timeStamping),this.caRepository.length&&ef(e,"CA Repository",this.caRepository),e}},u(Mc,"_AuthorityInfoAccessExtension"),Mc);o(f5,"AuthorityInfoAccessExtension");var l5=f5;l5.NAME="Authority Info Access";function ef(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{let n=new _e("");t.forEach((i,a)=>{let s=i.toTextObject(),c=`${s[_e.NAME]} ${a+1}`,d=n[c];Array.isArray(d)||(d=[],n[c]=d),d.push(s)}),r[e]=n}}u(ef,"addUrlsToObject");o(ef,"addUrlsToObject");function tf(r,e,t,n){let i=e[n];i&&(Array.isArray(i)?i:[i]).forEach(s=>{typeof s=="string"&&(s=new Qr("url",s)),r.push(new wl({accessMethod:t,accessLocation:X.parse(s.rawData,de)}))})}u(tf,"addAccessDescriptions");o(tf,"addAccessDescriptions");var Vc,p5=(Vc=class extends fr{constructor(...e){H.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(fA,e[1],new Vn(e[0]||[]).rawData)}onInit(e){super.onInit(e);let t=X.parse(e.extnValue,gt);this.names=new Vn(t)}toTextObject(){let e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(let n in t)e[n]=t[n];return e}},u(Vc,"_IssuerAlternativeNameExtension"),Vc);o(p5,"IssuerAlternativeNameExtension");var h5=p5;h5.NAME="Issuer Alternative Name";var In,v5=(In=class extends Wd{constructor(...e){let t;if(H.BufferSourceConverter.isBufferSource(e[0]))t=H.BufferSourceConverter.toArrayBuffer(e[0]);else{let n=e[0],i=Array.isArray(e[1])?e[1].map(a=>H.BufferSourceConverter.toArrayBuffer(a)):[];t=X.serialize(new $r({type:n,values:i}))}super(t,$r)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new _e("",{"":t})),e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty();return e[_e.NAME]===In.NAME&&(e[_e.NAME]=fn.toString(this.type)),e}},u(In,"_Attribute3"),In);o(v5,"Attribute");var kh=v5;kh.NAME="Attribute";var Uc,y5=(Uc=class extends kh{constructor(...e){var t;if(H.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let n=new xp({printableString:e[0]});super(SC,[X.serialize(n)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){let t=X.parse(this.values[0],xp);this.password=t.toString()}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[_e.VALUE]=this.password,e}},u(Uc,"_ChallengePasswordAttribute"),Uc);o(y5,"ChallengePasswordAttribute");var g5=y5;g5.NAME="Challenge Password";var $c,m5=($c=class extends kh{constructor(...e){var t;if(H.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let n=e[0],i=new Tn;for(let a of n)i.push(X.parse(a.rawData,_r));super(Zm,[X.serialize(i)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){let t=X.parse(this.values[0],Tn);this.items=t.map(n=>Ut.create(X.serialize(n)))}}toTextObject(){let e=this.toTextObjectWithoutValue(),t=this.items.map(n=>n.toTextObject());for(let n of t)e[n[_e.NAME]]=n;return e}},u($c,"_ExtensionsAttribute"),$c);o(m5,"ExtensionsAttribute");var e1=m5;e1.NAME="Extensions";var qc,b5=(qc=class{static register(e,t){this.items.set(e,t)}static create(e){let t=new kh(e),n=this.items.get(t.type);return n?new n(e):t}},u(qc,"_AttributeFactory"),qc);o(b5,"AttributeFactory");var xh=b5;xh.items=new Map;var Ph="crypto.signatureFormatter",Hc,w5=(Hc=class{toAsnSignature(e,t){return H.BufferSourceConverter.toArrayBuffer(t)}toWebSignature(e,t){return H.BufferSourceConverter.toArrayBuffer(t)}},u(Hc,"_AsnDefaultSignatureFormatter"),Hc);o(w5,"AsnDefaultSignatureFormatter");var hI=w5,ql,Tv,Fc,kg=ql=(Tv=(Fc=class{static createPssParams(e,t){let n=ql.getHashAlgorithm(e);return n?new Dn({hashAlgorithm:n,maskGenAlgorithm:new z({algorithm:yh,parameters:X.serialize(n)}),saltLength:t}):null}static getHashAlgorithm(e){let t=vt.resolve(Ad);return typeof e=="string"?t.toAsnAlgorithm({name:e}):typeof e=="object"&&e&&"name"in e?t.toAsnAlgorithm(e):null}toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in e){let t;if(typeof e.hash=="string")t=e.hash;else if(e.hash&&typeof e.hash=="object"&&"name"in e.hash&&typeof e.hash.name=="string")t=e.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(t.toLowerCase()){case"sha-1":return new z({algorithm:gp,parameters:null});case"sha-256":return new z({algorithm:ng,parameters:null});case"sha-384":return new z({algorithm:mp,parameters:null});case"sha-512":return new z({algorithm:bp,parameters:null})}}else return new z({algorithm:jn,parameters:null});break;case"rsa-pss":if("hash"in e){if(!("saltLength"in e&&typeof e.saltLength=="number"))throw new Error("Cannot get 'saltLength' from 'alg' argument");let t=ql.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new z({algorithm:Pf,parameters:X.serialize(t)})}else return new z({algorithm:Pf,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case jn:return{name:"RSASSA-PKCS1-v1_5"};case gp:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case ng:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case mp:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case bp:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case Pf:if(e.parameters){let t=X.parse(e.parameters,Dn);return{name:"RSA-PSS",hash:vt.resolve(Ad).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}},u(Fc,"_a97"),Fc),o(Tv,"RsaAlgorithm"),Tv);kg=ql=h([_h()],kg);vt.registerSingleton(Tl,kg);var Rv,Kc,xg=(Rv=(Kc=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new z({algorithm:wp});case"sha-256":return new z({algorithm:_p});case"sha-384":return new z({algorithm:Sp});case"sha-512":return new z({algorithm:Ap})}return null}toWebAlgorithm(e){switch(e.algorithm){case wp:return{name:"SHA-1"};case _p:return{name:"SHA-256"};case Sp:return{name:"SHA-384"};case Ap:return{name:"SHA-512"}}return null}},u(Kc,"_a98"),Kc),o(Rv,"ShaAlgorithm"),Rv);xg=h([_h()],xg);vt.registerSingleton(Tl,xg);var yr,_5=(yr=class{addPadding(e,t){let n=H.BufferSourceConverter.toUint8Array(t),i=new Uint8Array(e);return i.set(n,e-n.length),i.buffer}removePadding(e,t=!1){let n=H.BufferSourceConverter.toUint8Array(e);for(let i=0;i<n.length;i++)if(n[i]){n=n.slice(i);break}if(t&&n[0]>127){let i=new Uint8Array(n.length+1);return i.set(n,1),i.buffer}return n.buffer}toAsnSignature(e,t){if(e.name==="ECDSA"){let n=e.namedCurve,i=yr.namedCurveSize.get(n)||yr.defaultNamedCurveSize,a=new yp,s=H.BufferSourceConverter.toUint8Array(t);return a.r=this.removePadding(s.slice(0,i),!0),a.s=this.removePadding(s.slice(i,i+i),!0),X.serialize(a)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){let n=X.parse(t,yp),i=e.namedCurve,a=yr.namedCurveSize.get(i)||yr.defaultNamedCurveSize,s=this.addPadding(a,this.removePadding(n.r)),c=this.addPadding(a,this.removePadding(n.s));return(0,H.combine)(s,c)}return null}},u(yr,"_AsnEcSignatureFormatter"),yr);o(_5,"AsnEcSignatureFormatter");var Gn=_5;Gn.namedCurveSize=new Map;Gn.defaultNamedCurveSize=32;var jv="1.3.101.110",sw="1.3.101.111",Lv="1.3.101.112",uw="1.3.101.113",Dv,Wc,Pg=(Dv=(Wc=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=Lv;break;case"x25519":t=jv;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=Lv;break;case"ed448":t=uw;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=jv;break;case"x448":t=sw;break}}return t?new z({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case Lv:return{name:"Ed25519"};case uw:return{name:"EdDSA",namedCurve:"Ed448"};case jv:return{name:"X25519"};case sw:return{name:"ECDH-ES",namedCurve:"X448"}}return null}},u(Wc,"_a99"),Wc),o(Dv,"EdAlgorithm"),Dv);Pg=h([_h()],Pg);vt.registerSingleton(Tl,Pg);var rf,nf,af,of,sf,uf,cf,ni,Jc,S5=(Jc=class extends Ed{get subjectName(){return ce(this,nf,"f")||je(this,nf,new Wf(this.asn.certificationRequestInfo.subject),"f"),ce(this,nf,"f")}get subject(){return ce(this,af,"f")||je(this,af,this.subjectName.toString(),"f"),ce(this,af,"f")}get signatureAlgorithm(){if(!ce(this,of,"f")){let e=vt.resolve(Ad);je(this,of,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return ce(this,of,"f")}get signature(){return ce(this,sf,"f")||je(this,sf,this.asn.signature,"f"),ce(this,sf,"f")}get publicKey(){return ce(this,uf,"f")||je(this,uf,new ui(this.asn.certificationRequestInfo.subjectPKInfo),"f"),ce(this,uf,"f")}get attributes(){return ce(this,cf,"f")||je(this,cf,this.asn.certificationRequestInfo.attributes.map(e=>xh.create(X.serialize(e))),"f"),ce(this,cf,"f")}get extensions(){if(!ce(this,ni,"f")){je(this,ni,[],"f");let e=this.getAttribute(Zm);e instanceof e1&&je(this,ni,e.items,"f")}return ce(this,ni,"f")}get tbs(){return ce(this,rf,"f")||je(this,rf,this.asn.certificationRequestInfoRaw||X.serialize(this.asn.certificationRequestInfo),"f"),ce(this,rf,"f")}constructor(e){let t=Ed.isAsnEncoded(e)?[e,Ff]:[e];super(t[0],t[1]),rf.set(this,void 0),nf.set(this,void 0),af.set(this,void 0),of.set(this,void 0),sf.set(this,void 0),uf.set(this,void 0),cf.set(this,void 0),ni.set(this,void 0),this.tag=Tt.CertificateRequestTag}onInit(e){}getAttribute(e){for(let t of this.attributes)if(t.type===e)return t;return null}getAttributes(e){return this.attributes.filter(t=>t.type===e)}getExtension(e){for(let t of this.extensions)if(t.type===e)return t;return null}getExtensions(e){return this.extensions.filter(t=>t.type===e)}async verify(e=bt.get()){let t={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(t,["verify"],e),i=vt.resolveAll(Ph).reverse(),a=null;for(let c of i)if(a=c.toWebSignature(t,this.signature),a)break;if(!a)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await e.subtle.verify(this.signatureAlgorithm,n,a,this.tbs)}toTextObject(){let e=this.toTextObjectEmpty(),t=X.parse(this.rawData,Ff),n=t.certificationRequestInfo,i=new _e("",{Version:`${hd[n.version]} (${n.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){let a=new _e("");for(let s of this.attributes){let c=s.toTextObject();a[c[_e.NAME]]=c}i.Attributes=a}return e.Data=i,e.Signature=new _e("",{Algorithm:Mn.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}},u(Jc,"_Pkcs10CertificateRequest"),Jc);o(S5,"Pkcs10CertificateRequest");var vI=S5;rf=new WeakMap,nf=new WeakMap,af=new WeakMap,of=new WeakMap,sf=new WeakMap,uf=new WeakMap,cf=new WeakMap,ni=new WeakMap;vI.NAME="PKCS#10 Certificate Request";var df,ff,lf,pf,hf,vf,yf,gf,mf,bf,ii,wf,zc,A5=(zc=class extends Ed{get publicKey(){return ce(this,wf,"f")||je(this,wf,new ui(this.asn.tbsCertificate.subjectPublicKeyInfo),"f"),ce(this,wf,"f")}get serialNumber(){if(!ce(this,ff,"f")){let e=this.asn.tbsCertificate,t=new Uint8Array(e.serialNumber);t.length>1&&t[0]===0&&t[1]>127&&(t=t.slice(1)),je(this,ff,H.Convert.ToHex(t),"f")}return ce(this,ff,"f")}get subjectName(){return ce(this,lf,"f")||je(this,lf,new Wf(this.asn.tbsCertificate.subject),"f"),ce(this,lf,"f")}get subject(){return ce(this,pf,"f")||je(this,pf,this.subjectName.toString(),"f"),ce(this,pf,"f")}get issuerName(){return ce(this,hf,"f")||je(this,hf,new Wf(this.asn.tbsCertificate.issuer),"f"),ce(this,hf,"f")}get issuer(){return ce(this,vf,"f")||je(this,vf,this.issuerName.toString(),"f"),ce(this,vf,"f")}get notBefore(){if(!ce(this,yf,"f")){let e=this.asn.tbsCertificate.validity.notBefore.utcTime||this.asn.tbsCertificate.validity.notBefore.generalTime;if(!e)throw new Error("Cannot get 'notBefore' value");je(this,yf,e,"f")}return ce(this,yf,"f")}get notAfter(){if(!ce(this,gf,"f")){let e=this.asn.tbsCertificate.validity.notAfter.utcTime||this.asn.tbsCertificate.validity.notAfter.generalTime;if(!e)throw new Error("Cannot get 'notAfter' value");je(this,gf,e,"f")}return ce(this,gf,"f")}get signatureAlgorithm(){if(!ce(this,mf,"f")){let e=vt.resolve(Ad);je(this,mf,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return ce(this,mf,"f")}get signature(){return ce(this,bf,"f")||je(this,bf,this.asn.signatureValue,"f"),ce(this,bf,"f")}get extensions(){return ce(this,ii,"f")||(je(this,ii,[],"f"),this.asn.tbsCertificate.extensions&&je(this,ii,this.asn.tbsCertificate.extensions.map(e=>Ut.create(X.serialize(e))),"f")),ce(this,ii,"f")}get tbs(){return ce(this,df,"f")||je(this,df,this.asn.tbsCertificateRaw||X.serialize(this.asn.tbsCertificate),"f"),ce(this,df,"f")}constructor(e){let t=Ed.isAsnEncoded(e)?[e,vd]:[e];super(t[0],t[1]),df.set(this,void 0),ff.set(this,void 0),lf.set(this,void 0),pf.set(this,void 0),hf.set(this,void 0),vf.set(this,void 0),yf.set(this,void 0),gf.set(this,void 0),mf.set(this,void 0),bf.set(this,void 0),ii.set(this,void 0),wf.set(this,void 0),this.tag=Tt.CertificateTag}onInit(e){}getExtension(e){for(let t of this.extensions)if(typeof e=="string"){if(t.type===e)return t}else if(t instanceof e)return t;return null}getExtensions(e){return this.extensions.filter(t=>typeof e=="string"?t.type===e:t instanceof e)}async verify(e={},t=bt.get()){let n,i,a=e.publicKey;try{if(!a)n={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(n,["verify"],t);else if("publicKey"in a)n={...a.publicKey.algorithm,...this.signatureAlgorithm},i=await a.publicKey.export(n,["verify"],t);else if(a instanceof ui)n={...a.algorithm,...this.signatureAlgorithm},i=await a.export(n,["verify"],t);else if(H.BufferSourceConverter.isBufferSource(a)){let f=new ui(a);n={...f.algorithm,...this.signatureAlgorithm},i=await f.export(n,["verify"],t)}else n={...a.algorithm,...this.signatureAlgorithm},i=a}catch{return!1}let s=vt.resolveAll(Ph).reverse(),c=null;for(let f of s)if(c=f.toWebSignature(n,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");let d=await t.subtle.verify(this.signatureAlgorithm,i,c,this.tbs);if(e.signatureOnly)return d;{let l=(e.date||new Date).getTime();return d&&this.notBefore.getTime()<l&&l<this.notAfter.getTime()}}async getThumbprint(...e){let t,n="SHA-1";return e[0]&&(e[0].subtle?t=e[0]:(n=e[0]||n,t=e[1])),t??(t=bt.get()),await t.subtle.digest(n,this.rawData)}async isSelfSigned(e=bt.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){let e=this.toTextObjectEmpty(),t=X.parse(this.rawData,vd),n=t.tbsCertificate,i=new _e("",{Version:`${hd[n.version]} (${n.version})`,"Serial Number":n.serialNumber,"Signature Algorithm":Mn.serializeAlgorithm(n.signature),Issuer:this.issuer,Validity:new _e("",{"Not Before":n.validity.notBefore.getTime(),"Not After":n.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(n.issuerUniqueID&&(i["Issuer Unique ID"]=n.issuerUniqueID),n.subjectUniqueID&&(i["Subject Unique ID"]=n.subjectUniqueID),this.extensions.length){let a=new _e("");for(let s of this.extensions){let c=s.toTextObject();a[c[_e.NAME]]=c}i.Extensions=a}return e.Data=i,e.Signature=new _e("",{Algorithm:Mn.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}},u(zc,"_X509Certificate"),zc);o(A5,"X509Certificate");var t1=A5;df=new WeakMap,ff=new WeakMap,lf=new WeakMap,pf=new WeakMap,hf=new WeakMap,vf=new WeakMap,yf=new WeakMap,gf=new WeakMap,mf=new WeakMap,bf=new WeakMap,ii=new WeakMap,wf=new WeakMap;t1.NAME="Certificate";var yI,gI,mI,bI,wI,cw;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})(cw||(cw={}));yI=new WeakMap,gI=new WeakMap,mI=new WeakMap,bI=new WeakMap,wI=new WeakMap;var _I,SI,AI,CI,EI,kI,xI;_I=new WeakMap,SI=new WeakMap,AI=new WeakMap,CI=new WeakMap,EI=new WeakMap,kI=new WeakMap,xI=new WeakMap;Ut.register(rA,QC);Ut.register(Bm,e5);Ut.register(lA,r5);Ut.register(SA,i5);Ut.register(_y,XC);Ut.register(wA,Ym);Ut.register(ky,d5);Ut.register(wy,l5);Ut.register(fA,h5);xh.register(SC,g5);xh.register(Zm,e1);vt.registerSingleton(Ph,hI);vt.registerSingleton(Ph,Gn);Gn.namedCurveSize.set("P-256",32);Gn.namedCurveSize.set("K-256",32);Gn.namedCurveSize.set("P-384",48);Gn.namedCurveSize.set("P-521",66);var PI=["pre-registered","redirect_uri","https","did","verifier_attestation","x509_san_dns","x509_hash"],C5=o((r,e)=>{if(typeof r!="string"||r.length===0)return{prefix:"pre-registered",value:"",inferred:!0};if(typeof e=="string"&&e.length>0&&II(e))return{prefix:e,value:r,inferred:!1};let t=["redirect_uri","verifier_attestation","x509_san_dns","x509_hash"];for(let n of t){let i=`${n}:`;if(r.startsWith(i))return{prefix:n,value:r.slice(i.length),inferred:!1}}return r.startsWith("https://")?{prefix:"https",value:r,inferred:!0}:/^did:[a-z0-9]+:/.test(r)?{prefix:"did",value:r,inferred:!0}:{prefix:"pre-registered",value:r,inferred:!0}},"deriveClientIdPrefix"),II=o(r=>PI.includes(r),"isKnownPrefix"),Mv;function Ih(r){return{lang:r?.lang??Mv?.lang,message:r?.message,abortEarly:r?.abortEarly??Mv?.abortEarly,abortPipeEarly:r?.abortPipeEarly??Mv?.abortPipeEarly}}u(Ih,"getGlobalConfig");o(Ih,"getGlobalConfig");var OI;function E5(r){return OI?.get(r)}u(E5,"getGlobalMessage");o(E5,"getGlobalMessage");var BI;function k5(r){return BI?.get(r)}u(k5,"getSchemaMessage");o(k5,"getSchemaMessage");var NI;function x5(r,e){return NI?.get(r)?.get(e)}u(x5,"getSpecificMessage");o(x5,"getSpecificMessage");function kd(r){let e=typeof r;return e==="string"?`"${r}"`:e==="number"||e==="bigint"||e==="boolean"?`${r}`:e==="object"||e==="function"?(r&&Object.getPrototypeOf(r)?.constructor?.name)??"null":e}u(kd,"_stringify");o(kd,"_stringify");function Ne(r,e,t,n,i){let a=i&&"input"in i?i.input:t.value,s=i?.expected??r.expects??null,c=i?.received??kd(a),d={kind:r.kind,type:r.type,input:a,expected:s,received:c,message:`Invalid ${e}: ${s?`Expected ${s} but r`:"R"}eceived ${c}`,requirement:r.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},f=r.kind==="schema",l=i?.message??r.message??x5(r.reference,d.lang)??(f?k5(d.lang):null)??n.message??E5(d.lang);l!==void 0&&(d.message=typeof l=="function"?l(d):l),f&&(t.typed=!1),t.issues?t.issues.push(d):t.issues=[d]}u(Ne,"_addIssue");o(Ne,"_addIssue");function Fe(r){return{version:1,vendor:"valibot",validate(e){return r["~run"]({value:e},Ih())}}}u(Fe,"_getStandardProps");o(Fe,"_getStandardProps");function P5(r,e){return Object.hasOwn(r,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}u(P5,"_isValidObjectKey");o(P5,"_isValidObjectKey");function Oh(r,e){let t=[...new Set(r)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}u(Oh,"_joinExpects");o(Oh,"_joinExpects");function I5(r){if(r.path){let e="";for(let t of r.path)if(typeof t.key=="string"||typeof t.key=="number")e?e+=`.${t.key}`:e+=t.key;else return null;return e}return null}u(I5,"getDotPath");o(I5,"getDotPath");var Vv,Gc,O5=(Vv=(Gc=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}},u(Gc,"_a100"),Gc),o(Vv,"ValiError"),Vv);function zf(r,e){return{kind:"validation",type:"check",reference:zf,async:!1,expects:null,requirement:r,message:e,"~run"(t,n){return t.typed&&!this.requirement(t.value)&&Ne(this,"input",t,n),t}}}u(zf,"check");o(zf,"check");function ue(r){return{kind:"metadata",type:"description",reference:ue,description:r}}u(ue,"description");o(ue,"description");function Ip(r){return{kind:"validation",type:"integer",reference:Ip,async:!1,expects:null,requirement:Number.isInteger,message:r,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&Ne(this,"integer",e,t),e}}}u(Ip,"integer");o(Ip,"integer");function r1(r,e){return{kind:"validation",type:"min_value",reference:r1,async:!1,expects:`>=${r instanceof Date?r.toJSON():kd(r)}`,requirement:r,message:e,"~run"(t,n){return t.typed&&!(t.value>=this.requirement)&&Ne(this,"value",t,n,{received:t.value instanceof Date?t.value.toJSON():kd(t.value)}),t}}}u(r1,"minValue");o(r1,"minValue");function n1(r){return{kind:"validation",type:"non_empty",reference:n1,async:!1,expects:"!0",message:r,"~run"(e,t){return e.typed&&e.value.length===0&&Ne(this,"length",e,t,{received:"0"}),e}}}u(n1,"nonEmpty");o(n1,"nonEmpty");function ci(r){return{kind:"transformation",type:"raw_transform",reference:ci,async:!1,"~run"(e,t){let n=r({dataset:e,config:t,addIssue:o(i=>Ne(this,i?.label??"input",e,t,i),"addIssue"),NEVER:null});return e.issues?e.typed=!1:e.value=n,e}}}u(ci,"rawTransform");o(ci,"rawTransform");function Rl(r,e){return{kind:"validation",type:"regex",reference:Rl,async:!1,expects:`${r}`,requirement:r,message:e,"~run"(t,n){return t.typed&&!this.requirement.test(t.value)&&Ne(this,"format",t,n),t}}}u(Rl,"regex");o(Rl,"regex");function i1(r,e){return{kind:"validation",type:"some_item",reference:i1,async:!1,expects:null,requirement:r,message:e,"~run"(t,n){return t.typed&&!t.value.some(this.requirement)&&Ne(this,"item",t,n),t}}}u(i1,"someItem");o(i1,"someItem");function a1(r){return{kind:"transformation",type:"transform",reference:a1,async:!1,operation:r,"~run"(e){return e.value=this.operation(e.value),e}}}u(a1,"transform");o(a1,"transform");function Op(r){return{kind:"validation",type:"url",reference:Op,async:!1,expects:null,requirement(e){try{return new URL(e),!0}catch{return!1}},message:r,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&Ne(this,"URL",e,t),e}}}u(Op,"url");o(Op,"url");function B5(r,e,t){return typeof r.fallback=="function"?r.fallback(e,t):r.fallback}u(B5,"getFallback");o(B5,"getFallback");function jl(r){let e={};for(let t of r)if(t.path){let n=I5(t);n?(e.nested||(e.nested={}),e.nested[n]?e.nested[n].push(t.message):e.nested[n]=[t.message]):e.other?e.other.push(t.message):e.other=[t.message]}else e.root?e.root.push(t.message):e.root=[t.message];return e}u(jl,"flatten");o(jl,"flatten");function o1(r,e,t){return typeof r.default=="function"?r.default(e,t):r.default}u(o1,"getDefault");o(o1,"getDefault");function s1(r,e){return!r["~run"]({value:e},{abortEarly:!0}).issues}u(s1,"is2");o(s1,"is");function Nf(){return{kind:"schema",type:"any",reference:Nf,expects:"any",async:!1,get"~standard"(){return Fe(this)},"~run"(r){return r.typed=!0,r}}}u(Nf,"any");o(Nf,"any");function Rt(r,e){return{kind:"schema",type:"array",reference:Rt,expects:"Array",async:!1,item:r,message:e,get"~standard"(){return Fe(this)},"~run"(t,n){let i=t.value;if(Array.isArray(i)){t.typed=!0,t.value=[];for(let a=0;a<i.length;a++){let s=i[a],c=this.item["~run"]({value:s},n);if(c.issues){let d={type:"array",origin:"value",input:i,key:a,value:s};for(let f of c.issues)f.path?f.path.unshift(d):f.path=[d],t.issues?.push(f);if(t.issues||(t.issues=c.issues),n.abortEarly){t.typed=!1;break}}c.typed||(t.typed=!1),t.value.push(c.value)}}else Ne(this,"type",t,n);return t}}}u(Rt,"array");o(Rt,"array");function sr(r){return{kind:"schema",type:"boolean",reference:sr,expects:"boolean",async:!1,message:r,get"~standard"(){return Fe(this)},"~run"(e,t){return typeof e.value=="boolean"?e.typed=!0:Ne(this,"type",e,t),e}}}u(sr,"boolean");o(sr,"boolean");function Bh(r,e){return{kind:"schema",type:"custom",reference:Bh,expects:"unknown",async:!1,check:r,message:e,get"~standard"(){return Fe(this)},"~run"(t,n){return this.check(t.value)?t.typed=!0:Ne(this,"type",t,n),t}}}u(Bh,"custom");o(Bh,"custom");function u1(r){return{kind:"schema",type:"lazy",reference:u1,expects:"unknown",async:!1,getter:r,get"~standard"(){return Fe(this)},"~run"(e,t){return this.getter(e.value)["~run"](e,t)}}}u(u1,"lazy");o(u1,"lazy");function Ae(r,e){return{kind:"schema",type:"literal",reference:Ae,expects:kd(r),async:!1,literal:r,message:e,get"~standard"(){return Fe(this)},"~run"(t,n){return t.value===this.literal?t.typed=!0:Ne(this,"type",t,n),t}}}u(Ae,"literal");o(Ae,"literal");function Nh(r){return{kind:"schema",type:"null",reference:Nh,expects:"null",async:!1,message:r,get"~standard"(){return Fe(this)},"~run"(e,t){return e.value===null?e.typed=!0:Ne(this,"type",e,t),e}}}u(Nh,"null_");o(Nh,"null_");function ft(r){return{kind:"schema",type:"number",reference:ft,expects:"number",async:!1,message:r,get"~standard"(){return Fe(this)},"~run"(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Ne(this,"type",e,t),e}}}u(ft,"number");o(ft,"number");function ae(r,e){return{kind:"schema",type:"object",reference:ae,expects:"Object",async:!1,entries:r,message:e,get"~standard"(){return Fe(this)},"~run"(t,n){let i=t.value;if(i&&typeof i=="object"){t.typed=!0,t.value={};for(let a in this.entries){let s=this.entries[a];if(a in i||(s.type==="exact_optional"||s.type==="optional"||s.type==="nullish")&&s.default!==void 0){let c=a in i?i[a]:o1(s),d=s["~run"]({value:c},n);if(d.issues){let f={type:"object",origin:"value",input:i,key:a,value:c};for(let l of d.issues)l.path?l.path.unshift(f):l.path=[f],t.issues?.push(l);if(t.issues||(t.issues=d.issues),n.abortEarly){t.typed=!1;break}}d.typed||(t.typed=!1),t.value[a]=d.value}else if(s.fallback!==void 0)t.value[a]=B5(s);else if(s.type!=="exact_optional"&&s.type!=="optional"&&s.type!=="nullish"&&(Ne(this,"key",t,n,{input:void 0,expected:`"${a}"`,path:[{type:"object",origin:"key",input:i,key:a,value:i[a]}]}),n.abortEarly))break}}else Ne(this,"type",t,n);return t}}}u(ae,"object");o(ae,"object");function le(r,e){return{kind:"schema",type:"optional",reference:le,expects:`(${r.expects} | undefined)`,async:!1,wrapped:r,default:e,get"~standard"(){return Fe(this)},"~run"(t,n){return t.value===void 0&&(this.default!==void 0&&(t.value=o1(this,t,n)),t.value===void 0)?(t.typed=!0,t):this.wrapped["~run"](t,n)}}}u(le,"optional");o(le,"optional");function Un(r,e){return{kind:"schema",type:"picklist",reference:Un,expects:Oh(r.map(kd),"|"),async:!1,options:r,message:e,get"~standard"(){return Fe(this)},"~run"(t,n){return this.options.includes(t.value)?t.typed=!0:Ne(this,"type",t,n),t}}}u(Un,"picklist");o(Un,"picklist");function xt(r,e,t){return{kind:"schema",type:"record",reference:xt,expects:"Object",async:!1,key:r,value:e,message:t,get"~standard"(){return Fe(this)},"~run"(n,i){let a=n.value;if(a&&typeof a=="object"){n.typed=!0,n.value={};for(let s in a)if(P5(a,s)){let c=a[s],d=this.key["~run"]({value:s},i);if(d.issues){let l={type:"object",origin:"key",input:a,key:s,value:c};for(let p of d.issues)p.path=[l],n.issues?.push(p);if(n.issues||(n.issues=d.issues),i.abortEarly){n.typed=!1;break}}let f=this.value["~run"]({value:c},i);if(f.issues){let l={type:"object",origin:"value",input:a,key:s,value:c};for(let p of f.issues)p.path?p.path.unshift(l):p.path=[l],n.issues?.push(p);if(n.issues||(n.issues=f.issues),i.abortEarly){n.typed=!1;break}}(!d.typed||!f.typed)&&(n.typed=!1),d.typed&&(n.value[d.value]=f.value)}}else Ne(this,"type",n,i);return n}}}u(xt,"record");o(xt,"record");function ve(r){return{kind:"schema",type:"string",reference:ve,expects:"string",async:!1,message:r,get"~standard"(){return Fe(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=!0:Ne(this,"type",e,t),e}}}u(ve,"string");o(ve,"string");function c1(r,e){return{kind:"schema",type:"tuple",reference:c1,expects:"Array",async:!1,items:r,message:e,get"~standard"(){return Fe(this)},"~run"(t,n){let i=t.value;if(Array.isArray(i)){t.typed=!0,t.value=[];for(let a=0;a<this.items.length;a++){let s=i[a],c=this.items[a]["~run"]({value:s},n);if(c.issues){let d={type:"array",origin:"value",input:i,key:a,value:s};for(let f of c.issues)f.path?f.path.unshift(d):f.path=[d],t.issues?.push(f);if(t.issues||(t.issues=c.issues),n.abortEarly){t.typed=!1;break}}c.typed||(t.typed=!1),t.value.push(c.value)}}else Ne(this,"type",t,n);return t}}}u(c1,"tuple");o(c1,"tuple");function rr(r){return{kind:"schema",type:"undefined",reference:rr,expects:"undefined",async:!1,message:r,get"~standard"(){return Fe(this)},"~run"(e,t){return e.value===void 0?e.typed=!0:Ne(this,"type",e,t),e}}}u(rr,"undefined_");o(rr,"undefined_");function Ig(r){let e;if(r)for(let t of r)e?e.push(...t.issues):e=t.issues;return e}u(Ig,"_subIssues");o(Ig,"_subIssues");function Ke(r,e){return{kind:"schema",type:"union",reference:Ke,expects:Oh(r.map(t=>t.expects),"|"),async:!1,options:r,message:e,get"~standard"(){return Fe(this)},"~run"(t,n){let i,a,s;for(let c of this.options){let d=c["~run"]({value:t.value},n);if(d.typed)if(d.issues)a?a.push(d):a=[d];else{i=d;break}else s?s.push(d):s=[d]}if(i)return i;if(a){if(a.length===1)return a[0];Ne(this,"type",t,n,{issues:Ig(a)}),t.typed=!0}else{if(s?.length===1)return s[0];Ne(this,"type",t,n,{issues:Ig(s)})}return t}}}u(Ke,"union");o(Ke,"union");function Kt(){return{kind:"schema",type:"unknown",reference:Kt,expects:"unknown",async:!1,get"~standard"(){return Fe(this)},"~run"(r){return r.typed=!0,r}}}u(Kt,"unknown");o(Kt,"unknown");function Kr(r,e,t){return{kind:"schema",type:"variant",reference:Kr,expects:"Object",async:!1,key:r,options:e,message:t,get"~standard"(){return Fe(this)},"~run"(n,i){let a=n.value;if(a&&typeof a=="object"){let s,c=0,d=this.key,f=[],l=o((p,v)=>{for(let b of p.options){if(b.type==="variant")l(b,new Set(v).add(b.key));else{let g=!0,A=0;for(let w of v){let C=b.entries[w];if(w in a?C["~run"]({typed:!1,value:a[w]},{abortEarly:!0}).issues:C.type!=="exact_optional"&&C.type!=="optional"&&C.type!=="nullish"){g=!1,d!==w&&(c<A||c===A&&w in a&&!(d in a))&&(c=A,d=w,f=[]),d===w&&f.push(b.entries[w].expects);break}A++}if(g){let w=b["~run"]({value:a},i);(!s||!s.typed&&w.typed)&&(s=w)}}if(s&&!s.issues)break}},"parseOptions");if(l(this,new Set([this.key])),s)return s;Ne(this,"type",n,i,{input:a[d],expected:Oh(f,"|"),path:[{type:"object",origin:"value",input:a,key:d,value:a[d]}]})}else Ne(this,"type",n,i);return n}}}u(Kr,"variant");o(Kr,"variant");function N5(r,e){return{...r,get"~standard"(){return Fe(this)},"~run"(t,n){return r["~run"](t,{...n,message:e})}}}u(N5,"message2");o(N5,"message");function T5(r,e){let t={...r.entries};for(let n of e)delete t[n];return{...r,entries:t,get"~standard"(){return Fe(this)}}}u(T5,"omit");o(T5,"omit");function Gf(r,e,t){let n=r["~run"]({value:e},Ih(t));if(n.issues)throw new O5(n.issues);return n.value}u(Gf,"parse3");o(Gf,"parse");function Hl(r,e){let t={};for(let n of e)t[n]=r.entries[n];return{...r,entries:t,get"~standard"(){return Fe(this)}}}u(Hl,"pick");o(Hl,"pick");function ne(...r){return{...r[0],pipe:r,get"~standard"(){return Fe(this)},"~run"(e,t){for(let n of r)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=n["~run"](e,t))}return e}}}u(ne,"pipe");o(ne,"pipe");function nn(r,e,t){let n=r["~run"]({value:e},Ih(t));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}u(nn,"safeParse");o(nn,"safeParse");function R5(r){return!!r&&!Array.isArray(r)&&typeof r=="object"}u(R5,"isObject3");o(R5,"isObject");var Uv,Xc,TI=(Uv=(Xc=class extends Error{},u(Xc,"_a101"),Xc),o(Uv,"UnknownCauseError"),Uv);function j5(r){if(r instanceof Error)return r;let e=typeof r;if(!(e==="undefined"||e==="function"||r===null)){if(e!=="object")return new Error(String(r));if(R5(r)){let t=new TI;for(let n in r)t[n]=r[n];return t}}}u(j5,"getCauseFromUnknown");o(j5,"getCauseFromUnknown");var $v,Zc,Ar=($v=(Zc=class extends Error{constructor(e){let t=j5(e.cause),n=e.message??t?.message??e.code;super(n,{cause:t}),this.code=e.code,this.name="DcqlError",this.cause||(this.cause=t)}},u(Zc,"_a102"),Zc),o($v,"DcqlError"),$v),qv,Qc,RI=(qv=(Qc=class extends Ar{constructor(e){super({code:"BAD_REQUEST",...e})}},u(Qc,"_a103"),Qc),o(qv,"DcqlCredentialSetError"),qv),Hv,Yc,jI=(Hv=(Yc=class extends Ar{constructor(e){super({code:"BAD_REQUEST",...e})}},u(Yc,"_a104"),Yc),o(Hv,"DcqlUndefinedClaimSetIdError"),Hv),Fv,ed,LI=(Fv=(ed=class extends Ar{constructor(e){super({code:"BAD_REQUEST",...e})}},u(ed,"_a105"),ed),o(Fv,"DcqlNonUniqueCredentialQueryIdsError"),Fv),Kv,td,L5=(Kv=(td=class extends Ar{constructor(e){super({code:"PARSE_ERROR",...e})}},u(td,"_a106"),td),o(Kv,"DcqlParseError"),Kv),Wv,rd,DI=(Wv=(rd=class extends Ar{constructor(e){super({code:"BAD_REQUEST",...e})}},u(rd,"_a107"),rd),o(Wv,"DcqlInvalidPresentationRecordError"),Wv),Jv,nd,zv=(Jv=(nd=class extends Ar{constructor(e){super({code:"BAD_REQUEST",...e})}},u(nd,"_a108"),nd),o(Jv,"DcqlPresentationResultError"),Jv),D5=/^[a-zA-Z0-9_-]+$/;function lr(r){return r.length>0?r:void 0}u(lr,"asNonEmptyArrayOrUndefined");o(lr,"asNonEmptyArrayOrUndefined");function d1(r){return r.length>0}u(d1,"isNonEmptyArray");o(d1,"isNonEmptyArray");var he=o(r=>ne(Rt(r,e=>`Expected input to be an array, but received '${e.received}'`),Bh(e=>e.length>0,"Array must be non-empty and have length of at least 1")),"vNonEmptyArray"),MI=o(r=>Bh(e=>Array.isArray(e)?r.every(t=>e.includes(t)):!1,`Value must include all of: ${r.join(", ")}`),"vIncludesAll"),ir=ne(ve(),Rl(D5),n1()),VI=Rl(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==)?|[\w-]{3}=?)?$/iu,"must be base64url");function UI(r){return r===null||typeof r!="object"?!1:typeof r.toJson=="function"}u(UI,"isToJsonable");o(UI,"isToJsonable");var $I=Ke([ve(),ft(),sr(),Nh()]),Og=u1(()=>Ke([$I,Rt(Og),xt(ve(),Og)]));var f1=xt(ve(),Og),qI=ci(({dataset:r,addIssue:e,NEVER:t})=>{try{return JSON.parse(r.value)}catch{return e({message:"Invalid JSON"}),t}});function Bg(r,e){let t=ne(le(r,()=>{}),r);return e?N5(t,e):t}u(Bg,"vCustomRequiredMessage");o(Bg,"vCustomRequiredMessage");var HI=o(r=>ne(ae({type:Ae(r.type,e=>`Expected trusted authority type to be '${r.type}' but received ${typeof e.input=="string"?`'${e.input}'`:e.input}`),values:ne(he(ve()),i1(e=>r.values.includes(e),e=>`Expected one of the trusted authority values to be '${r.values.join("' | '")}' but received '${e.input.join("' , '")}'`))},`Expected trusted authority object with type '${r.type}' to be defined, but received undefined`),a1(({values:e,...t})=>({...t,value:e.find(n=>r.values.includes(n))}))),"getTrustedAuthorityParser"),M5=[ae({type:Ae("aki"),values:he(ne(ve("aki trusted authority value must be a string"),VI,ue("Contains a list of KeyIdentifier entries of the AuthorityKeyIdentifier as defined in Section 4.2.1.1 of [RFC5280], encoded as base64url. The raw byte representation of one of the elements MUST match with the AuthorityKeyIdentifier element of an X.509 certificate in the certificate chain present in the credential (e.g., in the header of an mdoc or SD-JWT). Note that the chain can consist of a single certificate and the credential can include the entire X.509 chain or parts of it.")))}),ae({type:Ae("etsi_tl"),values:he(ne(ve("etsi_tl trusted authority value must be a string"),Op("etsi_tl trusted authority value must be a valid https url"),zf(r=>r.startsWith("http://")||r.startsWith("https://"),"etsi_tl trusted authority value must be a valid https url"),ue("The identifier of a Trusted List as specified in ETSI TS 119 612 [ETSI.TL]. An ETSI Trusted List contains references to other Trusted Lists, creating a list of trusted lists, or entries for Trust Service Providers with corresponding service description and X.509 Certificates. The trust chain of a matching Credential MUST contain at least one X.509 Certificate that matches one of the entries of the Trusted List or its cascading Trusted Lists.")))}),ae({type:Ae("openid_federation"),values:he(ne(ve("openid_federation trusted authority value must be a string"),Op("openid_federation trusted authority value must be a valid https url"),zf(r=>r.startsWith("http://")||r.startsWith("https://"),"openid_federation trusted authority value must be a valid https url"),ue("The Entity Identifier as defined in Section 1 of [OpenID.Federation] that is bound to an entity in a federation. While this Entity Identifier could be any entity in that ecosystem, this entity would usually have the Entity Configuration of a Trust Anchor. A valid trust path, including the given Entity Identifier, must be constructible from a matching credential.")))})],Ng;(function(r){let e=M5.map(t=>ae({type:ne(t.entries.type,ue("REQUIRED. A string uniquely identifying the type of information about the issuer trust framework.")),values:ne(he(t.entries.values.item),ue("REQUIRED. An array of strings, where each string (value) contains information specific to the used Trusted Authorities Query type that allows to identify an issuer, trust framework, or a federation that an issuer belongs to."))}));r.vModel=Kr("type",e)})(Ng||(Ng={}));var Bp;(function(r){r.vModel=Kr("type",M5)})(Bp||(Bp={}));var Gv,id,ln=(Gv=(id=class{constructor(e){this.input=e}get v(){return this.input.vModel}parse(e){let t=this.safeParse(e);return t.success?t.output:new L5({message:JSON.stringify(t.flattened),cause:t.error})}safeParse(e){let t=nn(this.input.vModel,e);return t.success?{success:!0,output:t.output}:{success:!1,error:new O5(t.issues),flattened:jl(t.issues)}}is(e){return s1(this.v,e)}},u(id,"_a109"),id),o(Gv,"ModelDefinition"),Gv),l1=ae({authority:le(Bp.vModel),cryptographic_holder_binding:ne(sr(),ue("Indicates support/inclusion of cryptographic holder binding. This will be checked against the `require_cryptographic_holder_binding` property from the query."))}),xd;(function(r){let e=r.vNamespaces=xt(ve(),xt(ve(),Kt()));r.model=new ln({vModel:r.vModel=ae({...l1.entries,credential_format:Ae("mso_mdoc"),doctype:ve(),namespaces:e})})})(xd||(xd={}));var Pd;(function(r){let e=r.vClaims=f1;r.model=new ln({vModel:r.vModel=ae({...l1.entries,credential_format:Un(["vc+sd-jwt","dc+sd-jwt"]),vct:ve(),claims:e})})})(Pd||(Pd={}));var Id;(function(r){let e=r.vClaims=f1;r.model=new ln({vModel:r.vModel=ae({...l1.entries,credential_format:Un(["ldp_vc","jwt_vc_json","vc+sd-jwt"]),claims:e,type:Rt(ve())})})})(Id||(Id={}));var dw;(function(r){r.model=new ln({vModel:r.vModel=Kr("credential_format",[xd.vModel,Pd.vModel,Id.vModel])})})(dw||(dw={}));var Tg;(function(r){r.model=new ln({vModel:r.vModel=xd.vModel})})(Tg||(Tg={}));var Rg;(function(r){r.model=new ln({vModel:r.vModel=Pd.vModel})})(Rg||(Rg={}));var jg;(function(r){r.model=new ln({vModel:r.vModel=Id.vModel})})(jg||(jg={}));var fw;(function(r){r.model=new ln({vModel:Kr("credential_format",[Tg.vModel,Rg.vModel,jg.vModel])})})(fw||(fw={}));var lw;(function(r){let e=Ke([ve(),f1]),t=r.vModel=ne(Ke([xt(ir,he(e)),xt(ir,e)]),ue("REQUIRED. This is a JSON-encoded object containing entries where the key is the id value used for a Credential Query in the DCQL query and the value is an array of one or more Presentations that match the respective Credential Query. When multiple is omitted, or set to false, the array MUST contain only one Presentation. There MUST NOT be any entry in the JSON-encoded object for optional Credential Queries when there are no matching Credentials for the respective Credential Query. Each Presentation is represented as a string or object, depending on the format as defined in Appendix B. The same rules as above apply for encoding the Presentations."));r.parse=n=>Gf(typeof n=="string"?ne(ve(),qI,t):t,n),r.encode=n=>JSON.stringify(n)})(lw||(lw={}));var di;(function(r){let e=r.vValue=Ke([ve(),ne(ft(),Ip()),sr()]),t=r.vPath=Ke([ve(),ne(ft(),Ip(),r1(0)),Nh()]),n=r.vW3cSdJwtVc=ae({id:ne(le(ir),ue("A string identifying the particular claim. The value MUST be a non-empty string consisting of alphanumeric, underscore (_) or hyphen (-) characters. Within the particular claims array, the same id MUST NOT be present more than once.")),path:ne(he(t),ue("A non-empty array representing a claims path pointer that specifies the path to a claim within the Verifiable Credential.")),values:ne(le(Rt(e)),ue("An array of strings, integers or boolean values that specifies the expected values of the claim. If the values property is present, the Wallet SHOULD return the claim only if the type and value of the claim both match for at least one of the elements in the array."))}),i=ae({id:ne(le(ir),ue("A string identifying the particular claim. The value MUST be a non-empty string consisting of alphanumeric, underscore (_) or hyphen (-) characters. Within the particular claims array, the same id MUST NOT be present more than once.")),values:ne(le(Rt(e)),ue("An array of strings, integers or boolean values that specifies the expected values of the claim. If the values property is present, the Wallet SHOULD return the claim only if the type and value of the claim both match for at least one of the elements in the array."))}),a=r.vMdocNamespace=ae({...i.entries,namespace:ne(ve(),ue("A string that specifies the namespace of the data element within the mdoc, e.g., org.iso.18013.5.1.")),claim_name:ne(ve(),ue("A string that specifies the data element identifier of the data element within the provided namespace in the mdoc, e.g., first_name."))}),s=r.vMdocPath=ae({...i.entries,intent_to_retain:ne(le(sr()),ue("A boolean that is equivalent to `IntentToRetain` variable defined in Section 8.3.2.1.2.1 of [@ISO.18013-5].")),path:ne(c1([ne(ve(),ue("A string that specifies the namespace of the data element within the mdoc, e.g., org.iso.18013.5.1.")),ne(ve(),ue("A string that specifies the data element identifier of the data element within the provided namespace in the mdoc, e.g., first_name."))]),ue("An array defining a claims path pointer into an mdoc. It must contain two elements of type string. The first element refers to a namespace and the second element refers to a data element identifier."))}),c=r.vMdoc=Ke([a,s]);r.vModel=Ke([c,n])})(di||(di={}));function Np(r,e){let t=e;if(Object.getPrototypeOf(r)!==Object.prototype&&!Array.isArray(r))throw new Ar({message:"source value provided to deepMerge is neither an array or object.",code:"PARSE_ERROR"});if(Object.getPrototypeOf(e)!==Object.prototype&&!Array.isArray(e))throw new Ar({message:"target value provided to deepMerge is neither an array or object.",code:"PARSE_ERROR"});for(let[n,i]of Object.entries(r))if(i!==null&&typeof i=="object"&&(Object.getPrototypeOf(i)===Object.prototype||Array.isArray(i))){let a=Np(i,t[n]??new(Object.getPrototypeOf(i)).constructor);t=Lg(t,n,a)}else i!=null&&(t=Lg(t,n,i));return t}u(Np,"deepMerge");o(Np,"deepMerge");function Lg(r,e,t){let n=r;if(Array.isArray(n))n=[...n],n[e]=t;else if(Object.getPrototypeOf(n)===Object.prototype)n={...n,[e]:t};else throw new Ar({message:"Unsupported type for deep merge. Only primitive types or Array and Object are supported",code:"INTERNAL_SERVER_ERROR"});return n}u(Lg,"setValue");o(Lg,"setValue");var Rr=o(r=>r.map(e=>typeof e=="string"?`'${e}'`:`${e}`).join("."),"pathToString"),V5=o((r,e)=>e?Ke(e.map(t=>Ae(t,n=>`Expected claim ${Rr(r)} to be ${typeof t=="string"?`'${t}'`:t} but received ${typeof n.input=="string"?`'${n.input}'`:n.input}`)),t=>`Expected claim ${Rr(r)} to be ${e.map(n=>typeof n=="string"?`'${n}'`:n).join(" | ")} but received ${typeof t.input=="string"?`'${t.input}'`:t.input}`):ne(Kt(),zf(t=>t!=null,`Expected claim '${r.join("'.'")}' to be defined`)),"getClaimParser"),FI=o(r=>{let e=s1(di.vMdocNamespace,r)?{id:r.id,path:[r.namespace,r.claim_name],values:r.values}:r,t=e.path[0],n=e.path[1];return ae({[t]:ae({[n]:V5(e.path,r.values)},`Expected claim ${Rr(e.path)} to be defined`)},`Expected claim ${Rr(e.path)} to be defined`)},"getMdocClaimParser"),Fl=o((r,e)=>{let{index:t,presentation:n}=e,i=r.path[t],a=t===r.path.length-1,s=V5(r.path,r.values);if(typeof i=="number"){let c=a?s:Fl(r,{...e,index:t+1});return n?ne(Rt(Nf(),`Expected path ${Rr(r.path.slice(0,t+1))} to be an array`),ci(({dataset:d,addIssue:f})=>{let l=[];for(let p of d.value){let v=nn(c,p);if(v.success)return d.value;l.push(v.issues[0])}return f({...l[0],message:a?l[0].message:`Expected any element in array ${Rr(r.path.slice(0,t+1))} to match sub requirement but none matched: ${l[0].message}`}),d.value})):ne(Rt(Nf(),`Expected path ${Rr(r.path.slice(0,t+1))} to be an array`),ci(({addIssue:d,dataset:f,NEVER:l})=>{let p=nn(c,f.value[i]);return p.success?[...f.value.slice(0,i).map(()=>null),p.output]:(d(p.issues[0]),l)}))}return typeof i=="string"?ae({[i]:a?s:Fl(r,{...e,index:t+1})},`Expected claim ${Rr(r.path)} to be defined`):ne(Rt(Nf(),`Expected path ${Rr(r.path.slice(0,t+1))} to be an array`),ci(({addIssue:c,dataset:d,NEVER:f})=>{let l=d.value.map(p=>nn(a?s:Fl(r,{...e,index:t+1}),p));if(l.every(p=>!p.success)){for(let p of l)for(let v of p.issues)c(v);return f}return l.map(p=>p.success?p.output:null)}))},"getJsonClaimParser"),KI=o((r,e)=>{if(!r.claims)return{success:!0,valid_claims:void 0,failed_claims:void 0,valid_claim_sets:[{claim_set_index:void 0,output:{},success:!0,valid_claim_indexes:void 0}],failed_claim_sets:void 0};let t=[],n=[];for(let[s,c]of r.claims.entries()){let d=r.format==="mso_mdoc"?FI(c):Fl(c,{index:0,presentation:e.presentation}),f=nn(d,e.credential.credential_format==="mso_mdoc"?e.credential.namespaces:e.credential.claims);if(f.success)n.push({success:!0,claim_index:s,claim_id:c.id,output:f.output,parser:d});else{let l=jl(f.issues);t.push({success:!1,issues:l.nested??l,claim_index:s,claim_id:c.id,output:f.output,parser:d})}}let i=[],a=[];for(let[s,c]of r.claim_sets?.entries()??[[void 0,void 0]]){let d=c?.map(f=>{let l=n.find(p=>p.claim_id===f)??t.find(p=>p.claim_id===f);if(!l)throw new L5({message:`Claim with id '${f}' in query '${r.id}' from claim set with index '${s}' not found in claims of claim`});return l})??[...n,...t];if(d.every(f=>f.success)){let f=d.reduce((l,p)=>Np(p.output,l),{});a.push({success:!0,claim_set_index:s,output:f,valid_claim_indexes:lr(d.map(l=>l.claim_index))})}else{let f=t.reduce((l,p)=>Np(p.issues,l),{});i.push({success:!1,issues:f,claim_set_index:s,failed_claim_indexes:d.filter(l=>!l.success).map(l=>l.claim_index),valid_claim_indexes:lr(d.filter(l=>l.success).map(l=>l.claim_index))})}}return d1(a)?{success:!0,failed_claim_sets:lr(i),valid_claim_sets:a,valid_claims:lr(n.map(({parser:s,...c})=>c)),failed_claims:lr(t.map(({parser:s,...c})=>c))}:{success:!1,failed_claim_sets:i,failed_claims:t.map(({parser:s,...c})=>c),valid_claims:lr(n.map(({parser:s,...c})=>c))}},"runClaimsQuery"),p1=o(r=>ae({cryptographic_holder_binding:r.require_cryptographic_holder_binding?Ae(!0,e=>`Expected cryptographic_holder_binding to be true (because credential query '${r.id}' requires cryptographic holder binding), but received ${e.input}`):sr()}),"getCryptographicHolderBindingValue"),WI=o(r=>{let e=r.meta?.doctype_value?Ae(r.meta.doctype_value,t=>`Expected doctype to be '${r.meta?.doctype_value}' but received '${t.input}'`):ve("Expected doctype to be defined");return ae({credential_format:Ae("mso_mdoc",t=>`Expected credential format to be 'mso_mdoc' but received '${t.input}'`),doctype:e,...p1(r).entries})},"getMdocMetaParser"),pw=o(r=>ae({credential_format:Ae(r.format,e=>`Expected credential format to be '${r.format}' but received '${e.input}'`),vct:r.meta?.vct_values?Bg(Un(r.meta.vct_values,e=>`Expected vct to be '${r.meta?.vct_values?.join("' | '")}' but received '${e.input}'`),e=>`Expected vct to be '${r.meta?.vct_values?.join("' | '")}' but received '${e.input}'`):Bg(ve("Expected vct to be a string"),"Expected vct to be defined"),...p1(r).entries}),"getSdJwtVcMetaParser"),hw=o(r=>ae({credential_format:Ae(r.format,e=>`Expected credential format to be '${r.format}' but received '${e.input}'`),type:r.meta?.type_values?Ke(r.meta.type_values.map(e=>MI(e)),`Expected type to include all values from one of the following subsets: ${r.meta.type_values.map(e=>`[${e.join(", ")}]`).join(" | ")}`):he(ve()),...p1(r).entries}),"getW3cVcMetaParser"),JI=o(r=>{if(r.format==="mso_mdoc")return WI(r);if(r.format==="dc+sd-jwt")return pw(r);if(r.format==="vc+sd-jwt")return r.meta&&"type_values"in r.meta?hw(r):pw(r);if(r.format==="ldp_vc"||r.format==="jwt_vc_json")return hw(r);throw new Ar({code:"NOT_IMPLEMENTED",message:`Unsupported format '${r.format}'`})},"getMetaParser"),zI=o((r,e)=>{let t=JI(r),n=nn(t,e);if(!n.success){let i=jl(n.issues);return{success:!1,issues:i.nested??i,output:n.output}}return{success:!0,output:n.output}},"runMetaQuery"),GI=o((r,e)=>{if(!r.trusted_authorities)return{success:!0};let t=[];for(let[n,i]of r.trusted_authorities.entries()){let a=HI(i),s=nn(a,e.authority);if(s.success)return{success:!0,valid_trusted_authority:{success:!0,trusted_authority_index:n,output:s.output},failed_trusted_authorities:lr(t)};let c=jl(s.issues);t.push({success:!1,trusted_authority_index:n,issues:c.nested??c,output:s.output})}return{success:!1,failed_trusted_authorities:t}},"runTrustedAuthoritiesQuery"),U5=o((r,e)=>{let{credentials:t,presentation:n}=e,i=[],a=[];for(let[s,c]of t.entries()){let d=GI(r,c),f=KI(r,{credential:c,presentation:n}),l=zI(r,c);f.success&&d.success&&l.success?i.push({success:!0,input_credential_index:s,trusted_authorities:d,meta:l,claims:f}):a.push({success:!1,input_credential_index:s,trusted_authorities:d,meta:l,claims:f})}return d1(i)?{success:!0,credential_query_id:r.id,failed_credentials:lr(a),valid_credentials:i}:{success:!1,credential_query_id:r.id,failed_credentials:lr(a),valid_credentials:void 0}},"runCredentialQuery"),Xf;(function(r){let e=ae({id:ne(ve(),Rl(D5),ue("REQUIRED. A string identifying the Credential in the response and, if provided, the constraints in 'credential_sets'.")),require_cryptographic_holder_binding:ne(le(sr(),!0),ue("OPTIONAL. A boolean which indicates whether the Verifier requires a Cryptographic Holder Binding proof. The default value is true, i.e., a Verifiable Presentation with Cryptographic Holder Binding is required. If set to false, the Verifier accepts a Credential without Cryptographic Holder Binding proof.")),multiple:ne(le(sr(),!1),ue("OPTIONAL. A boolean which indicates whether multiple Credentials can be returned for this Credential Query. If omitted, the default value is false.")),claim_sets:ne(le(he(he(ir))),ue("OPTIONAL. A non-empty array containing arrays of identifiers for elements in 'claims' that specifies which combinations of 'claims' for the Credential are requested.")),trusted_authorities:ne(le(he(Ng.vModel)),ue("OPTIONAL. A non-empty array of objects as defined in Section 6.1.1 that specifies expected authorities or trust frameworks that certify Issuers, that the Verifier will accept. Every Credential returned by the Wallet SHOULD match at least one of the conditions present in the corresponding trusted_authorities array if present."))}),t=r.vMdoc=ae({...e.entries,format:ne(Ae("mso_mdoc"),ue("REQUIRED. A string that specifies the format of the requested Verifiable Credential.")),claims:ne(le(he(di.vMdoc)),ue("OPTIONAL. A non-empty array of objects as that specifies claims in the requested Credential.")),meta:ne(le(ae({doctype_value:ne(le(ve()),ue("OPTIONAL. String that specifies an allowed value for the doctype of the requested Verifiable Credential."))})),ue("OPTIONAL. An object defining additional properties requested by the Verifier that apply to the metadata and validity data of the Credential."))}),n=r.vSdJwtVc=ae({...e.entries,format:ne(Un(["vc+sd-jwt","dc+sd-jwt"]),ue("REQUIRED. A string that specifies the format of the requested Verifiable Credential.")),claims:ne(le(he(di.vW3cSdJwtVc)),ue("OPTIONAL. A non-empty array of objects as that specifies claims in the requested Credential.")),meta:ne(le(ne(ae({vct_values:le(Rt(ve()))}),ue("OPTIONAL. An array of strings that specifies allowed values for the type of the requested Verifiable Credential."))),ue("OPTIONAL. An object defining additional properties requested by the Verifier that apply to the metadata and validity data of the Credential."))}),i=r.vW3cVc=ae({...e.entries,format:ne(Un(["jwt_vc_json","ldp_vc","vc+sd-jwt"]),ue("REQUIRED. A string that specifies the format of the requested Verifiable Credential.")),claims:ne(le(he(di.vW3cSdJwtVc)),ue("OPTIONAL. A non-empty array of objects as that specifies claims in the requested Credential.")),meta:ne(ne(ae({type_values:ne(he(he(ve())),ue("REQUIRED. An array of string arrays that specifies the fully expanded types (IRIs) after the @context was applied that the Verifier accepts to be presented in the Presentation. Each of the top-level arrays specifies one alternative to match the type values of the Verifiable Credential against. Each inner array specifies a set of fully expanded types that MUST be present in the type property of the Verifiable Credential, regardless of order or the presence of additional types."))})),ue("REQUIRED. An object defining additional properties requested by the Verifier that apply to the metadata and validity data of the Credential."))});r.vModel=Kr("format",[t,i,n]),r.validate=a=>{XI(a)}})(Xf||(Xf={}));var XI=o(r=>{if(!r.claim_sets)return;let e=new Set(r.claims?.map(n=>n.id)),t=[];for(let n of r.claim_sets)for(let i of n)e.has(i)||t.push(i);if(t.length>0)throw new jI({message:`Credential set contains undefined credential id${t.length===0?"":"`s"} '${t.join(", ")}'`})},"claimSetIdsAreDefined"),Tp;(function(r){r.vModel=ae({options:ne(he(Rt(ir)),ue("REQUIRED. A non-empty array, where each value in the array is a list of Credential Query identifiers representing one set of Credentials that satisfies the use case.")),required:ne(le(sr(),!0),ue("OPTIONAL. Boolean which indicates whether this set of Credentials is required to satisfy the particular use case at the Verifier. If omitted, the default value is 'true'.")),purpose:ne(le(Ke([ve(),ft(),xt(ve(),Kt())])),ue("OPTIONAL. A string, number or object specifying the purpose of the query."))})})(Tp||(Tp={}));var Rp;(function(r){let e=Ke([xd.vModel.entries.namespaces,Pd.vModel.entries.claims,Id.vModel.entries.claims]),t=r.vClaimsEntrySuccessResult=ae({success:Ae(!0),claim_index:ft(),claim_id:le(ir),output:e}),n=r.vClaimsEntryFailureResult=ae({success:Ae(!1),claim_index:ft(),claim_id:le(ir),issues:xt(ve(),Kt()),output:Kt()}),i=r.vClaimSetSuccessResult=ae({success:Ae(!0),claim_set_index:Ke([ft(),rr()]),valid_claim_indexes:le(he(ft())),failed_claim_indexes:le(rr()),output:e}),a=r.vClaimSetFailureResult=ae({success:Ae(!1),claim_set_index:Ke([ft(),rr()]),valid_claim_indexes:le(he(ft())),failed_claim_indexes:he(ft()),issues:xt(ve(),Kt())}),s=r.vClaimsSuccessResult=ae({success:Ae(!0),valid_claims:le(he(t)),failed_claims:le(he(n)),valid_claim_sets:he(i),failed_claim_sets:le(he(a))}),c=r.vClaimsFailureResult=ae({success:Ae(!1),valid_claims:le(he(t)),failed_claims:he(n),valid_claim_sets:le(rr()),failed_claim_sets:he(a)});r.vModel=Ke([s,c])})(Rp||(Rp={}));var jp;(function(r){let e=r.vMetaSuccessResult=ae({success:Ae(!0),output:Kr("credential_format",[Hl(Pd.vModel,["credential_format","cryptographic_holder_binding","vct"]),Hl(xd.vModel,["credential_format","cryptographic_holder_binding","doctype"]),Hl(Id.vModel,["credential_format","cryptographic_holder_binding","type"])])}),t=r.vMetaFailureResult=ae({success:Ae(!1),issues:xt(ve(),Kt()),output:Kt()});r.vModel=Ke([e,t])})(jp||(jp={}));var Lp;(function(r){let e=r.vTrustedAuthorityEntrySuccessResult=ae({success:Ae(!0),trusted_authority_index:ft(),output:Kr("type",Bp.vModel.options.map(a=>ae({type:a.entries.type,value:a.entries.values.item})))}),t=r.vTrustedAuthorityEntryFailureResult=ae({success:Ae(!1),trusted_authority_index:ft(),issues:xt(ve(),Kt()),output:Kt()}),n=r.vTrustedAuthoritySuccessResult=Ke([ae({success:Ae(!0),valid_trusted_authority:le(rr()),failed_trusted_authorities:le(rr())}),ae({success:Ae(!0),valid_trusted_authority:e,failed_trusted_authorities:le(he(t))})]),i=r.vTrustedAuthorityFailureResult=ae({success:Ae(!1),valid_trusted_authority:le(rr()),failed_trusted_authorities:he(t)});r.vModel=Ke([...n.options,i])})(Lp||(Lp={}));var Dg;(function(r){let e=r.vCredentialQueryItemCredentialSuccessResult=ae({success:Ae(!0),input_credential_index:ft(),trusted_authorities:Lp.vTrustedAuthoritySuccessResult,claims:Rp.vClaimsSuccessResult,meta:jp.vMetaSuccessResult}),t=r.vCredentialQueryItemCredentialFailureResult=ae({success:Ae(!1),input_credential_index:ft(),trusted_authorities:Lp.vModel,claims:Rp.vModel,meta:jp.vModel}),n=r.vCredentialQueryItemResult=Ke([ae({success:Ae(!0),credential_query_id:ir,valid_credentials:he(e),failed_credentials:le(he(t))}),ae({success:Ae(!1),credential_query_id:ir,valid_credentials:le(rr()),failed_credentials:le(he(t))})]),i=r.vCredentialQueryResult=xt(ir,n);r.vModel=ae({credentials:ne(he(Xf.vModel),ue("REQUIRED. A non-empty array of Credential Queries that specify the requested Verifiable Credentials.")),credential_matches:i,credential_sets:le(ne(he(ae({...Tp.vModel.entries,matching_options:Ke([rr(),he(Rt(ve()))])})),ue("OPTIONAL. A non-empty array of credential set queries that specifies additional constraints on which of the requested Verifiable Credentials to return."))),can_be_satisfied:sr()})})(Dg||(Dg={}));var vw;(function(r){let e=r.vModel=T5(Dg.vModel,["credentials"]);r.parse=t=>Gf(e,t),r.fromDcqlPresentation=(t,n)=>{let{dcqlQuery:i}=n,a=Object.entries(t).map(([c,d])=>{let f=i.credentials.find(l=>l.id===c);if(!f)throw new zv({message:`Query ${c} not found in the dcql query. Cannot validate presentation.`});if(Array.isArray(d)){if(d.length===0)throw new zv({message:`Query credential '${c}' is present in the presentations but the value is an empty array. Each entry must at least provide one presentation.`});if(!f.multiple&&d.length>1)throw new zv({message:`Query credential '${c}' has not enabled 'multiple', but multiple presentations were provided. Only a single presentation is allowed for each query credential when 'multiple' is not enabled on the query.`})}return U5(f,{presentation:!0,credentials:d?Array.isArray(d)?d:[d]:[]})}),s=i.credential_sets?.map(c=>{let d=c.options.filter(f=>f.every(l=>a.find(p=>p.credential_query_id===l)?.success));return{...c,matching_options:d.length>0?d:void 0}});return{can_be_satisfied:a.every(c=>c.success&&!c.failed_credentials)&&(s?s.every(c=>!c.required||c.matching_options):i.credentials.every(c=>a.find(d=>d.credential_query_id===c.id)?.success)),credential_sets:s,credential_matches:Object.fromEntries(a.map(c=>[c.credential_query_id,c]))}},r.validate=t=>{if(!t.can_be_satisfied)throw new DI({message:"Invalid Presentation record",cause:t});return t}})(vw||(vw={}));var ZI=o((r,e)=>{let t=Object.fromEntries(r.credentials.map(a=>[a.id,U5(a,e)])),n=r.credential_sets?.map(a=>{let s=a.options.filter(c=>c.every(d=>t[d].success));return{...a,matching_options:s.length>0?s:void 0}}),i=n?n.every(a=>!a.required||a.matching_options):r.credentials.every(({id:a})=>t[a].success===!0);return{...r,can_be_satisfied:i,credential_matches:t,credential_sets:n}},"runDcqlQuery"),Zf;(function(r){let e=r.vModel=ae({credentials:ne(he(Xf.vModel),ue("REQUIRED. A non-empty array of Credential Queries that specify the requested Verifiable Credentials.")),credential_sets:ne(le(he(Tp.vModel)),ue("OPTIONAL. A non-empty array of credential set queries that specifies additional constraints on which of the requested Verifiable Credentials to return."))});r.validate=t=>{QI(t),YI(t),t.credentials.forEach(Xf.validate)},r.query=(t,n)=>ZI(t,{credentials:n,presentation:!1}),r.parse=t=>Gf(e,t)})(Zf||(Zf={}));var QI=o(r=>{let e=r.credentials.map(n=>n.id),t=e.filter((n,i)=>e.indexOf(n)!==i);if(t.length>0)throw new LI({message:`Duplicate credential query ids found: ${t.join(", ")}`})},"validateUniqueCredentialQueryIds"),YI=o(r=>{if(!r.credential_sets)return;let e=new Set(r.credentials.map(n=>n.id)),t=[];for(let n of r.credential_sets)for(let i of n.options)for(let a of i)e.has(a)||t.push(a);if(t.length>0)throw new RI({message:`Credential set contains undefined credential id${t.length===1?"":"`s"} '${t.join(", ")}'`})},"validateCredentialSets"),$5=o(r=>{if(r===null||typeof r!="object"||Array.isArray(r))throw new we("invalid_dcql_query","dcql_query must be a JSON object");let e;try{e=Zf.parse(r)}catch(t){throw new we("invalid_dcql_query",`dcql_query failed structural validation: ${yw(t)}`,{cause:t})}try{Zf.validate(e)}catch(t){throw new we("invalid_dcql_query",`dcql_query failed content validation: ${yw(t)}`,{cause:t})}return e},"parseDcqlQuery"),yw=o(r=>r instanceof Error?r.message:String(r),"describe"),ad,q5=(ad=class extends Error{constructor(e,t,n){super(t),this.name="RequestObjectError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}},u(ad,"_RequestObjectError"),ad);o(q5,"RequestObjectError");var pe=q5,eO=o(async r=>{let e=await tO(r),{header:t,claims:n}=rO(e),i=mt(n.client_id);if(!i)throw new pe("invalid_request_object","Request Object JWS payload is missing client_id");let a=mt(n.client_id_scheme)??r.urlClientIdScheme,{prefix:s,value:c}=C5(i,a);if(r.urlClientId&&r.urlClientId!==i)throw new pe("client_id_mismatch",`Outer URL client_id (${r.urlClientId}) does not match signed Request Object client_id (${i})`);if(r.unsafeSkipRequestObjectSignatureVerification)return bw(i,s,n);switch(s){case"redirect_uri":throw new pe("unsupported_client_id_scheme","client-id prefix=redirect_uri does not permit signed Request Objects (OID4VP \xA75)");case"did":await nO({jws:e,header:t,clientId:c,opts:r});break;case"x509_san_dns":await aO({jws:e,header:t,clientId:c,opts:r});break;case"pre-registered":await dO({jws:e,header:t,clientId:c,opts:r});break;case"https":case"verifier_attestation":case"x509_hash":throw new pe("unsupported_client_id_scheme",`client-id prefix=${s} is not yet supported (supported: did, x509_san_dns, pre-registered)`);default:{let d=s;throw new pe("unsupported_client_id_scheme",`client-id prefix=${d} is not supported`)}}return bw(i,s,n)},"verifyAndDecodeRequestObject"),tO=o(async r=>{if(r.inlineJwt){if(!_w(r.inlineJwt))throw new pe("invalid_request_object","Inline `request` parameter is not a compact JWS");return r.inlineJwt}if(!r.requestUri)throw new pe("invalid_request_object","verifyAndDecodeRequestObject requires either inlineJwt or requestUri");let e=r.fetchImpl??globalThis.fetch;if(typeof e!="function")throw new pe("request_fetch_failed","No fetch implementation available to resolve request_uri");let t;try{t=await e(r.requestUri,{method:"GET"})}catch(i){throw new pe("request_fetch_failed",`Failed to fetch request_uri: ${jt(i)}`,{cause:i})}if(!t.ok)throw new pe("request_fetch_failed",`request_uri returned ${t.status} ${t.statusText}`);let n=(await t.text()).trim();if(!_w(n))throw new pe("invalid_request_object","request_uri response is not a compact JWS");return n},"loadJws"),rO=o(r=>{let[e,t]=r.split(".");try{let n=JSON.parse(Sw(e)),i=JSON.parse(Sw(t));return{header:n,claims:i}}catch(n){throw new pe("invalid_request_object",`Failed to decode Request Object JWS: ${jt(n)}`,{cause:n})}},"decodeHeaderAndClaims"),nO=o(async r=>{let{jws:e,header:t,clientId:n,opts:i}=r,a=mt(t.kid);if(!a)throw new pe("invalid_request_object","Request Object JWS header is missing kid (required for client_id_scheme=did)");let s=n.split("#")[0],c=i.didResolver??lO(i.fetchImpl),d;try{d=await c(s)}catch(v){throw new pe("did_resolution_failed",`Failed to resolve ${s}: ${jt(v)}`,{cause:v})}let f=iO(d,a);if(!f)throw new pe("request_signer_untrusted",`Verification method ${a} not found on ${s}`);if(!f.publicKeyJwk)throw new pe("request_signer_untrusted",`Verification method ${f.id} has no publicKeyJwk (publicKeyMultibase not supported by default resolver)`);let l=mt(t.alg);if(!l)throw new pe("invalid_request_object","Request Object JWS header is missing alg");let p;try{p=await rl(f.publicKeyJwk,l)}catch(v){throw new pe("request_signer_untrusted",`Failed to import publicKeyJwk from ${f.id}: ${jt(v)}`,{cause:v})}try{await Hp(e,p)}catch(v){throw new pe("request_signature_invalid",`JWS signature verification failed: ${jt(v)}`,{cause:v})}},"verifyWithDid"),iO=o((r,e)=>{let t=[];for(let i of r.verificationMethod??[])t.push(i);for(let i of r.authentication??[])typeof i=="object"&&t.push(i);for(let i of r.assertionMethod??[])typeof i=="object"&&t.push(i);let n=e.includes("#")?e.split("#").pop():e;return t.find(i=>i.id===e||i.id.split("#").pop()===n)},"findVerificationMethod"),aO=o(async r=>{let{jws:e,header:t,clientId:n,opts:i}=r,a=t.x5c;if(!Array.isArray(a)||a.length===0)throw new pe("invalid_request_object","Request Object JWS header is missing x5c (required for client_id_scheme=x509_san_dns)");let s;try{s=oO(a)}catch(b){throw new pe("invalid_request_object",`Failed to parse x5c chain: ${jt(b)}`,{cause:b})}let c=s[0],d=fO(n);if(!uO(c,d))throw new pe("client_id_mismatch",`Leaf certificate SAN does not cover client_id host "${d}" (sanDnsNames=${H5(c).join(",")||"none"})`);let f=i.trustedX509Roots??[],l=!!i.unsafeAllowSelfSigned;if(f.length===0&&!l)throw new pe("request_signer_untrusted","client_id_scheme=x509_san_dns requires trustedX509Roots (or unsafeAllowSelfSigned for dev)");f.length>0&&await sO(s,f);let p=h1(a[0]),v;try{v=await Zg(p,mt(t.alg)??"RS256")}catch(b){throw new pe("request_signer_untrusted",`Failed to import leaf X.509 cert: ${jt(b)}`,{cause:b})}try{await Hp(e,v)}catch(b){throw new pe("request_signature_invalid",`JWS signature verification failed: ${jt(b)}`,{cause:b})}},"verifyWithX509"),oO=o(r=>r.map(e=>new t1(h1(e))),"buildCertChain"),sO=o(async(r,e)=>{let t=e.map(i=>new t1(i));for(let i=0;i<r.length-1;i++){let a=r[i],s=r[i+1];if(!await gw(a,s))throw new pe("request_signer_untrusted",`x5c chain broken at position ${i}: cert is not signed by its successor`)}let n=r[r.length-1];if(r.length===1){let i=await mw(n);for(let a of t)if(await mw(a)===i)return;throw new pe("request_signer_untrusted","Leaf certificate is self-contained and does not match any trustedX509Roots")}for(let i of t)if(await gw(n,i))return;throw new pe("request_signer_untrusted","Top of x5c chain is not rooted in any trustedX509Roots")},"verifyChainToTrustedRoots"),gw=o(async(r,e)=>{try{return await r.verify({publicKey:e.publicKey})}catch{return!1}},"safeVerify"),mw=o(async r=>{let e=await r.getThumbprint("SHA-256"),t=new Uint8Array(e),n="";for(let i=0;i<t.length;i++)n+=t[i].toString(16).padStart(2,"0");return n},"fingerprintHex"),uO=o((r,e)=>{let t=e.toLowerCase();for(let n of H5(r))if(cO(n,t))return!0;return!1},"leafCoversHost"),H5=o(r=>{let e=r.getExtension(Ym);return e?e.names.toJSON().filter(t=>t.type==="dns").map(t=>t.value):[]},"listLeafSanDnsNames"),cO=o((r,e)=>{let t=r.toLowerCase();if(t===e)return!0;if(!t.startsWith("*."))return!1;let n=t.slice(1);if(!e.endsWith(n))return!1;let i=e.slice(0,-n.length);return i.length>0&&!i.includes(".")},"matchesDnsName"),h1=o(r=>{let e=r.replace(/\s+/g,"");return`-----BEGIN CERTIFICATE-----
26
- ${(e.match(/.{1,64}/g)??[e]).join(`
27
- `)}
28
- -----END CERTIFICATE-----
29
- `},"derToPem"),dO=o(async r=>{let{jws:e,header:t,opts:n}=r;if(!!!n.unsafeAllowSelfSigned)throw new pe("unsupported_client_id_scheme","client-id prefix=pre-registered without a registry binding requires unsafeAllowSelfSigned=true (signing key cannot be derived from client_id alone)");let a=t.x5c;if(!Array.isArray(a)||a.length===0)throw new pe("invalid_request_object","client-id prefix=pre-registered requires an x5c header to verify the signature against (no key material available otherwise)");let s=h1(a[0]),c;try{c=await Zg(s,mt(t.alg)??"RS256")}catch(d){throw new pe("request_signer_untrusted",`Failed to import leaf X.509 cert: ${jt(d)}`,{cause:d})}try{await Hp(e,c)}catch(d){throw new pe("request_signature_invalid",`JWS signature verification failed: ${jt(d)}`,{cause:d})}},"verifyWithPreRegistered"),fO=o(r=>{try{return new URL(r.includes("://")?r:`https://${r}`).hostname}catch{return r}},"hostFromClientId"),lO=o((r=globalThis.fetch)=>async e=>{if(e.startsWith("did:jwk:"))return pO(e);if(e.startsWith("did:web:"))return hO(e,r);throw new pe("did_resolution_failed",`Built-in resolver does not support ${e.split(":").slice(0,2).join(":")} \u2014 pass a custom didResolver`)},"builtInDidResolver"),pO=o(r=>{let e=r.replace(/^did:jwk:/,"").split("#")[0],t;try{let i="=".repeat((4-e.length%4)%4),a=e.replace(/-/g,"+").replace(/_/g,"/")+i;t=JSON.parse(Buffer.from(a,"base64").toString("utf8"))}catch(i){throw new pe("did_resolution_failed",`Failed to decode did:jwk identifier: ${jt(i)}`,{cause:i})}let n=`${r}#0`;return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:t}],authentication:[n],assertionMethod:[n]}},"resolveDidJwk"),hO=o(async(r,e)=>{if(typeof e!="function")throw new pe("did_resolution_failed","did:web resolution requires a fetch implementation");let n=r.replace(/^did:web:/,"").split(":").map(f=>decodeURIComponent(f)),i=n.shift(),a=n.length===0?"/.well-known/did.json":`/${n.join("/")}/did.json`,s=`https://${i}${a}`,c;try{c=await e(s,{method:"GET"})}catch(f){throw new pe("did_resolution_failed",`Failed to fetch ${s}: ${jt(f)}`,{cause:f})}if(!c.ok)throw new pe("did_resolution_failed",`${s} returned ${c.status} ${c.statusText}`);let d;try{d=await c.json()}catch(f){throw new pe("did_resolution_failed",`${s} response was not JSON: ${jt(f)}`,{cause:f})}if(!d||typeof d!="object"||Array.isArray(d))throw new pe("did_resolution_failed",`${s} response was not a DID Document object`);return d},"resolveDidWeb"),bw=o((r,e,t)=>{let n=ww(t.presentation_definition)?t.presentation_definition:void 0,i=mt(t.presentation_definition_uri),a;if(t.dcql_query!==void 0&&t.dcql_query!==null){if(n||i)throw new we("both_pex_and_dcql","Request Object claims carry both PEX (presentation_definition[_uri]) and DCQL (dcql_query); OID4VP 1.0 \xA75.3 forbids this");a=$5(t.dcql_query)}let s=ww(t.client_metadata)?t.client_metadata:void 0;return{client_id:r,client_id_scheme:e,response_type:mt(t.response_type)??"vp_token",response_mode:mt(t.response_mode),response_uri:mt(t.response_uri),redirect_uri:mt(t.redirect_uri),nonce:mt(t.nonce)??"",state:mt(t.state),presentation_definition:n,presentation_definition_uri:i,dcql_query:a,client_metadata:s,client_metadata_uri:mt(t.client_metadata_uri),scope:mt(t.scope)}},"buildRequestFromClaims"),mt=o(r=>typeof r=="string"&&r.length>0?r:void 0,"asString"),ww=o(r=>r!==null&&typeof r=="object"&&!Array.isArray(r),"isObject"),_w=o(r=>/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(r),"looksLikeJws"),Sw=o(r=>{let e="=".repeat((4-r.length%4)%4),t=r.replace(/-/g,"+").replace(/_/g,"/")+e;return Buffer.from(t,"base64").toString("utf8")},"b64urlDecode"),jt=o(r=>r instanceof Error?r.message:String(r),"describe"),F5=o(r=>{if(typeof r!="string"||r.trim().length===0)throw new we("invalid_uri","Authorization Request URI must be a non-empty string");let e=yO(r),t=e.get("request_uri");if(typeof t=="string"&&t.length>0){if(!J5(t))throw new we("invalid_uri","request_uri must be an absolute https:// URL");return{kind:"by_reference_request_uri",requestUri:t,rawParams:e}}let n=e.get("request");return typeof n=="string"&&n.length>0?{kind:"by_reference_request_jwt",jwt:n,rawParams:e}:{kind:"by_value",request:gO(e)}},"parseAuthorizationRequestUri"),vO=o(async(r,e=globalThis.fetch)=>{if(typeof e!="function")throw new we("presentation_definition_fetch_failed","No fetch implementation available to resolve presentation_definition_uri");if(!J5(r))throw new we("invalid_uri","presentation_definition_uri must be an absolute https:// URL");let t;try{t=await e(r,{method:"GET"})}catch(i){throw new we("presentation_definition_fetch_failed",`Failed to fetch presentation_definition_uri: ${mO(i)}`,{cause:i})}if(!t.ok)throw new we("presentation_definition_fetch_failed",`presentation_definition_uri returned ${t.status} ${t.statusText}`);let n;try{n=await t.json()}catch(i){throw new we("invalid_json","presentation_definition_uri response was not valid JSON",{cause:i})}return W5(n)},"resolvePresentationDefinitionByReference"),K5=o(async(r,e=globalThis.fetch,t={})=>{let n=F5(r),i;if(n.kind==="by_value")i=n.request;else{let a=n.rawParams.get("client_id")??void 0,s=n.rawParams.get("client_id_scheme")??void 0;i=await eO({requestUri:n.kind==="by_reference_request_uri"?n.requestUri:void 0,inlineJwt:n.kind==="by_reference_request_jwt"?n.jwt:void 0,urlClientId:a,urlClientIdScheme:s,fetchImpl:e,didResolver:t.didResolver,trustedX509Roots:t.trustedX509Roots,unsafeAllowSelfSigned:t.unsafeAllowSelfSigned,unsafeSkipRequestObjectSignatureVerification:t.unsafeSkipRequestObjectSignatureVerification})}if(i.presentation_definition)return i;if(i.presentation_definition_uri){let a=await vO(i.presentation_definition_uri,e);return{...i,presentation_definition:a}}return i},"resolveAuthorizationRequest"),yO=o(r=>{let e=r.indexOf("?");if(e!==-1)return new URLSearchParams(r.slice(e+1));if(r.includes("://")||/^[a-z][a-z0-9+.-]*:/i.test(r))throw new we("invalid_uri","Authorization Request URI has no query string");if(r.includes("="))return new URLSearchParams(r);throw new we("invalid_uri","Authorization Request URI has no query string")},"extractSearchParams"),gO=o(r=>{let e=r.get("client_id");if(!e)throw new we("missing_client_id","Authorization Request is missing client_id");let t=r.get("nonce");if(!t)throw new we("missing_nonce","Authorization Request is missing nonce");let n=r.get("response_type");if(!n)throw new we("missing_response_type","Authorization Request is missing response_type");let i=n.split(/\s+/).filter(Boolean),a=new Set(["vp_token","id_token"]);if(!i.some(O=>a.has(O)))throw new we("unsupported_response_type",`Authorization Request response_type "${n}" is not supported (expected vp_token and/or id_token)`);let s=r.get("response_uri")??void 0,c=r.get("redirect_uri")??void 0,d=r.get("response_mode")??void 0;if(!s&&!c)throw new we("missing_response_target","Authorization Request is missing both response_uri and redirect_uri");let f=r.get("presentation_definition"),l=r.get("presentation_definition_uri"),p=r.get("dcql_query");if(f&&l)throw new we("both_definition_and_uri","Authorization Request has both presentation_definition and presentation_definition_uri");if(p&&(f||l))throw new we("both_pex_and_dcql","Authorization Request carries both PEX (presentation_definition[_uri]) and DCQL (dcql_query); OID4VP 1.0 \xA75.3 forbids this");let v;if(f){let O;try{O=JSON.parse(f)}catch(E){throw new we("invalid_json","presentation_definition query parameter was not valid JSON",{cause:E})}v=W5(O)}let b;if(p){let O;try{O=JSON.parse(p)}catch(E){throw new we("invalid_json","dcql_query query parameter was not valid JSON",{cause:E})}b=$5(O)}let g=r.get("scope")??void 0;if(i.includes("vp_token")&&!v&&!l&&!b&&!g)throw new we("missing_presentation_definition","Authorization Request has none of presentation_definition, presentation_definition_uri, dcql_query, or scope");let w=r.get("client_metadata"),C;if(w)try{let O=JSON.parse(w);if(O&&typeof O=="object"&&!Array.isArray(O))C=O;else throw new we("invalid_json","client_metadata query parameter must be a JSON object")}catch(O){throw O instanceof we?O:new we("invalid_json","client_metadata query parameter was not valid JSON",{cause:O})}let B=new Set(["client_id","client_id_scheme","response_type","response_mode","response_uri","redirect_uri","nonce","state","presentation_definition","presentation_definition_uri","dcql_query","client_metadata","client_metadata_uri","scope"]),T={};r.forEach((O,E)=>{B.has(E)||(T[E]=O)});let{prefix:M}=C5(e,r.get("client_id_scheme")??void 0);return{client_id:e,client_id_scheme:M,response_type:n,response_mode:d,response_uri:s,redirect_uri:c,nonce:t,state:r.get("state")??void 0,presentation_definition:v,presentation_definition_uri:l??void 0,dcql_query:b,client_metadata:C,client_metadata_uri:r.get("client_metadata_uri")??void 0,scope:g,...Object.keys(T).length>0?{extra:T}:{}}},"buildRequestFromParams"),W5=o(r=>{if(!r||typeof r!="object"||Array.isArray(r))throw new we("invalid_presentation_definition","presentation_definition must be a JSON object");let e=r;if(typeof e.id!="string"||e.id.length===0)throw new we("invalid_presentation_definition","presentation_definition is missing a string `id`");if(!Array.isArray(e.input_descriptors)||e.input_descriptors.length===0)throw new we("invalid_presentation_definition","presentation_definition must declare a non-empty input_descriptors array");for(let[t,n]of e.input_descriptors.entries()){if(!n||typeof n!="object")throw new we("invalid_presentation_definition",`input_descriptors[${t}] must be an object`);let i=n;if(typeof i.id!="string"||i.id.length===0)throw new we("invalid_presentation_definition",`input_descriptors[${t}].id must be a non-empty string`);if(!i.constraints||typeof i.constraints!="object")throw new we("invalid_presentation_definition",`input_descriptors[${t}].constraints must be an object`)}return e},"validatePresentationDefinition"),J5=o(r=>{try{return new URL(r).protocol==="https:"}catch{return!1}},"isHttpsUrl"),mO=o(r=>r instanceof Error?r.message:String(r),"describe"),bO=$n(Ck()),wO=512,_O=o((r,e)=>{if(!Array.isArray(e.path)||e.path.length===0)return{matched:!1,reason:"Field has no `path[]` declared"};for(let t of e.path){let n;try{n=AO(r,t)}catch(i){return{matched:!1,reason:`JSONPath "${t}" could not be evaluated: ${IO(i)}`}}if(n.length!==0)for(let i of n){if(!e.filter)return{matched:!0,matchedPath:t,value:i};if(Dp(i,e.filter))return{matched:!0,matchedPath:t,value:i};if(Array.isArray(i)&&kO(e.filter)){for(let a of i)if(Dp(a,e.filter))return{matched:!0,matchedPath:t,value:a}}}}return e.optional?{matched:!0,reason:"Field is optional and yielded no value"}:{matched:!1,reason:e.filter?`No value from paths ${JSON.stringify(e.path)} satisfied the filter`:`None of paths ${JSON.stringify(e.path)} resolved on the candidate`}},"evaluateField"),SO=o((r,e)=>{let n=e.constraints?.fields??[],i=[];for(let a of n){let s=_O(r,a);if(i.push(s),!s.matched)return{matched:!1,descriptorId:e.id,fields:i,reason:s.reason}}return{matched:!0,descriptorId:e.id,fields:i}},"matchInputDescriptor"),AO=o((r,e)=>{if(typeof e!="string"||e.length===0)throw new Error("JSONPath must be a non-empty string");if(e!=="$"&&!e.startsWith("$"))throw new Error(`JSONPath "${e}" must start with "$"`);if(/\[\?\(/.test(e))throw new Error(`JSONPath filter expressions are not supported yet (found in "${e}")`);if(/\[\s*\d+\s*:/.test(e)||/\[\s*:\s*\d+\s*\]/.test(e))throw new Error(`JSONPath array slicing is not supported yet (found in "${e}")`);let t=EO(e),n=[r];for(let i of t){let a=[];for(let s of n)switch(i.kind){case"property":{let c=CO(s,i.name);c!==void 0&&a.push(c);break}case"index":{Array.isArray(s)&&i.index<s.length&&a.push(s[i.index]);break}case"wildcard":{if(Array.isArray(s))for(let c of s)a.push(c);else if(s&&typeof s=="object")for(let c of Object.values(s))a.push(c);break}case"descendant":{Mg(s,i.name,a);break}}n=a}return n},"queryJsonPath"),CO=o((r,e)=>{if(r!=null&&!Array.isArray(r)&&typeof r=="object")return r[e]},"getProperty"),Mg=o((r,e,t)=>{if(r!=null){if(Array.isArray(r)){for(let n of r)Mg(n,e,t);return}if(typeof r=="object"){let n=r;for(let[i,a]of Object.entries(n))i===e&&t.push(a),Mg(a,e,t)}}},"collectDescendants"),EO=o(r=>{let e=[],t=r.startsWith("$")?1:0;for(;t<r.length;){let n=r[t];if(n===".")if(r[t+1]==="."){t+=2;let i=Aw(r,t);if(!i.text)throw new Error(`Recursive descent ".." at position ${t} must be followed by a property name`);e.push({kind:"descendant",name:i.text}),t=i.next}else{if(t+=1,r[t]==="*"){e.push({kind:"wildcard"}),t+=1;continue}let i=Aw(r,t);if(!i.text)throw new Error(`Property accessor "." at position ${t} must be followed by an identifier`);e.push({kind:"property",name:i.text}),t=i.next}else if(n==="["){let i=r.indexOf("]",t+1);if(i===-1)throw new Error(`Unterminated "[" in JSONPath "${r}"`);let a=r.slice(t+1,i).trim();if(a==="*")e.push({kind:"wildcard"});else if(/^-?\d+$/.test(a))e.push({kind:"index",index:parseInt(a,10)});else if(/^'[^']*'$/.test(a)||/^"[^"]*"$/.test(a))e.push({kind:"property",name:a.slice(1,-1)});else throw new Error(`Unsupported bracket expression [${a}] in JSONPath "${r}"`);t=i+1}else throw new Error(`Unexpected character "${n}" at position ${t} in JSONPath "${r}"`)}return e},"tokenizeJsonPath"),Aw=o((r,e)=>{let t=e;for(;t<r.length;){let n=r[t];if(!/[A-Za-z0-9_\-@:]/.test(n))break;t+=1}return{text:r.slice(e,t),next:t}},"readIdentifier"),Dp=o((r,e)=>{if("type"in e&&!(Array.isArray(e.type)?e.type:[e.type]).some(i=>PO(r,i))||"const"in e&&!Mp(r,e.const))return!1;if("enum"in e){let t=e.enum;if(!Array.isArray(t)||!t.some(n=>Mp(r,n)))return!1}if("pattern"in e){if(typeof r!="string")return!1;let t=e.pattern;if(typeof t!="string"||t.length>wO||!(0,bO.default)(t))return!1;let n;try{n=new RegExp(t)}catch{return!1}try{if(!n.test(r))return!1}catch{return!1}}if(typeof r=="number"&&(typeof e.minimum=="number"&&r<e.minimum||typeof e.maximum=="number"&&r>e.maximum||typeof e.exclusiveMinimum=="number"&&r<=e.exclusiveMinimum||typeof e.exclusiveMaximum=="number"&&r>=e.exclusiveMaximum)||typeof r=="string"&&(typeof e.minLength=="number"&&r.length<e.minLength||typeof e.maxLength=="number"&&r.length>e.maxLength))return!1;if(Array.isArray(r)){if(e.contains&&typeof e.contains=="object"){let t=e.contains;if(!r.some(i=>Dp(i,t)))return!1}if(e.items&&typeof e.items=="object"&&!Array.isArray(e.items)){let t=e.items;if(!r.every(i=>Dp(i,t)))return!1}if(typeof e.minItems=="number"&&r.length<e.minItems||typeof e.maxItems=="number"&&r.length>e.maxItems)return!1}return!0},"satisfiesFilter"),kO=o(r=>{if(Ew(r,["contains","items","minItems","maxItems"]))return!1;if("type"in r){let e=Array.isArray(r.type)?r.type:[r.type];return e.length===0?!1:e.every(t=>typeof t=="string"&&xO.has(t))}return Ew(r,["pattern","minLength","maxLength","minimum","maximum","exclusiveMinimum","exclusiveMaximum"])||"const"in r&&Cw(r.const)?!0:"enum"in r&&Array.isArray(r.enum)&&r.enum.length>0?r.enum.every(Cw):!1},"expectsPrimitive"),xO=new Set(["string","number","integer","boolean","null"]),Cw=o(r=>r===null||typeof r=="string"||typeof r=="number"||typeof r=="boolean","isPrimitiveValue"),Ew=o((r,e)=>e.some(t=>t in r),"hasAnyKeyword"),PO=o((r,e)=>{switch(e){case"string":return typeof r=="string";case"number":return typeof r=="number";case"integer":return typeof r=="number"&&Number.isInteger(r);case"boolean":return typeof r=="boolean";case"null":return r===null;case"array":return Array.isArray(r);case"object":return r!==null&&typeof r=="object"&&!Array.isArray(r);default:return!1}},"matchesType"),Mp=o((r,e)=>{if(r===e)return!0;if(r===null||e===null)return r===e;if(typeof r!=typeof e)return!1;if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(!Mp(r[t],e[t]))return!1;return!0}if(typeof r=="object"){if(typeof e!="object"||Array.isArray(e))return!1;let t=r,n=e,i=Object.keys(t),a=Object.keys(n);if(i.length!==a.length)return!1;for(let s of i)if(!Mp(t[s],n[s]))return!1;return!0}return!1},"deepEqual"),IO=o(r=>r instanceof Error?r.message:String(r),"describe"),OO=o((r,e)=>{let t=r.map((s,c)=>({index:c,candidate:{...s,format:s.format??z5(s.credential)}})),n=e.input_descriptors.map(s=>{let c=[],d=s.format??e.format;for(let f of t){let{candidate:l,index:p}=f;if(d&&!NO(l.format,d))continue;let v=TO(l),b=SO(v,s);b.matched&&c.push({descriptorId:s.id,candidate:l,match:b,candidateIndex:p})}return{descriptorId:s.id,candidates:c,reason:c.length===0?jO(s,t.length,d):void 0}}),i=new Set(n.filter(s=>s.candidates.length>0).map(s=>s.descriptorId)),a=BO(e,i);return{descriptors:n,canSatisfy:a.satisfied,reason:a.satisfied?void 0:a.reason}},"selectCredentials");var z5=o(r=>{if(typeof r=="string")return/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(r)?"jwt_vc_json":void 0;if(!r||typeof r!="object")return;let t=r.proof;if(t&&typeof t=="object"){if(typeof t.jwt=="string"||t.type==="JwtProof2020")return"jwt_vc_json";if(typeof t.type=="string")return"ldp_vc"}},"inferCredentialFormat"),BO=o((r,e)=>{let t=r.submission_requirements;if(!t||t.length===0){let n=r.input_descriptors.map(i=>i.id).filter(i=>!e.has(i));return n.length===0?{satisfied:!0}:{satisfied:!1,reason:n.length===1?`Input descriptor "${n[0]}" has no matching credential`:`${n.length} input descriptors have no matching credential: ${n.join(", ")}`}}for(let n of t){let i=G5(n,r,e);if(!i.satisfied)return i}return{satisfied:!0}},"evaluateSubmissionRequirements"),G5=o((r,e,t)=>{if(typeof r.from=="string"&&r.from.length>0){let n=e.input_descriptors.filter(a=>a.group?.includes(r.from));if(n.length===0)return{satisfied:!1,reason:`submission_requirement references unknown group "${r.from}"`};let i=n.filter(a=>t.has(a.id));return kw(r,i.length,n.length)}if(Array.isArray(r.from_nested)&&r.from_nested.length>0){let n=0;for(let i of r.from_nested)G5(i,e,t).satisfied&&(n+=1);return kw(r,n,r.from_nested.length)}return{satisfied:!1,reason:"submission_requirement has neither `from` nor `from_nested`"}},"evaluateRequirement"),kw=o((r,e,t)=>{let n=r.name??r.from??"<anonymous>";return r.rule==="all"?e>=t?{satisfied:!0}:{satisfied:!1,reason:`Requirement "${n}" (rule=all) needs ${t} matches, only ${e} available`}:r.rule==="pick"?typeof r.count=="number"&&e<r.count?{satisfied:!1,reason:`Requirement "${n}" (rule=pick) needs count=${r.count} matches, only ${e} available`}:typeof r.min=="number"&&e<r.min?{satisfied:!1,reason:`Requirement "${n}" (rule=pick) needs min=${r.min} matches, only ${e} available`}:r.count===void 0&&r.min===void 0&&e===0?{satisfied:!1,reason:`Requirement "${n}" (rule=pick) needs at least one match, none available`}:{satisfied:!0}:{satisfied:!1,reason:`Unknown submission_requirement rule "${r.rule}"`}},"applyRule"),NO=o((r,e)=>r?Object.prototype.hasOwnProperty.call(e,r):!1,"formatIsPermitted"),TO=o(r=>{let{credential:e,format:t}=r;if(t==="jwt_vc_json"){if(typeof e=="string"){let n=xw(e);if(n)return n}if(e&&typeof e=="object"){let n=e.proof;if(n&&typeof n=="object"){let i=n.jwt;if(typeof i=="string"){let a=xw(i);if(a)return a}}}}return e},"decodeCandidateForMatching"),xw=o(r=>{let e=r.split(".");if(e.length===3)try{return JSON.parse(RO(e[1]))}catch{return}},"decodeJwtVc"),RO=o(r=>{let t=(r+"=".repeat((4-r.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/");return typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString("binary")},"base64UrlDecode"),jO=o((r,e,t)=>{if(e===0)return"You have no credentials in your wallet yet";let n=r.name??r.id;if(t){let i=Object.keys(t).join(", ");return`No credential satisfies "${n}" (required format: ${i})`}return`No credential satisfies "${n}"`},"explainNoMatches");var od,X5=(od=class extends Error{constructor(e,t){super(t),this.name="BuildPresentationError",this.code=e}},u(od,"_BuildPresentationError"),od);o(X5,"BuildPresentationError");var Vp=X5,Pw=o(r=>{let{pd:e,chosen:t,holder:n}=r;if(!t||t.length===0)throw new Vp("no_selections","buildPresentation requires at least one chosen credential");let i=new Set(e.input_descriptors.map(l=>l.id)),a=t.map((l,p)=>{if(!i.has(l.descriptorId))throw new Vp("unknown_descriptor",`Chosen credential at index ${p} references unknown descriptor "${l.descriptorId}"`);return{descriptorId:l.descriptorId,...LO(l.candidate,p)}}),s=r.envelopeFormat??MO(e,a.map(l=>l.format)),c=r.makeId??qO,d={"@context":["https://www.w3.org/2018/credentials/v1"],id:r.presentationId??`urn:uuid:${HO(c)}`,type:["VerifiablePresentation"],holder:n,verifiableCredential:a.map(l=>l.credential)},f={id:r.submissionId??c(),definition_id:e.id,descriptor_map:a.map((l,p)=>({id:l.descriptorId,format:l.format,path:$O(p,s)}))};return{unsignedVp:d,submission:f,vpFormat:s,innerFormats:a.map(l=>l.format)}},"buildPresentation"),LO=o((r,e)=>{let t=r.format??z5(r.credential);if(!t)throw new Vp("unknown_credential_format",`Chosen credential at index ${e} has no detectable format (provide candidate.format or a shape inferCredentialFormat recognizes)`);if(t==="jwt_vc_json"){let n=DO(r.credential);if(!n)throw new Vp("invalid_jwt_vc",`Chosen credential at index ${e} is tagged jwt_vc_json but has no compact JWS (expected a string, or an object with string \`proof.jwt\`)`);return{credential:n,format:t}}return{credential:r.credential,format:t}},"normalizeForEmbedding"),DO=o(r=>{if(typeof r=="string")return/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(r)?r:void 0;if(r&&typeof r=="object"){let e=r.proof;if(e&&typeof e=="object"){let t=e.jwt;if(typeof t=="string")return t}}},"extractCompactJws"),MO=o((r,e)=>{let t=VO(r.format),n=UO(e);return t.has("jwt_vp_json")&&!t.has("ldp_vp")?"jwt_vp_json":t.has("ldp_vp")&&!t.has("jwt_vp_json")?"ldp_vp":(t.has("jwt_vp_json")&&t.has("ldp_vp"),n)},"inferEnvelopeFormat"),VO=o(r=>{let e=new Set;return r&&("jwt_vp_json"in r&&e.add("jwt_vp_json"),"ldp_vp"in r&&e.add("ldp_vp")),e},"vpFormatsFromDesignation"),UO=o(r=>r.length===0?"ldp_vp":r.every(t=>t==="jwt_vc_json")?"jwt_vp_json":"ldp_vp","homogeneousVpFormatFromInner"),$O=o((r,e)=>e==="jwt_vp_json"?`$.vp.verifiableCredential[${r}]`:`$.verifiableCredential[${r}]`,"pathForIndex"),qO=o(()=>{let r=typeof globalThis<"u"&&"crypto"in globalThis?globalThis.crypto:void 0;if(r&&typeof r.getRandomValues=="function"){let e=new Uint8Array(8);return r.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}return Math.random().toString(36).slice(2,18)},"defaultMakeId"),HO=o(r=>{let t=(r().replace(/[^0-9a-f]/gi,"")+"0".repeat(32)).slice(0,32);return[t.slice(0,8),t.slice(8,12),"4"+t.slice(13,16),(parseInt(t.charAt(16),16)&3|8).toString(16)+t.slice(17,20),t.slice(20,32)].join("-")},"makeUuidV4"),sd,Z5=(sd=class extends Error{constructor(e,t,n){super(t),this.name="VpSignError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}},u(sd,"_VpSignError"),sd);o(Z5,"VpSignError");var jr=Z5,Kl=o(async(r,e)=>(FO(r),r.vpFormat==="jwt_vp_json"?KO(r,e):WO(r,e)),"signPresentation"),FO=o(r=>{let{unsignedVp:e,holder:t,audience:n,nonce:i}=r;if(!e||typeof e!="object")throw new jr("invalid_input","signPresentation requires an unsignedVp object");if(typeof n!="string"||n.length===0)throw new jr("invalid_input","signPresentation requires a non-empty `audience`");if(typeof i!="string"||i.length===0)throw new jr("invalid_input","signPresentation requires a non-empty `nonce`");if(typeof t!="string"||t.length===0)throw new jr("invalid_input","signPresentation requires a non-empty `holder`");if(e.holder!==void 0&&e.holder!==t)throw new jr("holder_mismatch",`unsignedVp.holder (${e.holder}) does not match options.holder (${t})`)},"validateInput"),KO=o(async(r,e)=>{if(!e.jwtSigner)throw new jr("missing_jwt_signer","vpFormat=jwt_vp_json requires helpers.jwtSigner");let t=r.iat??Math.floor(Date.now()/1e3),n={alg:e.jwtSigner.alg,kid:e.jwtSigner.kid,typ:"JWT"},i=r.jti??(typeof r.unsignedVp.id=="string"?r.unsignedVp.id:void 0),a={iss:r.holder,sub:r.holder,aud:r.audience,nonce:r.nonce,iat:t,vp:r.unsignedVp};i&&(a.jti=i);let s;try{s=await e.jwtSigner.sign(n,a)}catch(c){throw new jr("jwt_sign_failed",`Failed to sign jwt_vp_json: ${c instanceof Error?c.message:String(c)}`,{cause:c})}return{vpToken:s,vpFormat:"jwt_vp_json"}},"signJwtVp"),WO=o(async(r,e)=>{if(!e.ldpVpSigner)throw new jr("missing_ldp_signer","vpFormat=ldp_vp requires helpers.ldpVpSigner");let t;try{t=await e.ldpVpSigner.sign(r.unsignedVp,{domain:r.audience,challenge:r.nonce})}catch(n){throw new jr("ldp_sign_failed",`Failed to sign ldp_vp: ${n instanceof Error?n.message:String(n)}`,{cause:n})}return{vpToken:t,vpFormat:"ldp_vp"}},"signLdpVp"),ud,Q5=(ud=class extends Error{constructor(e,t,n={}){super(t),this.name="JarmEncryptError",this.code=e,n.cause!==void 0&&(this.cause=n.cause)}},u(ud,"_JarmEncryptError"),ud);o(Q5,"JarmEncryptError");var Nt=Q5,JO="ECDH-ES",zO="A256GCM",GO=o(async r=>{let{payload:e,clientMetadata:t,verifierNonce:n,walletNonce:i,signer:a}=r,s=t.authorization_encrypted_response_alg??JO,c=t.authorization_encrypted_response_enc??zO,d=t.authorization_signed_response_alg,f=await XO(t,r.fetchImpl),l=ZO(f,s),p,v;if(d){if(!a)throw new Nt("missing_signer",`Verifier requires authorization_signed_response_alg=${d} but no wallet signer was supplied`);let w=await QO(e,d,a);p=new TextEncoder().encode(w),v="JWT"}else p=new TextEncoder().encode(JSON.stringify(e)),v=void 0;let b;try{b=await rl(l,s)}catch(w){throw new Nt("unsupported_alg",`Failed to import verifier encryption key (alg=${s}, kty=${l.kty}): ${Qf(w)}`,{cause:w})}let g={alg:s,enc:c};typeof l.kid=="string"&&l.kid.length>0&&(g.kid=l.kid),v&&(g.cty=v);let A={apv:new TextEncoder().encode(n)};typeof i=="string"&&i.length>0&&(A.apu=new TextEncoder().encode(i));try{return await new Sx(p).setProtectedHeader(g).setKeyManagementParameters(A).encrypt(b)}catch(w){throw new Nt("encrypt_failed",`JWE encryption failed (alg=${s}, enc=${c}): ${Qf(w)}`,{cause:w})}},"encryptResponseObject"),XO=o(async(r,e)=>{if(r.jwks&&Array.isArray(r.jwks.keys))return r.jwks.keys;if(typeof r.jwks_uri=="string"&&r.jwks_uri.length>0){let t=e??globalThis.fetch;if(typeof t!="function")throw new Nt("jwks_fetch_failed",`client_metadata.jwks_uri=${r.jwks_uri} but no fetch implementation is available`);let n;try{n=await t(r.jwks_uri,{headers:{Accept:"application/json"}})}catch(a){throw new Nt("jwks_fetch_failed",`Failed to fetch jwks_uri=${r.jwks_uri}: ${Qf(a)}`,{cause:a})}if(!n.ok)throw new Nt("jwks_fetch_failed",`jwks_uri returned HTTP ${n.status} for ${r.jwks_uri}`);let i;try{i=await n.json()}catch(a){throw new Nt("invalid_jwks",`jwks_uri body was not valid JSON: ${Qf(a)}`,{cause:a})}if(!i||typeof i!="object"||!Array.isArray(i.keys))throw new Nt("invalid_jwks","jwks_uri body must be a JSON object with a `keys` array");return i.keys}throw new Nt("no_encryption_key","client_metadata declares neither inline `jwks` nor `jwks_uri` \u2014 verifier cannot receive encrypted responses")},"resolveVerifierJwks"),ZO=o((r,e)=>{if(r.length===0)throw new Nt("no_encryption_key","Verifier JWKS contained no keys");let t=r.filter(a=>a.use!=="sig");if(t.length===0)throw new Nt("no_encryption_key",'Verifier JWKS contains only `use:"sig"` keys; no encryption-capable key advertised');let n=t.find(a=>a.alg===e);if(n)return n;let i=t.find(a=>!a.alg);return i||t[0]},"pickEncryptionKey"),QO=o(async(r,e,t)=>{try{return await t.sign({alg:e,kid:t.kid,typ:"JWT"},r)}catch(n){throw new Nt("sign_failed",`Wallet signer failed during JARM inner-JWS signing: ${Qf(n)}`,{cause:n})}},"signResponse"),Qf=o(r=>r instanceof Error?r.message:String(r),"describe"),cd,Y5=(cd=class extends Error{constructor(e,t,n={}){super(t),this.name="VpSubmitError",this.code=e,this.status=n.status,this.body=n.body,n.cause!==void 0&&(this.cause=n.cause)}},u(cd,"_VpSubmitError"),cd);o(Y5,"VpSubmitError");var Br=Y5,Xv=o(async r=>{let{responseUri:e,vpToken:t,submission:n,state:i}=r;if(typeof e!="string"||e.length===0)throw new Br("invalid_input","`responseUri` must be a non-empty string");if(t==null)throw new Br("invalid_input","`vpToken` is required");if(n!==void 0&&(n===null||typeof n!="object"))throw new Br("invalid_input","`submission` must be a PresentationSubmission object when provided (omit it entirely for DCQL flows)");let a=r.fetchImpl??globalThis.fetch;if(typeof a!="function")throw new Br("no_fetch","No fetch implementation available; pass `fetchImpl` or configure the plugin with one");let c=r.responseMode==="direct_post.jwt"?await tB({vpToken:t,submission:n,state:i,idToken:r.idToken,clientMetadata:r.clientMetadata,nonce:r.nonce,signer:r.signer,fetchImpl:a}):YO({vpToken:t,submission:n,state:i,idToken:r.idToken}),d;try{d=await a(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json, text/plain;q=0.9, */*;q=0.8"},body:c})}catch(l){throw new Br("network_error",`Failed to POST to ${e}: ${l instanceof Error?l.message:String(l)}`,{cause:l})}let f=await rB(d);if(!d.ok)throw new Br("server_error",`Verifier returned ${d.status} ${d.statusText||""}`.trim(),{status:d.status,body:f});return{status:d.status,redirectUri:nB(f),body:f}},"submitPresentation"),YO=o(r=>{let e=new URLSearchParams;return e.set("vp_token",eB(r.vpToken)),r.submission&&e.set("presentation_submission",JSON.stringify(r.submission)),typeof r.idToken=="string"&&r.idToken.length>0&&e.set("id_token",r.idToken),typeof r.state=="string"&&r.state.length>0&&e.set("state",r.state),e.toString()},"encodeFormBody"),eB=o(r=>typeof r=="string"?r:JSON.stringify(r),"stringifyVpToken"),tB=o(async r=>{if(!r.clientMetadata)throw new Br("invalid_input","response_mode=direct_post.jwt requires `clientMetadata` (verifier's JWKS + JWE algs)");if(typeof r.nonce!="string"||r.nonce.length===0)throw new Br("invalid_input","response_mode=direct_post.jwt requires the verifier `nonce` for the JWE `apv` ECDH-ES KDF input");let e={vp_token:r.vpToken};r.submission&&(e.presentation_submission=r.submission),typeof r.state=="string"&&r.state.length>0&&(e.state=r.state),typeof r.idToken=="string"&&r.idToken.length>0&&(e.id_token=r.idToken);let t;try{t=await GO({payload:e,clientMetadata:r.clientMetadata,verifierNonce:r.nonce,signer:r.signer,fetchImpl:r.fetchImpl})}catch(i){throw i instanceof Nt?new Br("jarm_encrypt_failed",`Failed to build JARM response (${i.code}): ${i.message}`,{cause:i}):i}let n=new URLSearchParams;return n.set("response",t),n.toString()},"encodeJarmBody"),rB=o(async r=>{let e=await r.text().catch(()=>"");if(!e)return;if((r.headers.get("content-type")??"").includes("application/json"))try{return JSON.parse(e)}catch{return e}try{return JSON.parse(e)}catch{return e}},"parseResponseBody"),nB=o(r=>{if(r&&typeof r=="object"){let e=r.redirect_uri;if(typeof e=="string"&&e.length>0)return e}},"extractRedirectUri"),dd,e8=(dd=class extends Error{constructor(e,t,n){super(t),this.name="SiopSignError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}},u(dd,"_SiopSignError"),dd);o(e8,"SiopSignError");var _f=e8,Iw=o(async(r,e)=>{iB(r,e);let{holder:t,audience:n,nonce:i}=r,a=r.iat??Math.floor(Date.now()/1e3),s=a+(r.lifetimeSeconds??300),c=r.issuerMode??"did",d={alg:e.signer.alg,kid:e.signer.kid,typ:"JWT"},f={iss:c==="did"?t:"https://self-issued.me/v2",sub:t,aud:n,nonce:i,iat:a,exp:s};r.vpTokenHash&&(f._vp_token={vp_token_hash:r.vpTokenHash});let l;try{l=await e.signer.sign(d,f)}catch(p){throw new _f("id_token_sign_failed",`Failed to sign SIOPv2 id_token: ${p instanceof Error?p.message:String(p)}`,{cause:p})}return{idToken:l}},"signIdToken"),iB=o((r,e)=>{if(!e.signer)throw new _f("missing_signer","signIdToken requires helpers.signer");if(typeof r.holder!="string"||r.holder.length===0)throw new _f("invalid_input","signIdToken requires a non-empty `holder`");if(typeof r.audience!="string"||r.audience.length===0)throw new _f("invalid_input","signIdToken requires a non-empty `audience`");if(typeof r.nonce!="string"||r.nonce.length===0)throw new _f("invalid_input","signIdToken requires a non-empty `nonce`")},"validateInput"),aB=o(r=>r?new Set(r.split(/\s+/).filter(Boolean)):new Set,"responseTypeSet"),oB=o(r=>aB(r).has("id_token"),"requiresIdToken"),sB=o(r=>{let e=r.format??fB(r.credential);if(e==="jwt_vc_json")return cB(r.credential);if(e==="ldp_vc")return dB(r.credential)},"adaptCredentialForDcql"),uB=o(r=>{let e=[];for(let t of r){let n=sB(t);n&&e.push({original:t,adapted:n})}return e},"adaptCredentialsForDcql"),cB=o(r=>{let e;if(typeof r=="string")e=Ow(r);else if(r&&typeof r=="object"){let a=r.proof;if(a&&typeof a=="object"){let s=a.jwt;typeof s=="string"&&(e=Ow(s))}}if(!e)return;let t=e.vc;if(!t||typeof t!="object"||Array.isArray(t))return;let n=t,i=t8(n.type);if(i.length!==0)return{credential_format:"jwt_vc_json",type:i,claims:n,cryptographic_holder_binding:!0}},"adaptJwtVc"),dB=o(r=>{if(!r||typeof r!="object"||Array.isArray(r))return;let e=r,t=t8(e.type);if(t.length!==0)return{credential_format:"ldp_vc",type:t,claims:e,cryptographic_holder_binding:!0}},"adaptLdpVc"),t8=o(r=>Array.isArray(r)?r.filter(e=>typeof e=="string"):typeof r=="string"?[r]:[],"extractTypes"),fB=o(r=>{if(typeof r=="string")return/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(r)?"jwt_vc_json":void 0;if(r&&typeof r=="object"&&!Array.isArray(r)){let e=r.proof;if(e&&typeof e=="object")return e.type==="JwtProof2020"?"jwt_vc_json":"ldp_vc"}},"inferDcqlFormat"),Ow=o(r=>{let e=r.split(".");if(e.length===3)try{let t=JSON.parse(lB(e[1]));return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}catch{return}},"decodeJwtPayload"),lB=o(r=>{let t=(r+"=".repeat((4-r.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/");return typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString("binary")},"base64UrlDecode"),pB=o((r,e)=>{let t=uB(r),n=t.map(s=>s.adapted),i=Zf.query(e,n),a={};for(let[s,c]of Object.entries(i.credential_matches)){if(c.success){let d=c.valid_credentials.map(f=>t[f.input_credential_index]?.original).filter(f=>f!==void 0);a[s]={credentialQueryId:s,candidates:d};continue}a[s]={credentialQueryId:s,candidates:[],reason:`No held credential satisfies query "${s}"`}}return{canSatisfy:i.can_be_satisfied,matches:a,reason:i.can_be_satisfied?void 0:"No combination of held credentials satisfies the verifier's DCQL query",raw:i}},"selectCredentialsForDcql"),fd,r8=(fd=class extends Error{constructor(e,t){super(t),this.name="BuildDcqlPresentationError",this.code=e}},u(fd,"_BuildDcqlPresentationError"),fd);o(r8,"BuildDcqlPresentationError");var Yf=r8,hB=o(r=>{let{query:e,chosen:t,holder:n}=r;if(t.length===0)throw new Yf("no_selections","buildDcqlPresentations requires at least one chosen credential");let i=r.makeId??mB,a=new Map;for(let d of t){let f=a.get(d.credentialQueryId);f?f.push(d.candidate):a.set(d.credentialQueryId,[d.candidate])}let s=new Map;for(let d of e.credentials)s.set(d.id,d);let c=[];for(let d of e.credentials){let f=a.get(d.id);f&&(c.push(vB(d,f,n,i)),a.delete(d.id))}if(a.size>0){let d=Array.from(a.keys()).join(", ");throw new Yf("unknown_credential_query",`chosen credentials reference query ids the DCQL query doesn't declare: ${d}`)}return c},"buildDcqlPresentations"),vB=o((r,e,t,n)=>{let i=yB(r.format,r.id),a=e.map((c,d)=>gB(c,r.id,d)),s={"@context":["https://www.w3.org/2018/credentials/v1"],id:`urn:uuid:${bB(n)}`,type:["VerifiablePresentation"],holder:t,verifiableCredential:a};return{credentialQueryId:r.id,unsignedVp:s,vpFormat:i,candidates:e}},"buildOnePresentation"),yB=o((r,e)=>{if(r==="jwt_vc_json")return"jwt_vp_json";if(r==="ldp_vc")return"ldp_vp";throw new Yf("unsupported_format",`DCQL query "${e}" requests format "${r}", which the plugin doesn't yet build presentations for (sd-jwt-vc and mso_mdoc are tracked for follow-up slices)`)},"vpFormatForQueryFormat"),gB=o((r,e,t)=>{let n=r.credential;if(typeof n=="string"){if(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(n))return n;throw new Yf("invalid_jwt_vc",`chosen candidate at index ${t} for query "${e}" is a string but not a compact JWS`)}if(n&&typeof n=="object"){let i=n.proof;if(i&&typeof i=="object"){let a=i.jwt;if(typeof a=="string")return a}return n}throw new Yf("invalid_jwt_vc",`chosen candidate at index ${t} for query "${e}" is neither a JWT string nor a JSON object`)},"normalizeForEmbedding"),mB=o(()=>{let r=typeof globalThis<"u"&&"crypto"in globalThis?globalThis.crypto:void 0;if(r&&typeof r.getRandomValues=="function"){let e=new Uint8Array(8);return r.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}return Math.random().toString(36).slice(2,18)},"defaultMakeId"),bB=o(r=>{let t=(r().replace(/[^0-9a-f]/gi,"")+"0".repeat(32)).slice(0,32);return[t.slice(0,8),t.slice(8,12),"4"+t.slice(13,16),(parseInt(t.slice(16,17),16)&3|8).toString(16)+t.slice(17,20),t.slice(20,32)].join("-")},"makeUuidV4"),wB=o(async(r,e)=>{let t=[];for(let n of r.built){let i=await Kl({unsignedVp:n.unsignedVp,vpFormat:n.vpFormat,audience:r.audience,nonce:r.nonce,holder:r.holder,iat:r.iat},e);t.push({credentialQueryId:n.credentialQueryId,vpToken:i.vpToken,vpFormat:n.vpFormat})}return t},"signDcqlPresentations"),_B=o(async(r,e)=>{let t=await wB(r,e);return{vpToken:SB(t),presentations:t}},"buildDcqlResponse"),SB=o(r=>{let e={};for(let t of r)e[t.credentialQueryId]=t.vpToken;return e},"assembleDcqlVpToken"),pn=o((r,e={})=>{let t=e.fetch??globalThis.fetch,n={didResolver:e.didResolver,trustedX509Roots:e.trustedX509Roots,unsafeAllowSelfSigned:e.unsafeAllowSelfSignedRequestObject,unsafeSkipRequestObjectSignatureVerification:e.unsafeSkipRequestObjectSignatureVerification},i=o(async a=>{let s=T1(a);if(s.kind==="by_value")return s.offer;if(typeof t!="function")throw new Ge("invalid_uri","No fetch implementation available; pass `config.fetch` to getOpenID4VCPlugin()");let c=await Ek(s.uri,t);if(c.kind!=="by_value")throw new Ge("invalid_uri","Unexpected by_reference result after resolving credential_offer_uri");return c.offer},"resolveOffer");return{name:"OpenID4VC",displayName:"OpenID4VC",description:"OpenID for Verifiable Credentials holder support \u2014 Credential Offers, VCI, VP, and SIOPv2.",methods:{parseCredentialOffer:o((a,s)=>T1(s),"parseCredentialOffer"),resolveCredentialOffer:o(async(a,s)=>i(s),"resolveCredentialOffer"),acceptCredentialOffer:o(async(a,s,c={})=>{let d=typeof s=="string"?await i(s):s,f=await ey(a,c);return M1({offer:d,signer:f,options:c,fetchImpl:t})},"acceptCredentialOffer"),acceptAndStoreCredentialOffer:o(async(a,s,c={})=>{let d=await(async()=>{let l=typeof s=="string"?await i(s):s,p=await ey(a,c);return M1({offer:l,signer:p,options:c,fetchImpl:t})})(),f=await e6(a,d,EB(c));return{...d,...f}},"acceptAndStoreCredentialOffer"),beginCredentialOfferAuthCode:o(async(a,s,c)=>{let d=typeof s=="string"?await i(s):s;return Mx({offer:d,redirectUri:c.redirectUri,clientId:c.clientId,configurationIds:c.configurationIds,scope:c.scope,fetchImpl:t})},"beginCredentialOfferAuthCode"),completeCredentialOfferAuthCode:o(async(a,s)=>{let c=s.signer??await ey(a,{});return Vx({flowHandle:s.flowHandle,code:s.code,state:s.state,signer:c,fetchImpl:t})},"completeCredentialOfferAuthCode"),parseAuthorizationRequest:o((a,s)=>F5(s),"parseAuthorizationRequest"),resolveAuthorizationRequest:o(async(a,s)=>K5(s,t,n),"resolveAuthorizationRequest"),prepareVerifiablePresentation:o(async(a,s,c)=>{let d=await ei(s,t,n);if(d.dcql_query){let f=pB(c,d.dcql_query);return{request:d,dcqlSelection:f}}if(d.presentation_definition){let f=OO(c,d.presentation_definition);return{request:d,selection:f}}return{request:d,selection:{descriptors:[],canSatisfy:!0,reason:void 0}}},"prepareVerifiablePresentation"),buildPresentation:o(async(a,s,c,d={})=>{let f=await ei(s,t,n),l=Bw(f),p=d.holder??a.id.did(),v=Pw({pd:l,chosen:c,holder:p,envelopeFormat:d.envelopeFormat});return{request:f,prepared:v}},"buildPresentation"),signPresentation:o(async(a,s,c,d={})=>{let f=await ei(s,t,n),l=d.holder??(typeof c.unsignedVp.holder=="string"?c.unsignedVp.holder:a.id.did());if(c.vpFormat==="jwt_vp_json"){let p=d.signer??await Wl(a);return Kl({unsignedVp:c.unsignedVp,vpFormat:c.vpFormat,audience:f.client_id,nonce:f.nonce,holder:l},{jwtSigner:p})}return Kl({unsignedVp:c.unsignedVp,vpFormat:c.vpFormat,audience:f.client_id,nonce:f.nonce,holder:l},{ldpVpSigner:Yv(a)})},"signPresentation"),submitPresentation:o(async(a,s,c,d,f={})=>{let l=await ei(s,t,n),p=l.response_uri??l.redirect_uri;if(!p)throw new Error("Authorization Request has no response_uri / redirect_uri \u2014 cannot submitPresentation");return Xv({responseUri:p,vpToken:c.vpToken,submission:d,idToken:f.idToken,state:l.state,fetchImpl:t,...Zv(l,await Qv(a,l))})},"submitPresentation"),signIdToken:o(async(a,s,c={})=>{let d=await ei(s,t,n),f=c.holder??a.id.did(),l=c.signer??await Wl(a);return Iw({holder:f,audience:d.client_id,nonce:d.nonce,lifetimeSeconds:c.lifetimeSeconds,issuerMode:c.issuerMode,vpTokenHash:c.vpTokenHash},{signer:l})},"signIdToken"),presentCredentials:o(async(a,s,c,d={})=>{let f=await ei(s,t,n),l=d.holder??a.id.did(),p=d.signer,v=o(async()=>(p||(p=await Wl(a)),p),"ensureSharedJwtSigner"),b=o(async()=>{if(oB(f.response_type))return Iw({holder:l,audience:f.client_id,nonce:f.nonce},{signer:await v()})},"signIdTokenIfRequested"),g=f.response_uri??f.redirect_uri;if(!g)throw new Error("Authorization Request has no response_uri / redirect_uri \u2014 cannot presentCredentials");if(f.dcql_query){let E=CB(c),P=hB({query:f.dcql_query,chosen:E,holder:l}),L=P.some(Pe=>Pe.vpFormat==="jwt_vp_json"),V=P.some(Pe=>Pe.vpFormat==="ldp_vp"),Y={...L?{jwtSigner:await v()}:{},...V?{ldpVpSigner:Yv(a)}:{}},oe=await _B({built:P,audience:f.client_id,nonce:f.nonce,holder:l},Y),be=await b(),Oe=await Xv({responseUri:g,vpToken:oe.vpToken,idToken:be?.idToken,state:f.state,fetchImpl:t,...Zv(f,await Qv(a,f))});return{request:f,dcqlBuilt:P,dcqlSigned:oe.presentations,dcqlVpToken:oe.vpToken,signedIdToken:be,submitted:Oe}}let A=Bw(f),w=AB(c),C=Pw({pd:A,chosen:w,holder:l,envelopeFormat:d.envelopeFormat}),B=C.vpFormat==="jwt_vp_json"?{jwtSigner:await v()}:{ldpVpSigner:Yv(a)},T=await Kl({unsignedVp:C.unsignedVp,vpFormat:C.vpFormat,audience:f.client_id,nonce:f.nonce,holder:l},B),M=await b(),O=await Xv({responseUri:g,vpToken:T.vpToken,submission:C.submission,idToken:M?.idToken,state:f.state,fetchImpl:t,...Zv(f,await Qv(a,f))});return{request:f,prepared:C,signed:T,signedIdToken:M,submitted:O}},"presentCredentials")}}},"getOpenID4VCPlugin"),ei=o(async(r,e,t)=>typeof r=="string"?await K5(r,e,t):r,"resolveRequestInput"),Bw=o(r=>{if(!r.presentation_definition)throw new Error("Authorization Request has no presentation_definition \u2014 cannot build a VP");return r.presentation_definition},"requirePresentationDefinition"),AB=o(r=>{for(let[e,t]of r.entries())if(!("descriptorId"in t)||typeof t.descriptorId!="string")throw new Error(`chosen[${e}] is missing 'descriptorId' \u2014 PEX requests need ChosenCredential entries (received DCQL-shape entry with credentialQueryId="${t.credentialQueryId}")`);return r},"assertPexChosen"),CB=o(r=>{for(let[e,t]of r.entries())if(!("credentialQueryId"in t)||typeof t.credentialQueryId!="string")throw new Error(`chosen[${e}] is missing 'credentialQueryId' \u2014 DCQL requests need DcqlChosenCredential entries (received PEX-shape entry with descriptorId="${t.descriptorId}")`);return r},"assertDcqlChosen"),Zv=o((r,e)=>r.response_mode!=="direct_post.jwt"?{}:{responseMode:"direct_post.jwt",clientMetadata:r.client_metadata,nonce:r.nonce,signer:e},"buildJarmOptions"),Qv=o(async(r,e)=>{if(e.response_mode!=="direct_post.jwt")return;let t=e.client_metadata?.authorization_signed_response_alg;if(!(typeof t!="string"||t.length===0))return Wl(r)},"maybeJarmSigner"),Wl=o(async r=>{let e=n8(r,"VP signing"),t=r.id.did(),n=await r.invoke.didToVerificationMethod(t);return i_({keypair:e,kid:n})},"ensureVpJwtSigner"),Yv=o(r=>({sign:o(async(e,{domain:t,challenge:n})=>r.invoke.issuePresentation(e,{domain:t,challenge:n}),"sign")}),"buildLdpVpSigner"),ey=o(async(r,e)=>{if(e.signer)return e.signer;let t=n8(r,"VCI proof-of-possession"),n=r.id.did(),i=await r.invoke.didToVerificationMethod(n);return i_({keypair:t,kid:i})},"ensureSigner"),n8=o((r,e)=>{let t;try{t=r.id.keypair("ed25519")}catch(n){throw new Error(`OpenID4VC ${e} requires an Ed25519 keypair on the host LearnCard, but \`id.keypair('ed25519')\` threw: ${n instanceof Error?n.message:String(n)}. Pass \`options.signer\` to bring your own signer (HSM / secp256k1 / external backend).`)}if(!t||t.kty!=="OKP"||t.crv!=="Ed25519")throw new Error(`OpenID4VC ${e} requires an Ed25519 keypair, but the host LearnCard returned ${t?`kty=${t.kty} crv=${t.crv??"<none>"}`:"no keypair"}. Pass \`options.signer\` to bring your own signer (HSM / secp256k1 / external backend).`);return t},"requireEd25519Keypair"),EB=o(r=>({storage:r.storage,encrypt:r.encrypt,category:r.category,title:r.title,imgUrl:r.imgUrl,upload:r.upload,addToIndex:r.addToIndex,makeId:r.makeId}),"splitStoreOptions");var hn={infuraProjectId:"",network:"mainnet"};var v1=u(async({seed:r,cloud:{url:e="https://cloud.learncard.com/trpc",unencryptedFields:t=[],unencryptedCustomFields:n=[],automaticallyAssociateDids:i=!0}={},didkit:a,allowRemoteContexts:s=!1,ethereumConfig:c=hn,openid4vc:d,debug:f})=>{let p=await(await(await(0,i8.generateLearnCard)({debug:f})).addPlugin(a8.DynamicLoaderPlugin)).addPlugin(o8.CryptoPlugin),v=u(async()=>a==="node"?(await import("@learncard/didkit-plugin-node")).getDidKitPlugin:s8.getDidKitPlugin,"getDidkit"),b=await p.addPlugin(await(await v())(a==="node"?void 0:a,s)),g=await b.addPlugin(await(0,u8.getDidKeyPlugin)(b,r,"key")),A=await g.addPlugin(await(0,c8.getEncryptionPlugin)(g)),C=await(await A.addPlugin((0,d8.getVCPlugin)(A))).addPlugin((0,f8.getVCTemplatesPlugin)()),B=await C.addPlugin(await(0,l8.getLearnCloudPlugin)(C,e,t,n,i)),T=await B.addPlugin((0,p8.expirationPlugin)(B)),M=await T.addPlugin((0,h8.getEthereumPlugin)(T,c)),E=await(await M.addPlugin((0,v8.getVpqrPlugin)(M))).addPlugin(await(0,y8.getCHAPIPlugin)()),P=await E.addPlugin((0,g8.getLearnCardPlugin)(E));return P.addPlugin(pn(P,d))},"learnCardFromSeed");var m8=require("@learncard/core"),b8=require("@learncard/dynamic-loader-plugin"),w8=require("@learncard/crypto-plugin"),_8=require("@learncard/didkit-plugin"),S8=require("@learncard/didkey-plugin"),A8=require("@learncard/encryption-plugin"),C8=require("@learncard/vc-plugin"),E8=require("@learncard/vc-templates-plugin"),k8=require("@learncard/learn-cloud-plugin"),x8=require("@learncard/expiration-plugin"),P8=require("@learncard/ethereum-plugin"),I8=require("@learncard/vpqr-plugin"),O8=require("@learncard/chapi-plugin"),Th=require("@learncard/network-plugin"),B8=require("@learncard/learn-card-plugin");var y1=u(async({seed:r,network:e,trustedBoostRegistry:t="https://raw.githubusercontent.com/learningeconomy/registries/main/learncard/trusted-app-registry.json",guardianApprovalGetter:n,extraHeaders:i,cloud:{url:a="https://cloud.learncard.com/trpc",unencryptedFields:s=[],unencryptedCustomFields:c=[],automaticallyAssociateDids:d=!0}={},didkit:f,allowRemoteContexts:l=!1,ethereumConfig:p=hn,openid4vc:v,debug:b})=>{let g=typeof e=="boolean"?"https://network.learncard.com/trpc":e,w=await(await(await(0,m8.generateLearnCard)({debug:b})).addPlugin(b8.DynamicLoaderPlugin)).addPlugin(w8.CryptoPlugin),C=u(async()=>f==="node"?(await import("@learncard/didkit-plugin-node")).getDidKitPlugin:_8.getDidKitPlugin,"getDidkit"),B=await w.addPlugin(await(await C())(f==="node"?void 0:f,l)),T=await B.addPlugin(await(0,S8.getDidKeyPlugin)(B,r,"key")),M=await T.addPlugin(await(0,A8.getEncryptionPlugin)(T)),E=await(await M.addPlugin((0,C8.getVCPlugin)(M))).addPlugin((0,E8.getVCTemplatesPlugin)()),P=await E.addPlugin(await(0,k8.getLearnCloudPlugin)(E,a,s,c,d)),L=await P.addPlugin((0,x8.expirationPlugin)(P)),V=await L.addPlugin((0,P8.getEthereumPlugin)(L,p)),oe=await(await V.addPlugin((0,I8.getVpqrPlugin)(V))).addPlugin(await(0,O8.getCHAPIPlugin)()),be=await oe.addPlugin(await(0,Th.getVerifyBoostPlugin)(oe,t)),Oe=await be.addPlugin((0,B8.getLearnCardPlugin)(be)),Pe=await Oe.addPlugin(await(0,Th.getLearnCardNetworkPlugin)(Oe,g,{guardianApprovalGetter:n,extraHeaders:i}));return Pe.addPlugin(pn(Pe,v))},"networkLearnCardFromSeed");var N8=require("@learncard/core"),T8=require("@learncard/dynamic-loader-plugin"),R8=require("@learncard/crypto-plugin"),j8=require("@learncard/didkit-plugin"),L8=require("@learncard/didkey-plugin"),D8=require("@learncard/encryption-plugin"),M8=require("@learncard/vc-plugin"),V8=require("@learncard/vc-templates-plugin"),U8=require("@learncard/learn-cloud-plugin"),$8=require("@learncard/expiration-plugin"),q8=require("@learncard/ethereum-plugin"),H8=require("@learncard/vpqr-plugin"),F8=require("@learncard/chapi-plugin"),K8=require("@learncard/learn-card-plugin"),W8=require("@learncard/did-web-plugin");var g1=u(async({seed:r,didWeb:e,cloud:{url:t="https://cloud.learncard.com/trpc",unencryptedFields:n=[],unencryptedCustomFields:i=[],automaticallyAssociateDids:a=!0}={},didkit:s,allowRemoteContexts:c=!1,ethereumConfig:d=hn,openid4vc:f,debug:l})=>{let v=await(await(await(0,N8.generateLearnCard)({debug:l})).addPlugin(T8.DynamicLoaderPlugin)).addPlugin(R8.CryptoPlugin),b=u(async()=>s==="node"?(await import("@learncard/didkit-plugin-node")).getDidKitPlugin:j8.getDidKitPlugin,"getDidkit"),g=await v.addPlugin(await(await b())(s==="node"?void 0:s,c)),A=await g.addPlugin(await(0,L8.getDidKeyPlugin)(g,r,"key")),w=await A.addPlugin(await(0,D8.getEncryptionPlugin)(A)),B=await(await w.addPlugin((0,M8.getVCPlugin)(w))).addPlugin((0,V8.getVCTemplatesPlugin)()),T=await B.addPlugin(await(0,U8.getLearnCloudPlugin)(B,t,n,i,a)),M=await T.addPlugin((0,$8.expirationPlugin)(T)),O=await M.addPlugin((0,q8.getEthereumPlugin)(M,d)),P=await(await O.addPlugin((0,H8.getVpqrPlugin)(O))).addPlugin(await(0,F8.getCHAPIPlugin)()),L=await P.addPlugin((0,K8.getLearnCardPlugin)(P)),V=await L.addPlugin(await(0,W8.getDidWebPlugin)(L,e));return V.addPlugin(pn(V,f))},"didWebLearnCardFromSeed");var J8=require("@learncard/core"),z8=require("@learncard/dynamic-loader-plugin"),G8=require("@learncard/crypto-plugin"),X8=require("@learncard/didkit-plugin"),Z8=require("@learncard/didkey-plugin"),Q8=require("@learncard/encryption-plugin"),Y8=require("@learncard/vc-plugin"),eE=require("@learncard/vc-templates-plugin"),tE=require("@learncard/learn-cloud-plugin"),rE=require("@learncard/expiration-plugin"),nE=require("@learncard/ethereum-plugin"),iE=require("@learncard/vpqr-plugin"),aE=require("@learncard/chapi-plugin"),Rh=require("@learncard/network-plugin"),oE=require("@learncard/learn-card-plugin"),sE=require("@learncard/did-web-plugin");var m1=u(async({seed:r,didWeb:e,network:t,trustedBoostRegistry:n="https://raw.githubusercontent.com/learningeconomy/registries/main/learncard/trusted-app-registry.json",guardianApprovalGetter:i,extraHeaders:a,cloud:{url:s="https://cloud.learncard.com/trpc",unencryptedFields:c=[],unencryptedCustomFields:d=[],automaticallyAssociateDids:f=!0}={},didkit:l,allowRemoteContexts:p=!1,ethereumConfig:v=hn,openid4vc:b,debug:g})=>{let A=typeof t=="boolean"?"https://network.learncard.com/trpc":t,C=await(await(await(0,J8.generateLearnCard)({debug:g})).addPlugin(z8.DynamicLoaderPlugin)).addPlugin(G8.CryptoPlugin),B=u(async()=>l==="node"?(await import("@learncard/didkit-plugin-node")).getDidKitPlugin:X8.getDidKitPlugin,"getDidkit"),T=await C.addPlugin(await(await B())(l==="node"?void 0:l,p)),M=await T.addPlugin(await(0,Z8.getDidKeyPlugin)(T,r,"key")),O=await M.addPlugin(await(0,Q8.getEncryptionPlugin)(M)),P=await(await O.addPlugin((0,Y8.getVCPlugin)(O))).addPlugin((0,eE.getVCTemplatesPlugin)()),L=await P.addPlugin(await(0,tE.getLearnCloudPlugin)(P,s,c,d,f)),V=await L.addPlugin((0,rE.expirationPlugin)(L)),Y=await V.addPlugin((0,nE.getEthereumPlugin)(V,v)),be=await(await Y.addPlugin((0,iE.getVpqrPlugin)(Y))).addPlugin(await(0,aE.getCHAPIPlugin)()),Oe=await be.addPlugin(await(0,Rh.getVerifyBoostPlugin)(be,n)),Pe=await Oe.addPlugin((0,oE.getLearnCardPlugin)(Oe)),Je=await Pe.addPlugin(await(0,sE.getDidWebPlugin)(Pe,e)),Me=await Je.addPlugin(await(0,Rh.getLearnCardNetworkPlugin)(Je,A,{guardianApprovalGetter:i,extraHeaders:a}));return Me.addPlugin(pn(Me,b))},"didWebNetworkLearnCardFromSeed");var uE=require("@learncard/core"),cE=require("@learncard/dynamic-loader-plugin"),dE=require("@learncard/crypto-plugin"),fE=require("@learncard/didkit-plugin"),lE=require("@learncard/vc-plugin"),pE=require("@learncard/vc-templates-plugin"),hE=require("@learncard/expiration-plugin"),vE=require("@learncard/vpqr-plugin"),yE=require("@learncard/chapi-plugin"),jh=require("@learncard/network-plugin"),gE=require("@learncard/learn-card-plugin");var b1=u(async({apiKey:r,network:e,trustedBoostRegistry:t="https://raw.githubusercontent.com/learningeconomy/registries/main/learncard/trusted-app-registry.json",guardianApprovalGetter:n,extraHeaders:i,didkit:a,allowRemoteContexts:s=!1,debug:c})=>{let d=typeof e=="boolean"?"https://network.learncard.com/trpc":e,l=await(await(await(0,uE.generateLearnCard)({debug:c})).addPlugin(cE.DynamicLoaderPlugin)).addPlugin(dE.CryptoPlugin),p=u(async()=>a==="node"?(await import("@learncard/didkit-plugin-node")).getDidKitPlugin:fE.getDidKitPlugin,"getDidkit"),v=await l.addPlugin(await(await p())(a==="node"?void 0:a,s)),g=await(await v.addPlugin((0,lE.getVCPlugin)(v))).addPlugin((0,pE.getVCTemplatesPlugin)()),A=await g.addPlugin((0,hE.expirationPlugin)(g)),C=await(await A.addPlugin((0,vE.getVpqrPlugin)(A))).addPlugin(await(0,yE.getCHAPIPlugin)()),B=await C.addPlugin(await(0,jh.getVerifyBoostPlugin)(C,t)),T=await B.addPlugin((0,gE.getLearnCardPlugin)(B));return T.addPlugin(await(0,jh.getLearnCardNetworkPlugin)(T,d,r,{guardianApprovalGetter:n,extraHeaders:i}))},"networkLearnCardFromApiKey");var mE=require("@learncard/core"),bE=require("@learncard/crypto-plugin"),wE=require("@learncard/vc-api-plugin"),_E=require("@learncard/expiration-plugin"),SE=require("@learncard/vc-templates-plugin"),AE=require("@learncard/chapi-plugin"),CE=require("@learncard/learn-card-plugin");var w1=u(async({url:r,did:e,debug:t})=>{let i=await(await(await(0,mE.generateLearnCard)({debug:t})).addPlugin(bE.CryptoPlugin)).addPlugin(await(0,wE.getVCAPIPlugin)({url:r,did:e})),c=await(await(await i.addPlugin((0,_E.expirationPlugin)(i))).addPlugin((0,SE.getVCTemplatesPlugin)())).addPlugin(await(0,AE.getCHAPIPlugin)());return c.addPlugin((0,CE.getLearnCardPlugin)(c))},"learnCardFromApiUrl");async function kB(r={}){if("custom"in r)return Lh({debug:r.debug});if("vcApi"in r){let{vcApi:e,did:t,debug:n}=r;return w1({url:typeof e=="string"?e:"https://bridge.learncard.com",did:e===!0?"did:key:z6MkjSz4mYqcn7dePGuktJ5PxecMkXQQHWRg8Lm6okATyFVh":t,debug:n})}return"apiKey"in r?b1(r):"seed"in r?"network"in r?"didWeb"in r?m1(r):y1(r):"didWeb"in r?g1(r):v1(r):Dh(r)}u(kB,"initLearnCard");
30
- /*! Bundled license information:
31
-
32
- reflect-metadata/Reflect.js:
33
- (*! *****************************************************************************
34
- Copyright (C) Microsoft. All rights reserved.
35
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
36
- this file except in compliance with the License. You may obtain a copy of the
37
- License at http://www.apache.org/licenses/LICENSE-2.0
38
-
39
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
40
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
41
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
42
- MERCHANTABLITY OR NON-INFRINGEMENT.
43
-
44
- See the Apache Version 2.0 License for specific language governing permissions
45
- and limitations under the License.
46
- ***************************************************************************** *)
47
-
48
- pvtsutils/build/index.js:
49
- (*!
50
- * MIT License
51
- *
52
- * Copyright (c) 2017-2024 Peculiar Ventures, LLC
53
- *
54
- * Permission is hereby granted, free of charge, to any person obtaining a copy
55
- * of this software and associated documentation files (the "Software"), to deal
56
- * in the Software without restriction, including without limitation the rights
57
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
58
- * copies of the Software, and to permit persons to whom the Software is
59
- * furnished to do so, subject to the following conditions:
60
- *
61
- * The above copyright notice and this permission notice shall be included in all
62
- * copies or substantial portions of the Software.
63
- *
64
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
66
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
67
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
68
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
69
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
70
- * SOFTWARE.
71
- *
72
- *)
73
-
74
- asn1js/build/index.es.js:
75
- (*!
76
- * Copyright (c) 2014, GMO GlobalSign
77
- * Copyright (c) 2015-2022, Peculiar Ventures
78
- * All rights reserved.
79
- *
80
- * Author 2014-2019, Yury Strozhevsky
81
- *
82
- * Redistribution and use in source and binary forms, with or without modification,
83
- * are permitted provided that the following conditions are met:
84
- *
85
- * * Redistributions of source code must retain the above copyright notice, this
86
- * list of conditions and the following disclaimer.
87
- *
88
- * * Redistributions in binary form must reproduce the above copyright notice, this
89
- * list of conditions and the following disclaimer in the documentation and/or
90
- * other materials provided with the distribution.
91
- *
92
- * * Neither the name of the copyright holder nor the names of its
93
- * contributors may be used to endorse or promote products derived from
94
- * this software without specific prior written permission.
95
- *
96
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
97
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
98
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
99
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
100
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
101
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
102
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
103
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
104
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
105
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
106
- *
107
- *)
108
-
109
- tslib/tslib.es6.js:
110
- (*! *****************************************************************************
111
- Copyright (c) Microsoft Corporation.
112
-
113
- Permission to use, copy, modify, and/or distribute this software for any
114
- purpose with or without fee is hereby granted.
115
-
116
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
117
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
118
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
119
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
120
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
121
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
122
- PERFORMANCE OF THIS SOFTWARE.
123
- ***************************************************************************** *)
124
-
125
- @peculiar/x509/build/x509.es.js:
126
- (*!
127
- * MIT License
128
- *
129
- * Copyright (c) Peculiar Ventures. All rights reserved.
130
- *
131
- * Permission is hereby granted, free of charge, to any person obtaining a copy
132
- * of this software and associated documentation files (the "Software"), to deal
133
- * in the Software without restriction, including without limitation the rights
134
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
135
- * copies of the Software, and to permit persons to whom the Software is
136
- * furnished to do so, subject to the following conditions:
137
- *
138
- * The above copyright notice and this permission notice shall be included in all
139
- * copies or substantial portions of the Software.
140
- *
141
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
142
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
143
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
144
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
145
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
146
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
147
- * SOFTWARE.
148
- *
149
- *)
150
- */
1
+ "use strict";var St=Object.create;var W=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var Nt=Object.getOwnPropertyNames;var Wt=Object.getPrototypeOf,vt=Object.prototype.hasOwnProperty;var a=(r,t)=>W(r,"name",{value:t,configurable:!0});var Et=(r,t)=>{for(var i in t)W(r,i,{get:t[i],enumerable:!0})},R=(r,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of Nt(t))!vt.call(r,e)&&e!==i&&W(r,e,{get:()=>t[e],enumerable:!(o=At(t,e))||o.enumerable});return r};var b=(r,t,i)=>(i=r!=null?St(Wt(r)):{},R(t||!r||!r.__esModule?W(i,"default",{value:r,enumerable:!0}):i,r)),qt=r=>R(W({},"__esModule",{value:!0}),r);var Mt={};Et(Mt,{customLearnCard:()=>T,didWebLearnCardFromSeed:()=>z,didWebNetworkLearnCardFromSeed:()=>Q,emptyLearnCard:()=>j,initLearnCard:()=>It,learnCardFromApiUrl:()=>G,learnCardFromSeed:()=>O,networkLearnCardFromApiKey:()=>U,networkLearnCardFromSeed:()=>B});module.exports=qt(Mt);var X=require("@learncard/core");var T=a(async({debug:r}={})=>(0,X.generateLearnCard)({debug:r}),"customLearnCard");var Y=require("@learncard/core"),Z=require("@learncard/dynamic-loader-plugin"),$=require("@learncard/crypto-plugin"),_=require("@learncard/didkit-plugin"),rr=require("@learncard/expiration-plugin"),tr=require("@learncard/vc-templates-plugin"),ir=require("@learncard/chapi-plugin"),ar=require("@learncard/learn-card-plugin");var j=a(async({didkit:r,allowRemoteContexts:t=!1,debug:i}={})=>{let e=await(await(await(0,Y.generateLearnCard)({debug:i})).addPlugin(Z.DynamicLoaderPlugin)).addPlugin($.CryptoPlugin),n=a(async()=>r==="node"?(await import("@learncard/didkit-plugin-node")).getDidKitPlugin:_.getDidKitPlugin,"getDidkit"),d=await e.addPlugin(await(await n())(r==="node"?void 0:r,t)),u=await(await(await d.addPlugin((0,rr.expirationPlugin)(d))).addPlugin((0,tr.getVCTemplatesPlugin)())).addPlugin(await(0,ir.getCHAPIPlugin)());return u.addPlugin((0,ar.getLearnCardPlugin)(u))},"emptyLearnCard");var er=require("@learncard/core"),or=require("@learncard/dynamic-loader-plugin"),nr=require("@learncard/crypto-plugin"),dr=require("@learncard/didkit-plugin"),mr=require("@learncard/didkey-plugin"),cr=require("@learncard/encryption-plugin"),ur=require("@learncard/vc-plugin"),gr=require("@learncard/vc-templates-plugin"),pr=require("@learncard/learn-cloud-plugin"),lr=require("@learncard/expiration-plugin"),sr=require("@learncard/ethereum-plugin"),Pr=require("@learncard/vpqr-plugin"),Lr=require("@learncard/chapi-plugin"),fr=require("@learncard/learn-card-plugin"),wr=require("@learncard/openid4vc-plugin");var F={infuraProjectId:"",network:"mainnet"};var O=a(async({seed:r,cloud:{url:t="https://cloud.learncard.com/trpc",unencryptedFields:i=[],unencryptedCustomFields:o=[],automaticallyAssociateDids:e=!0}={},didkit:n,allowRemoteContexts:d=!1,ethereumConfig:c=F,openid4vc:f,debug:u})=>{let k=await(await(await(0,er.generateLearnCard)({debug:u})).addPlugin(or.DynamicLoaderPlugin)).addPlugin(nr.CryptoPlugin),w=a(async()=>n==="node"?(await import("@learncard/didkit-plugin-node")).getDidKitPlugin:dr.getDidKitPlugin,"getDidkit"),y=await k.addPlugin(await(await w())(n==="node"?void 0:n,d)),p=await y.addPlugin(await(0,mr.getDidKeyPlugin)(y,r,"key")),P=await p.addPlugin(await(0,cr.getEncryptionPlugin)(p)),C=await(await P.addPlugin((0,ur.getVCPlugin)(P))).addPlugin((0,gr.getVCTemplatesPlugin)()),g=await C.addPlugin(await(0,pr.getLearnCloudPlugin)(C,t,i,o,e)),m=await g.addPlugin((0,lr.expirationPlugin)(g)),l=await m.addPlugin((0,sr.getEthereumPlugin)(m,c)),K=await(await l.addPlugin((0,Pr.getVpqrPlugin)(l))).addPlugin(await(0,Lr.getCHAPIPlugin)()),L=await K.addPlugin((0,fr.getLearnCardPlugin)(K));return L.addPlugin((0,wr.getOpenID4VCPlugin)(L,f))},"learnCardFromSeed");var Cr=require("@learncard/core"),yr=require("@learncard/dynamic-loader-plugin"),Dr=require("@learncard/crypto-plugin"),kr=require("@learncard/didkit-plugin"),Vr=require("@learncard/didkey-plugin"),Fr=require("@learncard/encryption-plugin"),hr=require("@learncard/vc-plugin"),xr=require("@learncard/vc-templates-plugin"),Kr=require("@learncard/learn-cloud-plugin"),br=require("@learncard/expiration-plugin"),Sr=require("@learncard/ethereum-plugin"),Ar=require("@learncard/vpqr-plugin"),Nr=require("@learncard/chapi-plugin"),E=require("@learncard/network-plugin"),Wr=require("@learncard/learn-card-plugin"),vr=require("@learncard/openid4vc-plugin");var B=a(async({seed:r,network:t,trustedBoostRegistry:i="https://raw.githubusercontent.com/learningeconomy/registries/main/learncard/trusted-app-registry.json",guardianApprovalGetter:o,extraHeaders:e,cloud:{url:n="https://cloud.learncard.com/trpc",unencryptedFields:d=[],unencryptedCustomFields:c=[],automaticallyAssociateDids:f=!0}={},didkit:u,allowRemoteContexts:s=!1,ethereumConfig:k=F,openid4vc:w,debug:y})=>{let p=typeof t=="boolean"?"https://network.learncard.com/trpc":t,h=await(await(await(0,Cr.generateLearnCard)({debug:y})).addPlugin(yr.DynamicLoaderPlugin)).addPlugin(Dr.CryptoPlugin),C=a(async()=>u==="node"?(await import("@learncard/didkit-plugin-node")).getDidKitPlugin:kr.getDidKitPlugin,"getDidkit"),g=await h.addPlugin(await(await C())(u==="node"?void 0:u,s)),m=await g.addPlugin(await(0,Vr.getDidKeyPlugin)(g,r,"key")),l=await m.addPlugin(await(0,Fr.getEncryptionPlugin)(m)),K=await(await l.addPlugin((0,hr.getVCPlugin)(l))).addPlugin((0,xr.getVCTemplatesPlugin)()),L=await K.addPlugin(await(0,Kr.getLearnCloudPlugin)(K,n,d,c,f)),D=await L.addPlugin((0,br.expirationPlugin)(L)),V=await D.addPlugin((0,Sr.getEthereumPlugin)(D,k)),M=await(await V.addPlugin((0,Ar.getVpqrPlugin)(V))).addPlugin(await(0,Nr.getCHAPIPlugin)()),S=await M.addPlugin(await(0,E.getVerifyBoostPlugin)(M,i)),A=await S.addPlugin((0,Wr.getLearnCardPlugin)(S)),N=await A.addPlugin(await(0,E.getLearnCardNetworkPlugin)(A,p,{guardianApprovalGetter:o,extraHeaders:e}));return N.addPlugin((0,vr.getOpenID4VCPlugin)(N,w))},"networkLearnCardFromSeed");var Er=require("@learncard/core"),qr=require("@learncard/dynamic-loader-plugin"),Ir=require("@learncard/crypto-plugin"),Mr=require("@learncard/didkit-plugin"),Hr=require("@learncard/didkey-plugin"),Tr=require("@learncard/encryption-plugin"),jr=require("@learncard/vc-plugin"),Or=require("@learncard/vc-templates-plugin"),Br=require("@learncard/learn-cloud-plugin"),zr=require("@learncard/expiration-plugin"),Qr=require("@learncard/ethereum-plugin"),Ur=require("@learncard/vpqr-plugin"),Gr=require("@learncard/chapi-plugin"),Jr=require("@learncard/learn-card-plugin"),Rr=require("@learncard/did-web-plugin"),Xr=require("@learncard/openid4vc-plugin");var z=a(async({seed:r,didWeb:t,cloud:{url:i="https://cloud.learncard.com/trpc",unencryptedFields:o=[],unencryptedCustomFields:e=[],automaticallyAssociateDids:n=!0}={},didkit:d,allowRemoteContexts:c=!1,ethereumConfig:f=F,openid4vc:u,debug:s})=>{let w=await(await(await(0,Er.generateLearnCard)({debug:s})).addPlugin(qr.DynamicLoaderPlugin)).addPlugin(Ir.CryptoPlugin),y=a(async()=>d==="node"?(await import("@learncard/didkit-plugin-node")).getDidKitPlugin:Mr.getDidKitPlugin,"getDidkit"),p=await w.addPlugin(await(await y())(d==="node"?void 0:d,c)),P=await p.addPlugin(await(0,Hr.getDidKeyPlugin)(p,r,"key")),h=await P.addPlugin(await(0,Tr.getEncryptionPlugin)(P)),g=await(await h.addPlugin((0,jr.getVCPlugin)(h))).addPlugin((0,Or.getVCTemplatesPlugin)()),m=await g.addPlugin(await(0,Br.getLearnCloudPlugin)(g,i,o,e,n)),l=await m.addPlugin((0,zr.expirationPlugin)(m)),x=await l.addPlugin((0,Qr.getEthereumPlugin)(l,f)),L=await(await x.addPlugin((0,Ur.getVpqrPlugin)(x))).addPlugin(await(0,Gr.getCHAPIPlugin)()),D=await L.addPlugin((0,Jr.getLearnCardPlugin)(L)),V=await D.addPlugin(await(0,Rr.getDidWebPlugin)(D,t));return V.addPlugin((0,Xr.getOpenID4VCPlugin)(V,u))},"didWebLearnCardFromSeed");var Yr=require("@learncard/core"),Zr=require("@learncard/dynamic-loader-plugin"),$r=require("@learncard/crypto-plugin"),_r=require("@learncard/didkit-plugin"),rt=require("@learncard/didkey-plugin"),tt=require("@learncard/encryption-plugin"),it=require("@learncard/vc-plugin"),at=require("@learncard/vc-templates-plugin"),et=require("@learncard/learn-cloud-plugin"),ot=require("@learncard/expiration-plugin"),nt=require("@learncard/ethereum-plugin"),dt=require("@learncard/vpqr-plugin"),mt=require("@learncard/chapi-plugin"),q=require("@learncard/network-plugin"),ct=require("@learncard/learn-card-plugin"),ut=require("@learncard/did-web-plugin"),gt=require("@learncard/openid4vc-plugin");var Q=a(async({seed:r,didWeb:t,network:i,trustedBoostRegistry:o="https://raw.githubusercontent.com/learningeconomy/registries/main/learncard/trusted-app-registry.json",guardianApprovalGetter:e,extraHeaders:n,cloud:{url:d="https://cloud.learncard.com/trpc",unencryptedFields:c=[],unencryptedCustomFields:f=[],automaticallyAssociateDids:u=!0}={},didkit:s,allowRemoteContexts:k=!1,ethereumConfig:w=F,openid4vc:y,debug:p})=>{let P=typeof i=="boolean"?"https://network.learncard.com/trpc":i,C=await(await(await(0,Yr.generateLearnCard)({debug:p})).addPlugin(Zr.DynamicLoaderPlugin)).addPlugin($r.CryptoPlugin),g=a(async()=>s==="node"?(await import("@learncard/didkit-plugin-node")).getDidKitPlugin:_r.getDidKitPlugin,"getDidkit"),m=await C.addPlugin(await(await g())(s==="node"?void 0:s,k)),l=await m.addPlugin(await(0,rt.getDidKeyPlugin)(m,r,"key")),x=await l.addPlugin(await(0,tt.getEncryptionPlugin)(l)),L=await(await x.addPlugin((0,it.getVCPlugin)(x))).addPlugin((0,at.getVCTemplatesPlugin)()),D=await L.addPlugin(await(0,et.getLearnCloudPlugin)(L,d,c,f,u)),V=await D.addPlugin((0,ot.expirationPlugin)(D)),v=await V.addPlugin((0,nt.getEthereumPlugin)(V,w)),S=await(await v.addPlugin((0,dt.getVpqrPlugin)(v))).addPlugin(await(0,mt.getCHAPIPlugin)()),A=await S.addPlugin(await(0,q.getVerifyBoostPlugin)(S,o)),N=await A.addPlugin((0,ct.getLearnCardPlugin)(A)),H=await N.addPlugin(await(0,ut.getDidWebPlugin)(N,t)),J=await H.addPlugin(await(0,q.getLearnCardNetworkPlugin)(H,P,{guardianApprovalGetter:e,extraHeaders:n}));return J.addPlugin((0,gt.getOpenID4VCPlugin)(J,y))},"didWebNetworkLearnCardFromSeed");var pt=require("@learncard/core"),lt=require("@learncard/dynamic-loader-plugin"),st=require("@learncard/crypto-plugin"),Pt=require("@learncard/didkit-plugin"),Lt=require("@learncard/vc-plugin"),ft=require("@learncard/vc-templates-plugin"),wt=require("@learncard/expiration-plugin"),Ct=require("@learncard/vpqr-plugin"),yt=require("@learncard/chapi-plugin"),I=require("@learncard/network-plugin"),Dt=require("@learncard/learn-card-plugin");var U=a(async({apiKey:r,network:t,trustedBoostRegistry:i="https://raw.githubusercontent.com/learningeconomy/registries/main/learncard/trusted-app-registry.json",guardianApprovalGetter:o,extraHeaders:e,didkit:n,allowRemoteContexts:d=!1,debug:c})=>{let f=typeof t=="boolean"?"https://network.learncard.com/trpc":t,s=await(await(await(0,pt.generateLearnCard)({debug:c})).addPlugin(lt.DynamicLoaderPlugin)).addPlugin(st.CryptoPlugin),k=a(async()=>n==="node"?(await import("@learncard/didkit-plugin-node")).getDidKitPlugin:Pt.getDidKitPlugin,"getDidkit"),w=await s.addPlugin(await(await k())(n==="node"?void 0:n,d)),p=await(await w.addPlugin((0,Lt.getVCPlugin)(w))).addPlugin((0,ft.getVCTemplatesPlugin)()),P=await p.addPlugin((0,wt.expirationPlugin)(p)),C=await(await P.addPlugin((0,Ct.getVpqrPlugin)(P))).addPlugin(await(0,yt.getCHAPIPlugin)()),g=await C.addPlugin(await(0,I.getVerifyBoostPlugin)(C,i)),m=await g.addPlugin((0,Dt.getLearnCardPlugin)(g));return m.addPlugin(await(0,I.getLearnCardNetworkPlugin)(m,f,r,{guardianApprovalGetter:o,extraHeaders:e}))},"networkLearnCardFromApiKey");var kt=require("@learncard/core"),Vt=require("@learncard/crypto-plugin"),Ft=require("@learncard/vc-api-plugin"),ht=require("@learncard/expiration-plugin"),xt=require("@learncard/vc-templates-plugin"),Kt=require("@learncard/chapi-plugin"),bt=require("@learncard/learn-card-plugin");var G=a(async({url:r,did:t,debug:i})=>{let e=await(await(await(0,kt.generateLearnCard)({debug:i})).addPlugin(Vt.CryptoPlugin)).addPlugin(await(0,Ft.getVCAPIPlugin)({url:r,did:t})),c=await(await(await e.addPlugin((0,ht.expirationPlugin)(e))).addPlugin((0,xt.getVCTemplatesPlugin)())).addPlugin(await(0,Kt.getCHAPIPlugin)());return c.addPlugin((0,bt.getLearnCardPlugin)(c))},"learnCardFromApiUrl");async function It(r={}){if("custom"in r)return T({debug:r.debug});if("vcApi"in r){let{vcApi:t,did:i,debug:o}=r;return G({url:typeof t=="string"?t:"https://bridge.learncard.com",did:t===!0?"did:key:z6MkjSz4mYqcn7dePGuktJ5PxecMkXQQHWRg8Lm6okATyFVh":i,debug:o})}return"apiKey"in r?U(r):"seed"in r?"network"in r?"didWeb"in r?Q(r):B(r):"didWeb"in r?z(r):O(r):j(r)}a(It,"initLearnCard");
151
2
  //# sourceMappingURL=init.cjs.production.min.cjs.map